From 8727d97312d4f1778208284f0d49c624805cf0c4 Mon Sep 17 00:00:00 2001 From: limingyu Date: Fri, 26 Apr 2024 11:34:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E4=BD=9C=E4=B8=9A=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=8A=A8=E7=81=AB=E6=96=B9=E6=B3=95=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/HotWorkApplicationServiceImpl.java | 21 ++++++++++++++++++- .../highriskwork/HotWorkApplicationMapper.xml | 6 +++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zcloud/service/highriskwork/impl/HotWorkApplicationServiceImpl.java b/src/main/java/com/zcloud/service/highriskwork/impl/HotWorkApplicationServiceImpl.java index 5c13c373..439a4590 100644 --- a/src/main/java/com/zcloud/service/highriskwork/impl/HotWorkApplicationServiceImpl.java +++ b/src/main/java/com/zcloud/service/highriskwork/impl/HotWorkApplicationServiceImpl.java @@ -3,9 +3,12 @@ package com.zcloud.service.highriskwork.impl; import java.util.Date; import java.util.List; +import com.zcloud.entity.system.Dictionaries; import com.zcloud.service.highriskwork.HotWorkApplicationDelayedService; import com.zcloud.service.highriskwork.HotWorkApplicationUserService; +import com.zcloud.service.system.DictionariesService; import com.zcloud.util.DateUtil; +import com.zcloud.util.Tools; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -30,6 +33,8 @@ public class HotWorkApplicationServiceImpl implements HotWorkApplicationService{ private HotWorkApplicationUserService hotWorkApplicationUserService; @Autowired private HotWorkApplicationDelayedService hotWorkApplicationDelayedService; + @Autowired + private DictionariesService dictionariesService; /**新增 * @param pd @@ -87,7 +92,21 @@ public class HotWorkApplicationServiceImpl implements HotWorkApplicationService{ * @throws Exception */ public PageData findById(PageData pd)throws Exception{ - return hotworkapplicationMapper.findById(pd); + PageData data = hotworkapplicationMapper.findById(pd); + String workMethodId = data.getString("HOT_WORK_METHOD_ID"); + //动火方法 + if (Tools.notEmpty(workMethodId)) { + String[] split = workMethodId.split(","); + List dictionaries = dictionariesService.listSubDictByIds(split); + StringBuilder methodName = new StringBuilder(); + for (Dictionaries dictionary : dictionaries) { + methodName.append(dictionary.getNAME()).append(","); + } + methodName.deleteCharAt(methodName.length() - 1); + data.put("HOT_WORK_METHOD_NAME", methodName); + } + + return data; } /**批量删除 diff --git a/src/main/resources/mybatis/datasource/highriskwork/HotWorkApplicationMapper.xml b/src/main/resources/mybatis/datasource/highriskwork/HotWorkApplicationMapper.xml index 2df76a17..1f51a337 100644 --- a/src/main/resources/mybatis/datasource/highriskwork/HotWorkApplicationMapper.xml +++ b/src/main/resources/mybatis/datasource/highriskwork/HotWorkApplicationMapper.xml @@ -155,13 +155,13 @@ select , u.NAME CREATORNAME, - d.NAME DEPARTMENTNAME, - p.name as HOT_WORK_METHOD_NAME + d.NAME DEPARTMENTNAME + from f left join sys_user u on f.CREATOR = u.USER_ID left join oa_department d on d.DEPARTMENT_ID = u.DEPARTMENT_ID - left join sys_dictionaries p on f.HOT_WORK_METHOD_ID = p.DICTIONARIES_ID + where f.HOTWORKAPPLICATION_ID = #{HOTWORKAPPLICATION_ID}