Ver código fonte

Merge branch 'dev' of liuwenbin/patient-co-management into dev

liuwenbin 7 anos atrás
pai
commit
4c29f63150

+ 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();
    }