Преглед на файлове

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

Conflicts:
	patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java
yeshijie преди 7 години
родител
ревизия
c31e9cc727

+ 9 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionDiagnosis.java

@ -18,6 +18,7 @@ public class PrescriptionDiagnosis  extends IdEntity {
    private String code;
    private String prescriptionCode;
    private String name;
    private Integer type;//1主诊断 2次诊断
    private Date createTime;
    private Date updateTime;
@ -60,4 +61,12 @@ public class PrescriptionDiagnosis  extends IdEntity {
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
}

+ 2 - 7
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java

@ -1,15 +1,12 @@
package com.yihu.wlyy.service.controller;
import com.yihu.wlyy.service.common.model.Result;
import com.yihu.wlyy.service.entity.prescription.Prescription;
import com.yihu.wlyy.service.entity.prescription.PrescriptionPay;
import com.yihu.wlyy.service.service.prescription.PrescriptionCAService;
import com.yihu.wlyy.service.service.prescription.PrescriptionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -105,13 +102,11 @@ public class PrescriptionController extends BaseController{
	@RequestMapping(value = "getDictForI",method = RequestMethod.POST)
	@ApiOperation("字典获取接口")
	public Result getDictForI(@ApiParam(name="dictName",value="字典名称",defaultValue = "IV_PHYSIC_DICT")
							  @RequestParam(value = "dictName",required = true) String dictName,
							  @ApiParam(name="hospital",value="医院code",defaultValue = "3502050200")
							  @RequestParam(value = "hospital",required = true) String hospital)
							  @RequestParam(value = "dictName",required = true) String dictName)
	{
		try {
			String re = prescriptionService.getDictForI(dictName,hospital);
			String re = prescriptionService.getDictForI(dictName);
			return Result.success("字典获取接口成功!",re);
		} catch (Exception ex) {

+ 1 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZysoftBaseService.java

@ -227,6 +227,7 @@ public class ZysoftBaseService {
                throw new HttpApiException(Integer.valueOf(code),map.get("MESSAGE"));
            }
//            com.alibaba.fastjson.JSONObject j = com.alibaba.fastjson.JSONObject.parseObject(re);
            //保存http日志
            logService.saveHttpLog(isSuccess,api,content,method,msgHeader,msgBody,re,error);
        }

+ 3 - 4
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -313,15 +313,14 @@ public class PrescriptionService extends ZysoftBaseService{
    /**
     * 7.1字典获取接口
     * @param dictName 字典名称
     * @param hospital
     * @return
     * @throws Exception
     */
    public String getDictForI(String dictName,String hospital)  throws Exception
    public String getDictForI(String dictName)  throws Exception
    {
        String[] hospitalMapping = getHospitalMapping(hospital); //获取机构映射
        hospital = hospitalMapping[0];
        String[] hospitalMapping = getHospitalMapping(null); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDispensaryCodeDao.java

@ -24,6 +24,9 @@ public interface PrescriptionDispensaryCodeDao extends PagingAndSortingRepositor
    @Query("select count(1) from PrescriptionDispensaryCode a where a.code= ?1 and a.isUse =0")
    Integer getResidentQRCodeCount(String code);
    @Query("select a.code from PrescriptionDispensaryCode a where a.prescriptionCode= ?1 and a.type =?2 ")
    String getCodeByPrescriptionCodeAndType(String prescriptionCode,Integer type);
//    @Query("select p1 from PrescriptionInfo p1 left join Prescription p2 on p1.prescriptionCode=p2.code where p1.prescriptionCode = ?1")
//    List<PrescriptionInfo> getPrescriptionInfo(String prescriptionCode);
}

+ 15 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -10,6 +10,7 @@ import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDispensaryCodeDao;
import com.yihu.wlyy.repository.prescription.PrescriptionExpressageDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
@ -19,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Date;
@ -45,7 +47,10 @@ public class PrescriptionService extends BaseService {
    private PatientDao patientDao;
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
    @Value("${wechat.wechat_base_url}")
    private String wechat_base_url;
    @Autowired
    private PrescriptionDispensaryCodeDao prescriptionDispensaryCodeDao;
    /**
     *  获取处方信息
@ -68,7 +73,15 @@ public class PrescriptionService extends BaseService {
                //自取
                Patient patient = patientDao.findByCode(prescription.getPatient());
                try {
                    prescriptionNoticesService.sendMessages(patient.getCode(), patient.getName(), null, null, 2, 0, "");
                    String dispensaryCode = prescriptionDispensaryCodeDao.getCodeByPrescriptionCodeAndType(code,1);
                    StringBuffer url = new StringBuffer();
                    url.append(wechat_base_url);
                    url.append("wx/prescription/html/code-detail.html?dispensaryCode=").append(dispensaryCode);
                    url.append("&openid=").append(patient.getOpenid());
                    url.append("&toUser=").append(patient.getCode());
                    url.append("&toName=").append(patient.getName());
                    url.append("&represented=").append(patient.getCode());
                    prescriptionNoticesService.sendMessages(patient.getCode(), patient.getName(), null, null, 2, 0, url.toString());
                }catch (Exception e){
                    logger.info("微信模板发送失败,续方code"+code);
                }

+ 1 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -1,12 +1,6 @@
package com.yihu.wlyy.service.third.jw;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionPay;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.repository.prescription.PrescriptionPayDao;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
@ -32,15 +26,13 @@ public class JwPrescriptionService {
    /**
     * 获取字典列表
     * @param dictName 字典名称
     * @param hospital 药品code
     * @return
     * @throws Exception
     */
    public String getDictForI(String dictName,String hospital) throws Exception{
    public String getDictForI(String dictName) throws Exception{
        String url = jwUrl + "/third/prescription/getDictForI";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");