| ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskRuleController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/domain/ServiceTaskRule.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/mapper/ServiceTaskRuleMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/service/IServiceTaskRuleService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/service/impl/ServiceTaskRuleServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/resources/mapper/smartor/ServiceTaskRuleMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskRuleController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,118 @@ package com.ruoyi.web.controller.smartor; import java.util.List; import com.ruoyi.common.annotation.AddOrgId; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.smartor.domain.ServiceTaskRule; import com.smartor.service.IServiceTaskRuleService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 任塿§è¡è§åController * * @author lihu * @date 2026-05-15 */ @Api("任塿§è¡è§å") @RestController @RequestMapping("/smartor/taskrule") public class ServiceTaskRuleController extends BaseController { @Autowired private IServiceTaskRuleService serviceTaskRuleService; /** * æ¥è¯¢ä»»å¡æ§è¡è§åå表 */ @ApiOperation("æ¥è¯¢ä»»å¡æ§è¡è§åå表") //@PreAuthorize("@ss.hasPermi('smartor:rule:list')") @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") @PostMapping("/list") public TableDataInfo list(@RequestBody ServiceTaskRule serviceTaskRule) { startPage(); List<ServiceTaskRule> list = serviceTaskRuleService.selectServiceTaskRuleList(serviceTaskRule); return getDataTable(list); } /** * 导åºä»»å¡æ§è¡è§åå表 */ @ApiOperation("导åºä»»å¡æ§è¡è§åå表") //@PreAuthorize("@ss.hasPermi('smartor:rule:export')") @Log(title = "任塿§è¡è§å", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ServiceTaskRule serviceTaskRule) { List<ServiceTaskRule> list = serviceTaskRuleService.selectServiceTaskRuleList(serviceTaskRule); ExcelUtil<ServiceTaskRule> util = new ExcelUtil<ServiceTaskRule>(ServiceTaskRule.class); util.exportExcel(response, list, "任塿§è¡è§åæ°æ®"); } /** * è·å任塿§è¡è§å详ç»ä¿¡æ¯ */ @ApiOperation("è·å任塿§è¡è§å详ç»ä¿¡æ¯") //@PreAuthorize("@ss.hasPermi('smartor:rule:query')") @GetMapping(value = "/getInfo/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(serviceTaskRuleService.selectServiceTaskRuleById(id)); } /** * æ°å¢ä»»å¡æ§è¡è§å */ @ApiOperation("æ°å¢ä»»å¡æ§è¡è§å") //@PreAuthorize("@ss.hasPermi('smartor:rule:add')") @Log(title = "任塿§è¡è§å", businessType = BusinessType.INSERT) @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") @PostMapping("/add") public AjaxResult add(@RequestBody ServiceTaskRule serviceTaskRule) { return toAjax(serviceTaskRuleService.insertServiceTaskRule(serviceTaskRule)); } /** * ä¿®æ¹ä»»å¡æ§è¡è§å */ @ApiOperation("ä¿®æ¹ä»»å¡æ§è¡è§å") //@PreAuthorize("@ss.hasPermi('smartor:rule:edit')") @Log(title = "任塿§è¡è§å", businessType = BusinessType.UPDATE) @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") @PostMapping("/edit") public AjaxResult edit(@RequestBody ServiceTaskRule serviceTaskRule) { return toAjax(serviceTaskRuleService.updateServiceTaskRule(serviceTaskRule)); } /** * å é¤ä»»å¡æ§è¡è§å */ @ApiOperation("å é¤ä»»å¡æ§è¡è§å") //@PreAuthorize("@ss.hasPermi('smartor:rule:remove')") @Log(title = "任塿§è¡è§å", businessType = BusinessType.DELETE) @GetMapping("/remove/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(serviceTaskRuleService.deleteServiceTaskRuleByIds(ids)); } } ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
@@ -59,7 +59,7 @@ <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult"> <include refid="selectGenTableVo"/> where <where> <if test="orgid != null and orgid != ''"> AND orgid = #{orgid} </if> @@ -75,6 +75,7 @@ <if test="params.endTime != null and params.endTime != ''"><!-- ç»ææ¶é´æ£ç´¢ --> AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') </if> </where> </select> <select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult"> smartor/src/main/java/com/smartor/domain/ServiceTaskRule.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,100 @@ package com.smartor.domain; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; /** * 任塿§è¡è§å对象 service_task_rule * * @author lihu * @date 2026-05-15 */ @Data @ApiModel("任塿§è¡è§å") public class ServiceTaskRule extends BaseEntity { private static final long serialVersionUID = 1L; /** ä»»å¡ID */ @ApiModelProperty("ä»»å¡ID") //æ°æ®åºèªå¢æ¹æ@TableId(type = IdType.AUTO) private Long id; /** é¨é¨è§åï¼1é¦å æ§è¡ 2æ¬¡è¦æ§è¡ï¼ */ @ApiModelProperty("é¨é¨è§åï¼1é¦å æ§è¡ 2æ¬¡è¦æ§è¡ï¼") @Excel(name = "é¨é¨è§å", readConverterExp = "1=é¦å æ§è¡,2=æ¬¡è¦æ§è¡") private String deptRule; /** ç åºè§åï¼1é¦å æ§è¡ 2æ¬¡è¦æ§è¡ï¼ */ @ApiModelProperty("ç åºè§åï¼1é¦å æ§è¡ 2æ¬¡è¦æ§è¡ï¼") @Excel(name = "ç åºè§å", readConverterExp = "1=é¦å æ§è¡,2=æ¬¡è¦æ§è¡") private String wradRule; /** ç¾ç è§åï¼1é¦å æ§è¡ 2æ¬¡è¦æ§è¡ï¼ */ @ApiModelProperty("ç¾ç è§åï¼1é¦å æ§è¡ 2æ¬¡è¦æ§è¡ï¼") @Excel(name = "ç¾ç è§å", readConverterExp = "1=é¦å æ§è¡,2=æ¬¡è¦æ§è¡") private String diagRule; /** å 餿 å¿ï¼0ï¼æªå é¤ 1ï¼å·²å é¤ï¼ */ @ApiModelProperty("å 餿 å¿ï¼0ï¼æªå é¤ 1ï¼å·²å é¤ï¼") private String delFlag; /** ç¶GUID */ @ApiModelProperty("ç¶GUID") @Excel(name = "ç¶GUID") private String pguid; /** GUID */ @ApiModelProperty("GUID") @Excel(name = "GUID") private String guid; /** ç¶ID */ @ApiModelProperty("ç¶ID") @Excel(name = "ç¶ID") private Long pid; /** å»é¢æºæID */ @ApiModelProperty("å»é¢æºæID") @Excel(name = "å»é¢æºæID") private String orgid; /** é¢åº */ @ApiModelProperty("é¢åº") @Excel(name = "é¢åº") private String campusid; /** ä¸ä¼ æ¶é´ */ @ApiModelProperty("ä¸ä¼ æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "ä¸ä¼ æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date uploadTime; /** é¨é¨ç¼ç */ @ApiModelProperty("é¨é¨ç¼ç ") @Excel(name = "é¨é¨ç¼ç ") private String deptcode; /** é¨é¨ç¼ç åç§° */ @ApiModelProperty("é¨é¨ç¼ç åç§°") @Excel(name = "é¨é¨ç¼ç åç§°") private String deptname; /** ç åºç¼ç */ @ApiModelProperty("ç åºç¼ç ") @Excel(name = "ç åºç¼ç ") private String wardcode; /** ç åºç¼ç åç§° */ @ApiModelProperty("ç åºç¼ç åç§°") @Excel(name = "ç åºç¼ç åç§°") private String wardname; } smartor/src/main/java/com/smartor/mapper/ServiceTaskRuleMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,71 @@ package com.smartor.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import com.smartor.domain.ServiceTaskRule; /** * 任塿§è¡è§åMapperæ¥å£ * * @author lihu * @date 2026-05-15 */ @Mapper public interface ServiceTaskRuleMapper { /** * æ¥è¯¢ä»»å¡æ§è¡è§å * * @param id 任塿§è¡è§åä¸»é® * @return 任塿§è¡è§å */ public ServiceTaskRule selectServiceTaskRuleById(Long id); /** * æ¥è¯¢ä»»å¡æ§è¡è§åå表 * * @param serviceTaskRule 任塿§è¡è§å * @return 任塿§è¡è§åéå */ public List<ServiceTaskRule> selectServiceTaskRuleList(ServiceTaskRule serviceTaskRule); /** * æ°å¢ä»»å¡æ§è¡è§å * * @param serviceTaskRule 任塿§è¡è§å * @return ç»æ */ public int insertServiceTaskRule(ServiceTaskRule serviceTaskRule); /** * ä¿®æ¹ä»»å¡æ§è¡è§å * * @param serviceTaskRule 任塿§è¡è§å * @return ç»æ */ public int updateServiceTaskRule(ServiceTaskRule serviceTaskRule); /** * å é¤ä»»å¡æ§è¡è§å * * @param id 任塿§è¡è§åä¸»é® * @return ç»æ */ public int deleteServiceTaskRuleById(Long id); /** * æ¹éå é¤ä»»å¡æ§è¡è§å * * @param ids éè¦å é¤çæ°æ®ä¸»é®éå * @return ç»æ */ public int deleteServiceTaskRuleByIds(Long[] ids); /** * æ ¹æ®ç§å®¤ç¼ç åç åºç¼ç æ¥è¯¢ä»»å¡æ§è¡è§å * * @param serviceTaskRule æ¥è¯¢æ¡ä»¶ï¼å å«deptcodeåwardcodeåæ®µï¼ * @return 任塿§è¡è§å */ public ServiceTaskRule selectServiceTaskRuleByDeptOrWard(ServiceTaskRule serviceTaskRule); } smartor/src/main/java/com/smartor/service/IServiceTaskRuleService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,61 @@ package com.smartor.service; import java.util.List; import com.smartor.domain.ServiceTaskRule; /** * 任塿§è¡è§åServiceæ¥å£ * * @author lihu * @date 2026-05-15 */ public interface IServiceTaskRuleService { /** * æ¥è¯¢ä»»å¡æ§è¡è§å * * @param id 任塿§è¡è§åä¸»é® * @return 任塿§è¡è§å */ public ServiceTaskRule selectServiceTaskRuleById(Long id); /** * æ¥è¯¢ä»»å¡æ§è¡è§åå表 * * @param serviceTaskRule 任塿§è¡è§å * @return 任塿§è¡è§åéå */ public List<ServiceTaskRule> selectServiceTaskRuleList(ServiceTaskRule serviceTaskRule); /** * æ°å¢ä»»å¡æ§è¡è§å * * @param serviceTaskRule 任塿§è¡è§å * @return ç»æ */ public int insertServiceTaskRule(ServiceTaskRule serviceTaskRule); /** * ä¿®æ¹ä»»å¡æ§è¡è§å * * @param serviceTaskRule 任塿§è¡è§å * @return ç»æ */ public int updateServiceTaskRule(ServiceTaskRule serviceTaskRule); /** * æ¹éå é¤ä»»å¡æ§è¡è§å * * @param ids éè¦å é¤ç任塿§è¡è§å主é®éå * @return ç»æ */ public int deleteServiceTaskRuleByIds(Long[] ids); /** * å é¤ä»»å¡æ§è¡è§åä¿¡æ¯ * * @param id 任塿§è¡è§åä¸»é® * @return ç»æ */ public int deleteServiceTaskRuleById(Long id); } smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -57,6 +57,8 @@ private PatMedOperationMapper patMedOperationMapper; @Autowired private PatMedOperationItemMapper patMedOperationItemMapper; @Autowired private ServiceTaskRuleMapper serviceTaskRuleMapper; @Value("${spring.profiles.active}") private String active; @@ -307,27 +309,13 @@ } } //2.åºé¢é访 String generationRule = iSysConfigService.selectConfigByKey("multitask.generation.rule"); //generationRule 0:æææå¡é½çæ; 1:ä¸ç ä»»å¡ä¼å if ("0".equals(generationRule)) { //ç§å®¤ä»»å¡æ°å¢ addDeptSubTask(config, generationRule); //2.åºé¢é访 - åºäºè§åçä»»å¡çæ addSubTaskByRule(config); //æ ¹æ®æ£è æå¨ç åºï¼è·å该ç åºçé¿æä»»å¡,æ°åå»é¢å¯ä»¥å ä¸ç¨æ ¹æ®ç åºåç¾ç æ¥å if (!active.equals("xh")) { addWardSubTask(config, generationRule); addIcd10SubTask(config, generationRule); addOperationSubTask(config, generationRule); } addOperationSubTask(config); } //丽水çç¹æ®è¦æ±ï¼éè¦å æ§è¡ç¾ç ï¼å¦æç¾ç 为空ï¼åæ§è¡ç§å®¤åç åºï¼ if ("1".equals(generationRule)) { addIcd10SubTask(config, generationRule); //ç§å®¤ä»»å¡æ°å¢ addDeptSubTask(config, generationRule); addWardSubTask(config, generationRule); } //è·åæªå¤çå¨é¢çæ°æ®(妿åååºé¢çæ£è æ°æ®çåºé¢æ¶é´,å¨ä¸é¢æ¥è¯¢åºçå ¥é¢æ¶é´ä¹å,é£ä¹åçåºé¢æ£è çæ°æ®,ä¹å¾åæ,å 为åå ¥é¢äº) PatMedInhosp patMedInhosp = new PatMedInhosp(); @@ -1178,7 +1166,7 @@ } } private void addOperationSubTask(String config, String generationRule) { private void addOperationSubTask(String config) { // ææ¯é访 PatMedOperationItem pmoi = new PatMedOperationItem(); //è·åéè¦åºé¢ç¾ç éè®¿ï¼æªå¤ççæ°æ® @@ -1223,7 +1211,7 @@ } } private void addIcd10SubTask(String config, String generationRule) { private void addIcd10SubTask(String config) { PatMedInhosp pmjb = new PatMedInhosp(); //è·åéè¦åºé¢ç¾ç éè®¿ï¼æªå¤ççæ°æ® pmjb.setDiagcheckFlag("0"); @@ -1314,7 +1302,7 @@ } } private void addWardSubTask(String config, String generationRule) { private void addWardSubTask(String config) { PatMedInhosp pmbq = new PatMedInhosp(); //è·åéè¦åºé¢é¨é¨éè®¿ï¼æªå¤ççæ°æ® pmbq.setWardcheckFlag("0"); @@ -1383,7 +1371,7 @@ } } private void addDeptSubTask(String config, String generationRule) { private void addDeptSubTask(String config) { //è·åéè¦åºé¢é¨é¨éè®¿ï¼æªå¤ççæ°æ® PatMedInhosp pmks = new PatMedInhosp(); pmks.setDeptcheckFlag("0"); @@ -1443,5 +1431,264 @@ } } /** * åºäºè§åçä»»å¡çææ¹æ³ * æ ¹æ®æ£è 离é¢ç§å®¤æç åºæ¥è¯¢service_task_ruleï¼è·ådeptRuleãwradRuleãdiagRule * æ ¹æ®è§åå¼å³å®è°ç¨åªä¸ªæ¹æ³çæéè®¿ä»»å¡ */ private void addSubTaskByRule(String config) { // è·åææéè¦å¤ççåºé¢æ£è ï¼ç§å®¤ç»´åº¦æªå¤çï¼ PatMedInhosp pmks = new PatMedInhosp(); pmks.setDeptcheckFlag("0"); pmks.setInhospstate("1"); pmks.setFuflag("1"); List<PatMedInhosp> patMedInhosps = patMedInhospMapper.selectPatMedInhospList(pmks); log.info("ãåºäºè§åãéè¦å¤ççåºé¢æ£è ä¿¡æ¯ï¼{}", CollectionUtils.isNotEmpty(patMedInhosps) ? patMedInhosps.size() : null); for (PatMedInhosp patMedInhosp1 : patMedInhosps) { // è·åæ£è åºæ¬ä¿¡æ¯ PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedInhosp1.getPatid()); if (Objects.isNull(patArchive)) { patMedInhosp1.setDeptcheckFlag("2"); patMedInhosp1.setLongTaskReason("æ£è åºæ¬ä¿¡æ¯ä¸ºç©º"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); continue; } try { // æ¥è¯¢è§åï¼æ ¹æ®ç¦»é¢ç§å®¤æç åº ServiceTaskRule ruleQuery = new ServiceTaskRule(); ruleQuery.setDeptcode(patMedInhosp1.getLeaveldeptcode()); ruleQuery.setWardcode(patMedInhosp1.getLeavehospitaldistrictcode()); ServiceTaskRule rule = serviceTaskRuleMapper.selectServiceTaskRuleByDeptOrWard(ruleQuery); if (rule == null) { // è§å为空ï¼å ¨é¨çæ log.info("ãåºäºè§åãæ£è {}æªé ç½®è§åï¼æ§è¡å ¨é¨çæé»è¾", patMedInhosp1.getInhospid()); addDeptSubTaskForPatient(patMedInhosp1, patArchive, config); if (!active.equals("xh")) { addWardSubTaskForPatient(patMedInhosp1, patArchive, config); addIcd10SubTaskForPatient(patMedInhosp1, patArchive, config); } } else { // æè§åï¼æè§åæ§è¡ log.info("ãåºäºè§åãæ£è {}æ¥è¯¢å°è§åï¼deptRule={}, wradRule={}, diagRule={}", patMedInhosp1.getInhospid(), rule.getDeptRule(), rule.getWradRule(), rule.getDiagRule()); // 夿æ¯å¦æè§å为"1"ï¼é¦å æ§è¡ï¼ boolean hasPrimaryRule = "1".equals(rule.getDeptRule()) || "1".equals(rule.getWradRule()) || "1".equals(rule.getDiagRule()); if (hasPrimaryRule) { // æé¦è¦è§åï¼åªæ§è¡é¦è¦è§å对åºçæ¹æ³ int generatedCount = 0; // æé¡ºåºï¼ç§å®¤ -> ç åº -> ç¾ç if ("1".equals(rule.getDeptRule())) { log.info("ãåºäºè§åãæ§è¡ç§å®¤é¦è¦è§å"); generatedCount += addDeptSubTaskForPatient(patMedInhosp1, patArchive, config); } if (!active.equals("xh")) { if ("1".equals(rule.getWradRule())) { log.info("ãåºäºè§åãæ§è¡ç åºé¦è¦è§å"); generatedCount += addWardSubTaskForPatient(patMedInhosp1, patArchive, config); } if ("1".equals(rule.getDiagRule())) { log.info("ãåºäºè§åãæ§è¡ç¾ç é¦è¦è§å"); generatedCount += addIcd10SubTaskForPatient(patMedInhosp1, patArchive, config); } } // 妿é¦è¦è§åçæçåä»»å¡ä¸ºç©ºï¼åè°ç¨å ¶ä»æ¬¡è¦è§åçæ¹æ³ if (generatedCount == 0) { log.info("ãåºäºè§åãé¦è¦è§åæªçæåä»»å¡ï¼å¼å§æ§è¡æ¬¡è¦è§å"); if (!"1".equals(rule.getDeptRule()) && StringUtils.isNotEmpty(rule.getDeptRule())) { log.info("ãåºäºè§åãæ§è¡ç§å®¤æ¬¡è¦è§å"); addDeptSubTaskForPatient(patMedInhosp1, patArchive, config); } if (!active.equals("xh")) { if (!"1".equals(rule.getWradRule()) && StringUtils.isNotEmpty(rule.getWradRule())) { log.info("ãåºäºè§åãæ§è¡ç åºæ¬¡è¦è§å"); addWardSubTaskForPatient(patMedInhosp1, patArchive, config); } if (!"1".equals(rule.getDiagRule()) && StringUtils.isNotEmpty(rule.getDiagRule())) { log.info("ãåºäºè§åãæ§è¡ç¾ç 次è¦è§å"); addIcd10SubTaskForPatient(patMedInhosp1, patArchive, config); } } } } else { // 没æé¦è¦è§åï¼é½æ¯"2"æå ¶ä»ï¼ï¼å ¨é¨çæ log.info("ãåºäºè§åãæ é¦è¦è§åï¼æ§è¡å ¨é¨çæé»è¾"); addDeptSubTaskForPatient(patMedInhosp1, patArchive, config); if (!active.equals("xh")) { addWardSubTaskForPatient(patMedInhosp1, patArchive, config); addIcd10SubTaskForPatient(patMedInhosp1, patArchive, config); } } } } catch (Exception e) { e.printStackTrace(); log.error("ãåºäºè§åãæ£è {}å¤çå¼å¸¸ï¼{}", patMedInhosp1.getInhospid(), e.getMessage()); patMedInhosp1.setDeptcheckFlag("2"); patMedInhosp1.setLongTaskReason("åºäºè§åå¤çå¼å¸¸ï¼" + e.getMessage()); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } } } /** * 为å个æ£è çæç§å®¤ç»´åº¦çåä»»å¡ * * @return çæçå任塿°é */ private int addDeptSubTaskForPatient(PatMedInhosp patMedInhosp1, PatArchive patArchive, String config) { int generatedCount = 0; try { //æ ¹æ®æ£è æå¨ç§å®¤ï¼è·å该ç§å®¤çé¿æä»»å¡ ServiceTaskdept serviceTaskdept = new ServiceTaskdept(); serviceTaskdept.setLongtask(1L); serviceTaskdept.setDeptCode(patMedInhosp1.getLeaveldeptcode()); serviceTaskdept.setDeptType("1"); serviceTaskdept.setServiceType("2"); serviceTaskdept.setOrgid(patMedInhosp1.getOrgid()); List<ServiceTaskdept> serviceTaskdepts = serviceTaskdeptMapper.selectServiceTaskdeptList(serviceTaskdept); if (CollectionUtils.isEmpty(serviceTaskdepts)) { PatMedInhosp patMedInhosp = patMedInhospMapper.selectPatMedInhospByInhospid(patMedInhosp1.getInhospid()); patMedInhosp1.setDeptcheckFlag("2"); patMedInhosp1.setLongTaskReason(patMedInhosp.getLongTaskReason() + "该æ£è æå¨ç§å®¤æªé 置离é¢é¿æä»»å¡;"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } else { for (ServiceTaskdept serviceTaskdept1 : serviceTaskdepts) { writeInSubTask(serviceTaskdept1.getTaskId(), true, patMedInhosp1, patArchive, 1, config); generatedCount++; } } } catch (Exception e) { e.printStackTrace(); log.error("ãç§å®¤ä»»å¡ãæ£è {}å¤çå¼å¸¸ï¼{}", patMedInhosp1.getInhospid(), e.getMessage()); patMedInhosp1.setDeptcheckFlag("2"); patMedInhosp1.setLongTaskReason("ç§å®¤ä»»å¡å¤çå¼å¸¸ï¼" + e.getMessage()); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } return generatedCount; } /** * 为å个æ£è çæç åºç»´åº¦çåä»»å¡ * * @return çæçå任塿°é */ private int addWardSubTaskForPatient(PatMedInhosp patMedInhosp1, PatArchive patArchive, String config) { int generatedCount = 0; try { String errorreason = null; List<ServiceTaskdept> serviceTaskdeptList = null; if (!StringUtils.isEmpty(patMedInhosp1.getLeavehospitaldistrictcode())) { ServiceTaskdept serviceTaskdept = new ServiceTaskdept(); serviceTaskdept.setLongtask(1L); serviceTaskdept.setDeptCode(patMedInhosp1.getLeavehospitaldistrictcode()); serviceTaskdept.setDeptType("2"); serviceTaskdept.setServiceType("2"); serviceTaskdept.setOrgid(patMedInhosp1.getOrgid()); serviceTaskdeptList = serviceTaskdeptMapper.selectServiceTaskdeptList(serviceTaskdept); if (CollectionUtils.isEmpty(serviceTaskdeptList)) { errorreason = "该æ£è æå¨ç åºæªé ç½®é¿æä»»å¡;"; } } else { errorreason = "离é¢ç åºä¸ºç©º;"; } if (StringUtils.isNotEmpty(errorreason)) { PatMedInhosp patMedInhosp = patMedInhospMapper.selectPatMedInhospByInhospid(patMedInhosp1.getInhospid()); patMedInhosp1.setWardcheckFlag("2"); patMedInhosp1.setLongTaskReason(StringUtils.isNotEmpty(patMedInhosp.getLongTaskReason()) ? patMedInhosp.getLongTaskReason() + errorreason : errorreason); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } else { for (ServiceTaskdept serviceTaskdept1 : serviceTaskdeptList) { writeInSubTask(serviceTaskdept1.getTaskId(), true, patMedInhosp1, patArchive, 2, config); generatedCount++; } } } catch (Exception e) { e.printStackTrace(); log.error("ãç åºä»»å¡ãæ£è {}å¤çå¼å¸¸ï¼{}", patMedInhosp1.getInhospid(), e.getMessage()); patMedInhosp1.setWardcheckFlag("2"); patMedInhosp1.setLongTaskReason("ç åºä»»å¡å¤çå¼å¸¸ï¼" + e.getMessage()); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } return generatedCount; } /** * 为å个æ£è çæç¾ç 维度çåä»»å¡ * * @return çæçå任塿°é */ private int addIcd10SubTaskForPatient(PatMedInhosp patMedInhosp1, PatArchive patArchive, String config) { int generatedCount = 0; try { if (StringUtils.isEmpty(patMedInhosp1.getLeaveicd10code())) { return 0; } ServiceTaskdiag serviceTaskdiag = new ServiceTaskdiag(); serviceTaskdiag.setLongtask(1L); serviceTaskdiag.setServiceType("2"); if (active.equals("nhfy")) { serviceTaskdiag.setIcd10name(patMedInhosp1.getLeavediagname()); if (StringUtils.isEmpty(patMedInhosp1.getLeavediagname())) { PatMedInhosp patMedInhosp = patMedInhospMapper.selectPatMedInhospByInhospid(patMedInhosp1.getInhospid()); patMedInhosp1.setDiagcheckFlag("2"); patMedInhosp1.setLongTaskReason("该æ£è ä¸»è¯æå称为空;"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); return 0; } } else { serviceTaskdiag.setIcd10code(patMedInhosp1.getLeaveicd10code()); } serviceTaskdiag.setOrgid(patMedInhosp1.getOrgid()); List<ServiceTaskdiag> serviceTaskdiags = serviceTaskdiagMapper.selectServiceTaskdiagListByIcdName(serviceTaskdiag); if (CollectionUtils.isEmpty(serviceTaskdiags)) { PatMedInhosp patMedInhosp = patMedInhospMapper.selectPatMedInhospByInhospid(patMedInhosp1.getInhospid()); patMedInhosp1.setDiagcheckFlag("2"); patMedInhosp1.setLongTaskReason("该æ£è ææ£ç¾ç æªé ç½®é¿æä»»å¡;"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } else { int flag = 0; for (ServiceTaskdiag serviceTaskdiag1 : serviceTaskdiags) { if (StringUtils.isNotEmpty(serviceTaskdiag1.getDeptCode()) && serviceTaskdiag1.getDeptCode().equals(patMedInhosp1.getLeaveldeptcode())) { writeInSubTask(serviceTaskdiag1.getTaskId(), true, patMedInhosp1, patArchive, 3, config); generatedCount++; flag = 1; } else if (StringUtils.isNotEmpty(serviceTaskdiag1.getWardCode()) && serviceTaskdiag1.getWardCode().equals(patMedInhosp1.getLeavehospitaldistrictcode())) { writeInSubTask(serviceTaskdiag1.getTaskId(), true, patMedInhosp1, patArchive, 3, config); generatedCount++; flag = 1; } } if (flag == 0) { log.error("该ç§å®¤æç åºå¯¹äºæ£è ææ£ç¾ç æªé ç½®é¿æä»»å¡,æ£è ï¼{}", patMedInhosp1.getInhospid()); PatMedInhosp patMedInhosp = patMedInhospMapper.selectPatMedInhospByInhospid(patMedInhosp1.getInhospid()); patMedInhosp1.setDiagcheckFlag("2"); patMedInhosp1.setLongTaskReason("该ç§å®¤æç åºå¯¹äºæ£è ææ£ç¾ç æªé ç½®é¿æä»»å¡;"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } } } catch (Exception e) { e.printStackTrace(); log.error("ãç¾ç ä»»å¡ãæ£è {}å¤çå¼å¸¸ï¼{}", patMedInhosp1.getInhospid(), e.getMessage()); patMedInhosp1.setDiagcheckFlag("2"); patMedInhosp1.setLongTaskReason("ç¾ç ä»»å¡å¤çå¼å¸¸ï¼" + e.getMessage()); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } return generatedCount; } } smartor/src/main/java/com/smartor/service/impl/ServiceTaskRuleServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,96 @@ package com.smartor.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.smartor.mapper.ServiceTaskRuleMapper; import com.smartor.domain.ServiceTaskRule; import com.smartor.service.IServiceTaskRuleService; /** * 任塿§è¡è§åServiceä¸å¡å±å¤ç * * @author lihu * @date 2026-05-15 */ @Service public class ServiceTaskRuleServiceImpl implements IServiceTaskRuleService { @Autowired private ServiceTaskRuleMapper serviceTaskRuleMapper; /** * æ¥è¯¢ä»»å¡æ§è¡è§å * * @param id 任塿§è¡è§åä¸»é® * @return 任塿§è¡è§å */ @Override public ServiceTaskRule selectServiceTaskRuleById(Long id) { return serviceTaskRuleMapper.selectServiceTaskRuleById(id); } /** * æ¥è¯¢ä»»å¡æ§è¡è§åå表 * * @param serviceTaskRule 任塿§è¡è§å * @return 任塿§è¡è§å */ @Override public List<ServiceTaskRule> selectServiceTaskRuleList(ServiceTaskRule serviceTaskRule) { return serviceTaskRuleMapper.selectServiceTaskRuleList(serviceTaskRule); } /** * æ°å¢ä»»å¡æ§è¡è§å * * @param serviceTaskRule 任塿§è¡è§å * @return ç»æ */ @Override public int insertServiceTaskRule(ServiceTaskRule serviceTaskRule) { serviceTaskRule.setCreateTime(DateUtils.getNowDate()); return serviceTaskRuleMapper.insertServiceTaskRule(serviceTaskRule); } /** * ä¿®æ¹ä»»å¡æ§è¡è§å * * @param serviceTaskRule 任塿§è¡è§å * @return ç»æ */ @Override public int updateServiceTaskRule(ServiceTaskRule serviceTaskRule) { serviceTaskRule.setUpdateTime(DateUtils.getNowDate()); return serviceTaskRuleMapper.updateServiceTaskRule(serviceTaskRule); } /** * æ¹éå é¤ä»»å¡æ§è¡è§å * * @param ids éè¦å é¤ç任塿§è¡è§åä¸»é® * @return ç»æ */ @Override public int deleteServiceTaskRuleByIds(Long[] ids) { return serviceTaskRuleMapper.deleteServiceTaskRuleByIds(ids); } /** * å é¤ä»»å¡æ§è¡è§åä¿¡æ¯ * * @param id 任塿§è¡è§åä¸»é® * @return ç»æ */ @Override public int deleteServiceTaskRuleById(Long id) { return serviceTaskRuleMapper.deleteServiceTaskRuleById(id); } } smartor/src/main/resources/mapper/smartor/ServiceTaskRuleMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,263 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.smartor.mapper.ServiceTaskRuleMapper"> <resultMap type="com.smartor.domain.ServiceTaskRule" id="ServiceTaskRuleResult"> <result property="id" column="id"/> <result property="deptRule" column="dept_rule"/> <result property="wradRule" column="wrad_rule"/> <result property="diagRule" column="diag_rule"/> <result property="delFlag" column="del_flag"/> <result property="pguid" column="pguid"/> <result property="guid" column="guid"/> <result property="pid" column="pid"/> <result property="orgid" column="orgid"/> <result property="campusid" column="campusid"/> <result property="uploadTime" column="upload_time"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="deptcode" column="deptcode"/> <result property="deptname" column="deptname"/> <result property="wardcode" column="wardcode"/> <result property="wardname" column="wardname"/> </resultMap> <sql id="selectServiceTaskRuleVo"> select id, dept_rule, wrad_rule, diag_rule, del_flag, pguid, guid, pid, orgid, campusid, upload_time, create_by, create_time, update_by, update_time, deptcode, deptname, wardcode, wardname from service_task_rule </sql> <select id="selectServiceTaskRuleList" parameterType="com.smartor.domain.ServiceTaskRule" resultMap="ServiceTaskRuleResult"> <include refid="selectServiceTaskRuleVo"/> where 1=1 and del_flag=0 <if test="deptRule != null and deptRule != ''"> and dept_rule = #{deptRule} </if> <if test="wradRule != null and wradRule != ''"> and wrad_rule = #{wradRule} </if> <if test="diagRule != null and diagRule != ''"> and diag_rule = #{diagRule} </if> <if test="pguid != null and pguid != ''"> and pguid = #{pguid} </if> <if test="guid != null and guid != ''"> and guid = #{guid} </if> <if test="pid != null "> and pid = #{pid} </if> <if test="orgid != null and orgid != ''"> and orgid = #{orgid} </if> <if test="campusid != null and campusid != ''"> and campusid = #{campusid} </if> <if test="uploadTime != null "> and upload_time = #{uploadTime} </if> <if test="deptcode != null and deptcode != ''"> and deptcode = #{deptcode} </if> <if test="deptname != null and deptname != ''"> and deptname like concat('%', #{deptname}, '%') </if> <if test="wardcode != null and wardcode != ''"> and wardcode = #{wardcode} </if> <if test="wardname != null and wardname != ''"> and wardname like concat('%', #{wardname}, '%') </if> </select> <select id="selectServiceTaskRuleById" parameterType="Long" resultMap="ServiceTaskRuleResult"> <include refid="selectServiceTaskRuleVo"/> where id = #{id} </select> <select id="selectServiceTaskRuleByDeptOrWard" parameterType="com.smartor.domain.ServiceTaskRule" resultMap="ServiceTaskRuleResult"> <include refid="selectServiceTaskRuleVo"/> where del_flag = 0 and ( (deptcode = #{deptcode} and deptcode is not null and deptcode != '') or (wardcode = #{wardcode} and wardcode is not null and wardcode != '') ) order by case when deptcode = #{deptcode} then 0 else 1 end limit 1 </select> <insert id="insertServiceTaskRule" parameterType="com.smartor.domain.ServiceTaskRule" useGeneratedKeys="true" keyProperty="id"> insert into service_task_rule <trim prefix="(" suffix=")" suffixOverrides=","> <if test="deptRule != null">dept_rule, </if> <if test="wradRule != null">wrad_rule, </if> <if test="diagRule != null">diag_rule, </if> <if test="delFlag != null">del_flag, </if> <if test="pguid != null">pguid, </if> <if test="guid != null">guid, </if> <if test="pid != null">pid, </if> <if test="orgid != null">orgid, </if> <if test="campusid != null">campusid, </if> <if test="uploadTime != null">upload_time, </if> <if test="createBy != null">create_by, </if> <if test="createTime != null">create_time, </if> <if test="updateBy != null">update_by, </if> <if test="updateTime != null">update_time, </if> <if test="deptcode != null">deptcode, </if> <if test="deptname != null">deptname, </if> <if test="wardcode != null">wardcode, </if> <if test="wardname != null">wardname, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="deptRule != null">#{deptRule}, </if> <if test="wradRule != null">#{wradRule}, </if> <if test="diagRule != null">#{diagRule}, </if> <if test="delFlag != null">#{delFlag}, </if> <if test="pguid != null">#{pguid}, </if> <if test="guid != null">#{guid}, </if> <if test="pid != null">#{pid}, </if> <if test="orgid != null">#{orgid}, </if> <if test="campusid != null">#{campusid}, </if> <if test="uploadTime != null">#{uploadTime}, </if> <if test="createBy != null">#{createBy}, </if> <if test="createTime != null">#{createTime}, </if> <if test="updateBy != null">#{updateBy}, </if> <if test="updateTime != null">#{updateTime}, </if> <if test="deptcode != null">#{deptcode}, </if> <if test="deptname != null">#{deptname}, </if> <if test="wardcode != null">#{wardcode}, </if> <if test="wardname != null">#{wardname}, </if> </trim> </insert> <update id="updateServiceTaskRule" parameterType="com.smartor.domain.ServiceTaskRule"> update service_task_rule <trim prefix="SET" suffixOverrides=","> <if test="deptRule != null">dept_rule = #{deptRule}, </if> <if test="wradRule != null">wrad_rule = #{wradRule}, </if> <if test="diagRule != null">diag_rule = #{diagRule}, </if> <if test="delFlag != null">del_flag = #{delFlag}, </if> <if test="pguid != null">pguid = #{pguid}, </if> <if test="guid != null">guid = #{guid}, </if> <if test="pid != null">pid = #{pid}, </if> <if test="orgid != null">orgid = #{orgid}, </if> <if test="campusid != null">campusid = #{campusid}, </if> <if test="uploadTime != null">upload_time = #{uploadTime}, </if> <if test="createBy != null">create_by = #{createBy}, </if> <if test="createTime != null">create_time = #{createTime}, </if> <if test="updateBy != null">update_by = #{updateBy}, </if> <if test="updateTime != null">update_time = #{updateTime}, </if> <if test="deptcode != null">deptcode = #{deptcode}, </if> <if test="deptname != null">deptname = #{deptname}, </if> <if test="wardcode != null">wardcode = #{wardcode}, </if> <if test="wardname != null">wardname = #{wardname}, </if> </trim> where id = #{id} </update> <update id="deleteServiceTaskRuleById" parameterType="Long"> update service_task_rule <trim prefix="SET" suffixOverrides=","> del_flag =1 </trim> where id = #{id} </update> <update id="deleteServiceTaskRuleByIds" parameterType="String"> update service_task_rule <trim prefix="SET" suffixOverrides=","> del_flag =1 </trim> where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </update> </mapper>