Kaynağa Gözat

代码修改

liubing 4 yıl önce
ebeveyn
işleme
744fe2b2f5
26 değiştirilmiş dosya ile 1788 ekleme ve 40 silme
  1. 15 0
      business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseJobCategoryDao.java
  2. 8 0
      business/base-service/src/main/java/com/yihu/jw/hospital/doctor/dao/DoctorTimeMappingDao.java
  3. 19 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/BaseNatAppointmentDao.java
  4. 8 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/BaseNatInspectionDao.java
  5. 20 8
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java
  6. 450 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  7. 147 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  8. 30 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/util/MqSdkUtil.java
  9. 8 8
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  10. 8 0
      business/base-service/src/mqConfig/esbmq-config.xml
  11. 59 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseJobCategoryDO.java
  12. 77 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorTimeMappingDO.java
  13. 10 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java
  14. 384 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java
  15. 149 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatInspectionDO.java
  16. 12 1
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  17. 9 3
      server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java
  18. 13 3
      server/svr-authentication/src/main/java/com/yihu/jw/security/model/WlyyUserDetails.java
  19. 4 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthYlzConfigService.java
  20. 63 0
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java
  21. 9 0
      svr/svr-internet-hospital-entrance/src/mqConfig/esbmq-config.xml
  22. 50 4
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/TimeoutOverDueService.java
  23. 59 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/CancelNotPay.java
  24. 71 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  25. 105 6
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  26. 1 2
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

+ 15 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseJobCategoryDao.java

@ -0,0 +1,15 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.base.dict.BaseJobCategoryDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface BaseJobCategoryDao extends PagingAndSortingRepository<BaseJobCategoryDO, Integer>, JpaSpecificationExecutor<BaseJobCategoryDO> {
    @Query("from BaseJobCategoryDO t where t.pid = '0' and t.del = 1")
    List<BaseJobCategoryDO> findFirstCategoryList();
    @Query("from BaseJobCategoryDO t where t.pid = ?1 and t.del = 1")
    List<BaseJobCategoryDO> findSecondCategoryList(String pid);
}

+ 8 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/doctor/dao/DoctorTimeMappingDao.java

@ -0,0 +1,8 @@
package com.yihu.jw.hospital.doctor.dao;
import com.yihu.jw.entity.base.doctor.BaseDoctorTimeMappingDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface DoctorTimeMappingDao extends PagingAndSortingRepository<BaseDoctorTimeMappingDO, Integer>, JpaSpecificationExecutor<BaseDoctorTimeMappingDO> {
}

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

@ -0,0 +1,19 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.BaseNatAppointmentDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
public interface BaseNatAppointmentDao extends PagingAndSortingRepository<BaseNatAppointmentDO, Integer>, JpaSpecificationExecutor<BaseNatAppointmentDO> {
    @Query("from BaseNatAppointmentDO t where t.payStatus = 0 ")
    List<BaseNatAppointmentDO> findByPayStatus();
    @Query("select a from BaseNatAppointmentDO a where  a.realOrder =?1 ")
    List<BaseNatAppointmentDO> findByRealOrderList(String realOrder);
}

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

@ -0,0 +1,8 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.BaseNatInspectionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseNatInspectionDao extends PagingAndSortingRepository<BaseNatInspectionDO, Integer>, JpaSpecificationExecutor<BaseNatInspectionDO> {
}

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

@ -1,27 +1,22 @@
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import jxl.WorkbookSettings;
import jxl.write.*;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class PayInfoNoticeService {
@ -58,6 +53,23 @@ public class PayInfoNoticeService {
        return null;
    }
    public String pushPrescriptionPayAndHsjc(String patient,String doctorName,String orderNo,String id,String total,String title,String url){
        BasePatientDO patientDO = patientDao.findById(patient);
        if (patientDO!=null){
            String userName = patientDO.getName();
            String idcard = patientDO.getIdcard();
            String phone = patientDO.getMobile();
            if (!StringUtils.isNotBlank(url)){
                url = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+id;
            }
            String remark = "结算方式:微信结算" +
                    "点击查看核酸预约开单信息";
            return paySuccessNotice(userName,idcard,phone,title,url,doctorName,total,"0",total,orderNo,remark);
        }
        return null;
    }
    /**
     * 支付成功提醒
     * @param userName 用户名 (不能为空)

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

@ -1,6 +1,7 @@
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONPObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.DictDeptDescDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
@ -82,7 +83,6 @@ import com.yihu.jw.utils.CheckSumBuilder;
import com.yihu.jw.utils.GenerateUserSig;
import com.yihu.jw.utils.Pkis.PKIService_PortType;
import com.yihu.jw.utils.Pkis.PKIService_ServiceLocator;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
@ -106,7 +106,6 @@ import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
@ -272,6 +271,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private HttpClientUtil httpClientUtil;
    @Autowired
    private YxTokenMappingDao yxTokenMappingDao;
    @Autowired
    private BaseNatAppointmentDao baseNatAppointmentDao;
@ -4682,6 +4683,55 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    //核算检测预约模板消息
    public void sendNatWxTemplat(String name,String idcard,String mobile,String time,String orderNo,String relationName){
        String first = "";
        String contentMsg = "";
        String msgUrl="";
        String remark="";
        String responseMsg="";
        if ("natAppointmentRemind".equalsIgnoreCase(relationName)){
            first = "尊敬的用户"+name+",您已完成线上自助核酸检测开单预约";
            contentMsg = "申请人:"+name+";预约时间:"+time+";发票流水号:"+orderNo;
            remark="请您持核酸开单预约信息和结算发票号、医保卡、就诊卡、电子健康卡,提前15分钟至我院五号楼北侧(急诊部后侧)核酸检测点2号窗口绑定检测。";
        }
        if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)) {
            String prefix = "https://hlwyy.xmzsh.com";
            responseMsg = entranceService.ehospitalNotice(
                    name,
                   idcard,
                    mobile,
                    first,
                    prefix + msgUrl,
                    contentMsg,
                    remark);
                logger.info("中山发送模板消息返回结果="+responseMsg);
                System.out.println("结束发送模板消息");
        }else if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)) {
            String prefix = "https://hlwyy.xmzsh.com";
                responseMsg = entranceService.ehospitalNotice(
                        name,
                        idcard,
                        mobile,
                        first,
                        prefix + msgUrl,
                        contentMsg,
                        remark
                );
                logger.info("心脏发送模板消息返回结果="+responseMsg);
                System.out.println("结束发送模板消息");
        }
        //保存发送模板记录,
        WxPushLogDO wxPushLogDO = new WxPushLogDO();
        wxPushLogDO.setCreateTime(new Date());
        wxPushLogDO.setWechatId(wechatId);
        wxPushLogDO.setReceiverName(name);
        wxPushLogDO.setRequest(first+contentMsg+msgUrl);
        wxPushLogDO.setResponse(responseMsg);
        wxPushLogDO.setTempName("核算检测预约模板消息");
        wxPushLogDao.save(wxPushLogDO);
    }
    public List<WlyyHospitalSysDictDO> findCancelReasonList() {
@ -5970,6 +6020,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("mobile", basePatientDO.getMobile());
        rs.put("photo", basePatientDO.getPhoto());
        rs.put("address", basePatientDO.getAddress());
        rs.put("cardType",basePatientDO.getCardType());
        if (patientMedicareCardDO != null) {
            rs.put("ssc", patientMedicareCardDO.getCode());
        } else {
@ -9278,6 +9329,32 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, object);
    }
    public MixEnvelop selectByUrlHsjc(Integer id,String wxId) throws Exception {
        WxWechatDO wxWechatDO = wechatDao.findById(wxId);
        if (wxWechatDO == null) {
            throw new Exception("微信配置不存在!");
        }
        BaseNatAppointmentDO natAppointmentDO = baseNatAppointmentDao.findOne(id);
        List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wxId, natAppointmentDO.getPatientId());
        if (patientWechatDos == null || patientWechatDos.size() == 0) {
            throw new Exception("openid不存在!");
        }
        BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
        String idcard = null;
        if (natAppointmentDO != null) {
            idcard = natAppointmentDO.getMedicare();
        }
        if (!StringUtils.isNoneBlank(idcard)) {
            throw new Exception("就诊卡不存在!");
        }
        String url = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(), patientWechatDo.getOpenid(), idcard, "WX");
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(url);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, object);
    }
    /**
     * 获取居民openId
     *
@ -10337,5 +10414,376 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
       }
       return doorServiceCount;
    }
    public MixEnvelop findJobCategory(){
        String sqlPid = "select id as \"id\",name as \"name\",pid as \"pid\" from base_job_category  where pid = 0 and del = 1";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sqlPid);
        if (list.size()>0){
            for (Map<String,Object> map:list){
                String child = "select id as \"id\",name as \"name\",pid as \"pid\" from base_job_category  where del = 1";
                String pid = map.get("id").toString();
                child+=" and pid = "+pid;
                List<Map<String,Object>> childList = hibenateUtils.createSQLQuery(child);
                map.put("childList",childList);
            }
        }
        MixEnvelop envelop = new MixEnvelop();
        envelop.setDetailModelList(list);
        return  envelop;
    }
    public Map<String,Object> findRandomDoctor(){
        String sql = "select t.id as \"id\"," +
                "t.doctor_mapping_code as \"doctorMappingCode\"," +
                "t.doctor_code as \"doctorCode\"," +
                "t.dept_code as \"deptCode\"," +
                "t.start_time as \"startTime\"," +
                "t.end_time as \"endTime\"," +
                "t.doctor_name as \"doctorName\"," +
                "t.dept_name  as \"deptName\" from base_doctor_time_mapping t where 1=1 ";
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            sql+=" order by dbms_random.value";
        }else {
            sql+=" ORDER BY RAND() ";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        if (list!=null&&list.size()>0){
            return list.get(0);
        }
        return null;
    }
    public Map saveNatAppointment(String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName) throws Exception {
        BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
        baseNatAppointmentDO.setMedicare(mediaCard);
        baseNatAppointmentDO.setName(name);
        baseNatAppointmentDO.setCardNo(cardNo);
        baseNatAppointmentDO.setCardType(cardType);
        baseNatAppointmentDO.setAddress(address);
        baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDate(natTime,"yyyy-MM-dd hh:mm:ss"));
        baseNatAppointmentDO.setCityName(cityName);
        baseNatAppointmentDO.setFirstJobCode(firstJobCode);
        baseNatAppointmentDO.setFirstJobName(firstJobName);
        baseNatAppointmentDO.setSecondJobCode(secondJobCode);
        baseNatAppointmentDO.setSecondJobName(secondJobName);
        baseNatAppointmentDO.setProvinceName(provinceName);
        baseNatAppointmentDO.setTownName(townName);
        baseNatAppointmentDO.setStreetName(streetName);
        baseNatAppointmentDO.setPatientId(patientId);
        baseNatAppointmentDO.setIsSuccess("0");
        baseNatAppointmentDO.setPayStatus("0");
        baseNatAppointmentDO.setCreateTime(new Date());
        baseNatAppointmentDO.setMobile(mobile);
        baseNatAppointmentDO.setInspectionCode("鼻/咽拭子");
        baseNatAppointmentDO.setInspectionName("鼻/咽拭子");
        baseNatAppointmentDO.setIcdCode("Z00.000");
        baseNatAppointmentDO.setChargeCode("361322");
        baseNatAppointmentDO.setWinNo("6");
        baseNatAppointmentDO.setDept("3150000");
        baseNatAppointmentDO.setDeptName("感染疾病科");
        baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
        Map returnMap = new HashMap();
        net.sf.json.JSONObject jsondate = new JSONObject();
        jsondate.put("checkPart","鼻/咽拭子");
        jsondate.put("cardNo",mediaCard);
        jsondate.put("chargeFlag","2");
        jsondate.put("chargeCode","361322");
        jsondate.put("icdCode","Z00.000");
        jsondate.put("socialNo",cardNo);
        jsondate.put("tellPhone",mobile);
        jsondate.put("address1",provinceName);
        jsondate.put("address2",cityName);
        jsondate.put("address3",townName);
        jsondate.put("address4",streetName);
        jsondate.put("address5",2);
        jsondate.put("area",address);
        jsondate.put("winNo",6);
        jsondate.put("target",2);
        jsondate.put("quantity",1);
        Map<String,Object> map = findRandomDoctor();
        net.sf.json.JSONObject rs = new JSONObject();
        if (map!=null){
            //先进行核算检测预约
            String result = entranceService.BS10144("3150000","0001",natTime,mediaCard,name,cardNo,mobile,demoFlag);
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
            logger.info("核酸检测预约结束"+result);
            Boolean flag = false;
            if (object!=null){
                com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("MsgInfo");
                String Msg = jsonObject.getString("Msg");
                if (Msg.contains("Error")){
                    throw new Exception(Msg);
                }else {
                    flag = true;
                }
            }
            if (flag){
                try {
                    logger.info("挂号开始");
                    String date = DateUtil.dateToStr(new Date(), "yyyy-MM-dd");
                    List<WlyyPatientRegisterDO> patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctorAndDel(patientId, date,map.get("doctorCode").toString() ,1);
                    if (patientRegisterDOs != null && patientRegisterDOs.size() > 0) {
                        WlyyPatientRegisterDO registerDO = patientRegisterDOs.get(0);
                        //判断是否已经挂号,如果已经挂号
                        if (StringUtils.isNotBlank(registerDO.getConNo()) && StringUtils.isNotBlank(registerDO.getRegisterNo())) {
                            net.sf.json.JSONObject res = new JSONObject();
                            res.put("@RESULT", "0");
                            logger.info("已经挂号 res: " + res.toString());
                            jsondate.put("serialNo",registerDO.getRegisterNo());
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                            baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
                        }else {
                            returnMap.put("msg","已经挂号的数据有误");
                            returnMap.put("status","-1");
                            returnMap.put("id",baseNatAppointmentDO.getId());
                            return returnMap;
                        }
                    }else {
                        rs = entranceService.BS10111(mediaCard, map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag);
                        net.sf.json.JSONObject res = rs.getJSONObject("resquest");
                        logger.info("挂号结果 res: " + res.toString());
                        String rsCode = res.getString("@RESULT");
                        if ("0".equals(rsCode)) {
                            //存储挂号号
                            // {"resquest":{"@RESULT":"0","@MSG":"完成","@serial_no":"47770476","@times":"28"}}
                            String serialNo = (String) res.get("@serial_no");
                            String conNo = (String) res.get("@times");
                            String xtgzh = (String) res.get("@xtgzh");
                            String realOrder = (String) res.get("@real_order");
                            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
                            jsondate.put("serialNo",serialNo);
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            //存储就诊记录
                            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
                            // 存储挂号医生与挂号科室
                            registerDO.setDoctor(map.get("doctorCode").toString());
                            registerDO.setDoctorName(map.get("doctorName").toString());
                            registerDO.setDept(map.get("deptCode").toString());
                            registerDO.setDeptName(map.get("deptName").toString());
                            registerDO.setRealOrder(realOrder);
                            registerDO.setXtgzh(xtgzh);
                            registerDO.setPatient(patientId);
                            registerDO.setPatientName(name);
                            //挂号流水号与挂号次数
                            registerDO.setRegisterNo(serialNo);
                            registerDO.setConNo(conNo);
                            registerDO.setCreateTime(new Date());
                            registerDO.setDel(1);
                            registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
                            patientRegisterDao.save(registerDO);
                            //保存日志
                            WlyyHttpLogDO log = new WlyyHttpLogDO();
                            log.setCode("registerOutPatient");
                            log.setName("挂号");
                            log.setPatient(patientId);
                            log.setDoctor(map.get("doctorCode").toString());
                            log.setResponse(rs.toString());
                            log.setStatus(rsCode);
                            log.setCreateTime(new Date());
                            wlyyHttpLogDao.save(log);
                        } else if ("-2".equals(rsCode)) {
                            String serialNo = (String) res.get("@serial_no");
                            String xtgzh = (String) res.get("@xtgzh");
                            String realOrder = (String) res.get("@real_order");
                            String conNo = (String) res.get("@times");
                            jsondate.put("serialNo",serialNo);
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
                            //存储就诊记录
                            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
                            registerDO.setDoctor(map.get("doctorCode").toString());
                            registerDO.setDoctorName(map.get("doctorName").toString());
                            registerDO.setDept(map.get("deptCode").toString());
                            registerDO.setDeptName(map.get("deptName").toString());
                            registerDO.setRealOrder(realOrder);
                            registerDO.setXtgzh(xtgzh);
                            registerDO.setPatient(patientId);
                            registerDO.setPatientName(name);
                            registerDO.setRegisterNo(serialNo);
                            registerDO.setConNo(conNo);
                            registerDO.setCreateTime(new Date());
                            registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
                            patientRegisterDao.save(registerDO);
                            //保存日志
                            WlyyHttpLogDO log = new WlyyHttpLogDO();
                            log.setCode("registerOutPatient");
                            log.setName("挂号");
                            log.setPatient(patientId);
                            log.setDoctor(map.get("doctorCode").toString());
                            log.setResponse(rs.toString());
                            log.setStatus(rsCode);
                            log.setCreateTime(new Date());
                            wlyyHttpLogDao.save(log);
                        }else {
                            returnMap.put("msg","请求挂号失败");
                            returnMap.put("status","-1");
                            returnMap.put("id",baseNatAppointmentDO.getId());
                            return returnMap;
                        }
                        baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                        baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                logger.info("开单开始");
                logger.info("saveNatAppointment params:"+jsondate.toString());
                com.alibaba.fastjson.JSONArray array = new com.alibaba.fastjson.JSONArray();
                array.add(jsondate);
                try {
                    JSONObject jsonObject  = entranceService.BS10112(array.toString(),demoFlag);
                    //判断返回结果
                    String prers = jsonObject.getString("@RESULT");
                    //保存日志
                    WlyyHttpLogDO log = new WlyyHttpLogDO();
                    log.setCode("saveNatAppointment");
                    log.setName("核酸检测开方");
                    log.setPatient(patientId);
                    log.setDoctor(map.get("doctorCode").toString());
                    log.setResponse(jsonObject.toString());
                    log.setRequest(jsondate.toString());
                    log.setCreateTime(new Date());
                    wlyyHttpLogDao.save(log);
                    if ("0".equals(prers)) {
                        String realOrder = jsonObject.getString("@real_order");
                        baseNatAppointmentDO.setRealOrder(realOrder);
                        baseNatAppointmentDO.setIsSuccess("1");
                        baseNatAppointmentDao.save(baseNatAppointmentDO);
                        String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
                        String applyDepaName = map.get("deptName").toString();
                        String voucherNo = jsonObject.getString("@xtgzh0");
                        String applyDoctorName = map.get("doctorName").toString();
                        BasePatientDO patientDO = basePatientDao.findById(patientId);
                        String userName = null;
                        String idcard = null;
                        if (patientDO != null) {
                            userName = patientDO.getName();
                            idcard = patientDO.getIdcard();
                        }
                        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patientId);
                        String userNo = null;
                        if (patientMappingDO != null) {
                            userNo = patientMappingDO.getMappingCode();
                        }
                        logger.info("cardNo:" + cardNo);
                        JSONObject jsonObject1 =entranceService.BS15054(patientMappingDO.getMappingCode(),realOrder,demoFlag);
                        net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest");
                        logger.info("获取待结算数据 res: " + res.toString());
                        String rsCode = res.getString("@RESULT");
                        String free= "";
                        if ("0".equals(rsCode)) {
                            free = res.getString("@total_charge");
                        }
                        ylzPayService.msgPush("01", mediaCard, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1");
                        /*//成功后发送模板消息
                        sendNatWxTemplat(name,cardNo,mobile,natTime,realOrder,"natAppointmentRemind");*/
                    }else{
                        returnMap.put("msg","核酸检测开方失败");
                        returnMap.put("status","-1");
                        returnMap.put("id",baseNatAppointmentDO.getId());
                        return returnMap;
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            returnMap.put("msg","预约成功");
            returnMap.put("status","200");
            returnMap.put("id",baseNatAppointmentDO.getId());
        }
        return returnMap;
    }
    public MixEnvelop getNatRecords(String patientId,Integer page ,Integer pageSize){
        String sql = "select t.name as \"name\"," +
                "t.card_no as \"cardNo\"," +
                "t.card_type as \"cardType\"," +
                "t.mobile as \"mobile\"," +
                "t.inspection_name as \"inspectionName\"," +
                "t.real_order as \"realOrder\"," +
                "t.is_success as \"isSuccess\"," +
                "t.create_time as \"createTime\"," +
                "t.pay_status as \"payStatus\"," +
                "t.id as \"id\"," +
                "t.appointment_time as \"appointmentTime\" " +
                " from base_nat_appointment t where 1=1 ";
        if (StringUtils.isNoneBlank(patientId)){
            sql+=" and t.patient_id ='"+patientId+"'";
        }
        List<Map<String ,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<Map<String ,Object>> listCount = hibenateUtils.createSQLQuery(sql);
        MixEnvelop mixnvelop = new MixEnvelop();
        if (listCount!=null&&listCount.size()>0){
            mixnvelop.setCurrPage(page);
            mixnvelop.setPageSize(pageSize);
            mixnvelop.setTotalCount(listCount.size());
            mixnvelop.setDetailModelList(list);
        }
        return mixnvelop;
    }
    public List<Map<String,Object>> findBaseAddress(String addressFlag,String parentName){
        String sql="";
        if ("1".equalsIgnoreCase(addressFlag)){
            sql+="select  t.province_name as \"provinceName\" from base_address_mapping t group by t.province_name ";
        }else if("2".equalsIgnoreCase(addressFlag)){
            sql+="select  t.city_name as \"cityName\" from base_address_mapping t where t.province_name ='"+parentName+"' and city_name <> '' and city_name is not null group by t.city_name ";
        }else if("3".equalsIgnoreCase(addressFlag)){
            sql+="select  t.town_name as \"townName\" from base_address_mapping t  where t.city_name ='"+parentName+"' and town_name <> '' and town_name is not null group by t.town_name";
        }else if("4".equalsIgnoreCase(addressFlag)){
            sql+="select  t.street_name as \"streetName\" from base_address_mapping t  where t.town_name ='"+parentName+"' and street_name <> '' and street_name is not null";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        return list;
    }
    //患者取消预约
    public String cancelNatAppointment (Integer id,String patientId ){
        BasePatientDO patientDO = basePatientDao.findById(patientId);
        String res = "";
        if (patientDO!=null){
            String patientCode = null;
            try {
                patientCode = patientMappingService.findHisPatNoByIdCard(patientDO.getIdcard());
                BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
                if (null!=baseNatAppointmentDO){
                    res = entranceService.BS10145("3150000","0001",DateUtil.dateToStr(baseNatAppointmentDO.getAppointmentTime(),"yyyy-MM-dd hh:mm:ss"),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),demoFlag);
                    logger.info("核酸检测预约取消"+res);
                    com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                    Boolean flag = false;
                    if (jsonObject!=null){
                        com.alibaba.fastjson.JSONObject object = jsonObject.getJSONObject("MsgInfo");
                        String Msg = object.getString("Msg");
                        if (Msg.contains("Error")){
                            throw new Exception(Msg);
                        }else {
                            baseNatAppointmentDO.setIsSuccess("-1");
                            baseNatAppointmentDO.setCancelReson("患者本人取消");
                            baseNatAppointmentDO.setCancelTime(new Date());
                            baseNatAppointmentDO.setCancelBy(patientId);
                            baseNatAppointmentDao.save(baseNatAppointmentDO);
                        }
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return res;
    }
}

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

@ -1852,7 +1852,12 @@ public class EntranceService {
    }
    /**
     * 获取五级地址
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public JSONArray MS02019(boolean demoFlag) throws Exception {
        String fid = "MS02019";
        String resp = "";
@ -1867,12 +1872,153 @@ public class EntranceService {
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>20000</endNum><Msg/>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            logger.info("sbs"+sbs.toString());
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            logger.info("resp"+resp);
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    /**
     *  核酸预约列表接口
     * @param deptCode
     * @param docCode
     * @param chargeType
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public JSONArray BS10142(String deptCode,String docCode,String chargeType,boolean demoFlag) throws Exception {
        String fid = "BS10142";
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            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("<MsgInfo><endNum>20000</endNum><Msg>");
            sbs.append("<![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root><resquest DeptCode=\""+deptCode+"\" DocCode=\""+docCode+"\" ChargeType=\""+chargeType+"\" ></resquest></root>]]>");
            sbs.append("</Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            logger.info("resp"+resp);
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    /**
     * 核酸号源查询
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public JSONArray BS10143(String day,boolean demoFlag) throws Exception {
        String fid = "BS10143";
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            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("<MsgInfo><endNum>20000</endNum><Msg>");
            if (StringUtils.isNotBlank(day)) {
                sbs.append("<![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root><resquest request_day=\""+day+"\" ampm=\"a\" ></resquest></root>]]>");
            }
            sbs.append("</Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            logger.info("resp"+resp);
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    /**
     * 核酸预约
     * @param deptCode 科室code
     * @param docCode 医生code
     * @param startTime 预约时间
     * @param sSID 社保卡
     * @param patientName 患者姓名
     * @param patientID 身份证
     * @param patientPhone 手机号
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public String BS10144(String deptCode,String docCode,String startTime,String sSID,String patientName,String patientID,String patientPhone, boolean demoFlag) throws Exception {
        String fid = "BS10144";
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            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("<MsgInfo><endNum>20000</endNum><Msg>");
            sbs.append("<as_xml><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root><resquest DeptCode=\""+deptCode+"\" DocCode=\""+docCode+"\" ampm=\"a\" StartTime=\""+startTime+"\" SSID=\""+sSID+"\" PatientName=\""+patientName+"\" PatientID=\""+patientID+"\" PatientPhone=\""+patientPhone+"\"></resquest></root>]]></as_xml>");
            sbs.append("</Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRowBS10144(resp);
            logger.info("resp"+resp);
        }
        return resp;
    }
    /**
     * 核酸预约取消
     * @param deptCode 科室code
     * @param docCode 医生code
     * @param startTime 预约时间
     * @param sSID 社保卡
     * @param patientName 患者姓名
     * @param patientID 身份证
     * @param patientPhone 手机号
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public String BS10145(String deptCode,String docCode,String startTime,String sSID,String patientName,String patientID,String patientPhone, boolean demoFlag) throws Exception {
        String fid = "BS10145";
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            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("<MsgInfo><endNum>20000</endNum><Msg>");
            sbs.append("<as_xml><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root><resquest DeptCode=\""+deptCode+"\" DocCode=\""+docCode+"\" ampm=\"a\" StartTime=\""+startTime+"\" SSID=\""+sSID+"\" PatientName=\""+patientName+"\" PatientID=\""+patientID+"\" PatientPhone=\""+patientPhone+"\"></resquest></root>]]></as_xml>");
            sbs.append("</Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRowBS10144(resp);
            logger.info("resp"+resp);
        }
        return resp;
    }
    /**
     * 同步医生到本地库,获取到医生的时候需要调用BS55010 查询医生的诊查费
     *

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

@ -123,6 +123,7 @@ public class MqSdkUtil {
        QueueTools queueTools = new QueueTools();
        // 队列管理器实例
        MQQueueManager queueManager = null;
        log.info("reqMsg"+reqMsg);
        // 消息Id
        String msgId = null;
        // 响应数据
@ -133,8 +134,8 @@ public class MqSdkUtil {
            // 发送请求消息
            msgId = queueTools.putMsg(queueManager, xmlNodeName, reqMsg);
            // 获取响应消息
            respMsg = queueTools.getMsgById(queueManager, xmlNodeName, msgId, 150);
            log.info("respMsg=="+reqMsg);
            respMsg = queueTools.getMsgById(queueManager, xmlNodeName, msgId, 1200000000);
            log.info("respMsg=="+respMsg);
            return respMsg;
        } catch (MQException e) {
            // 2033表示队列中没有消息
@ -243,6 +244,7 @@ public class MqSdkUtil {
    public static String xml2jsonArrayRootRow(String xmlString) throws Exception {
        XMLSerializer xmlSerializer = new XMLSerializer();
        JSON json = xmlSerializer.read(xmlString);
        log.info("json"+json.toString());
        Object retInfo=  ((JSONObject) json).get("RetInfo");
        Object retCode= ((JSONObject) retInfo).get("RetCode");
        if(retCode.equals("1")){
@ -426,5 +428,31 @@ public class MqSdkUtil {
        return json;
    }
    /**
     * 将xml字符串<STRONG>转换</STRONG>为JSON字符串,msg的根节点为row
     * XML中Msg为数组
     *
     * @param xmlString xml字符串
     * @return JSON<STRONG>对象</STRONG>
     */
    public static String xml2jsonArrayRootRowBS10144(String xmlString) throws Exception {
        XMLSerializer xmlSerializer = new XMLSerializer();
        JSON json = xmlSerializer.read(xmlString);
        log.info("xmlString"+json);
        Object retInfo=  ((JSONObject) json).get("RetInfo");
        Object retCode= ((JSONObject) retInfo).get("RetCode");
        if(retCode.equals("1")){
            //成功
            Object jsonObject = ((net.sf.json.JSONObject) json).get("MsgInfo");
            ((net.sf.json.JSONObject) json).element("MsgInfo",  jsonObject);
            log.info("xmlString===="+json);
        }else if(retCode.equals("0")){
            //重新封装到json中
            ((net.sf.json.JSONObject) json).element("MsgInfo",   ((JSONObject) retInfo).get("RetCon"));
        }
        return getMsgInfo(json);
    }
}

+ 8 - 8
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -14,20 +14,14 @@ import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.order.BusinessOrderRefundDO;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionExpressageDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
@ -131,6 +125,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    private WlyyChargeDictDao chargeDictDao;
    @Autowired
    private WlyyHttpLogDao wlyyHttpLogDao;
    @Autowired
    private BaseNatAppointmentDao baseNatAppointmentDao;
@ -1116,6 +1112,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        return businessOrderDO;
    }
    public BaseNatAppointmentDO selectById(Integer relationCode){
        return  baseNatAppointmentDao.findOne(relationCode);
    }
    public List<BusinessOrderDO> selectListStatus(String relationCode){
        List<BusinessOrderDO> businessOrderDOList = businessOrderDao.selectListByRelationCode(relationCode);

+ 8 - 0
business/base-service/src/mqConfig/esbmq-config.xml

@ -31,6 +31,14 @@
				<BS10111_1>EwellQ.S60.BS10111.GET</BS10111_1>
				<BS10138_0>EwellQ.S60.BS10138.PUT</BS10138_0>
				<BS10138_1>EwellQ.S60.BS10138.GET</BS10138_1>
				<BS10142_0>EwellQ.S60.BS10142.PUT</BS10142_0>
				<BS10142_1>EwellQ.S60.BS10142.GET</BS10142_1>
				<BS10143_0>EwellQ.S60.BS10143.PUT</BS10143_0>
				<BS10143_1>EwellQ.S60.BS10143.GET</BS10143_1>
				<BS10144_0>EwellQ.S60.BS10144.PUT</BS10144_0>
				<BS10144_1>EwellQ.S60.BS10144.GET</BS10144_1>
				<BS10145_0>EwellQ.S60.BS10145.PUT</BS10145_0>
				<BS10145_1>EwellQ.S60.BS10145.GET</BS10145_1>
				<BS15054_0>EwellQ.S60.BS15054.PUT</BS15054_0>
				<BS15054_1>EwellQ.S60.BS15054.GET</BS15054_1>
				<BS10112_0>EwellQ.S60.BS10112.PUT</BS10112_0>

+ 59 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseJobCategoryDO.java

@ -0,0 +1,59 @@
package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "base_job_category")
@SequenceGenerator(name="id_generated", sequenceName="base_job_category")
public class BaseJobCategoryDO extends IntegerIdentityEntity {
    private String name;
    private Integer del;
    private Date createTime;
    private Date updateTime;
    private String pid;//父级id
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getPid() {
        return pid;
    }
    public void setPid(String pid) {
        this.pid = pid;
    }
}

+ 77 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorTimeMappingDO.java

@ -0,0 +1,77 @@
package com.yihu.jw.entity.base.doctor;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "base_doctor_time_mapping")
@SequenceGenerator(name="id_generated", sequenceName="base_doctor_time_mapping")
public class BaseDoctorTimeMappingDO extends IntegerIdentityEntity {
    private String doctorMappingCode;
    private String doctorCode;
    private String deptCode;
    private Date startTime;
    private Date endTime;
    private String doctorName;
    private String deptName;
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getDeptName() {
        return deptName;
    }
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
    public String getDoctorMappingCode() {
        return doctorMappingCode;
    }
    public void setDoctorMappingCode(String doctorMappingCode) {
        this.doctorMappingCode = doctorMappingCode;
    }
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    public String getDeptCode() {
        return deptCode;
    }
    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
}

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java

@ -244,6 +244,16 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    private String phone;
    private String openid;
    private Date openidTime;
    private String cardType;
    public String getCardType() {
        return cardType;
    }
    public void setCardType(String cardType) {
        this.cardType = cardType;
    }
    public Date getOpenidTime() {
        return openidTime;
    }

+ 384 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java

@ -0,0 +1,384 @@
package com.yihu.jw.entity.hospital.prescription;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "base_nat_appointment")
@SequenceGenerator(name="id_generated", sequenceName="base_nat_appointment")
public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    private String cardType;
    private String cardNo;
    private Date appointmentTime;
    private String isSuccess;
    private String appointmentTode;
    private Date endTime;
    private Date createTime;
    private String address;
    private String province;
    private String provinceName;
    private String city;
    private String cityName;
    private String town;
    private String townName;
    private String street;
    private String streetName;
    private String name;
    private String mobile;
    private String payStatus;
    private String realOrder;
    private String inspectionCode;
    private String inspectionName;
    private String dept;
    private String deptName;
    private String doctorId;
    private String patientId;
    private String chargeAmount;
    private String cancelBy;
    private String cancelReson;
    private Date cancelTime;
    private String secondJobCode;
    private String secondJobName;
    private String firstJobCode;
    private String firstJobName;
    private String medicare;
    private String checkPart;
    private String chargeFlag;
    private String winNo;
    private String chargeCode;
    private String icdCode;
    private String doctorName;
    public String getMedicare() {
        return medicare;
    }
    public void setMedicare(String medicare) {
        this.medicare = medicare;
    }
    public String getCheckPart() {
        return checkPart;
    }
    public void setCheckPart(String checkPart) {
        this.checkPart = checkPart;
    }
    public String getChargeFlag() {
        return chargeFlag;
    }
    public void setChargeFlag(String chargeFlag) {
        this.chargeFlag = chargeFlag;
    }
    public String getWinNo() {
        return winNo;
    }
    public void setWinNo(String winNo) {
        this.winNo = winNo;
    }
    public String getChargeCode() {
        return chargeCode;
    }
    public void setChargeCode(String chargeCode) {
        this.chargeCode = chargeCode;
    }
    public String getIcdCode() {
        return icdCode;
    }
    public void setIcdCode(String icdCode) {
        this.icdCode = icdCode;
    }
    public String getSecondJobCode() {
        return secondJobCode;
    }
    public void setSecondJobCode(String secondJobCode) {
        this.secondJobCode = secondJobCode;
    }
    public String getSecondJobName() {
        return secondJobName;
    }
    public void setSecondJobName(String secondJobName) {
        this.secondJobName = secondJobName;
    }
    public String getFirstJobCode() {
        return firstJobCode;
    }
    public void setFirstJobCode(String firstJobCode) {
        this.firstJobCode = firstJobCode;
    }
    public String getFirstJobName() {
        return firstJobName;
    }
    public void setFirstJobName(String firstJobName) {
        this.firstJobName = firstJobName;
    }
    public String getCancelBy() {
        return cancelBy;
    }
    public void setCancelBy(String cancelBy) {
        this.cancelBy = cancelBy;
    }
    public String getCancelReson() {
        return cancelReson;
    }
    public void setCancelReson(String cancelReson) {
        this.cancelReson = cancelReson;
    }
    public Date getCancelTime() {
        return cancelTime;
    }
    public void setCancelTime(Date cancelTime) {
        this.cancelTime = cancelTime;
    }
    public String getPayStatus() {
        return payStatus;
    }
    public void setPayStatus(String payStatus) {
        this.payStatus = payStatus;
    }
    public String getRealOrder() {
        return realOrder;
    }
    public void setRealOrder(String realOrder) {
        this.realOrder = realOrder;
    }
    public String getInspectionCode() {
        return inspectionCode;
    }
    public void setInspectionCode(String inspectionCode) {
        this.inspectionCode = inspectionCode;
    }
    public String getInspectionName() {
        return inspectionName;
    }
    public void setInspectionName(String inspectionName) {
        this.inspectionName = inspectionName;
    }
    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 getDoctorId() {
        return doctorId;
    }
    public void setDoctorId(String doctorId) {
        this.doctorId = doctorId;
    }
    public String getPatientId() {
        return patientId;
    }
    public void setPatientId(String patientId) {
        this.patientId = patientId;
    }
    public String getChargeAmount() {
        return chargeAmount;
    }
    public void setChargeAmount(String chargeAmount) {
        this.chargeAmount = chargeAmount;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getProvince() {
        return province;
    }
    public void setProvince(String province) {
        this.province = province;
    }
    public String getProvinceName() {
        return provinceName;
    }
    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }
    public String getCityName() {
        return cityName;
    }
    public void setCityName(String cityName) {
        this.cityName = cityName;
    }
    public String getTown() {
        return town;
    }
    public void setTown(String town) {
        this.town = town;
    }
    public String getTownName() {
        return townName;
    }
    public void setTownName(String townName) {
        this.townName = townName;
    }
    public String getStreet() {
        return street;
    }
    public void setStreet(String street) {
        this.street = street;
    }
    public String getStreetName() {
        return streetName;
    }
    public void setStreetName(String streetName) {
        this.streetName = streetName;
    }
    public String getCardType() {
        return cardType;
    }
    public void setCardType(String cardType) {
        this.cardType = cardType;
    }
    public String getCardNo() {
        return cardNo;
    }
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }
    public Date getAppointmentTime() {
        return appointmentTime;
    }
    public String getIsSuccess() {
        return isSuccess;
    }
    public void setIsSuccess(String isSuccess) {
        this.isSuccess = isSuccess;
    }
    public void setAppointmentTime(Date appointmentTime) {
        this.appointmentTime = appointmentTime;
    }
    public String getAppointmentTode() {
        return appointmentTode;
    }
    public void setAppointmentTode(String appointmentTode) {
        this.appointmentTode = appointmentTode;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
}

+ 149 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatInspectionDO.java

@ -0,0 +1,149 @@
package com.yihu.jw.entity.hospital.prescription;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "base_nat_inspection")
@SequenceGenerator(name="id_generated", sequenceName="base_nat_inspection")
public class BaseNatInspectionDO  extends IntegerIdentityEntity {
    private Integer appointmentId;
    private String realOrder;
    private String prescriptionId;
    private String code;
    private String name;
    private String chargeAmount;
    private String patientId;
    private String doctorId;
    private String dept;
    private String deptName;
    private String quantity;
    private String checkTtype;
    private String chekcTypeName;
    private Date createTime;
    private Integer del;
    public Integer getAppointmentId() {
        return appointmentId;
    }
    public void setAppointmentId(Integer appointmentId) {
        this.appointmentId = appointmentId;
    }
    public String getRealOrder() {
        return realOrder;
    }
    public void setRealOrder(String realOrder) {
        this.realOrder = realOrder;
    }
    public String getPrescriptionId() {
        return prescriptionId;
    }
    public void setPrescriptionId(String prescriptionId) {
        this.prescriptionId = prescriptionId;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getChargeAmount() {
        return chargeAmount;
    }
    public void setChargeAmount(String chargeAmount) {
        this.chargeAmount = chargeAmount;
    }
    public String getPatientId() {
        return patientId;
    }
    public void setPatientId(String patientId) {
        this.patientId = patientId;
    }
    public String getDoctorId() {
        return doctorId;
    }
    public void setDoctorId(String doctorId) {
        this.doctorId = doctorId;
    }
    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 getQuantity() {
        return quantity;
    }
    public void setQuantity(String quantity) {
        this.quantity = quantity;
    }
    public String getCheckTtype() {
        return checkTtype;
    }
    public void setCheckTtype(String checkTtype) {
        this.checkTtype = checkTtype;
    }
    public String getChekcTypeName() {
        return chekcTypeName;
    }
    public void setChekcTypeName(String chekcTypeName) {
        this.chekcTypeName = chekcTypeName;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

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

@ -107,7 +107,18 @@ public class BaseHospitalRequestMapping {
         * 上门复诊
         */
        public static final String appointmentRevisitOnDoor = "/appointmentRevisitOnDoor";
        /**
         * 查询业务字典
         */
        public static final String findJobCategory ="/findJobCategory";
        /**
         * 查询getNatRecords
         */
        public static final String getNatRecords ="/getNatRecords";
        /**
         * 查询getNatRecords
         */
        public static final String findBaseAddress ="/findBaseAddress";
        /**
         * 查询所有机构
         */

+ 9 - 3
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -57,8 +57,8 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
    private static final String DEFAULT_PATIENT_INSERT_STATEMENT =
            "INSERT into base_patient (id,photo,idcard,password,salt,name,birthday,sex,mobile," +
                    "province_code,province_name,city_code,city_name,town_code,town_name,street_code,street_name,address," +
                    "del,locked,enabled,login_failure_count,login_date) " +
                    " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
                    "del,locked,enabled,login_failure_count,login_date,card_type) " +
                    " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
    private static final String PATIENT_INSERT_WEHCAT = "insert into base_patient_wechat (id,wechat_id,patient_id,openid,create_time) values(?,?,?,?,?)";
@ -298,10 +298,12 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                    }
                    JSONObject object1 = JSONObject.parseObject(res);
                    logger.info("object1"+object1.toJSONString());
                    if (null != object1&&null!=object1.get("status") && "200".equals(object1.get("status").toString())) {
                        JSONObject patient = object1.getJSONObject("userinfo");
                        String salt = randomString(5);
                        idcard = patient.getString("idcard");
                        String idtype = patient.getString("idtype");
                        String mobile = patient.getString("mobile");
                        String pw = mobile.substring(mobile.length()-6);
                        try {
@ -328,7 +330,8 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                                            0,
                                            1,
                                            0,
                                            new Date()
                                            new Date(),
                                            idtype
                                    }
                            );
                        }catch (Exception e){
@ -350,6 +353,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                        user.setEnabled(true);
                        user.setLocked(false);
                        user.setLockedDate(null);
                        user.setCardType(idcard);
                        users.add(user);
                    }else{
@ -672,6 +676,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                JSONObject patient = object1.getJSONObject("userinfo");
                logger.info("开始同步患者数据");
                String idcard = patient.getString("idcard");
                String idtype = patient.getString("idtype");
                BasePatientDO patientDO2 = patientDao.findByIdcardAndDel(idcard,"1");
                BasePatientDO patient1 = new BasePatientDO();
                String salt = UUID.randomUUID().toString().substring(0,5);
@ -689,6 +694,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                    patient1.setSalt(salt);
                }
                patient1.setIdcard(idcard);
                patient1.setCardType(idtype);
                patient1.setName(patient.getString("name"));
                patient1.setSex(StringUtils.isNotBlank(idcard)?Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)):null);
                patient1.setMobile(mobile);

+ 13 - 3
server/svr-authentication/src/main/java/com/yihu/jw/security/model/WlyyUserDetails.java

@ -1,8 +1,5 @@
package com.yihu.jw.security.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;
@ -114,6 +111,11 @@ public class WlyyUserDetails implements Serializable {
     */
    private String address;
    /**
     *
     */
    private String cardType;
    public Date getBirthday() {
@ -371,4 +373,12 @@ public class WlyyUserDetails implements Serializable {
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public String getCardType() {
        return cardType;
    }
    public void setCardType(String cardType) {
        this.cardType = cardType;
    }
}

+ 4 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthYlzConfigService.java

@ -211,6 +211,7 @@ public class OauthYlzConfigService {
                String  auth_status = biz.getString("auth_status");
                if("succ".equals(auth_status)){
                    String idcard = biz.getString("id_no");
                    String cardType = biz.getString("id_type");
                    BasePatientDO patientDO =  basePatientDao.findByIdcardAndDel(idcard,"1");
                    if(StringUtils.isNotBlank(idcard)&&patientDO == null){
                        BasePatientDO patient = new BasePatientDO();
@ -236,6 +237,7 @@ public class OauthYlzConfigService {
                        patient.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)));
                        patient.setCreateTime(new Date());
                        patient.setUpdateTime(new Date());
                        patient.setCardType(cardType);
                        patient.setBirthday(DateUtil.strToDate(biz.getString("birthday"),"yyyyMMdd"));
                        patientDO = basePatientDao.save(patient);
                        WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(patientDO.getId(),"7");
@ -258,6 +260,8 @@ public class OauthYlzConfigService {
                        rsMap.put("patient",patient);
                        return rsMap;
                    }else{
                        patientDO.setCardType(cardType);
                        basePatientDao.save(patientDO);
                        WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(patientDO.getId(),"7");
                        if (basePatientFamilyMemberDO==null){
                            basePatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();

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

@ -385,6 +385,69 @@ public class MqSdkController extends EnvelopRestEndpoint {
        return success(obj);
    }
    @GetMapping(value = "/BS10142")
    @ApiOperation(value = "核酸预约列表接口")
    public ListEnvelop BS10142(@ApiParam(name = "deptCode", value = "科室code")
                                   @RequestParam(value = "deptCode", required = true) String deptCode,
                               @ApiParam(name = "docCode", value = "医生code")
                               @RequestParam(value = "docCode", required = true) String docCode,
                               @ApiParam(name = "chargeType", value = "号别类型")
                                   @RequestParam(value = "chargeType", required = true) String chargeType) throws Exception{
        JSONArray  obj = entranceService.BS10142(deptCode,docCode,chargeType,demoFlag);
        return success(obj);
    }
    @GetMapping(value = "/BS10143")
    @ApiOperation(value = "核酸号源查询")
    public ListEnvelop BS10143(@ApiParam(name = "day", value = "时间")
                               @RequestParam(value = "day", required = true) String day) throws Exception{
        JSONArray  obj = entranceService.BS10143(day,demoFlag);
        return success(obj);
    }
    @GetMapping(value = "/BS10144")
    @ApiOperation(value = "核酸预约")
    public Envelop BS10144(@ApiParam(name = "deptCode", value = "科室code")
                               @RequestParam(value = "deptCode", required = true) String deptCode,
                               @ApiParam(name = "docCode", value = "医生code")
                               @RequestParam(value = "docCode", required = true) String docCode,
                               @ApiParam(name = "startTime", value = "预约时间")
                               @RequestParam(value = "startTime", required = true) String startTime,
                               @ApiParam(name = "sSID", value = "社保卡")
                                   @RequestParam(value = "sSID", required = true) String sSID,
                               @ApiParam(name = "patientName", value = "患者姓名")
                                   @RequestParam(value = "patientName", required = true) String patientName,
                               @ApiParam(name = "patientID", value = "患者身份证")
                                   @RequestParam(value = "patientID", required = true) String patientID,
                               @ApiParam(name = "patientPhone", value = "患者手机号")
                                   @RequestParam(value = "patientPhone", required = true) String patientPhone) throws Exception{
        //String deptCode,String docCode,String startTime,String sSID,String patientName,String patientID,String patientPhone
        String   obj = entranceService.BS10144(deptCode,docCode,startTime,sSID,patientName,patientID,patientPhone,demoFlag);
        return success(obj);
    }
    @GetMapping(value = "/BS10145")
    @ApiOperation(value = "核酸预约")
    public Envelop BS10145(@ApiParam(name = "deptCode", value = "科室code")
                               @RequestParam(value = "deptCode", required = true) String deptCode,
                               @ApiParam(name = "docCode", value = "医生code")
                               @RequestParam(value = "docCode", required = true) String docCode,
                               @ApiParam(name = "startTime", value = "预约时间")
                               @RequestParam(value = "startTime", required = true) String startTime,
                               @ApiParam(name = "sSID", value = "社保卡")
                               @RequestParam(value = "sSID", required = true) String sSID,
                               @ApiParam(name = "patientName", value = "患者姓名")
                               @RequestParam(value = "patientName", required = true) String patientName,
                               @ApiParam(name = "patientID", value = "患者身份证")
                               @RequestParam(value = "patientID", required = true) String patientID,
                               @ApiParam(name = "patientPhone", value = "患者手机号")
                               @RequestParam(value = "patientPhone", required = true) String patientPhone) throws Exception{
        //String deptCode,String docCode,String startTime,String sSID,String patientName,String patientID,String patientPhone
        String  obj = entranceService.BS10145(deptCode,docCode,startTime,sSID,patientName,patientID,patientPhone,demoFlag);
        return success(obj);
    }
    @PostMapping(value = "/ehospitalNotice")
    @ApiOperation(value = "互联网医院通知")
    public ObjEnvelop ehospitalNotice(

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

@ -26,6 +26,14 @@
				<BS10111_1>EwellQ.S60.BS10111.GET</BS10111_1>
				<BS10138_0>EwellQ.S60.BS10138.PUT</BS10138_0>
				<BS10138_1>EwellQ.S60.BS10138.GET</BS10138_1>
				<BS10142_0>EwellQ.S60.BS10142.PUT</BS10142_0>
				<BS10142_1>EwellQ.S60.BS10142.GET</BS10142_1>
				<BS10143_0>EwellQ.S60.BS10143.PUT</BS10143_0>
				<BS10143_1>EwellQ.S60.BS10143.GET</BS10143_1>
				<BS10144_0>EwellQ.S60.BS10144.PUT</BS10144_0>
				<BS10144_1>EwellQ.S60.BS10144.GET</BS10144_1>
				<BS10145_0>EwellQ.S60.BS10145.PUT</BS10145_0>
				<BS10145_1>EwellQ.S60.BS10145.GET</BS10145_1>
				<BS15054_0>EwellQ.S60.BS15054.PUT</BS15054_0>
				<BS15054_1>EwellQ.S60.BS15054.GET</BS15054_1>
				<BS10112_0>EwellQ.S60.BS10112.PUT</BS10112_0>
@ -96,6 +104,7 @@
				<MS02017_1>EwellQ.S60.MS02017.GET</MS02017_1>
				<MS02019_1>EwellQ.S60.MS02019.GET</MS02019_1>
				<MS02019_0>EwellQ.S60.MS02019.PUT</MS02019_0>
				<!--检查检验end-->
				<!-- 预约挂号start-->

+ 50 - 4
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/TimeoutOverDueService.java

@ -3,20 +3,23 @@ package com.yihu.jw.service.channel;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.doctor.WlyyPatientRegisterTimeDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.BaseNatAppointmentDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultTeamDao;
@ -24,6 +27,7 @@ import com.yihu.jw.im.service.ImService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.DateUtil;
import com.yihu.jw.util.common.IdCardUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -80,6 +84,14 @@ public class TimeoutOverDueService {
    private ConsultTeamDao consultTeamDao;
    @Autowired
    private ConsultDao consultDao;
    @Autowired
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private EntranceService entranceService;
    @Autowired
    private PatientMappingDao patientMappingDao;
    /**
     *  取消未结束门诊
     */
@ -201,5 +213,39 @@ public class TimeoutOverDueService {
                }
            }
        }
    public void CancelNotPay(){
        List<BaseNatAppointmentDO> list =  baseNatAppointmentDao.findByPayStatus();
        long defaultTime=30;//分钟
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("CancelNotPayTime");
        if (wlyyHospitalSysDictDO!=null&&StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())){
            defaultTime= Long.parseLong(wlyyHospitalSysDictDO.getDictValue());
        }
        if (list!=null&&list.size()>0){
            for (BaseNatAppointmentDO baseNatAppointmentDO:list){
                long currentTime = new Date().getTime();
                long outpatientTime = baseNatAppointmentDO.getCreateTime().getTime();
                if (currentTime-outpatientTime>defaultTime*60*1000){
                    baseNatAppointmentDO.setCancelBy("system");
                    baseNatAppointmentDO.setCancelReson("超时系统取消");
                    baseNatAppointmentDO.setCancelTime(new Date());
                    baseNatAppointmentDO.setIsSuccess("-1");
                    baseNatAppointmentDao.save(baseNatAppointmentDO);
                }
                //取消预约
                try {
                    PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(baseNatAppointmentDO.getPatientId());
                    String userNo = null;
                    if (patientMappingDO != null) {
                        userNo = patientMappingDO.getMappingCode();
                    }
                    entranceService.BS10145(baseNatAppointmentDO.getDept(),baseNatAppointmentDO.getDoctorId(), DateUtil.dateToStr(baseNatAppointmentDO.getAppointmentTime(),"yyyy-MM-dd hh:mm:ss"),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),userNo,baseNatAppointmentDO.getMobile(),false);
                    //取消挂号
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }
    }

+ 59 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/CancelNotPay.java

@ -0,0 +1,59 @@
package com.yihu.jw.util;
import com.yihu.jw.service.channel.TimeoutOverDueService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.Trigger;
import org.springframework.scheduling.TriggerContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import java.util.Date;
@Lazy(false)
@Component
@EnableScheduling
public class CancelNotPay implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(CancelNotPay.class);
    private static String cron = "0 */1 * * * ?";//"0 0 0 * * ?";0 */5 * * * ?
    @Autowired
    private TimeoutOverDueService timeoutOverDueService;
    public String change(String corIn) {
        if (StringUtils.isNotBlank(corIn)) {
            cron = corIn;
        }
        return cron;
    }
    @Override
    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
        taskRegistrar.addTriggerTask(new Runnable() {
            @Override
            public void run() {
                logger.info("START========CancelNotPay========");
                try {
                    timeoutOverDueService.CancelNotPay();
                    logger.info("END========CancelNotPay========");
                } catch (Exception e) {
                    e.printStackTrace();
                    logger.error("END===ERROE===CancelNotPay,message:"+e.getMessage());
                }
            }
        }, new Trigger() {
            @Override
            public Date nextExecutionTime(TriggerContext triggerContext) {
                // 任务触发,可修改任务的执行周期
                CronTrigger trigger = new CronTrigger(cron);
                System.out.println("CancelNotPay,可修改任务的执行周期"+cron);
                Date nextExec = trigger.nextExecutionTime(triggerContext);
                return nextExec;
            }
        });
    }
}

+ 71 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -180,6 +180,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseBannerDoctorService baseBannerDoctorService;
    @Autowired
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
@ -890,6 +892,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                            if (listWPD!=null&&listWPD.size()!=0){
                                WaitPayDetailVO waitPayDetailVO = listWPD.get(0);
                                String voucherNo = waitPayDetailVO.getVoucherNo();
                                //判断处方
                                List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderList(waitPayDetailVO.getRecipeNo());
                                for (WlyyPrescriptionDO prescriptionDO:prescriptionDOList){
                                    if (prescriptionDO.getStatus()!=30){
@ -939,6 +942,45 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                        logger.info("处方结算成功"+pushPayLog+"====="+waitPayDetailVO.getRecipeNo());
                                    }
                                }
                                //判断检查订单
                                List<BaseNatAppointmentDO> baseNatAppointmentDOS = baseNatAppointmentDao.findByRealOrderList(waitPayDetailVO.getRecipeNo());
                                for (BaseNatAppointmentDO natAppointmentDO:baseNatAppointmentDOS){
                                    natAppointmentDO.setPayStatus("1");
                                    baseNatAppointmentDao.save(natAppointmentDO);
                                    //发送支付成功通知
                                    String pushPayLog = null;
                                    String fee = waitPayDetailVO.getFee();
                                    if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                                        String title="您在厦门大学附属中山医院有一笔交易已支付完成!";
                                        pushPayLog = payInfoNoticeService.pushPrescriptionPayAndHsjc(natAppointmentDO.getPatientId(),natAppointmentDO.getDoctorName(),voucherNo,natAppointmentDO.getId()+"",fee,title,null);
                                    }
                                    //发送预约成功通知
                                    String name= natAppointmentDO.getName();
                                    String idcard = natAppointmentDO.getCardNo();
                                    String mobile = natAppointmentDO.getMobile();
                                    String url = "https://hlwyy.xmzsh.com";
                                    String date = DateUtil.dateToStrLong(natAppointmentDO.getAppointmentTime());
                                    String first = "尊敬的用户"+name+",您已完成线上自助核酸检测开单预约";
                                    String contentMsg = "申请人:"+name+";预约时间:"+date+";发票流水号:"+voucherNo;
                                    String remark="<div style=\"color:#ff4949;\">\n" +
                                            "        <p>备注:1、请您持核酸开单预约信息和发票流水号、医保卡/就诊卡/电子健康卡,提前15分钟至我院五号楼北侧(急诊部后侧)核酸检测点?号取管窗口绑定检测。</p >\n" +
                                            "<p>2、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。</p >\n" +
                                            "    </div>";
                                    String responseMsg="";
                                    if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {
                                        responseMsg = entranceService.ehospitalNotice(
                                                name,
                                                idcard,
                                                mobile,
                                                first,
                                                url,
                                                contentMsg,
                                                remark);
                                        logger.info("中山发送模板消息返回结果="+responseMsg);
                                        System.out.println("结束发送模板消息");
                                    }
                                }
                            }
                            for (WaitPayDetailVO waitPayDetailVO:listWPD){
                                if (waitPayDetailVO.getItemName().equalsIgnoreCase("互联网医院复诊诊查费")){
@ -1417,5 +1459,34 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findJobCategory)
    @ApiOperation(value = "查询所有业务分类", notes = "查询所有业务分类")
    public MixEnvelop findJobCategory() {
        return prescriptionService.findJobCategory();
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getNatRecords)
    @ApiOperation(value = "查询预约记录", notes = "查询预约记录")
    public MixEnvelop getNatRecords(@ApiParam(name = "patientId", value = "居民id")
                                        @RequestParam(value = "patientId", required = false)String patientId,
                                    @ApiParam(name = "page", value = "页数")
                                    @RequestParam(value = "page", required = false)Integer page,
                                    @ApiParam(name = "pageSize", value = "每页大小")
                                        @RequestParam(value = "pageSize", required = false)Integer pageSize) {
        return  prescriptionService.getNatRecords(patientId,page,pageSize);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findBaseAddress)
    @ApiOperation(value = "查询地址", notes = "查询地址")
    public ListEnvelop findBaseAddress(@ApiParam(name = "addressFlag", value = "addressFlag")
                                    @RequestParam(value = "addressFlag", required = false)String addressFlag,
                                    @ApiParam(name = "parentName", value = "parentName")
                                    @RequestParam(value = "parentName", required = false)String parentName ){
        return  success(prescriptionService.findBaseAddress(addressFlag,parentName));
    }
}

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

@ -25,6 +25,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.*;
import com.yihu.jw.hospital.prescription.service.entrance.DoctorPreSignService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
@ -125,6 +126,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    private TnyyEntranceService tnyyEntranceService;
    @Autowired
    private TnPrescriptionService tnPrescriptionService;
    @Autowired
    private EntranceService entranceService;
    @Value("${qywx.id}")
    private String qywxId;
@ -1574,8 +1577,14 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation("查询支付状态")
    public ObjEnvelop selectOrderStatus(
            @ApiParam(name = "relationCode", value = "relationCode", required = true)
            @RequestParam(required = true)String relationCode) throws Exception {
            @RequestParam(required = true)String relationCode,
            @ApiParam(name = "flag", value = "flag", required = false)
            @RequestParam(required = false)String flag) throws Exception {
        try {
            if (StringUtils.isNoneBlank(flag)){
                Integer id = Integer.parseInt(relationCode);
                return ObjEnvelop.getSuccess("ok",businessOrderService.selectById(id));
            }
            return ObjEnvelop.getSuccess("ok",businessOrderService.selectStatus(relationCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
@ -2157,12 +2166,19 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.selectByUrl)
    @ApiOperation("获取诊间支付url")
    public ObjEnvelop selectByUrl(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId,
            @ApiParam(name = "oupatientId", value = "oupatientId", required = true)
            @RequestParam(required = true)String oupatientId) throws Exception {
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = false)
            @RequestParam(required = false)String prescriptionId,
            @ApiParam(name = "oupatientId", value = "oupatientId", required = false)
            @RequestParam(required = false)String oupatientId,
            @ApiParam(name = "flag", value = "flag", required = false)
            @RequestParam(required = false)String flag) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrl(oupatientId,prescriptionId,wxId));
            if (StringUtils.isNoneBlank(flag)){
                Integer id = Integer.parseInt(oupatientId);
                return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrlHsjc(id,wxId));
            }else {
                return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrl(oupatientId,prescriptionId,wxId));
            }
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
@ -2484,4 +2500,87 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(array);
    }
    @GetMapping("/BS10142")
    public ListEnvelop BS10142(
            @ApiParam(name = "deptCode", value = "deptCode")
            @RequestParam(value = "deptCode",required = false)String deptCode,
            @ApiParam(name = "docCode", value = "docCode")
            @RequestParam(value = "docCode",required = false)String docCode,
            @ApiParam(name = "chargeType", value = "chargeType")
            @RequestParam(value = "chargeType",required = false)String chargeType) throws Exception {
        return success(entranceService.BS10142(deptCode,docCode,chargeType,demoFlag));
    }
    @GetMapping("/BS10143")
    public ListEnvelop BS10143(@ApiParam(name = "day", value = "day")
                               @RequestParam(value = "day",required = false)String day) throws Exception {
        return success(entranceService.BS10143(day,demoFlag));
    }
    @GetMapping("/BS10144")
    public Envelop BS10144(@ApiParam(name = "deptCode", value = "deptCode")
                               @RequestParam(value = "deptCode",required = false)String deptCode,
                           @ApiParam(name = "docCode", value = "docCode")
                           @RequestParam(value = "docCode",required = false)String docCode,
                           @ApiParam(name = "startTime", value = "startTime")
                               @RequestParam(value = "startTime",required = false)String startTime,
                           @ApiParam(name = "sSID", value = "sSID")
                               @RequestParam(value = "sSID",required = false)String sSID,
                           @ApiParam(name = "patientName", value = "patientName")
                               @RequestParam(value = "patientName",required = false)String patientName,
                           @ApiParam(name = "patientID", value = "patientID")
                               @RequestParam(value = "patientID",required = false)String patientID,
                           @ApiParam(name = "patientPhone", value = "patientPhone")
                               @RequestParam(value = "patientPhone",required = false)String patientPhone) throws Exception {
        return success(entranceService.BS10144(deptCode,docCode,startTime,sSID,patientName,patientID,patientPhone,demoFlag));
    }
    @GetMapping("/BS10145")
    public Envelop BS10145(@ApiParam(name = "id", value = "id")
                               @RequestParam(value = "id",required = false)Integer id,
                           @ApiParam(name = "patientId", value = "patientId")
                               @RequestParam(value = "patientId",required = false)String patientId) throws Exception {
        return success(prescriptionService.cancelNatAppointment(id,patientId));
    }
    @GetMapping("/saveNatAppointment")
    @ApiOperation(value = "核酸检测预约接口")
    public Envelop saveNatAppointment(@ApiParam(name = "mediaCard", value = "mediaCard")
                                          @RequestParam(value = "mediaCard",required = false)String mediaCard,
                                      @ApiParam(name = "patientId", value = "patientId")
                                          @RequestParam(value = "patientId",required = false)String patientId,
                                      @ApiParam(name = "name", value = "name")
                                          @RequestParam(value = "name",required = false)String name,
                                      @ApiParam(name = "cardNo", value = "cardNo")
                                          @RequestParam(value = "cardNo",required = false)String cardNo,
                                      @ApiParam(name = "cardType", value = "cardType")
                                          @RequestParam(value = "cardType",required = false)String cardType,
                                      @ApiParam(name = "mobile", value = "mobile")
                                          @RequestParam(value = "mobile",required = false)String mobile,
                                      @ApiParam(name = "firstJobCode", value = "firstJobCode")
                                          @RequestParam(value = "firstJobCode",required = false)String firstJobCode,
                                      @ApiParam(name = "firstJobName", value = "firstJobName")
                                          @RequestParam(value = "firstJobName",required = false)String firstJobName,
                                      @ApiParam(name = "secondJobCode", value = "secondJobCode")
                                          @RequestParam(value = "secondJobCode",required = false)String secondJobCode,
                                      @ApiParam(name = "secondJobName", value = "secondJobName")
                                          @RequestParam(value = "secondJobName",required = false)String secondJobName,
                                      @ApiParam(name = "natTime", value = "natTime")
                                          @RequestParam(value = "natTime",required = false)String natTime,
                                      @ApiParam(name = "address", value = "address")
                                          @RequestParam(value = "address",required = false)String address,
                                      @ApiParam(name = "provinceName", value = "provinceName")
                                          @RequestParam(value = "provinceName",required = false)String provinceName,
                                      @ApiParam(name = "cityName", value = "cityName")
                                          @RequestParam(value = "cityName",required = false)String cityName,
                                      @ApiParam(name = "townName", value = "townName")
                                          @RequestParam(value = "townName",required = false)String townName,
                                      @ApiParam(name = "streetName", value = "streetName")
                                          @RequestParam(value = "streetName",required = false)String streetName){
        try {
            return success(prescriptionService.saveNatAppointment(mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
}

+ 1 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -345,9 +345,8 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
                    String code = null==nameList.get(0).get("code")?"":nameList.get(0).get("code").toString();
                    String name = null==nameList.get(0).get("name")?"": ConcealUtil.nameOrAddrConceal(nameList.get(0).get("name").toString());
//                    String name = null==nameList.get(0).get("name")?"": ConcealUtil.nameOrAddrConceal(AesEncryptUtils.decrypt(nameList.get(0).get("name").toString()));//待i健康加密
                    locationDataVO.setIdCard(AesEncryptUtils.decrypt(idCard));
                    locationDataVO.setCode(code);
                    locationDataVO.setName(AesEncryptUtils.decrypt(name));
                    locationDataVO.setName(name);
                }
                if (deviceList.size()>0){
                    String equipmentName = null==deviceList.get(0).get("device_name")?"":deviceList.get(0).get("device_name").toString();