Browse Source

Merge remote-tracking branch 'origin/dev' into dev

hxm 3 years ago
parent
commit
8ee91118e0
34 changed files with 882 additions and 37 deletions
  1. 28 2
      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. 2 2
      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. 1 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxTemplateConfigDO.java
  9. 11 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java
  10. 9 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/emergency/EmergencyOrderVO.java
  11. 7 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyHisPrescriptionVO.java
  12. 4 2
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/DoctorHealthController.java
  13. 8 4
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientHealthController.java
  14. 52 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/third/device/PDeviceController.java
  15. 30 3
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/third/platForm/PatientInfoPlatFormEndpoint.java
  16. 2 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/assistance/EmergencyAssistanceService.java
  17. 84 3
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientHealthIndexService.java
  18. 1 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java
  19. 2 2
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java
  20. 1 0
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/OnenetService.java
  21. 2 0
      svr/svr-cloud-transfor/src/main/java/com/yihu/SvrCloudTransforApplication.java
  22. 42 0
      svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/config/AsyncConfig.java
  23. 111 0
      svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/controller/BaseController.java
  24. 104 0
      svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/controller/OnenetController.java
  25. 26 0
      svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/service/OnenetService.java
  26. 138 0
      svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/util/HttpClientUtil.java
  27. 40 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/ykyy/UnCheckPrescriptionJob.java
  28. 77 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java
  29. 13 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java
  30. 12 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  31. 3 0
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  32. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  33. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  34. 1 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationInfoService.java

+ 28 - 2
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;
@ -5236,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("眼科微信消息模板推送 医生拒诊开始");
@ -5248,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)) {
@ -5273,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("眼科微信消息模板推送 就诊支付提醒开始");
@ -5305,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)) {
@ -5331,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)) {
@ -5350,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("眼科微信消息模板推送");
@ -5362,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("眼科微信消息模板推送 处方支付提醒开始");
@ -5383,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("眼科微信消息模板推送 视频问诊预约提醒开始");
@ -5394,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("极光消息推送 医生拒诊开始");
@ -5416,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("眼科微信消息模板推送 系统拒诊开始");
@ -5569,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);
@ -12062,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==""){
@ -12108,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){
@ -12155,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);
@ -12327,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);
@ -12456,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

+ 2 - 2
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);

+ 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) {

+ 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;
    }
}

+ 9 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/emergency/EmergencyOrderVO.java

@ -54,6 +54,7 @@ public class EmergencyOrderVO {
    private List<PatientSosContactsDO> sosContacts;//紧急联系人
    private List<Map<String,Object>> securityDevices;//安防设备列表
    private String overTimeNotResponse;
    private Integer orderType;//20紧急 22安防
    public String getId() {
        return id;
@ -294,4 +295,12 @@ public class EmergencyOrderVO {
    public void setOverTimeNotResponse(String overTimeNotResponse) {
        this.overTimeNotResponse = overTimeNotResponse;
    }
    public Integer getOrderType() {
        return orderType;
    }
    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }
}

+ 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;

+ 4 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/DoctorHealthController.java

@ -67,9 +67,11 @@ public class DoctorHealthController extends BaseController {
											   @ApiParam(name="begin",value="开始时间",defaultValue = "2017-05-22 00:00:00")
											   @RequestParam(value="begin",required = true) String begin,
											   @ApiParam(name="end",value="结束时间",defaultValue = "2017-06-02 00:00:00")
												   @RequestParam(value="end",required = true) String end) {
												   @RequestParam(value="end",required = true) String end,
											   @ApiParam(name = "deviceSn",required = false)
												   @RequestParam(value = "deviceSn",required = false) String deviceSn) {
		try {
			JSONArray jsonArray = healthIndexService.findChartByPatient(patient,type,gi_type,begin,end);
			JSONArray jsonArray = healthIndexService.findChartByPatient(patient,type,gi_type,begin,end,deviceSn);
			if (jsonArray.length()==0) {
				return success("查询成功!");
			}

+ 8 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientHealthController.java

@ -359,10 +359,12 @@ public class PatientHealthController extends BaseController {
                                               @ApiParam(name = "begin", value = "开始时间", defaultValue = "2017-05-22 00:00:00")
                                               @RequestParam(value = "begin", required = true) String begin,
                                               @ApiParam(name = "end", value = "结束时间", defaultValue = "2017-06-02 00:00:00")
                                               @RequestParam(value = "end", required = true) String end) {
                                               @RequestParam(value = "end", required = true) String end,
                                               @ApiParam(name = "deviceSn",required = false)
                                                   @RequestParam(value = "deviceSn",required = false) String deviceSn) {
        try {
            JSONArray jsonArray = healthIndexService.findChartByPatient(getUID(),type,gi_type,begin,end);
            JSONArray jsonArray = healthIndexService.findChartByPatient(getUID(),type,gi_type,begin,end,deviceSn);
            if (jsonArray.length()==0) {
                return success("查询成功!");
            }
@ -384,10 +386,12 @@ public class PatientHealthController extends BaseController {
                                               @ApiParam(name = "begin", value = "开始时间", defaultValue = "2017-05-22 00:00:00")
                                               @RequestParam(value = "begin", required = true) String begin,
                                               @ApiParam(name = "end", value = "结束时间", defaultValue = "2017-06-02 00:00:00")
                                               @RequestParam(value = "end", required = true) String end) {
                                               @RequestParam(value = "end", required = true) String end,
                                               @ApiParam(name = "deviceSn",required = false)
                                               @RequestParam(value = "deviceSn",required = false) String deviceSn) {
        try {
            JSONArray jsonArray = healthIndexService.findChartByPatient(getRepUID(), type, gi_type, begin, end);
            JSONArray jsonArray = healthIndexService.findChartByPatient(getRepUID(), type, gi_type, begin, end,deviceSn);
//            List<DevicePatientHealthIndex> list = healthIndexService.findChartByPatient(getUID(), type, gi_type, begin, end);
            if (jsonArray.length()==0) {

+ 52 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/third/device/PDeviceController.java

@ -1,5 +1,6 @@
package com.yihu.jw.care.endpoint.third.device;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.care.aop.ObserverRequired;
import com.yihu.jw.care.dao.device.PatientDeviceDao;
@ -7,6 +8,7 @@ import com.yihu.jw.care.endpoint.BaseController;
import com.yihu.jw.care.service.device.DeviceDetailService;
import com.yihu.jw.care.service.device.PatientDeviceService;
import com.yihu.jw.care.service.device.PatientHealthIndexService;
import com.yihu.jw.care.service.device.YsDeviceService;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
import com.yihu.jw.patient.dao.BasePatientDao;
@ -15,7 +17,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -25,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -43,6 +45,8 @@ public class PDeviceController extends BaseController {
    @Autowired
    private PatientDeviceService patientDeviceService;
    @Autowired
    private YsDeviceService ysDeviceService;
    @ApiOperation("获取居民的设备任务信息")
@ -135,4 +139,51 @@ public class PDeviceController extends BaseController {
            return error(-1,"安全区域设置失败");
        }
    }
    @ApiOperation("设备云台控制开始")//操作后都需要调用停止接口 才会停止转动
    @RequestMapping(value = "ptzStart", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String ptzStart(
            @ApiParam(name="deviceSerial",required = true,value="设备序列号")
            @RequestParam(value = "deviceSerial",required = true) String deviceSerial,
            @ApiParam(name="channelNo",required = true,value="通道号,IPC设备填1")
            @RequestParam(value = "channelNo",required = true) Integer channelNo,
            @ApiParam(name="direction",required = true,value="0-上,1-下,2-左,3-右,4-左上,5-左下,6-右上,7-右下,8-放大,9-缩小,10-近焦距,11-远焦距")
            @RequestParam(value = "direction",required = true) Integer direction,
            @ApiParam(name="speed",required = true,value="云台速度:0-慢,1-适中,2-快,海康设备参数不可为0")
            @RequestParam(value = "speed",required = true) Integer speed,
            HttpServletRequest request){
        try {
            com.alibaba.fastjson.JSONObject result = ysDeviceService.ptzStart(deviceSerial,channelNo,direction,speed,request);
            if ("200".equals(result.getString("code"))){
                return write(200,"查询成功","data",result);
            }else {
                return write(-1,result.getString("msg"));
            }
        }catch (Exception e){
            return errorResult(e);
        }
    }
    @ApiOperation("设备云台控制结束")
    @RequestMapping(value = "ptzStop", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String ptzStop(
            @ApiParam(name="deviceSerial",required = true,value="设备序列号")
            @RequestParam(value = "deviceSerial",required = true) String deviceSerial,
            @ApiParam(name="channelNo",required = true,value="通道号,IPC设备填1")
            @RequestParam(value = "channelNo",required = true) Integer channelNo,
            @ApiParam(name="direction",required = true,value="0-上,1-下,2-左,3-右,4-左上,5-左下,6-右上,7-右下,8-放大,9-缩小,10-近焦距,11-远焦距")
            @RequestParam(value = "direction",required = true) Integer direction,
            HttpServletRequest request){
        try {
            JSONObject result = ysDeviceService.ptzStop(deviceSerial,channelNo,direction,request);
            if ("200".equals(result.getString("code"))){
                return write(200,"查询成功","data",result);
            }else {
                return write(-1,result.getString("msg"));
            }
        }catch (Exception e){
            return errorResult(e);
        }
    }
}

+ 30 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/third/platForm/PatientInfoPlatFormEndpoint.java

@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.care.endpoint.BaseController;
import com.yihu.jw.care.service.assistance.EmergencyAssistanceService;
import com.yihu.jw.care.service.common.DictService;
import com.yihu.jw.care.service.device.PatientHealthIndexService;
import com.yihu.jw.care.service.doorCoach.DoctorDoorCoachOrderService;
import com.yihu.jw.care.service.doorCoach.PatientDoorCoachOrderService;
import com.yihu.jw.care.service.lifeCare.LifeCareOrderService;
@ -58,6 +59,8 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
    private BaseServiceNewsService baseServiceNewsService;
    @Autowired
    private DictService dictService;
    @Autowired
    private PatientHealthIndexService healthIndexService;
    private BaseController baseController = new BaseController();
@ -162,10 +165,32 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "getHealthIndexInfoWithAvg")
    @ApiOperation("获取居民体征信息--带体征平均值")
    public String getHealthIndexInfoWithAvg(@ApiParam(name="patient",value="患者代码",defaultValue = "eb0b478fbe9245428ecf63cd7517206f")
                                     @RequestParam(value="patient",required = false) String patient,
                                     @ApiParam(name="type",value="指标类型",defaultValue = "1")
                                     @RequestParam(value="type",required = true) Integer type,
                                     @ApiParam(name="gi_type",value="就餐类型",defaultValue = "0")
                                     @RequestParam(value = "gi_type",required = false) Integer gi_type,
                                     @ApiParam(name="begin",value="开始时间",defaultValue = "2017-05-22 00:00:00")
                                     @RequestParam(value="begin",required = true) String begin,
                                     @ApiParam(name="end",value="结束时间",defaultValue = "2017-06-02 00:00:00")
                                     @RequestParam(value="end",required = true) String end,
                                     @ApiParam(name = "deviceSn",required = false)
                                     @RequestParam(value = "deviceSn",required = false) String deviceSn){
        try {
            return baseController.write(200,"查询成功","data",healthIndexService.findChartByPatientWithAvg(patient,type,gi_type,begin,end,deviceSn));
        }catch (Exception e){
            return baseController.errorResult(e);
        }
    }
    @GetMapping(value = "getHealthIndexInfo")
    @ApiOperation("获取居民体征信息")
    public String getHealthIndexInfo(@ApiParam(name="patient",value="患者代码",defaultValue = "eb0b478fbe9245428ecf63cd7517206f")
                                     @RequestParam(value="patient",required = true) String patient,
                                     @RequestParam(value="patient",required = false) String patient,
                                     @ApiParam(name="type",value="指标类型",defaultValue = "1")
                                     @RequestParam(value="type",required = true) Integer type,
                                     @ApiParam(name="gi_type",value="就餐类型",defaultValue = "0")
@ -173,9 +198,11 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
                                     @ApiParam(name="begin",value="开始时间",defaultValue = "2017-05-22 00:00:00")
                                     @RequestParam(value="begin",required = true) String begin,
                                     @ApiParam(name="end",value="结束时间",defaultValue = "2017-06-02 00:00:00")
                                     @RequestParam(value="end",required = true) String end){
                                     @RequestParam(value="end",required = true) String end,
                                     @ApiParam(name = "deviceSn",required = false)
                                     @RequestParam(value = "deviceSn",required = false) String deviceSn){
        try {
            return baseController.write (200,"查询成功","data",patientInfoPlatFormService.getHealthIndexInfo(patient,type,gi_type,begin,end));
            return baseController.write (200,"查询成功","data",patientInfoPlatFormService.getHealthIndexInfo(patient,type,gi_type,begin,end,deviceSn));
        }catch (Exception e){
            return baseController.errorResult(e);
        }

+ 2 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/assistance/EmergencyAssistanceService.java

@ -126,7 +126,7 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    @Autowired
    private BaseOrgDao orgDao;
    @Autowired
    private DeviceDetailDao deviceDetailDao;
    /**
@ -374,6 +374,7 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
        emergencyOrderVO.setPatientName(assistanceDO.getPatientName());
        emergencyOrderVO.setSex(patientDO.getSex());
        emergencyOrderVO.setPhone(assistanceDO.getPatientPhone());
        emergencyOrderVO.setOrderType(20);
        List<BaseEmergencyWarnLogDO> logDOS = logDao.findByOrderIdOrderByCreateTimeDesc(assistanceDO.getId());
        for (BaseEmergencyWarnLogDO tmp:logDOS){

+ 84 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientHealthIndexService.java

@ -798,7 +798,7 @@ public class PatientHealthIndexService extends BaseJpaService<DevicePatientHealt
     * @param end     结束时间
     * @return
     */
    public JSONArray findChartByPatient(String patient, int type, int gi_type, String begin, String end) {
    public JSONArray findChartByPatient(String patient, int type, int gi_type, String begin, String end,String deviceSn) {
        JSONArray re = new JSONArray();
        String sql = "SELECT " +
                "MIN(id) id" +
@ -816,11 +816,17 @@ public class PatientHealthIndexService extends BaseJpaService<DevicePatientHealt
                ",sort_date" +
                ",min(czrq) czrq " +
                " from wlyy_patient_health_index " +
                " WHERE `user` = '" + patient + "' " +
                " WHERE 1=1 "+
                " and type =" + type +
                " and record_date >= '" + begin + "'" +
                " and record_date <= '" + end + "' " +
                " and del = '1' ";
        if (StringUtils.isNotBlank(patient)){
            sql+=" and user = '" + patient + "' ";
        }
        if (StringUtils.isNotBlank(deviceSn)){
            sql += " and device_sn='"+deviceSn+"' ";
        }
        String conditionApp = "";
        if (gi_type != 0) {
            conditionApp = " and value2 = '" + gi_type + "' ";
@ -857,7 +863,82 @@ public class PatientHealthIndexService extends BaseJpaService<DevicePatientHealt
        }
        return re;
    }
    
    public JSONObject findChartByPatientWithAvg(String patient, int type, int gi_type, String begin, String end,String deviceSn) {
        JSONObject result = new JSONObject();
        JSONArray re = new JSONArray();
        String sql = "SELECT " +
                "MIN(id) id" +
                ", user" +
                ",value1" +
                ",value2" +
                ",value3" +
                ",value4" +
                ",value5" +
                ",value6" +
                ",value7" +
                ",device_sn" +
                ",type" +
                ",record_date" +
                ",sort_date" +
                ",min(czrq) czrq " +
                " from wlyy_patient_health_index " +
                " WHERE 1=1 "+
                " and type =" + type +
                " and record_date >= '" + begin + "'" +
                " and record_date <= '" + end + "' " +
                " and del = '1' ";
        if (StringUtils.isNotBlank(patient)){
            sql+=" and user = '" + patient + "' ";
        }
        if (StringUtils.isNotBlank(deviceSn)){
            sql += " and device_sn='"+deviceSn+"' ";
        }
        String conditionApp = "";
        if (gi_type != 0) {
            conditionApp = " and value2 = '" + gi_type + "' ";
        }
        sql = sql + conditionApp +
                " GROUP BY user,value1,value2,value3,value4,value5,value6,value7,type,record_date,sort_date " +
                " order by record_date desc ,sort_date desc limit " + 0 + " ," + 1000 + " ";
//        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        List<Map<String, Object>> list = findByPatientAndTime(sql,patient,type,1000,gi_type,begin,end);
        for (Map<String, Object> map : list) {
            JSONObject json = new JSONObject();
            json.put("id", map.get("id"));
            json.put("patient", map.get("user"));
            json.put("value1", map.get("value1"));
            json.put("value2", map.get("value2"));
            json.put("value3", map.get("value3"));
            json.put("value4", map.get("value4"));
            json.put("value5", map.get("value5"));
            json.put("value6", map.get("value6"));
            json.put("value7", map.get("value7"));
            json.put("deviceSn", map.get("device_sn") == null ? "" : map.get("device_sn"));
            json.put("type", map.get("type"));
            Date date = (Date) map.get("record_date");
            if (type == 2) {
                json.put("date", DateUtil.dateToStr(date, DateUtil.YYYY_MM_DD_HH_MM_SS));
            } else {
                json.put("date", DateUtil.dateToStr(date, DateUtil.YYYY_MM_DD));
            }
            json.put("sortDate", map.get("sort_date"));
            json.put("czrq", map.get("czrq"));
            re.put(json);
        }
        result.put("list",re);
        OptionalDouble avg =  list.stream().mapToDouble(t -> t.get("value1") == null ? 0.0 :Double.parseDouble(t.get("value1").toString())).average();
        result.put("avg",0.0);
        try {
            result.put("avg",avg.getAsDouble());
        }catch (Exception e){}
        return result;
    }
    /**
     * 按时间段查询患者健康指标
     *

+ 1 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -357,6 +357,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        emergencyOrderVO.setPatientName(orderDO.getPatientName());
        emergencyOrderVO.setSex(patientDO.getSex());
        emergencyOrderVO.setTopicItem(orderDO.getTopicItem());
        emergencyOrderVO.setOrderType(22);
        if (StringUtils.isNotBlank(orderDO.getSceneImg())){
            emergencyOrderVO.setSceneImg(orderDO.getSceneImg());
        }

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -215,8 +215,8 @@ public class PatientInfoPlatFormService {
     * @param patient
     * @return
     */
    public JSONArray getHealthIndexInfo(String patient, int type, int gi_type, String begin, String end){
       return healthIndexService.findChartByPatient(patient,type,gi_type,begin,end);//图表
    public JSONArray getHealthIndexInfo(String patient, int type, int gi_type, String begin, String end,String deviceSn){
       return healthIndexService.findChartByPatient(patient,type,gi_type,begin,end,deviceSn);//图表
    }
    /**

+ 1 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/OnenetService.java

@ -154,6 +154,7 @@ public class OnenetService {
                    String psk = jsonObject.getJSONObject("data").getString("psk");
                    device.setDeviceId(deviceId);
                    device.setPsk(psk);
                    device.setCreateTime(new Date());
                    onenetDevices.add(device);
                }
            }catch (Exception e){

+ 2 - 0
svr/svr-cloud-transfor/src/main/java/com/yihu/SvrCloudTransforApplication.java

@ -5,12 +5,14 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
/**
 * Created by yeshijie on 2021/10/14.
 */
@SpringBootApplication
@ComponentScan("com.yihu")
@EnableAsync
public class SvrCloudTransforApplication extends SpringBootServletInitializer {
    public static void main(String[] args)  {

+ 42 - 0
svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/config/AsyncConfig.java

@ -0,0 +1,42 @@
package com.yihu.jw.care.config;
import org.apache.tomcat.util.threads.ThreadPoolExecutor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/4/30
 * @Description: 异步线程配置
 */
@Configuration
public class AsyncConfig {
    @Bean
    public Executor taskExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        // 设置核心线程数
        executor.setCorePoolSize(5);
        // 设置最大线程数
        executor.setMaxPoolSize(20);
        // 设置队列容量
        executor.setQueueCapacity(200);
        // 设置线程活跃时间(秒)
        executor.setKeepAliveSeconds(60);
        // 设置默认线程名称
        executor.setThreadNamePrefix("user-transfor-");
        // 设置拒绝策略
        // rejection-policy:当pool已经达到max size的时候,如何处理新任务
        // CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行
        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
//        // 等待所有任务结束后再关闭线程池
//        executor.setWaitForTasksToCompleteOnShutdown(true);
        executor.initialize();
        return executor;
    }
}

+ 111 - 0
svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/controller/BaseController.java

@ -0,0 +1,111 @@
package com.yihu.jw.care.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 *
 */
public class BaseController {
    private static Logger logger = LoggerFactory.getLogger("error_logger");
    /**
     * 获取request中body数据
     */
    public String getRequestBodyData(HttpServletRequest request) throws IOException {
        BufferedReader bufferReader = new BufferedReader(request.getReader());
        StringBuilder sb = new StringBuilder();
        String line = null;
        while ((line = bufferReader.readLine()) != null) {
            sb.append(line);
        }
        return sb.toString();
    }
    /**
     * 返回接口处理结果
     *
     * @param code  结果码,成功为200
     * @param msg   结果提示信息
     * @return
     */
    public String error(int code, String msg) {
        try {
            Map<Object, Object> map = new HashMap<Object, Object>();
            ObjectMapper mapper = new ObjectMapper();
            map.put("code", code);
            map.put("msg", msg);
            map.put("success", false);
            return mapper.writeValueAsString(map);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    /**
     * 接口处理成功
     * @return
     */
    public String success() {
        try {
            Map<Object, Object> map = new HashMap<Object, Object>();
            ObjectMapper mapper = new ObjectMapper();
            map.put("code", 200);
            map.put("success", true);
            return mapper.writeValueAsString(map);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    public String write(int code, String msg) {
        try {
            Map<Object, Object> map = new HashMap<Object, Object>();
            ObjectMapper mapper = new ObjectMapper();
            map.put("code", code);
            map.put("msg", msg);
            map.put("success", true);
            return mapper.writeValueAsString(map);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    /**
     * 返回接口处理结果
     *
     * @param code  结果码,成功为200
     * @param msg   结果提示信息
     * @param value 结果数据
     * @return
     */
    public String write(int code, String msg, String key, Object value) {
        try {
            Map<Object, Object> map = new HashMap<Object, Object>();
            ObjectMapper mapper = new ObjectMapper();
            map.put("code", code);
            map.put("msg", msg);
            map.put(key, value);
            return mapper.writeValueAsString(map);
        } catch (Exception e) {
            error(e);
            return error(-1, "服务器异常,请稍候再试!");
        }
    }
    public void error(Exception e) {
        e.printStackTrace();
    }
}

+ 104 - 0
svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/controller/OnenetController.java

@ -0,0 +1,104 @@
package com.yihu.jw.care.controller;
import com.yihu.jw.care.service.OnenetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * Created with IntelliJ IDEA.
 * onenet平台验证无法请求杭州服务器 只能转发
 * @Author: yeshijie
 * @Date: 2021/10/20
 * @Description:
 */
@RestController
@RequestMapping("/siterwelldevice")
@Api(value = "onenet设备相关服务", description = "onenet设备相关服务")
public class OnenetController extends BaseController{
    private static Logger logger = LoggerFactory.getLogger(OnenetController.class);
    @Autowired
    private OnenetService onenetService;
    /**
     * 功能描述:第三方平台数据接收。<p>
     *           <ul>注:
     *               <li>1.OneNet平台为了保证数据不丢失,有重发机制,如果重复数据对业务有影响,数据接收端需要对重复数据进行排除重复处理。</li>
     *               <li>2.OneNet每一次post数据请求后,等待客户端的响应都设有时限,在规定时限内没有收到响应会认为发送失败。
     *                    接收程序接收到数据时,尽量先缓存起来,再做业务逻辑处理。</li>
     *           </ul>
     * @param body 数据消息
     * @return 任意字符串。OneNet平台接收到http 200的响应,才会认为数据推送成功,否则会重发。
     */
    @RequestMapping(value = "receive",method = RequestMethod.POST)
    public String receive(@RequestBody String body) throws Exception {
        logger.info("data receive:  body String --- " +body);
        /************************************************
         *  解析数据推送请求,非加密模式。
         *  如果是明文模式使用以下代码
         **************************************************/
        /*************明文模式  start****************/
        onenetService.receive(body);
        /*************明文模式  end****************/
        /********************************************************
         *  解析数据推送请求,加密模式
         *
         *  如果是加密模式使用以下代码
         ********************************************************/
        /*************加密模式  start****************/
//        Util.BodyObj obj1 = Util.resolveBody(body, true);
//        logger.info("data receive:  body Object--- " +obj1);
//        if (obj1 != null){
//            boolean dataRight1 = Util.checkSignature(obj1, token);
//            if (dataRight1){
//                String msg = Util.decryptMsg(obj1, aeskey);
//                logger.info("data receive: content" + msg);
//            }else {
//                logger.info("data receive:  signature error " );
//            }
//        }else {
//            logger.info("data receive: body empty error" );
//        }
        /*************加密模式  end****************/
        return "ok";
    }
    /**
     * 功能说明: URL&Token验证接口。如果验证成功返回msg的值,否则返回其他值。
     * @param msg 验证消息
     * @param nonce 随机串
     * @param signature 签名
     * @return msg值
     */
    @RequestMapping(value = "receive", method = RequestMethod.GET)
    public String check(@RequestParam(value = "msg") String msg,
                        @RequestParam(value = "nonce") String nonce,
                        @RequestParam(value = "signature") String signature) throws Exception {
        logger.info("url&token check: msg:{} nonce{} signature:{}",msg,nonce,signature);
        return msg;
    }
    @ApiOperation("触发器消息通知接收--废弃")
    @RequestMapping(value = "triggerMessage",method = {RequestMethod.POST,RequestMethod.GET})
    public String triggerMessage(@RequestBody String body) {
        try {
            logger.info("======================:"+body);
            return success();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"Device data incoming failure");
        }
    }
}

+ 26 - 0
svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/service/OnenetService.java

@ -0,0 +1,26 @@
package com.yihu.jw.care.service;
import com.yihu.jw.care.util.HttpClientUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
/**
 * Created by yeshijie on 2021/10/20.
 */
@Service
public class OnenetService {
    private Logger logger = LoggerFactory.getLogger(AqgService.class);
    private static final String baseUrl = "https://zhyzh.gongshu.gov.cn/device/";
//    private static final String baseUrl = "http://ehr.yihu.com/wlyy/aqg";
    @Async
    public void receive(String body){
        String url = baseUrl + "siterwelldevice/receive";
        String result = HttpClientUtil.postBodyStr(url,body);
        logger.info(url+","+result);
    }
}

+ 138 - 0
svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/util/HttpClientUtil.java

@ -0,0 +1,138 @@
package com.yihu.jw.care.util;
import com.alibaba.fastjson.JSONObject;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
public class HttpClientUtil {
	/**
	 * 发送post请求
	 * @param url 请求地址
	 * @param params 请求参数
	 * @param chatSet 编码格式
	 * @return
	 */
	public static String post(String url, List<NameValuePair> params, String chatSet) {
		// 创建默认的httpClient实例.
		CloseableHttpClient httpclient = HttpClients.createDefault();
		// 创建httppost
		HttpPost httppost = new HttpPost(url);
		UrlEncodedFormEntity uefEntity;
		try {
			uefEntity = new UrlEncodedFormEntity(params, chatSet);
			httppost.setEntity(uefEntity);
			CloseableHttpResponse response = httpclient.execute(httppost);
			try {
				HttpEntity entity = response.getEntity();
				if (entity != null) {
					return EntityUtils.toString(entity, chatSet);
				}
			} finally {
				response.close();
			}
		} catch (ClientProtocolException e) {
			e.printStackTrace();
		} catch (UnsupportedEncodingException e1) {
			e1.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			// 关闭连接,释放资源
			try {
				httpclient.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return null;
	}
	/**
	 * 发送get请求
	 * @param url 请求地址
	 * @param chatSet 编码格式
	 * @return
	 */
	public static String get(String url, String chatSet) {
		CloseableHttpClient httpclient = HttpClients.createDefault();
		try {
			// 创建httpget.
			HttpGet httpget = new HttpGet(url);
			// 执行get请求.
			CloseableHttpResponse response = httpclient.execute(httpget);
			try {
				// 获取响应实体
				HttpEntity entity = response.getEntity();
				if (entity != null) {
					return EntityUtils.toString(entity, chatSet);
				}
			} finally {
				response.close();
			}
		} catch (ClientProtocolException e) {
			e.printStackTrace();
		} catch (ParseException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			// 关闭连接,释放资源
			try {
				httpclient.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return null;
	}
	public static String postBodyStr(String url, String params){
		RestTemplate restTemplate = new RestTemplate();
		HttpHeaders headers = new HttpHeaders();
		MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
		headers.setContentType(type);
		headers.add("Accept", MediaType.APPLICATION_JSON.toString());
		org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<String>(params, headers);
		String ret = restTemplate.postForObject(url, formEntity, String.class);
		return ret;
	}
	public static String postBody(String url, JSONObject params){
		RestTemplate restTemplate = new RestTemplate();
		HttpHeaders headers = new HttpHeaders();
		MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
		headers.setContentType(type);
		headers.add("Accept", MediaType.APPLICATION_JSON.toString());
		org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<String>(params.toString(), headers);
		String ret = restTemplate.postForObject(url, formEntity, String.class);
		return ret;
	}
	public static void putBody(String url,JSONObject params){
		RestTemplate restTemplate = new RestTemplate();
		HttpHeaders headers = new HttpHeaders();
		MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
		headers.setContentType(type);
		headers.add("Accept", MediaType.APPLICATION_JSON.toString());
		org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<String>(params.toString(), headers);
		restTemplate.put(url, formEntity, String.class);
	}
}

+ 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.*;