Trick преди 5 години
родител
ревизия
50b2346003

+ 4 - 53
business/base-service/src/main/java/com/yihu/jw/hospital/appointment/service/AppointmentService.java

@ -75,23 +75,18 @@ public class AppointmentService extends BaseJpaService<WlyyAppointmentDO, WlyyAp
    /**
     * 获取预约记录列表
     * @param patient
     * @param idcard
     * @param doctor
     * @param doctorName
     * @param opId
     * @param dept
     * @param startDate
     * @param endDate
     * @param chargeType
     * @return
     * @throws Exception
     */
    public JSONArray getAppointmentList(String patient,String doctor,String doctorName,String opId,String startDate,String endDate,String chargeType)throws Exception{
    public JSONArray getAppointmentList(String idcard,String doctor,String doctorName,String dept,String startDate,String endDate,String chargeType)throws Exception{
        logger.info("getAppointmentList :");
        String patientMappingId = null;
        if(StringUtils.isNotBlank(patient)){
            patientMappingId = patientMappingService.findHisPatNoByPatient(patient);
            logger.info("getAppointmentList patientMappingId:"+patientMappingId);
        }
        String doctorMappingId = null;
        if(StringUtils.isNotBlank(doctor)){
@ -102,15 +97,7 @@ public class AppointmentService extends BaseJpaService<WlyyAppointmentDO, WlyyAp
            }
        }
        String opDoctorId = null;
        if(StringUtils.isNotBlank(opId)){
            DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(opId,"350211A1002");
            if(doctorMappingDO!=null){
                opDoctorId = doctorMappingDO.getMappingCode();
                logger.info("getAppointmentList opDoctorId:"+opDoctorId);
            }
        }
        return registerService.BS10047(patientMappingId,doctorMappingId,doctorName,opDoctorId,startDate,endDate,chargeType,demoFlag);
        return registerService.BS10047(idcard,doctorMappingId,doctorName,dept,startDate,endDate,chargeType,demoFlag);
    }
    /**
@ -126,32 +113,6 @@ public class AppointmentService extends BaseJpaService<WlyyAppointmentDO, WlyyAp
        RegisterAmVO registerAmVO = objectMapper.readValue(appointmentJson,RegisterAmVO.class);
        //查找居民映射id
        if(StringUtils.isNotBlank(registerAmVO.getPatientId())){
            String patientMappingId = patientMappingService.findHisPatNoByPatient(registerAmVO.getPatientId());
            if(StringUtils.isBlank(patientMappingId)){
                throw new RuntimeException("未找到居民卡信息");
            }
            registerAmVO.setPatientId(patientMappingId);
        }else{
            throw new RuntimeException("未找到居民卡信息");
        }
        //查找医生映射id
        if(StringUtils.isNotBlank(registerAmVO.getAppType())){
            DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(registerAmVO.getAppType(),"350211A1002");
            if(doctorMappingDO!=null){
                String doctorMappingId = doctorMappingDO.getMappingCode();
                if(StringUtils.isBlank(doctorMappingId)){
                    throw new RuntimeException("未找医生映射信息");
                }
                registerAmVO.setAppType(doctorMappingId);
            }else{
                throw new RuntimeException("未找医生映射信息");
            }
        }else{
            throw new RuntimeException("医生信息为空");
        }
        if(StringUtils.isNotBlank(registerAmVO.getDoctor())){
            DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(registerAmVO.getDoctor(),"350211A1002");
@ -191,16 +152,6 @@ public class AppointmentService extends BaseJpaService<WlyyAppointmentDO, WlyyAp
    public net.sf.json.JSONObject cancelAppointment(String appointmentJson)throws Exception{
        RegisterAmVO registerAmVO = objectMapper.readValue(appointmentJson,RegisterAmVO.class);
        //查找居民映射id
        if(StringUtils.isNotBlank(registerAmVO.getPatientId())){
            String patientMappingId = patientMappingService.findHisPatNoByPatient(registerAmVO.getPatientId());
            if(StringUtils.isBlank(patientMappingId)){
                throw new RuntimeException("未找到居民卡信息");
            }
            registerAmVO.setPatientId(patientMappingId);
        }else{
            throw new RuntimeException("未找到居民卡信息");
        }
        //查找医生映射id
        if(StringUtils.isNotBlank(registerAmVO.getDoctor())){

+ 18 - 17
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/RegisterService.java

@ -64,7 +64,7 @@ public class RegisterService {
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>"+sourceSysCode+"</SourceSysCode><TargetSysCode>"+targetSysCode+"</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>10</endNum>");
            sbs.append("<MsgInfo><endNum>20000</endNum>");
            sbs.append(" <Msg>");
            sbs.append(" and (request_day between '"+startDate+"' and '"+endDate+"') ");
            if(StringUtils.isNotBlank(dept)){
@ -113,7 +113,7 @@ public class RegisterService {
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>"+sourceSysCode+"</SourceSysCode><TargetSysCode>"+targetSysCode+"</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>10</endNum>");
            sbs.append("<MsgInfo><endNum>20000</endNum>");
            sbs.append(" <Msg/>");
            sbs.append(" <query compy=\"=\" item=\"unit_code\" splice=\"and\" value=\"'"+dept+"'\"/>");
            sbs.append(" <query compy=\"=\" item=\"doctor_code\" splice=\"and\" value=\"'"+doctor_code+"'\"/>");
@ -130,10 +130,10 @@ public class RegisterService {
    /**
     * BS10047 病人预约结果表 2.00
     * @param req_id 病人ID
     * @param social_no 病人ID
     * @param doctor_code   医生ID
     * @param doctor_name   医生名称支持模糊
     * @param op_id 预约医生
     * @param unit_code 部门
     * @param startDate 开始时间
     * @param endDate 结束时间
     * @param reg_type 号别
@ -141,7 +141,7 @@ public class RegisterService {
     * @return
     * @throws Exception
     */
    public JSONArray BS10047(String req_id,String doctor_code,String doctor_name,String op_id,String startDate,String endDate,String reg_type,boolean demoFlag) throws Exception {
    public JSONArray BS10047(String social_no,String doctor_code,String doctor_name,String unit_code,String startDate,String endDate,String reg_type,boolean demoFlag) throws Exception {
        String fid="BS10047";
        String resp="";
        if (demoFlag) {
@ -153,10 +153,10 @@ public class RegisterService {
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>"+sourceSysCode+"</SourceSysCode><TargetSysCode>"+targetSysCode+"</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>10</endNum>");
            sbs.append("<Msg");
            if(StringUtils.isNotBlank(req_id)){
                sbs.append(" and req_id = '"+req_id+"' ");
            sbs.append("<MsgInfo><endNum>20000</endNum>");
            sbs.append("<Msg>");
            if(StringUtils.isNotBlank(social_no)){
                sbs.append(" and social_no = '"+social_no+"' ");
            }
            if(StringUtils.isNotBlank(doctor_code)){
                sbs.append(" and doctor_code = '"+doctor_code+"' ");
@ -164,8 +164,8 @@ public class RegisterService {
            if(StringUtils.isNotBlank(doctor_name)){
                sbs.append(" and doctor_name like '%"+doctor_name+"%' ");
            }
            if(StringUtils.isNotBlank(op_id)){
                sbs.append(" and op_id = '"+op_id+"' ");
            if(StringUtils.isNotBlank(unit_code)){
                sbs.append(" and unit_code = '"+unit_code+"' ");
            }
            if(StringUtils.isNotBlank(startDate)){
                sbs.append(" and request_day >= '"+startDate+"' ");
@ -203,21 +203,22 @@ public class RegisterService {
            sbs.append("<ESBEntry><AccessControl><Fid>" + fid + "</Fid><UserName>"+mqUser+"</UserName><Password>"+mqPwd+"</Password></AccessControl>");
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>"+sourceSysCode+"</SourceSysCode><TargetSysCode>"+targetSysCode+"</TargetSysCode></MessageHeader>");
            sbs.append("</Msg>");
            sbs.append("<Msg/>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>10</endNum>");
            sbs.append("<MsgInfo><endNum>20000</endNum>");
            sbs.append(" <query item=\"DeptCode\" value=\""+registerAmVO.getDept()+"\"/>");
            sbs.append(" <query item=\"DocCode\" value=\""+registerAmVO.getDoctor()+"\"/>");
            sbs.append(" <query item=\"SectionType\" value=\""+registerAmVO.getSectionType()+"\"/>");
            sbs.append(" <query item=\"StartTime\" value=\""+registerAmVO.getStartTime()+"\"/>");
            sbs.append(" <query item=\"PatientName\" value=\""+registerAmVO.getPatientName()+"\"/>");
            sbs.append(" <query item=\"PatientID\" value=\""+registerAmVO.getPatientId()+"\"/>");
            sbs.append(" <query item=\"PatientID\" value=\""+registerAmVO.getIdcard()+"\"/>");
            sbs.append(" <query item=\"PatientPhone\" value=\""+registerAmVO.getPatientPhone()+"\"/>\n");
            sbs.append(" <query item=\"app_type\" value=\""+registerAmVO.getAppType()+"\"/>");
            sbs.append(" <query item=\"app_type\" value=\"XS\"/>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            logger.info(fid+" resp:"+resp);
        }
        return ConvertUtil.convertListEnvelopInRequest(resp);
    }
@ -242,13 +243,13 @@ public class RegisterService {
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>"+sourceSysCode+"</SourceSysCode><TargetSysCode>"+targetSysCode+"</TargetSysCode></MessageHeader>");
            sbs.append("</Msg>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>10</endNum>");
            sbs.append("<MsgInfo><endNum>20000</endNum>");
            sbs.append(" <query item=\"DeptCode\" value=\""+registerAmVO.getDept()+"\"/>");
            sbs.append(" <query item=\"DocCode\" value=\""+registerAmVO.getDoctor()+"\"/>");
            sbs.append(" <query item=\"SectionType\" value=\""+registerAmVO.getSectionType()+"\"/>");
            sbs.append(" <query item=\"StartTime\" value=\""+registerAmVO.getStartTime()+"\"/>");
            sbs.append(" <query item=\"PatientName\" value=\""+registerAmVO.getPatientName()+"\"/>");
            sbs.append(" <query item=\"PatientID\" value=\""+registerAmVO.getPatientId()+"\"/>");
            sbs.append(" <query item=\"PatientID\" value=\""+registerAmVO.getIdcard()+"\"/>");
            sbs.append(" <query item=\"PatientPhone\" value=\""+registerAmVO.getPatientPhone()+"\"/>\n");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");

+ 12 - 21
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/appointment/WlyyAppointmentDO.java

@ -20,11 +20,10 @@ public class WlyyAppointmentDO extends UuidIdentityEntity {
    private String patient;//病人',
    private String patientName;//居民名称',
    private String patientPhone;//居民电话',
    private String idcard;//居民身份证
    private Integer type;//1 自己预约 2.代理预约',
    private String sectionType;//上午:AM 和 下午:PM,',
    private Date startTime;//预约时间',
    private String appType;//'代理医生工号',
    private String appTypeName;//代理医生名称',
    private String startTime;//预约时间',
    private Integer status;//1预约成功,0预约失败 -1预约取消',
    private String httpLog;//结果记录
    private Date createTime;//创建时间
@ -101,30 +100,14 @@ public class WlyyAppointmentDO extends UuidIdentityEntity {
        this.sectionType = sectionType;
    }
    public Date getStartTime() {
    public String getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }
    public String getAppType() {
        return appType;
    }
    public void setAppType(String appType) {
        this.appType = appType;
    }
    public String getAppTypeName() {
        return appTypeName;
    }
    public void setAppTypeName(String appTypeName) {
        this.appTypeName = appTypeName;
    }
    public Integer getStatus() {
        return status;
    }
@ -148,4 +131,12 @@ public class WlyyAppointmentDO extends UuidIdentityEntity {
    public void setHttpLog(String httpLog) {
        this.httpLog = httpLog;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
}

+ 14 - 5
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/register/RegisterAmVO.java

@ -21,7 +21,8 @@ public class RegisterAmVO {
    private String sectionType;
    private String startTime;
    private String patientName;
    private String patientId;
    private String patient;
    private String idcard;//居民身份证
    private String patientPhone;
    private String appType;
@ -65,12 +66,12 @@ public class RegisterAmVO {
        this.patientName = patientName;
    }
    public String getPatientId() {
        return patientId;
    public String getPatient() {
        return patient;
    }
    public void setPatientId(String patientId) {
        this.patientId = patientId;
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getPatientPhone() {
@ -88,4 +89,12 @@ public class RegisterAmVO {
    public void setAppType(String appType) {
        this.appType = appType;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
}

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

@ -47,18 +47,10 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            }
            //互联网医院 监管平台上报
            String trigger = SystemConf.getInstance().getSystemProperties().getProperty("internet_update_job");
            // 2.3 网上预约挂号上传  job
//            if (!quartzHelper.isExistJob("data_upload_23_job")) {
//                quartzHelper.addJob(DataUpload23Job.class, trigger, "data_upload_23_job", new HashMap<String, Object>());
//                logger.info("data_upload_23_job  job success");
//            } else {
//                logger.info("data_upload_23_job  job exist");
//            }
            //2.5 网上预约挂号上传
            if (!quartzHelper.isExistJob("data_upload_25_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_25_job");
                quartzHelper.addJob(DataUpload25Job.class, trigger, "data_upload_25_job", new HashMap<String, Object>());
                logger.info("data_upload_25_job  job success");
            } else {
@ -67,6 +59,7 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            //2.6 网上医技预约上传开始
            if (!quartzHelper.isExistJob("data_upload_26_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_26_job");
                quartzHelper.addJob(DataUpload26Job.class, trigger, "data_upload_26_job", new HashMap<String, Object>());
                logger.info("data_upload_26_job  job success");
            } else {
@ -75,6 +68,7 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            //2.7 医生评价信息开始
            if (!quartzHelper.isExistJob("data_upload_27_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_27_job");
                quartzHelper.addJob(DataUpload27Job.class, trigger, "data_upload_27_job", new HashMap<String, Object>());
                logger.info("data_upload_27_job  job success");
            } else {
@ -83,6 +77,7 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            //2.8 网络咨询服务信息开始
            if (!quartzHelper.isExistJob("data_upload_28_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_28_job");
                quartzHelper.addJob(DataUpload28Job.class, trigger, "data_upload_28_job", new HashMap<String, Object>());
                logger.info("data_upload_28_job  job success");
            } else {
@ -91,6 +86,7 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            //2.9 网络诊疗服务信息
            if (!quartzHelper.isExistJob("data_upload_29_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_29_job");
                quartzHelper.addJob(DataUpload29Job.class, trigger, "data_upload_29_job", new HashMap<String, Object>());
                logger.info("data_upload_29_job  job success");
            } else {
@ -99,6 +95,7 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            //2.10 电子处方表
            if (!quartzHelper.isExistJob("data_upload_210_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_210_job");
                quartzHelper.addJob(DataUpload210Job.class, trigger, "data_upload_210_job", new HashMap<String, Object>());
                logger.info("data_upload_210_job  job success");
            } else {
@ -107,6 +104,7 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            //2.11 电子处方_药品明细表
            if (!quartzHelper.isExistJob("data_upload_211_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_211_job");
                quartzHelper.addJob(DataUpload211Job.class, trigger, "data_upload_211_job", new HashMap<String, Object>());
                logger.info("data_upload_211_job  job success");
            } else {

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

@ -70,6 +70,20 @@ public class JobController extends BaseController {
        }
    }
    @RequestMapping(value = "isExist", method = RequestMethod.GET)
    public String isExist(String id) {
        try {
            if(quartzHelper.isExistJob(id)){
                return success("启动成功!");
            }
            return success("启动失败!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
        }
    }
    /**
     * 生成过去几天的数据
     *

+ 13 - 1
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -6,4 +6,16 @@ prescriptionStatus_update_job=0 */2 * * * ?
prescription_overdue_job=0 0 1 * * ?
#每天1 点触发
internet_update_job=0 0 1 * * ?
data_upload_25_job=0 0 1 * * ?
data_upload_26_job=0 0 1 * * ?
data_upload_27_job=0 0 1 * * ?
data_upload_28_job=0 0 1 * * ?
data_upload_29_job=0 0 1 * * ?
data_upload_210_job=0 0 1 * * ?
data_upload_211_job=0 0 1 * * ?

+ 5 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/appointment/AppointmentEndPoint.java

@ -59,21 +59,21 @@ public class AppointmentEndPoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Appointment.getAppointmentList)
    @ApiOperation(value = "获取预约记录列表")
    public ListEnvelop getAppointmentList(@ApiParam(name = "patient", value = "患者ID")
                                          @RequestParam(value = "patient",required = false) String patient,
    public ListEnvelop getAppointmentList(@ApiParam(name = "idcard", value = "患者idcard")
                                          @RequestParam(value = "idcard",required = false) String idcard,
                                          @ApiParam(name = "doctor", value = "医生ID精确查询")
                                          @RequestParam(value = "doctor",required = false)String doctor,
                                          @ApiParam(name = "doctorName", value = "医生姓名模糊")
                                          @RequestParam(value = "doctorName",required = false)String doctorName,
                                          @ApiParam(name = "opId", value = "操作医生")
                                          @RequestParam(value = "opId",required = false)String opId,
                                          @ApiParam(name = "dept", value = "部门")
                                          @RequestParam(value = "dept",required = false)String dept,
                                          @ApiParam(name = "chargeType", value = "号别")
                                          @RequestParam(value = "chargeType",required = false)String chargeType,
                                          @ApiParam(name = "startDate", value = "开始时间")
                                          @RequestParam(value = "startDate",required = true)String startDate,
                                          @ApiParam(name = "endDate", value = "结束时间")
                                          @RequestParam(value = "endDate",required = true)String endDate) throws Exception {
        return success(appointmentService.getAppointmentList(patient,doctor,doctorName,opId,startDate,endDate,chargeType));
        return success(appointmentService.getAppointmentList(idcard,doctor,doctorName,dept,startDate,endDate,chargeType));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Appointment.makeAppointment)