trick9191 il y a 8 ans
Parent
commit
c4eb73a738

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

@ -30,7 +30,7 @@ public class Prescription extends IdEntity {
    private String patient;                  //关联 wlyy_patient code
    private String patientName;             //患者名称
    private Integer type;                    //1 处方 2 续方
    private Integer status;                  //状态 (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 , 40配药成功/待配送  41配送失败  42配送中   43配送到服务站  100配送到患者手中/已完成)
    private Integer status;                  //状态 (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 3.调整完成 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 , 40配药成功/待配送  41配送失败  42配送中   43配送到服务站  100配送到患者手中/已完成)
    private String doctor;                   //开处方的医生code 关联 wlyy_doctor
    private String doctorName;               //医生名称
    private Long adminTeamId;             //患者签约的行政团队

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

@ -58,11 +58,12 @@ public class PrescriptionReviewed extends IdEntity {
    private String deptName;                   //科室名称
    private String doctor;                  //审核医生
    private String doctorName;                  //审核医生名称
    private Integer status;               //  1审核通过1 0待审核  -1  审核通过   -2无效审核
    private Integer status;               //  1审核通过1 0待审核  -1  审核不通过   -2无效审核
    private String reason;                  //审核不通过原因
    private String remark;                  //备注
    private Date reviewedTime;           //审核时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getReviewedTime() {
        return reviewedTime;
    }
@ -87,6 +88,7 @@ public class PrescriptionReviewed extends IdEntity {
        this.prescriptionCode = prescriptionCode;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionAdjustDao.java

@ -4,9 +4,12 @@ import com.yihu.wlyy.entity.patient.prescription.PrescriptionAdjust;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2017/8/2.
 */
public interface PrescriptionAdjustDao extends PagingAndSortingRepository<PrescriptionAdjust, Long>,JpaSpecificationExecutor<PrescriptionAdjust> {
    List<PrescriptionAdjust> findByPrescriptionCode(String code);
}

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

@ -168,6 +168,7 @@ public class PrescriptionInfoService extends BaseService {
        Prescription prescription = prescriptionDao.findByCode(code);
        List<PrescriptionInfo> prescriptionInfos = prescriptionInfoDao.findByPrescriptionCode(code);
        PrescriptionReviewed reviewed =  prescriptionReviewedDao.findByPrescriptionCode(code);
        List<PrescriptionAdjust> prescriptionAdjusts = prescriptionAdjustDao.findByPrescriptionCode(code);
        JSONObject rs = new JSONObject();
        if(prescription!=null&&StringUtils.isNotBlank(prescription.getPatient())){
            Patient p = patientDao.findByCode(prescription.getPatient());
@ -178,13 +179,18 @@ public class PrescriptionInfoService extends BaseService {
        if(prescription.getStatus()==10){
            Long s = (prescription.getCreateTime().getTime()-new Date().getTime())/1000;
            rs.put("time",s);
            //rs.put("time",s);
            if(s>172800){
                prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.pay_outtime.getValue());
                prescriptionDao.save(prescription);
            }
        }else{
            rs.put("time","");
            //rs.put("time","");
        }
        if(prescriptionAdjusts!=null&&prescriptionAdjusts.size()>0){
            rs.put("isAdjust",true);
        }else{
            rs.put("isAdjust",false);
        }
        rs.put("reviewed",reviewed);
        rs.put("prescription",prescription);