From f5fade663b80c711656aacea6ecda90d0b0c2b1e Mon Sep 17 00:00:00 2001 From: zpl Date: Thu, 19 Aug 2021 08:12:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=BB=B4=E4=BF=AE=EF=BC=8C?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E6=98=BE=E7=A4=BA=E5=90=8D=E7=A7=B0=E3=80=81?= =?UTF-8?q?=E4=B8=8D=E8=89=AF=E4=BB=A3=E7=A0=81=E6=98=BE=E7=A4=BA=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ResourceInspectTaskController.java | 2 +- .../ResourceRepairTaskController.java | 16 ++++++++- .../equip/model/ResourceRepairTask.java | 32 +++++++++--------- .../service/ResourceRepairTaskService.java | 3 ++ .../impl/ResourceRepairTaskServiceImpl.java | 33 ++++++++++++++++++- .../mesnac/meapi/mapper/NwaUserMapper.java | 6 ++++ .../main/resources/mapper/NwaUserMapper.xml | 14 ++++++++ 7 files changed, 88 insertions(+), 18 deletions(-) diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskController.java b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskController.java index f0d8b0bc..57d9e2a7 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskController.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskController.java @@ -235,7 +235,7 @@ public class ResourceInspectTaskController { try { return R.ok(resourceInspectTaskService.getInspectTaskByResource(resourceInspectTaskDto)); }catch (Exception e){ - return R.failed("数据更新失败" + e.getMessage()); + return R.failed("查询失败:" + e.getMessage()); } } diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java index 7c547d1d..e4cc920e 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java @@ -26,6 +26,21 @@ public class ResourceRepairTaskController { @Autowired public ResourceRepairTaskService resourceRepairTaskService; + + /** + * 界面数据字段初始化 + * @param + * @return + */ + @GetMapping("/init") + public R init(){ + try{ + return R.ok(resourceRepairTaskService.init()); + }catch (Exception e){ + return R.failed("" + e.getMessage()); + } + } + /** * 根据id查询 * @@ -271,5 +286,4 @@ public class ResourceRepairTaskController { } - } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceRepairTask.java b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceRepairTask.java index 114078b9..621f001d 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceRepairTask.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceRepairTask.java @@ -282,29 +282,19 @@ public class ResourceRepairTask extends Model { */ @TableField(exist = false) private String compareStartDate; - /** - * 比较时间,终 - */ + /**比较时间,终*/ @TableField(exist = false) private String compareEndDate; - /** - * 备品清单 - */ + /**备品清单*/ @TableField(exist = false) private List spareList; - /** - * 序号 - */ + /**序号*/ @TableField(exist = false) private Integer seq; - /** - * 提报人名称 - */ + /**提报人名称*/ @TableField(exist = false) private String reportUserName; - /** - * 取消代码描述 - */ + /**取消代码描述*/ @TableField(exist = false) private String cancelCodeDescription; /**取消用户名称**/ @@ -313,6 +303,18 @@ public class ResourceRepairTask extends Model { /**不良代码名称**/ @TableField(exist = false) private String ncCodeNoDescription; + /**维修人员名称*/ + @TableField(exist = false) + private String repairUserName; + + + public String getRepairUserName() { + return repairUserName; + } + + public void setRepairUserName(String repairUserName) { + this.repairUserName = repairUserName; + } public String getNcCodeNoDescription() { return ncCodeNoDescription; diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceRepairTaskService.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceRepairTaskService.java index a6890c93..b86159de 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceRepairTaskService.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceRepairTaskService.java @@ -5,6 +5,7 @@ import com.foreverwin.mesnac.equip.model.ResourceRepairTask; import com.baomidou.mybatisplus.extension.service.IService; import com.foreverwin.modular.core.util.FrontPage; +import java.util.HashMap; import java.util.List; /** @@ -17,6 +18,8 @@ import java.util.List; */ public interface ResourceRepairTaskService extends IService { + HashMap init(); + /** * 分页查询 * @param frontPage diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java index 0adbf540..d51e8e29 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java @@ -6,7 +6,10 @@ import com.foreverwin.mesnac.common.helper.NextNumberHelper; import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare; import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService; import com.foreverwin.mesnac.meapi.dto.NcCodeDto; +import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper; +import com.foreverwin.mesnac.meapi.model.DataField; import com.foreverwin.mesnac.meapi.model.NwaUser; +import com.foreverwin.mesnac.meapi.service.DataFieldListService; import com.foreverwin.mesnac.meapi.service.NcCodeService; import com.foreverwin.mesnac.meapi.service.NwaUserService; import com.foreverwin.mesnac.meapi.service.ResrceService; @@ -53,6 +56,23 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl init() { + HashMap hashMap = new HashMap<>(); + String site = CommonMethods.getSite(); + //原因分类 + DataField dealWay = new DataField(); + dealWay.setSite(site); + dealWay.setDataField("REPAIR_DEAL_WAY"); + List dealWayList = dataFieldListService.findDataFieldListById(dealWay); + hashMap.put("REPAIR_DEAL_WAY",dealWayList); + return hashMap; + } @Override public IPage selectPage(FrontPage frontPage, ResourceRepairTask resourceRepairTask) { @@ -240,11 +260,22 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl spareList = resourceInspectTaskSpareService.selectList(taskSpare); - ResourceRepairTask repairTask = resourceRepairTaskMapper.findResourceRepairTaskByHandleAndSite(site, handle); repairTask.setSpareList(spareList); + // 维修用户的中文名称 + String repairUsers = repairTask.getRepairUsers(); + if (repairUsers != null && !repairUsers.equals("")){ + String[] split = repairUsers.split(","); + if (split.length > 0){ + List list = Arrays.asList(split); + String userNameList = nwaUserMapper.getFullNameCommaByUserNameList(site, list); + repairTask.setRepairUserName(userNameList); + } + } return repairTask; } diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/NwaUserMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/NwaUserMapper.java index 692d4e42..379b7e72 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/NwaUserMapper.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/NwaUserMapper.java @@ -24,4 +24,10 @@ public interface NwaUserMapper extends BaseMapper { List selectAllByUserGroups(@Param("site")String site,@Param("list")List list); int checkUser(@Param("site")String site,@Param("list")List list); + + /** + * 根据多个用户userName,查询用户名称,并使用 , 分割返回 + * */ + String getFullNameCommaByUserNameList(@Param("site")String site,@Param("list")List list); + } \ No newline at end of file diff --git a/meapi/src/main/resources/mapper/NwaUserMapper.xml b/meapi/src/main/resources/mapper/NwaUserMapper.xml index aabdef65..2c98a8d2 100644 --- a/meapi/src/main/resources/mapper/NwaUserMapper.xml +++ b/meapi/src/main/resources/mapper/NwaUserMapper.xml @@ -596,4 +596,18 @@ ) + + +