From 7367cc2773210968a656b6fe46ad2b33aa23dd19 Mon Sep 17 00:00:00 2001 From: zpl Date: Wed, 25 Aug 2021 17:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E4=B8=80=E8=AE=BE=E5=A4=87=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E7=BB=B4=E6=8A=A4=E7=9B=B8=E5=90=8C=E7=82=B9=E6=A3=80?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E7=82=B9=E6=A3=80=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equip/mapper/ResourceInspectTaskMapper.java | 4 ++++ .../impl/ResourceInspectPlanServiceImpl.java | 12 ++++++++++++ .../mapper/ResourceInspectTaskMapper.xml | 17 ++++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskMapper.java b/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskMapper.java index c20fc4e9..4144b9d0 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskMapper.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskMapper.java @@ -3,6 +3,7 @@ package com.foreverwin.mesnac.equip.mapper; import com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto; import com.foreverwin.mesnac.equip.model.ResourceInspectTask; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; @@ -46,4 +47,7 @@ public interface ResourceInspectTaskMapper extends BaseMapper resourceColl = new ArrayList<>(); + StringBuffer resInfo = new StringBuffer("["); for (ResourceInspectResource equip: equips) { equip.setResourceInspectPlanBo(handle); equip.setCreateUser(user); equip.setCreatedDateTime(LocalDateTime.now()); String resourceNo = equip.getResourceNo(); + Integer cnt = resourceInspectTaskMapper.findResourceTaskByResrceAndCategory(site, category, resourceNo); + if (cnt > 0){ + resInfo.append(resourceNo+","); + } String resourceHandle = HandleEnum.RESOURCE.getHandle(site, resourceNo); equip.setHandle(HandleEnum.RESOURCE_INSPECT_RESOURCE.getHandle(site,handle,resourceHandle)); resourceColl.add(equip); } + if (!resInfo.equals("")){ + throw BusinessException.build("设备编号" + resInfo.append("]") + "已经维护了相同点检类型的点检计划!"); + } resourceInspectResourceService.saveBatch(resourceColl); // 保存用户组清单 List userGroups = resourceInspectPlan.getInspectPlanUserGroupList(); @@ -380,6 +389,9 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl - AND ZRIT.resrce = #{resrce} + AND ZRIT.RESRCE = #{resrce} + + + AND ZRIT.CATEGORY = #{category} + + + AND ZRIT.TASK_CREATE_DATE <= #{planCompleteDate} + + + AND ZRIT.TASK_CREATE_DATE >= #{planStartDate} + + +