| | |
| | | <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> |
| | | <outputRelativeToContentRoot value="true" /> |
| | | <module name="ruoyi-framework" /> |
| | | <module name="smartor-wuxi" /> |
| | | <module name="ruoyi-system" /> |
| | | <module name="smartor" /> |
| | | <module name="ruoyi-generator" /> |
| | |
| | | |
| | | for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { |
| | | //å
夿ä¸ä¸ï¼subIdsæ¯å¦ä¸ºç©ºï¼å¦æä¸ä¸ºç©ºï¼åªæ§è¡subIdséçæ£è
|
| | | log.info("-----subIdsçå¼ä¸ºï¼{}", subIds); |
| | | if (CollectionUtils.isNotEmpty(subIds)) { |
| | | boolean contains = subIds.contains(serviceSubtask.getId()); |
| | | //妿containsä¸ä¸ºtrue,说æå½åçæ£è
å·²ç»åéæåï¼ç´æ¥å¾ªç¯ä¸ä¸ä¸ªäººå°±è¡ |
| | |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(ip + ":" + req_path + "/sf?p=" + format); |
| | | sendMagParam.setContent("æ¨å¥½ï¼é请æ¨å¡«ååºé¢éè®¿è°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + " å¡«åãæè°¢æ¨é
åï¼"); |
| | | log.info("888888888888:{}",sendMagParam); |
| | | log.info("888888888888:{}", sendMagParam); |
| | | } else if (type == 2) { |
| | | //é®å¸ï¼é®é¢ï¼ |
| | | ServiceOutPath serviceOutPath = new ServiceOutPath(); |
| | |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(ip + ":" + req_path + "/wt?p=" + format); |
| | | sendMagParam.setContent("æ¨å¥½ï¼é请æ¨å¡«ååºé¢è°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + " å¡«åãæè°¢æ¨é
åï¼"); |
| | | log.info("æ¨å¥½ï¼é请æ¨å¡«ååºé¢è°æ¥è¡¨ï¼è¯·ç¹å»,{}",sendMagParam.getUrl()); |
| | | log.info("æ¨å¥½ï¼é请æ¨å¡«ååºé¢è°æ¥è¡¨ï¼è¯·ç¹å»,{}", sendMagParam.getUrl()); |
| | | } else if (type == 3) { |
| | | //宣æ |
| | | ServiceOutPath serviceOutPath = new ServiceOutPath(); |
| | |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(ip + ":" + req_path + "/xj?p=" + format); |
| | | sendMagParam.setContent("æ¨å¥½ï¼é请æ¨å¡«ååºé¢å®£æè°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é
åï¼"); |
| | | log.info("-----------sendMagParamçå¼ä¸ºï¼{}", sendMagParam); |
| | | } |
| | | //çä¿¡è¿éè¦æ¨¡æ¿ |
| | | // Map<String, String> req = new HashMap<>(); |
| | |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddhhmmsszzz"); // è¾åºæ¥ææ ¼å¼ |
| | | strb.append("&send_time=" + dateFormat.format(new Date())); |
| | | String isSuccess = HttpUtil.postFormRequest(xhsmsPath, strb.toString()); |
| | | log.info("-----------sisSuccessçå¼ä¸ºï¼{}", isSuccess); |
| | | if (StringUtils.isNotEmpty(isSuccess) && isSuccess.contains("200")) { |
| | | ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); |
| | | serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); |
| | |
| | | @Value("${uploadSwitch}") |
| | | private Integer uploadSwitch; |
| | | |
| | | @Value("${req_path}") |
| | | private String reqPath; |
| | | |
| | | @Value("${localIP}") |
| | | private String localIP; |
| | | |
| | | /** |
| | | * éç¨ä¸è½½è¯·æ± |
| | | * |
| | |
| | | String fileName = FileUploadUtils.uploadSort(filePath, file); |
| | | String url = null; |
| | | //æ°åå»é¢ç¹æ®ï¼è¿ä¸ªè§é¢ç访é®å¾è½¬ |
| | | String xhPath = "http://218.108.11.22:8093/profile-api"; |
| | | String xhPath = localIP + ":" + reqPath + "/profile-api"; |
| | | if (localIP.contains("127.0.0.1") || localIP.contains("localhost")) { |
| | | xhPath = localIP + ":8095" + "/profile"; |
| | | } |
| | | if (uploadSwitch == 1) { |
| | | String fn = fileName.replaceAll("/profile", ""); |
| | | url = xhPath + fn; |
| | |
| | | convertDocToHtml(filePath + "\\" + file.getOriginalFilename(), filePath + "\\" + file.getOriginalFilename().split("\\.", 2)[0] + ".html"); |
| | | |
| | | String url = null; |
| | | String xhPath = "http://218.108.11.22:8093/profile-api"; |
| | | String xhPath = localIP + ":" + reqPath + "/profile-api"; |
| | | if (localIP.contains("127.0.0.1") || localIP.contains("localhost")) { |
| | | xhPath = localIP + ":8095" + "/profile"; |
| | | } |
| | | if (uploadSwitch == 1) { |
| | | String fn = fileName.replaceAll("\\.[^.]*$", ".html").replaceAll("/profile", ""); |
| | | url = xhPath + fn; |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | String url = null; |
| | | String xhPath = "http://218.108.11.22:8093/profile-api"; |
| | | String xhPath = localIP + ":" + reqPath + "/profile-api"; |
| | | if (localIP.contains("127.0.0.1") || localIP.contains("localhost")) { |
| | | xhPath = localIP + ":8095" + "/profile"; |
| | | } |
| | | if (uploadSwitch == 1) { |
| | | url = xhPath + "/upload/show/" + fileName.split("\\.", 2)[0] + "/" + fileName; |
| | | } else { |
| | |
| | | System.out.println("word转htmlæå"); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ã请填ååè½åç§°ãå表 |
| | | * æ¥è¯¢å©´å¿æé¿è®°å½å² |
| | | */ |
| | | @ApiOperation("æ¥è¯¢ã请填ååè½åç§°ãå表") |
| | | @ApiOperation("æ¥è¯¢å©´å¿æé¿è®°å½å²") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:growth:list')") |
| | | @PostMapping("/dateLine") |
| | | public TableDataInfo dateLine(@RequestBody PatBabyGrowth patBabyGrowth) |
| | |
| | | @PostMapping("/selectPatMedInhospListCount") |
| | | @ApiOperation("æ¥è¯¢åºãå
¥é¢çç
人次å人æ°") |
| | | public AjaxResult selectPatMedInhospListCount(PatMedReq patMedReq) { |
| | | SysUser user = getLoginUser().getUser(); |
| | | patMedReq.setOrgid(user.getOrgid()); |
| | | return success(patMedInhospService.selectPatMedInhospListCount(patMedReq)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.smartor.domain.SchemeAutofinshrule; |
| | | import com.ruoyi.smartor.service.ISchemeAutofinshruleService; |
| | | import com.smartor.service.ISchemeAutofinshruleService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | |
| | | return success(serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | /** |
| | | * é访ç»è®¡å¯¼åº |
| | | */ |
| | | @ApiOperation("æå¡ç»è®¡æ¥è¯¢-ææ¶é´ç»´åº¦ç»è®¡åºé¢/é¨è¯éè®¿æ°æ®") |
| | | @PostMapping("/getServiceStatistics") |
| | | public AjaxResult getServiceStatistics(@RequestBody ServiceStatisticsRequest serviceStatisticsRequest) { |
| | | SysUser user = getLoginUser().getUser(); |
| | | serviceStatisticsRequest.setOrgid(user.getOrgid()); |
| | | List<ServiceStatisticsResponse> serviceStatistics = serviceSubtaskService.getServiceStatistics(serviceStatisticsRequest); |
| | | return success(serviceStatistics); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.smartor.domain.BaseSmsRequest; |
| | | import com.smartor.service.IBaseSmsaccountService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | private IBaseSmsaccountService baseSmsaccountService; |
| | | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | | |
| | | /** |
| | | * ç»å½æ¹æ³ |
| | | * |
| | |
| | | @PostMapping("/login") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // çæä»¤ç |
| | | String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), loginBody.getUuid()); |
| | | String token = null; |
| | | if (loginBody.getPhoneCode() != null) { |
| | | String phone = redisCache.getCacheObject(loginBody.getPhoneCode()); |
| | | token = loginService.loginByPhone(phone); |
| | | } else { |
| | | // çæä»¤ç |
| | | token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), loginBody.getUuid()); |
| | | } |
| | | ajax.put(Constants.TOKEN, token); |
| | | return ajax; |
| | | } |
| | |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
| | | return AjaxResult.success(menuService.buildMenus(menus)); |
| | | } |
| | | |
| | | /** |
| | | * éªè¯ç åé |
| | | * |
| | | * @param payload |
| | | * @return |
| | | */ |
| | | @PostMapping("/phoneLogin") |
| | | public AjaxResult sendCode(@RequestBody Map<String, String> payload) { |
| | | String phone = payload.get("phone"); |
| | | String code = String.format("%06d", new Random().nextInt(999999)); |
| | | |
| | | // åå
¥ Redisï¼æææ2åé |
| | | redisCache.setCacheObject(code, phone, 2, TimeUnit.MINUTES); |
| | | |
| | | //æ é¡çº¿ä¸ç¯å¢æåçä¿¡ |
| | | if (active.equals("wx")) { |
| | | BaseSmsRequest baseSmsRequest = new BaseSmsRequest(); |
| | | baseSmsRequest.setPhoneNumber(phone); |
| | | baseSmsRequest.setContent("ç»ééªè¯ç ï¼" + code + " ï¼2åéå
æï¼åå¿å°éªè¯ç æä¾ç»ä»äººï¼è°¨é²è¢«éªã"); |
| | | baseSmsaccountService.sendMsg(baseSmsRequest); |
| | | } |
| | | // è°ç¨çä¿¡æå¡åééªè¯ç |
| | | System.out.println("ç»ééªè¯ç ï¼" + code); |
| | | |
| | | return AjaxResult.success(true); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.smartor.domain.ServiceSubtaskDetail; |
| | |
| | | |
| | | @Test |
| | | public void bb() { |
| | | String key="1-9-WJscriptCache"; |
| | | String[] split = key.split("-"); |
| | | System.out.println(split.clone()); |
| | | RSAPublicKeyExample rsaPublicKeyExample=new RSAPublicKeyExample(); |
| | | // String s1 = rsaPublicKeyExample.encryptedData("123456", "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALQzqW1EIXBKGMu+2oEYSB5gM7Ox/ihyYTeeoE0yPX1qtt4++5yNOeTBVd6EEM4iKzVEzWj6REIWVwaSNPn/SvUCAwEAAQ=="); |
| | | |
| | | String s = rsaPublicKeyExample.decryptedData("J7V6yb5WHW63bQMbMyzxeT07HGesIXJwy9w77zBa6KG4PnWe7uaZh00vX21w%2Bn5FW8%2BjUAAU1HatqRWzFp7fvA%3D%3D", "MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg=="); |
| | | System.out.println(s); |
| | | } |
| | | |
| | | public void aa(MultipartFile file) throws IOException { |
| | |
| | | #req_path: 8095 |
| | | #localIP: 192.168.2.10 |
| | | |
| | | #æ°åå»é¢å¤é¾è¯·æ±IPå端å£å· |
| | | req_path: 8093 |
| | | localIP: 218.108.11.22 |
| | | #å¤é¾è¯·æ±IPå端å£å· |
| | | req_path: 8092 |
| | | localIP: 192.16.4.220 |
| | | |
| | | #è·åæ£è
ä¿¡æ¯URL(ååæä¾) |
| | | hosp_info_url: http://esb-core-rest.wowjoy.cn/esb/exchange |
| | |
| | | # password: csbsbxt@123 |
| | | # driver-class-name: org.postgresql.Driver |
| | | # æ¬å°é«æ¯ |
| | | url: jdbc:postgresql://192.168.100.138:5432/postgres |
| | | url: jdbc:postgresql://192.168.100.126:5432/postgres |
| | | username: gaussdb |
| | | password: Ls@123456 |
| | | driver-class-name: org.postgresql.Driver |
| | | # 髿¯æ°æ®åºé¾æ¥ |
| | | # url: jdbc:postgresql://172.20.32.115:15400/smartorwx?prepareThreshold=0 |
| | | # username: shuifang |
| | | # password: Shuifang@51868 |
| | | # driver-class-name: org.postgresql.Driver |
| | | # url: jdbc:postgresql://172.20.32.115:15400/smartorwx?prepareThreshold=0 |
| | | # username: shuifang |
| | | # password: Shuifang@51868 |
| | | # driver-class-name: org.postgresql.Driver |
| | | |
| | | # å
¬å¸äº |
| | | # url: jdbc:mysql://116.62.18.175:6002/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: false |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | # redis é
ç½® |
| | | redis: |
| | | # # å°åï¼æ é¡äººæ°å»é¢ï¼ |
| | | # host: 127.0.0.1 |
| | | # port: 6020 |
| | | # host: 127.0.0.1 |
| | | # port: 6020 |
| | | |
| | | # å°åï¼å
¬å¸ï¼ |
| | | host: 127.0.0.1 |
| | |
| | | qrpath: D:\qrcode |
| | | |
| | | #æ é¡å
å¤é¾è¯·æ±IPå端å£å· |
| | | req_path: 8092/wxsf |
| | | localIP: 192.168.100.128 |
| | | req_path: 8093 |
| | | localIP: 127.0.0.1 |
| | | #req_path: 8092 |
| | | #localIP: http://61.160.111.174 |
| | | |
| | |
| | | # å®ä¾æ¼ç¤ºå¼å
³ |
| | | demoEnabled: true |
| | | # æä»¶è·¯å¾ 示ä¾ï¼ Windowsé
ç½®D:/ruoyi/uploadPathï¼Linuxé
ç½® /home/ruoyi/uploadPathï¼ |
| | | profile: D:/ruoyi/uploadPath |
| | | # profile: D:/ruoyi/uploadPath |
| | | profile: /home/software/uploadPath |
| | | # è·åipå°åå¼å
³ |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°ç»è®¡ç® char å符éªè¯ |
| | |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | profiles: |
| | | active: wx |
| | | active: local |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | |
| | | |
| | | /** |
| | | * ç¨æ·ç»å½å¯¹è±¡ |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class LoginBody |
| | | { |
| | | public class LoginBody { |
| | | /** |
| | | * ç¨æ·å |
| | | */ |
| | |
| | | private String code; |
| | | |
| | | /** |
| | | * ææºéªè¯ç |
| | | */ |
| | | private String phoneCode; |
| | | |
| | | /** |
| | | * å¯ä¸æ è¯ |
| | | */ |
| | | private String uuid; |
| | | |
| | | public String getUsername() |
| | | { |
| | | public String getUsername() { |
| | | return username; |
| | | } |
| | | |
| | | public void setUsername(String username) |
| | | { |
| | | public void setUsername(String username) { |
| | | this.username = username; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | public void setPassword(String password) { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getCode() |
| | | { |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) |
| | | { |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getUuid() |
| | | { |
| | | public String getUuid() { |
| | | return uuid; |
| | | } |
| | | |
| | | public void setUuid(String uuid) |
| | | { |
| | | public void setUuid(String uuid) { |
| | | this.uuid = uuid; |
| | | } |
| | | |
| | | public String getPhoneCode() { |
| | | return phoneCode; |
| | | } |
| | | |
| | | public void setPhoneCode(String phoneCode) { |
| | | this.phoneCode = phoneCode; |
| | | } |
| | | } |
| | |
| | | public class RSAPublicKeyExample { |
| | | |
| | | |
| | | /** |
| | | * æ°æ®è§£å¯ |
| | | * |
| | | * @param encryptedData |
| | | * @return |
| | | */ |
| | | public String decryptedData(String encryptedData, String pri_key) { |
| | | String privateKeyString = "ç§é¥çBase64ç¼ç å符串"; // å端ç§é¥çBase64ç¼ç å符串 |
| | | |
| | | public static String encryptedData(String plainText, String pubKey) { |
| | | try { |
| | | // å°ç§é¥Base64ç¼ç å符串转æ¢ä¸ºPrivateKey对象 |
| | | byte[] privateKeyBytes = Base64.getDecoder().decode(pri_key); |
| | | PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes); |
| | | KeyFactory keyFactory = KeyFactory.getInstance("RSA"); |
| | | PrivateKey privateKey = keyFactory.generatePrivate(keySpec); |
| | | |
| | | // 使ç¨ç§é¥è§£å¯æ°æ® |
| | | Cipher decryptCipher = Cipher.getInstance("RSA"); |
| | | decryptCipher.init(Cipher.DECRYPT_MODE, privateKey); |
| | | byte[] decryptedBytes = decryptCipher.doFinal(Base64.getDecoder().decode(encryptedData)); |
| | | |
| | | // è§£å¯åçæ°æ® |
| | | String decryptedData = new String(decryptedBytes); |
| | | System.out.println("è§£å¯åçæ°æ®ï¼" + decryptedData); |
| | | return decryptedData; |
| | | } catch (Exception e) { |
| | | log.error("è§£å¯æ¥éäº:{}", e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * è¦å å¯çæææ°æ® |
| | | * |
| | | * @param plainText |
| | | * @return |
| | | */ |
| | | public String encryptedData(String plainText, String pub_key) { |
| | | log.error("éè¦å å¯çæ°æ®ï¼{}", plainText); |
| | | try { |
| | | |
| | | byte[] publicKeyBytes = Base64.getDecoder().decode(pub_key); |
| | | byte[] publicKeyBytes = Base64.getDecoder().decode(pubKey); |
| | | X509EncodedKeySpec keySpec = new X509EncodedKeySpec(publicKeyBytes); |
| | | KeyFactory keyFactory = KeyFactory.getInstance("RSA"); |
| | | PublicKey publicKey = keyFactory.generatePublic(keySpec); |
| | | |
| | | // 使ç¨å
¬é¥å 坿°æ® |
| | | Cipher encryptCipher = Cipher.getInstance("RSA"); |
| | | encryptCipher.init(Cipher.ENCRYPT_MODE, publicKey); |
| | | byte[] encryptedBytes = encryptCipher.doFinal(plainText.getBytes()); |
| | | Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); |
| | | cipher.init(Cipher.ENCRYPT_MODE, publicKey); |
| | | byte[] encryptedBytes = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8)); |
| | | |
| | | // å°å å¯åçæ°æ®è½¬æ¢ä¸ºBase64ç¼ç çå符串 |
| | | // Base64 ç¼ç ï¼å¿
é¡»ä¿çï¼ |
| | | String encryptedText = Base64.getEncoder().encodeToString(encryptedBytes); |
| | | log.error("Base64å å¯åçæ°æ®ï¼{}", encryptedText); |
| | | encryptedText = URLEncoder.encode(encryptedText, StandardCharsets.UTF_8.toString()); |
| | | log.error("URLEncoderç¼ç åçæ°æ®ï¼{}", encryptedText); |
| | | String decodedString = URLDecoder.decode(encryptedText, "UTF-8"); |
| | | log.error("URLEncoderè§£ç åçæ°æ®ï¼{}", decodedString); |
| | | return encryptedText; |
| | | |
| | | // å¯éï¼å¦æç¨äº URL ä¼ è¾ï¼åè¿è¡ URL ç¼ç |
| | | return URLEncoder.encode(encryptedText, StandardCharsets.UTF_8.toString()); |
| | | } catch (Exception e) { |
| | | log.error("å å¯å¤±è´¥äº:{}", e.getMessage()); |
| | | System.err.println("å å¯å¤±è´¥: " + e.getMessage()); |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * RSA ç§é¥è§£å¯ï¼è§£å¯ Base64 ç¼ç åçå¯æï¼æ¯æ URL è§£ç ï¼ |
| | | */ |
| | | public static String decryptedData(String encryptedData, String priKey) { |
| | | try { |
| | | // å¯éï¼å
URL è§£ç ï¼å¦æå å¯ååäº URLEncoderï¼ |
| | | String base64Encrypted = URLDecoder.decode(encryptedData, StandardCharsets.UTF_8.toString()); |
| | | |
| | | // Base64 è§£ç |
| | | byte[] encryptedBytes = Base64.getDecoder().decode(base64Encrypted); |
| | | |
| | | byte[] privateKeyBytes = Base64.getDecoder().decode(priKey); |
| | | PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes); |
| | | KeyFactory keyFactory = KeyFactory.getInstance("RSA"); |
| | | PrivateKey privateKey = keyFactory.generatePrivate(keySpec); |
| | | |
| | | Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); |
| | | cipher.init(Cipher.DECRYPT_MODE, privateKey); |
| | | byte[] decryptedBytes = cipher.doFinal(encryptedBytes); |
| | | |
| | | return new String(decryptedBytes, StandardCharsets.UTF_8); |
| | | } catch (Exception e) { |
| | | System.err.println("è§£å¯å¤±è´¥: " + e.getMessage()); |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String decodedString = null; |
| | | try { |
| | |
| | | // è¿æ»¤è¯·æ± |
| | | .authorizeRequests() |
| | | // 对äºç»å½login 注åregister éªè¯ç captchaImage å
许å¿åè®¿é® |
| | | .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask/phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/subtaskAnswer/saveQuestionAnswer","/smartor/import/download","/smartor/serviceSubtask/recordAccept","/smartor/outPath/getInfoByParam").permitAll() |
| | | .antMatchers("/login","/phoneLogin", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask/phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/subtaskAnswer/saveQuestionAnswer","/smartor/import/download","/smartor/serviceSubtask/recordAccept","/smartor/outPath/getInfoByParam").permitAll() |
| | | // éæèµæºï¼å¯å¿åè®¿é® |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() |
| | | // é¤ä¸é¢å¤çææè¯·æ±å
¨é¨éè¦é´æè®¤è¯ |
| | |
| | | package com.ruoyi.framework.web.service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.authentication.BadCredentialsException; |
| | |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç»å½æ ¡éªæ¹æ³ |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class SysLoginService |
| | | { |
| | | public class SysLoginService { |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | |
| | | |
| | | /** |
| | | * ç»å½éªè¯ |
| | | * |
| | | * |
| | | * @param username ç¨æ·å |
| | | * @param password å¯ç |
| | | * @param code éªè¯ç |
| | | * @param uuid å¯ä¸æ è¯ |
| | | * @param code éªè¯ç |
| | | * @param uuid å¯ä¸æ è¯ |
| | | * @return ç»æ |
| | | */ |
| | | public String login(String username, String password, String code, String uuid) |
| | | { |
| | | public String login(String username, String password, String code, String uuid) { |
| | | boolean captchaEnabled = configService.selectCaptchaEnabled(); |
| | | // éªè¯ç å¼å
³ |
| | | if (captchaEnabled) |
| | | { |
| | | if (captchaEnabled) { |
| | | validateCaptcha(username, code, uuid); |
| | | } |
| | | // ç¨æ·éªè¯ |
| | | Authentication authentication = null; |
| | | try |
| | | { |
| | | try { |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password); |
| | | AuthenticationContextHolder.setContext(authenticationToken); |
| | | // è¯¥æ¹æ³ä¼å»è°ç¨UserDetailsServiceImpl.loadUserByUsername |
| | | authentication = authenticationManager.authenticate(authenticationToken); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (e instanceof BadCredentialsException) |
| | | { |
| | | } catch (Exception e) { |
| | | if (e instanceof BadCredentialsException) { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); |
| | | throw new UserPasswordNotMatchException(); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); |
| | | throw new ServiceException(e.getMessage()); |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | } finally { |
| | | AuthenticationContextHolder.clearContext(); |
| | | } |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); |
| | |
| | | return tokenService.createToken(loginUser); |
| | | } |
| | | |
| | | |
| | | public String loginByPhone(String phone) { |
| | | SysUser sysUser = userService.selectUserByPhone(phone); |
| | | if (ObjectUtils.isNotEmpty(sysUser)) { |
| | | // æå»ºç»å½ç¨æ·å¯¹è±¡ |
| | | LoginUser loginUser = new LoginUser(); |
| | | loginUser.setUser(sysUser); |
| | | loginUser.setUserId(sysUser.getUserId()); |
| | | // å建 token |
| | | String token = tokenService.createToken(loginUser); |
| | | // çætoken |
| | | return token; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªéªè¯ç |
| | | * |
| | | * |
| | | * @param username ç¨æ·å |
| | | * @param code éªè¯ç |
| | | * @param uuid å¯ä¸æ è¯ |
| | | * @param code éªè¯ç |
| | | * @param uuid å¯ä¸æ è¯ |
| | | * @return ç»æ |
| | | */ |
| | | public void validateCaptcha(String username, String code, String uuid) |
| | | { |
| | | public void validateCaptcha(String username, String code, String uuid) { |
| | | String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); |
| | | String captcha = redisCache.getCacheObject(verifyKey); |
| | | redisCache.deleteObject(verifyKey); |
| | | if (captcha == null) |
| | | { |
| | | if (captcha == null) { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"))); |
| | | throw new CaptchaExpireException(); |
| | | } |
| | | if (!code.equalsIgnoreCase(captcha)) |
| | | { |
| | | if (!code.equalsIgnoreCase(captcha)) { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); |
| | | throw new CaptchaException(); |
| | | } |
| | |
| | | * |
| | | * @param userId ç¨æ·ID |
| | | */ |
| | | public void recordLoginInfo(Long userId) |
| | | { |
| | | public void recordLoginInfo(Long userId) { |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.setUserId(userId); |
| | | sysUser.setLoginIp(IpUtils.getIpAddr(ServletUtils.getRequest())); |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class UserDetailsServiceImpl implements UserDetailsService |
| | | { |
| | | public class UserDetailsServiceImpl implements UserDetailsService { |
| | | private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class); |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | |
| | | @Autowired |
| | | private SysPasswordService passwordService; |
| | | |
| | |
| | | private SysPermissionService permissionService; |
| | | |
| | | @Override |
| | | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException |
| | | { |
| | | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { |
| | | SysUser user = userService.selectUserByUserName(username); |
| | | if (StringUtils.isNull(user)) |
| | | { |
| | | if (StringUtils.isNull(user)) { |
| | | log.info("ç»å½ç¨æ·ï¼{} ä¸åå¨.", username); |
| | | throw new ServiceException("ç»å½ç¨æ·ï¼" + username + " ä¸åå¨"); |
| | | } |
| | | else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) |
| | | { |
| | | } else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { |
| | | log.info("ç»å½ç¨æ·ï¼{} 已被å é¤.", username); |
| | | throw new ServiceException("对ä¸èµ·ï¼æ¨çè´¦å·ï¼" + username + " 已被å é¤"); |
| | | } |
| | | else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) |
| | | { |
| | | } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { |
| | | log.info("ç»å½ç¨æ·ï¼{} 已被åç¨.", username); |
| | | throw new ServiceException("对ä¸èµ·ï¼æ¨çè´¦å·ï¼" + username + " å·²åç¨"); |
| | | } |
| | |
| | | return createLoginUser(user); |
| | | } |
| | | |
| | | public UserDetails createLoginUser(SysUser user) |
| | | { |
| | | public UserDetails createLoginUser(SysUser user) { |
| | | return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user)); |
| | | } |
| | | } |
| | |
| | | JsonNode resultListNode = rootNode.path("results").path("resultList"); |
| | | // éåresultListä¸çæ¯ä¸ªå¯¹è±¡ |
| | | for (JsonNode item : resultListNode) { |
| | | |
| | | SysUserImport person = objectMapper.treeToValue(item, SysUserImport.class); |
| | | person.setStaffPhoto(""); |
| | | sysUserImportMapper.insertSysUserImport(person); |
| | | |
| | | } |
| | | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void analysisData() { |
| | |
| | | } catch (Exception e) { |
| | | log.error("ééåºé¢æ°æ®åºé®é¢äºï¼{}", e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | // |
| | | // public void dealHisData2() { |
| | |
| | | */ |
| | | public SysUser selectUserByUserName(String userName); |
| | | |
| | | public SysUser selectUserByPhone(String phone); |
| | | |
| | | /** |
| | | * éè¿ç¨æ·IDæ¥è¯¢ç¨æ· |
| | | * |
| | |
| | | */ |
| | | public SysUser selectUserByUserName(String userName); |
| | | |
| | | public SysUser selectUserByPhone(String phone); |
| | | |
| | | |
| | | /** |
| | | * éè¿ç¨æ·IDæ¥è¯¢ç¨æ· |
| | | * |
| | |
| | | * @return ç¨æ·å¯¹è±¡ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public SysUser selectUserByPhone(String phone) { |
| | | return userMapper.selectUserByPhone(phone); |
| | | } |
| | | |
| | | @Override |
| | | public SysUser selectUserByUserName(String userName) { |
| | | SysUser sysUser = userMapper.selectUserByUserName(userName); |
| | | List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(sysUser.getUserId()); |
| | |
| | | } |
| | | sysUser.setBelongWards(list); |
| | | } |
| | | log.error("æ½å¤çç§å®¤æ¯ï¼{}",sysUserDeptKSs); |
| | | log.error("æ½å¤çç§å®¤æ¯ï¼{}", sysUserDeptKSs); |
| | | if (!CollectionUtils.isEmpty(sysUserDeptKSs)) { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (SysUserDept sud : sysUserDeptKSs) { |
| | |
| | | where u.user_name = #{userName} and u.del_flag = '0' |
| | | </select> |
| | | |
| | | <select id="selectUserByPhone" parameterType="String" resultMap="SysUserResult"> |
| | | <include refid="selectUserVo"/> |
| | | where u.phonenumber = #{phone} and u.del_flag = '0' |
| | | </select> |
| | | |
| | | <select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> |
| | | <include refid="selectUserVo"/> |
| | | where u.user_id = #{userId} |
| | |
| | | @ApiModelProperty(value = "å®¶åºçµè¯") |
| | | private String jtdh; |
| | | |
| | | @ApiModelProperty(value = "é¢ççµè¯") |
| | | private String yldh; |
| | | |
| | | @ApiModelProperty(value = "æ·å£å°å") |
| | | private String hkdz; |
| | | |
| | |
| | | private String relativetelcode; |
| | | |
| | | /** |
| | | * é¢çå·ç |
| | | */ |
| | | @ApiModelProperty("é¢çå·ç ") |
| | | @Excel(name = " é¢çå·ç ") |
| | | private String reservedPhone; |
| | | |
| | | /** |
| | | * æ°æ |
| | | */ |
| | | @ApiModelProperty("æ°æ") |
| | |
| | | @Excel(name = " ææºå·ç ") |
| | | private String telcode; |
| | | |
| | | /** |
| | | * é¢çå·ç |
| | | */ |
| | | @ApiModelProperty("é¢çå·ç ") |
| | | @Excel(name = " é¢çå·ç ") |
| | | private String reservedPhone; |
| | | |
| | | /** |
| | | * 亲å±å·ç |
| | |
| | | @ApiModelProperty("ææºå·ç ") |
| | | private String telcode; |
| | | |
| | | |
| | | /** |
| | | * 亲å±å·ç |
| | | */ |
| | |
| | | private String telcode; |
| | | |
| | | /** |
| | | * é¢çå·ç |
| | | */ |
| | | @ApiModelProperty("é¢çå·ç ") |
| | | @Excel(name = " é¢çå·ç ") |
| | | private String reservedPhone; |
| | | |
| | | /** |
| | | * ææºå·ç |
| | | */ |
| | | @ApiModelProperty("ææºå·ç ") |
| | |
| | | private List<String> leaveldeptcodes; |
| | | |
| | | /** |
| | | * ç
åºç¼å· |
| | | * ç
åºç¼å·éå |
| | | */ |
| | | @ApiModelProperty(value = "ç
åºç¼å·") |
| | | @ApiModelProperty(value = "ç
åºç¼å·éå") |
| | | private List<String> hospitaldistrictcodes; |
| | | |
| | | /** |
| | |
| | | @Excel(name = " ææºå·ç ") |
| | | private String telcode; |
| | | |
| | | /** |
| | | * é¢çå·ç |
| | | */ |
| | | @ApiModelProperty("é¢çå·ç ") |
| | | @Excel(name = " é¢çå·ç ") |
| | | private String reservedPhone; |
| | | |
| | | /** |
| | | * 亲å±å·ç |
| | |
| | | */ |
| | | @ApiModelProperty("èé¾ï¼å¨ï¼") |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private Long age; |
| | | private String age; |
| | | |
| | | /** |
| | | * $column.columnComment |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æå¡ç»è®¡è¯·æ±åæ° |
| | | * |
| | | * @author smartor |
| | | * @date 2025-01-14 |
| | | */ |
| | | @ApiModel(value = "ServiceStatisticsRequest", description = "æå¡ç»è®¡è¯·æ±åæ°") |
| | | @Data |
| | | public class ServiceStatisticsRequest { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¥æ", required = true, example = "2025-08-01") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¥æ", required = true, example = "2025-08-05") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty(value = "ç»è®¡ç»´åº¦ï¼day-æå¤©, month-ææ, year-æå¹´", example = "day") |
| | | private String timeType = "day"; |
| | | |
| | | @ApiModelProperty(value = "æºæIDï¼ä¸ºç©ºåæ¥è¯¢ææ") |
| | | private String orgid; |
| | | |
| | | @ApiModelProperty(value = "ç§å®¤ç¼ç å表ï¼ä¸ºç©ºåæ¥è¯¢ææ") |
| | | private List<String> deptcodes; |
| | | |
| | | @ApiModelProperty(value = "ç
åºç¼ç å表ï¼ä¸ºç©ºåæ¥è¯¢ææ") |
| | | private List<String> leavehospitaldistrictcodes; |
| | | |
| | | @ApiModelProperty(value = "æå¡ç±»åå表ï¼ä¸ºç©ºåæ¥è¯¢ææ (2-åºé¢é访, 3-é¨è¯é访)") |
| | | private List<String> serviceTypes; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æå¡ç»è®¡ååºç»æ |
| | | * |
| | | * @author smartor |
| | | * @date 2025-01-14 |
| | | */ |
| | | @ApiModel(value = "ServiceStatisticsResponse", description = "æå¡ç»è®¡ååºç»æ") |
| | | @Data |
| | | public class ServiceStatisticsResponse { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "æ¶é´å¨æ") |
| | | @Excel(name = "æ¶é´å¨æ") |
| | | private String timePeriod; |
| | | |
| | | @ApiModelProperty(value = "åºé¢é访é") |
| | | @Excel(name = "åºé¢é访é") |
| | | private Long dischargeFollowCount = 0L; |
| | | |
| | | @ApiModelProperty(value = "é¨è¯é访é") |
| | | @Excel(name = "é¨è¯é访é") |
| | | private Long outpatientFollowCount = 0L; |
| | | |
| | | |
| | | @ApiModelProperty(value = "åºé¢äººæ¬¡") |
| | | @Excel(name = "åºé¢äººæ¬¡") |
| | | private Long pmiCount = 0L; |
| | | |
| | | @ApiModelProperty(value = "é¨è¯äººæ¬¡") |
| | | @Excel(name = "é¨è¯äººæ¬¡") |
| | | private Long pmoCount = 0L; |
| | | } |
| | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "离é¢è¯æåç§°") |
| | | private String leavediagname; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | |
| | | * åä¸ä»»å¡ï¼é访ï¼å¯¹è±¡ ivr_taskcall |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-02-02 |
| | | */ |
| | | @ApiModel(value = "ServiceSubtaskVO", description = "åä¸é访任å¡å
¥å") |
| | | @Data |
| | |
| | | * |
| | | */ |
| | | @ApiModelProperty(value = "主é®id") |
| | | private Long id; |
| | | private Long subId; |
| | | |
| | | |
| | | /** |
| | | * éè®¿æ¬¡æ° |
| | | */ |
| | | @ApiModelProperty(value = "é访次æ°") |
| | | private Integer visitCount; |
| | | |
| | | /** |
| | | * æ¯å¦å¨æ¬¡é访ï¼1å¦ 2æ¯ |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦å¨æ¬¡é访ï¼1æ¯ 2å¦") |
| | | private Integer isVisitAgain; |
| | | /** |
| | | * æ£è
ID |
| | | */ |
| | | @Excel(name = " æ£è
ID") |
| | | @ApiModelProperty(value = "æ£è
ID") |
| | | private String patguid; |
| | | |
| | | /** |
| | | * å¤è¯éç¥ï¼0å·²éç¥ 1æªéç¥ |
| | | */ |
| | | @ApiModelProperty(value = "å¤è¯éç¥ï¼0å·²éç¥ 1æªéç¥") |
| | | private Integer visitNotice; |
| | | |
| | | /** |
| | | * åºé¢è¯æåç§° |
| | | */ |
| | | @Excel(name = " åºé¢è¯æåç§°") |
| | | @ApiModelProperty(value = "åºé¢è¯æåç§°") |
| | | private String leavediagname; |
| | | |
| | | /** |
| | | * åºé¢ç
人记å½ID |
| | |
| | | /** |
| | | * å¼å§åºé¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å¼å§åºé¢æ¥æ") |
| | | private Date startOutHospTime; |
| | | |
| | | /** |
| | | * ç»æåºé¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "ç»æåºé¢æ¥æ") |
| | | private Date endOutHospTime; |
| | | |
| | | /** |
| | | * æåºï¼ï¼ |
| | | */ |
| | | @ApiModelProperty(value = "æåºï¼0 åºé¢æ¶é´(æ£åº) 1 åºé¢æ¶é´(ååº) 2 åéæ¶é´(æ£åº) 3 åéæ¶é´(ååº) ") |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * ç¬¬ä¸æ¹ä»»å¡ID |
| | | */ |
| | | @ApiModelProperty(value = "ç¬¬ä¸æ¹ä»»å¡ID") |
| | | private String taskGuid; |
| | | |
| | | |
| | | /** |
| | | * å建å¼å§æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createStartTime; |
| | | |
| | | /** |
| | | * åå»ºç»ææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createEndTime; |
| | | |
| | | |
| | | /** |
| | | * ç§å®¤ä¸ç
åºçæ¥è¯¢æ¯orè¿æ¯and: 1:and(é»è®¤) 2:or |
| | | */ |
| | | @ApiModelProperty(value = "ç§å®¤ä¸ç
åºçæ¥è¯¢æ¯orè¿æ¯and: 1:and(é»è®¤) 2:or ") |
| | | private String deptOrDistrict = "1"; |
| | | |
| | | /** |
| | | * æ£è
æ¥æº |
| | | */ |
| | | @ApiModelProperty(value = "æ£è
æ¥æºï¼0æ¬å°æ£è
表 1å¤é¨æ£è
表") |
| | | private String patfrom; |
| | | |
| | | |
| | | /** |
| | | * å¼å§å鿥æ |
| | | */ |
| | | @ApiModelProperty(value = "å¼å§å鿥æ") |
| | | private Date startSendDateTime; |
| | | |
| | | /** |
| | | * ç»æå鿥æ |
| | | */ |
| | | @ApiModelProperty(value = "ç»æå鿥æ") |
| | | private Date endSendDateTime; |
| | | |
| | | |
| | | /** |
| | | * /** |
| | | * æ£è
䏿¬¡é访çsubId |
| | | */ |
| | | @ApiModelProperty(value = "æ£è
䏿¬¡é访çsubId") |
| | | private Integer upid; |
| | | |
| | | @ApiModelProperty(value = "é访æ¶é´") |
| | | private Date visitTime; |
| | | /** |
| | | * é访æ¹å¼ |
| | | */ |
| | | @ApiModelProperty(value = "é访æ¹å¼") |
| | | private String visitType; |
| | | |
| | | @ApiModelProperty(value = "é访é¨é¨ç¼ç ") |
| | | private String visitDeptCode; |
| | | |
| | | @ApiModelProperty(value = "é访é¨é¨åç§°") |
| | | private String visitDeptName; |
| | | |
| | | @ApiModelProperty(value = "é访é¨é¨ç¼ç éå") |
| | | private List<String> visitDeptCodes; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.smartor.mapper; |
| | | package com.smartor.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.smartor.domain.SchemeAutofinshrule; |
| | | import com.smartor.domain.SchemeAutofinshrule; |
| | | |
| | | /** |
| | | * æ¹æ¡ç»æ¡è§åMapperæ¥å£ |
| | | * |
| | | * |
| | | * @author smartor |
| | | * @date 2023-03-04 |
| | | */ |
| | | public interface SchemeAutofinshruleMapper |
| | | public interface SchemeAutofinshruleMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢æ¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param id æ¹æ¡ç»æ¡è§åä¸»é® |
| | | * @return æ¹æ¡ç»æ¡è§å |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¡ç»æ¡è§åå表 |
| | | * |
| | | * |
| | | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å |
| | | * @return æ¹æ¡ç»æ¡è§åéå |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ°å¢æ¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å |
| | | * @return ç»æ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å |
| | | * @return ç»æ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å 餿¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param id æ¹æ¡ç»æ¡è§åä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ¹éå 餿¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | |
| | | package com.smartor.mapper; |
| | | |
| | | import com.smartor.domain.ServiceSubtask; |
| | | import com.smartor.domain.ServiceSubtaskCount; |
| | | import com.smartor.domain.ServiceSubtaskCountReq; |
| | | import com.smartor.domain.ServiceSubtaskVO; |
| | | import com.smartor.domain.*; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | |
| | | public List<ServiceSubtask> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | public List<ServiceStatisticsResponse> getServiceStatistics(ServiceStatisticsRequest serviceStatisticsRequest); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.smartor.service; |
| | | package com.smartor.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.smartor.domain.SchemeAutofinshrule; |
| | | |
| | | /** |
| | | * æ¹æ¡ç»æ¡è§åServiceæ¥å£ |
| | | * |
| | | * |
| | | * @author smartor |
| | | * @date 2023-03-04 |
| | | */ |
| | | public interface ISchemeAutofinshruleService |
| | | public interface ISchemeAutofinshruleService |
| | | { |
| | | /** |
| | | * æ¥è¯¢æ¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param id æ¹æ¡ç»æ¡è§åä¸»é® |
| | | * @return æ¹æ¡ç»æ¡è§å |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¡ç»æ¡è§åå表 |
| | | * |
| | | * |
| | | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å |
| | | * @return æ¹æ¡ç»æ¡è§åéå |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ°å¢æ¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å |
| | | * @return ç»æ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å |
| | | * @return ç»æ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ¹éå 餿¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param ids éè¦å é¤çæ¹æ¡ç»æ¡è§å主é®éå |
| | | * @return ç»æ |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å 餿¹æ¡ç»æ¡è§åä¿¡æ¯ |
| | | * |
| | | * |
| | | * @param id æ¹æ¡ç»æ¡è§åä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | |
| | | package com.smartor.service; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.ServiceSubtask; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | /** |
| | | * è·åé访ç»è®¡æ¯ä¾ |
| | | * |
| | | * @param serviceSubtaskCountReq |
| | | * @return |
| | | */ |
| | | public List<ServiceSubtaskStatistic> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | public List<ServiceStatisticsResponse> getServiceStatistics(ServiceStatisticsRequest request); |
| | | |
| | | } |
| | |
| | | public Boolean getExternalLeaveHospPatientInfo30Day() { |
| | | try { |
| | | // åºå®å¼å§æ¶é´ |
| | | String fixedStartTime = "2025-03-25"; |
| | | // String fixedStartTime = "2025-03-25"; |
| | | String fixedStartTime = "2025-02-01"; |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String today = formatter.format(new Date()); |
| | | |
| | |
| | | |
| | | try { |
| | | startCal.setTime(formatter.parse(fixedStartTime)); |
| | | endCal.setTime(formatter.parse(today)); |
| | | endCal.setTime(formatter.parse("2025-06-08")); |
| | | // endCal.setTime(formatter.parse(today)); |
| | | } catch (ParseException e) { |
| | | log.error("æ¥æè§£æå¤±è´¥ï¼{}", e.getMessage(), e); |
| | | return false; |
| | |
| | | @Autowired |
| | | private IvrLibaTemplateScriptMapper ivrLibaTemplateScriptMapper; |
| | | |
| | | @Autowired |
| | | private TemplateDeptMapper tempDetpRelevanceMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¨¡æ¿åº |
| | |
| | | IvrLibaTemplateScript ivrLibaTemplateScript = scriptHandle(ivrLibaTemplate, ivrLibaTemplateScriptVO, ivrLibaTemplateVO.getIsoperation()); |
| | | // dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(), ivrLibaTemplateVO.getIsoperation()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //对ç§å®¤è¿è¡å¤ç |
| | | for (TemplateDept tempDetpRelevance : ivrLibaTemplateVO.getTempDetpRelevances()) { |
| | | if (tempDetpRelevance.getId() == null) { |
| | | //æ°å¢ |
| | | tempDetpRelevance.setTempid(ivrLibaTemplate.getId()); |
| | | tempDetpRelevance.setType(2L); |
| | | tempDetpRelevance.setCreateTime(new Date()); |
| | | tempDetpRelevanceMapper.insertTemplateDept(tempDetpRelevance); |
| | | } else { |
| | | tempDetpRelevance.setUpdateTime(new Date()); |
| | | tempDetpRelevanceMapper.updateTemplateDept(tempDetpRelevance); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.smartor.mapper.IvrTaskTemplateMapper; |
| | | import com.smartor.mapper.IvrTaskTemplateScriptMapper; |
| | | import com.smartor.mapper.IvrTaskTemplateTargetoptionMapper; |
| | | import com.smartor.mapper.TemplateDeptMapper; |
| | | import com.smartor.service.IIvrTaskTemplateService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | |
| | | @Autowired |
| | | private IvrTaskTemplateTargetoptionMapper ivrTaskTemplateTargetoptionMapper; |
| | | |
| | | @Autowired |
| | | private TemplateDeptMapper templateDeptMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢é访任å¡é访模æ¿åº |
| | |
| | | */ |
| | | @Override |
| | | public int deleteIvrTaskTemplateByIDs(Long[] IDs) { |
| | | if (IDs[0] != null) { |
| | | IvrTaskTemplate ivrTaskTemplate = selectIvrTaskTemplateByID(IDs[0]); |
| | | if (StringUtils.isNotEmpty(ivrTaskTemplate.getLongTemp()) && ivrTaskTemplate.getLongTemp().equals("1")) { |
| | | //妿è¿ä¸ªæ¨¡æ¿æ¯é¿æä»»å¡ï¼åéè¦å 餿¨¡æ¿ä¸é¨é¨çå
³è |
| | | TemplateDept templateDept = new TemplateDept(); |
| | | templateDept.setType(21L); |
| | | templateDept.setTempid(IDs[0]); |
| | | templateDeptMapper.deleteTemplateDeptByTemplateId(templateDept); |
| | | } |
| | | } |
| | | |
| | | return ivrTaskTemplateMapper.deleteIvrTaskTemplateByIDs(IDs); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public PatMedRes selectPatMedInhospListCount(PatMedReq patMedReq) { |
| | | PatMedRes patMedRes = null; |
| | | // è·åå½åç»é人çé¨é¨æé |
| | | if (org.springframework.util.CollectionUtils.isEmpty(patMedReq.getDeptcodeList())) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(userId); |
| | | List<String> deptCode = new ArrayList<>(); |
| | | for (SysDept sysDept : sysDepts) { |
| | | deptCode.add(sysDept.getDeptId().toString()); |
| | | } |
| | | patMedReq.setDeptcodeList(deptCode); |
| | | patMedRes = patMedInhospMapper.selectPatMedInhospCount(patMedReq); |
| | | } |
| | | // // è·åå½åç»é人çé¨é¨æé |
| | | // if (org.springframework.util.CollectionUtils.isEmpty(patMedReq.getDeptcodeList())) { |
| | | // Long userId = SecurityUtils.getUserId(); |
| | | // List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(userId); |
| | | // List<String> deptCode = new ArrayList<>(); |
| | | // for (SysDept sysDept : sysDepts) { |
| | | // deptCode.add(sysDept.getDeptId().toString()); |
| | | // } |
| | | // patMedReq.setDeptcodeList(deptCode); |
| | | // } |
| | | patMedRes = patMedInhospMapper.selectPatMedInhospCount(patMedReq); |
| | | return patMedRes; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public PatMedRes selectPatMedOuthospCount(PatMedReq patMedReq) { |
| | | // è·åå½åç»é人çé¨é¨æé |
| | | if (CollectionUtils.isEmpty(patMedReq.getDeptcodeList())) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(userId); |
| | | List<String> deptCode = new ArrayList<>(); |
| | | for (SysDept sysDept : sysDepts) { |
| | | deptCode.add(sysDept.getDeptId().toString()); |
| | | } |
| | | patMedReq.setDeptcodeList(deptCode); |
| | | } |
| | | // if (CollectionUtils.isEmpty(patMedReq.getDeptcodeList())) { |
| | | // Long userId = SecurityUtils.getUserId(); |
| | | // List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(userId); |
| | | // List<String> deptCode = new ArrayList<>(); |
| | | // for (SysDept sysDept : sysDepts) { |
| | | // deptCode.add(sysDept.getDeptId().toString()); |
| | | // } |
| | | // patMedReq.setDeptcodeList(deptCode); |
| | | // } |
| | | return patMedOuthospMapper.selectPatMedOuthospCount(patMedReq); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.smartor.service.impl; |
| | | package com.smartor.service.impl; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.smartor.domain.SchemeAutofinshrule; |
| | | import com.smartor.mapper.SchemeAutofinshruleMapper; |
| | | import com.smartor.service.ISchemeAutofinshruleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.smartor.mapper.SchemeAutofinshruleMapper; |
| | | import com.ruoyi.smartor.domain.SchemeAutofinshrule; |
| | | import com.ruoyi.smartor.service.ISchemeAutofinshruleService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¹æ¡ç»æ¡è§åServiceä¸å¡å±å¤ç |
| | | * |
| | | * |
| | | * @author smartor |
| | | * @date 2023-03-04 |
| | | */ |
| | | @Service |
| | | public class SchemeAutofinshruleServiceImpl implements ISchemeAutofinshruleService |
| | | { |
| | | public class SchemeAutofinshruleServiceImpl implements ISchemeAutofinshruleService { |
| | | @Autowired |
| | | private SchemeAutofinshruleMapper schemeAutofinshruleMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param id æ¹æ¡ç»æ¡è§åä¸»é® |
| | | * @return æ¹æ¡ç»æ¡è§å |
| | | */ |
| | | @Override |
| | | public SchemeAutofinshrule selectSchemeAutofinshruleById(Long id) |
| | | { |
| | | public SchemeAutofinshrule selectSchemeAutofinshruleById(Long id) { |
| | | return schemeAutofinshruleMapper.selectSchemeAutofinshruleById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¡ç»æ¡è§åå表 |
| | | * |
| | | * |
| | | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å |
| | | * @return æ¹æ¡ç»æ¡è§å |
| | | */ |
| | | @Override |
| | | public List<SchemeAutofinshrule> selectSchemeAutofinshruleList(SchemeAutofinshrule schemeAutofinshrule) |
| | | { |
| | | public List<SchemeAutofinshrule> selectSchemeAutofinshruleList(SchemeAutofinshrule schemeAutofinshrule) { |
| | | return schemeAutofinshruleMapper.selectSchemeAutofinshruleList(schemeAutofinshrule); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertSchemeAutofinshrule(SchemeAutofinshrule schemeAutofinshrule) |
| | | { |
| | | public int insertSchemeAutofinshrule(SchemeAutofinshrule schemeAutofinshrule) { |
| | | schemeAutofinshrule.setCreateTime(DateUtils.getNowDate()); |
| | | return schemeAutofinshruleMapper.insertSchemeAutofinshrule(schemeAutofinshrule); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateSchemeAutofinshrule(SchemeAutofinshrule schemeAutofinshrule) |
| | | { |
| | | public int updateSchemeAutofinshrule(SchemeAutofinshrule schemeAutofinshrule) { |
| | | schemeAutofinshrule.setUpdateTime(DateUtils.getNowDate()); |
| | | return schemeAutofinshruleMapper.updateSchemeAutofinshrule(schemeAutofinshrule); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå 餿¹æ¡ç»æ¡è§å |
| | | * |
| | | * |
| | | * @param ids éè¦å é¤çæ¹æ¡ç»æ¡è§åä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteSchemeAutofinshruleByIds(Long[] ids) |
| | | { |
| | | public int deleteSchemeAutofinshruleByIds(Long[] ids) { |
| | | return schemeAutofinshruleMapper.deleteSchemeAutofinshruleByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å 餿¹æ¡ç»æ¡è§åä¿¡æ¯ |
| | | * |
| | | * |
| | | * @param id æ¹æ¡ç»æ¡è§åä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteSchemeAutofinshruleById(Long id) |
| | | { |
| | | public int deleteSchemeAutofinshruleById(Long id) { |
| | | return schemeAutofinshruleMapper.deleteSchemeAutofinshruleById(id); |
| | | } |
| | | } |
| | |
| | | return serviceSubtaskStatistics; |
| | | } |
| | | |
| | | /** |
| | | * æå¡ç»è®¡æ¥è¯¢ - ææ¶é´ç»´åº¦ç»è®¡åºé¢/é¨è¯éè®¿æ°æ® |
| | | * |
| | | * @param request ç»è®¡è¯·æ±åæ° |
| | | * @return ç»è®¡ç»æå表 |
| | | */ |
| | | @Override |
| | | public List<ServiceStatisticsResponse> getServiceStatistics(ServiceStatisticsRequest request) { |
| | | log.info("getServiceStatisticsçå
¥å为ï¼{}", request); |
| | | |
| | | // åæ°æ ¡éª |
| | | if (request.getStartDate() == null || request.getEndDate() == null) { |
| | | throw new IllegalArgumentException("å¼å§æ¥æåç»ææ¥æä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | if (request.getStartDate().after(request.getEndDate())) { |
| | | throw new IllegalArgumentException("å¼å§æ¥æä¸è½æäºç»ææ¥æ"); |
| | | } |
| | | |
| | | // 妿timeType为空ï¼é»è®¤æå¤©ç»è®¡ |
| | | if (com.ruoyi.common.utils.StringUtils.isEmpty(request.getTimeType())) { |
| | | request.setTimeType("day"); |
| | | } |
| | | |
| | | List<ServiceStatisticsResponse> result = serviceSubtaskMapper.getServiceStatistics(request); |
| | | |
| | | |
| | | log.info("getServiceStatisticsè¿åç»ææ°éï¼{}", result.size()); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | private ServiceSubtaskStatistic getStatistic(List<ServiceSubtask> serviceSubtaskList) { |
| | | log.error("-------------serviceSubtaskListçå¼ä¸ºï¼{}", serviceSubtaskList); |
| | | ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); |
| | |
| | | info = wjInfo(serviceTask, patid, isFinish); |
| | | } else { |
| | | //宣æ |
| | | info = xjInfo(Long.valueOf(serviceTask.getLibtemplateid()), taskid, patid, isFinish); |
| | | info = xjInfo(Long.valueOf(serviceTask.getTemplateid()), taskid, patid, isFinish); |
| | | } |
| | | |
| | | SvyTaskTemplate svyTaskTemplate = svyTaskTemplateMapper.selectSvyTaskTemplateBySvyid(serviceTask.getTemplateid()); |
| | |
| | | @Autowired |
| | | private SvyLibTemplateTargetoptionMapper svyLibTemplateTargetoptionMapper; |
| | | @Autowired |
| | | private TemplateDeptMapper templateDeptMapper; |
| | | @Autowired |
| | | private SvyLibTemplateTagMapper svyLibTemplateTagMapper; |
| | | @Autowired |
| | | private Icd10AssociationMapper icd10AssociationMapper; |
| | |
| | | //å°é¢ç®æ¾å°é®å·åè¡¨ä¸ |
| | | svyLibTemplateVOS.get(i).setSvyTemplateLibScripts(svyLibTemplateScripts); |
| | | |
| | | //è·åæ¯ä¸ªé®å·å¯¹åºçç§å®¤ |
| | | TemplateDept templateDept = new TemplateDept(); |
| | | templateDept.setTempid(svyLibTemplateVOS.get(i).getSvyid()); |
| | | List<TemplateDept> tempDetpRelevances = templateDeptMapper.selectTemplateDeptList(templateDept); |
| | | svyLibTemplateVOS.get(i).setTempDetpRelevances(CollectionUtils.isNotEmpty(tempDetpRelevances) ? tempDetpRelevances : new ArrayList<>()); |
| | | |
| | | //è·åæ ç¾ |
| | | SvyLibTemplateTag svyLibTemplateTag = new SvyLibTemplateTag(); |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(svyLibTemplate.getTempDetpRelevances())) { |
| | | for (TemplateDept tempDetpRelevance : svyLibTemplate.getTempDetpRelevances()) { |
| | | if (tempDetpRelevance.getId() == null) { |
| | | //æ°å¢ |
| | | tempDetpRelevance.setTempid(svyLibTemplate.getSvyid()); |
| | | tempDetpRelevance.setType(1L); |
| | | templateDeptMapper.insertTemplateDept(tempDetpRelevance); |
| | | } else { |
| | | templateDeptMapper.updateTemplateDept(tempDetpRelevance); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //æ ç¾å¤ç |
| | |
| | | DWMC, |
| | | RYRQ, |
| | | SFZH, |
| | | YLDH, |
| | | JDR |
| | | from HIT.HF_RYJDXX |
| | | </sql> |
| | |
| | | <result property="medicareType" column="medicare_type"/> |
| | | <result property="carePerson" column="care_person"/> |
| | | <result property="casePersonAge" column="case_person_age"/> |
| | | <result property="reservedPhone" column="reserved_phone"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/> |
| | | <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/> |
| | | <result property="admitdate" column="admitdate"/> |
| | | <result property="reservedPhone" column="reserved_phone"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectPatArchiveVo"> |
| | |
| | | archivetime, |
| | | archiveby, |
| | | telcode, |
| | | reserved_phone, |
| | | relativetelcode, |
| | | idcardtype, |
| | | orgid, |
| | |
| | | <if test="medicareType != null ">and medicare_type = #{medicareType}</if> |
| | | <if test="carePerson != null ">and care_person = #{carePerson}</if> |
| | | <if test="casePersonAge != null ">and case_person_age = #{casePersonAge}</if> |
| | | <if test="reservedPhone != null ">and reserved_phone = #{reservedPhone}</if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | a.income, |
| | | a.medicare_type, |
| | | a.care_person, |
| | | a.reserved_phone, |
| | | a.case_person_age |
| | | from pat_archive a,pat_archivetag b ,base_tag c |
| | | <where> |
| | | a.del_flag=0 and |
| | | a.id = b.patid and b.tagid = c.tagid |
| | | <if test="reservedPhone != null ">and reserved_phone = #{reservedPhone}</if> |
| | | <if test="name != null and name != ''">and a.name like concat('%', #{name}, '%')</if> |
| | | <if test="idcardno != null and idcardno != ''">and idcardno = #{idcardno}</if> |
| | | <if test="telcode != null and telcode != ''">and telcode = #{telcode}</if> |
| | |
| | | <if test="medicareType != null ">medicare_type,</if> |
| | | <if test="carePerson != null ">care_person,</if> |
| | | <if test="casePersonAge != null ">case_person_age,</if> |
| | | <if test="reservedPhone != null ">reserved_phone,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="patientno != null">#{patientno},</if> |
| | |
| | | <if test="medicareType != null ">#{medicareType},</if> |
| | | <if test="carePerson != null ">#{carePerson},</if> |
| | | <if test="casePersonAge != null ">#{casePersonAge},</if> |
| | | <if test="reservedPhone != null ">#{reservedPhone},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | insert into |
| | | pat_archive(name,viptype,sex,idcardno,birthdate,place_of_residence,age,age2,sourcefrom,archivetime,archiveby,telcode,relativetelcode,idcardtype,orgid,openid,dduserid,update_by,update_time |
| | | ,create_by,create_time,isupload,upload_time,pattype,nation,birthplace,native_place,patientno,patid_his,sd_flag,age_unit,age_unit2,notrequired_flag,notrequiredreason,care_facilities,case_path, |
| | | degree_of_education,marital_status,income,medicare_type,care_person,case_person_age) |
| | | degree_of_education,marital_status,income,medicare_type,care_person,case_person_age,reserved_phone) |
| | | values |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | (#{item.name},#{item.viptype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.placeOfResidence},#{item.age},#{item.age2},#{item.sourcefrom},#{item.archivetime},#{item.archiveby} |
| | | ,#{item.telcode},#{item.archiveby},#{item.idcardtype},#{item.orgid},#{item.openid},#{item.dduserid},#{item.updateBy}, |
| | | #{item.updateTime},#{item.createBy},#{item.createTime},#{item.isupload},#{item.uploadTime},#{item.pattype},#{item.nation},#{item.birthplace},#{item.nativePlace},#{item.patientno}, |
| | | #{item.patidHis},#{item.sdFlag},#{item.ageUnit},#{item.ageUnit2},#{item.notrequiredFlag},#{item.notrequiredreason} |
| | | ,#{item.careFacilities},#{item.casePath},#{item.degreeOfEducation},#{item.maritalStatus},#{item.income},#{item.medicareType},#{item.carePerson},#{item.casePersonAge}) |
| | | ,#{item.careFacilities},#{item.casePath},#{item.degreeOfEducation},#{item.maritalStatus},#{item.income},#{item.medicareType},#{item.carePerson},#{item.casePersonAge},#{item.reservedPhone}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | |
| | | <if test="isupload != null">isupload = #{isupload},</if> |
| | | <if test="uploadTime != null">upload_time = #{uploadTime},</if> |
| | | <if test="viptype != null">viptype = #{viptype},</if> |
| | | <if test="viptype != null">patientno = #{patientno},</if> |
| | | <if test="viptype != null">patid_his = #{patidHis},</if> |
| | | <if test="viptype != null">sd_flag = #{sdFlag},</if> |
| | | <if test="patientno != null">patientno = #{patientno},</if> |
| | | <if test="patidHis != null">patid_his = #{patidHis},</if> |
| | | <if test="sdFlag != null">sd_flag = #{sdFlag},</if> |
| | | <if test="ageUnit != null">age_unit = #{ageUnit},</if> |
| | | <if test="ageUnit2 != null">age_unit2 = #{ageUnit2},</if> |
| | | <if test="notrequiredFlag != null ">notrequired_flag = #{notrequiredFlag},</if> |
| | |
| | | <if test="medicareType != null ">medicare_type = #{medicareType},</if> |
| | | <if test="carePerson != null ">care_person = #{carePerson},</if> |
| | | <if test="casePersonAge != null ">case_person_age = #{casePersonAge},</if> |
| | | <if test="reservedPhone != null ">reserved_phone = #{reservedPhone},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | a.upload_time, |
| | | a.viptype, |
| | | a.pattype, |
| | | a.reserved_phone, |
| | | COALESCE(( |
| | | SELECT string_agg(d.tagname, ', ') |
| | | FROM pat_archivetag d |
| | |
| | | LEFT JOIN pat_archivetag b ON a.id = b.patid AND b.del_flag = 0 |
| | | <where> |
| | | a.del_flag = 0 |
| | | <if test="reservedPhone != null ">and a.reserved_phone = #{reservedPhone}</if> |
| | | <if test="name != null and name != ''">and a.name like concat('%', #{name}, '%')</if> |
| | | <if test="tagname != null and tagname != ''">and b.tagname like concat('%', #{tagname}, '%')</if> |
| | | <if test="idcardno != null and idcardno != ''">and a.idcardno = #{idcardno}</if> |
| | |
| | | a.create_by, |
| | | a.create_time, |
| | | a.isupload, |
| | | a.reserved_phone, |
| | | a.upload_time, |
| | | a.pattype, |
| | | d.bed_no, |
| | |
| | | pat_med_inhosp d |
| | | JOIN pat_archive a ON a.id = d.patid |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | ) t ON t.patid = d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | | AND a.del_flag != 1 |
| | | <if test="reservedPhone != null ">and a.reserved_phone = #{reservedPhone}</if> |
| | | <if test="name != null and name != ''">and a.name like concat('%', #{name}, '%')</if> |
| | | <if test="tagname != null and tagname != ''">and t.tagname like concat('%', #{tagname}, '%')</if> |
| | | <if test="idcardno != null and idcardno != ''">and a.idcardno = #{idcardno}</if> |
| | |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size()>0"> |
| | | <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size()>0 and deptcodes == null "> |
| | | AND d.hospitaldistrictcode IN |
| | | <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator="," |
| | | close=")"> |
| | | #{hospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="deptcodes != null and deptcodes.size() > 0"> |
| | | |
| | | <if test="deptcodes != null and deptcodes.size() > 0 and hospitaldistrictcodes == null"> |
| | | AND d.deptcode IN |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," |
| | | close=")"> |
| | |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size()>0 and deptcodes != null "> |
| | | AND (d.hospitaldistrictcode IN |
| | | <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator="," |
| | | close=")"> |
| | | #{hospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="hospitaldistrictcodes != null and deptcodes != null and deptcodes.size() > 0"> |
| | | OR d.deptcode IN |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," |
| | | close="))"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="patids != null"> |
| | | AND a.id NOT IN |
| | |
| | | a.create_time, |
| | | a.isupload, |
| | | a.upload_time, |
| | | d.leavehospitaldistrictcode AS leavehospitaldistrictcode, |
| | | d.leavehospitaldistrictname AS leavehospitaldistrictname, |
| | | a.reserved_phone, |
| | | COALESCE(( |
| | | SELECT string_agg(dd.tagname, ', ') |
| | | FROM pat_archivetag dd |
| | |
| | | <where> |
| | | d.del_flag != 1 |
| | | AND a.del_flag != 1 |
| | | <if test="reservedPhone != null ">and a.reserved_phone = #{reservedPhone}</if> |
| | | <if test="patid != null and patid != ''">and a.id = #{patid}</if> |
| | | <if test="tagname != null and tagname != ''">and t.tagname like concat('%', #{tagname}, '%')</if> |
| | | <if test="name != null and name != ''">and a.name like concat('%', #{name}, '%')</if> |
| | |
| | | a.create_time, |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.reserved_phone, |
| | | COALESCE(( |
| | | SELECT string_agg(dd.tagname, ', ') |
| | | FROM pat_archivetag dd |
| | |
| | | <where> |
| | | d.del_flag != 1 |
| | | AND a.del_flag != 1 |
| | | <if test="reservedPhone != null ">and a.reserved_phone = #{reservedPhone}</if> |
| | | <if test="patid != null and patid != ''">and a.id = #{patid}</if> |
| | | <if test="tagname != null and tagname != ''">and t.tagname like concat('%', #{tagname}, '%')</if> |
| | | <if test="name != null and name != ''">and a.name like concat('%', #{name}, '%')</if> |
| | |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.pattype, |
| | | a.reserved_phone, |
| | | d.bed_no, |
| | | d.starttime, |
| | | d.endtime, |
| | |
| | | <where> |
| | | d.del_flag != 1 |
| | | AND a.del_flag != 1 |
| | | <if test="reservedPhone != null ">and a.reserved_phone = #{reservedPhone}</if> |
| | | <if test="name != null and name != ''">AND a.name LIKE concat('%', #{name}, '%')</if> |
| | | <if test="idcardno != null and idcardno != ''">AND a.idcardno = #{idcardno}</if> |
| | | <if test="tagname != null and tagname != ''"> |
| | |
| | | <if test="deptname != null and deptname != ''">AND d.deptname LIKE concat('%', #{deptname}, '%')</if> |
| | | <if test="drname != null and drname != ''">AND d.drname LIKE concat('%',#{drname}, '%')</if> |
| | | <if test="diagname != null and diagname != ''">AND d.diagname LIKE concat('%',#{diagname}, '%')</if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0"> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0 and leaveldeptcodes == null"> |
| | | AND d.leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0 and leaveldeptcodes != null and leaveldeptcodes.size() > 0"> |
| | | AND (d.leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | |
| | | </if> |
| | | <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0 and leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0"> |
| | | OR d.leaveldeptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," close=")"> |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," close="))"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | |
| | | a.create_by, |
| | | a.create_time, |
| | | a.isupload, |
| | | a.reserved_phone, |
| | | a.upload_time, |
| | | rt.tagname, |
| | | ROW_NUMBER() OVER (PARTITION BY a.idcardno ORDER BY a.update_time DESC) AS rn, |
| | |
| | | AND a.del_flag != 1 |
| | | AND d.admitdate >= CURRENT_DATE - INTERVAL '90 days' <!-- å¼ºçæ¨èå æ¶é´éå¶ --> |
| | | <if test="patid != null and patid != ''">AND a.id = #{patid}</if> |
| | | <if test="reservedPhone != null ">and a.reserved_phone = #{reservedPhone}</if> |
| | | <if test="tagname != null and tagname != ''">AND rt.tagname LIKE concat('%', #{tagname}, '%')</if> |
| | | <if test="name != null and name != ''">AND a.name LIKE concat('%', #{name}, '%')</if> |
| | | <if test="idcardno != null and idcardno != ''">AND a.idcardno = #{idcardno}</if> |
| | |
| | | a.create_time, |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.reserved_phone, |
| | | COALESCE(( |
| | | SELECT string_agg(dd.tagname, ', ') |
| | | FROM pat_archivetag dd |
| | |
| | | <where> |
| | | d.del_flag != 1 |
| | | AND a.del_flag != 1 |
| | | <if test="reservedPhone != null ">and a.reserved_phone = #{reservedPhone}</if> |
| | | <if test="patid != null and patid != ''">and a.id = #{patid}</if> |
| | | <if test="tagname != null and tagname != ''">and t.tagname like concat('%', #{tagname}, '%')</if> |
| | | <if test="name != null and name != ''">and a.name like concat('%', #{name}, '%')</if> |
| | |
| | | </select> |
| | | <select id="selectPatMedInhospCount" parameterType="com.smartor.domain.PatMedReq" |
| | | resultType="com.smartor.domain.PatMedRes"> |
| | | SELECT SUM( rs ) AS rs, |
| | | SUM( rc ) AS rc |
| | | FROM ( |
| | | SELECT |
| | | COUNT(1) AS rc, |
| | | COUNT(DISTINCT patid) AS rs |
| | | 0 AS rs |
| | | FROM |
| | | pat_med_inhosp |
| | | <where> |
| | | del_flag=0 |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="zy != null"> |
| | | and inhospstate=0 |
| | | and TO_DATE(starttime,'YYYY-MM-DD') >= TO_DATE(#{startDate},'YYYY-MM-DD') |
| | | and TO_DATE(starttime,'YYYY-MM-DD') <= TO_DATE(#{endDate},'YYYY-MM-DD') |
| | | and starttime >= #{startDate} |
| | | and starttime >= #{endDate} |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <if test="cy != null"> |
| | | and inhospstate=1 |
| | | and TO_DATE(endtime,'YYYY-MM-DD') >= TO_DATE(#{startDate},'YYYY-MM-DD') |
| | | and TO_DATE(endtime,'YYYY-MM-DD') <= TO_DATE(#{endDate},'YYYY-MM-DD') |
| | | and endtime >= #{startDate} |
| | | and endtime <= #{endDate} |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and leaveldeptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <if test="deptcodeList != null"> |
| | | |
| | | </where> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | | count(1) AS rs |
| | | FROM |
| | | service_subtask |
| | | <where> |
| | | del_flag = 0 |
| | | and service_type=2 |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | and visit_time >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null"> |
| | | and visit_time <= #{endDate} |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ) AS combined_data |
| | | |
| | | </select> |
| | | |
| | | <select id="selectEndtimeMax" resultType="java.util.Date"> |
| | |
| | | |
| | | <select id="selectPatMedOuthospCount" parameterType="com.smartor.domain.PatMedReq" |
| | | resultType="com.smartor.domain.PatMedRes"> |
| | | |
| | | SELECT SUM( rs ) AS rs, |
| | | SUM( rc ) AS rc |
| | | FROM ( |
| | | SELECT |
| | | COUNT(id) AS rc, |
| | | COUNT(DISTINCT patid) AS rs |
| | | 0 AS rs |
| | | FROM |
| | | pat_med_outhosp |
| | | <where> |
| | | del_flag=0 |
| | | and TO_DATE(admitdate,'YYYY-MM-DD') >= TO_DATE(#{startDate},'YYYY-MM-DD') |
| | | and TO_DATE(admitdate,'YYYY-MM-DD') <= TO_DATE(#{endDate},'YYYY-MM-DD') |
| | | <if test="deptcodeList != null"> |
| | | <if test="orgid != null"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | and admitdate >= #{startDate} |
| | | and admitdate <= #{endDate} |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | | count(1) AS rs |
| | | FROM |
| | | service_subtask |
| | | <where> |
| | | del_flag = 0 |
| | | and service_type=3 |
| | | <if test="orgid != null"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | and visit_time >=#{startDate} |
| | | </if> |
| | | <if test="endDate != null"> |
| | | and visit_time <= #{endDate} |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ) AS combined_data |
| | | </select> |
| | | |
| | | <select id="selectAdmitdateMax" resultType="java.util.Date"> |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.smartor.mapper.SchemeAutofinshruleMapper"> |
| | | |
| | | <resultMap type="SchemeAutofinshrule" id="SchemeAutofinshruleResult"> |
| | | <mapper namespace="com.smartor.mapper.SchemeAutofinshruleMapper"> |
| | | |
| | | <resultMap type="com.smartor.domain.SchemeAutofinshrule" id="SchemeAutofinshruleResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="schemeid" column="schemeid" /> |
| | | <result property="ruletype" column="ruletype" /> |
| | |
| | | select id, schemeid, ruletype, rulevalue, orgid, del_flag, create_by, create_time, update_by, update_time, isupload, upload_time from scheme_autofinshrule |
| | | </sql> |
| | | |
| | | <select id="selectSchemeAutofinshruleList" parameterType="SchemeAutofinshrule" resultMap="SchemeAutofinshruleResult"> |
| | | <select id="selectSchemeAutofinshruleList" parameterType="com.smartor.domain.SchemeAutofinshrule" resultMap="SchemeAutofinshruleResult"> |
| | | <include refid="selectSchemeAutofinshruleVo"/> |
| | | <where> |
| | | <where> |
| | | <if test="schemeid != null "> and schemeid = #{schemeid}</if> |
| | | <if test="ruletype != null "> and ruletype = #{ruletype}</if> |
| | | <if test="rulevalue != null and rulevalue != ''"> and rulevalue = #{rulevalue}</if> |
| | | <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectSchemeAutofinshruleById" parameterType="Long" resultMap="SchemeAutofinshruleResult"> |
| | | <include refid="selectSchemeAutofinshruleVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertSchemeAutofinshrule" parameterType="SchemeAutofinshrule" useGeneratedKeys="true" keyProperty="id"> |
| | | |
| | | <insert id="insertSchemeAutofinshrule" parameterType="com.smartor.domain.SchemeAutofinshrule" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into scheme_autofinshrule |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="schemeid != null">schemeid,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateSchemeAutofinshrule" parameterType="SchemeAutofinshrule"> |
| | | <update id="updateSchemeAutofinshrule" parameterType="com.smartor.domain.SchemeAutofinshrule"> |
| | | update scheme_autofinshrule |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="schemeid != null">schemeid = #{schemeid},</if> |
| | |
| | | </delete> |
| | | |
| | | <delete id="deleteSchemeAutofinshruleByIds" parameterType="String"> |
| | | delete from scheme_autofinshrule where id in |
| | | delete from scheme_autofinshrule where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| | | </mapper> |
| | |
| | | <result property="sendstate" column="sendstate"/> |
| | | <result property="tagname" column="tagname"/> |
| | | <result property="visitTime" column="visit_time"/> |
| | | <result property="leavediagname" column="leavediagname"/> |
| | | </resultMap> |
| | | |
| | | <resultMap type="com.smartor.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2"> |
| | |
| | | recordid, |
| | | exrecallcount, |
| | | pulltime, |
| | | leavediagname, |
| | | deptcode, |
| | | labelstatus, |
| | | del_flag, |
| | |
| | | |
| | | <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtaskVO" |
| | | resultMap="ServiceSubtaskResult"> |
| | | select a.id, |
| | | a.hosp_type, |
| | | a.suggest, |
| | | a.sendstate, |
| | | a.endtime, |
| | | a.nurse_id, |
| | | a.nurse_name, |
| | | a.starttime, |
| | | a.submit, |
| | | a.inhospid, |
| | | a.drname, |
| | | a.excep, |
| | | a.drcode, |
| | | a.long_send_time, |
| | | a.openid, |
| | | a.remark, |
| | | a.service_type, |
| | | a.libtemplateid, |
| | | a.libtemplatename, |
| | | a.hospno, |
| | | a.score, |
| | | a.phone, |
| | | a.sex, |
| | | a.age, |
| | | a.patid, |
| | | a.sfzh, |
| | | a.addr, |
| | | a.senderdetail, |
| | | a.type, |
| | | a.taskid, |
| | | a.templateid, |
| | | a.templatename, |
| | | a.senddate, |
| | | a.senduuid, |
| | | a.result, |
| | | a.finishtime, |
| | | a.recordid, |
| | | a.exrecallcount, |
| | | a.pulltime, |
| | | a.deptcode, |
| | | a.labelstatus, |
| | | a.del_flag, |
| | | a.update_by, |
| | | a.update_time, |
| | | a.create_by, |
| | | a.create_time, |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.orgid, |
| | | a.pid, |
| | | a.guid, |
| | | a.text_param, |
| | | a.preachform, |
| | | a.bed_no, |
| | | a.send_type, |
| | | a.task_name, |
| | | a.task_desc, |
| | | a.operator_no, |
| | | a.operator, |
| | | a.wechat, |
| | | a.sendname, |
| | | a.roomno, |
| | | a.admindate, |
| | | a.deptname, |
| | | a.stop_state, |
| | | a.visit_time, |
| | | a.leavehospitaldistrictcode, |
| | | a.leavehospitaldistrictname, |
| | | a.diagname, |
| | | COALESCE(( |
| | | SELECT string_agg(d.tagname, ', ') |
| | | FROM pat_archivetag d |
| | | WHERE d.patid = a.patid |
| | | AND d.del_flag = 0 |
| | | ), '') AS tagname |
| | | from service_subtask a |
| | | LEFT JOIN pat_archivetag c ON c.patid = a.patid |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | <where> |
| | | a.del_flag=0 |
| | | -- and c.del_flag=0 |
| | | <if test="sendname != null and sendname != ''">and a.sendname like concat('%', #{sendname}, '%')</if> |
| | | <if test="tagname != null and tagname != ''">and c.tagname like concat('%', #{tagname}, '%')</if> |
| | | del_flag=0 |
| | | <if test="sendname != null and sendname != ''">and sendname like concat('%', #{sendname}, '%')</if> |
| | | <if test="phone != null and phone != ''">and phone = #{phone}</if> |
| | | <if test="leavehospitaldistrictcode != null and leavehospitaldistrictcode != ''">and |
| | | a.leavehospitaldistrictcode = #{leavehospitaldistrictcode} |
| | | leavehospitaldistrictcode = #{leavehospitaldistrictcode} |
| | | </if> |
| | | <if test="leavehospitaldistrictname != null and leavehospitaldistrictname != ''">and |
| | | a.leavehospitaldistrictname = #{leavehospitaldistrictname} |
| | | leavehospitaldistrictname = #{leavehospitaldistrictname} |
| | | </if> |
| | | <if test="sex != null and sex != ''">and a.sex = #{sex}</if> |
| | | <if test="age != null ">and a.age = #{age}</if> |
| | | <if test="submit != null ">and a.submit = #{submit}</if> |
| | | <if test="serviceType != null ">and a.service_type = #{serviceType}</if> |
| | | <if test="patid != null ">and a.patid = #{patid}</if> |
| | | <if test="sfzh != null and sfzh != ''">and a.sfzh = #{sfzh}</if> |
| | | <if test="addr != null and addr != ''">and a.addr = #{addr}</if> |
| | | <if test="senderdetail != null and senderdetail != ''">and a.senderdetail = #{senderdetail}</if> |
| | | <if test="type != null and type != ''">and a.type = #{type}</if> |
| | | <if test="taskid != null ">and a.taskid = #{taskid}</if> |
| | | <if test="templateid != null and templateid != ''">and a.templateid = #{templateid}</if> |
| | | <if test="templatename != null and templatename != ''">and a.templatename like concat('%', #{templatename}, |
| | | <if test="leavediagname != null and leavediagname != ''">and leavediagname like concat('%', |
| | | #{leavediagname}, '%') |
| | | </if> |
| | | <if test="sex != null and sex != ''">and sex = #{sex}</if> |
| | | <if test="age != null ">and age = #{age}</if> |
| | | <if test="patguid != null ">and patguid = #{patguid}</if> |
| | | <if test="subId != null ">and id = #{subId}</if> |
| | | <if test="inhospid != null ">and inhospid = #{inhospid}</if> |
| | | <if test="submit != null ">and submit = #{submit}</if> |
| | | <if test="upid != null ">and upid = #{upid}</if> |
| | | <if test="patfrom != null ">and patfrom = #{patfrom}</if> |
| | | <if test="serviceType != null ">and service_type = #{serviceType}</if> |
| | | <if test="patid != null ">and patid = #{patid}</if> |
| | | <if test="sfzh != null and sfzh != ''">and sfzh = #{sfzh}</if> |
| | | <if test="addr != null and addr != ''">and addr = #{addr}</if> |
| | | <if test="senderdetail != null and senderdetail != ''">and senderdetail = #{senderdetail}</if> |
| | | <if test="type != null and type != ''">and type = #{type}</if> |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="templateid != null and templateid != ''">and templateid = #{templateid}</if> |
| | | <if test="templatename != null and templatename != ''">and templatename like concat('%', #{templatename}, |
| | | '%') |
| | | </if> |
| | | <if test="startOutHospTime != null"> |
| | | AND TO_DATE( a.endtime,'YYYY-MM-DD') >= TO_DATE(#{startOutHospTime},'YYYY-MM-DD') |
| | | AND to_char(endtime, 'YYMMDD') >= to_char(#{startOutHospTime}::timestamp, 'YYMMDD') |
| | | </if> |
| | | <if test="endOutHospTime != null"> |
| | | AND TO_DATE( a.endtime,'YYYY-MM-DD') <= TO_DATE(#{endOutHospTime},'YYYY-MM-DD') |
| | | AND to_char(endtime, 'YYMMDD') <= to_char(#{endOutHospTime}::timestamp, 'YYMMDD') |
| | | </if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND a.leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | <if test="startSendDateTime != null"> |
| | | AND to_char(long_send_time, 'YYMMDD') >= to_char(#{startSendDateTime}::timestamp, 'YYMMDD') |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | AND a.deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | <if test="endSendDateTime != null"> |
| | | AND to_char(long_send_time, 'YYMMDD') <= to_char(#{endSendDateTime}::timestamp, 'YYMMDD') |
| | | </if> |
| | | <if test="longSendTime != null"> |
| | | AND to_char(long_send_time, 'YYMMDD') <= to_char(#{longSendTime}::timestamp, 'YYMMDD') |
| | | </if> |
| | | <if test="deptOrDistrict==1"> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | AND deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <if test="deptOrDistrict==2"> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND (leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | OR deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close="))"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | |
| | | <if test="senddate != null ">and a.senddate = #{senddate}</if> |
| | | <if test="senduuid != null and senduuid != ''">and a.senduuid = #{senduuid}</if> |
| | | <if test="result != null and result != ''">and a.result = #{result}</if> |
| | | <if test="finishtime != null ">and a.finishtime = #{finishtime}</if> |
| | | <if test="recordid != null ">and a.recordid = #{recordid}</if> |
| | | <if test="exrecallcount != null ">and a.exrecallcount = #{exrecallcount}</if> |
| | | <if test="pulltime != null ">and a.pulltime = #{pulltime}</if> |
| | | <if test="deptcode != null and deptcode != ''">and a.deptcode = #{deptcode}</if> |
| | | <if test="deptname != null and deptname != ''">and a.deptname = #{deptname}</if> |
| | | <if test="labelstatus != null ">and a.labelstatus = #{labelstatus}</if> |
| | | <if test="isupload != null ">and a.isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and a.upload_time = #{uploadTime}</if> |
| | | <if test="orgid != null and orgid != ''">and a.orgid = #{orgid}</if> |
| | | <if test="pid != null ">and a.pid = #{pid}</if> |
| | | <if test="inhospid != null ">and a.inhospid = #{inhospid}</if> |
| | | <if test="preachform != null ">and a.preachform = #{preachform}</if> |
| | | <if test="guid != null and guid != ''">and a.guid = #{guid}</if> |
| | | <if test="textParam != null and textParam != ''">and a.text_param = #{textParam}</if> |
| | | <if test="bedNo != null">and a.bed_no = #{bedNo}</if> |
| | | <if test="sendType != null and sendType != ''">and a.send_type = #{sendType}</if> |
| | | <if test="operator != null and operator != ''">and a.operator = #{operator}</if> |
| | | <if test="operatorNo != null and operatorNo != ''">and a.operator_no = #{operatorNo}</if> |
| | | <if test="wechat != null and wechat != ''">and a.wechat = #{wechat}</if> |
| | | <if test="hospType != null and hospType != ''">and a.hosp_type = #{hospType}</if> |
| | | <if test="libtemplateid != null ">and a.libtemplateid = #{libtemplateid}</if> |
| | | <if test="libtemplatename != null ">and a.libtemplatename = #{libtemplatename}</if> |
| | | <if test="openid != null ">and a.openid = #{openid}</if> |
| | | <if test="longSendTime != null ">and a.long_send_time = #{longSendTime}</if> |
| | | <if test="sendstate != null ">and a.sendstate = #{sendstate}</if> |
| | | <if test="drname != null and drname != ''">and a.drname like concat('%', #{drname}, '%')</if> |
| | | <if test="drcode != null ">and a.drcode = #{drcode}</if> |
| | | <if test="starttime != null ">and a.starttime = #{starttime}</if> |
| | | <if test="endtime != null ">and a.endtime = #{endtime}</if> |
| | | <if test="excep != null ">and a.excep = #{excep}</if> |
| | | <if test="nurseId != null ">and a.nurse_id = #{nurseId}</if> |
| | | <if test="nurseName != null ">and a.nurse_name = #{nurseName}</if> |
| | | <if test="score != null">and a.score = #{score}</if> |
| | | <if test="remark != null">and a.remark = #{remark}</if> |
| | | <if test="suggest != null">and a.suggest = #{suggest}</if> |
| | | <if test="createBy != null">and a.create_by = #{createBy}</if> |
| | | <if test="visitTime != null">and a.visit_time = #{visitTime}</if> |
| | | <if test="senddate != null ">and senddate = #{senddate}</if> |
| | | <if test="senduuid != null and senduuid != ''">and senduuid = #{senduuid}</if> |
| | | <if test="result != null and result != ''">and result = #{result}</if> |
| | | <if test="finishtime != null ">and finishtime = #{finishtime}</if> |
| | | <if test="recordid != null ">and recordid = #{recordid}</if> |
| | | <if test="exrecallcount != null ">and exrecallcount = #{exrecallcount}</if> |
| | | <if test="pulltime != null ">and pulltime = #{pulltime}</if> |
| | | <if test="deptcode != null and deptcode != ''">and deptcode = #{deptcode}</if> |
| | | <if test="deptname != null and deptname != ''">and deptname = #{deptname}</if> |
| | | <if test="labelstatus != null ">and labelstatus = #{labelstatus}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="pid != null ">and pid = #{pid}</if> |
| | | <if test="preachform != null ">and preachform = #{preachform}</if> |
| | | <if test="guid != null and guid != ''">and guid = #{guid}</if> |
| | | <if test="textParam != null and textParam != ''">and text_param = #{textParam}</if> |
| | | <if test="bedNo != null">and bed_no = #{bedNo}</if> |
| | | <if test="sendType != null and sendType != ''">and send_type = #{sendType}</if> |
| | | <if test="operator != null and operator != ''">and operator = #{operator}</if> |
| | | <if test="operatorNo != null and operatorNo != ''">and operator_no = #{operatorNo}</if> |
| | | <if test="wechat != null and wechat != ''">and wechat = #{wechat}</if> |
| | | <if test="hospType != null and hospType != ''">and hosp_type = #{hospType}</if> |
| | | <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid}</if> |
| | | <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename}</if> |
| | | <if test="openid != null ">and openid = #{openid}</if> |
| | | <if test="longSendTime != null ">and long_send_time = #{longSendTime}</if> |
| | | <if test="sendstate != null ">and sendstate = #{sendstate}</if> |
| | | <if test="drname != null and drname != ''">and drname like concat('%', #{drname}, '%')</if> |
| | | <if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if> |
| | | <if test="drcode != null and drcode != ''">and (drcode = #{drcode}</if> |
| | | <if test="nurseId != null and nurseId != ''">or nurse_id = #{nurseId})</if> |
| | | <if test="starttime != null ">and starttime = #{starttime}</if> |
| | | <if test="endtime != null ">and endtime = #{endtime}</if> |
| | | <if test="excep != null ">and excep = #{excep}</if> |
| | | <if test="nurseName != null ">and nurse_name = #{nurseName}</if> |
| | | <if test="score != null">and score = #{score}</if> |
| | | <!-- <if test="visitCount != null">and visit_count = #{visitCount}</if>--> |
| | | <if test="visitCount != null and visitCount == 1"> |
| | | AND visit_count = 1 |
| | | </if> |
| | | <if test="visitCount != null and visitCount > 1"> |
| | | AND visit_count > 1 |
| | | </if> |
| | | <if test="remark != null">and remark = #{remark}</if> |
| | | <if test="suggest != null">and suggest = #{suggest}</if> |
| | | <if test="createBy != null">and create_by = #{createBy}</if> |
| | | <if test="taskGuid != null">and task_guid = #{taskGuid}</if> |
| | | <if test="isVisitAgain != null">and is_visit_again = #{isVisitAgain}</if> |
| | | <if test="visitTime != null">and visit_time = #{visitTime}</if> |
| | | <!--<if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> |
| | | <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if>--> |
| | | <if test="visitCount != null and visitCount > 1 and visitDeptCodes != null and visitDeptCodes.size() > 0"> |
| | | AND visit_dept_code IN |
| | | <foreach collection="visitDeptCodes" item="visitDeptCodes" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{visitDeptCodes} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY a.id, |
| | | a.hosp_type, |
| | | a.suggest, |
| | | a.sendstate, |
| | | a.endtime, |
| | | a.nurse_id, |
| | | a.nurse_name, |
| | | a.starttime, |
| | | a.submit, |
| | | a.inhospid, |
| | | a.drname, |
| | | a.excep, |
| | | a.drcode, |
| | | a.long_send_time, |
| | | a.openid, |
| | | a.remark, |
| | | a.service_type, |
| | | a.libtemplateid, |
| | | a.libtemplatename, |
| | | a.hospno, |
| | | a.score, |
| | | a.phone, |
| | | a.sex, |
| | | a.age, |
| | | a.patid, |
| | | a.sfzh, |
| | | a.addr, |
| | | a.senderdetail, |
| | | a.type, |
| | | a.taskid, |
| | | a.templateid, |
| | | a.templatename, |
| | | a.senddate, |
| | | a.visit_time, |
| | | a.senduuid, |
| | | a.result, |
| | | a.finishtime, |
| | | a.recordid, |
| | | a.exrecallcount, |
| | | a.pulltime, |
| | | a.deptcode, |
| | | a.labelstatus, |
| | | a.del_flag, |
| | | a.update_by, |
| | | a.update_time, |
| | | a.create_by, |
| | | a.create_time, |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.orgid, |
| | | a.pid, |
| | | a.guid, |
| | | a.text_param, |
| | | a.preachform, |
| | | a.bed_no, |
| | | a.send_type, |
| | | a.task_name, |
| | | a.task_desc, |
| | | a.operator_no, |
| | | a.operator, |
| | | a.wechat, |
| | | a.sendname, |
| | | a.roomno, |
| | | a.admindate, |
| | | a.deptname, |
| | | a.stop_state, |
| | | a.leavehospitaldistrictcode, |
| | | a.leavehospitaldistrictname, |
| | | a.diagname |
| | | order by a.visit_time desc |
| | | <if test="serviceType != null and serviceType != ''and serviceType != '2'and serviceType != '3'"> |
| | | ,a.long_send_time desc |
| | | </if> |
| | | <if test="serviceType != null and serviceType != ''and serviceType == '2'">,a.endtime desc</if> |
| | | <if test="serviceType != null and serviceType != ''and serviceType == '3'">,a.admindate desc</if> |
| | | <if test="sort != null and sort==0">order by endtime asc</if> |
| | | <if test="sort != null and sort==1">order by endtime desc</if> |
| | | <if test="sort != null and sort==2">order by long_send_time asc</if> |
| | | <if test="sort != null and sort==3">order by long_send_time desc</if> |
| | | <if test="sort != null and sort==5">order by admindate asc</if> |
| | | <if test="sort != null and sort==6">order by admindate desc</if> |
| | | |
| | | |
| | | <!-- order by update_time desc,id desc --> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectServiceSubtaskById" parameterType="Long" resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | |
| | | <if test="sendstate != null ">sendstate,</if> |
| | | <if test="inhospid != null ">inhospid,</if> |
| | | <if test="visitTime != null ">visit_time,</if> |
| | | <if test="leavediagname != null ">leavediagname,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="sendname != null">#{sendname},</if> |
| | |
| | | <if test="sendstate != null ">#{sendstate},</if> |
| | | <if test="inhospid != null ">#{inhospid},</if> |
| | | <if test="visitTime != null ">#{visitTime},</if> |
| | | <if test="leavediagname != null ">#{leavediagname},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="suggest != null ">suggest=#{suggest},</if> |
| | | <if test="inhospid != null ">inhospid=#{inhospid},</if> |
| | | <if test="visitTime != null ">visit_time=#{visitTime},</if> |
| | | <if test="leavediagname != null ">leavediagname=#{leavediagname},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <where> |
| | | <if test="patid != null ">patid=#{patid}</if> |
| | | <if test="taskid != null ">and taskid=#{taskid}</if> |
| | | <if test="leavediagname != null ">and leavediagname=#{leavediagname}</if> |
| | | </where> |
| | | </update> |
| | | |
| | |
| | | <if test="suggest != null ">suggest=#{suggest},</if> |
| | | <if test="inhospid != null ">inhospid=#{inhospid},</if> |
| | | <if test="visitTime != null ">visit_time=#{visitTime},</if> |
| | | <if test="leavediagname != null ">leavediagname=#{leavediagname},</if> |
| | | </trim> |
| | | where patid = #{patid} and taskid = #{taskid} |
| | | </update> |
| | |
| | | nurse_name, |
| | | remark, |
| | | visit_time, |
| | | leavediagname, |
| | | diagname |
| | | FROM service_subtask, |
| | | JSON_TABLE(send_time_slot, '$[*]' COLUMNS ( |
| | |
| | | <!-- è·åé访é¨è¯æ¯æçæ°é--> |
| | | <select id="getSfFzInfoEveryMonth" parameterType="com.smartor.domain.ServiceSubtaskCountReq" |
| | | resultMap="ServiceSubtaskResult2"> |
| | | SELECT TO_DATE(st.finishtime, '%Y-%m') AS month, |
| | | SELECT to_char(st.finishtime, 'YYYY-MM') AS month, |
| | | st.service_type as service_type, |
| | | st.id as subTaskId, |
| | | COUNT(*) AS count |
| | |
| | | WHERE |
| | | dd.user_id =#{userId} |
| | | AND st.finishtime IS NOT NULL |
| | | and TO_DATE(st.finishtime |
| | | , '%Y-%m') >= #{startTime} |
| | | and TO_DATE(st.finishtime |
| | | , '%Y-%m') <= #{endTime} |
| | | and to_char(st.finishtime |
| | | , 'YYYY-MM') >= #{startTime} |
| | | and to_char(st.finishtime |
| | | , 'YYYY-MM') <= #{endTime} |
| | | GROUP BY |
| | | month, st.service_type, st.id |
| | | ORDER BY |
| | | month, st.service_type, st.id; |
| | | </select> |
| | | |
| | | |
| | | <!-- æå¡ç»è®¡æ¥è¯¢ - ææ¶é´ç»´åº¦ç»è®¡åºé¢/é¨è¯éè®¿æ°æ® --> |
| | | <select id="getServiceStatistics" parameterType="com.smartor.domain.ServiceStatisticsRequest" |
| | | resultType="com.smartor.domain.ServiceStatisticsResponse"> |
| | | SELECT |
| | | timePeriod, |
| | | SUM(dischargeFollowCount) AS dischargeFollowCount, |
| | | SUM(outpatientFollowCount) AS outpatientFollowCount, |
| | | SUM(pmiCount) AS pmiCount, |
| | | SUM(pmoCount) AS pmoCount |
| | | FROM ( |
| | | -- éè®¿æ°æ® |
| | | SELECT |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | to_char(visit_time, 'YYYY-MM-DD') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | to_char(visit_time, 'YYYY-MM') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | to_char(visit_time, 'YYYY') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(visit_time), '-W', LPAD(WEEK(visit_time, 1), 2, '0')) AS timePeriod, |
| | | </when> |
| | | <otherwise> |
| | | to_char(visit_time, 'YYYY-MM-DD') AS timePeriod, |
| | | </otherwise> |
| | | </choose> |
| | | COUNT(CASE WHEN service_type = '2' THEN 1 END) AS dischargeFollowCount, |
| | | COUNT(CASE WHEN service_type = '3' THEN 1 END) AS outpatientFollowCount, |
| | | 0 AS pmiCount, |
| | | 0 AS pmoCount |
| | | FROM service_subtask |
| | | WHERE |
| | | del_flag = '0' |
| | | <if test="startDate != null and endDate != null"> |
| | | AND visit_time >= #{startDate} |
| | | AND visit_time <= #{endDate} |
| | | </if> |
| | | |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | |
| | | <if test="deptcodes != null and deptcodes.size() > 0"> |
| | | AND deptcode IN |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="districtcode" open="(" separator="," close=")"> |
| | | #{districtcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="serviceTypes != null and serviceTypes.size() > 0"> |
| | | AND service_type IN |
| | | <foreach collection="serviceTypes" item="serviceType" open="(" separator="," close=")"> |
| | | #{serviceType} |
| | | </foreach> |
| | | </if> |
| | | |
| | | GROUP BY |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | to_char(visit_time, 'YYYY-MM-DD') |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | to_char(visit_time, 'YYYY-MM') |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | to_char(visit_time, 'YYYY') |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(visit_time), '-W', LPAD(WEEK(visit_time, 1), 2, '0')) |
| | | </when> |
| | | <otherwise> |
| | | to_char(visit_time, 'YYYY-MM-DD') |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | UNION ALL |
| | | |
| | | -- åºé¢äººæ¬¡æ°æ® |
| | | SELECT |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | to_char(endtime, 'YYYY-MM-DD') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | to_char(endtime, 'YYYY-MM') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | to_char(endtime, 'YYYY') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(endtime), '-W', LPAD(WEEK(endtime, 1), 2, '0')) AS timePeriod, |
| | | </when> |
| | | <otherwise> |
| | | to_char(endtime, 'YYYY-MM-DD') AS timePeriod, |
| | | </otherwise> |
| | | </choose> |
| | | 0 AS dischargeFollowCount, |
| | | 0 AS outpatientFollowCount, |
| | | COUNT( patid) AS pmiCount, |
| | | 0 AS pmoCount |
| | | FROM pat_med_inhosp |
| | | WHERE del_flag = '0' |
| | | <if test="startDate != null and endDate != null"> |
| | | AND endtime >= #{startDate} |
| | | AND endtime <= #{endDate} |
| | | </if> |
| | | |
| | | AND inhospstate=1 |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="districtcode" open="(" separator="," close=")"> |
| | | #{districtcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="deptcodes != null and deptcodes.size() > 0"> |
| | | AND leaveldeptcode IN |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | GROUP BY |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | to_char(endtime, 'YYYY-MM-DD') |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | to_char(endtime, 'YYYY-MM') |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | to_char(endtime, 'YYYY') |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(endtime), '-W', LPAD(WEEK(endtime, 1), 2, '0')) |
| | | </when> |
| | | <otherwise> |
| | | to_char(endtime, 'YYYY-MM-DD') |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | UNION ALL |
| | | |
| | | -- é¨è¯äººæ¬¡æ°æ® |
| | | SELECT |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | to_char(admitdate, 'YYYY-MM-DD') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | to_char(admitdate, 'YYYY-MM') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | to_char(admitdate, 'YYYY') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(admitdate), '-W', LPAD(WEEK(admitdate, 1), 2, '0')) AS timePeriod, |
| | | </when> |
| | | <otherwise> |
| | | to_char(admitdate, 'YYYY-MM-DD') AS timePeriod, |
| | | </otherwise> |
| | | </choose> |
| | | 0 AS dischargeFollowCount, |
| | | 0 AS outpatientFollowCount, |
| | | 0 AS pmiCount, |
| | | COUNT( patid) AS pmoCount |
| | | FROM pat_med_outhosp |
| | | WHERE del_flag = '0' |
| | | <if test="startDate != null and endDate != null"> |
| | | AND admitdate >= #{startDate} |
| | | AND admitdate <= #{endDate} |
| | | </if> |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | |
| | | <if test="deptcodes != null and deptcodes.size() > 0"> |
| | | AND deptcode IN |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | GROUP BY |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | to_char(admitdate, 'YYYY-MM-DD') |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | to_char(admitdate, 'YYYY-MM') |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | to_char(admitdate, 'YYYY') |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(admitdate), '-W', LPAD(WEEK(admitdate, 1), 2, '0')) |
| | | </when> |
| | | <otherwise> |
| | | to_char(admitdate, 'YYYY-MM-DD') |
| | | </otherwise> |
| | | </choose> |
| | | ) AS combined_data |
| | | GROUP BY timePeriod |
| | | ORDER BY timePeriod DESC |
| | | </select> |
| | | |
| | | |
| | | </mapper> |