فهرست منبع

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
wangzhinan 4 سال پیش
والد
کامیت
03550cac71
16فایلهای تغییر یافته به همراه269 افزوده شده و 31 حذف شده
  1. 4 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionCheckDao.java
  2. 6 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDiagnosisDao.java
  3. 7 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionInfoDao.java
  4. 6 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/WlyyInspectionDao.java
  5. 101 20
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  6. 12 8
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  7. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyInspectionDO.java
  8. 14 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java
  9. 13 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDiagnosisDO.java
  10. 2 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  11. 10 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyInspectionVO.java
  12. 10 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionDiagnosisVO.java
  13. 14 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionVO.java
  14. 44 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java
  15. 1 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  16. 16 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionCheckDao.java

@ -18,4 +18,8 @@ public interface PrescriptionCheckDao extends PagingAndSortingRepository<WlyyPre
    @Query("select a from WlyyPrescriptionCheckDO a where a.prescriptionId = ?1 order by a.createTime desc ")
    List<WlyyPrescriptionCheckDO> findByPrescriptionId(String prescriptionId);
    @Query("select a from WlyyPrescriptionCheckDO a where a.prescriptionId = ?1 and a.status=?2 order by a.createTime desc ")
    List<WlyyPrescriptionCheckDO> findByStatus(String prescriptionId,Integer status);
}

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDiagnosisDao.java

@ -2,6 +2,8 @@ package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDiagnosisDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
@ -12,4 +14,8 @@ import java.util.List;
public interface PrescriptionDiagnosisDao extends PagingAndSortingRepository<WlyyPrescriptionDiagnosisDO, String>, JpaSpecificationExecutor<WlyyPrescriptionDiagnosisDO> {
    List<WlyyPrescriptionDiagnosisDO> findByPrescriptionId(String prescriptionId);
    @Modifying
    @Query("update WlyyPrescriptionDiagnosisDO p set p.del=0 where p.id=?1")
    void deleteById(String id);
}

+ 7 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionInfoDao.java

@ -2,6 +2,8 @@ package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
@ -15,4 +17,9 @@ public interface PrescriptionInfoDao extends PagingAndSortingRepository<WlyyPres
    List<WlyyPrescriptionInfoDO> findByPrescriptionId(String prescriptionId);
    List<WlyyPrescriptionInfoDO> queryAllByPrescriptionIdInAndDel(Set ids,Integer del);
    @Modifying
    @Query("update WlyyPrescriptionInfoDO p set p.del=0 where p.id=?1")
    void deleteById(String id);
}

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/WlyyInspectionDao.java

@ -2,6 +2,8 @@ package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyInspectionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
@ -14,4 +16,8 @@ public interface WlyyInspectionDao extends PagingAndSortingRepository<WlyyInspec
    List<WlyyInspectionDO> findByOutpatientId(String outpatientId);
    List<WlyyInspectionDO> findByPrescriptionId(String prescriptionId);
    @Modifying
    @Query("update WlyyInspectionDO p set p.del=0 where p.id=?1")
    void deleteById(String id);
}

+ 101 - 20
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -180,6 +180,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private PrescriptionCheckDao prescriptionCheckDao;
    @Autowired
    private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
    @Value("${demo.flag}")
@ -442,7 +444,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else{
            rs.put("expressage",null);
        }
/*
        //物流配送新
        List<WlyyPrescriptionExpressageLogDO>  expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(outpatientId);
@ -452,7 +453,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else{
            rs.put("expressageLogs",null);
        }
*/
        //预约记录
        List<WlyyPatientRegisterTimeDO> timeDOs = patientRegisterTimeDao.findByOutpatientId(outpatientId);
@ -1847,10 +1847,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //============================下诊断==============================================================
        //删除之前诊断
        List<WlyyPrescriptionDiagnosisDO> ds = prescriptionDiagnosisDao.findByPrescriptionId(prescription.getId());
       /* List<WlyyPrescriptionDiagnosisDO> ds = prescriptionDiagnosisDao.findByPrescriptionId(prescription.getId());
        if (ds != null && ds.size() > 0) {
            prescriptionDiagnosisDao.delete(ds);
        }
        }*/
        List<WlyyPrescriptionDiagnosisDO> diagnosisDOs = (List<WlyyPrescriptionDiagnosisDO>) com.alibaba.fastjson.JSONArray.parseArray(diagnosisJson, WlyyPrescriptionDiagnosisDO.class);
        String Icd10 = "";
@ -1884,15 +1884,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                throw new RuntimeException("未找到医生映射信息");
            }
            //his处方拼接开方条件
            com.alibaba.fastjson.JSONArray jsonData = new com.alibaba.fastjson.JSONArray();
            //===================药品操作======================================================
            // 删除原有药品信息
            List<WlyyPrescriptionInfoDO> oldInfos = prescriptionInfoDao.findByPrescriptionId(prescription.getId());
            /*List<WlyyPrescriptionInfoDO> oldInfos = prescriptionInfoDao.findByPrescriptionId(prescription.getId());
            if (oldInfos != null && oldInfos.size() > 0) {
                prescriptionInfoDao.delete(oldInfos);
            }
            }*/
            //存储药品,构建his开方入参
            if (StringUtils.isNotBlank(infoJsons)) {
@ -1904,8 +1903,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    info.setDel(1);
                    info.setPrescriptionId(prescription.getId());
                    //设置his药品查询条件
                    setInfoJsonParam(jsonData, doctorMappingDO, outpatientDO, prescriptionDO, info, Icd10);
                }
                //保存药品信息
                prescriptionInfoDao.save(infoDOs);
@ -1921,10 +1919,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //=====================检查检验=======================================================================
            //存储检查检验,构建his开方入参
            //删除之前检查检验
            List<WlyyInspectionDO> inspectionDels = wlyyInspectionDao.findByOutpatientId(outPatientId);
            /*List<WlyyInspectionDO> inspectionDels = wlyyInspectionDao.findByOutpatientId(outPatientId);
            if (inspectionDels != null && inspectionDels.size() > 0) {
                wlyyInspectionDao.delete(inspectionDels);
            }
            }*/
            if (StringUtils.isNotBlank(inspectionJson)) {
                List<WlyyInspectionDO> inspections = (List<WlyyInspectionDO>) com.alibaba.fastjson.JSONArray.parseArray(inspectionJson, WlyyInspectionDO.class);
@ -1934,8 +1932,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    ins.setPrescriptionId(prescription.getId());
                    ins.setOutpatientId(outPatientId);
                    //设置his药品查询条件
                    setInspectionParam(jsonData, doctorMappingDO, outpatientDO, prescriptionDO, ins, Icd10);
                }
                //保存检查检验。
                wlyyInspectionDao.save(inspections);
@ -1947,6 +1944,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //保存挂号费用
            prescription.setRegFee(getChargeFee(outpatientDO.getDoctor()));
            //=====================保存日志 start=========================================================
            List<WlyyPrescriptionCheckDO> prescriptionCheckDOS = prescriptionCheckDao.findByStatus(prescription.getId(),5);
            if (prescriptionCheckDOS==null || prescriptionCheckDOS.size() ==0){
                savePrescriptionCheck(prescription.getDoctor(),"开具处方",5,prescription.getId());
            }
            //=====================保存日志 end=========================================================
            //保存费用
            prescriptionDao.save(prescription);
            if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
@ -1971,13 +1975,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                Double price = 0.01;
                businessOrderService.recharge(prescription.getId(),"处方收费","4","处方收费",prescription.getPatientCode(),prescription.getPatientName(),prescription.getDoctor(),price);
                //上传his开方
                return sendHisDiagnosis(jsonData, outpatientDO, prescription);
                //sendHisDiagnosis(jsonData, outpatientDO, prescription)
                //zsSynHis(prescription.getId());
                return null;
            }else {
                result.put("code", 1);
                result.put("mes", "诊断完成");
                return result;
            }
        } else {
            outpatientDO.setStatus("2");
            outpatientDao.save(outpatientDO);
@ -5227,7 +5234,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
                sql +="\tp.status as \"status\",\n" +
                        "\tp.check_status as \"checkStatus\",\n" +
                        "\tp.check_reason as \"checkReason\"\n" +
                        "\tp.check_reason as \"checkReason\",\n" +
                        "\tp.pay_type as \"payType\"\n" +
                "FROM\n" +
                "\twlyy_prescription P\n" +
                "WHERE\n" +
@ -5330,7 +5338,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param prescriptionId
     * @return
     */
    public WlyyPrescriptionCheckDO saveCheck(String operate,String operateName,String reason,Integer status,String prescriptionId){
    public WlyyPrescriptionCheckDO saveCheck(String operate,String operateName,String reason,Integer status,String prescriptionId,String wxId){
        WlyyPrescriptionCheckDO prescriptionCheckDO = new WlyyPrescriptionCheckDO();
        prescriptionCheckDO.setCreateTime(new Date());
        prescriptionCheckDO.setOperate(operate);
@ -5344,7 +5352,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        prescriptionCheckDO = prescriptionCheckDao.save(prescriptionCheckDO);
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
        if (status==2){
            prescriptionDao.updateCheckStatus(prescriptionId,4,reason,12);
            prescriptionDao.updateCheckStatus(prescriptionId,2,reason,12);
            /*if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                try {
                    WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
                    List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId);
                    List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId);
                    WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
                    DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
                    //his处方拼接开方条件
                    com.alibaba.fastjson.JSONArray jsonData = new com.alibaba.fastjson.JSONArray();
                    for (WlyyPrescriptionInfoDO info:infoDOS){
                        //设置his药品查询条件
                        setInfoJsonParam(jsonData, doctorMappingDO, outpatientDO, prescriptionDO, info, outpatientDO.getIcd10());
                    }
                    for (WlyyInspectionDO ins:inspectionDOS){
                        //设置his药品查询条件
                        setInspectionParam(jsonData, doctorMappingDO, outpatientDO, prescriptionDO, ins, outpatientDO.getIcd10());
                    }
                    sendHisDiagnosis(jsonData, outpatientDO, prescriptionDO);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }*/
        }else{
            wlyyPrescriptionDO.setCheckStatus(status);
            wlyyPrescriptionDO.setCheckReason(reason);
@ -5403,7 +5435,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            wlyyPrescriptionDO.setCheckReason("未审核");
            wlyyPrescriptionDO.setDealStatus(2);
            wlyyPrescriptionDO.setDealReason(reason);
        }else if (status==5){
            wlyyPrescriptionDO.setCheckStatus(0);
            wlyyPrescriptionDO.setCheckReason("未审核");
        }
        prescriptionDao.save(wlyyPrescriptionDO);
        return prescriptionCheckDO;
    }
@ -5442,11 +5478,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if (status==2){
                systemMessageDO.setTitle("审方通过");
                data.put("message","审方通过");
                data.put("message","您为"+prescriptionDO.getPatientName()+"("+IdCardUtil.getAgeForIdcard(prescriptionDO.getIdcard())+"岁 "+IdCardUtil.getSexForIdcard_new(prescriptionDO.getIdcard())+")开具的处方已审核通过。");
                data.put("message","您为"+prescriptionDO.getPatientName()+"("+IdCardUtil.getAgeForIdcard(prescriptionDO.getIdcard())+"岁 "+IdCardUtil.getSexForIdcard(prescriptionDO.getIdcard())+")开具的处方已审核通过。");
            } else if (status==1) {
                systemMessageDO.setTitle("审方退回");
                data.put("message","审方退回");
                data.put("message","您为"+prescriptionDO.getPatientName()+"("+IdCardUtil.getAgeForIdcard(prescriptionDO.getIdcard())+"岁 "+IdCardUtil.getSexForIdcard_new(prescriptionDO.getIdcard())+")开具的处方被审方退回,请尽快处理");
                data.put("message","您为"+prescriptionDO.getPatientName()+"("+IdCardUtil.getAgeForIdcard(prescriptionDO.getIdcard())+"岁 "+IdCardUtil.getSexForIdcard(prescriptionDO.getIdcard())+")开具的处方被审方退回,请尽快处理");
            }
            systemMessageDO.setData(data.toString());
            systemMessageService.saveMessage(systemMessageDO);
@ -5504,4 +5540,49 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public void deleteById(Integer flag,String id){
        if (flag ==1){
            //药品
            prescriptionInfoDao.deleteById(id);
        }else if (flag==2){
            //诊断
            prescriptionDiagnosisDao.deleteById(id);
        }else if (flag==3){
            //检查检验
            wlyyInspectionDao.deleteById(id);
        }
    }
    public void zsSynHis(String prescriptionId){
        try {
            WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
            List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId);
            List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId);
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
            DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
            //his处方拼接开方条件
            com.alibaba.fastjson.JSONArray jsonData = new com.alibaba.fastjson.JSONArray();
            for (WlyyPrescriptionInfoDO info:infoDOS){
                //设置his药品查询条件
                setInfoJsonParam(jsonData, doctorMappingDO, outpatientDO, prescriptionDO, info, outpatientDO.getIcd10());
            }
            for (WlyyInspectionDO ins:inspectionDOS){
                //设置his药品查询条件
                setInspectionParam(jsonData, doctorMappingDO, outpatientDO, prescriptionDO, ins, outpatientDO.getIcd10());
            }
            sendHisDiagnosis(jsonData, outpatientDO, prescriptionDO);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

+ 12 - 8
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1725,8 +1725,8 @@ public class ImService {
					"d.name AS \"patientName\"," +
					"d.id as \"patientId\"," +
					"d.idcard as \"patientIdcard\"," +
					"d.sex as \"patientsex\"," +
					"d.photo AS \"patientphoto\" " +
					"d.sex as \"patientSex\"," +
					"d.photo AS \"patientPhoto\" " +
					"FROM wlyy_consult a," +
					"wlyy_consult_team b," +
					"base_patient d " +
@ -1749,12 +1749,12 @@ public class ImService {
					"d.name AS \"patientName\"," +
					"d.id as \"patientId\"," +
					"d.idcard as \"patientIdcard\"," +
					"d.sex as \"patientsex\"," +
					"op.id as \"outpatientid\"," +
					"d.sex as \"patientSex\"," +
					"op.id as \"outpatientId\"," +
					"op.type as \"consultType\"," +
					"op.general_doctor as \"generalDoctor\"," +
					"op.icd10_name as \"icd10Name\"," +
					"d.photo AS \"patientphoto\" " +
					"d.photo AS \"patientPhoto\" " +
					"FROM wlyy_consult_team b," +
					"base_patient d," +
					"wlyy_consult a   " +
@ -2468,9 +2468,13 @@ public class ImService {
		if("9".equals(type) || "16".equals(type)|| "12".equals(type)){
			sql = "SELECT " +
					"op.description AS \"title\"," +
					"op.description AS \"symptoms\"," +
					"op.create_time AS \"czrq\"," +
					"op.status AS \"status\"," +
					"op.description AS \"symptoms\",";
			if("xm_ykyy_wx".equals(wxId)){
				sql = sql + "to_char(op.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
			}else{
				sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
			}
					sql =sql +"op.status AS \"status\"," +
					"op.evaluate_status AS \"evaluate\"," +
					"op.doctor AS \"doctorCode\"," +
					"op.general_doctor AS \"generalDoctor\"," +

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyInspectionDO.java

@ -53,6 +53,8 @@ public class WlyyInspectionDO extends UuidIdentityEntity {
    private String mzpg;//麻醉评估 0否,1有
    private String sfzg;//是否做过 0 否 和 1是
    private Integer del;//1可用 0删除
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date createTime;//,
@ -289,4 +291,11 @@ public class WlyyInspectionDO extends UuidIdentityEntity {
        this.chargeAmount = chargeAmount;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 14 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java

@ -258,6 +258,11 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
     */
    private String dealReason;
    /**
     * 付款方式(0自费,1医保)
     */
    private Integer payType;
    @Column(name = "outpatient_id")
    public String getOutpatientId() {
        return outpatientId;
@ -638,4 +643,13 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
    public void setDealReason(String dealReason) {
        this.dealReason = dealReason;
    }
    @Column(name = "pay_type")
    public Integer getPayType() {
        return payType;
    }
    public void setPayType(Integer payType) {
        this.payType = payType;
    }
}

+ 13 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDiagnosisDO.java

@ -38,6 +38,11 @@ public class WlyyPrescriptionDiagnosisDO extends UuidIdentityEntity {
     */
    private Integer type;
    /**
     * 1可用 0删除
     */
    private Integer del;
    /**
     * 创建时间
     */
@ -85,4 +90,12 @@ public class WlyyPrescriptionDiagnosisDO extends UuidIdentityEntity {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 2 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -403,6 +403,8 @@ public class BaseHospitalRequestMapping {
        public static final String savePrescriptionCheck = "/savePrescriptionCheck";
        public static final String deleteById = "/deleteById";
    }

+ 10 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyInspectionVO.java

@ -3,6 +3,7 @@ package com.yihu.jw.restmodel.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
@ -50,6 +51,7 @@ public class WlyyInspectionVO extends UuidIdentityVO {
//    private String dCode;//自定义码',
//    private String execUnit;//执行科室',
//    private String winNo;//院区',
    private Integer del;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date createTime;//,
@ -281,4 +283,12 @@ public class WlyyInspectionVO extends UuidIdentityVO {
    public void setCheckPartName(String checkPartName) {
        this.checkPartName = checkPartName;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 10 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionDiagnosisVO.java

@ -42,6 +42,9 @@ public class WlyyPrescriptionDiagnosisVO extends UuidIdentityVOWithOperator {
    @ApiModelProperty(value = "1主诊断 2次诊断", example = "模块1")
    private Integer type;
    @ApiModelProperty(value = "删除标识", example = "模块1")
    private Integer del;
    /**
     * 创建时间
     */
@ -86,4 +89,11 @@ public class WlyyPrescriptionDiagnosisVO extends UuidIdentityVOWithOperator {
        this.createTime = createTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 14 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionVO.java

@ -360,6 +360,12 @@ public class WlyyPrescriptionVO extends UuidIdentityVOWithOperator {
    @ApiModelProperty(value = "性别", example = "模块1")
    private String sex;//性别
    /**
     * 付款方式0自费1医保
     */
    @ApiModelProperty(value = "付款方式", example = "模块1")
    private Integer payType;
    @ApiModelProperty(value = "检查检验", example = "模块1")
    private List<WlyyInspectionVO> inspectionVOs;
@ -809,4 +815,12 @@ public class WlyyPrescriptionVO extends UuidIdentityVOWithOperator {
    public void setSex(String sex) {
        this.sex = sex;
    }
    public Integer getPayType() {
        return payType;
    }
    public void setPayType(Integer payType) {
        this.payType = payType;
    }
}

+ 44 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java

@ -300,7 +300,50 @@ public class PrescriptionStatusUpdateService {
                    }
                }
                outpatientDao.save(outpatientDOs);
                if (wechatId.equalsIgnoreCase(""))
                //退费
                for (WlyyOutpatientDO outpatientDO:outpatientDOs){
                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
                    if (businessOrderDO!=null){
                        try {
                            if (businessOrderDO.getPayType()==1){
                                businessOrderService.orderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
                            }else if (businessOrderDO.getPayType()==3){
                                businessOrderService.ylzOrderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }
                logger.info("setOutPatientOver count :"+outpatientDOs.size());
            }else {
                logger.info("setOutPatientOver count :"+0);
            }
        }else{
            logger.info("setOutPatientOver Time is not up ");
        }
        logger.info("setOutPatientOver end ");
    }
    public void setOutPatientStatusOver(){
        logger.info("setOutPatientOver start ");
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        int i = calendar.get(Calendar.HOUR_OF_DAY);
        //复诊记录状态状态安全锁,每天0~2点才允许触发,避免误调用
        //将所有的已接诊的处方记录
        if(i==0||i==1){
            List<WlyyOutpatientDO> outpatientDOs = outpatientDao.findByStatus("2");
            if(outpatientDOs!=null&&outpatientDOs.size()>0){
                for(WlyyOutpatientDO outpatientDO:outpatientDOs){
                    //结束门诊
                    outpatientDO.setStatus("0");
                }
                outpatientDao.save(outpatientDOs);
                //退费
                for (WlyyOutpatientDO outpatientDO:outpatientDOs){
                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -194,7 +194,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
						net.sf.json.JSONObject res = prescriptionService.registerOutPatient(outpatientCode,doctorCode);
						rsCode = (String)res.get("@RESULT");
						mes = (String)res.get("@MSG");
					/*	rsCode="0";
			/*			rsCode="0";
						mes="已挂号";*/
					}

+ 16 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -1285,7 +1285,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            //String operate,String operateName,String reason,Integer status,String prescriptionId
            return ObjEnvelop.getSuccess("ok",prescriptionService.saveCheck(operate,operateName,reason,status,prescriptionId));
            return ObjEnvelop.getSuccess("ok",prescriptionService.saveCheck(operate,operateName,reason,status,prescriptionId,wxId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
@ -1363,4 +1363,19 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    }
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.deleteById)
    @ApiOperation("医生端-逻辑删除业务数据")
    public ObjEnvelop deleteById(
            @ApiParam(name = "flag", value = "1药品2诊断3检查", required = true)
            @RequestParam(required = true)Integer flag,
            @ApiParam(name = "id", value = "业务id", required = true)
            @RequestParam(required = true)String id) throws Exception {
        try {
            prescriptionService.deleteById(flag,id);
            return ObjEnvelop.getSuccess("ok",null);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}