Переглянути джерело

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

chenweida 7 роки тому
батько
коміт
7dda0dd577

+ 27 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressage.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.Date;
/**
/**
@ -36,6 +37,11 @@ public class PrescriptionExpressage extends IdEntity{
    private Date createTime;                //创建的时间
    private Date createTime;                //创建的时间
    private Integer oneselfPickupFlg;//是否自取 1是 0否
    private Integer oneselfPickupFlg;//是否自取 1是 0否
    //没有hibernate映射
    private Integer dispensaryType;            //取药类型:1 自取 2快递配送 3健管师配送
    private Integer status;                  //状态 (-1 审核不通过 , 0 审核中, 10 审核通过/待支付 ,21支付失败  20 配药中/支付成功, 21 等待领药 ,30 配送中 ,100配送成功/已完成)
    @Column(name = "code", unique = true , nullable=false)
    @Column(name = "code", unique = true , nullable=false)
    public String getCode() {
    public String getCode() {
        return code;
        return code;
@ -185,4 +191,25 @@ public class PrescriptionExpressage extends IdEntity{
    public String getMailno() { return mailno; }
    public String getMailno() { return mailno; }
    public void setMailno(String mailno) { this.mailno = mailno; }
    public void setMailno(String mailno) { this.mailno = mailno; }
    @Transient
    public Integer getDispensaryType() {
        return dispensaryType;
    }
    public void setDispensaryType(Integer dispensaryType) {
        this.dispensaryType = dispensaryType;
    }
    @Transient
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}
}

+ 6 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionPay.java

@ -21,8 +21,8 @@ public class PrescriptionPay extends IdEntity {
    private String ybCard;//医保卡号
    private String ybCard;//医保卡号
    private Integer type;// 1 医保支付
    private Integer type;// 1 医保支付
    private Integer status;//状态  成功1 失败0
    private Integer status;//状态  成功1 失败0
    private Double ybCost;//医保费用
    private Double myCost;//自己付费
    private Integer ybCost;//统筹金额  单位分
    private Integer myCost;//自费金额  单位分
    public String getCode() {
    public String getCode() {
        return code;
        return code;
@ -81,19 +81,19 @@ public class PrescriptionPay extends IdEntity {
        this.status = status;
        this.status = status;
    }
    }
    public Double getYbCost() {
    public Integer getYbCost() {
        return ybCost;
        return ybCost;
    }
    }
    public void setYbCost(Double ybCost) {
    public void setYbCost(Integer ybCost) {
        this.ybCost = ybCost;
        this.ybCost = ybCost;
    }
    }
    public Double getMyCost() {
    public Integer getMyCost() {
        return myCost;
        return myCost;
    }
    }
    public void setMyCost(Double myCost) {
    public void setMyCost(Integer myCost) {
        this.myCost = myCost;
        this.myCost = myCost;
    }
    }
}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionPayDao.java

@ -12,6 +12,6 @@ import java.util.List;
 * Created by chenweida on 2017/7/27.
 * Created by chenweida on 2017/7/27.
 */
 */
public interface PrescriptionPayDao extends PagingAndSortingRepository<PrescriptionPay, Long>, JpaSpecificationExecutor<PrescriptionPay> {
public interface PrescriptionPayDao extends PagingAndSortingRepository<PrescriptionPay, Long>, JpaSpecificationExecutor<PrescriptionPay> {
    @Query("from PrescriptionPay p where p.prescriptionCode=?1 ")
    @Query("from PrescriptionPay p where p.prescriptionCode=?1 and p.status=1")
    PrescriptionPay findByPrescriptionPay(String prescriptionCode);
    PrescriptionPay findByPrescriptionPay(String prescriptionCode);
}
}

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

@ -1,8 +1,14 @@
package com.yihu.wlyy.web.doctor.prescription;
package com.yihu.wlyy.web.doctor.prescription;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionPay;
import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageService;
import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageService;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import com.yihu.wlyy.service.app.prescription.PrescriptionPayService;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
@ -11,6 +17,8 @@ import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
/**
 * Created by Trick on 2017/7/25.
 * Created by Trick on 2017/7/25.
 */
 */
@ -23,6 +31,10 @@ public class PrescriptionInfoController extends BaseController{
    private PrescriptionInfoService prescriptionInfoService;
    private PrescriptionInfoService prescriptionInfoService;
    @Autowired
    @Autowired
    private PrescriptionExpressageService prescriptionExpressageService;
    private PrescriptionExpressageService prescriptionExpressageService;
    @Autowired
    private PrescriptionService prescriptionService;
    @Autowired
    private PrescriptionPayService prescriptionPayService;
    /**
    /**
     * 确认配送 二维码方式
     * 确认配送 二维码方式
@ -143,5 +155,37 @@ public class PrescriptionInfoController extends BaseController{
        }
        }
    }
    }
    /**
     * 订单跟踪 包含处方药品信息 订单记录  支付记录
     * 根据处方code获取处方流程
     *
     * @param prescriptionCode
     * @return
     */
    @RequestMapping(value = "/prescriptionFollow", method = RequestMethod.GET)
    @ApiOperation(value = "获取处方订单详情")
    public String prescriptionFollow(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
            JSONObject jo = new JSONObject();
            //获取处方信息
            Prescription prescription = prescriptionService.findByCode(prescriptionCode);
            //获取处方药品信息
            List<PrescriptionInfo> prescriptionInfos = prescriptionInfoService.getPrescriptionInfo(prescriptionCode);
            //获取付款信息
            PrescriptionPay prescriptionPay = prescriptionPayService.findByPrescriptionCode(prescriptionCode);
            //获取配送信息
            PrescriptionExpressage prescriptionExpressage = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            prescriptionExpressage.setDispensaryType(prescription.getType());//处方配送方式
            prescriptionExpressage.setStatus(prescription.getStatus());//处方状态
            jo.put("prescriptionInfos", prescriptionInfos);
            jo.put("prescriptionPay", prescriptionPay);
            jo.put("prescriptionExpressage", prescriptionExpressage);
            return write(200, "查询成功", "data", jo);
        } catch (Exception e) {
            return error(-1, "获取失败");
        }
    }
}
}