| | |
| | | return toAjax(serviceSubtaskService.updateServiceSubtask(serviceSubtask)); |
| | | } |
| | | |
| | | @ApiOperation("ä¿®æ¹å任塿¨¡æ¿") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/updateTemplate") |
| | | public AjaxResult updateTemplate(@RequestBody ServiceSubtaskTemplateVO serviceSubtaskTemplateVO) { |
| | | serviceSubtaskTemplateVO.setUpdateBy(getLoginUser().getUser().getNickName()); |
| | | return toAjax(serviceSubtaskService.updateTemplate(serviceSubtaskTemplateVO)); |
| | | } |
| | | |
| | | @ApiOperation("æ°å¢åä»»å¡") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/addSubTask") |
| | |
| | | |
| | | log.info("tidåpidçå¼ä¸ºï¼{},{}", tid, pid); |
| | | if (StringUtils.isEmpty(serviceTaskScriptQues.getPatfrom())) serviceTaskScriptQues.setPatfrom("0"); |
| | | return success(serviceTaskService.getScriptInfoByCondition(tid, pid, true, serviceTaskScriptQues.getPatfrom())); |
| | | return success(serviceTaskService.getScriptInfoByCondition(tid, pid, true, serviceTaskScriptQues.getPatfrom(),null)); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | log.info("tidåpidçå¼ä¸ºï¼{},{}", tid, pid); |
| | | if (StringUtils.isEmpty(serviceTaskScriptQues.getPatfrom())) serviceTaskScriptQues.setPatfrom("0"); |
| | | return success(serviceTaskService.getScriptInfoByCondition(tid, pid, true, serviceTaskScriptQues.getPatfrom())); |
| | | return success(serviceTaskService.getScriptInfoByCondition(tid, pid, true, serviceTaskScriptQues.getPatfrom(),null)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.smartor.domain.SvyLibScriptTag; |
| | | import com.smartor.domain.SvyLibTemplate; |
| | | import com.smartor.domain.SvyLibTemplateReq; |
| | | import com.smartor.domain.SvyLibTemplateVO; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.service.ISvyLibTemplateService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | return getDataTable(sviLibTemplate); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢é®å·å表éè¿é¨é¨ç
åºä»£ç ") |
| | | @PostMapping("/getSviLibTemplateByDeptCode") |
| | | public Map<String, Object> getSviLibTemplateByDeptCode(@RequestBody TemplateDeptVO templateDeptVO) { |
| | | templateDeptVO.setPageNum(PageUtils.getOffset(templateDeptVO.getPageNum(), templateDeptVO.getPageSize())); |
| | | List<SvyLibTemplate> sviLibTemplate = svyLibTemplateService.getSviLibTemplateByDeptCode(templateDeptVO); |
| | | |
| | | //è·åtotal |
| | | templateDeptVO.setPageNum(null); |
| | | templateDeptVO.setPageSize(null); |
| | | List<SvyLibTemplate> total = svyLibTemplateService.getSviLibTemplateByDeptCode(templateDeptVO); |
| | | |
| | | return getDataTable3(CollectionUtils.isNotEmpty(total) ? total.size() : 0L, sviLibTemplate); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢é®å·å表 |
| | | */ |
| | |
| | | /** ç®æ³/模å¼/å¡«å
*/ |
| | | private static final String ALGORITHM = "AES/CBC/PKCS5Padding"; |
| | | |
| | | /** é»è®¤ Keyï¼HEXï¼32åèâ256ä½å¯é¥ï¼ */ |
| | | /** é»è®¤ Keyï¼HEXï¼16åèâ128ä½å¯é¥ï¼ */ |
| | | private static final String DEFAULT_KEY = "0F471C56362408AF8DB929C38EDFD23C"; |
| | | |
| | | /** é»è®¤ IVï¼HEXï¼16åèâ128ä½åç§»éï¼ */ |
| | |
| | | // ------------------------------------------------------------------------- |
| | | |
| | | /** |
| | | * HEX å符串转åèæ°ç»ï¼å¤§å°ååå¯ï¼ |
| | | * HEX å符串转åèæ°ç»ï¼å¤§å°ååå¯ï¼ï¼ä¸è¶³ 16 åèèªå¨è¡¥ 0 |
| | | */ |
| | | private static byte[] hexToBytes(String hex) { |
| | | if (hex == null || hex.length() % 2 != 0) { |
| | |
| | | data[i / 2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4) |
| | | + Character.digit(hex.charAt(i + 1), 16)); |
| | | } |
| | | // IV ä¸è¶³ 16 åèæ¶è¡¥ 0ï¼å
¼å®¹ç¬¬ä¸æ¹ 8 åè IVï¼ |
| | | if (data.length < 16) { |
| | | byte[] padded = new byte[16]; |
| | | System.arraycopy(data, 0, padded, 0, data.length); |
| | | data = padded; |
| | | } |
| | | return data; |
| | | } |
| | | |
| | |
| | | log.info("ç»å½ç¨æ·ï¼{} 䏿¯æ¬å»é¢å¸å·ï¼{}", username, split[1]); |
| | | throw new ServiceException("对ä¸èµ·ï¼æ¨çè´¦å·ï¼" + split[0] + " 䏿¯æ¬å»é¢ç"); |
| | | } |
| | | //-0/-85#4- |
| | | |
| | | passwordService.validate(user); |
| | | |
| | | return createLoginUser(user); |
| | |
| | | /** |
| | | * HISæ°æ®éé |
| | | * 宿¶ä»»å¡ï¼é鿣è
ä¿¡æ¯ãåºé¢ãé¨è¯æ°æ® |
| | | * todayZeroStr å½åçæ¶é´ ä¾å¦ï¼2026-05-06 00:00:00 |
| | | */ |
| | | public void dealHisData() { |
| | | public void dealHisData(String todayZeroStr) { |
| | | log.info("ãdealHisDataãå¼å§æ§è¡HISæ°æ®ééä»»å¡"); |
| | | // è·åæ¨å¤©0ç¹å°ä»å¤©0ç¹çæ¶é´èå´ |
| | | LocalDateTime todayZero = LocalDateTime.now().with(LocalTime.MIN); |
| | | if (StringUtils.isNotBlank(todayZeroStr)) { |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | todayZero = LocalDateTime.parse(todayZeroStr, formatter); |
| | | } |
| | | LocalDateTime yesterdayZero = todayZero.minusDays(1); |
| | | log.info("ãdealHisDataãééæ¶é´èå´ï¼{} ~ {}", yesterdayZero, todayZero); |
| | | |
| | |
| | | } catch (Exception e) { |
| | | log.error("ãdealHisDataãæ°åæ°æ®ééå¼å¸¸", e); |
| | | } |
| | | } |
| | | else if (active.trim().equals("hn")) { |
| | | } else if (active.trim().equals("hn")) { |
| | | try { |
| | | // æ²³åæ°æ®éé |
| | | HnDataGatherVO hnDataGatherVO = new HnDataGatherVO(); |
| | |
| | | } catch (Exception e) { |
| | | log.error("ãdealHisDataãæ²³åæ°æ®ééå¼å¸¸", e); |
| | | } |
| | | } |
| | | else if (active.trim().equals("sltd") || active.trim().equals("nhfy")) { |
| | | } else if (active.trim().equals("sltd") || active.trim().equals("nhfy")) { |
| | | //çç«åå¾·ä¸ååéä¸ç¨åä¸å¥ééæ¹æ³ï¼é½æ¯æ¥æªæ¥æä¾ï¼ |
| | | |
| | | try { |
| | |
| | | |
| | | // çç«åå¾·æ°æ®éé |
| | | for (Long cid : campusidList) { |
| | | log.debug("ãdealHisDataãçç«åå¾·âé¢å
¥é¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.info("ãdealHisDataãçç«åå¾·âé¢å
¥é¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | String nowTime = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | ServiceSLTDInhospReqVO serviceSLTDInhospReqVO = new ServiceSLTDInhospReqVO(); |
| | | serviceSLTDInhospReqVO.setOrgId("20001001"); |
| | |
| | | list.add("FH0109.23"); |
| | | list.add("FH0109.53"); |
| | | serviceSLTDInhospReqVO.setStatusList(list); |
| | | log.debug("ãdealHisDataãçç«åå¾·âé¢å
¥é¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | log.info("ãdealHisDataãçç«åå¾·âé¢å
¥é¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | serviceSLTDHealthcareRecordService.queryHealthcareRecordList(serviceSLTDInhospReqVO); |
| | | log.debug("ãdealHisDataãçç«åå¾·âé¢å
¥é¢âçµæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.info("ãdealHisDataãçç«åå¾·âé¢å
¥é¢âçµæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | |
| | | log.debug("ãdealHisDataãçç«åå¾·âå
¥é¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.info("ãdealHisDataãçç«åå¾·âå
¥é¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | serviceSLTDInhospReqVO.setOrgId("20001001"); |
| | | serviceSLTDInhospReqVO.setCampusId(cid); |
| | | serviceSLTDInhospReqVO.setEncounterTimeStart(null); |
| | |
| | | List<String> listStr = new ArrayList<>(); |
| | | listStr.add("FH0109.26"); |
| | | serviceSLTDInhospReqVO.setStatusList(listStr); |
| | | log.debug("ãdealHisDataãçç«åå¾·âå
¥é¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | log.info("ãdealHisDataãçç«åå¾·âå
¥é¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | serviceSLTDHealthcareRecordService.queryHealthcareRecordList(serviceSLTDInhospReqVO); |
| | | log.debug("ãdealHisDataãçç«åå¾·âå
¥é¢âçµæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.info("ãdealHisDataãçç«åå¾·âå
¥é¢âçµæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | |
| | | // 鍿¥è¯å页ééï¼æ¯é¡µ1000æ¡ï¼ç´å°æ æ°æ®ä¸ºæ¢ |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯âå¼å§å页ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | // 鍿¥è¯å页ééï¼æ¯é¡µ1000æ¡ï¼ç´å°æ æ°æ®ä¸ºæ¢(ååéä¸çå
ä¸é鍿¥è¯æ°æ®) |
| | | if (active.trim().equals("sltd")) { |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯âå¼å§å页ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | serviceSLTDInhospReqVO.setStartHeadTime(null); |
| | | serviceSLTDInhospReqVO.setStartTailTime(null); |
| | | serviceSLTDInhospReqVO.setEncounterTimeStart(nowTime); |
| | |
| | | while (true) { |
| | | serviceSLTDInhospReqVO.setCurrent(outpPage); |
| | | serviceSLTDInhospReqVO.setSize(OUTP_PAGE_SIZE); |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯âéé第{}é¡µæ°æ®ï¼é¢åºï¼{}", outpPage, cid); |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯âéé第{}é¡µæ°æ®ï¼é¢åºï¼{}", outpPage, cid); |
| | | List<ServiceSLTDInhospResDTO> outpResult = serviceSLTDHealthcareRecordService.queryHealthcareRecordList(serviceSLTDInhospReqVO); |
| | | if (CollectionUtils.isEmpty(outpResult)) { |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯â第{}é¡µæ æ°æ®ï¼ééç»æï¼é¢åºï¼{}", outpPage, cid); |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯â第{}é¡µæ æ°æ®ï¼ééç»æï¼é¢åºï¼{}", outpPage, cid); |
| | | break; |
| | | } |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯â第{}页éé{}æ¡ï¼é¢åºï¼{}", outpPage, outpResult.size(), cid); |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯â第{}页éé{}æ¡ï¼é¢åºï¼{}", outpPage, outpResult.size(), cid); |
| | | if (outpResult.size() < OUTP_PAGE_SIZE) { |
| | | break; |
| | | } |
| | |
| | | // æ¸
é¤å页忰ï¼é¿å
å½±ååç»åºå
¥é¢æ¥è¯¢ |
| | | serviceSLTDInhospReqVO.setCurrent(null); |
| | | serviceSLTDInhospReqVO.setSize(null); |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯âå页éé宿ï¼é¢åºï¼{}", cid); |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯âå页éé宿ï¼é¢åºï¼{}", cid); |
| | | } |
| | | |
| | | log.debug("ãdealHisDataãçç«åå¾·âåºé¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.info("ãdealHisDataãçç«åå¾·âåºé¢âå¼å§ééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | serviceSLTDInhospReqVO.setStartHeadTime(null); |
| | | serviceSLTDInhospReqVO.setStartTailTime(null); |
| | | serviceSLTDInhospReqVO.setEncounterTimeStart(null); |
| | |
| | | // list2.add("FH0108.02"); |
| | | list2.add("FH0109.27"); |
| | | serviceSLTDInhospReqVO.setStatusList(list2); |
| | | log.debug("ãdealHisDataãçç«åå¾·âåºé¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | log.info("ãdealHisDataãçç«åå¾·âåºé¢âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | serviceSLTDHealthcareRecordService.queryHealthcareRecordList(serviceSLTDInhospReqVO); |
| | | log.debug("ãdealHisDataãçç«åå¾·âåºé¢âæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | log.info("ãdealHisDataãçç«åå¾·âåºé¢âæééæ°æ®ï¼é¢åºï¼{}", cid); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | |
| | | ServiceSLTDInhospReqVO serviceSLTDInhospReqVO = new ServiceSLTDInhospReqVO(); |
| | | serviceSLTDInhospReqVO.setOrgId("20001001"); |
| | | serviceSLTDInhospReqVO.setCampusId(30001002L); |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯âå¼å§ééæ°æ®ï¼é¢åºï¼{}", "30001002"); |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯âå¼å§ééæ°æ®ï¼é¢åºï¼{}", "30001002"); |
| | | serviceSLTDInhospReqVO.setStartHeadTime(null); |
| | | serviceSLTDInhospReqVO.setStartTailTime(null); |
| | | serviceSLTDInhospReqVO.setEncounterTimeStart(nowTime); |
| | |
| | | list1.add("FH0108.01"); |
| | | list1.add("FH0108.03"); |
| | | serviceSLTDInhospReqVO.setHealthcareRecordTypeList(list1); |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯âééæ°æ®å
¥åï¼{}", serviceSLTDInhospReqVO); |
| | | serviceSLTDHealthcareRecordService.queryHealthcareRecordList(serviceSLTDInhospReqVO); |
| | | log.debug("ãdealHisDataãçç«åå¾·â鍿¥è¯âæééæ°æ®ï¼é¢åºï¼{}", "30001002"); |
| | | log.info("ãdealHisDataãçç«åå¾·â鍿¥è¯âæééæ°æ®ï¼é¢åºï¼{}", "30001002"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("ãdealHisDataãçç«åå¾·æ°æ®ééå¼å¸¸", e); |
| | | } |
| | | |
| | | } /** |
| | | } |
| | | |
| | | /** |
| | | * è¿ä¸ªåªæ¯æ°å临æ¶ä½¿ç¨ï¼å¹³æ¶ç¨ä¸å° |
| | | */ |
| | | public void dealHisData2() { |
| | |
| | | * 模æ¿å |
| | | */ |
| | | @Excel(name = " 模æ¿å ") |
| | | @ApiModelProperty(value = "æåæ¶é´") |
| | | @ApiModelProperty(value = "模æ¿å") |
| | | private String templatename; |
| | | |
| | | /** |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åä»»å¡é®å·æ¨¡æ¿ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-02-02 |
| | | */ |
| | | @ApiModel(value = "ServiceSubtaskTemplateVO", description = "åä»»å¡é®å·æ¨¡æ¿") |
| | | @Data |
| | | public class ServiceSubtaskTemplateVO { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @ApiModelProperty(value = "主é®") |
| | | private Long subId; |
| | | |
| | | /** |
| | | * ä¿®æ¹äºº |
| | | */ |
| | | @ApiModelProperty(value = "ä¿®æ¹äºº") |
| | | private String updateBy; |
| | | |
| | | |
| | | @ApiModelProperty(value = "é®å·æ¨¡æ¿") |
| | | private SvyTaskTemplateVO svyTaskTemplateVO; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | private List<String> leavehospitaldistrictcodes; |
| | | |
| | | /** |
| | | * åºé¢ç
åºç¼å· |
| | | * åºé¢ç§å®¤ç¼å· |
| | | */ |
| | | @ApiModelProperty(value = "åºé¢é¨é¨ç¼å·éå") |
| | | private List<String> leaveldeptcodes; |
| | |
| | | /** |
| | | * é¨é¨åç§° |
| | | */ |
| | | @ApiModelProperty("é¨é¨åç§°") |
| | | @Excel(name = "é¨é¨åç§°") |
| | | @ApiModelProperty("ç¾ç
åç§°") |
| | | @Excel(name = "ç¾ç
åç§°") |
| | | private String icd10name; |
| | | |
| | | /** |
| | |
| | | private String svyname; |
| | | |
| | | /** |
| | | * ç§å®¤åç§°éåï¼ä»¥â,âåå²ï¼ |
| | | */ |
| | | @ApiModelProperty(value = "ç§å®¤åç§°éåï¼ä»¥â,âåå²ï¼") |
| | | private String deptNames; |
| | | |
| | | /** |
| | | * éç¨ç¾ç
|
| | | */ |
| | | @ApiModelProperty(value = "éç¨ç¾ç
") |
| | |
| | | |
| | | import com.smartor.domain.SvyLibTemplate; |
| | | import com.smartor.domain.SvyLibTemplateReq; |
| | | import com.smartor.domain.TemplateDept; |
| | | import com.smartor.domain.TemplateDeptVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public List<SvyLibTemplate> selectSvyLibTemplateList(SvyLibTemplateReq svyLibTemplateReq); |
| | | |
| | | public List<SvyLibTemplate> selectSvyLibTemplateListByDeptCode(TemplateDeptVO templateDeptVO); |
| | | |
| | | /** |
| | | * æ°å¢é®å· |
| | | * |
| | |
| | | |
| | | import com.smartor.domain.SvyLibTemplateTargetoption; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteSvyLibTemplateTargetoptionByIds(Long[] ids); |
| | | |
| | | /** |
| | | * æ ¹æ®è¯æ¯IDåè¡¨åæºæIDæ¹éæ¥è¯¢é项 |
| | | * |
| | | * @param scriptIds è¯æ¯IDå表 |
| | | * @param orgid æºæID |
| | | * @return é项éå |
| | | */ |
| | | public List<SvyLibTemplateTargetoption> selectByScriptIds(@Param("scriptIds") List<Long> scriptIds, @Param("orgid") String orgid); |
| | | } |
| | |
| | | |
| | | public SysDept selectDeptByCode(@Param("deptCode")String deptCode,@Param("orgid")String orgid); |
| | | |
| | | public SysDept selectDeptByCodeAndCampus(@Param("deptCode")String deptCode,@Param("orgid")String orgid,@Param("campusid")String campusid); |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢ææåé¨é¨ |
| | | * |
| | |
| | | public Boolean updateServiceSubtask(ServiceSubtask ServiceSubtask); |
| | | |
| | | /** |
| | | * å任塿¨¡æ¿ä¿®æ¹ |
| | | * @param serviceSubtaskTemplateVO |
| | | * @return |
| | | */ |
| | | public Boolean updateTemplate(ServiceSubtaskTemplateVO serviceSubtaskTemplateVO); |
| | | |
| | | /** |
| | | * æ¹éå é¤åä¸ä»»å¡ï¼éè®¿ï¼ |
| | | * |
| | | * @param ids éè¦å é¤çåä¸ä»»å¡ï¼é访ï¼ä¸»é®éå |
| | |
| | | * @param patid |
| | | * @return |
| | | */ |
| | | public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid, Boolean isFinish, String patfrom); |
| | | public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid, Boolean isFinish, String patfrom,Long subId); |
| | | |
| | | public Map<String, Object> getScriptByCondition(Long taskid, String zyserialnum, String mzserialnum, String tsserialnum); |
| | | |
| | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.smartor.domain.SvyLibTemplate; |
| | | import com.smartor.domain.SvyLibTemplateReq; |
| | | import com.smartor.domain.SvyLibTemplateVO; |
| | | import com.smartor.domain.*; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | |
| | | |
| | | public List<SvyLibTemplate> getSviLibTemplate(SvyLibTemplate svyLibTemplate); |
| | | |
| | | public List<SvyLibTemplate> getSviLibTemplateByDeptCode(TemplateDeptVO templateDeptVO); |
| | | |
| | | /** |
| | | * æ¥è¯¢é®å·å表 |
| | | * |
| | |
| | | pmiJB.setLongTaskReason(StringUtils.isNotEmpty(patMedInhosp.getLongTaskReason()) ? patMedInhosp.getLongTaskReason() + errorIcd : errorIcd); |
| | | patMedInhospMapper.updatePatMedInhosp(pmiJB); |
| | | } else if (CollectionUtils.isEmpty(serviceTaskdiags)) { |
| | | errorIcd = "该æ£è
æå¨ç
åºæªé
ç½®é¿æä»»å¡;"; |
| | | errorIcd = "该æ£è
ææ£ç¾ç
æªé
ç½®é¿æä»»å¡;"; |
| | | PatMedInhosp patMedInhosp = patMedInhospMapper.selectPatMedInhospByInhospid(pmiJB.getInhospid()); |
| | | pmiJB.setDiagcheckFlag("2"); |
| | | pmiJB.setLongTaskReason(StringUtils.isNotEmpty(patMedInhosp.getLongTaskReason()) ? patMedInhosp.getLongTaskReason() + errorIcd : errorIcd); |
| | |
| | | * @param check æ¯å¦éè¦æ ¡éª |
| | | * @param patMedInhosp1 ç
人åºå
¥é¢ä¿¡æ¯ |
| | | * @param patArchive ç
äººä¿¡æ¯ |
| | | * @param type é访类å(1-ç§å®¤ï¼2-ç
åºï¼3-ç¾ç
ï¼ |
| | | * @param type é访类å(1-ç§å®¤ï¼2-ç
åºï¼3-ç¾ç
4-å
¥é¢ç§å®¤ 5-å
¥é¢ç
åº) |
| | | * @param config é
ç½®ä¿¡æ¯ visit.early.day |
| | | */ |
| | | //å°æ£è
æ¾å°subtaskä¸ |
| | |
| | | patMedInhosp1.setLongTaskReason(longTaskReason + " & 该æ£è
ç¾ç
é¿æä»»å¡ä¸åå¨,ä»»å¡ID为:" + taskid); |
| | | patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); |
| | | return; |
| | | } else if (type == 4) { |
| | | patMedInhosp1.setInDeptcheckFlag("2"); |
| | | patMedInhosp1.setLongTaskReason(longTaskReason + " & 该æ£è
å
¥é¢ç§å®¤é¿æä»»å¡ä¸åå¨,ä»»å¡ID为:" + taskid); |
| | | patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); |
| | | return; |
| | | } else if (type == 5) { |
| | | patMedInhosp1.setInWardcheckFlag("2"); |
| | | patMedInhosp1.setLongTaskReason(longTaskReason + " & 该æ£è
å
¥é¢ç
åºé¿æä»»å¡ä¸åå¨,ä»»å¡ID为:" + taskid); |
| | | patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); |
| | | return; |
| | | } |
| | | } else { |
| | | serviceTask = serviceTasks.get(0); |
| | | } |
| | | if (Objects.isNull(patMedInhosp1.getEndtime())) { |
| | | if (patMedInhosp1.getInhospstate().equals("1") && Objects.isNull(patMedInhosp1.getEndtime())) { |
| | | return; |
| | | } |
| | | //å°è£
serviceSubtask |
| | | ServiceSubtask serviceSubtask = boxedServiceSubtask(serviceTask, patMedInhosp1, patArchive, config); |
| | | ServiceSubtask serviceSubtask = boxedServiceSubtask(serviceTask, patMedInhosp1, patArchive, config, type); |
| | | if (ObjectUtils.isEmpty(serviceSubtask)) { |
| | | return; |
| | | } |
| | | if (type != 2) { |
| | | //ç§å®¤åç¾ç
é½ç¨ ç§å®¤å¡«å
|
| | | if (patMedInhosp1.getInhospstate().equals("1")) { |
| | | serviceSubtask.setVisitDeptCode(patMedInhosp1.getLeaveldeptcode()); |
| | | serviceSubtask.setVisitDeptName(patMedInhosp1.getLeaveldeptname()); |
| | | } else if (patMedInhosp1.getInhospstate().equals("0")) { |
| | | serviceSubtask.setVisitDeptCode(patMedInhosp1.getDeptcode()); |
| | | serviceSubtask.setVisitDeptName(patMedInhosp1.getDeptname()); |
| | | if(type==5){ |
| | | serviceSubtask.setVisitDeptCode(patMedInhosp1.getHospitaldistrictcode()); |
| | | serviceSubtask.setVisitDeptName(patMedInhosp1.getHospitaldistrictname()); |
| | | } |
| | | } |
| | | } else if (type == 2) { |
| | | serviceSubtask.setVisitDeptCode(patMedInhosp1.getLeavehospitaldistrictcode()); |
| | | serviceSubtask.setVisitDeptName(patMedInhosp1.getLeavehospitaldistrictname()); |
| | |
| | | if (type == 1) patMedInhosp2.setDeptcheckFlag("1"); |
| | | if (type == 2) patMedInhosp2.setWardcheckFlag("1"); |
| | | if (type == 3) patMedInhosp2.setDiagcheckFlag("1"); |
| | | if (type == 4) patMedInhosp2.setInDeptcheckFlag("1"); |
| | | if (type == 5) patMedInhosp2.setInWardcheckFlag("1"); |
| | | patMedInhospMapper.updatePatMedInhosp(patMedInhosp2); |
| | | } else { |
| | | //çæåä»»å¡å¤±è´¥ï¼ |
| | |
| | | if (type == 1) patMedInhosp2.setDeptcheckFlag("2"); |
| | | if (type == 2) patMedInhosp2.setWardcheckFlag("2"); |
| | | if (type == 3) patMedInhosp2.setDiagcheckFlag("2"); |
| | | if (type == 4) patMedInhosp2.setInDeptcheckFlag("2"); |
| | | if (type == 5) patMedInhosp2.setInWardcheckFlag("2"); |
| | | patMedInhosp2.setRemark("çæåä»»å¡å¤±è´¥ " + type); |
| | | patMedInhospMapper.updatePatMedInhosp(patMedInhosp2); |
| | | } |
| | |
| | | |
| | | |
| | | //å°è£
serviceSubtask |
| | | private ServiceSubtask boxedServiceSubtask(ServiceTask serviceTask, PatMedInhosp patMedInhosp1, PatArchive patArchive, String config) { |
| | | private ServiceSubtask boxedServiceSubtask(ServiceTask serviceTask, PatMedInhosp patMedInhosp1, PatArchive patArchive, String config, Integer type) { |
| | | //å¢å serviceTaskå¤ç©º |
| | | // if(Objects.isNull(serviceTask)){ |
| | | // return null; |
| | |
| | | serviceSubtask.setDrname(patMedInhosp1.getDrname()); |
| | | serviceSubtask.setDeptcode(patMedInhosp1.getLeaveldeptcode()); |
| | | serviceSubtask.setDeptname(patMedInhosp1.getLeaveldeptname()); |
| | | serviceSubtask.setLeavehospitaldistrictcode(patMedInhosp1.getLeavehospitaldistrictcode()); |
| | | serviceSubtask.setLeavehospitaldistrictname(patMedInhosp1.getLeavehospitaldistrictname()); |
| | | if (type == 4 || type == 5) { |
| | | //设置å
¥é¢ç |
| | | serviceSubtask.setDeptcode(patMedInhosp1.getDeptcode()); |
| | | serviceSubtask.setDeptname(patMedInhosp1.getDeptname()); |
| | | serviceSubtask.setLeavehospitaldistrictcode(patMedInhosp1.getHospitaldistrictcode()); |
| | | serviceSubtask.setLeavehospitaldistrictname(patMedInhosp1.getHospitaldistrictname()); |
| | | } |
| | | serviceSubtask.setLeaveicd10code(patMedInhosp1.getLeaveicd10code()); |
| | | serviceSubtask.setLeavediagname(patMedInhosp1.getDiagname()); |
| | | serviceSubtask.setTemplateid(serviceTask.getTemplateid()); |
| | |
| | | serviceSubtask.setServiceType(serviceTask.getServiceType()); |
| | | serviceSubtask.setPreachform(serviceTask.getPreachform()); |
| | | serviceSubtask.setHospType("2"); |
| | | if (type == 4 || type == 5) serviceSubtask.setHospType("6"); |
| | | serviceSubtask.setCreateTime(new Date()); |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | serviceSubtask.setCreateBy(patMedInhosp1.getNurseName()); |
| | |
| | | serviceSubtask.setLeavehospitaldistrictname(patMedInhosp1.getLeavehospitaldistrictname()); |
| | | serviceSubtask.setUpdateBy(serviceTask.getUpdateBy()); |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | //妿æ¯å®£æå°±è®¾ç½®ä¸º7 |
| | | if (serviceTask.getServiceType().equals("17")) serviceSubtask.setTaskSituation(7); |
| | | //设置åéæ¶é´ |
| | | if (serviceTask.getSendDay() == null) serviceTask.setSendDay(1L); |
| | | Date newDate = null; |
| | | if (!Objects.isNull(patMedInhosp1.getEndtime())) { |
| | | newDate = addDays(patMedInhosp1.getEndtime(), serviceTask.getSendDay().intValue()); |
| | | } else { |
| | | //妿çäº4,è¯´ææ¯å
¥é¢å®£æï¼å
¥é¢ä¸å¯è½æendTime |
| | | if (type != 4 && type != 5) { |
| | | patMedInhosp1.setDeptcheckFlag("2"); |
| | | patMedInhosp1.setRemark(patMedInhosp1.getRemark() + "& 该æ£è
ç¾ç
åºé¢æ¶é´ä¸ºç©º,åºé¢è®°å½ID为:" + patMedInhosp1.getInhospid()); |
| | | patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); |
| | | //妿åºé¢æ¶é´ä¸ºç©ºï¼åè¿åä¸ä¸ªæ°å¯¹è±¡ |
| | | return new ServiceSubtask(); |
| | | } |
| | | //å
¥é¢å®£æï¼åºæ¬å½å¤©æé天就è¦ååº |
| | | newDate = addDays(new Date(), serviceTask.getSendDay().intValue()); |
| | | } |
| | | serviceSubtask.setLongSendTime(newDate); |
| | | serviceSubtask.setVisitTime(newDate); |
| | | |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.json.JSON; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.entity.SysUserDept; |
| | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.mapper.*; |
| | | import com.smartor.service.IPatMedOuthospService; |
| | | import com.smartor.service.IServiceExternalService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import netscape.javascript.JSObject; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Override |
| | | public Map<String, Object> query360PatInfolwl(Long patid, SysUser sysUser) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | PatArchive pa = patArchiveMapper.selectPatArchiveByPatid(patid); |
| | | if (pa.getPatientno() == null) { |
| | | result.put("url", null); |
| | | result.put("error", "æ£è
ç¼å·ä¸ºç©º"); |
| | | return result; |
| | | PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patid); |
| | | Map<String, String> headers = buildRequestHeaders(); |
| | | Map<String, Object> requestParams = buildRequestParams(sysUser,patArchive); |
| | | String result = HttpUtils.sendPostByHeader("http://cfdata.nhyfy.cn/kapi/hbos-h360/open/getNoLoginUrl", new Gson().toJson(requestParams), headers); |
| | | log.info("============resultçå¼ä¸ºï¼{}",result); |
| | | Gson gson = new Gson(); |
| | | Map<String, Object> map = null; |
| | | if (result != null) { |
| | | map = gson.fromJson(result, new TypeToken<Map<String, Object>>() { |
| | | }.getType()); |
| | | } |
| | | |
| | | StringBuffer sbf = new StringBuffer("http://cfdata.nhyfy.cn/cfdata/h360/patient-summary?"); |
| | | sbf.append("referer=thirdparty"); |
| | | sbf.append("&encode=1"); |
| | | sbf.append("&patientMainIndexNum=" + AesUtils.encrypt(pa.getPatientno())); |
| | | sbf.append("&workId=" + AesUtils.encrypt(sysUser.getUserName())); |
| | | sbf.append("&workName=" + AesUtils.encrypt(sysUser.getNickName())); |
| | | sbf.append("&hisOrgCode=" + AesUtils.encrypt("20001001")); |
| | | sbf.append("&hisOrgName=" + AesUtils.encrypt("åå大å¦éå±ç¬¬ä¸å»é¢")); |
| | | sbf.append("&hisHosCode=" + AesUtils.encrypt("30001002")); |
| | | sbf.append("&hisHosName=" + AesUtils.encrypt("åå大å¦éå±ç¬¬ä¸å»é¢")); |
| | | String url360 = null; |
| | | try { |
| | | url360 = URLEncoder.encode(sbf.toString(), "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | StringBuffer stringBuffer = new StringBuffer("http://cfdata.nhyfy.cn/cfdata/login/nologin?"); |
| | | //accountNo对æ¥äººä¸ç»ï¼å
空ç--------------------------------------------------------------- |
| | | stringBuffer.append("accountNo="); |
| | | stringBuffer.append("&source=third"); |
| | | stringBuffer.append("&redirectUrl=" + url360); |
| | | |
| | | result.put("url", stringBuffer.toString()); |
| | | result.put("error", null); |
| | | return result; |
| | | return map; |
| | | } |
| | | |
| | | private Boolean getType(String type, Map dataMap) { |
| | |
| | | return ageMap; |
| | | } |
| | | |
| | | |
| | | private Map<String, String> buildRequestHeaders() { |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | headers.put("app-key", "ak-0p5Qi0J1I4AL67ztEYQL1j9v"); |
| | | return headers; |
| | | } |
| | | |
| | | private Map<String, Object> buildRequestParams(SysUser sysUser,PatArchive patArchive) { |
| | | Map<String, Object> requestParams = new HashMap<>(); |
| | | requestParams.put("key", sysUser.getUserName()); |
| | | requestParams.put("windowOpen", false); |
| | | requestParams.put("isShowHeader", false); |
| | | requestParams.put("encode", 1); |
| | | |
| | | Map<String, Object> params = new HashMap<>(); |
| | | //ç
åå· |
| | | params.put("patientMainIndexNum", patArchive.getPatientno()); |
| | | params.put("sourceSystem", "pacs"); |
| | | params.put("workId", sysUser.getUserName()); |
| | | params.put("workName", sysUser.getNickName()); |
| | | params.put("hisDepName", sysUser.getDeptName()); |
| | | params.put("hisDepCode", sysUser.getDeptCode()); |
| | | params.put("hisOrgName", "åå大å¦éå±ç¬¬ä¸å»é¢"); |
| | | params.put("hisOrgCode", "20001001"); |
| | | params.put("hisHosName", "åå大å¦éå±ç¬¬ä¸å»é¢"); |
| | | params.put("hisHosCode", "30001002"); |
| | | requestParams.put("params", params); |
| | | return requestParams; |
| | | } |
| | | |
| | | } |
| | |
| | | sysDept.setUpdateTime(new Date()); |
| | | sysDept.setUpdateBy(null); |
| | | |
| | | SysDept sysDept1 = sysDeptMapper.selectDeptByCode(sysDept.getDeptCode(), sysDept.getOrgid()); |
| | | // æ deptCode + orgid + campusid æ¥éï¼é¿å
è·¨é¢åºç§å®¤éå¤ |
| | | SysDept sysDept1 = sysDeptMapper.selectDeptByCodeAndCampus(sysDept.getDeptCode(), sysDept.getOrgid(), sysDept.getCampusid()); |
| | | if (Objects.isNull(sysDept1)) { |
| | | try { |
| | | int i = sysDeptMapper.insertDept(sysDept); |
| | | log.info("ServiceExternalServiceImpl---addDeptInfoæ¯å¦æ°å¢æåï¼{}", i); |
| | | } catch (org.springframework.dao.DuplicateKeyException e) { |
| | | log.warn("ãqueryDeptWardAreaInfoListãç§å®¤å·²åå¨(å¹¶åæå
¥)ï¼è·³è¿ï¼deptCode={}, orgid={}, campusid={}", sysDept.getDeptCode(), sysDept.getOrgid(), sysDept.getCampusid()); |
| | | } |
| | | } else { |
| | | sysDept.setDeptId(sysDept1.getDeptId()); |
| | | int i = sysDeptMapper.updateDept(sysDept); |
| | |
| | | sysUser.setUpdateTime(new Date()); |
| | | sysUser.setUpdateBy("admin"); |
| | | sysUser.setCreateBy("admin"); |
| | | sysUser.setCreateBy("admin"); |
| | | sysUser.setOrgid("" + getLongValue(dataItem, "orgId")); |
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
| | | sysUser.setPassword(passwordEncoder.encode(userPwd)); |
| | | SysUser sysUser1 = sysUser2Mapper.selectUserByUserName(sysUser.getUserName()); |
| | | if (ObjectUtils.isNotEmpty(sysUser1)) { |
| | | //ç±äººå·¥ç»´æ¤çåæ®µæ¯ä¸éè¦æ´æ°ç |
| | | //å·²åå¨ï¼ç±äººå·¥ç»´æ¤çåæ®µæ¯ä¸éè¦æ´æ°çï¼orgid/campusidä¿çåå¼ä¸è¦ç |
| | | sysUser.setSearchscope(null); |
| | | sysUser.setPassword(null); |
| | | sysUser.setUserId(sysUser1.getUserId()); |
| | | sysUser.setOrgid(null); |
| | | sysUser.setCampusid(null); |
| | | sysUser2Mapper.updateUser(sysUser); |
| | | } else { |
| | | try { |
| | | sysUser2Mapper.insertUser(sysUser); |
| | | } catch (org.springframework.dao.DuplicateKeyException e) { |
| | | //å¹¶åæå
¥åºæ¯ï¼éæ°æ¥è¯¢è·åå·²åå¨è®°å½ï¼é¿å
éå¤ |
| | | log.warn("ãqueryHospUserInfoListãç¨æ·å·²åå¨(å¹¶åæå
¥)ï¼è·³è¿ï¼userName={}", sysUser.getUserName()); |
| | | SysUser existingUser = sysUser2Mapper.selectUserByUserName(sysUser.getUserName()); |
| | | if (ObjectUtils.isNotEmpty(existingUser)) { |
| | | sysUser.setUserId(existingUser.getUserId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // å¤çç¨æ·ä¸é¨é¨çå
³ç³» |
| | |
| | | log.info("------businessDeptMapæ¯å¦æå¼ï¼{}", businessDeptMap); |
| | | String hisDeptId = getStringValue(businessDeptMap, "deptId"); |
| | | log.info("------hisDeptIdæ¯å¦æå¼ï¼{}, reqVO.getOrgId()çå¼ä¸º:{}", hisDeptId, reqVO.getCampusId()); |
| | | //å¨è¿éï¼hisDeptIdå°±æ¯deptCode |
| | | SysDept sysDept = sysDeptMapper.selectDeptByCode(hisDeptId, reqVO.getOrgId()); |
| | | //å¨è¿éï¼hisDeptIdå°±æ¯deptCodeï¼æé¢åº+æºææ¥ç§å®¤ï¼é¿å
è·¨é¢åºæ¥é |
| | | SysDept sysDept = sysDeptMapper.selectDeptByCodeAndCampus(hisDeptId, reqVO.getOrgId(), reqVO.getCampusId() != null ? reqVO.getCampusId().toString() : null); |
| | | log.info("------hisDeptIdæ¯å¦æå¼ï¼{}, reqVO.getCampusId()çå¼ä¸º:{}", hisDeptId, reqVO.getCampusId()); |
| | | if (Objects.isNull(sysDept)) continue; |
| | | SysUserDept sysUserDept = new SysUserDept(); |
| | |
| | | queryInhosp.setSerialnum(StringUtils.trim(patMedInhosp.getSerialnum())); |
| | | queryInhosp.setOrgid(StringUtils.trim(dto.getOrgId())); |
| | | queryInhosp.setInhospstate(cry); |
| | | queryInhosp.setSchemestatus(0L); |
| | | log.info("----------------è¿éçå
¥å为ï¼{},{}", queryInhosp.getPatno(), queryInhosp.getSerialnum()); |
| | | List<PatMedInhosp> existingInhosps = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | |
| | |
| | | queryInhosp.setInhospstate("3"); |
| | | List<PatMedInhosp> patMedInhospList = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | if (CollectionUtils.isNotEmpty(patMedInhospList)) { |
| | | //妿é¢å
¥é¢ä¸ä¸ºç©ºï¼åè¿è¡ä¿®æ¹ |
| | | //妿é¢å
¥é¢ä¸ä¸ºç©ºï¼åè¿è¡ä¿®æ¹ï¼é¢å
¥é¢âå
¥é¢ï¼ |
| | | patMedInhosp.setInhospid(patMedInhospList.get(0).getInhospid()); |
| | | patMedInhospService.updatePatMedInhosp(patMedInhosp); |
| | | log.info("ç±é¢å
¥é¢æ´æ°ä¸ºå
¥é¢ï¼serialnum={}", patMedInhosp.getSerialnum()); |
| | | } else { |
| | | //妿åºé¢ä¸ä¸ºç©ºï¼åä¸è¿è¡å¤ç |
| | | queryInhosp.setInhospstate("1"); |
| | |
| | | if (locked == null || Boolean.TRUE.equals(locked)) { |
| | | try { |
| | | queryInhosp.setInhospstate(null); |
| | | queryInhosp.setSchemestatus(null); |
| | | queryInhosp.setPatno(null); |
| | | List<PatMedInhosp> patMedInhospList3 = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | if (CollectionUtils.isEmpty(patMedInhospList3)) { |
| | | try { |
| | |
| | | } |
| | | if ("1".equals(cry)) { |
| | | patMedInhosp.setInhospstate("1"); |
| | | if (CollectionUtils.isNotEmpty(dto.getDiagnosisList()) && dto.getDiagnosisList().size() > 0) { |
| | | for (ServiceSLTDDiagnosisResDTO diagnosis : dto.getDiagnosisList()) { |
| | | if (diagnosis.getIsMainDiagnosis() == 1) { |
| | | patMedInhosp.setLeavediagname(diagnosis.getDiagnosisDictName() == null ? "" : diagnosis.getDiagnosisDictName()); |
| | | patMedInhosp.setLeaveicd10code(diagnosis.getDiagnosisDictCode() == null ? "" : diagnosis.getDiagnosisDictCode()); |
| | | } |
| | | ServiceSLTDDiagnosisResDTO mainDischargeDiagnosis = dto.getMainDischargeDiagnosis(); |
| | | log.info("-----------mainDischargeDiagnosisç弿äºå?{}", mainDischargeDiagnosis); |
| | | if (!Objects.isNull(mainDischargeDiagnosis)) { |
| | | if (mainDischargeDiagnosis.getIsMainDiagnosis() == 1) { |
| | | patMedInhosp.setLeavediagname(StringUtils.defaultString(mainDischargeDiagnosis.getDiagnosisDictName(), "")); |
| | | patMedInhosp.setLeaveicd10code(StringUtils.defaultString(mainDischargeDiagnosis.getDiagnosisDictCode(), "")); |
| | | } |
| | | } |
| | | } |
| | |
| | | private PatArchive processPatientArchive(ServiceSLTDInhospResDTO dto) { |
| | | List<PatArchive> existingArchives = null; |
| | | |
| | | // ä¼å
æ patientno 精确æ¥éï¼æ¥ä¸å°åæ idcardno æ¥éï¼ANDæ¡ä»¶ä¼æ¼æ¥åä¸äººä¸åpatientnoçæ
åµï¼ |
| | | if (dto.getPatientId() != null) { |
| | | // ç¬¬ä¸æ¥ï¼æ patientno 精确æ¥éï¼ä¸æå
¥æ¶ä½¿ç¨ç medicalRecordNo ä¸è´ï¼ |
| | | String patientno = dto.getMedicalRecordNo() == null ? null : String.valueOf(dto.getMedicalRecordNo()); |
| | | if (StringUtils.isNotEmpty(patientno)) { |
| | | PatArchive queryByPatientNo = new PatArchive(); |
| | | queryByPatientNo.setPatientno(String.valueOf(dto.getPatientId())); |
| | | queryByPatientNo.setIdcardno(StringUtils.isNotEmpty(dto.getIdCardNo()) ? dto.getIdCardNo().trim() : null); |
| | | queryByPatientNo.setPatientno(patientno); |
| | | existingArchives = patArchiveService.selectPatArchiveList(queryByPatientNo); |
| | | } |
| | | |
| | | // ç¬¬äºæ¥ï¼æ patientno æ¥ä¸å°æ¶ï¼æ idcardno æ¥éï¼åæ¥ORï¼é¿å
ANDæ¡ä»¶æ¼æ¥ï¼ |
| | | if (CollectionUtils.isEmpty(existingArchives) && StringUtils.isNotEmpty(dto.getIdCardNo())) { |
| | | PatArchive queryByIdCard = new PatArchive(); |
| | | queryByIdCard.setIdcardno(dto.getIdCardNo().trim()); |
| | | existingArchives = patArchiveService.selectPatArchiveList(queryByIdCard); |
| | | } |
| | | |
| | | // ç¬¬ä¸æ¥ï¼æ patidHis æ¥éï¼å
¼å®¹æ§æ°æ®ï¼æ§æ°æ®å¯è½ä»¥ patientId å为 patientnoï¼ |
| | | if (CollectionUtils.isEmpty(existingArchives) && dto.getPatientId() != null) { |
| | | PatArchive queryByPatidHis = new PatArchive(); |
| | | queryByPatidHis.setPatientno(String.valueOf(dto.getPatientId())); |
| | | existingArchives = patArchiveService.selectPatArchiveList(queryByPatidHis); |
| | | } |
| | | |
| | | PatArchive patArchive = buildPatientArchive(dto); |
| | | |
| | | if (CollectionUtils.isEmpty(existingArchives)) { |
| | | try { |
| | | patArchiveService.insertPatArchive(patArchive); |
| | | log.debug("ãprocessPatientArchiveãæ°å¢æ£è
æ¡£æ¡ï¼æ£è
ç¼å·ï¼{}", patArchive.getPatientno()); |
| | | } catch (org.springframework.dao.DuplicateKeyException e) { |
| | | log.warn("ãprocessPatientArchiveãæ£è
æ¡£æ¡å·²åå¨(å¹¶åæå
¥)ï¼è·³è¿ï¼patientno={}, idcardno={}", patArchive.getPatientno(), patArchive.getIdcardno()); |
| | | // å¹¶åæå
¥åºæ¯ï¼éæ°æ¥è¯¢è·åå·²åå¨çè®°å½ |
| | | PatArchive queryRetry = new PatArchive(); |
| | | queryRetry.setPatientno(patArchive.getPatientno()); |
| | | existingArchives = patArchiveService.selectPatArchiveList(queryRetry); |
| | | if (CollectionUtils.isNotEmpty(existingArchives)) { |
| | | patArchive.setId(existingArchives.get(0).getId()); |
| | | patArchive.setNotrequiredFlag(existingArchives.get(0).getNotrequiredFlag()); |
| | | patArchive.setNotrequiredreason(existingArchives.get(0).getNotrequiredreason()); |
| | | } |
| | | } |
| | | } else { |
| | | patArchive.setId(existingArchives.get(0).getId()); |
| | | patArchive.setNotrequiredFlag(existingArchives.get(0).getNotrequiredFlag()); |
| | |
| | | dto.setCostNatureName(getStringValue(dataItem, "costNatureName")); |
| | | dto.setCostNatureCode(getStringValue(dataItem, "costNatureCode")); |
| | | dto.setFurtherConsultationStatus(getIntegerValue(dataItem, "furtherConsultationStatus")); |
| | | |
| | | Object mainDiagObj = dataItem.get("mainDischargeDiagnosis"); |
| | | if (mainDiagObj instanceof Map) { |
| | | Map<String, Object> mainDiagMap = (Map<String, Object>) mainDiagObj; |
| | | ServiceSLTDDiagnosisResDTO mainDiag = new ServiceSLTDDiagnosisResDTO(); |
| | | mainDiag.setDiagnosisDictCode(getStringValue(mainDiagMap, "diagnosisDictCode")); |
| | | mainDiag.setDiagnosisDictName(getStringValue(mainDiagMap, "diagnosisDictName")); |
| | | mainDiag.setDiagnosisCategory(getStringValue(mainDiagMap, "diagnosisCategory")); |
| | | mainDiag.setRecordType(getIntegerValue(mainDiagMap, "recordType")); |
| | | mainDiag.setIsMainDiagnosis(getIntegerValue(mainDiagMap, "isMainDiagnosis")); |
| | | dto.setMainDischargeDiagnosis(mainDiag); |
| | | } |
| | | Object contactsObj = dataItem.get("residentContactInfos"); |
| | | if (contactsObj instanceof List) { |
| | | dto.setResidentContactInfos(parseContacts((List<?>) contactsObj)); |
| | |
| | | |
| | | @Override |
| | | public Map<String, Object> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq) { |
| | | log.error("selectPatQuesTionResultçå
¥å为ï¼{}", serviceSubTaskQueryReq); |
| | | log.info("selectPatQuesTionResultçå
¥å为ï¼{}", serviceSubTaskQueryReq); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | //è·åæ¬æ¬¡çé®çç»æ |
| | | Map<String, Object> scriptInfoByCondition = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), serviceSubTaskQueryReq.getIsFinish(), serviceSubTaskQueryReq.getPatfrom()); |
| | | Map<String, Object> scriptInfoByCondition = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), serviceSubTaskQueryReq.getIsFinish(), serviceSubTaskQueryReq.getPatfrom(), serviceSubTaskQueryReq.getSubId()); |
| | | map = getMap(scriptInfoByCondition, serviceSubTaskQueryReq.getSubId(), serviceSubTaskQueryReq.getPatid()); |
| | | |
| | | //è·å䏿¬¡çé®çç»æ |
| | | ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(serviceSubTaskQueryReq.getSubId()); |
| | | map.put("upScriptResult", null); |
| | | map.put("templateName", serviceSubtask.getTemplatename()); |
| | | map.put("upTaskName", null); |
| | | if (ObjectUtils.isNotEmpty(serviceSubtask) && serviceSubtask.getUpid() != null) { |
| | | Map<String, Object> scriptInfoByCondition2 = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), serviceSubTaskQueryReq.getIsFinish(), serviceSubTaskQueryReq.getPatfrom()); |
| | | Map<String, Object> scriptInfoByCondition2 = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), serviceSubTaskQueryReq.getIsFinish(), serviceSubTaskQueryReq.getPatfrom(),serviceSubTaskQueryReq.getSubId()); |
| | | Map<String, Object> map1 = getMap(scriptInfoByCondition2, Long.valueOf(serviceSubtask.getUpid()), serviceSubTaskQueryReq.getPatid()); |
| | | if (!map1.isEmpty()) { |
| | | map.put("upScriptResult", map1.get("scriptResult")); |
| | |
| | | private Map<String, Object> getMap(Map<String, Object> scriptInfoByCondition, Long subid, Long patid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (ObjectUtils.isNotEmpty(scriptInfoByCondition) && ObjectUtils.isNotEmpty(scriptInfoByCondition.get("script"))) { |
| | | // log.error("-----------scriptInfoByConditionçå¼ä¸ºï¼{}", scriptInfoByCondition); |
| | | if (scriptInfoByCondition.get("type").equals("1")) { |
| | | List<IvrTaskTemplateScriptVO> ivrTaskTemplateScriptVOS = (List<IvrTaskTemplateScriptVO>) scriptInfoByCondition.get("script"); |
| | | // List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOList = DtoConversionUtils.sourceToTarget(ivrTaskTemplateScriptVOS, IvrLibaTemplateScriptVO.class); |
| | | for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateScriptVOS) { |
| | | Map<String, String> scriptResult = getScriptResult(subid, patid, ivrTaskTemplateScriptVO.getId()); |
| | | if (ObjectUtils.isNotEmpty(scriptResult)) { |
| | |
| | | return serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateTemplate(ServiceSubtaskTemplateVO serviceSubtaskTemplateVO) { |
| | | ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(serviceSubtaskTemplateVO.getSubId()); |
| | | if (serviceSubtask == null || serviceSubtask.getSendstate() != 2L) |
| | | throw new BaseException("该任å¡å·²åéç»æ£è
ï¼ä¸è½åè¿è¡ä¿®æ¹æ¨¡æ¿"); |
| | | |
| | | Integer taskTempid = svyTaskTemplateService.saveOrUpdateTemplate(serviceSubtaskTemplateVO.getSvyTaskTemplateVO()); |
| | | if (taskTempid == null) return false; |
| | | |
| | | String tempName = svyTaskTemplateService.selectSvyTaskTemplateBySvyid(Long.valueOf(taskTempid)).getSvyname(); |
| | | serviceSubtask.setTemplateid(taskTempid.longValue()); |
| | | serviceSubtask.setTemplatename(tempName); |
| | | serviceSubtask.setUpdateBy(serviceSubtaskTemplateVO.getUpdateBy()); |
| | | serviceSubtask.setLibtemplateid(serviceSubtaskTemplateVO.getSvyTaskTemplateVO().getTemplateid()); |
| | | return updateServiceSubtask(serviceSubtask); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤åä¸ä»»å¡ï¼éè®¿ï¼ |
| | | * |
| | |
| | | serviceTaskoper.setOrgid(serviceTask.getOrgid()); |
| | | serviceTaskoper.setCreateTime(new Date()); |
| | | if (StringUtils.isNotEmpty(serviceTaskVO.getOplevelcode())) { |
| | | // String[] opcodes = serviceTaskVO.getOpcode().split(","); |
| | | // for (String opcode : opcodes) { |
| | | // serviceTaskoper.setOpcode(opcode); |
| | | // log.info("----serviceTaskoperçå¼ä¸ºï¼{}", serviceTaskoper); |
| | | // serviceTaskoperService.insertServiceTaskoper(serviceTaskoper); |
| | | // } |
| | | log.info("----serviceTaskoperçå¼ä¸ºï¼{}", serviceTaskoper); |
| | | serviceTaskoperService.insertServiceTaskoper(serviceTaskoper); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (serviceTaskVO.getIsoperation() != null && serviceTaskVO.getIsoperation() == 2) { |
| | | } else if (serviceTaskVO.getIsoperation() != null && serviceTaskVO.getIsoperation() == 2) { |
| | | //ä»»å¡ä¿®æ¹ |
| | | if (ObjectUtils.isNotEmpty(serviceTaskVO.getSendTimeslot())) |
| | | serviceTask.setSendTimeSlot(JSON.toJSONString(serviceTaskVO.getSendTimeslot())); |
| | |
| | | serviceTaskdiag.setUpdateTime(new Date()); |
| | | if (StringUtils.isNotEmpty(serviceTaskVO.getIcd10code())) { |
| | | String[] icd10codes = serviceTaskVO.getIcd10code().split(","); |
| | | for (String icdcode : icd10codes) { |
| | | String[] icd10names = serviceTaskVO.getIcd10name().split(","); |
| | | if (icd10codes.length != icd10names.length) { |
| | | throw new BaseException("ç¾ç
ç¼ç åç¾ç
åç§°æ°éä¸ä¸è´"); |
| | | } |
| | | for (int i = 0; i < icd10codes.length; i++) { |
| | | //å
æ¥è¯¢ä¸ä¸æ¯å¦åå¨ |
| | | ServiceTaskdiag serviceTaskdiag2 = new ServiceTaskdiag(); |
| | | serviceTaskdiag2.setTaskId(serviceTaskVO.getTaskid()); |
| | | serviceTaskdiag2.setIcd10code(icdcode); |
| | | serviceTaskdiag2.setIcd10code(icd10codes[i]); |
| | | serviceTaskdiag2.setIcd10name(icd10names[i]); |
| | | List<ServiceTaskdiag> serviceTaskdiags = serviceTaskdiagService.selectServiceTaskdiagList(serviceTaskdiag2); |
| | | serviceTaskdiag.setIcd10code(icdcode); |
| | | serviceTaskdiag.setIcd10code(icd10codes[i]); |
| | | serviceTaskdiag.setIcd10name(icd10names[i]); |
| | | log.info("----serviceTaskdiagæ´æ°çå¼ä¸ºï¼{}", serviceTaskdiag); |
| | | if (CollectionUtils.isNotEmpty(serviceTaskdiags)) { |
| | | serviceTaskdiag.setId(serviceTaskdiags.get(0).getId()); |
| | |
| | | ServiceSubtaskEntity serviceSubtaskVO = DtoConversionUtils.sourceToTarget(serviceSubtask, ServiceSubtaskEntity.class); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | for (ServiceSubtask ss : serviceSubtaskList) { |
| | | log.error("sfSendéè¦ç§»é¤çsubId为ï¼{}", ss.getId().toString()); |
| | | log.info("sfSendéè¦ç§»é¤çsubId为ï¼{}", ss.getId().toString()); |
| | | redisCache.removeElementFromList("cache-exist", ss.getId().toString()); |
| | | redisCache.removeElementFromList("cache-0", ss.getId().toString()); |
| | | redisCache.removeElementFromList("cache-1", ss.getId().toString()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid, Boolean isFinish, String patfrom) { |
| | | public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid, Boolean isFinish, String patfrom, Long subId) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | if (subId != null) { |
| | | serviceSubtaskVO.setSubId(subId); |
| | | } else { |
| | | serviceSubtaskVO.setPatid(patid); |
| | | serviceSubtaskVO.setTaskid(taskid); |
| | | serviceSubtaskVO.setSendstate(3L); |
| | | } |
| | | List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | // //æ¥è¯¢æ£è
æ¯å¦éè¦åé¢ |
| | | // if (CollectionUtils.isEmpty(selectServiceSubtaskList)) { |
| | | // Long submit = selectServiceSubtaskList.get(0).getSubmit(); |
| | | // if (submit == 1L) { |
| | | // map.put("submit", "1"); |
| | | // return map; |
| | | // } |
| | | // } |
| | | |
| | | //éè¿ä»»å¡IDè·å模æ¿ID |
| | | ServiceTask serviceTask = selectServiceTaskByTaskid(taskid); |
| | | if (serviceTask == null) { |
| | |
| | | List info = new ArrayList(); |
| | | if (serviceTask.getType().equals("1")) { |
| | | //é访 |
| | | log.error("ææ¬é访é®é¢"); |
| | | log.info("ææ¬é访é®é¢"); |
| | | info = sfInfo(serviceTask, patid, patfrom); |
| | | } else if (serviceTask.getType().equals("2")) { |
| | | //é®å· |
| | | log.error("ææ¬é®å·é®é¢"); |
| | | info = wjInfo(serviceTask, patid, isFinish, patfrom); |
| | | log.info("ææ¬é®å·é®é¢"); |
| | | info = wjInfo(serviceTask, patid, isFinish, patfrom, subId); |
| | | } else { |
| | | //宣æ |
| | | info = xjInfo(Long.valueOf(serviceTask.getLibtemplateid()), taskid, patid, isFinish); |
| | |
| | | } |
| | | } |
| | | //æ¿æ¢æ£è
ä¸ªäººä¿¡æ¯æ°æ® |
| | | log.error("é®é¢idï¼{}, é®é¢å
容ï¼{}", svyTaskTemplateScriptVO.getId(), svyTaskTemplateScriptVO.getScriptContent()); |
| | | log.info("é®é¢idï¼{}, é®é¢å
容ï¼{}", svyTaskTemplateScriptVO.getId(), svyTaskTemplateScriptVO.getScriptContent()); |
| | | if (StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getScriptContent()) && ObjectUtils.isNotEmpty(patArchive)) { |
| | | svyTaskTemplateScriptVO.setScriptContent(svyTaskTemplateScriptVO.getScriptContent().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : "")); |
| | | svyTaskTemplateScriptVO.setScriptContent(svyTaskTemplateScriptVO.getScriptContent().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : "")); |
| | |
| | | * @param patid |
| | | * @return |
| | | */ |
| | | private List wjInfo(ServiceTask serviceTask, Long patid, Boolean isFinish, String patfrom) { |
| | | private List wjInfo(ServiceTask serviceTask, Long patid, Boolean isFinish, String patfrom, Long subId) { |
| | | //ç¨æ·ç¹å»äºå¤é¾ï¼å°±ç®ä»é¢åäº |
| | | //è¿æ ·å伿ä¸ä¸ªé®é¢ï¼å¦æåºå®ä»»å¡ï¼ä¼åºç°ä¸ä¸ªä»»å¡éï¼æå¤ä¸ªè¯¥æ£è
|
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | if (subId != null) { |
| | | serviceSubtaskVO.setSubId(subId); |
| | | } else { |
| | | serviceSubtaskVO.setTaskid(serviceTask.getTaskid()); |
| | | serviceSubtaskVO.setPatid(patid); |
| | | } |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskList) && serviceSubtaskList.size() == 1) { |
| | | if (serviceSubtaskList.get(0).getSendstate() == 3 && isFinish == true) { |
| | |
| | | //éè¿æ¨¡æ¿IDè·åé®é¢ä¿¡æ¯ |
| | | SvyTaskTemplateScript svyTaskTemplateScript = new SvyTaskTemplateScript(); |
| | | svyTaskTemplateScript.setTemplateID(Long.valueOf(serviceTask.getTemplateid())); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskList) && serviceSubtaskList.get(0).getTemplateid() != null) |
| | | svyTaskTemplateScript.setTemplateID(serviceSubtaskList.get(0).getTemplateid()); |
| | | svyTaskTemplateScript.setDelFlag("0"); |
| | | List<SvyTaskTemplateScript> svyTaskTemplateScripts = svyTaskTemplateScriptMapper.selectSvyTaskTemplateScriptList(svyTaskTemplateScript); |
| | | if (CollectionUtils.isEmpty(svyTaskTemplateScripts) || svyTaskTemplateScripts.size() == 0) { |
| | |
| | | } |
| | | } |
| | | //æ¿æ¢æ£è
ä¸ªäººä¿¡æ¯æ°æ® |
| | | log.error("é®é¢idï¼{}, é®é¢å
容ï¼{}", svyTaskTemplateScriptVO.getId(), svyTaskTemplateScriptVO.getScriptContent()); |
| | | log.info("é®é¢idï¼{}, é®é¢å
容ï¼{}", svyTaskTemplateScriptVO.getId(), svyTaskTemplateScriptVO.getScriptContent()); |
| | | if (StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getScriptContent()) && ObjectUtils.isNotEmpty(patArchive)) { |
| | | svyTaskTemplateScriptVO.setScriptContent(svyTaskTemplateScriptVO.getScriptContent().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : "")); |
| | | svyTaskTemplateScriptVO.setScriptContent(svyTaskTemplateScriptVO.getScriptContent().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : "")); |
| | |
| | | svyLibTemplateReq.setSvyname(svyLibTemplate.getSvyname()); |
| | | svyLibTemplateReq.setOrgid(svyLibTemplate.getOrgid()); |
| | | List<SvyLibTemplate> svyLibTemplates = svyLibTemplateMapper.selectSvyLibTemplateList(svyLibTemplateReq); |
| | | for (SvyLibTemplate svyLibTemplate1 : svyLibTemplates) { |
| | | SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript(); |
| | | svyLibTemplateScript.setSvyid(svyLibTemplate1.getSvyid()); |
| | | svyLibTemplateScript.setOrgid(svyLibTemplate1.getOrgid()); |
| | | List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSvyLibTemplateScriptList(svyLibTemplateScript); |
| | | for (SvyLibTemplateScript svyLibTemplateScript1 : svyLibTemplateScripts) { |
| | | if (svyLibTemplateScript1.getScriptType().equals("1") || svyLibTemplateScript1.getScriptType().equals("2")) { |
| | | SvyLibTemplateTargetoption svyLibTemplateTargetoption = new SvyLibTemplateTargetoption(); |
| | | svyLibTemplateTargetoption.setScriptid(svyLibTemplateScript1.getId()); |
| | | svyLibTemplateTargetoption.setOrgid(svyLibTemplateScript1.getOrgid()); |
| | | List<SvyLibTemplateTargetoption> svyLibTemplateTargetoptions = svyLibTemplateTargetoptionMapper.selectSvyLibTemplateTargetoptionList(svyLibTemplateTargetoption); |
| | | svyLibTemplateScript1.setSvyLibTemplateTargetoptions(svyLibTemplateTargetoptions); |
| | | } |
| | | } |
| | | svyLibTemplate1.setSvyTemplateLibScripts(svyLibTemplateScripts); |
| | | svyLibTemplatesCycle(svyLibTemplates); |
| | | return svyLibTemplates; |
| | | } |
| | | |
| | | @Override |
| | | public List<SvyLibTemplate> getSviLibTemplateByDeptCode(TemplateDeptVO templateDeptVO) { |
| | | if (templateDeptVO.getType() == null) templateDeptVO.setType(1L); |
| | | if (templateDeptVO.getDeptType() == null) templateDeptVO.setDeptType("1"); |
| | | List<SvyLibTemplate> svyLibTemplates = svyLibTemplateMapper.selectSvyLibTemplateListByDeptCode(templateDeptVO); |
| | | svyLibTemplatesCycle(svyLibTemplates); |
| | | return svyLibTemplates; |
| | | } |
| | | |
| | |
| | | svyLibTemplateTargetoptionMapper.deleteSvyLibTemplateTargetoptionById(svyLibTemplateTargetoption.getId()); |
| | | } |
| | | } |
| | | |
| | | private void svyLibTemplatesCycle(List<SvyLibTemplate> svyLibTemplates) { |
| | | for (SvyLibTemplate svyLibTemplate1 : svyLibTemplates) { |
| | | SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript(); |
| | | svyLibTemplateScript.setSvyid(svyLibTemplate1.getSvyid()); |
| | | svyLibTemplateScript.setOrgid(svyLibTemplate1.getOrgid()); |
| | | List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSvyLibTemplateScriptList(svyLibTemplateScript); |
| | | |
| | | // æ¶éææéè¦æ¥è¯¢é项çscriptIdï¼scriptType为1æ2çé¢ç®æéè¦éé¡¹ï¼ |
| | | List<Long> scriptIds = svyLibTemplateScripts.stream().filter(s -> "1".equals(s.getScriptType()) || "2".equals(s.getScriptType())).map(SvyLibTemplateScript::getId).filter(Objects::nonNull).collect(Collectors.toList()); |
| | | |
| | | // æ¹éæ¥è¯¢ææéé¡¹ï¼æscriptIdåç» |
| | | Map<Long, List<SvyLibTemplateTargetoption>> optionMap; |
| | | if (CollectionUtils.isNotEmpty(scriptIds)) { |
| | | List<SvyLibTemplateTargetoption> allOptions = svyLibTemplateTargetoptionMapper.selectByScriptIds(scriptIds, svyLibTemplate1.getOrgid()); |
| | | optionMap = allOptions.stream().collect(Collectors.groupingBy(SvyLibTemplateTargetoption::getScriptid)); |
| | | } else { |
| | | optionMap = new HashMap<>(); |
| | | } |
| | | |
| | | // å°é项åé
å°å¯¹åºé¢ç® |
| | | for (SvyLibTemplateScript svyLibTemplateScript1 : svyLibTemplateScripts) { |
| | | if ("1".equals(svyLibTemplateScript1.getScriptType()) || "2".equals(svyLibTemplateScript1.getScriptType())) { |
| | | svyLibTemplateScript1.setSvyLibTemplateTargetoptions(optionMap.getOrDefault(svyLibTemplateScript1.getId(), new ArrayList<>())); |
| | | } |
| | | } |
| | | |
| | | svyLibTemplate1.setSvyTemplateLibScripts(svyLibTemplateScripts); |
| | | } |
| | | } |
| | | } |
| | |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | | where del_flag = 0 |
| | | <if test="subId != null ">and id = #{subId}</if> |
| | | <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if> |
| | | <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow,jdbcType=TIMESTAMP}</if> |
| | | <if test="continueCount != null ">and continue_count = #{continueCount}</if> |
| | |
| | | service_task.orgid from service_task |
| | | where 1=1 |
| | | and service_task.del_flag = 0 |
| | | <!-- and taskid in (--> |
| | | <!-- select task_id from service_taskdept--> |
| | | <!-- where 1=1--> |
| | | <!-- <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0">--> |
| | | <!-- and dept_code in--> |
| | | <!-- <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","--> |
| | | <!-- close=")">--> |
| | | <!-- #{leaveldeptcode}--> |
| | | <!-- </foreach>--> |
| | | <!-- </if>--> |
| | | <!-- )--> |
| | | <if test="taskName != null and taskName != ''">and service_task.task_name like concat('%', #{taskName}, |
| | | '%') |
| | | </if> |
| | |
| | | <if test="leavehospitaldistrictname != null ">and service_task.leavehospitaldistrictname = |
| | | #{leavehospitaldistrictname} |
| | | </if> |
| | | <if test="leavehospitaldistrictcodes!=null and leavehospitaldistrictcodes.size()>0"> |
| | | AND service_task.leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="leaveldeptcodes!=null and leaveldeptcodes.size()>0"> |
| | | AND service_task.deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="deptcode" open="(" separator="," |
| | | close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="leavehospitaldistrictcode != null ">and service_task.leavehospitaldistrictcode = |
| | | #{leavehospitaldistrictcode} |
| | | </if> |
| | |
| | | <if test="description != null and description != ''">and b.icd10name like concat('%', #{description}, '%') |
| | | </if> |
| | | order by a.create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectSvyLibTemplateListByDeptCode" parameterType="com.smartor.domain.TemplateDeptVO" |
| | | resultMap="SvyLibTemplateResult"> |
| | | SELECT |
| | | a.svyid, |
| | | a.long_temp, |
| | | a.conclusion, |
| | | a.instruction, |
| | | a.prologue, |
| | | a.categoryid, |
| | | a.svycode, |
| | | a.svyname, |
| | | a.description, |
| | | a.introduce, |
| | | a.submitprompt, |
| | | a.templateid, |
| | | a.version, |
| | | a.centerlibrarycode, |
| | | a.centerlibraryid, |
| | | a.islocal, |
| | | a.isenable, |
| | | a.orgid, |
| | | a.del_flag, |
| | | a.create_by, |
| | | a.create_time, |
| | | a.update_by, |
| | | a.update_time, |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.dept_names, |
| | | a.value_type, |
| | | a.reply, |
| | | a.campus, |
| | | a.suitway, |
| | | a.script_score, |
| | | a.score_type, |
| | | a.otherdata, |
| | | a.guid |
| | | FROM |
| | | svy_lib_template a |
| | | LEFT JOIN template_dept b ON a.del_flag = 0 |
| | | AND a.svyid = b.tempid |
| | | where a.del_flag=0 |
| | | and b.del_flag=0 |
| | | <if test="deptCode != null ">and b.dept_code = #{deptCode}</if> |
| | | <if test="deptType != null ">and b.dept_type = #{deptType}</if> |
| | | <if test="type != null">and b.type=#{type}</if> |
| | | <if test="tempid != null">and a.svyid=#{tempid}</if> |
| | | order by a.create_time desc |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | </select> |
| | | |
| | | <select id="selectSvyLibTemplateBySvyid" parameterType="Long" resultMap="SvyLibTemplateResult"> |
| | |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="selectByScriptIds" resultMap="SvyLibTemplateTargetoptionResult"> |
| | | <include refid="selectSvyLibTemplateTargetoptionVo"/> |
| | | where del_flag = 0 |
| | | and scriptid in |
| | | <foreach item="scriptId" collection="scriptIds" open="(" separator="," close=")"> |
| | | #{scriptId} |
| | | </foreach> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectDeptByCodeAndCampus" parameterType="string" resultMap="SysDeptResult"> |
| | | select d.dept_id, |
| | | d.parent_id, |
| | | d.type, |
| | | d.campusid, |
| | | d.dept_code, |
| | | d.dept_type, |
| | | d.ancestors, |
| | | d.dept_name, |
| | | d.order_num, |
| | | d.leader, |
| | | d.phone, |
| | | d.email, |
| | | d.orgid, |
| | | d.his_dept_id, |
| | | d.his_parent_id, |
| | | d.status |
| | | from sys_dept d |
| | | where del_flag = 0 |
| | | <if test="deptCode != null and deptCode != ''"> |
| | | AND dept_code = #{deptCode} |
| | | </if> |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="campusid != null and campusid != ''"> |
| | | AND campusid = #{campusid} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="checkDeptExistUser" parameterType="Long" resultType="int"> |
| | | select count(1) |
| | | from sys_user |