Sfoglia il codice sorgente

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

chenweida 7 anni fa
parent
commit
a1da063c50
14 ha cambiato i file con 349 aggiunte e 54 eliminazioni
  1. 88 0
      common/common-entity/src/main/java/com/yihu/mm/entity/patient/Report.java
  2. 42 0
      common/common-entity/src/main/java/com/yihu/mm/entity/patient/ReportDetail.java
  3. 9 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressage.java
  4. 43 11
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/controller/medicine/PhysicalExaminationController.java
  5. 32 0
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/PhysicalExaminationService.java
  6. 6 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionCAService.java
  7. 14 14
      patient-co-service/wlyy_service/src/main/resources/system.properties
  8. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  9. 41 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java
  10. 22 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  11. 8 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/pc/prescription/PrescriptionExpressagePCService.java
  12. 12 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java
  13. 20 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java
  14. 10 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

+ 88 - 0
common/common-entity/src/main/java/com/yihu/mm/entity/patient/Report.java

@ -0,0 +1,88 @@
package com.yihu.mm.entity.patient;
/**
 * 非数据库字段,用于越人接口返回转换
 */
public class Report {
    private String cc_id;//咨询结论编号
    private String ct_id;//咨询编号
    private String cl_id;//结论编号
    private String cc_last;//最终结论
    private String cl_template;//显示模板
    private String cl_type;//分类
    private String cl_sort;//结论排序权重
    private String cl_condition;
    public String getCc_id() {
        return cc_id;
    }
    public void setCc_id(String cc_id) {
        this.cc_id = cc_id;
    }
    public String getCt_id() {
        return ct_id;
    }
    public void setCt_id(String ct_id) {
        this.ct_id = ct_id;
    }
    public String getCl_id() {
        return cl_id;
    }
    public void setCl_id(String cl_id) {
        this.cl_id = cl_id;
    }
    public String getCc_last() {
        return cc_last;
    }
    public void setCc_last(String cc_last) {
        this.cc_last = cc_last;
    }
    public String getCl_template() {
        return cl_template;
    }
    public void setCl_template(String cl_template) {
        this.cl_template = cl_template;
    }
    public String getCl_type() {
        return cl_type;
    }
    public void setCl_type(String cl_type) {
        this.cl_type = cl_type;
    }
    public String getCl_sort() {
        return cl_sort;
    }
    public void setCl_sort(String cl_sort) {
        this.cl_sort = cl_sort;
    }
    public String getCl_condition() {
        return cl_condition;
    }
    public void setCl_condition(String cl_condition) {
        this.cl_condition = cl_condition;
    }
}

+ 42 - 0
common/common-entity/src/main/java/com/yihu/mm/entity/patient/ReportDetail.java

@ -0,0 +1,42 @@
package com.yihu.mm.entity.patient;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 非数据库字段,用于越人接口返回数据的转换
 */
public class ReportDetail {
    private List<Map<String,Object>> conclusion = new ArrayList<>();
    private List<Map<String,Object>> nature = new ArrayList<>();
    private Map<String,Object> userinfo = new HashMap<>();
    public List<Map<String, Object>> getConclusion() {
        return conclusion;
    }
    public void setConclusion(List<Map<String, Object>> conclusion) {
        this.conclusion = conclusion;
    }
    public List<Map<String, Object>> getNature() {
        return nature;
    }
    public void setNature(List<Map<String, Object>> nature) {
        this.nature = nature;
    }
    public Map<String, Object> getUserinfo() {
        return userinfo;
    }
    public void setUserinfo(Map<String, Object> userinfo) {
        this.userinfo = userinfo;
    }
}

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

@ -47,6 +47,7 @@ public class PrescriptionExpressage extends IdEntity{
    private String hospitalCode;            // 配药机构code
    private String hospitalDoctor;          // 配药机构出药人(健管师或者称工作人员)
    private String hospitalDoctorCode;     // 配药机构出药人code
    private Date fetchingMedicineTime;    //配药机构出药时间
    //配送人信息
    private String expressageHospitalName;            // 如果配送方式是健管师那么这个字段存服务站名称,如果是快递配送那么是快递公司名称
@ -406,4 +407,12 @@ public class PrescriptionExpressage extends IdEntity{
    public void setHospitalDoctorCode(String hospitalDoctorCode) {
        this.hospitalDoctorCode = hospitalDoctorCode;
    }
    public Date getFetchingMedicineTime() {
        return fetchingMedicineTime;
    }
    public void setFetchingMedicineTime(Date fetchingMedicineTime) {
        this.fetchingMedicineTime = fetchingMedicineTime;
    }
}

+ 43 - 11
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/controller/medicine/PhysicalExaminationController.java

@ -1,24 +1,30 @@
package com.yihu.mm.controller.medicine;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.mm.controller.BaseController;
import com.yihu.mm.entity.patient.ExamReport;
import com.yihu.mm.entity.patient.PatientExam;
import com.yihu.mm.entity.patient.Report;
import com.yihu.mm.entity.patient.ReportDetail;
import com.yihu.mm.entity.questionnaire.MedicineAnswerLog;
import com.yihu.mm.service.*;
import com.yihu.mm.util.JSONUtil;
import com.yihu.wlyy.entity.patient.Patient;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "/medicine/physicalExamination")
@ -134,13 +140,24 @@ public class PhysicalExaminationController extends BaseController {
    }
    @ApiOperation(value = "四诊资料采集")
    @RequestMapping(value = "/dillphoneimgdata",produces="application/json;charset=UTF-8")
    @RequestMapping(value = "/dillphoneimgdata", method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    @ResponseBody
    public String dillphoneimgdata(@ApiParam(name = "at_id", value = "文件id", required = true)@RequestParam(required = true, name = "at_id") String at_id,
                             @ApiParam(name = "answer", value = "问题答案,文件名称", required = true)@RequestParam(required = true, name = "answer") String answer,
    public String dillphoneimgdata(@RequestParam MultipartFile file,
                              @ApiParam(name = "type", value = "1.脸型  2.舌像  3.声音", required = true)@RequestParam(required = true, name = "type") String type,
                             @ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = true, name = "ct_id") String ct_id){
        String result = physicalExaminationService.dillphoneimgdata(at_id, answer, type, ct_id);
        String uploadAttachment = physicalExaminationService.uploadAttachment(file);
        String at_id = null;
        String at_realname=null;
        JSONObject uploadResult = new JSONObject(uploadAttachment);
        String status = uploadResult.get("status").toString();
        if("200".equals(status)){
            JSONObject recordset = uploadResult.getJSONObject("recordset");
            at_id =  recordset.get("at_id").toString();
            at_realname = (String) recordset.get("at_realname");
        }else{
            return write(500,"提交失败","exception",uploadResult.get("status").toString());
        }
        String result = physicalExaminationService.dillphoneimgdata(at_id, at_realname, type, ct_id);
        return result;
    }
@ -150,11 +167,26 @@ public class PhysicalExaminationController extends BaseController {
    public String showDetail(@ApiParam(name = "patientCode", value = "居民code", required = false)@RequestParam(required = true, name = "patientCode") String patientCode,
            @ApiParam(name = "ct_id", value = "咨询编号", required = false)@RequestParam(required = false, name = "ct_id") String ct_id){
        ExamReport examReport = examReportService.showDetail(patientCode, ct_id);
        Map<String,Object> respon = new HashMap<String,Object>();
        if(null!=examReport){
            String report = examReport.getReport();
            String reportDetail = examReport.getReportDetail();
            List<Report> reports = null;
            ReportDetail reportDetail1 = null;
            ObjectMapper objm = new ObjectMapper();
            JavaType javaType = objm.getTypeFactory().constructParametricType(List.class, Report.class);
            try {
                reports=(List<Report>)objm.readValue(report,javaType);
                reportDetail1 = (ReportDetail) JSONUtil.JSONToObj(reportDetail, ReportDetail.class);
            } catch (Exception e) {
                e.printStackTrace();
            }
            respon.put("report",reports);
            respon.put("reportDetail",reportDetail1);
            return write(200,"查询成功","recordset",respon);
        }
        return write(200,"查询成功","recordset",examReport);
        return write(-200,"未查询到数据");
    }
}

+ 32 - 0
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/PhysicalExaminationService.java

@ -7,8 +7,15 @@ import com.yihu.wlyy.entity.patient.Patient;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.FileSystemResource;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -172,4 +179,29 @@ public class PhysicalExaminationService {
        return examReport;
    }
    //查找试卷
    public String uploadAttachment(MultipartFile file) {
        MultiValueMap<String, Object> param = new LinkedMultiValueMap<>();
        String fileName = file.getOriginalFilename();
        String filePath =Class.class.getClass().getResource("/").getPath() + "temp/" + System.currentTimeMillis() + fileName;
        File dest = new File(filePath);
        if (!dest.getParentFile().exists()) {
            dest.getParentFile().mkdirs();
        }
        try {
            file.transferTo(dest);
            RestTemplate rest = new RestTemplate();
            FileSystemResource resource = new FileSystemResource(filePath);
            param.add("file", resource);
            String postStr = rest.postForObject(yuerenApi+"/uploadattachment" , param, String.class);
            if (dest.exists() && dest.isFile()) {
                dest.delete();
            }
            return postStr;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "{\"status\":500,\"exception\":\"上传文件出错\"}";
    }
}

+ 6 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionCAService.java

@ -77,7 +77,6 @@ public class PrescriptionCAService {
        Map<String,String> p = new HashMap<>();
        p.put("msgHeader",msgHeader);
        p.put("msgBody",msgBody);
        return WebserviceUtil.post(urlString,namespace,unifiedCallInterface,p);
    }
@ -233,6 +232,7 @@ public class PrescriptionCAService {
        String re = "";
        String body = "";
        String error = "";
        Throwable errorLog =null;
        String action = MODIFY_PASSWD;
        try {
            Map<String,String> params = new HashMap<>();
@ -259,6 +259,7 @@ public class PrescriptionCAService {
            isSuccess = false;
            ex.printStackTrace();
            error = ex.getMessage();
            errorLog = ex.getCause();
        }
        //保存http日志
@ -268,6 +269,10 @@ public class PrescriptionCAService {
        {
            throw new Exception(error);
        }
        if(errorLog!=null)
        {
            throw new Exception("CA服务器维护中。。。");
        }
        return re;
    }

+ 14 - 14
patient-co-service/wlyy_service/src/main/resources/system.properties

@ -1,18 +1,18 @@
###基卫测试环境服务
#gateway_url = http://117.25.173.18:18280/
#gateway_licence = 5YGl5bq45LmL7Lev
#gateway_public_key = PublicKeyTest.key
#jw_hospital = 350211B1013
#jw_licence = 5YGl5bq45LmL7Lev
##基卫服务
guahao_url =  http://10.95.18.10/urp.service/urp.open.service/ReservationPulic.asmx
guahao_namespace = http://www.zysoft.com.cn/
gateway_url = http://10.95.21.21:18280/
gateway_url = http://117.25.173.18:18280/
gateway_licence = 5YGl5bq45LmL7Lev
gateway_public_key = PublicGov.key
jw_hospital = 350211B1004
jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=
gateway_public_key = PublicKeyTest.key
jw_hospital = 350211B1013
jw_licence = 5YGl5bq45LmL7Lev
ca_url = http://117.29.183.114:8081/XMCAService?wsdl
ca_namespace = http://platfomservice.xmca.com/
ca_namespace = http://platfomservice.xmca.com/
##基卫服务
#guahao_url =  http://10.95.18.10/urp.service/urp.open.service/ReservationPulic.asmx
#guahao_namespace = http://www.zysoft.com.cn/
#gateway_url = http://10.95.21.21:18280/
#gateway_licence = 5YGl5bq45LmL7Lev
#gateway_public_key = PublicGov.key
#jw_hospital = 350211B1004
#jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -1113,6 +1113,8 @@ public class ConsultTeamService extends ConsultService {
            prescription.setJwDoctorCode(map.get("jw_doctor").toString());
            prescription.setJwHospital(map.get("jw_doctor_hospital").toString());
        }
        //设置费别类型
        prescription.setJwRateTypeCode(zyDictService.getRateType());
        prescriptionDao.save(prescription);

+ 41 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java

@ -1,14 +1,9 @@
package com.yihu.wlyy.service.app.prescription;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionDispensaryCode;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDispensaryCodeDao;
import com.yihu.wlyy.repository.prescription.PrescriptionInfoDao;
import com.yihu.wlyy.repository.prescription.*;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.QrcodeUtil;
@ -44,6 +39,10 @@ public class PrescriptionDispensaryCodeService extends BaseService {
    private PrescriptionDao prescriptionDao;
    @Autowired
    private MessageDao messageDao;
    @Autowired
    private PrescriptionLogDao prescriptionLogDao;
    @Autowired
    private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
    private static Object obj = new Object();
    private static Object obj2 = new Object();
@ -241,12 +240,47 @@ public class PrescriptionDispensaryCodeService extends BaseService {
            prescriptionDispensaryCode.setIsUse(1);
            prescriptionDispensaryCodeDao.save(prescriptionDispensaryCode);
            //新增log表
//            PrescriptionLog log = new PrescriptionLog();
            Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
            if(prescriptionDispensaryCode.getType()==1){
                prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
//                log.setRemark("配送到患者手中/已完成");
//                log.setType(PrescriptionLog.PrescriptionLogType.finish.getValue());
//                log.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
            }else if(prescription.getDispensaryType()==2){
                prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
//                log.setRemark("配送中");
//                log.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
//                log.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
            }else{
                prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
//                log.setRemark("配送到服务站");
//                log.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
//                log.setStatus(PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
            }
            if(prescription.getDispensaryType()==3){
                //健管师配送
                //修改系统的续方消息的审核状态
                messageDao.updatePreScriptionMessage(prescription.getCode(), "1", 7);
//                log.setUserType(2);
            }
//            else{
//                log.setUserType(1);
//            }
//            log.setPrescriptionCode(prescription.getCode());
//            log.setCode(getCode());
//            log.setCreateTime(new Date());
//            log.setHospital(prescription.getHospital());
//            log.setHospitalName(prescription.getHospitalName());
//            log.setUserName(prescription.getDoctorName());
//            log.setFlag(1);
//            log.setUserCode(prescription.getDoctor());
//            prescriptionLogDao.save(log);
        }else{
            throw new Exception("二维码输入错误或者已过期!");
        }

+ 22 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -190,7 +190,7 @@ public class PrescriptionInfoService extends BaseService {
                params.add(patient);
                //查询已经审核通过的,否则查询所有
                if ("2".equals(type)) {
                    sqlBuffer.append(" AND p.status >=10 ");
                    sqlBuffer.append(" AND p.status >="+PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
                }
                if (StringUtils.isNotBlank(startDate)) {
                    sqlBuffer.append(" AND p.create_time >= ?");
@ -211,6 +211,13 @@ public class PrescriptionInfoService extends BaseService {
                    String code = (String) map.get("code");
                    map.put("patient", p.getCode());
                    map.put("patientName", p.getName());
                    StringBuffer isAdjustSql = new StringBuffer("SELECT a.id FROM wlyy_prescription_adjust a WHERE a.prescription_code = ? ");
                    List<Map<String,Object>> adjusts = jdbcTemplate.queryForList(isAdjustSql.toString(),new Object[]{code});
                    if(adjusts!=null&&adjusts.size()>0){
                        map.put("isAdjust", "1");
                    }else{
                        map.put("isAdjust", "0");
                    }
                    map.put("prescriptionInfo", prescriptionDiagnosisService.getPrescriptionInfo(code));
                    map.put("prescriptionDt", prescriptionDiagnosisService.getPrescriptionDiagnosis(code));
                }
@ -307,8 +314,8 @@ public class PrescriptionInfoService extends BaseService {
        }
        if (prescription != null && prescription.getStatus() == PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue()) {
            Long s = (prescription.getCreateTime().getTime() - new Date().getTime()) / 1000;
        if (prescription!=null&&reviewed != null && prescription.getStatus() == PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue()&&reviewed.getReviewedTime()!=null) {
            Long s = (new Date().getTime()-reviewed.getReviewedTime().getTime()) / 1000;
            //rs.put("time",s);
            if (s > 172800) {
                prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.pay_outtime.getValue());
@ -523,14 +530,14 @@ public class PrescriptionInfoService extends BaseService {
                p.setReviewedTime(new Date());
                p.setJwDeptCode(dept);
                p.setJwRegisterFee(registerFee);
                p.setJwRateTypeCode(rateTypeCode);
                p.setJwGisterTypeCode(rateTypeCode);//挂号类型
            } else {
                //审核不通过
                p.setStatus(PrescriptionLog.PrescriptionLogStatus.no_reviewed.getValue());
                p.setReviewedTime(new Date());
                reviewed.setReason(reason);
                reviewed.setReviewedTime(new Date());
                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.del.getValue());
                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.reviewed_fail.getValue());
                //修改系统的续方消息的审核状态
                messageDao.updatePreScriptionMessage(p.getConsult(), "2", 6);
@ -821,10 +828,10 @@ public class PrescriptionInfoService extends BaseService {
        List<Map<String, Object>> states = new ArrayList<>();
        Map<String, Object> map0 = new HashMap<>();
        map0.put("name", "续方申请通过");
        map0.put("code", PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
        states.add(map0);
//        Map<String, Object> map0 = new HashMap<>();
//        map0.put("name", "续方申请通过");
//        map0.put("code", PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
//        states.add(map0);
        Map<String, Object> map1 = new HashMap<>();
        map1.put("name", "订单已支付");
@ -1162,4 +1169,10 @@ public class PrescriptionInfoService extends BaseService {
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql.toString());
        return new JSONArray(rs);
    }
    public JSONArray getPhysicMinDose(String code) {
        StringBuffer sql = new StringBuffer("SELECT t.min_dose AS minDose,t.physicCode FROM zy_iv_physic_dict t WHERE t.physic_code = ?");
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql.toString());
        return new JSONArray(rs);
    }
}

+ 8 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/pc/prescription/PrescriptionExpressagePCService.java

@ -60,8 +60,8 @@ public class PrescriptionExpressagePCService extends BaseService {
    public JSONObject getMedicine(String code,String userCode) throws Exception{
        JSONObject jsonObject = new JSONObject();
        Doctor doctor = doctorService.findDoctorByCode(userCode);
        String sql = "select a.type,a.prescription_code as prescriptionCode ,c.status,b.hospital_code as hospitalCode, \n" +
                "b.code as orderCode, b.hospital_name as hospitalName,c.dispensary_type as dispensaryType, \n" +
        String sql = "select a.type,a.prescription_code as prescriptionCode ,c.status,b.hospital_code as hospitalCode, b.hospital_doctor as hospitalDoctor,\n" +
                "b.code as orderCode, b.hospital_name as hospitalName,c.dispensary_type as dispensaryType,b.fetching_medicine_time as fetchingMedicineTime ,\n" +
                "b.expressage_name as expressageName, b.expressage_code as expressageCode,b.expressage_mobile as expressageMobile,d.idcard \n" +
                "from wlyy_prescription_dispensary_code a \n" +
                "left join wlyy_prescription_expressage b on a.prescription_code = b.prescription_code \n" +
@ -95,6 +95,8 @@ public class PrescriptionExpressagePCService extends BaseService {
                            jsonObject.put("dispensaryType",result.get("dispensaryType"));
                            jsonObject.put("expressageName",result.get("expressageName"));
                            jsonObject.put("expressageMobile",result.get("expressageMobile"));
                            jsonObject.put("fetchingMedicineTime",result.get("fetchingMedicineTime"));
                            jsonObject.put("hospitalDoctor",result.get("hospitalDoctor"));
//                            return jsonObject;
                        }else{
                            List<PrescriptionInfo> list = prescriptionInfoDao.findByPrescriptionCode(result.get("prescriptionCode").toString());
@ -116,7 +118,7 @@ public class PrescriptionExpressagePCService extends BaseService {
                    case 2:{
                        //判断出药机构是否与健管师所属机构一致,不一致弹窗提示:“出药机构与您所在机构不一致,无法出药,请重新确认”。一致则进入下一步。
                        if(doctor.getHospital().equals(result.get("hospitalCode").toString())){
                        if(doctor.getHospital().equals(result.get("hospitalCode")!=null?result.get("hospitalCode").toString():"")){
                            //20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 , 40配药成功/待配送  41配送失败 42分配健管师 45配送中   49配送到服务站  100配送到患者手中/已完成
                            if(status==50){
                                jsonObject.put("flag",-5);//订单正在配药中,暂时无法出药
@ -168,7 +170,7 @@ public class PrescriptionExpressagePCService extends BaseService {
                }
            }else{
                jsonObject.put("status",-3);
                //保存验证二维码的日志
                PrescriptionLog prescriptionLog = new PrescriptionLog();
                prescriptionLog.setCode(UUID.randomUUID().toString());
@ -180,6 +182,7 @@ public class PrescriptionExpressagePCService extends BaseService {
                prescriptionLog.setUserType(2);
                prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
                prescriptionLog.setRemark("PC端取药码输入错误!");
                prescriptionLogDao.save(prescriptionLog);
            }
            return jsonObject;
@ -243,6 +246,7 @@ public class PrescriptionExpressagePCService extends BaseService {
        Doctor doctor = doctorDao.findByCode(userCode);
        prescriptionExpressage.setHospitalDoctorCode(userCode);
        prescriptionExpressage.setHospitalDoctor(doctor.getName());
        prescriptionExpressage.setFetchingMedicineTime(new Date());
        prescriptionExpressageDao.save(prescriptionExpressage);
    }
}

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

@ -123,14 +123,19 @@ public class JwPrescriptionService {
     * @return
     * @throws Exception
     */
    public String saveRecipe(String prescriptionCode) throws Exception{
        String url = jwUrl + "/third/prescription/saveRecipe";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
        String response = httpClientUtil.post(url, params, "UTF-8");
    public String saveRecipe(String prescriptionCode){
        String response = null;
        try {
            String url = jwUrl + "/third/prescription/saveRecipe";
            List<NameValuePair> params = new ArrayList<>();
            params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
        return response;
            response = httpClientUtil.post(url, params, "UTF-8");
            return response;
        }catch (Exception e){
            logger.info("处方开方接口saveRecipe:"+response);
            throw e;
        }
    }
    /**

+ 20 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java

@ -65,6 +65,26 @@ public class ZyDictService {
        return doctorMappingDao.getDoctorByJw(jwHospital,jwDoctor);
    }
    /**
     * 获取费别类型,长处方默认市医保
     * @return
     */
    public String getRateType(){
        String sql = "SELECT code,name from zy_common_dict WHERE dict_name = 'IV_RATE_TYPE_DICT' ORDER BY code ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list!=null&&list.size()>0){
            for (Map<String,Object> map:list){
                String code = map.get("code").toString();
                String name = map.get("name").toString();
                if("市医保".equals(name)){
                    return code;
                }
            }
            return list.get(0).get("code").toString();
        }
        return null;
    }
    /**
     * 根据医生code获取
     * @param doctor

+ 10 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -453,5 +453,14 @@ public class PrescriptionInfoController extends BaseController {
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPhysicMinDose", method = RequestMethod.GET)
    @ApiOperation(value = "获取药品最小用量")
    public String getPhysicMinDose(String code) {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getPhysicMinDose(code));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}