Prechádzať zdrojové kódy

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

huangwenjie 5 rokov pred
rodič
commit
e3266fbed4
16 zmenil súbory, kde vykonal 329 pridanie a 36 odobranie
  1. 11 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OauthDzqmConfigDao.java
  2. 3 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PatientRegisterDao.java
  3. 37 11
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  4. 61 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/DoctorPreSignService.java
  5. 2 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  6. 39 19
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java
  7. 42 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dzqm/OauthDzqmConfigDO.java
  8. 36 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPatientRegisterDO.java
  9. 2 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  10. 10 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/event/ApplicationEvent.java
  11. 1 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/InternetUpdateJob.java
  12. 30 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/PrescriptionOverdueJob.java
  13. 28 3
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java
  14. 13 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  15. 3 0
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  16. 11 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

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

@ -0,0 +1,11 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.dzqm.OauthDzqmConfigDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2019/10/14.
 */
public interface OauthDzqmConfigDao extends PagingAndSortingRepository<OauthDzqmConfigDO, String>, JpaSpecificationExecutor<OauthDzqmConfigDO> {
}

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

@ -12,4 +12,7 @@ import java.util.List;
public interface PatientRegisterDao extends PagingAndSortingRepository<WlyyPatientRegisterDO, String>, JpaSpecificationExecutor<WlyyPatientRegisterDO> {
    List<WlyyPatientRegisterDO> findByPatientAndDate(String patient,String date);
    List<WlyyPatientRegisterDO> findByPatientAndDateAndDoctor(String patient,String date,String doctor);
}

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

@ -671,8 +671,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //取药类型:1 自取 2快递配送
                sql = "UPDATE base.wlyy_prescription p SET p.`status`='100',p.pay_status='1' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
                //变更门诊状态
                outPatientSql = "UPDATE base.wlyy_outpatient p SET p.`status`='2' WHERE p.adm_no='" + admNo + "'";
                jdbcTemplate.execute(outPatientSql);
//                outPatientSql = "UPDATE base.wlyy_outpatient p SET p.`status`='2' WHERE p.adm_no='" + admNo + "'";
//                jdbcTemplate.execute(outPatientSql);d
            } else {
                //取药类型:1 自取 2快递配送
                sql = "UPDATE base.wlyy_prescription p SET p.`status`='32',p.pay_status='1' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
@ -1043,7 +1043,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //查找居民当天挂号记录
        String date = DateUtil.dateToStr(new Date(),"yyyy-MM-dd");
        List<WlyyPatientRegisterDO>  patientRegisterDOs = patientRegisterDao.findByPatientAndDate(outpatientDO.getPatient(),date);
        List<WlyyPatientRegisterDO>  patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctor(outpatientDO.getPatient(),date,doctor);
        if(patientRegisterDOs!=null&&patientRegisterDOs.size()>0){
            WlyyPatientRegisterDO registerDO = patientRegisterDOs.get(0);
            //判断是否已经挂号,如果已经挂号
@ -1081,8 +1081,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //存储就诊记录
            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
            // 存储挂号医生与挂号科室
            registerDO.setDoctor(outpatientDO.getDoctor());
            registerDO.setDoctorName(outpatientDO.getDoctorName());
            registerDO.setDept(outpatientDO.getDept());
            registerDO.setDeptName(outpatientDO.getDeptName());
            registerDO.setPatient(outpatientDO.getPatient());
            registerDO.setPatientName(outpatientDO.getPatientName());
            //挂号流水号与挂号次数
            registerDO.setRegisterNo(serialNo);
            registerDO.setConNo(conNo);
            registerDO.setCreateTime(new Date());
@ -1100,6 +1107,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //存储就诊记录
            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
            registerDO.setDoctor(outpatientDO.getDoctor());
            registerDO.setDoctorName(outpatientDO.getDoctorName());
            registerDO.setDept(outpatientDO.getDept());
            registerDO.setDeptName(outpatientDO.getDeptName());
            registerDO.setPatient(outpatientDO.getPatient());
            registerDO.setPatientName(outpatientDO.getPatientName());
            registerDO.setRegisterNo(serialNo);
@ -1260,8 +1273,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //获取门诊记录
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outPatientId);
        //设置医嘱
        outpatientDO.setAdvice(advice);
        //========================处方操作=============================================================
        //创建处方记录
        List<WlyyPrescriptionDO> prescriptionDOs = prescriptionDao.findByOutpatientId(outPatientId);
        WlyyPrescriptionDO prescriptionDO = null;
@ -1279,10 +1294,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        prescriptionDO.setDoctorName(outpatientDO.getDoctorName());
        WlyyPrescriptionDO prescription = prescriptionDao.save(prescriptionDO);
        //========================处方操作结束=============================================================
        //加入处方状态变更流水日志
        prescriptionLogService.addPrescriptionLog(prescription.getId(),10,2,outpatientDO.getDoctor(),outpatientDO.getDoctorName(),"",new Date());
        //下诊断
        //============================下诊断==============================================================
        //删除之前诊断
        List<WlyyPrescriptionDiagnosisDO> ds = prescriptionDiagnosisDao.findByPrescriptionId(prescription.getId());
        if(ds!=null&&ds.size()>0){
@ -1304,11 +1321,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        prescriptionDiagnosisDao.save(diagnosisDOs);
        //存储icd10
        Icd10 = Icd10.substring(0,Icd10.length()-1);
        Icd10Name = Icd10Name.substring(0,Icd10Name.length()-1);
        outpatientDO.setIcd10(Icd10);
        outpatientDO.setIcd10Name(Icd10Name);
        outpatientDao.save(outpatientDO);
        //============================下诊断end==============================================================
        //判断是否有检查检验或药品开方
        if("1".equals(type)){
@ -1319,15 +1338,16 @@ 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());
            if(oldInfos!=null&&oldInfos.size()>0){
                prescriptionInfoDao.delete(oldInfos);
            }
            //his处方拼接开方条件
            com.alibaba.fastjson.JSONArray jsonData = new com.alibaba.fastjson.JSONArray();
            //存储药品,构建his开方入参
            if(StringUtils.isNotBlank(infoJsons)){
                //药品
@ -1340,16 +1360,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    //设置his药品查询条件
                    setInfoJsonParam(jsonData,doctorMappingDO,outpatientDO,prescriptionDO,info,Icd10);
                }
                //保存处方
                //保存药品信息
                prescriptionInfoDao.save(infoDOs);
            }
            //=====================药品操作=======================================================================
            //=====================检查检验=======================================================================
            //存储检查检验,构建his开方入参
            //删除之前检查检验
            List<WlyyInspectionDO> inspectionDels = wlyyInspectionDao.findByOutpatientId(outPatientId);
            if(inspectionDels!=null&&inspectionDels.size()>0){
                wlyyInspectionDao.delete(inspectionDels);
            }
            //存储检查检验,构建his开方入参
            if(StringUtils.isNotBlank(inspectionJson)){
                List<WlyyInspectionDO> inspections = (List<WlyyInspectionDO>) com.alibaba.fastjson.JSONArray.parseArray(inspectionJson, WlyyInspectionDO.class);
                for(WlyyInspectionDO ins:inspections){
@ -1364,11 +1388,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //保存检查检验。
                wlyyInspectionDao.save(inspections);
            }
            //=====================检查检验=======================================================================
            //上传his开方
            return sendHisDiagnosis(jsonData,outpatientDO,prescription);
        }else{
            //
            outpatientDO.setStatus("2");
            outpatientDao.save(outpatientDO);
            result.put("code",1);

+ 61 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/DoctorPreSignService.java

@ -0,0 +1,61 @@
package com.yihu.jw.hospital.prescription.service.entrance;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.dzqm.OauthDzqmConfigDO;
import com.yihu.jw.hospital.prescription.dao.OauthDzqmConfigDao;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
/**
 * Created by Trick on 2019/10/14.
 */
@Service
@Transactional
public class DoctorPreSignService {
    private static final Logger logger = LoggerFactory.getLogger(DoctorPreSignService.class);
    @Autowired
    private OauthDzqmConfigDao oauthDzqmConfigDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    /**
     * 获取医生签名
     * @param doctor
     * @return
     * @throws Exception
     */
    public JSONObject getDoctorSign(String doctor)throws Exception{
        logger.info("getDoctorSign doctor:"+doctor);
        BaseDoctorDO doc = doctorDao.findOne(doctor);
        OauthDzqmConfigDO dzqmConfigDO = oauthDzqmConfigDao.findOne("base_dzqm");
        Map<String,Object> params = new HashedMap();
        params.put("sys",dzqmConfigDO.getSys());
        params.put("idNumber",doc.getIdcard());
        params.put("idType",0);
        params.put("picType",0);
        HttpResponse httpResponse = HttpUtils.doGet(dzqmConfigDO.getUrl(),params);
        logger.info("getDoctorSign httpResponse:"+httpResponse.getContent());
        JSONObject jsonObject = (JSONObject)JSONObject.parse(httpResponse.getContent());
        return jsonObject;
    }
}

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -742,13 +742,13 @@ public class EntranceService {
            }
            if(StringUtils.isNotBlank(py_code)){
                py_code=py_code.toUpperCase();
                logger.info("py_code="+py_code);
//                logger.info("py_code="+py_code);
                sbs.append("<query compy=\"like\" item=\"py_code\" splice=\"and\" value=\"'%"+py_code+"%'\"/>");
            }
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            logger.info(fid+" resp:"+resp);
//            logger.info(fid+" resp:"+resp);
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }

+ 39 - 19
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java

@ -24,6 +24,7 @@ import org.springframework.util.LinkedCaseInsensitiveMap;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpErrorLogDao> {
@ -417,31 +418,50 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        int success = 0;
        int error = 0;
        List<MedicalSkillOrdersDO> medicalSkillOrdersDOs= medicalSkillOrdersDao.findMedicalSkillOrdersByAppTime(startDate,endDate);
        if(medicalSkillOrdersDOs != null && medicalSkillOrdersDOs.size() > 0){
            total = medicalSkillOrdersDOs.size();
            for(MedicalSkillOrdersDO medicalSkillOrdersDO :medicalSkillOrdersDOs ){
                String[] dept = depToSubject(medicalSkillOrdersDO.getAppDepCode().toString());
                String docInterId = achNsDoctorRecord(medicalSkillOrdersDO.getIdDoctor());
        String sql ="SELECT " +
                " i.id, " +
                " i.`code`, " +
                " i.dept, " +
                " o.doctor, " +
                " o.register_date " +
                " i.create_time, " +
                " p.`name`, " +
                " p.idcard, " +
                " p.mobile " +
                "FROM " +
                " wlyy_inspection i " +
                "JOIN wlyy_outpatient o ON o.id = i.outpatient_id  " +
                "JOIN base_patient p ON p.id = o.patient " +
                "WHERE " +
                " i.create_time >='"+startDate+"' " +
                " and i.create_time <='"+endDate+"'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
//        List<MedicalSkillOrdersDO> medicalSkillOrdersDOs= medicalSkillOrdersDao.findMedicalSkillOrdersByAppTime(startDate,endDate);
        if(list != null && list.size() > 0){
            total = list.size();
            for(Map<String,Object> ins :list ){
                String[] dept = depToSubject(ins.get("dept").toString());
                String docInterId = achNsDoctorRecord(ins.get("doctor").toString());
                JSONObject jb = new JSONObject();
                jb.put("id",orgCode + medicalSkillOrdersDO.getId());
                jb.put("id",orgCode + ins.get("id").toString());
                jb.put("cd_org", orgCode);
                jb.put("cd_area", orgArea);
                jb.put("cd_orgSub", orgSub);
                jb.put("app_time",medicalSkillOrdersDO.getAppTime().toString());
                jb.put("app_time",DateUtil.dateToStr(new Date((Long)ins.get("register_date")),"YYYY-MM-DD HH:mm:SS"));
                jb.put("app_dep_code", dept[0].toString());
                jb.put("app_class_code", medicalSkillOrdersDO.getAppClassCode());
                jb.put("app_class_code", ins.get(""));
                jb.put("id_doctor", docInterId);
                jb.put("fg_handle", medicalSkillOrdersDO.getFgHandle());
                jb.put("handle_time", medicalSkillOrdersDO.getHandleTime());
                jb.put("pt_name", medicalSkillOrdersDO.getPtName());
                jb.put("ge_code", medicalSkillOrdersDO.getGeCode());
                jb.put("card_type", "1");
                jb.put("id_no", medicalSkillOrdersDO.getIdNo());
                jb.put("pt_tel", medicalSkillOrdersDO.getPtTel());
//                jb.put("fg_handle", medicalSkillOrdersDO.getFgHandle());
//                jb.put("handle_time", medicalSkillOrdersDO.getHandleTime());
//                jb.put("pt_name", medicalSkillOrdersDO.getPtName());
//                jb.put("ge_code", medicalSkillOrdersDO.getGeCode());
//                jb.put("card_type", "1");
//                jb.put("id_no", medicalSkillOrdersDO.getIdNo());
//                jb.put("pt_tel", medicalSkillOrdersDO.getPtTel());
                jb.put("crt_date",DateUtil.dateToStrLong(DateUtil.getNow()));
                JSONArray jsonArray = new JSONArray();
@ -452,7 +472,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
                if("200".equals(resJson.get("msg").toString())){
                    success++;
                }else{
                    saveErrorLog("6",medicalSkillOrdersDO.getId().toString(),res);
//                    saveErrorLog("6",medicalSkillOrdersDO.getId().toString(),res);
                    error++;
                }
            }

+ 42 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dzqm/OauthDzqmConfigDO.java

@ -0,0 +1,42 @@
package com.yihu.jw.entity.hospital.dzqm;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2019/10/14.
 */
@Entity
@Table(name = "wlyy_http_log")
public class OauthDzqmConfigDO extends UuidIdentityEntity{
    private String sys;
    private String url;
    private String remark;
    public String getSys() {
        return sys;
    }
    public void setSys(String sys) {
        this.sys = sys;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}

+ 36 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPatientRegisterDO.java

@ -15,6 +15,10 @@ public class WlyyPatientRegisterDO extends UuidIdentityEntity {
    private String patient;//居民id
    private String patientName;//居民姓名
    private String doctor;//就诊医生
    private String doctorName;//就诊医生姓名
    private String dept;//部门
    private String deptName;//部门号
    private String conNo;//就诊次数
    private String registerNo;//挂号流水号',
    private String date;//yyyy-MM-dd',
@ -67,4 +71,36 @@ public class WlyyPatientRegisterDO extends UuidIdentityEntity {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getDept() {
        return dept;
    }
    public void setDept(String dept) {
        this.dept = dept;
    }
    public String getDeptName() {
        return deptName;
    }
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
}

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

@ -303,6 +303,8 @@ public class BaseHospitalRequestMapping {
        public static final String getTcChild="/getTcChild";
        public static final String getInsChild="/getInsChild";
        public static final String getDoctorPreSign ="/getDoctorPreSign";
    }

+ 10 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/event/ApplicationEvent.java

@ -1,6 +1,7 @@
package com.yihu.jw.event;
import com.yihu.jw.job.InternetUpdateJob;
import com.yihu.jw.job.PrescriptionOverdueJob;
import com.yihu.jw.job.PrescriptionStatusUpdateJob;
import com.yihu.jw.job.QuartzHelper;
import com.yihu.jw.util.SystemConf;
@ -36,6 +37,15 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
                logger.info("prescriptionStatus_update_job  job exist");
            }
            //门诊过期
            if (!quartzHelper.isExistJob("prescription_overdue_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prescription_overdue_job");
                quartzHelper.addJob(PrescriptionOverdueJob.class, trigger, "prescription_overdue_job", new HashMap<String, Object>());
                logger.info("prescription_overdue_job  job success");
            } else {
                logger.info("prescription_overdue_job  job exist");
            }
            //互联网医院 监管平台上报 job
            if (!quartzHelper.isExistJob("internet_update_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("internet_update_job");

+ 1 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/InternetUpdateJob.java

@ -38,7 +38,7 @@ public class InternetUpdateJob implements Job {
            logger.info("START========2.6 网上医技预约上传开始========");
            res = internetService.upMedicalOnline(startDate,endDate);
            logger.info("END==========2.5 网上医技预约上传结束========" + res);
            logger.info("END==========2.6 网上医技预约上传结束========" + res);
            logger.info("START========2.7 医生评价信息开始========");
            res = internetService.upNsDoctorScore(startDate,endDate);

+ 30 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/PrescriptionOverdueJob.java

@ -0,0 +1,30 @@
package com.yihu.jw.job;
import com.yihu.jw.service.channel.PrescriptionStatusUpdateService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * Created by Trick on 2019/10/15.
 */
public class PrescriptionOverdueJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(InternetUpdateJob.class);
    @Autowired
    private PrescriptionStatusUpdateService prescriptionStatusUpdateService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========PrescriptionOverdueJob========");
        try {
            prescriptionStatusUpdateService.setOutPatientOver();
            logger.info("END========PrescriptionOverdueJob========");
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("END===ERROE===PrescriptionOverdueJob,message:"+e.getMessage());
        }
    }
}

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

@ -261,7 +261,32 @@ public class PrescriptionStatusUpdateService {
    }
//    public void setOutPatientOver(){
//        outpatientDao.
//    }
    /**
     * 设置门诊为已完成
     */
    public void setOutPatientOver(){
        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("1");
            if(outpatientDOs!=null&&outpatientDOs.size()>0){
                for(WlyyOutpatientDO outpatientDO:outpatientDOs){
                    outpatientDO.setStatus("2");
                }
                outpatientDao.save(outpatientDOs);
                logger.info("setOutPatientOver count :"+outpatientDOs.size());
            }else {
                logger.info("setOutPatientOver count :"+0);
            }
        }else{
            logger.info("setOutPatientOver Time is not up ");
        }
        logger.info("setOutPatientOver end ");
    }
}

+ 13 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -1,6 +1,7 @@
package com.yihu.jw.web.quota;
import com.yihu.jw.internet.service.InternetService;
import com.yihu.jw.job.PrescriptionOverdueJob;
import com.yihu.jw.job.PrescriptionStatusUpdateJob;
import com.yihu.jw.job.QuartzHelper;
import com.yihu.jw.service.quota.JobService;
@ -207,6 +208,18 @@ public class JobController extends BaseController {
        }
    }
    @RequestMapping(value = "/PrescriptionOverdueJob", method = RequestMethod.POST)
    @ApiOperation("门诊过期")
    public String PrescriptionOverdueJob() {
        try {
            quartzHelper.startNow(PrescriptionOverdueJob.class, UUID.randomUUID().toString(), null);
            return write(200, "启动成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "启动失败");
        }
    }
    @RequestMapping(value = "/internetUpload", method = RequestMethod.GET)
    @ApiOperation("监管平台测试")
    public String internetUpload(String taskId) {

+ 3 - 0
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -2,5 +2,8 @@
# 健康频道状态
prescriptionStatus_update_job=0 */2 * * * ?
# 门诊记录过期job,每天1 点触发
prescription_overdue_job=0 0 1 * * ?
#每天1 点触发
internet_update_job=0 0 1 * * ?

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

@ -4,6 +4,7 @@ import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.prescription.service.InspectionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.DoctorPreSignService;
import com.yihu.jw.restmodel.base.dict.DictHospitalDeptVO;
import com.yihu.jw.restmodel.base.org.BaseOrgVO;
import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
@ -51,6 +52,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private InspectionService inspectionService;
    @Autowired
    private DoctorPreSignService doctorPreSignService;
    @Value("${demo.flag}")
    private boolean demoFlag;
@ -722,4 +726,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "flag",defaultValue = "1") String flag) throws Exception {
        return success(prescriptionService.getTcxz(charge_code,tc_no,flag));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getDoctorPreSign)
    @ApiOperation(value = "获取医生签名")
    public ObjEnvelop getDoctorPreSign(@ApiParam(name = "doctor", value = "医生编码")
                                         @RequestParam(value = "doctor",required = false) String doctor)throws Exception{
        return success(doctorPreSignService.getDoctorSign(doctor));
    }
}