Browse Source

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

wujunjie 7 years ago
parent
commit
6db4c641af

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

@ -946,6 +946,12 @@ public class ConsultTeamService extends ConsultService {
            if(signFamily==null){
                return -2;
            }
            String checkPre = prescriptionInfoService.checkPre(patient,DateUtil.getStringDateShort()+" 00:00:00");
            if("0".equals(checkPre)){//存在未结算的续方
                return -3;
            }
            Doctor doctor = doctorDao.findByCode(doctorCode);
            // 查询患者信息
            Patient p = patientDao.findByCode(patient);

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

@ -259,11 +259,12 @@ public class PrescriptionDispensaryCodeService extends BaseService {
            throw new Exception("编码已使用!");
        } else if (status == -3) {
            throw new Exception("编码类型错误!");
        } else if (status == -4) {
            throw new Exception("未到达服务站!");
        } else if (status == -5) {
            throw new Exception("不可配送!");
        }
//        else if (status == -4) {
//            throw new Exception("未到达服务站!");
//        } else if (status == -5) {
//            throw new Exception("不可配送!");
//        }
        return prescriptionDispensaryCode;
    }

+ 29 - 29
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java

@ -171,20 +171,20 @@ public class PrescriptionExpressageService {
        //修改处方状态为完成
        Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
        if(prescription.getStatus()<=65){
            PrescriptionLog prescriptionLog = new PrescriptionLog();
            prescriptionLog.setCode(UUID.randomUUID().toString());
            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
            prescriptionLog.setCreateTime(new Date());
            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
            prescriptionLog.setFlag(1);
            prescriptionLog.setUserCode(userCode);
            prescriptionLog.setUserType(2);
            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
            prescriptionLog.setRemark("该状态不可取药");
            prescriptionLogDao.save(prescriptionLog);
            return -4;
        }
//        if(prescription.getStatus()<=65){
//            PrescriptionLog prescriptionLog = new PrescriptionLog();
//            prescriptionLog.setCode(UUID.randomUUID().toString());
//            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
//            prescriptionLog.setCreateTime(new Date());
//            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
//            prescriptionLog.setFlag(1);
//            prescriptionLog.setUserCode(userCode);
//            prescriptionLog.setUserType(2);
//            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
//            prescriptionLog.setRemark("该状态不可取药");
//            prescriptionLogDao.save(prescriptionLog);
//            return -4;
//        }
        Date finshTime = new Date();
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        prescription.setFinishTime(finshTime);
@ -226,20 +226,20 @@ public class PrescriptionExpressageService {
        Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
        if(prescription.getStatus()<=50){
            PrescriptionLog prescriptionLog = new PrescriptionLog();
            prescriptionLog.setCode(UUID.randomUUID().toString());
            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
            prescriptionLog.setCreateTime(new Date());
            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
            prescriptionLog.setFlag(1);
            prescriptionLog.setUserCode(userCode);
            prescriptionLog.setUserType(2);
            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
            prescriptionLog.setRemark("该状态不可配送");
            prescriptionLogDao.save(prescriptionLog);
            return -5;
        }
//        if(prescription.getStatus()<=50){
//            PrescriptionLog prescriptionLog = new PrescriptionLog();
//            prescriptionLog.setCode(UUID.randomUUID().toString());
//            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
//            prescriptionLog.setCreateTime(new Date());
//            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
//            prescriptionLog.setFlag(1);
//            prescriptionLog.setUserCode(userCode);
//            prescriptionLog.setUserType(2);
//            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
//            prescriptionLog.setRemark("该状态不可配送");
//            prescriptionLogDao.save(prescriptionLog);
//            return -5;
//        }
        //修改处方状态为配送中
        Date expressageing = new Date();
        prescription.setExpressageTime(expressageing);
@ -273,7 +273,7 @@ public class PrescriptionExpressageService {
                "&code=" + prescriptionDispensaryCode.getPrescriptionCode() + "&toUser=" + patient.getCode() + "&toName=" + patient.getName();
        prescriptionNoticesService.sendMessages(userCode, doctor.getName(), DateUtil.dateToStrLong(expressageing), 3, 0, url);
        prescriptionNoticesService.sendMessages(patient.getCode(), doctor.getName(), DateUtil.dateToStrLong(expressageing), 3, 0, url);
        return prescriptionDispensaryCode.getType();
    }

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

@ -1138,6 +1138,22 @@ public class PrescriptionInfoService extends BaseService {
        }
    }
    /**
     * 判断丹田
     * @param patient
     * @param currentDay
     * @return
     */
    public String checkPre(String patient,String currentDay){
        StringBuffer sql = new StringBuffer("SELECT code from wlyy_prescription WHERE patient = ? and `status`> "+PrescriptionLog.PrescriptionLogStatus.revieweding.getValue()+" and create_time>? and jw_pay_status = '0'");
        List<Map<String, Object>> mp = jdbcTemplate.queryForList(sql.toString(), patient,currentDay);
        if (mp != null && mp.size() > 0) {
            return "0";
        } else {
            return "1";
        }
    }
    public String presCheckStateObj(String code) {
        StringBuffer sql = new StringBuffer(" SELECT pr.code FROM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND pr.status >= " + PrescriptionLog.PrescriptionLogStatus.revieweding.getValue() + " AND pr.status < " + PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
        List<Map<String, Object>> mp = jdbcTemplate.queryForList(sql.toString(), code);

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -999,6 +999,8 @@ public class ConsultController extends WeixinBaseController {
                return error(-1, "该处方存在未审核的续方,无法进行续方咨询!");
            } if (res == -2) {
                return error(-1, "您还未签约,不能发起续方咨询!");
            } if (res == -3) {
                return error(-1, "您当天有未完成的续方,不能发起续方咨询!");
            }
//            Doctor doctor = doctorService.findDoctorByCode(consult.getDoctor());