Browse Source

预约挂号

Trick 5 years ago
parent
commit
84e5a6ef9b

+ 12 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/appointment/dao/WlyyAppointmentDao.java

@ -0,0 +1,12 @@
package com.yihu.jw.hospital.appointment.dao;
import com.yihu.jw.entity.hospital.appointment.WlyyAppointmentDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2019/10/29.
 */
public interface WlyyAppointmentDao extends PagingAndSortingRepository<WlyyAppointmentDO, String>, JpaSpecificationExecutor<WlyyAppointmentDO> {
}

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

@ -0,0 +1,235 @@
package com.yihu.jw.hospital.appointment.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.hospital.appointment.WlyyAppointmentDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.hospital.appointment.dao.WlyyAppointmentDao;
import com.yihu.jw.hospital.mapping.service.DoctorMappingService;
import com.yihu.jw.hospital.mapping.service.PatientMappingService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.RegisterService;
import com.yihu.jw.restmodel.hospital.register.RegisterAmVO;
import com.yihu.mysql.query.BaseJpaService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
 * Created by Trick on 2019/10/29.
 */
@Service
@Transactional
public class AppointmentService extends BaseJpaService<WlyyAppointmentDO, WlyyAppointmentDao> {
    private static final Logger logger = LoggerFactory.getLogger(PrescriptionService.class);
    @Autowired
    private RegisterService registerService;
    @Autowired
    private DoctorMappingService doctorMappingService;
    @Autowired
    private PatientMappingService patientMappingService;
    @Autowired
    private WlyyAppointmentDao wlyyAppointmentDao;
    @Autowired
    private ObjectMapper objectMapper;
    @Value("${demo.flag}")
    private boolean demoFlag;
    /**
     * 获取医生号源
     * @param dept
     * @param docMappingCode
     * @param specialCode
     * @param startDate
     * @param endDate
     * @return
     * @throws Exception
     */
    public JSONArray getDoctorSchedule(String dept, String docMappingCode,String nameKey,String specialCode,String chargeType,String startDate,String endDate)throws Exception{
        logger.info("getDoctorSchedule :");
        return registerService.BS10045(dept,docMappingCode,nameKey,specialCode,chargeType,startDate,endDate,demoFlag);
    }
    /**
     * 获取医生具体号源时间
     * @param dept
     * @param docMappingCode
     * @param date
     * @return
     * @throws Exception
     */
    public JSONArray getDoctorScheduleTime(String dept,String docMappingCode,String date,String ampm)throws Exception{
        logger.info("getDoctorScheduleTime :");
        return registerService.BS10046(dept,docMappingCode,date,ampm,demoFlag);
    }
    /**
     * 获取预约记录列表
     * @param patient
     * @param doctor
     * @param doctorName
     * @param opId
     * @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{
        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)){
            DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(doctor,"350211A1002");
            if(doctorMappingDO!=null){
                doctorMappingId = doctorMappingDO.getMappingCode();
                logger.info("getAppointmentList doctorMappingId:"+doctorMappingId);
            }
        }
        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);
    }
    /**
     * 预约
     * @param appointmentJson
     * @return
     * @throws Exception
     */
    public WlyyAppointmentDO makeAppointment(String appointmentJson)throws Exception{
        logger.info("getAppointmentList :");
        WlyyAppointmentDO wlyyAppointmentDO = objectMapper.readValue(appointmentJson,WlyyAppointmentDO.class);
        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");
            if(doctorMappingDO!=null){
                String doctorMappingId = doctorMappingDO.getMappingCode();
                if(StringUtils.isBlank(doctorMappingId)){
                    throw new RuntimeException("未找医生映射信息");
                }
                registerAmVO.setDoctor(doctorMappingId);
            }else{
                throw new RuntimeException("未找医生映射信息");
            }
        }else{
            throw new RuntimeException("医生信息为空");
        }
        net.sf.json.JSONObject res = registerService.BS10048(registerAmVO,demoFlag);
        logger.info(res.toString());
        wlyyAppointmentDO.setCreateTime(new Date());
        wlyyAppointmentDO.setStatus(2);
        wlyyAppointmentDO.setType(1);
        wlyyAppointmentDO.setHttpLog(res.toString());
        wlyyAppointmentDao.save(wlyyAppointmentDO);
        return wlyyAppointmentDO;
    }
    /**
     * 取消预约
     * @param appointmentJson
     * @return
     * @throws Exception
     */
    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())){
            DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(registerAmVO.getDoctor(),"350211A1002");
            if(doctorMappingDO!=null){
                String doctorMappingId = doctorMappingDO.getMappingCode();
                if(StringUtils.isBlank(doctorMappingId)){
                    throw new RuntimeException("未找医生映射信息");
                }
                registerAmVO.setDoctor(doctorMappingId);
            }else{
                throw new RuntimeException("未找医生映射信息");
            }
        }else{
            throw new RuntimeException("医生信息为空");
        }
        net.sf.json.JSONObject res = registerService.BS10049(registerAmVO,demoFlag);
        logger.info(res.toString());
        return  res;
    }
    /**
     * 根据映射id查询互联网医生ID
     * @param mappingCode
     * @return
     */
    public DoctorMappingDO getDoctorByMappingCode(String mappingCode){
        return doctorMappingService.findByOrgCodeAndMappingCode("350211A1002",mappingCode);
    }
}

+ 8 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/mapping/service/DoctorMappingService.java

@ -23,4 +23,12 @@ public class DoctorMappingService {
        }
        return null;
    }
    public DoctorMappingDO findByOrgCodeAndMappingCode(String orgCode,String mappingCode){
        List<DoctorMappingDO> list = doctorMappingDao.findByOrgCodeAndMappingCode(orgCode,mappingCode);
        if(list!=null&&list.size()>0){
            return list.get(0);
        }
        return null;
    }
}

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

@ -3874,5 +3874,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return doctorMappingService.findMappingCode(doctor,orgCode);
    }
    /**
     * 获取医生简介
     * @param doctorCode
     * @return
     * @throws Exception
     */
    public net.sf.json.JSON getDoctorIntroduction(String doctorCode) throws Exception {
        DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(doctorCode,"350211A1002");
        if(doctorMappingDO==null){
            throw new RuntimeException("未找到医生映射信息");
        }
        return entranceService.BS16010(doctorMappingDO.getMappingCode(),demoFlag);
    }
}

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

@ -51,7 +51,8 @@ public class RegisterService {
     * @return
     * @throws Exception
     */
    public JSONArray BS10045(String dept,String doctor_code,String special_code,String startDate,String endDate, boolean demoFlag) throws Exception {
    public JSONArray BS10045(String dept,String doctor_code,String doctor_name,String special_code,String charge_type,String startDate,String endDate, boolean demoFlag) throws Exception {
        logger.info("BS10045:");
        String fid="BS10045";
        String resp="";
        if (demoFlag) {
@ -69,12 +70,19 @@ public class RegisterService {
            if(StringUtils.isNotBlank(doctor_code)){
                sbs.append(" and doctor_code ='"+doctor_code+"'");
            }
            if(StringUtils.isNotBlank(doctor_name)){
                sbs.append(" and doctor_name like '%"+doctor_name+"%'");
            }
            if(StringUtils.isNotBlank(charge_type)){
                sbs.append(" and charge_type ='"+charge_type+"'");
            }
            if(StringUtils.isNotBlank(special_code)){
                sbs.append(" and special_code ='"+special_code+"'");
            }
            sbs.append(" order by request_day,ampm");
            sbs.append(" </Msg>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        }
@ -90,7 +98,7 @@ public class RegisterService {
     * @return
     * @throws Exception
     */
    public JSONArray BS10046(String dept,String doctor_code,String date, boolean demoFlag) throws Exception {
    public JSONArray BS10046(String dept,String doctor_code,String date,String ampm, boolean demoFlag) throws Exception {
        String fid="BS10046";
        String resp="";
        if (demoFlag) {
@ -103,12 +111,12 @@ 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("<MsgInfo><endNum>10</endNum>");
            sbs.append(" </Msg>");
            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+"'\"/>");
            sbs.append(" <query compy=\"=\" item=\"CONVERT(varchar(100),yy_time,23)\" splice=\"and\" value=\"'"+date+"'\"/>");
            sbs.append(" <query compy=\"=\" item=\"yy_status\" splice=\"and\" value=\"'0'\"/>");
            sbs.append(" <query compy=\"=\" item=\"ampm\" splice=\"and\" value=\"'p'\"/>");
            sbs.append(" </Msg>");
            sbs.append(" <query compy=\"=\" item=\"ampm\" splice=\"and\" value=\"'"+ampm+"'\"/>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
@ -116,14 +124,21 @@ public class RegisterService {
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    /**
     * BS10047 病人预约结果表 2.00
     * @param req_id
     * @param req_id 病人ID
     * @param doctor_code   医生ID
     * @param doctor_name   医生名称支持模糊
     * @param op_id 预约医生
     * @param startDate 开始时间
     * @param endDate 结束时间
     * @param reg_type 号别
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public JSONArray BS10047(String req_id, boolean demoFlag) 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 {
        String fid="BS10047";
        String resp="";
        if (demoFlag) {
@ -136,7 +151,29 @@ 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("<MsgInfo><endNum>10</endNum>");
            sbs.append("<Msg>and req_id = '"+req_id+"'</Msg>");
            sbs.append("<Msg");
            if(StringUtils.isNotBlank(req_id)){
                sbs.append(" and req_id = '"+req_id+"' ");
            }
            if(StringUtils.isNotBlank(doctor_code)){
                sbs.append(" and doctor_code = '"+doctor_code+"' ");
            }
            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(startDate)){
                sbs.append(" and request_day >= '"+startDate+"' ");
            }
            if(StringUtils.isNotBlank(endDate)){
                sbs.append(" and request_day <= '"+endDate+"' ");
            }
            if(StringUtils.isNotBlank(reg_type)){
                sbs.append(" and reg_type = '"+reg_type+"' ");
            }
            sbs.append("</Msg>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
@ -152,7 +189,7 @@ public class RegisterService {
     * @return
     * @throws Exception
     */
    public JSONArray BS10048(RegisterAmVO registerAmVO, boolean demoFlag) throws Exception {
    public net.sf.json.JSONObject BS10048(RegisterAmVO registerAmVO, boolean demoFlag) throws Exception {
        String fid="BS10048";
        String resp="";
        if (demoFlag) {
@ -179,7 +216,7 @@ public class RegisterService {
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
        return ConvertUtil.convertListEnvelopInRequest(resp);
    }
    /**
@ -189,7 +226,7 @@ public class RegisterService {
     * @return
     * @throws Exception
     */
    public JSONArray BS10049(RegisterAmVO registerAmVO, boolean demoFlag) throws Exception {
    public net.sf.json.JSONObject BS10049(RegisterAmVO registerAmVO, boolean demoFlag) throws Exception {
        String fid="BS10049";
        String resp="";
        if (demoFlag) {
@ -215,7 +252,7 @@ public class RegisterService {
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
        return ConvertUtil.convertListEnvelopInRequest(resp);
    }

+ 151 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/appointment/WlyyAppointmentDO.java

@ -0,0 +1,151 @@
package com.yihu.jw.entity.hospital.appointment;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Trick on 2019/10/29.
 */
@Entity
@Table(name = "wlyy_appointment")
public class WlyyAppointmentDO extends UuidIdentityEntity {
    private String dept;//预约科室code',
    private String deptName;//预约科室',
    private String doctor;//医生',
    private String doctorName;//医生名称',
    private String patient;//病人',
    private String patientName;//居民名称',
    private String patientPhone;//居民电话',
    private Integer type;//1 自己预约 2.代理预约',
    private String sectionType;//上午:AM 和 下午:PM,',
    private Date startTime;//预约时间',
    private String appType;//'代理医生工号',
    private String appTypeName;//代理医生名称',
    private Integer status;//1预约成功,0预约失败 -1预约取消',
    private String httpLog;//结果记录
    private Date createTime;//创建时间
    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;
    }
    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 getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public String getPatientPhone() {
        return patientPhone;
    }
    public void setPatientPhone(String patientPhone) {
        this.patientPhone = patientPhone;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getSectionType() {
        return sectionType;
    }
    public void setSectionType(String sectionType) {
        this.sectionType = sectionType;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date 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;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getHttpLog() {
        return httpLog;
    }
    public void setHttpLog(String httpLog) {
        this.httpLog = httpLog;
    }
}

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

@ -21,6 +21,18 @@ public class BaseHospitalRequestMapping {
        public static final String STATUS = "/status";
    }
    public static class Appointment extends BaseHospitalRequestMapping.Basic{
        public static final String PREFIX  = "/appointment";
        public static final String getDoctorSchedule = "/getDoctorSchedule";
        public static final String getDoctorScheduleTime = "/getDoctorScheduleTime";
        public static final String getAppointmentList = "/getAppointmentList";
        public static final String makeAppointment = "/makeAppointment";
        public static final String cancelAppointment = "/cancelAppointment";
        public static final String getDoctorByMappingCode = "/getDoctorByMappingCode";
    }
    public static class Prescription extends BaseHospitalRequestMapping.Basic {
        public static final String PREFIX  = "/prescription";
@ -305,7 +317,7 @@ public class BaseHospitalRequestMapping {
        public static final String getDoctorPreSign ="/getDoctorPreSign";
        public static final String getDoctorIntroduction ="/getDoctorIntroduction";
    }

+ 20 - 18
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java

@ -488,18 +488,14 @@ public class MqSdkController extends EnvelopRestEndpoint {
    @GetMapping(value = "/BS10045")
    @ApiOperation(value = "预约排班号源")
    public ObjEnvelop BS10045(
            @ApiParam(name = "dept", value = "部门")
            @RequestParam(value = "dept",defaultValue = "") String dept,
            @ApiParam(name = "doctor_code", value = "医生")
            @RequestParam(value = "doctor_code",defaultValue = "")String doctor_code,
            @ApiParam(name = "special_code", value = "科目")
            @RequestParam(value = "special_code",defaultValue = "")String special_code,
            @ApiParam(name = "startDate", value = "开始时间")
            @RequestParam(value = "startDate",defaultValue = "")String startDate,
            @ApiParam(name = "endDate", value = "结束时间")
            @RequestParam(value = "endDate",defaultValue = "")String endDate) throws Exception {
        JSON obj = registerService.BS10045(dept,doctor_code,special_code,startDate,endDate,demoFlag);
    public ObjEnvelop BS10045(String dept,
                              String doctor_code,
                              String doctor_name,
                              String special_code,
                              String charge_type,
                              String startDate,
                              String endDate) throws Exception {
        JSON obj = registerService.BS10045( dept, doctor_code, doctor_name, special_code, charge_type, startDate, endDate,demoFlag);
        return success(obj);
    }
    @GetMapping(value = "/BS10046")
@ -510,16 +506,22 @@ public class MqSdkController extends EnvelopRestEndpoint {
            @ApiParam(name = "doctor_code", value = "医生")
            @RequestParam(value = "doctor_code",defaultValue = "") String doctor_code,
            @ApiParam(name = "date", value = "日期")
            @RequestParam(value = "date",defaultValue = "") String date) throws Exception {
        JSON obj = registerService.BS10046(dept,doctor_code,date,demoFlag);
            @RequestParam(value = "date",defaultValue = "") String date,
            @ApiParam(name = "ampm", value = "上午下午")
            @RequestParam(value = "ampm",defaultValue = "")String ampm) throws Exception {
        JSON obj = registerService.BS10046(dept,doctor_code,date,ampm,demoFlag);
        return success(obj);
    }
    @GetMapping(value = "/BS10047")
    @ApiOperation(value = "预约时间号源表")
    public ObjEnvelop BS10047(
            @ApiParam(name = "req_id", value = "病人ID")
            @RequestParam(value = "req_id",defaultValue = "") String req_id) throws Exception {
        JSON obj = registerService.BS10047(req_id,demoFlag);
    public ObjEnvelop BS10047(String req_id,
                              String doctor_code,
                              String doctor_name,
                              String op_id,
                              String startDate,
                              String endDate,
                              String reg_type) throws Exception {
        JSON obj = registerService.BS10047( req_id, doctor_code, doctor_name, op_id, startDate, endDate, reg_type,demoFlag);
        return success(obj);
    }
    @GetMapping(value = "/BS10048")

+ 13 - 0
svr/svr-internet-hospital-entrance/src/mqConfig/esbmq-config.xml

@ -84,6 +84,19 @@
				<MS02017_0>EwellQ.S60.MS02017.PUT</MS02017_0>
				<MS02017_1>EwellQ.S60.MS02017.GET</MS02017_1>
				<!--检查检验end-->
				<!-- 预约挂号start-->
				<BS10047_0>EwellQ.S60.BS10047.PUT</BS10047_0>
				<BS10047_1>EwellQ.S60.BS10047.GET</BS10047_1>
				<BS10048_0>EwellQ.S60.BS10048.PUT</BS10048_0>
				<BS10048_1>EwellQ.S60.BS10048.GET</BS10048_1>
				<BS10049_0>EwellQ.S60.BS10049.PUT</BS10049_0>
				<BS10049_1>EwellQ.S60.BS10049.GET</BS10049_1>
				<BS10045_0>EwellQ.S60.BS10045.PUT</BS10045_0>
				<BS10045_1>EwellQ.S60.BS10045.GET</BS10045_1>
				<BS10046_0>EwellQ.S60.BS10046.PUT</BS10046_0>
				<BS10046_1>EwellQ.S60.BS10046.GET</BS10046_1>
				<!-- 预约挂号end-->
			</QUEUES>
		</QMGR.S60>
	</MQCONFIG>

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

@ -50,12 +50,12 @@ 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");
            }
//            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")) {

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

@ -0,0 +1,99 @@
package com.yihu.jw.hospital.endpoint.appointment;
import com.yihu.jw.hospital.appointment.service.AppointmentService;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created by Trick on 2019/10/30.
 */
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.Appointment.PREFIX)
@Api(value = "预约挂号", description = "预约挂号", tags = {"预约挂号接口"})
public class AppointmentEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private AppointmentService appointmentService;
    @GetMapping(value = BaseHospitalRequestMapping.Appointment.getDoctorSchedule)
    @ApiOperation(value = "获取医生号源")
    public ListEnvelop getDoctorSchedule(@ApiParam(name = "dept", value = "部门ID")
                                         @RequestParam(value = "dept",required = false) String dept,
                                         @ApiParam(name = "docMappingCode", value = "中山医院医生ID精确查询")
                                         @RequestParam(value = "docMappingCode",required = false)String docMappingCode,
                                         @ApiParam(name = "nameKey", value = "医生姓名模糊")
                                         @RequestParam(value = "nameKey",required = false)String nameKey,
                                         @ApiParam(name = "specialCode", value = "专科")
                                         @RequestParam(value = "specialCode",required = false)String specialCode,
                                         @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.getDoctorSchedule( dept,  docMappingCode, nameKey, specialCode, chargeType, startDate, endDate));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Appointment.getDoctorScheduleTime)
    @ApiOperation(value = "获取医生具体号源时间")
    public ListEnvelop getDoctorScheduleTime(@ApiParam(name = "dept", value = "部门ID")
                                         @RequestParam(value = "dept",required = true) String dept,
                                         @ApiParam(name = "docMappingCode", value = "医生ID精确查询")
                                         @RequestParam(value = "docMappingCode",required = true)String docMappingCode,
                                         @ApiParam(name = "date", value = "日期")
                                         @RequestParam(value = "date",required = true)String date,
                                         @ApiParam(name = "ampm", value = "上午a,下午p")
                                         @RequestParam(value = "ampm",required = true)String ampm) throws Exception {
        return success(appointmentService.getDoctorScheduleTime(dept,docMappingCode,date,ampm));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Appointment.getAppointmentList)
    @ApiOperation(value = "获取预约记录列表")
    public ListEnvelop getAppointmentList(@ApiParam(name = "patient", value = "患者ID")
                                          @RequestParam(value = "patient",required = false) String patient,
                                          @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 = "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));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Appointment.makeAppointment)
    @ApiOperation(value = "预约")
    public ObjEnvelop makeAppointment(@ApiParam(name = "appointmentJson", value = "预约实体")
                                       @RequestParam(value = "appointmentJson",required = false) String appointmentJson) throws Exception {
        return success(appointmentService.makeAppointment(appointmentJson));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Appointment.cancelAppointment)
    @ApiOperation(value = "取消预约")
    public ObjEnvelop cancelAppointment(@ApiParam(name = "appointmentJson", value = "预约实体")
                                        @RequestParam(value = "appointmentJson",required = false) String appointmentJson) throws Exception {
        return success(appointmentService.cancelAppointment(appointmentJson));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Appointment.getDoctorByMappingCode)
    @ApiOperation(value = "转化医生映射code")
    public ObjEnvelop getDoctorByMappingCode(@ApiParam(name = "mappingCode", value = "患者ID")
                                        @RequestParam(value = "mappingCode",required = false) String mappingCode) throws Exception {
        return success(appointmentService.getDoctorByMappingCode(mappingCode));
    }
}

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

@ -735,4 +735,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "doctor",required = false) String doctor)throws Exception{
        return success(doctorPreSignService.getDoctorSign(doctor));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getDoctorIntroduction)
    @ApiOperation(value = "获取医生简介")
    public ObjEnvelop getDoctorIntroduction(@ApiParam(name = "doctor", value = "医生编码")
                                            @RequestParam(value = "doctor",required = false) String doctor)throws Exception{
        return success(prescriptionService.getDoctorIntroduction(doctor));
    }
}