Browse Source

门诊快递物流功能接口

LiTaohong 6 years ago
parent
commit
740c19be6d

+ 14 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java

@ -1,10 +1,13 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
@ -14,4 +17,15 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    @Query("select a from WlyyPrescriptionDO a where a.patientCode = ?1 and a.status >= 0 ")
    List<WlyyPrescriptionDO> findByPatientCode(String patientCode);
    @Modifying
    @Query("update WlyyPrescriptionDO p set p.status=?2 where p.id=?1")
    void updateStatus(String id,Integer status);
    @Modifying
    @Query("update WlyyPrescriptionDO p set p.status=?2 ,p.finishTime =?3 where p.id=?1")
    void updateStatus(String id, Integer status, Date date);
    @Query("from WlyyPrescriptionDO p where p.visitNo=?1 and p.recipeNo=?2 ")
    WlyyPrescriptionDO findByVisitNoAndRecipeNo(String visitNo,String recipeNo);
}

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionExpressageDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
@ -12,4 +13,7 @@ import java.util.List;
public interface PrescriptionExpressageDao extends PagingAndSortingRepository<WlyyPrescriptionExpressageDO, String>, JpaSpecificationExecutor<WlyyPrescriptionExpressageDO> {
    List<WlyyPrescriptionExpressageDO> findByPrescriptionId(String prescriptionId);
    @Query("from WlyyPrescriptionExpressageDO p where p.mailno=?1")
    WlyyPrescriptionExpressageDO findByPrescriptionExpressMailno(String mailno);
}

+ 5 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionExpressageLogDao.java

@ -4,8 +4,13 @@ import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2019/5/17.
 */
public interface PrescriptionExpressageLogDao extends PagingAndSortingRepository<WlyyPrescriptionExpressageLogDO, String>, JpaSpecificationExecutor<WlyyPrescriptionExpressageLogDO> {
    List<WlyyPrescriptionExpressageLogDO> queryByOutpatientId(String outpatientId);
}

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionInfoDao.java

@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import java.util.Set;
/**
 * Created by Trick on 2019/5/17.
@ -15,4 +16,5 @@ public interface PrescriptionInfoDao extends PagingAndSortingRepository<WlyyPres
    List<WlyyPrescriptionInfoDO> findByPrescriptionId(String prescriptionId);
    List<WlyyPrescriptionInfoDO> queryAllByPrescriptionIdInAndDel(Set ids,Integer del);
}

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionInfoLogDao.java

@ -7,5 +7,5 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2019/5/17.
 */
public interface PrescriptionInfoLogDao extends PagingAndSortingRepository<WlyyPrescriptionLogDO, String>, JpaSpecificationExecutor<WlyyPrescriptionLogDO> {
public interface PrescriptionLogDao extends PagingAndSortingRepository<WlyyPrescriptionLogDO, String>, JpaSpecificationExecutor<WlyyPrescriptionLogDO> {
}

+ 16 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgDO.java

@ -105,6 +105,12 @@ public class BaseOrgDO extends UuidIdentityEntityWithOperator {
	 */
	private String photo;
   /**
	 * 机构联系电话
	 */
	private String mobile;
    /**
	 * 经度
	 */
@ -303,7 +309,16 @@ public class BaseOrgDO extends UuidIdentityEntityWithOperator {
        this.photo = photo;
    }
	@Column(name = "longitude")
    @Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    @Column(name = "longitude")
    public String getLongitude() {
        return longitude;
    }

+ 9 - 8
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionExpressageDO.java

@ -25,9 +25,9 @@ public class WlyyPrescriptionExpressageDO extends UuidIdentityEntity {
	private String saasId;
    /**
	 * 关联wlyy_wlyy_prescription id
	 * 关联wlyy_outpatient id
	 */
	private String prescriptionId;
	private String outpatientId;
    /**
	 * 快递单号
@ -151,15 +151,16 @@ public class WlyyPrescriptionExpressageDO extends UuidIdentityEntity {
        this.saasId = saasId;
    }
	@Column(name = "prescription_id")
    public String getPrescriptionId() {
        return prescriptionId;
    @Column(name = "outpatient_id")
    public String getOutpatientId() {
        return outpatientId;
    }
    public void setPrescriptionId(String prescriptionId) {
        this.prescriptionId = prescriptionId;
    public void setOutpatientId(String outpatientId) {
        this.outpatientId = outpatientId;
    }
	@Column(name = "mailno")
    @Column(name = "mailno")
    public String getMailno() {
        return mailno;
    }

+ 9 - 7
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionExpressageLogDO.java

@ -25,9 +25,9 @@ public class WlyyPrescriptionExpressageLogDO extends UuidIdentityEntity {
	private String saasId;
    /**
	 * 关联表wlyy_prescription id
	 * 关联表wlyy_ouapatient id
	 */
	private String prescriptionId;
	private String outpatientId;
    /**
	 * 关联wlyy_prescription_expressage id
@ -141,12 +141,14 @@ public class WlyyPrescriptionExpressageLogDO extends UuidIdentityEntity {
        this.saasId = saasId;
    }
	@Column(name = "prescription_id")
    public String getPrescriptionId() {
        return prescriptionId;
    @Column(name = "outpatient_id")
    public String getOutpatientId() {
        return outpatientId;
    }
    public void setPrescriptionId(String prescriptionId) {
        this.prescriptionId = prescriptionId;
    public void setOutpatientId(String outpatientId) {
        this.outpatientId = outpatientId;
    }
	@Column(name = "expressage_id")

+ 9 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -103,4 +103,13 @@ public class BaseHospitalRequestMapping {
        //医生下诊断
        public static final String diagnose ="/diagnose";
    }
    /**
     * 门诊处方物流
     */
    public static class Expressage extends Basic {
        public static final String PREFIX  = "/expressage";
    }
}

+ 99 - 0
common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientKit.java

@ -1,9 +1,23 @@
package com.yihu.jw.util.http;
import javafx.util.Pair;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -152,4 +166,89 @@ public class HttpClientKit {
        }
    }
    /**
     * 发送post请求
     *
     * @param url     请求地址
     * @param params  请求参数
     * @param chatSet 编码格式
     * @return
     */
    public  static String post(String url, List<NameValuePair> params, String chatSet) {
        // 创建默认的httpClient实例.
        CloseableHttpClient httpclient = HttpClients.createDefault();
        // 创建httppost
        HttpPost httppost = new HttpPost(url);
        UrlEncodedFormEntity uefEntity;
        try {
            uefEntity = new UrlEncodedFormEntity(params, chatSet);
            httppost.setEntity(uefEntity);
            CloseableHttpResponse response = httpclient.execute(httppost);
            try {
                HttpEntity entity = response.getEntity();
                if (entity != null) {
                    return EntityUtils.toString(entity, chatSet);
                }
            } finally {
                response.close();
            }
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (UnsupportedEncodingException e1) {
            e1.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            // 关闭连接,释放资源
            try {
                httpclient.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return null;
    }
    /**
     * 发送get请求
     *
     * @param url     请求地址
     * @param chatSet 编码格式
     * @return
     */
    public  String get(String url, String chatSet) {
        CloseableHttpClient httpclient = HttpClients.createDefault();
        try {
            // 创建httpget.
            HttpGet httpget = new HttpGet(url);
            // 执行get请求.
            CloseableHttpResponse response = httpclient.execute(httpget);
            try {
                // 获取响应实体
                HttpEntity entity = response.getEntity();
                if (entity != null) {
                    return EntityUtils.toString(entity, chatSet);
                }
            } finally {
                response.close();
            }
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (ParseException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            // 关闭连接,释放资源
            try {
                httpclient.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return null;
    }
}