Explorar o código

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

trick9191 %!s(int64=7) %!d(string=hai) anos
pai
achega
29febb5db6

+ 29 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java

@ -395,31 +395,49 @@ public class Prescription extends IdEntity {
            case 2: {
                return "调整处方中";
            }
            case 3: {
                return "调整成功";
            }
            case 4: {
                return "调整失败";
            }
            case 5: {
                return "药师审核失败";
            }
            case 6: {
                return "开方失败";
            }
            case 10: {
                return "开方中";
            }
            case 20: {
                return "开方完成";
            }
            case 21: {
                return "支付失败";
                return "药师审核中";
            }
            case 30: {
                return "订单已支付";
                return "开方中/药师审核成功";
            }
            case 40: {
                return "配药完成";
                return "开方完成/待支付 ";
            }
            case 41: {
                return "支付失败";
            }
            case 50: {
                return " 支付成功/待配药";
            }
            case 60: {
                return "配药成功/待配送";
            }
            case 61: {
                return "配送失败";
            }
            case 42: {
                return "分配健管师配送";
            case 62: {
                return "分配健管师 ";
            }
            case 45: {
                return "配送中";
            case 65: {
                return "配送中 ";
            }
            case 49: {
            case 69: {
                if (StringUtils.isEmpty(hospitalName)) {
                    return "配送到服务站";
                }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionLog.java

@ -58,9 +58,9 @@ public class PrescriptionLog extends IdEntity {
        // 审核不通过
        no_reviewed("审核不通过", -1),
        revieweding("待审核", 0),
        //审核中
        revieweding("待审核", 0),
        changeing("调整中", 2),
        change_success("调整成功",3),
        change_error("调整失败",4),

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

@ -111,6 +111,8 @@ public class PrescriptionInfoService extends BaseService {
                p1.put("adminTeamId","643");
                p1.put("prescriptionType","门诊");
                p1.put("date","2017-08-08 10:10:10");
                p1.put("patient","37c0657335f94ed38eeced22dbed8011");
                p1.put("patientName","花生");
                if(StringUtils.isNotBlank((String)p1.get("code"))){
                    String sql = "SELECT p.status FROM wlyy_prescription p WHERE p.parent_code='2'";
                    List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
@ -356,11 +358,11 @@ public class PrescriptionInfoService extends BaseService {
     * @param code
     * @return
     */
    public JSONObject getContinuedPrescriptionAsDoctor(String code){
    public com.alibaba.fastjson.JSONObject getContinuedPrescriptionAsDoctor(String code){
        Prescription prescription = prescriptionDao.findByCode(code);
        List<PrescriptionInfo> prescriptionInfos = prescriptionInfoDao.findByPrescriptionCode(code);
        PrescriptionReviewed reviewed  = prescriptionReviewedDao.findByPrescriptionCode(code);
        JSONObject rs = new JSONObject();
        com.alibaba.fastjson.JSONObject rs = new com.alibaba.fastjson.JSONObject();
        rs.put("prescription",prescription);
        rs.put("prescriptionInfos",prescriptionInfos);
        rs.put("reviewed",reviewed);
@ -383,24 +385,11 @@ public class PrescriptionInfoService extends BaseService {
            Prescription p = prescriptionDao.findByCode(code);
           //更新审核记录
            PrescriptionReviewed reviewed = prescriptionReviewedDao.findByPrescriptionCode(code);
//            PrescriptionReviewed reviewed = new PrescriptionReviewed();
//            reviewed.setCode(getCode());
//            reviewed.setPrescriptionCode(code);
//            reviewed.setCreateTime(new Date());
//            reviewed.setRemark("医生审核");
//            reviewed.setDoctor(p.getDoctor());
//            reviewed.setDoctorName(p.getDoctorName());
//            reviewed.setHospital(p.getHospital());
//            reviewed.setHospitalName(p.getHospitalName());
//            reviewed.setDept(p.getDept());
//            reviewed.setDeptName(p.getDeptName());
            if("1".equals(state)){
                //审核通过
                p.setStatus(PrescriptionLog.PrescriptionLogStatus.reviewed_success.getValue());
                //审核通过,前往智业开方
                p.setStatus(PrescriptionLog.PrescriptionLogStatus.adding.getValue());
                p.setReviewedTime(new Date());
                reviewed.setReviewedTime(new Date());
                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.reviewed_success.getValue());
            }else{
                //审核不通过
                p.setStatus(PrescriptionLog.PrescriptionLogStatus.no_reviewed.getValue());
@ -408,6 +397,15 @@ public class PrescriptionInfoService extends BaseService {
                reviewed.setReason(reason);
                reviewed.setReviewedTime(new Date());
                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.del.getValue());
                //审核不用过发送消息
                //发送Im消息
                JSONObject content = new JSONObject();
                content.put("title","我已经审核您"+ DateUtil.dateToStr(p.getCreateTime(),"yyyy-MM-dd")+"发起的续方申请");
                content.put("result","审核不通过");
                content.put("reason",reason);
                content.put("url","");
                imUtill.sendTopicIM(p.getDoctor(),p.getDoctorName(),p.getConsult(),"1",content.toString(),null);
            }
            prescriptionReviewedDao.save(reviewed);
            prescriptionDao.save(p);
@ -425,17 +423,9 @@ public class PrescriptionInfoService extends BaseService {
            log.setHospital(p.getHospital());
            log.setUserType(2);
            log.setFlag(1);
            log.setRemark("医生审核");
            log.setRemark("医生审核/开方");
            prescriptionLogDao.save(log);
            //发送Im消息
            JSONObject content = new JSONObject();
            content.put("title","我已经审核您"+ DateUtil.dateToStr(p.getCreateTime(),"yyyy-MM-dd")+"发起的续方申请");
            content.put("result","1".equals(state)?"审核通过":"审核不通过");
            content.put("reason","1".equals(state)?"":reason);
            content.put("url","");
            imUtill.sendTopicIM(p.getDoctor(),p.getDoctorName(),p.getConsult(),"1",content.toString(),null);
            //同步智业接口
            upLoadPrescriotionState();
            return 1;