Bladeren bron

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

LAPTOP-KB9HII50\70708 3 jaren geleden
bovenliggende
commit
42fa1900ef
19 gewijzigde bestanden met toevoegingen van 301 en 65 verwijderingen
  1. 50 27
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  3. 3 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  4. 32 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  5. 8 18
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  6. 12 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WxTemplateService.java
  7. 15 8
      business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java
  8. 7 3
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  9. 1 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxTemplateConfigDO.java
  10. 11 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java
  11. 7 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyHisPrescriptionVO.java
  12. 40 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/ykyy/UnCheckPrescriptionJob.java
  13. 77 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java
  14. 13 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java
  15. 12 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  16. 3 0
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  17. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  18. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  19. 1 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationInfoService.java

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

@ -148,6 +148,7 @@ import java.lang.Boolean;
import java.lang.management.ManagementFactory;
import java.math.BigDecimal;
import java.net.URL;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -3862,7 +3863,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    statuss += " ";
                }*/
                String odry = "";
                String orderCategory ="";
                String orderCategory = "";
                String odte = "";
                String status ="";
                String pay = "";
                if (m.get("orderCategory")==null){
                    odry = null;
                }else {
@ -3870,27 +3875,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    if (orderCategory.equals("1")) {
                        odry += "专家咨询";
                    }else if (orderCategory.equals("2")) {
                        odry += "图文诊室";
                        odry += "复诊";
                    }else if (orderCategory.equals("3")) {
                        odry += "视频诊室";
                    }else if (orderCategory.equals("4")) {
                        odry += "处方";
                        odte += "处方";
                    }else if (orderCategory.equals("5")) {
                        if (m.get("orderType") != null) {
                            String ort = m.get("orderType").toString();
                            if (ort.equalsIgnoreCase("10")) {
                                odry += "就诊卡号充值";
                            }else if(ort.equalsIgnoreCase("11")) {
                                odry += "门诊卡号充值";
                            }
                        }
                        odry += "就诊卡充值";
                        odte += "就诊卡充值";
                    }else {
                        odry += " ";
                    }
                }
                String status ="";
                if(m.get("orderType") == null) {
                    odte = null;
                }else{
                    String orderType =  m.get("orderType").toString();
                    if (orderType.equalsIgnoreCase("1")) {
                        odte += "图文";
                    }else if (orderType.equalsIgnoreCase("3")) {
                        odte += "视频";
                    }
                }
                if (m.get("status") == null) {
                    status = null;
                }else {
@ -3914,18 +3923,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    }
                }
                String odte = "";
                if(m.get("orderType") == null) {
                    odte = null;
                }else{
                    String orderType =  m.get("orderType").toString();
                    if (orderType.equalsIgnoreCase("1")) {
                        odte += "图文咨询";
                    }else if (orderType.equalsIgnoreCase("3")) {
                        odte += "视频咨询";
                    }
                }
                String pay = "";
                if (m.get("payPrice") == null) {
                    pay = null;
                }else{
@ -3939,7 +3938,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    time = m.get("payTime").toString();
                }
                addCell(ws, i, 0, m.get("id")!=null?m.get("id").toString():n);
                addCell(ws, i, 1, time!=null?time:n);
                addCell(ws, i, 2, (String) m.get("orderNo")!=null?(String) m.get("orderNo"):n);
@ -5239,6 +5237,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setKeyword1( outpatientDO.getHospitalName());
                newConfig.setKeyword2(outpatientDO.getDoctorName());
                newConfig.setKeyword3( doctorDO.getFee());
                newConfig.setPagepath(newConfig.getPagepath() + "" + outpatientDO.getId());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 医生拒诊开始");
@ -5251,6 +5250,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                scene="jzddgcts";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_timeout_remind", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setPagepath(newConfig.getPagepath() + "" + outpatientDO.getId());
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("就诊等待过长提示");
            } else if ("payRemind".equalsIgnoreCase(titelType)) {
@ -5276,6 +5276,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                newConfig.setKeyword2(outpatientDO.getHospitalName());
                newConfig.setKeyword3(outpatientDO.getDoctorName());
                String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
                newConfig.setPagepath(newConfig.getPagepath()+URLEncoder.encode(path));
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 就诊支付提醒开始");
@ -5308,6 +5310,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                newConfig.setKeyword2(outpatientDO.getHospitalName());
                newConfig.setKeyword3(outpatientDO.getDoctorName());
                String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
                newConfig.setPagepath(newConfig.getPagepath() +URLEncoder.encode(path));
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
            } else if ("doctorPick".equalsIgnoreCase(titelType)) {
@ -5334,6 +5338,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setRemark(config.getRemark().replace("key1",outpatientDO.getDoctorName()));
                newConfig.setKeyword2(outpatientDO.getHospitalName());
                newConfig.setKeyword3(outpatientDO.getDoctorName());
                String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
                newConfig.setPagepath(newConfig.getPagepath() +URLEncoder.encode(path));
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
            }else if ("patientCancel".equalsIgnoreCase(titelType)) {
@ -5353,6 +5359,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setKeyword1( outpatientDO.getHospitalName());
                newConfig.setKeyword2(outpatientDO.getDoctorName());
                newConfig.setKeyword3(outpatientDO.getFee()==null?"0":outpatientDO.getFee().toString());
                String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
                newConfig.setPagepath(newConfig.getPagepath() + URLEncoder.encode(path));
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送");
@ -5365,6 +5373,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setKeyword1( "处方支付");
                newConfig.setKeyword2(outpatientDO.getHospitalName());
                newConfig.setKeyword3(outpatientDO.getDoctorName());
                String path = "returnVisit/preChat?type=16&outpatientId="+outpatientDO.getId();
                newConfig.setPagepath(newConfig.getPagepath()+URLEncoder.encode(path) );
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 处方支付提醒开始");
@ -5386,6 +5396,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setKeyword3( outpatientDO.getDoctorName());
                newConfig.setKeyword4(DateUtil.dateToStrLong(outpatientDO.getRegisterDate()));
                newConfig.setKeyword5(generalDoctorWaitingNumber(doctorDO.getId(), wxId, outpatientId));
                String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
                newConfig.setPagepath(newConfig.getPagepath() +URLEncoder.encode(path));
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 视频问诊预约提醒开始");
@ -5397,6 +5409,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setFirst(config.getFirst().replaceFirst("key1", consPatientDO.getName()));
                newConfig.setKeyword2(hospitalDO.getOrgName());
                newConfig.setKeyword3(consDoctorDO.getName());
                String path = "fuwupingjia?consultCode="+consultTeam.getConsult();
                newConfig.setPagepath(newConfig.getPagepath()+URLEncoder.encode(path));
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                logger.info("极光消息推送 医生拒诊开始");
@ -5419,7 +5433,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                newConfig.setKeyword1( outpatientDO.getHospitalName());
                newConfig.setKeyword2(outpatientDO.getDoctorName());
                newConfig.setKeyword3( doctorDO.getFee());
                newConfig.setKeyword3(outpatientDO.getFee()==null?"0":outpatientDO.getFee().toString());
                String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
                newConfig.setPagepath(newConfig.getPagepath() +URLEncoder.encode(path));
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 系统拒诊开始");
@ -5572,6 +5588,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            newConfig.setKeyword3(mailNo);
            newConfig.setKeyword4(remindMsg);
            newConfig.setRemark(config.getRemark());
            String path = "returnVisit/logistics?outpatientId="+outpatientId+"&prescriptionCode="+prescriptionId;
            newConfig.setPagepath(newConfig.getPagepath()+ URLEncoder.encode(path));
            newConfig.setUrl(newConfig.getUrl().replace("key1",outpatientId).replace("key2",prescriptionId));
            logger.info("=======setUrl========" + newConfig.getUrl());
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
@ -12065,7 +12084,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public Map saveNatAppointment(String chargeAmount,String inspectionName,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,String pm,String pushFlag,String cardNoType,String consumer,
                                  String checkPart,String chargeFlag,String chargeCode,String icdCode,String preNo) throws Exception {
                                  String checkPart,String chargeFlag,String chargeCode,String icdCode,String preNo,String idnoType) throws Exception {
        Map returnMap = new HashMap();
        Integer winNo = 6;
        if (checkPart==null||checkPart==""){
@ -12111,6 +12130,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            jsondate.put("targetChild",secondJobName);
            jsondate.put("target",firstJobName);
            jsondate.put("quantity",1);
            jsondate.put("idno_type",idnoType);
            Map<String,Object> map = findRandomDoctor();
            net.sf.json.JSONObject rs = new JSONObject();
            if (map!=null){
@ -12158,6 +12178,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    baseNatAppointmentDO.setIcdCode(icdCode);
                    baseNatAppointmentDO.setChargeCode(chargeCode);
                    baseNatAppointmentDO.setWinNo(String.valueOf(winNo));
                    baseNatAppointmentDO.setIdnoType(idnoType);
                    baseNatAppointmentDO.setDept("3150000");
                    baseNatAppointmentDO.setDeptName("感染疾病科");
                    baseNatAppointmentDO.setAmpm(pm);
@ -12330,6 +12351,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            baseNatAppointmentDO.setAmpm(pm);
            baseNatAppointmentDO.setHospitalFlag(pushFlag);
            baseNatAppointmentDO.setConsumer(consumer);
            baseNatAppointmentDO.setIdnoType(idnoType);
            BasePatientDO basePatientDO = basePatientDao.findById(consumer);
            baseNatAppointmentDO.setConsumerName(basePatientDO.getName());
            baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
@ -12459,6 +12481,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                baseNatAppointmentDO.setName(name);
                baseNatAppointmentDO.setCardNo(cardNo.trim());
                baseNatAppointmentDO.setCardType(cardType);
                baseNatAppointmentDO.setIdnoType(idnoType);
                baseNatAppointmentDO.setAddress(address);
                baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
                baseNatAppointmentDO.setOderNum(orderNum);

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

@ -367,7 +367,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                businessOrderDO.setOrderType(1);
                businessOrderDO.setOrderCategory("1");
            } else if (outpatientDO.getType().equalsIgnoreCase("2")) {
                businessOrderDO.setOrderType(17);
                businessOrderDO.setOrderType(3);
                businessOrderDO.setOrderCategory("1");
            }
        }else {

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

@ -1096,7 +1096,9 @@ public class EntranceService {
                if (StringUtils.isNotBlank(vo.getArea())) {
                    sbs.append(" area=\"" + vo.getArea() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getIdnoType())) {
                    sbs.append(" idno_type=\"" + vo.getIdnoType() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getTarget())) {
                    sbs.append(" target=\"" + vo.getTarget() + "\"");
                }

+ 32 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -286,12 +286,12 @@ public class YkyyEntranceService {
        if(patientMappingDO==null){
            return new JSONArray();
        }
        String sql ="select * from VLIS_REPORT_MASTER where PATIENT_ID = '"+patientMappingDO.getMappingCode()+"'";
        String sql ="select * from VLIS_REPORT_MASTER where PATIENT_ID = 'XMYK"+patientMappingDO.getMappingCode()+"'";
        if(StringUtils.isNoneBlank(startTime)){
            sql+=" and REPORT_TIME >= '"+startTime.replace("-",".")+"' ";
            sql+=" and REPORT_TIME >= to_date('"+startTime+"', 'YYYY-MM-DD HH24:MI:SS')";
        }
        if(StringUtils.isNoneBlank(endTime)){
            sql+=" and REPORT_TIME <= '"+endTime.replace("-",".")+"' ";
            sql+=" and REPORT_TIME <= to_date('"+endTime+"', 'YYYY-MM-DD HH24:MI:SS')";
        }
        sql+="  order by REPORT_TIME desc";
        Map<String,Object> params = new HashedMap();
@ -624,6 +624,35 @@ public class YkyyEntranceService {
        return new JSONArray();
    }
    /**
     * 查找眼科his 未审核未付款
     * @throws Exception
     */
    public JSONArray getUnCheckPrescription(String startTime,String endTime) throws Exception{
        String sql = "SELECT h.BRID,h.CFSB,h.SJLY from v_ms_dd01 h WHERE h.SPZT = 0 and h.FKZT = 0 ";
        if(!StringUtil.isBlank(startTime)){
            sql += " and h.KFRQ >= to_date('"+startTime+"', 'YYYY-MM-DD HH24:MI:SS')";
        }
        if(!StringUtil.isBlank(endTime)){
            sql += " and h.KFRQ <= to_date('"+endTime+"', 'YYYY-MM-DD HH24:MI:SS')";
        }
        sql+=" order by h.KFRQ desc ";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        params.put("page","1");
        params.put("size","60");
        HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            return rs.getJSONArray("detailModelList");
        }
        return new JSONArray();
    }
    /**
     * HIS就诊患者历史查询
     * @throws Exception

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

@ -283,14 +283,14 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        businessOrderDO.setUpdateTime(new Date());
        businessOrderDO.setStatus(0);
        if (StringUtils.isNoneBlank(businessOrderDO.getDoctor())){
            if (businessOrderDO.getOrderType()==17){
            if (businessOrderDO.getOrderType()==3){
                businessOrderDO.setOrderNo("HLWYY3"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            }else {
                businessOrderDO.setOrderNo("HLWYY"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            }
        }else {
            if (businessOrderDO.getOrderType()==17){
            if (businessOrderDO.getOrderType()==3){
                businessOrderDO.setOrderNo("HLWYYQD3"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            }else {
                businessOrderDO.setOrderNo("HLWYYQD"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
@ -2103,36 +2103,26 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            }
        }
        if (StringUtils.isNoneBlank(orderNo)){
            sql+=" and t.order_no ='"+orderNo+"'";
            sql+=" and t.order_no like '%"+orderNo+"%'";
        }
        if (StringUtils.isNoneBlank(yktOrderNo)){
            sql+=" and t.yk_order_no ='"+yktOrderNo+"'";
            sql+=" and t.yk_order_no like '%"+yktOrderNo+"%'";
        }
        if (StringUtils.isNoneBlank(patientName)){
            sql+=" and t.patient_name  like '%"+patientName+"%'";
        }
        if (StringUtils.isNoneBlank(idCard)){
            sql+=" and b.idcard ='"+idCard+"'";
        }
        if (StringUtils.isNoneBlank(medicard)){
            sql+=" and t.relation_code ='"+medicard+"'";
            sql+=" and b.idcard like '%"+idCard+"%'";
        }
        if (status!=null){
            sql+=" and t.status ="+status+"";
        }
        if (StringUtils.isNoneBlank(orderType)){
            sql+=" and t.order_type ="+orderType+"";
        }
        if (StringUtils.isNoneBlank(yktOrderNo)){
            sql+=" and t.yk_order_no =" + yktOrderNo + "";
        }
        if (StringUtils.isNoneBlank(medicard)){
            sql+=" and t.relation_code =" + medicard + "";
        }
        if (StringUtils.isNoneBlank(idCard)){
            sql+=" and b.idcard =" + idCard + "";
            sql+=" and t.order_type like %"+orderType+"%";
        }
        if (StringUtils.isNoneBlank(orderCategory)){
            if (orderCategory.equalsIgnoreCase("2")){
                sql+=" and t.order_category IN ('2','3') ";

+ 12 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxTemplateService.java

@ -405,6 +405,10 @@ public class WxTemplateService {
                                        WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
                                        BeanUtils.copyProperties(config,newConfig);
                                        newConfig.setFirst(config.getFirst().replace("key1",patientDO.getName()));
                                        if (StringUtils.isNoneBlank(config.getPagepath())){
                                            String path = "returnVisit/record?outpatientId="+outpatientId;
                                            newConfig.setPagepath(config.getPagepath()+URLEncoder.encode(path));
                                        }
                                        newConfig.setUrl(config.getUrl()+""+outpatientId);
                                        newConfig.setKeyword3(doctorName);
                                        WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
@ -509,6 +513,10 @@ public class WxTemplateService {
                                        condition = "&outpatientId="+relationCode;
                                    }
                                    newConfig.setFirst(config.getFirst().replace("key1",patientDO.getName()).replace("key2",name));
                                    if (StringUtils.isNoneBlank(config.getPagepath())){
                                        String path = "returnVisit/record?outpatientId="+relationCode;
                                        newConfig.setPagepath(config.getPagepath()+URLEncoder.encode(path));
                                    }
                                    newConfig.setUrl(config.getUrl()+""+condition);
                                    newConfig.setKeyword3(doctorDO.getName());
                                    newConfig.setKeyword1(name);
@ -614,6 +622,10 @@ public class WxTemplateService {
                        config.setFirst(config.getFirst().replace("key1",userName));
                        config.setKeyword1(contentString);
                        config.setKeyword2(DateUtil.dateToStrLong(new Date()));
                        if (StringUtils.isNoneBlank(config.getPagepath())){
                            String path = URLEncoder.encode(url.replace("https://intel.yanketong.com/ims-wx/index.html#/",""));
                            config.setPagepath(config.getPagepath()+path);
                        }
                        config.setUrl(url);
                        weixinMessagePushUtils.putWxMsg(wxAccessTokenService.getWxAccessTokenById(wechatId).getAccessToken(),basePatientWechatDo.getOpenid(),config);
                }

+ 15 - 8
business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java

@ -340,11 +340,15 @@ public class ElasticsearchUtil {
        public List findDateQuotaLevel0(String startDate, String endDate, String area, int level, String index, String timeLevel, String interval, String lowLevel) throws Exception {
        String areaLevel="6";
        String sqlArea = " select area_level from wlyy_job_config_new where id='"+index+"' ";
        List<String> areaLevels = jdbcTemplate.queryForList(sqlArea,String.class);
        if (areaLevels.size()>0){
            areaLevel = areaLevels.get(0);
        if (!index.contains(",")){
            String sqlArea = " select area_level from wlyy_job_config_new where id='"+index+"' ";
            List<String> areaLevels = jdbcTemplate.queryForList(sqlArea,String.class);
            if (areaLevels.size()>0){
                areaLevel = areaLevels.get(0);
            }
        }
        //时间格式转换  yyyy-MM-dd转成 2017-07-17T00:00:00+0800
        if (StringUtils.isNotEmpty(startDate)) {
            if (startDate.length() > 10) {
@ -1133,11 +1137,14 @@ public class ElasticsearchUtil {
     */
    public List findDateQuotaLevels(String startDate, String endDate, String area, int level, String index, String timeLevel,String interval, String lowLevel,String groupKey,String ...slaveKeys) {
        String areaLevel="6";
        String sqlArea = " select area_level from wlyy_job_config_new where id='"+index+"' ";
        List<String> areaLevels = jdbcTemplate.queryForList(sqlArea,String.class);
        if (areaLevels.size()>0){
            areaLevel = areaLevels.get(0);
        if (!index.contains(",")){
            String sqlArea = " select area_level from wlyy_job_config_new where id='"+index+"' ";
            List<String> areaLevels = jdbcTemplate.queryForList(sqlArea,String.class);
            if (areaLevels.size()>0){
                areaLevel = areaLevels.get(0);
            }
        }
        //时间格式转换  yyyy-MM-dd转成 2017-07-17T00:00:00+0800
        if (StringUtils.isNotEmpty(startDate)) {
            if (startDate.length() > 10) {

+ 7 - 3
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -4508,7 +4508,7 @@ public class ImService {
        pushSql =
                "SELECT\n" +
                        "\ta.patient_name AS \"pname\",\n" +
                        "\ta.doctor_name AS \"dname\",\n" +
                        "\ta.consumer_name AS \"dname\",\n" +
                        "\ta.dept_name AS \"dept\",\n" +
                        "\ta.outpatient_type AS \"type\",\n" +
                        "\ta.create_time AS \"ctime\",\n" +
@ -4523,11 +4523,15 @@ public class ImService {
                        "WHERE\n" +
                        "\t1 = 1";
        if (org.apache.commons.lang3.StringUtils.isNotBlank(status.toString())) {
        if (status != null) {
            pushSql += " AND a. STATUS in(" + status + ") ";
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(type)) {
            pushSql += " AND a.type = " + type +" ";
            if (type.equals("0")) {
            }else {
                pushSql += " AND a.type = " + type +" ";
            }
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(doctor)) {
            pushSql += " AND a.doctor_name like '%" + doctor + "%' ";

+ 1 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxTemplateConfigDO.java

@ -195,4 +195,5 @@ public class WxTemplateConfigDO extends UuidIdentityEntityWithOperator implement
    public void setStatus(Integer status) {
        this.status = status;
    }
}

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

@ -2,6 +2,7 @@ package com.yihu.jw.entity.hospital.prescription;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -60,6 +61,7 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    private String consumer;
    private String consumerName;
    private String oderNum;
    private String idnoType;
    public String getOderNum() {
        return oderNum;
@ -453,4 +455,13 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    public void setConsumerName(String consumerName) {
        this.consumerName = consumerName;
    }
    @Column(name = "idno_type")
    public String getIdnoType() {
        return idnoType;
    }
    public void setIdnoType(String idnoType) {
        this.idnoType = idnoType;
    }
}

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

@ -145,9 +145,16 @@ public class WlyyHisPrescriptionVO extends UuidIdentityVOWithOperator {
    private String target;
    private String targetChild;
    private String idnoType;
    public String getIdnoType() {
        return idnoType;
    }
    public void setIdnoType(String idnoType) {
        this.idnoType = idnoType;
    }
    public String getCardNo() {
        return cardNo;

+ 40 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/ykyy/UnCheckPrescriptionJob.java

@ -0,0 +1,40 @@
package com.yihu.jw.job.ykyy;
import com.yihu.jw.service.channel.PrescriptionStatusUpdateService;
import com.yihu.jw.service.channel.UnSettledHISPrescriptionService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * 定时查询HIS的01表中的审方状态,如果已审方,且未结算,则推送一条模板消息给居民,让居民进行支付结算。
 * Created by yeshijie on 2020/4/26.
 *
 * @author yeshijie.
 */
@DisallowConcurrentExecution
public class UnCheckPrescriptionJob implements Job{
    private static final Logger logger = LoggerFactory.getLogger(UnCheckPrescriptionJob.class);
    @Autowired
    private PrescriptionStatusUpdateService prescriptionStatusUpdateService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========unCheckPrescription========");
        try {
            prescriptionStatusUpdateService.unCheckPrescription();
            logger.info("END========unCheckPrescription 执行结束========");
        }catch (Exception e){
            e.printStackTrace();
            logger.error("END===ERROE===unCheckPrescription,message:"+e.getMessage());
        }
    }
}

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

@ -1,8 +1,12 @@
package com.yihu.jw.service.channel;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.WxPushLogDO;
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.message.SystemMessageDO;
@ -26,9 +30,15 @@ import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.status.EnvelopStatus;
import com.yihu.jw.sms.dao.HospitalSysDictDao;
import com.yihu.jw.util.DateUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.http.HttpUtils;
import com.yihu.jw.utils.YkyySMSService;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.WxPushLogDao;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -87,6 +97,16 @@ public class PrescriptionStatusUpdateService {
    private PrescriptionService prescriptionService;
    @Autowired
    private SystemMessageService systemMessageService;
    @Autowired
    private YkyyEntranceService ykyyEntranceService;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private HospitalSysDictDao hospitalSysDictDao;
    @Autowired
    private WxPushLogDao wxPushLogDao;
    @Autowired
    private YkyySMSService ykyySMSService;
    public void autoPush() throws Exception {
@ -831,6 +851,63 @@ public class PrescriptionStatusUpdateService {
        return msgReurn;
    }
    public void unCheckPrescription() throws Exception {
        String startTime= DateUtil.getStringDateShort() +" 00:00:00";
        String endTime= DateUtil.getStringDateShort() +" 23:59:59";
        JSONArray array = ykyyEntranceService.getUnCheckPrescription(startTime,endTime);
        String sendMesControl = "1";//1 开启发送短信 0 关闭
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("ykSmsControl");
        WlyyHospitalSysDictDO yunweiSysDict = hospitalSysDictDao.findById("yunweiMobile");
        String remind = yunweiSysDict.getDictValue();
        String mobiles = yunweiSysDict.getDictCode();
        if (wlyyHospitalSysDictDO!=null){
            sendMesControl = wlyyHospitalSysDictDO.getDictValue();
        }
        if(array!=null&&array.size()>0) {
            for (int i = 0; i < array.size(); i++) {
                JSONObject json = array.getJSONObject(i);
                String brid = json.getString("BRID");
                String cfsb = json.getString("CFSB");
                //查找居民信息
                BasePatientDO patientDO = ykyyEntranceService.findPatientByMapingCode(brid);
                if (patientDO != null) {
                    //查找对应的处方
                    String sql = "SELECT w.OUTPATIENT_ID,w.ID,w.DOCTOR_NAME,to_char(w.CREATE_TIME ,'yyyy/MM/dd hh24:mi:ss' ) as CREATE_TIME from WLYY_PRESCRIPTION w WHERE REAL_ORDER = '" + cfsb + "' ORDER BY w.CREATE_TIME desc";
                    List<Map<String, Object>> pre = hibenateUtils.createSQLQuery(sql);
                    if(pre!=null && pre.size()>0){
                        String outpatientId = pre.get(0).get("OUTPATIENT_ID").toString();
                        String createTime =pre.get(0).get("CREATE_TIME").toString();
                        Date createDate =  DateUtil.strToDateLong(createTime);
                        Calendar cal= Calendar.getInstance();
                        cal.setTime(createDate);
                        cal.add(Calendar.MINUTE,Integer.parseInt(remind));
                        Long now = new Date().getTime();
                        Long min = cal.getTime().getTime();
                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
                        if (min<=now){
                            String mobileList[] = mobiles.split(",");
                            if ("1".equalsIgnoreCase(sendMesControl)){
                                for (int j=0;j<mobileList.length;j++){
                                    WxPushLogDO wxPushLogDO = new WxPushLogDO();
                                    wxPushLogDO.setTempName("未审核提醒");
                                    wxPushLogDO.setOpenid(wlyyOutpatientDO.getId());
                                    wxPushLogDO.setReceiver(wlyyOutpatientDO.getPatient());
                                    wxPushLogDO.setCreateTime(new Date());
                                    wxPushLogDao.save(wxPushLogDO);
                                    ykyySMSService.ykyySendSMS(mobileList[j],wlyyOutpatientDO.getDoctorName()+"已为患者:开具处方,请尽快通知相关人员处理。");
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    public String finishOldConsult(String consult){
        int resutl = imService.finish(consult,"admin",2);

+ 13 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java

@ -47,6 +47,7 @@ import com.yihu.jw.wechat.dao.WxPushLogDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.dao.WxTemplateDao;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
@ -260,6 +261,10 @@ public class UnSettledHISPrescriptionService {
                                        WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
                                        BeanUtils.copyProperties(config,newConfig);
                                        newConfig.setFirst(config.getFirst().replace("key1",patientDO.getName()));
                                        if (StringUtils.isNoneBlank(config.getPagepath())){
                                            String path = "returnVisit/record?outpatientId="+outpatientId;
                                            newConfig.setPagepath(config.getPagepath()+URLEncoder.encode(path));
                                        }
                                        newConfig.setUrl(config.getUrl()+""+outpatientId);
                                        newConfig.setKeyword3(doctorName);
                                        WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
@ -392,6 +397,10 @@ public class UnSettledHISPrescriptionService {
                                        WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
                                        BeanUtils.copyProperties(config,newConfig);
                                        newConfig.setFirst(config.getFirst().replace("key1",patientDO.getName()));
                                        if (StringUtils.isNoneBlank(config.getPagepath())){
                                            String path = "returnVisit/record?outpatientId="+outpatientId;
                                            newConfig.setPagepath(config.getPagepath()+URLEncoder.encode(path));
                                        }
                                        newConfig.setUrl(config.getUrl()+""+outpatientId);
                                        newConfig.setKeyword3(doctorName);
                                        WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
@ -524,6 +533,10 @@ public class UnSettledHISPrescriptionService {
                                        condition = "&outpatientId="+relationCode;
                                    }
                                    newConfig.setFirst(config.getFirst().replace("key1",patientDO.getName()).replace("key2",name));
                                    if (StringUtils.isNoneBlank(config.getPagepath())){
                                        String path = "returnVisit/record?outpatientId="+relationCode;
                                        newConfig.setPagepath(config.getPagepath()+URLEncoder.encode(path));
                                    }
                                    newConfig.setUrl(config.getUrl()+""+condition);
                                    newConfig.setKeyword3(doctorDO.getName());
                                    newConfig.setKeyword1(name);

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

@ -11,6 +11,7 @@ import com.yihu.jw.internet.service.YkyyCommonService;
import com.yihu.jw.internet.service.ykyy.YkyyInternetService;
import com.yihu.jw.job.*;
import com.yihu.jw.job.yk.YKYYDataUploadJob;
import com.yihu.jw.job.ykyy.UnCheckPrescriptionJob;
import com.yihu.jw.job.ykyy.UnSettledHISPrescriptionJob;
import com.yihu.jw.job.ykyy.UpdateStatusByPayTimeJob;
import com.yihu.jw.job.ykyy.YkyyDataUploadJob;
@ -196,6 +197,17 @@ public class JobController extends BaseController {
                        logger.info("unsettled_prescription_notice_job  job exist");
                    }
                    break;
                case "uncheck_prescription_notice_job" :
                    //互联网医院 待结算消息推送
                    if (!quartzHelper.isExistJob("uncheck_prescription_notice_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("uncheck_prescription_notice_job");
                        quartzHelper.addJob(UnCheckPrescriptionJob.class, trigger, "uncheck_prescription_notice_job", new HashMap<String, Object>());
                        logger.info("uncheck_prescription_notice_job  job success");
                    } else {
                        logger.info("uncheck_prescription_notice_job  job exist");
                    }
                    break;
                case "pay_status_notice_job" :
                    //互联网医院 待结算消息推送

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

@ -24,3 +24,6 @@ data_common_upload_job=0 0 0 * * ?
#-------------------------眼科医院-----------------------------#
data_ykupload_job_2=0 0 0 * * ?
uncheck_prescription_notice_job=0 */1 * * * ?

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

@ -2513,11 +2513,13 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "icdCode", value = "icdCode")
                                          @RequestParam(value = "icdCode",required = false)String icdCode,
                                      @ApiParam(name = "preNo", value = "preNo")
                                          @RequestParam(value = "preNo",required = false)String preNo){
                                          @RequestParam(value = "preNo",required = false)String preNo,
                                      @ApiParam(name = "idnoType", value = "idnoType")
                                          @RequestParam(value = "idnoType",required = false)String idnoType){
        try {
            return success(prescriptionService.saveNatAppointment(chargeAmount,inspectionName,mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,
                    cityName,townName,streetName,pm,pushFlag,cardNoType,getUID(),checkPart,chargeFlag,chargeCode,icdCode,preNo));
                    cityName,townName,streetName,pm,pushFlag,cardNoType,getUID(),checkPart,chargeFlag,chargeCode,icdCode,preNo,idnoType));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }

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

@ -3215,10 +3215,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "icdCode", value = "icdCode")
                                      @RequestParam(value = "icdCode", required = false) String icdCode,
                                      @ApiParam(name = "preNo", value = "preNo")
                                      @RequestParam(value = "preNo", required = false) String preNo) {
                                      @RequestParam(value = "preNo", required = false) String preNo,
                                      @ApiParam(name = "idnoType", value = "idnoType")
                                          @RequestParam(value = "idnoType", required = false) String idnoType) {
        try {
            return success(prescriptionService.saveNatAppointment(chargeAmount, inspectionName, mediaCard, patientId, name, cardNo, cardType, mobile, firstJobCode, firstJobName, secondJobCode, secondJobName, natTime, address, provinceName,
                    cityName, townName, streetName, pm, pushFlag, cardNoType, getUID(), checkPart, chargeFlag, chargeCode, icdCode, preNo));
                    cityName, townName, streetName, pm, pushFlag, cardNoType, getUID(), checkPart, chargeFlag, chargeCode, icdCode, preNo,idnoType));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }

+ 1 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationInfoService.java

@ -43,6 +43,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sun.awt.im.InputMethodJFrame;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.*;