Browse Source

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

chenweida 7 years ago
parent
commit
e203976c4d

+ 25 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.entity.patient.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import org.springframework.util.StringUtils;
import javax.persistence.Column;
import javax.persistence.Entity;
@ -54,6 +55,10 @@ public class Prescription extends IdEntity {
//    private Double myCost;                      //自己付费
    private Integer prescriptionType;          //处方类型:1、门诊处方,2、住院处方
    private String statusName; //
    @Column(name = "code", unique = true, nullable = false)
    public String getCode() {
        return code;
@ -345,6 +350,16 @@ public class Prescription extends IdEntity {
    @Transient
    public String getStatusName() {
        return statusName;
    }
    public void setStatusName(String statusName) {
        this.statusName = getStatusName(status,null);
    }
    @Transient
    public static String getStatusName(Integer status, String hospitalName) {
        /**
         *  no_reviewed("审核不通过", -1),
         revieweding("待审核", 0),
@ -392,7 +407,7 @@ public class Prescription extends IdEntity {
                return "订单已支付";
            }
            case 40: {
                return "配药成功待配送";
                return "配药完成";
            }
            case 41: {
                return "配送失败";
@ -401,15 +416,20 @@ public class Prescription extends IdEntity {
                return "分配健管师配送";
            }
            case 45: {
                return "订单配送中";
                return "配送中";
            }
            case 49: {
                return "配送到服务站";
                if (StringUtils.isEmpty(hospitalName)) {
                    return "配送到服务站";
                }
                {
                    return "配送到" + hospitalName;
                }
            }
            case 100: {
                return "订单完成";
                return "续方完成";
            }
        }
        return "";
        return "未知";
    }
}

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

@ -48,6 +48,7 @@ public class PrescriptionLog extends IdEntity {
            this.value = value;
        }
    }
    //状态枚举
    public enum PrescriptionLogStatus {
@ -55,7 +56,7 @@ public class PrescriptionLog extends IdEntity {
        patient_canel("患者自己取消", -2),
        no_reviewed("审核不通过", -1),
        revieweding("待审核", 0),
        changeing("调整中",2),
        changeing("调整中", 2),
        reviewed_success("审核通过/开方中", 10),
        wait_pay("开方完成/待支付", 20),
@ -100,6 +101,7 @@ public class PrescriptionLog extends IdEntity {
    private String prescriptionCode;      //处方code 关联表wlyy_prescription code
    private Date createTime;               //处方创建时间
    private Integer status;                 //状态 (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 , 40配药成功/待配送  41配送失败 42分配健管师 45配送中   49配送到服务站  100配送到患者手中/已完成)
    private Integer type;                   //类型: 1智业对接 2易联众对接  3创建处方 4 审核  5付款 6 配送 7完成
    private String userCode;                  //医生或者患者code
    private String userName;                  //医生或者患者name
@ -109,6 +111,8 @@ public class PrescriptionLog extends IdEntity {
    private String hospital;//医院code
    private String hospitalName;//医院名称
    private String statusName;  //状态名称
    @Column(name = "code")
    public String getCode() {
        return code;
@ -214,4 +218,13 @@ public class PrescriptionLog extends IdEntity {
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    @Transient
    public String getStatusName() {
        return statusName;
    }
    public void setStatusName(String statusName) {
        this.statusName = Prescription.getStatusName(this.status,hospitalName);
    }
}

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

@ -184,7 +184,7 @@ public class PrescriptionInfoController extends BaseController{
            jo.put("dispensaryDispensaryType", prescription.getType());//处方配送方式
            jo.put("dispensaryDispensaryTypeName", prescription.getTypeName());//处方配送方式
            jo.put("prescriptionStatus", prescription.getStatus());//处方状态
            jo.put("prescriptionStatusName", prescription.getStatusName());//处方名称
            jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(),""));//处方状态名称
            return write(200, "查询成功", "data", jo);
        } catch (Exception e) {

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

@ -37,7 +37,44 @@ public class PrescriptionLogController extends BaseController {
    public String addReply(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
            Integer[] types = new Integer[]{20, 30, 31,100};
            // (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 ,
            //  40配药成功/待配送  41配送失败  42配送中   43配送到服务站  100配送到患者手中/已完成)
            Integer[] types = new Integer[]{
                    PrescriptionLog.PrescriptionLogStatus.pay_success.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressageing.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.finish.getValue()};
            List<PrescriptionLog> prescriptionLogs = prescriptionLogService.findPrescriptionLogsByPrescriptionCode(prescriptionCode, types);
            if (prescriptionLogs != null) {
                return write(200, "获取处方流程成功", "data", prescriptionLogs);
            } else {
                return error(-1, "获取失败");
            }
        } catch (Exception e) {
            return error(-1, "获取失败");
        }
    }
    /**
     * 根据处方code获取处方流程
     *
     * @param prescriptionCode
     * @return
     */
    @RequestMapping(value = "/orderFollow", method = RequestMethod.GET)
    @ApiOperation(value = "订单状态跟踪")
    public String orderFollow(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
            // (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 ,
            //  40配药成功/待配送  41配送失败  42配送中   43配送到服务站  100配送到患者手中/已完成)
            Integer[] types = new Integer[]{
                    PrescriptionLog.PrescriptionLogStatus.pay_success.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressageing.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.finish.getValue()};
            List<PrescriptionLog> prescriptionLogs = prescriptionLogService.findPrescriptionLogsByPrescriptionCode(prescriptionCode, types);
            if (prescriptionLogs != null) {
                return write(200, "获取处方流程成功", "data", prescriptionLogs);