| | |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.common.MtSubmitSmUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.mapper.*; |
| | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | | @Autowired |
| | | private MtSubmitSmUtil mtSubmitSmUtil; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | |
| | | iServiceOutPathService.updateServiceOutPath(serviceOutPath); |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(ip + ":" + req_path + "/sf?p=" + format); |
| | | if (active.equals("ls") || active.equals("sltd")) { |
| | | if (active.equals("ls") || active.equals("sltd") || active.equals("nhfy")) { |
| | | sendMagParam.setContent("æ¨å¥½ï¼é请æ¨å¡«ååºé¢éè®¿è°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é
åï¼"); |
| | | } else if (active.equals("xh")) { |
| | | sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢éè®¿è°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "å¡«åãæè°¢æ¨é
åï¼"); |
| | |
| | | //妿typeæ¯è¯é³é访çè¯ï¼è¯´æè¡¥å¿åéæ¹å¼ä¸æçµè¯éè®¿çæ¹å¼ï¼è¿éçå¤é¾å°±å°ååªè½ç¨/sfï¼ |
| | | if (serviceSubtask.getType().equals("1")) |
| | | sendMagParam.setUrl(ip + ":" + req_path + "/sf?p=" + format); |
| | | if (active.equals("ls") || active.equals("sltd")) { |
| | | if (active.equals("ls") || active.equals("sltd") || active.equals("nhfy")) { |
| | | sendMagParam.setContent("æ¨å¥½ï¼é请æ¨å¡«ååºé¢è°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é
åï¼"); |
| | | } else if (active.equals("xh")) { |
| | | sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢è°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "å¡«åãæè°¢æ¨é
åï¼"); |
| | |
| | | if (heLibrary.getHetype().equals("1")) { |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(ip + ":" + req_path + "/xj?p=" + format); |
| | | if (active.equals("ls") || active.equals("sltd")) { |
| | | if (active.equals("ls") || active.equals("sltd") || active.equals("nhfy")) { |
| | | sendMagParam.setContent("æ¨å¥½ï¼é请æ¨å¡«ååºé¢å®£æè°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é
åï¼"); |
| | | } else if (active.equals("xh")) { |
| | | sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢å®£æè°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é
åï¼"); |
| | |
| | | setFailPreachForm(serviceSubtask, sendPreachform, "çä¿¡åé失败", "5"); |
| | | throw new BaseException("çä¿¡åé失败"); |
| | | } |
| | | } else if (active.equals("sltd")) { |
| | | } else if (active.equals("sltd") || active.equals("nhfy")) { |
| | | //çç«åå¾·ççä¿¡åéæ¹å¼ |
| | | String data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | if (StringUtils.isNotEmpty(data)) { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | JsonNode root = mapper.readTree(data); |
| | | String status = root.get("result").get(0).get("status").asText(); |
| | | if (status.equals("00000")) { |
| | | s = "true"; |
| | | String data = null; |
| | | Map<String, Object> smsResult = null; |
| | | if (active.equals("sltd")) { |
| | | data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | if (StringUtils.isNotEmpty(data)) { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | JsonNode root = mapper.readTree(data); |
| | | String status = root.get("result").get(0).get("status").asText(); |
| | | if (status.equals("00000")) { |
| | | s = "true"; |
| | | } else { |
| | | setFailPreachForm(serviceSubtask, sendPreachform, "çä¿¡åé失败: " + data, "5"); |
| | | throw new BaseException("çä¿¡åé失败"); |
| | | } |
| | | |
| | | } else { |
| | | setFailPreachForm(serviceSubtask, sendPreachform, "çä¿¡åé失败: " + data, "5"); |
| | | throw new BaseException("çä¿¡åé失败"); |
| | | } |
| | | } else { |
| | | setFailPreachForm(serviceSubtask, sendPreachform, "çä¿¡åé失败: " + data, "5"); |
| | | throw new BaseException("çä¿¡åé失败"); |
| | | } else if (active.equals("nhfy")) { |
| | | smsResult = mtSubmitSmUtil.submitSm(sendMagParam.getPhone(), sendMagParam.getContent()); |
| | | if (smsResult != null && smsResult.get("result") != null && smsResult.get("result").toString().equals("0")) { |
| | | s = "true"; |
| | | } else { |
| | | setFailPreachForm(serviceSubtask, sendPreachform, "çä¿¡åé失败", "5"); |
| | | throw new BaseException("çä¿¡åé失败"); |
| | | } |
| | | } |
| | | |
| | | } else if (active.equals("hzszlyy")) { |
| | | //å¸ä¸ |
| | | long timestamp = new Date().getTime(); |
| | |
| | | if (failSendstate.equals("4") || failSendstate.equals("5")) { |
| | | serviceSubtask.setCurrentPreachform(preachform); |
| | | serviceSubtask.setSendstate(5L); |
| | | serviceSubtask.setRemark("setFailPreachFormæ¹æ³ å½åçpreachformå·²ç»æ¯æåä¸ä¸ªäºï¼å
¨é¨æ§è¡å¤±è´¥"); |
| | | serviceSubtask.setRemark("å¤çè¡¥å¿ä»»å¡,å½åå¤çæåè¡¥å¿ï¼å
¨é¨æ§è¡å¤±è´¥"); |
| | | //人工åéè¶
æ¶ |
| | | if(ObjectUtils.isNotEmpty(preachform) && preachform.equals("1") && failSendstate.equals("7")){ |
| | | if (ObjectUtils.isNotEmpty(preachform) && preachform.equals("1") && failSendstate.equals("7")) { |
| | | serviceSubtask.setSendstate(7L); |
| | | serviceSubtask.setRemark("人工åéè¶
æ¶"); |
| | | } |
| | |
| | | serviceSubtask.setVisitTime(getNextVisitTime(serviceSubtask.getId(), serviceSubtask.getTaskid(), serviceSubtask.getVisitTime(), serviceSubtask.getCurrentPreachform())); |
| | | serviceSubtask.setSendstate(3L); |
| | | //人工åéè¶
æ¶ |
| | | if(ObjectUtils.isNotEmpty(preachform) && preachform.equals("1") && failSendstate.equals("7")){ |
| | | if (ObjectUtils.isNotEmpty(preachform) && preachform.equals("1") && failSendstate.equals("7")) { |
| | | serviceSubtask.setSendstate(7L); |
| | | serviceSubtask.setRemark("人工åéè¶
æ¶"); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.smartor.common.MtSubmitSmUtil; |
| | | import com.smartor.domain.MtSubmitSmResp; |
| | | import com.smartor.domain.ServiceSLTDDeptReqVO; |
| | | import com.smartor.domain.ServiceSLTDInhospReqVO; |
| | | import com.smartor.domain.ServiceSLTDInhospResDTO; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * çç«åå¾·å¥åº·è®°å½æ¥è¯¢Controller |
| | |
| | | @Autowired |
| | | private IServiceSLTDHealthcareRecordService serviceSLTDHealthcareRecordService; |
| | | |
| | | @Autowired |
| | | private MtSubmitSmUtil mtSubmitSmUtil; |
| | | |
| | | /** |
| | | * æ¥è¯¢å¨é¢æ£è
å¥åº·è®°å½å表 |
| | | */ |
| | |
| | | // ç´æ¥ä»å·²æèåç»ææ¨ç®totalï¼é¿å
廿å页ååå
¨éæ¥ä¸é大表 |
| | | long total = 0L; |
| | | try { |
| | | // * wzx: æªæ§è¡æ°é |
| | | // * ysf: å·²é访æ°é |
| | | // * fssb: åé失败æ°é |
| | | // * yfs: å·²åéæ°é |
| | | // * dsf: å¾
é访æ°é |
| | | |
| | | // long wzx = map.get("wzx") != null ? ((Number) map.get("wzx")).longValue() : 0L; |
| | | // long ysf = map.get("ysf") != null ? ((Number) map.get("ysf")).longValue() : 0L; |
| | | // long dsf = map.get("dsf") != null ? ((Number) map.get("dsf")).longValue() : 0L; |
| | | // long fssb = map.get("fssb") != null ? ((Number) map.get("fssb")).longValue() : 0L; |
| | | total = map.get("total") != null ? ((Number) map.get("total")).longValue() : 0L; |
| | | |
| | | } catch (Exception e) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # æ°æ®æºé
ç½® |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | # driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | # ååéä¸ |
| | | url: jdbc:mysql://192.168.99.192:3306/smartor_nhfy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&connectTimeout=60000&socketTimeout=120000 |
| | | username: root |
| | | password: Smartor.2023 |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | |
| | | # # 髿¯æ°æ®åºé
ç½® |
| | | # url: jdbc:postgresql://127.0.0.1:5432/smartorlishui |
| | | # username: gaussdb |
| | | # password: Ls@123456 |
| | | # driverClassName: org.postgresql.Driver |
| | | |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é(å
¬å¸) |
| | | # enabled: true |
| | | # url: jdbc:sqlserver://116.62.18.175:6001;DatabaseName=iv-ywey;encrypt=false;SelectMethod=cursor |
| | | # username: sa |
| | | # password: Hxerp2000 |
| | | # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é(ä¹ä¹äºé¢) |
| | | # enabled: true |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=IntelligentVoice;encrypt=false;SelectMethod=cursor |
| | | # username: sa |
| | | # password: sfxt#2023 |
| | | # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | |
| | | # åå§è¿æ¥æ° |
| | | initialSize: 5 |
| | | # æå°è¿æ¥æ± æ°é |
| | | minIdle: 10 |
| | | # æå¤§è¿æ¥æ± æ°é |
| | | maxActive: 20 |
| | | # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ |
| | | maxWait: 60000 |
| | | # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼å使¯æ¯«ç§ |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | # validationQuery: SELECT 1 |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: false |
| | | # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-username: lihu |
| | | login-password: Lihu@1363419#$ |
| | | filter: |
| | | stat: |
| | | enabled: false |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: false |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | # redis é
ç½® |
| | | redis: |
| | | host: 127.0.0.1 |
| | | port: 6020 |
| | | |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
| | | # å¯ç |
| | | password: Smartor |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | | # æ¯å¦å¼å¯swagger |
| | | enabled: false |
| | | # 请æ±åç¼ |
| | | pathMapping: /dev-api |
| | | |
| | | # PageHelperå页æä»¶ |
| | | #pagehelper: |
| | | # helperDialect: mysql |
| | | # supportMethodsArguments: true |
| | | # params: count=countSql |
| | | |
| | | magic-api: |
| | | web: /magic/web |
| | | resource: |
| | | type: database # é
ç½®åå¨å¨æ°æ®åºä¸ |
| | | tableName: magic_config # æ°æ®åºä¸ç表å |
| | | prefix: /api |
| | | readonly: false |
| | | sql-column-case: camel |
| | | show-sql: true #é
ç½®æå°SQL |
| | | page-config: |
| | | size: size |
| | | page: page |
| | | default-page: 1 |
| | | default-size: 10 |
| | | |
| | | #ééçå¯é¥ |
| | | dingAppid: dingn8iip5ubj7clrrsv |
| | | dingAppSecret: qlEK8D3oOVwGPOTiBQIBYTqQVlAfy9S_qQizEQFjJdSScwemWFryg4gbneu-NqWD |
| | | |
| | | # websocketè¶
æ¶æ¶é´ |
| | | server: |
| | | websocket: |
| | | timeout=60000: |
| | | |
| | | |
| | | accessKeyId: LTAI5tPfc1VJzz7VuhzcBwug |
| | | accessKeySecret: gG1srKxPFDBNWe2oHfqmK1qsSQkf1e |
| | | signName: æå·å©æ¹ç§æ |
| | | |
| | | #æºè½å¼å«(䏿µ·) |
| | | phoneIP: http://124.220.50.51 |
| | | phonePort: 8001 |
| | | #æå· |
| | | hzphoneIP: http://121.43.112.160 |
| | | hzphonePort: 8088 |
| | | #çµè¯çº¿è·¯ï¼1 䏿µ·ï¼2 æå·ï¼ |
| | | phonePath: 2 |
| | | #èªå·±ççµè¯å·ç |
| | | phoneMySelf: 83234089 |
| | | ##ææ id(æå·) |
| | | #app_id: hzgs |
| | | ##ææ key(å·²å å¯è¿ç key)(æå·) |
| | | #app_key: 605453540c4a0a692fe07e1cae1162f3 |
| | | #ææ id(æå·) |
| | | app_id: hz_ali |
| | | #ææ key(å·²å å¯è¿ç key)(æå·) |
| | | app_key: a2f3b5799d635216aa280362fafd8c35 |
| | | |
| | | |
| | | pub_key: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALQzqW1EIXBKGMu+2oEYSB5gM7Ox/ihyYTeeoE0yPX1qtt4++5yNOeTBVd6EEM4iKzVEzWj6REIWVwaSNPn/SvUCAwEAAQ== |
| | | #è¿ä¸ªæ¯å端çç§é¥ï¼ç¨ä¸å° |
| | | pri_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg== |
| | | #å端ç§é¥ï¼ç¨ä¸å°äºï¼ |
| | | #pri_key: MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEApHTIe/StslZAT5Jzv8XClbrqox32pfaTrP5IOCRJ3FaH/UZsGgA/tsNBBEXq9eagqwPbJrjYfpdEtINcChrK4wIDAQABAkEAilDujdKshGGmlUZHs/NQRT6AOdDpsYxBiC4V76IVvQpw0IW6c4HGEvH4T+xRufika7/48L0eu0f06H+YtL5lgQIhANUd0a6oSsVxWifAjtKwMZcXD3OaIxQIQSCN4NT4VFY3AiEAxYxYrIhkIyg+UVw3WOSvBpXKxM4/WL9HRzkxDLvp2rUCIQCK23P8tgCJ5xJT5l3onw6goFDcBKkoazxsBqVgfjENPwIgWbuTd+OIYPPhwsE5ntZZrosSDO2GlsBkFzUiU59z7VUCIA0LL+9IFb+FWCl3DGTwIQ9SZYbv61T83LKjebUcSOfe |
| | | |
| | | #äºç»´ç è·¯å¾ |
| | | qrpath: D:\qrcode |
| | | |
| | | |
| | | #å¤é¾è¯·æ±IPå端å£å· |
| | | req_path: |
| | | localIP: https://xiniuhisintcus.nhfyyy.com/aifollowup |
| | | |
| | | |
| | | #è·åæ£è
ä¿¡æ¯URL(ååæä¾) |
| | | hosp_info_url: http://esb-core-rest.wowjoy.cn/esb/exchange |
| | | |
| | | # 0代表走é»è®¤çä¸ä¼ 1 代ç èµ°æ°åå»é¢çä¸ä¼ |
| | | uploadSwitch: 1 |
| | | |
| | | # æå®asråè°çurlè·¯å¾(æ°å) |
| | | ASRCallBackPath: http://192.168.101.135:8095/smartor/serviceSubtask/phoneCallBackYQ |
| | | #ææIP(æ°å) |
| | | hangup: http://192.16.4.220:8091/hangup |
| | | #fsæä½¿ç¨çé¿éçapp_key(æ°å) |
| | | app_key_yq: ZurNHpaQLq6P55YS |
| | | |
| | | #ç信请æ±å°å(è¿é为空ï¼åå¾·æä¾çæ¯ws) |
| | | xhsmsPath: |
| | | #å¸å· |
| | | xhsmsAccount: |
| | | #æ¥å£å¯ç |
| | | xhsmsPwd: |
| | | #èææ¥å
¥ç |
| | | xhsmsjrm: |
| | | |
| | | ##æ¬å°FTPè¿æ¥ |
| | | #FTP_SERVER: "192.168.2.13" |
| | | #FTP_USERNAME: voice |
| | | #FTP_PASSWORD: xh@2023 |
| | | |
| | | #æ°åFTPè¿æ¥ |
| | | FTP_SERVER: "192.16.4.220" |
| | | FTP_USERNAME: voice |
| | | FTP_PASSWORD: xh@2023 |
| | | |
| | | #è¯é³å°å访é®åç¼(æ°å) |
| | | voicePathPrefix: http://192.168.191.181:8095/profile/upload/vadio/ |
| | | #è¯é³å°å访é®åç¼(å
¬å¸) |
| | | #voicePathPrefix: http://192.168.2.13:8095/profile/upload/vadio/ |
| | | |
| | | #ç¬¬ä¸ªå°æ¶çµè¯æ¨æçä¸é |
| | | phoneUpEveryHour: 12 |
| | | #çµè¯æ¯å¤©ç»ææ¶é´ |
| | | phoneEndHour: 20 |
| | | |
| | | #æ°åå·¥é»è®¤å¯ç |
| | | defaultPwd: 123456 |
| | | |
| | | #æ¯å¦éè¦æ ¹æ®ç¾ç
建ç«åºé¢æ£è
é访 |
| | | createIcd10Visit: false |
| | | |
| | | #admin管çåuserId |
| | | isAdmin: 1,2,3,4,5,6,7,8,9,10,11,12,13 |
| | | |
| | | #ç¨æ·é»è®¤å¯ç |
| | | userPwd: nhfy@0230 |
| | | |
| | | #å¤çæè¯å»ºè®®çé¨é¨ç¼ç |
| | | dealDeptCode: 40003024 |
| | | |
| | | |
| | | #æ¯å¦å å¯ 0ä¸å 1å å¯ |
| | | isEncryp: 0 |
| | | |
| | | #æä»¶ä¸ä¼ å°å |
| | | fileUpload: https://xiniuhisintcus.nhfyyy.com/aifollowup |
| | | profile: /prod-api/profile |
| | | |
| | | # æ¥æªæ¥app_key |
| | | lwl_app_key: ak-LMyQUE4rjW25UO7otb8XMXzv |
| | | |
| | | # ååéä¸åæ°æ®å
Œ
±æ¥å£ |
| | | sltd_pub_path: "http://open.nhyfy.cn/kapi/gw-api/" |
| | | |
| | | sms_accountName: S200232 |
| | | sms_password: lD94Yo |
| | | sms_url: http://open.nhyfy.cn/kapi/gw-api/hntypt/ucpmsg/send |
| | | sms_sourceAddr: 1069100020341 |
| | | sms_serviceCode: PUSH |
| | | sms_appkey: ak-BFq4NN0TMf92J7KAioNYGz74 |
| | | sms_flag: ãåå大å¦éå±ç¬¬ä¸å»é¢ã |
| | | |
| | | |
| | | |
| | |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | profiles: |
| | | active: druid |
| | | active: nhfy |
| | | |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | |
| | | package com.ruoyi.framework.web.service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.common.utils.HttpUtil; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.smartor.service.impl.ServiceSLTDHealthcareRecordServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.authentication.BadCredentialsException; |
| | | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.stereotype.Component; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | |
| | | import com.ruoyi.common.exception.user.CaptchaException; |
| | | import com.ruoyi.common.exception.user.CaptchaExpireException; |
| | | import com.ruoyi.common.exception.user.UserPasswordNotMatchException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.MessageUtils; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.common.utils.ip.IpUtils; |
| | | import com.ruoyi.framework.manager.AsyncManager; |
| | | import com.ruoyi.framework.manager.factory.AsyncFactory; |
| | | import com.ruoyi.framework.security.context.AuthenticationContextHolder; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.authentication.BadCredentialsException; |
| | | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | | @Value("${lwl_app_key}") |
| | | private String APP_KEY; |
| | | |
| | | /** |
| | | * ç»å½éªè¯ |
| | |
| | | */ |
| | | private String resolveUserNameBySltdToken(String token) { |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("app-key", ServiceSLTDHealthcareRecordServiceImpl.APP_KEY); |
| | | headers.put("app-key", APP_KEY); |
| | | Map<String, String> requestParams = new HashMap<>(); |
| | | requestParams.put("token", token); |
| | | String reqData = HttpUtil.postFormRequest(sltdPubPath + "/checkSsoTokenId", requestParams, headers, null); |
| | |
| | | import com.ruoyi.common.enums.MsgLSEnum; |
| | | import com.ruoyi.common.enums.ServiceFromEnum; |
| | | import com.ruoyi.common.enums.WxGZHEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.common.utils.sms.smsUtils; |
| | |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.common.MtSubmitSmUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.mapper.*; |
| | |
| | | @Value("${server.port}") |
| | | private String port; |
| | | |
| | | @Autowired |
| | | private MtSubmitSmUtil mtSubmitSmUtil; |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | |
| | | } catch (Exception e) { |
| | | log.error("ãdealHisDataãæ²³åæ°æ®ééå¼å¸¸", e); |
| | | } |
| | | } else if (active.trim().equals("sltd")) { |
| | | } else if (active.trim().equals("sltd") || active.trim().equals("nhfy")) { |
| | | //çç«åå¾·ä¸ååéä¸ç¨åä¸å¥ééæ¹æ³ï¼é½æ¯æ¥æªæ¥æä¾ï¼ |
| | | |
| | | try { |
| | | //è·åæ¯å¦éè¦ééç¨æ·ãé¨é¨ä¿¡æ¯ |
| | | SysConfig config = new SysConfig(); |
| | |
| | | if (heLibrary.getHetype().equals("1")) { |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(localIP + ":" + req_path + "/xj?p=" + format); |
| | | if (active.equals("ls") || active.equals("sltd")) { |
| | | if (active.equals("ls") || active.equals("sltd") || active.equals("nhfy")) { |
| | | sendMagParam.setContent("æ¨å¥½ï¼é请æ¨å¡«ååºé¢å®£æè°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é
åï¼"); |
| | | } else if (active.equals("xh")) { |
| | | sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢å®£æè°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é
åï¼"); |
| | |
| | | if (code.equals("0")) { |
| | | isSuccess = "true"; |
| | | } |
| | | } else if (active.equals("sltd")) { |
| | | } else if (active.equals("sltd") || active.equals("nhfy")) { |
| | | log.info("sltdè¿æ¥äºåï¼{} ,---sendMagParam.getContent()çåæ°ä¸ºï¼{}", active, sendMagParam.getContent()); |
| | | //çç«åå¾·ççä¿¡åéæ¹å¼ |
| | | String data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | if (StringUtils.isNotEmpty(data)) { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | JsonNode root = mapper.readTree(data); |
| | | String status = root.get("result").get(0).get("status").asText(); |
| | | if (status.equals("00000")) { |
| | | if (active.equals("sltd")) { |
| | | //çç«åå¾·ççä¿¡åéæ¹å¼ |
| | | String data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); |
| | | if (StringUtils.isNotEmpty(data)) { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | JsonNode root = mapper.readTree(data); |
| | | String status = root.get("result").get(0).get("status").asText(); |
| | | if (status.equals("00000")) { |
| | | isSuccess = "true"; |
| | | } |
| | | } |
| | | } else if (active.equals("nhfy")) { |
| | | Map<String, Object> smsResult = mtSubmitSmUtil.submitSm(sendMagParam.getPhone(), sendMagParam.getContent()); |
| | | if (smsResult != null && smsResult.get("result") != null && smsResult.get("result").toString().equals("0")) { |
| | | isSuccess = "true"; |
| | | } |
| | | } |
| | |
| | | if (active.equals("hzszlyy")) { |
| | | if (!map.isEmpty() && map.get("success") != null) { |
| | | Integer wxCodeSuccessShiyi = (Integer) map.get("success"); |
| | | if(ObjectUtils.isNotEmpty(wxCodeSuccessShiyi) && wxCodeSuccessShiyi == 1){ |
| | | if (ObjectUtils.isNotEmpty(wxCodeSuccessShiyi) && wxCodeSuccessShiyi == 1) { |
| | | wxCodeSuccess = true; |
| | | }else { |
| | | } else { |
| | | wxCodeSuccess = false; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.common; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.smartor.domain.MtSubmitSmResp; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.MessageDigest; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * MTæ¶æ¯åéå·¥å
·ç±»ï¼SPåè¡ä¸æ±èå¹³å°æäº¤MTæ¶æ¯ï¼ |
| | | * æ¥å£å°åï¼http://ip:port/submitsm |
| | | * ç¼ç ï¼UTF-8ï¼é´æç®æ³ï¼MD5 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class MtSubmitSmUtil { |
| | | private static final RestTemplate restTemplate = new RestTemplate(); |
| | | |
| | | @Value("${sms_password}") |
| | | private String password; |
| | | |
| | | @Value("${sms_accountName}") |
| | | private String accountName; |
| | | |
| | | @Value("${sms_url}") |
| | | private String url; |
| | | |
| | | @Value("${sms_sourceAddr}") |
| | | private String sourceAddr; |
| | | |
| | | @Value("${sms_serviceCode}") |
| | | private String serviceCode; |
| | | |
| | | @Value("${sms_appkey}") |
| | | private String appKey; |
| | | |
| | | @Value("${sms_flag}") |
| | | private String smsFlag; |
| | | |
| | | |
| | | /** |
| | | * åéMTæ¶æ¯ |
| | | * |
| | | * @param destAddr ç®æ å·ç |
| | | * @param content çä¿¡å
容 |
| | | * @return MtSubmitSmResp ååºç»æ |
| | | */ |
| | | public Map<String, Object> submitSm(String destAddr, String content) { |
| | | try { |
| | | String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); |
| | | String hashHex = buildHashHex(accountName, password, date); |
| | | |
| | | Map<String, Object> authMap = new HashMap<>(); |
| | | authMap.put("Algorithm", "MD5"); |
| | | authMap.put("Date", date); |
| | | authMap.put("HASHHEX", hashHex); |
| | | |
| | | Map<String, Object> reqMap = new HashMap<>(); |
| | | reqMap.put("accountName", accountName); |
| | | reqMap.put("Authorization", authMap); |
| | | reqMap.put("DestAddr", destAddr); |
| | | reqMap.put("SourceAddr", sourceAddr); |
| | | reqMap.put("Content", smsFlag + content); |
| | | reqMap.put("ServiceCode", serviceCode); |
| | | |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(new MediaType("application", "json", StandardCharsets.UTF_8)); |
| | | headers.set("Accept-Language", "UTF-8"); |
| | | headers.set("app-key", "ak-BFq4NN0TMf92J7KAioNYGz74"); |
| | | |
| | | HttpEntity<String> entity = new HttpEntity<>(JSON.toJSONString(reqMap), headers); |
| | | log.info("MtSubmitSm 请æ±å°åï¼{}ï¼è¯·æ±åæ°ï¼{}", url + "/submitsm", JSON.toJSONString(reqMap)); |
| | | |
| | | ResponseEntity<String> response = restTemplate.postForEntity(url, entity, String.class); |
| | | log.info("MtSubmitSm ååºç»æï¼{}", response.getBody()); |
| | | |
| | | return JSON.parseObject(response.getBody(), Map.class); |
| | | } catch (Exception e) { |
| | | log.error("MtSubmitSm åé失败ï¼urlï¼{}ï¼destAddrï¼{}ï¼errorï¼{}", url, destAddr, e.getMessage(), e); |
| | | Map<String, Object> resp = new HashMap<>(); |
| | | resp.put("code", -1); |
| | | resp.put("message", "åéå¼å¸¸ï¼" + e.getMessage()); |
| | | return resp; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 计ç®HASHHEXï¼MD5(Algorithm:å¸å·å:å¯ç :Date) |
| | | * ä¾ï¼MD5:95555:12345:2016-10-09 16:19:43 |
| | | */ |
| | | private static String buildHashHex(String accountName, String password, String date) throws Exception { |
| | | String plain = "MD5:" + accountName + ":" + password + ":" + date; |
| | | MessageDigest md = MessageDigest.getInstance("MD5"); |
| | | byte[] bytes = md.digest(plain.getBytes(StandardCharsets.UTF_8)); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (byte b : bytes) { |
| | | sb.append(String.format("%02x", b)); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * MTæ¶æ¯åéååºåæ° |
| | | */ |
| | | @Data |
| | | public class MtSubmitSmResp { |
| | | |
| | | |
| | | /** |
| | | * ä¸åç¶æï¼0 æåï¼å
¶ä»å¤±è´¥ |
| | | */ |
| | | private Integer code; |
| | | |
| | | /** |
| | | * 失败æ¶çé误æç¤º |
| | | */ |
| | | private String message; |
| | | |
| | | /** |
| | | * 失败æ¶çé误æç¤º |
| | | */ |
| | | private String success; |
| | | |
| | | /** |
| | | * ååºç»æ |
| | | */ |
| | | private String result; |
| | | |
| | | /** |
| | | * ä¸åç¶æ=0æ¶ææï¼ä¸ºç³»ç»äº§ççmsgidï¼å¦åçäºé¿çä¿¡æåï¼åè¿å夿¡msgid |
| | | */ |
| | | private List<String> mtSubmitSm; |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty(value = "ç»è®¡ç»´åº¦ï¼day-æå¤©, month-ææ, year-æå¹´", example = "day") |
| | | @ApiModelProperty(value = "ç»è®¡ç»´åº¦ï¼day-æå¤©, month-ææ, year-æå¹´(ææ¶æ²¡æ)", example = "day") |
| | | private String timeType = "day"; |
| | | |
| | | @ApiModelProperty(value = "æºæIDï¼ä¸ºç©ºåæ¥è¯¢ææ") |
| | |
| | | import java.io.FileOutputStream; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.Period; |
| | | import java.time.ZoneId; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | |
| | | |
| | | List<PatArchive> patArchiveList1 = DtoConversionUtils.sourceToTarget(patArchiveList, PatArchive.class); |
| | | //ç»æ£è
è系人èµå¼ |
| | | // for (PatArchive pa : patArchives) { |
| | | for (PatArchive pa : patArchiveList1) { |
| | | PatArchivecontact patArchivecontact = new PatArchivecontact(); |
| | | patArchivecontact.setPatid(pa.getId()); |
| | | pa.setPatArchivecontactList(patArchivecontactMapper.selectPatArchivecontactList(patArchivecontact)); |
| | | Map<String, String> map = calculateAge(pa.getBirthdate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now()); |
| | | pa.setAge(StringUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null); |
| | | pa.setAgeUnit(map.get("ageUnit") != null ? map.get("ageUnit") : ""); |
| | | } |
| | | |
| | | return patArchiveList1; |
| | |
| | | * @return |
| | | */ |
| | | // @Override |
| | | |
| | | /** |
| | | * è·åæ£è
ä¿¡æ¯æ»æ°ï¼å»éï¼ |
| | | * |
| | |
| | | } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 2) { |
| | | // æ¥çä½é¢ 1 æ¥çé¨è¯ 2 æ¥ç使£ 3 æ¥çåºé¢ 4 |
| | | // count = patArchiveMapper.countPatArchiveInfoByOuthospQC(patArchiveReq); |
| | | PatMedOuthospQueryReq req=new PatMedOuthospQueryReq(); |
| | | PatMedOuthospQueryReq req = new PatMedOuthospQueryReq(); |
| | | String deptcodes = CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) ? null : String.join(",", patArchiveReq.getLeaveldeptcodes()); |
| | | String leavehospitaldistrictcodes = CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) ? null : String.join(",", patArchiveReq.getLeavehospitaldistrictcodes()); |
| | | req.setDeptcode(deptcodes); |
| | |
| | | List<PatArchiveOthreInfo> patArchiveList = new ArrayList<>(); |
| | | |
| | | //鍿¥è¯ä¿¡æ¯ï¼éç¨å表æ¥è¯¢ï¼å
æ¥é¨æ¥è¯çåå¨è¿ç¨ï¼åæ¥æ£è
åºæ¬ä¿¡æ¯è¡¨ï¼å
³èæ¡ä»¶ï¼patidï¼ |
| | | PatMedOuthospQueryReq req=new PatMedOuthospQueryReq(); |
| | | PatMedOuthospQueryReq req = new PatMedOuthospQueryReq(); |
| | | String deptcodes = CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) ? null : String.join(",", patArchiveReq.getLeaveldeptcodes()); |
| | | String leavehospitaldistrictcodes = CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) ? null : String.join(",", patArchiveReq.getLeavehospitaldistrictcodes()); |
| | | req.setDeptcode(deptcodes); |
| | |
| | | req.setDrname(StringUtils.isNotEmpty(patArchiveReq.getDrname()) ? patArchiveReq.getDrname() : null); |
| | | req.setPatname(StringUtils.isNotEmpty(patArchiveReq.getName()) ? patArchiveReq.getName() : null); |
| | | req.setDiagname(StringUtils.isNotEmpty(patArchiveReq.getLeavediagname()) ? patArchiveReq.getLeavediagname() : null); |
| | | req.setPageNum(patArchiveReq.getPageNum()==null?null:patArchiveReq.getPageNum()); |
| | | req.setPageSize(patArchiveReq.getPageSize()==null?null:patArchiveReq.getPageSize()); |
| | | req.setPageNum(patArchiveReq.getPageNum() == null ? null : patArchiveReq.getPageNum()); |
| | | req.setPageSize(patArchiveReq.getPageSize() == null ? null : patArchiveReq.getPageSize()); |
| | | List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.callSpQueryOuthosp(req); |
| | | for (PatMedOuthosp patMedOuthosp:patMedOuthosps ) { |
| | | for (PatMedOuthosp patMedOuthosp : patMedOuthosps) { |
| | | PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp.getPatid()); |
| | | PatArchiveOthreInfo patArchiveOthreInfo = DtoConversionUtils.sourceToTarget(patArchive, PatArchiveOthreInfo.class); |
| | | patArchiveOthreInfo.setDeptcode(patMedOuthosp.getDeptcode()); |
| | |
| | | } |
| | | return patArchiveList; |
| | | } |
| | | |
| | | public Map<String, String> calculateAge(LocalDate birthdate, LocalDate today) { |
| | | if (birthdate == null || today.isBefore(birthdate)) { |
| | | return null; |
| | | } |
| | | Map<String, String> ageMap = new HashMap<>(); |
| | | |
| | | Period period = Period.between(birthdate, today); |
| | | long totalDays = ChronoUnit.DAYS.between(birthdate, today); |
| | | long totalMonths = ChronoUnit.MONTHS.between(birthdate, today); |
| | | |
| | | int years = period.getYears(); |
| | | int months = period.getMonths(); |
| | | int days = period.getDays(); |
| | | |
| | | String ageUnit; |
| | | Integer age; |
| | | String ageUnit2 = null; |
| | | Integer age2 = null; |
| | | |
| | | if (totalDays < 90) { |
| | | // å°äº 1 个æï¼æå¤©è®¡ç® |
| | | ageUnit = "天"; |
| | | age = (int) totalDays; |
| | | ageMap.put("age", age != null ? age.toString() : null); |
| | | ageMap.put("ageUnit", ageUnit); |
| | | ageMap.put("age2", null); |
| | | ageMap.put("ageUnit2", null); |
| | | } else if (totalMonths < 36) { |
| | | // å°äº 1 å¹´ï¼ææ + å¤©è®¡ç® |
| | | ageUnit = "æ"; |
| | | age = (int) totalMonths; |
| | | ageUnit2 = "天"; |
| | | age2 = days; |
| | | ageMap.put("age", age != null ? age.toString() : null); |
| | | ageMap.put("ageUnit", ageUnit); |
| | | ageMap.put("age2", age2 != null ? age2.toString() : null); |
| | | ageMap.put("ageUnit2", ageUnit2); |
| | | } else { |
| | | // å¤§äº 1 å¹´ï¼æå¹´ + æè®¡ç® |
| | | ageUnit = "å²"; |
| | | age = years; |
| | | ageUnit2 = "æ"; |
| | | age2 = months; |
| | | ageMap.put("age", age != null ? age.toString() : null); |
| | | ageMap.put("ageUnit", ageUnit); |
| | | ageMap.put("age2", age2 != null ? age2.toString() : null); |
| | | ageMap.put("ageUnit2", ageUnit2); |
| | | } |
| | | |
| | | return ageMap; |
| | | } |
| | | } |
| | | |
| | |
| | | PatMedOuthospQueryReq req = new PatMedOuthospQueryReq(); |
| | | String deptcodes = CollectionUtils.isEmpty(patMedReq.getDeptcodeList()) ? null : String.join(",", patMedReq.getDeptcodeList()); |
| | | req.setBeginAdmitdate(patMedReq.getStartDate()); |
| | | req.setEndAdmitdate(patMedReq.getEndDate()); |
| | | req.setEndAdmitdate(DateUtils.addDays(patMedReq.getEndDate(),1)); |
| | | req.setDeptcode(deptcodes); |
| | | req.setOrgid(patMedReq.getOrgid()); |
| | | // req.setCampusid(patMedReq.getCampusid()); |
| | |
| | | public class ServiceSLTDHealthcareRecordServiceImpl implements IServiceSLTDHealthcareRecordService { |
| | | |
| | | private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; |
| | | public static final String APP_KEY = "ak-zUMiOWhqXiJQWPB1pCbz0pjr"; |
| | | |
| | | @Autowired |
| | | private IPatArchiveService patArchiveService; |
| | |
| | | |
| | | @Value("${userPwd}") |
| | | private String userPwd; |
| | | |
| | | @Value("${lwl_app_key}") |
| | | private String APP_KEY; |
| | | |
| | | @Override |
| | | public List<ServiceSLTDInhospResDTO> queryHealthcareRecordList(ServiceSLTDInhospReqVO reqVO) { |
| | |
| | | sysUserDept.setCreateTime(new Date()); |
| | | sysUserDept.setDelFlag(0L); |
| | | |
| | | //夿ä¸ä¸æ¯ä¸æ¯å·²ç»åå¨äº |
| | | if (ObjectUtils.isNotEmpty(sysUser1) && ObjectUtils.isNotEmpty(sysDept)) { |
| | | //夿ä¸ä¸ç¨æ·-é¨é¨å
³ç³»æ¯ä¸æ¯å·²ç»åå¨äºï¼æ 论æ°ç¨æ·è¿æ¯èç¨æ·é½éè¦å»éï¼ |
| | | if (ObjectUtils.isNotEmpty(sysUser.getUserId()) && ObjectUtils.isNotEmpty(sysDept)) { |
| | | SysUserDept sud = new SysUserDept(); |
| | | sud.setUserId(sysUser1.getUserId()); |
| | | sud.setUserId(sysUser.getUserId()); |
| | | sud.setDeptId(sysDept.getDeptId()); |
| | | List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sud); |
| | | if (CollectionUtils.isNotEmpty(sysUserDepts)) { |
| | | sysUserDept.setId(sysUserDepts.get(0).getId()); |
| | | sysUserDeptMapper.updateSysUserDept(sysUserDept); |
| | | } else { |
| | | sysUserDeptMapper.insertSysUserDept(sysUserDept); |
| | | } |
| | | } else { |
| | | //ä¸åå¨ï¼åæ°å¢ |
| | | sysUserDeptMapper.insertSysUserDept(sysUserDept); |
| | | } |
| | | if (StringUtils.isNotEmpty(sysDept.getDeptType()) && sysDept.getDeptType().equals("1")) { |
| | | hospInfoList.add(Arrays.asList(sysDept.getDeptCode())); |
| | |
| | | sur.setOrgid(sysUser.getOrgid()); |
| | | |
| | | //å
æ¥è¯¢ä¸ä¸ï¼æ¯å¦åå¨ |
| | | SysUserRole sysUserRole = sysUserRoleMapper.selectUserRoleByRoleIdAndUserId(sysUser.getUserId(), 3L); |
| | | SysUserRole sysUserRole = sysUserRoleMapper.selectUserRoleByRoleIdAndUserId(3L, sysUser.getUserId()); |
| | | if (ObjectUtils.isNotEmpty(sysUserRole)) continue; |
| | | |
| | | userRoleList.add(sur); |
| | |
| | | } |
| | | |
| | | private PatArchive processPatientArchive(ServiceSLTDInhospResDTO dto) { |
| | | PatArchive queryArchive = new PatArchive(); |
| | | queryArchive.setIdcardno(StringUtils.isEmpty(dto.getIdCardNo()) ? "" + dto.getMedicalCardId() : dto.getIdCardNo().trim()); |
| | | List<PatArchive> existingArchives = patArchiveService.selectPatArchiveList(queryArchive); |
| | | List<PatArchive> existingArchives = null; |
| | | |
| | | // ä¼å
æ patientno 精确æ¥éï¼æ¥ä¸å°åæ idcardno æ¥éï¼ANDæ¡ä»¶ä¼æ¼æ¥åä¸äººä¸åpatientnoçæ
åµï¼ |
| | | if (dto.getPatientId() != null) { |
| | | PatArchive queryByPatientNo = new PatArchive(); |
| | | queryByPatientNo.setPatientno(String.valueOf(dto.getPatientId())); |
| | | queryByPatientNo.setIdcardno(StringUtils.isNotEmpty(dto.getIdCardNo()) ? dto.getIdCardNo().trim() : null); |
| | | existingArchives = patArchiveService.selectPatArchiveList(queryByPatientNo); |
| | | } |
| | | // if (CollectionUtils.isEmpty(existingArchives) && !StringUtils.isEmpty(dto.getIdCardNo())) { |
| | | // PatArchive queryByIdCard = new PatArchive(); |
| | | // queryByIdCard.setIdcardno(dto.getIdCardNo().trim()); |
| | | // existingArchives = patArchiveService.selectPatArchiveList(queryByIdCard); |
| | | // } |
| | | |
| | | PatArchive patArchive = buildPatientArchive(dto); |
| | | |
| | |
| | | |
| | | private PatArchive buildPatientArchive(ServiceSLTDInhospResDTO dto) { |
| | | PatArchive patArchive = new PatArchive(); |
| | | patArchive.setPatientno("" + dto.getPatientId()); |
| | | patArchive.setPatientno(dto.getPatientId() == null ? null : String.valueOf(dto.getPatientId())); |
| | | patArchive.setIdcardno(StringUtils.isEmpty(dto.getIdCardNo()) ? "" + dto.getMedicalCardId() : dto.getIdCardNo().trim()); |
| | | patArchive.setName(dto.getPatientName()); |
| | | patArchive.setSourcefrom(2L); |
| | |
| | | String deptcodes = CollectionUtils.isEmpty(request.getDeptcodes()) ? null : String.join(",", request.getDeptcodes()); |
| | | if (!request.getTimeType().equals("month")) { |
| | | req.setBeginAdmitdate(DateUtils.parseDate(serviceStatisticsResponse.getTimePeriod())); |
| | | req.setEndAdmitdate(DateUtils.parseDate(serviceStatisticsResponse.getTimePeriod())); |
| | | req.setEndAdmitdate( DateUtils.addDays(DateUtils.parseDate(serviceStatisticsResponse.getTimePeriod()),1)); |
| | | } else { |
| | | // year ç±»åï¼timePeriod æ ¼å¼ä¸º "yyyy-MM"ï¼åå½æç¬¬ä¸å¤©åæåä¸å¤© |
| | | java.time.YearMonth ym = java.time.YearMonth.parse(serviceStatisticsResponse.getTimePeriod()); |