From a08c76aaaad27147172731c195118ba78ca2e9c0 Mon Sep 17 00:00:00 2001 From: zpl Date: Fri, 25 Jun 2021 09:17:47 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97--=E8=AE=BE=E5=A4=87=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=A8=A1=E5=9D=97=E8=87=AA=E5=8A=A8=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E4=BB=BB=E5=8A=A1=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/common/constant/Constants.java | 3 + .../InspectPlanUserGroupController.java | 122 ++++++ .../ResourceInspectPlanController.java | 51 ++- .../ResourceInspectResourceController.java | 4 +- .../ResourceInspectTaskController.java | 16 +- .../mapper/InspectPlanUserGroupMapper.java | 18 + .../mapper/ResourceInspectTaskMapper.java | 2 +- .../equip/model/InspectPlanUserGroup.java | 192 +++++++++ .../equip/model/ResourceInspectPlan.java | 18 +- .../equip/model/ResourceInspectResource.java | 5 + .../equip/model/ResourceInspectTask.java | 18 +- .../service/InspectPlanUserGroupService.java | 30 ++ .../service/ResourceInspectPlanService.java | 9 +- .../ResourceInspectResourceService.java | 3 + .../service/ResourceInspectTaskService.java | 2 +- .../impl/InspectPlanUserGroupServiceImpl.java | 53 +++ .../impl/ResourceInspectPlanServiceImpl.java | 404 ++++++++++++++++-- .../ResourceInspectResourceServiceImpl.java | 7 + .../impl/ResourceInspectTaskServiceImpl.java | 2 +- .../mapper/InspectPlanUserGroupMapper.xml | 354 +++++++++++++++ .../mapper/ResourceInspectTaskMapper.xml | 18 +- .../meapi/controller/UserGroupController.java | 122 ++++++ .../mesnac/meapi/mapper/UserGroupMapper.java | 18 + .../mesnac/meapi/model/UserGroup.java | 145 +++++++ .../meapi/service/UserGroupService.java | 28 ++ .../service/impl/UserGroupServiceImpl.java | 46 ++ .../main/resources/mapper/UserGroupMapper.xml | 332 ++++++++++++++ 27 files changed, 1963 insertions(+), 59 deletions(-) create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/controller/InspectPlanUserGroupController.java create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/mapper/InspectPlanUserGroupMapper.java create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/model/InspectPlanUserGroup.java create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/service/InspectPlanUserGroupService.java create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/InspectPlanUserGroupServiceImpl.java create mode 100644 equip/src/main/resources/mapper/InspectPlanUserGroupMapper.xml create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/UserGroupController.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/UserGroupMapper.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/model/UserGroup.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/service/UserGroupService.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/UserGroupServiceImpl.java create mode 100644 meapi/src/main/resources/mapper/UserGroupMapper.xml diff --git a/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java b/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java index d614969d..24853717 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java @@ -15,4 +15,7 @@ public interface Constants { String STATUS_Y = "Y"; String STATUS_N = "N"; + + //任务编号常量 + String RESOURCE_INSPECT_TASK = "RESOURCE_INSPECT_TASK"; } diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/InspectPlanUserGroupController.java b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/InspectPlanUserGroupController.java new file mode 100644 index 00000000..8aa94c29 --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/InspectPlanUserGroupController.java @@ -0,0 +1,122 @@ +package com.foreverwin.mesnac.equip.controller; + +import com.foreverwin.modular.core.util.R; +import com.foreverwin.modular.core.util.FrontPage; +import com.foreverwin.modular.core.util.CommonMethods; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.foreverwin.mesnac.equip.service.InspectPlanUserGroupService; +import com.foreverwin.mesnac.equip.model.InspectPlanUserGroup; +import java.util.List; + +/** + * + * @author pavel.Liu + * @since 2021-06-18 + */ +@RestController +@RequestMapping("/Z-INSPECT-PLAN-USER-GROUP") +public class InspectPlanUserGroupController { + + @Autowired + public InspectPlanUserGroupService inspectPlanUserGroupService; + + /** + * 根据id查询 + * + * @param id 主键 + * @return + */ + @ResponseBody + @GetMapping("/{id:.+}") + public R getInspectPlanUserGroupById(@PathVariable String id) { + return R.ok( inspectPlanUserGroupService.getById(id)); + } + + /** + * 查询所有数据 + * + * @return + */ + @ResponseBody + @GetMapping("") + public R getInspectPlanUserGroupList(InspectPlanUserGroup inspectPlanUserGroup){ + List result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(inspectPlanUserGroup); + result = inspectPlanUserGroupService.list(queryWrapper); + return R.ok(result); + } + + /** + * 分页查询数据 + * + * @param frontPage 分页信息 + * @return + */ + @ResponseBody + @GetMapping("/page") + public R page(FrontPage frontPage, InspectPlanUserGroup inspectPlanUserGroup){ + IPage result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(inspectPlanUserGroup); + if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { + //TODO modify global query + queryWrapper.lambda().and(wrapper -> wrapper + .like(InspectPlanUserGroup::getHandle, frontPage.getGlobalQuery()) + .or().like(InspectPlanUserGroup::getUserGroupBo, frontPage.getGlobalQuery()) + .or().like(InspectPlanUserGroup::getResourceInspectPlanBo, frontPage.getGlobalQuery()) + .or().like(InspectPlanUserGroup::getCreateUser, frontPage.getGlobalQuery()) + .or().like(InspectPlanUserGroup::getModifyUser, frontPage.getGlobalQuery()) + ); + } + result = inspectPlanUserGroupService.page(frontPage.getPagePlus(), queryWrapper); + return R.ok(result); + } + + /** + * 新增 + * @param inspectPlanUserGroup 传递的实体 + * @return null 失败 实体成功 + */ + @PostMapping + public R save(@RequestBody InspectPlanUserGroup inspectPlanUserGroup) { + return R.ok(inspectPlanUserGroupService.save(inspectPlanUserGroup)); + } + + /** + * 修改 + * @param inspectPlanUserGroup 传递的实体 + * @return null 失败 实体成功 + */ + @PutMapping + public R updateById(@RequestBody InspectPlanUserGroup inspectPlanUserGroup) { + return R.ok(inspectPlanUserGroupService.updateById(inspectPlanUserGroup)); + } + + /** + * 根据id删除对象 + * @param id 实体ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}") + public R removeById(@PathVariable("id") String id){ + return R.ok(inspectPlanUserGroupService.removeById(id)); + } + + /** + * 批量删除对象 + * @param ids 实体集合ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.POST, value = "/delete-batch") + public R removeByIds(List ids){ + return R.ok(inspectPlanUserGroupService.removeByIds(ids)); + } +} \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectPlanController.java b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectPlanController.java index 427d74e1..ce8b990f 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectPlanController.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectPlanController.java @@ -151,7 +151,12 @@ public class ResourceInspectPlanController { */ @PostMapping(value = "/saveOrUpdate") public R saveOrUpdate(@RequestBody ResourceInspectPlan resourceInspectPlan) { - return R.ok(resourceInspectPlanService.saveResourcePlanData(resourceInspectPlan)); + try{ + resourceInspectPlanService.saveResourcePlanData(resourceInspectPlan); + }catch (Exception e){ + return R.failed("更新或保存失败:" + e.getMessage()); + } + return R.ok(); } /** @@ -179,4 +184,48 @@ public class ResourceInspectPlanController { return R.ok(inspectionItemDetailList); } + /** + * 根据handle,查询检验计划 + * @param resourceInspectPlan + * @return + */ + @ResponseBody + @RequestMapping("/getInspectPlanByHandle") + public R getInspectPlanByHandle(ResourceInspectPlan resourceInspectPlan){ + return R.ok(resourceInspectPlanService.getInspectPlanByHandle(resourceInspectPlan)); + } + + /** + * 根据handle,删除检验项目计划 + * @param resourceInspectPlan + * @return + */ + @ResponseBody + @RequestMapping("/deleteInspectionPlanByHandle") + public R deleteInspectionPlanByHandle(ResourceInspectPlan resourceInspectPlan){ + try { + resourceInspectPlanService.deleteInspectionPlanByHandle(resourceInspectPlan); + } catch (Exception e) { + R.failed("计划删除失败:" + e.getMessage()); + } + return R.ok(); + } + + /** + * 自动创建任务。 + * @param resourceInspectPlan + * @return + */ + /*@ResponseBody + @RequestMapping("/autoCreateTaskByResourceInspectPlan") + public R autoCreateTaskByResourceInspectPlan(ResourceInspectPlan resourceInspectPlan){ + try { + resourceInspectPlanService.deleteInspectionPlanByHandle(resourceInspectPlan); + } catch (Exception e) { + R.failed("计划删除失败:" + e.getMessage()); + } + return R.ok(); + }*/ + + } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectResourceController.java b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectResourceController.java index a5c22c40..6bf75dd5 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectResourceController.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectResourceController.java @@ -143,8 +143,8 @@ public class ResourceInspectResourceController { * @return */ @ResponseBody - @RequestMapping(value = "/addEquipList") - public R addEquipList(EquipType resourceType){ + @RequestMapping(value = "/getEquipList") + public R getEquipList(EquipType resourceType){ String equipType = resourceType.getEquipType(); String site = CommonMethods.getSite(); List resourceList = new ArrayList<>(); 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 bc336077..c34fc641 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 @@ -16,7 +16,7 @@ import java.util.List; /** * * @author pavel.Liu - * @since 2021-06-10 + * @since 2021-06-24 */ @RestController @RequestMapping("/Z-RESOURCE-INSPECT-TASK") @@ -45,11 +45,7 @@ public class ResourceInspectTaskController { @ResponseBody @GetMapping("") public R getResourceInspectTaskList(ResourceInspectTask resourceInspectTask){ - List result; - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.setEntity(resourceInspectTask); - result = resourceInspectTaskService.list(queryWrapper); - return R.ok(result); + return R.ok(resourceInspectTaskService.selectList(resourceInspectTask)); } /** @@ -128,4 +124,12 @@ public class ResourceInspectTaskController { public R removeByIds(List ids){ return R.ok(resourceInspectTaskService.removeByIds(ids)); } + + @ResponseBody + @GetMapping("/selectResourceInspectTaskList") + public R selectResourceInspectTaskList(ResourceInspectTask resourceInspectTask){ + return R.ok(resourceInspectTaskService.selectList(resourceInspectTask)); + } + + } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/InspectPlanUserGroupMapper.java b/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/InspectPlanUserGroupMapper.java new file mode 100644 index 00000000..aaf49637 --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/InspectPlanUserGroupMapper.java @@ -0,0 +1,18 @@ +package com.foreverwin.mesnac.equip.mapper; + +import com.foreverwin.mesnac.equip.model.InspectPlanUserGroup; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 设备检验计划从表 Mapper 接口 + *

+ * + * @author pavel.Liu + * @since 2021-06-18 + */ +@Repository +public interface InspectPlanUserGroupMapper extends BaseMapper { + +} \ No newline at end of file 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 4727d3f6..00800775 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 @@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository; *

* * @author pavel.Liu - * @since 2021-06-10 + * @since 2021-06-24 */ @Repository public interface ResourceInspectTaskMapper extends BaseMapper { diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/model/InspectPlanUserGroup.java b/equip/src/main/java/com/foreverwin/mesnac/equip/model/InspectPlanUserGroup.java new file mode 100644 index 00000000..1788709a --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/model/InspectPlanUserGroup.java @@ -0,0 +1,192 @@ +package com.foreverwin.mesnac.equip.model; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import com.baomidou.mybatisplus.annotation.IdType; + +/** + *

+ * 设备检验计划从表 + *

+ * + * @author pavel.Liu + * @since 2021-06-18 + */ + +@TableName("Z_INSPECT_PLAN_USER_GROUP") + +public class InspectPlanUserGroup extends Model { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "HANDLE", type = IdType.INPUT) + private String handle; + /** + * 用户组HANDLE + */ + @TableField("USER_GROUP_BO") + private String userGroupBo; + /** + * 检验计划HANDLE + */ + @TableField("RESOURCE_INSPECT_PLAN_BO") + private String resourceInspectPlanBo; + /** + * 创建人 + */ + @TableField("CREATE_USER") + private String createUser; + /** + * 创建时间 + */ + @TableField("CREATED_DATE_TIME") + private LocalDateTime createdDateTime; + /** + * 修改人 + */ + @TableField("MODIFY_USER") + private String modifyUser; + /** + * 修改时间 + */ + @TableField("MODIFIED_DATE_TIME") + private LocalDateTime modifiedDateTime; + + /*** + * 用户组编号 + */ + @TableField(exist = false) + private String userGroupNo; + /** + * 用户组描述 + */ + @TableField(exist = false) + private String description; + /** + * 序号(仅用于排序) + */ + @TableField(exist = false) + private Integer itemSeq; + + public String getUserGroupNo() { + return userGroupNo; + } + + public void setUserGroupNo(String userGroupNo) { + this.userGroupNo = userGroupNo; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Integer getItemSeq() { + return itemSeq; + } + + public void setItemSeq(Integer itemSeq) { + this.itemSeq = itemSeq; + } + + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public String getUserGroupBo() { + return userGroupBo; + } + + public void setUserGroupBo(String userGroupBo) { + this.userGroupBo = userGroupBo; + } + + public String getResourceInspectPlanBo() { + return resourceInspectPlanBo; + } + + public void setResourceInspectPlanBo(String resourceInspectPlanBo) { + this.resourceInspectPlanBo = resourceInspectPlanBo; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public LocalDateTime getCreatedDateTime() { + return createdDateTime; + } + + public void setCreatedDateTime(LocalDateTime createdDateTime) { + this.createdDateTime = createdDateTime; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public LocalDateTime getModifiedDateTime() { + return modifiedDateTime; + } + + public void setModifiedDateTime(LocalDateTime modifiedDateTime) { + this.modifiedDateTime = modifiedDateTime; + } + +public static final String HANDLE = "HANDLE"; + +public static final String USER_GROUP_BO = "USER_GROUP_BO"; + +public static final String RESOURCE_INSPECT_PLAN_BO = "RESOURCE_INSPECT_PLAN_BO"; + +public static final String CREATE_USER = "CREATE_USER"; + +public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; + +public static final String MODIFY_USER = "MODIFY_USER"; + +public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; + + + @Override + protected Serializable pkVal() { + return this.handle; + } + + @Override + public String toString() { + return "InspectPlanUserGroup{" + + "handle = " + handle + + ", userGroupBo = " + userGroupBo + + ", resourceInspectPlanBo = " + resourceInspectPlanBo + + ", createUser = " + createUser + + ", createdDateTime = " + createdDateTime + + ", modifyUser = " + modifyUser + + ", modifiedDateTime = " + modifiedDateTime + + "}"; + } +} \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectPlan.java b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectPlan.java index 1bc74d3b..eac0fae7 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectPlan.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectPlan.java @@ -8,13 +8,14 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import java.time.LocalDateTime; + import java.util.ArrayList; import java.util.List; import com.baomidou.mybatisplus.annotation.IdType; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.foreverwin.mesnac.common.model.InspectionItemDetail; -//import com.foreverwin.mesnac.quality.model.InspectionItem; /** *

@@ -148,12 +149,17 @@ public class ResourceInspectPlan extends Model { @TableField(exist = false) private List inspectionItemDetailList = new ArrayList<>(); + /** + * 用户组清单 + */ + @TableField(exist = false) + private List inspectPlanUserGroupList = new ArrayList<>(); public List getMaintainPlanEquipList() { return maintainPlanEquipList; } - public void setMaintainPlanEquips(List maintainPlanEquipList) { + public void setMaintainPlanEquipList(List maintainPlanEquipList) { this.maintainPlanEquipList = maintainPlanEquipList; } @@ -165,6 +171,14 @@ public class ResourceInspectPlan extends Model { this.inspectionItemDetailList = inspectionItemDetailList; } + public List getInspectPlanUserGroupList() { + return inspectPlanUserGroupList; + } + + public void setInspectPlanUserGroupList(List inspectPlanUserGroupList) { + this.inspectPlanUserGroupList = inspectPlanUserGroupList; + } + public String getHandle() { return handle; } diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectResource.java b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectResource.java index 2ba2ce0b..ad0296a3 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectResource.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectResource.java @@ -9,7 +9,9 @@ import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import java.time.LocalDateTime; + import com.baomidou.mybatisplus.annotation.IdType; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; /** @@ -51,6 +53,7 @@ public class ResourceInspectResource extends Model { * 设备描述 */ @TableField("DESCRIPTION") +// @TableField(exist = false) private String description; /** * 任务状态(启用/禁用) @@ -61,6 +64,8 @@ public class ResourceInspectResource extends Model { * 任务生成时间 */ @TableField("TASK_CREATE_DATE") +// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") +// @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ss") private LocalDateTime taskCreateDate; /** * 创建人 diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTask.java b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTask.java index b8f1f239..f847f439 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTask.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTask.java @@ -16,7 +16,7 @@ import com.baomidou.mybatisplus.annotation.IdType; *

* * @author pavel.Liu - * @since 2021-06-10 + * @since 2021-06-24 */ @TableName("Z_RESOURCE_INSPECT_TASK") @@ -75,6 +75,11 @@ public class ResourceInspectTask extends Model { */ @TableField("RESULT") private String result; + /** + * 任务创建时间 + */ + @TableField("TASK_CREATE_DATE") + private LocalDateTime taskCreateDate; /** * 计划开始时间 */ @@ -207,6 +212,14 @@ public class ResourceInspectTask extends Model { this.result = result; } + public LocalDateTime getTaskCreateDate() { + return taskCreateDate; + } + + public void setTaskCreateDate(LocalDateTime taskCreateDate) { + this.taskCreateDate = taskCreateDate; + } + public LocalDateTime getPlanStartDate() { return planStartDate; } @@ -307,6 +320,8 @@ public static final String RESOURCE_BO = "RESOURCE_BO"; public static final String RESULT = "RESULT"; +public static final String TASK_CREATE_DATE = "TASK_CREATE_DATE"; + public static final String PLAN_START_DATE = "PLAN_START_DATE"; public static final String PLAN_COMPLETE_DATE = "PLAN_COMPLETE_DATE"; @@ -346,6 +361,7 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; ", inspectionItemBo = " + inspectionItemBo + ", resourceBo = " + resourceBo + ", result = " + result + + ", taskCreateDate = " + taskCreateDate + ", planStartDate = " + planStartDate + ", planCompleteDate = " + planCompleteDate + ", actualStartDate = " + actualStartDate + diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/InspectPlanUserGroupService.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/InspectPlanUserGroupService.java new file mode 100644 index 00000000..73c6b4ad --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/InspectPlanUserGroupService.java @@ -0,0 +1,30 @@ +package com.foreverwin.mesnac.equip.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.equip.model.InspectPlanUserGroup; +import com.baomidou.mybatisplus.extension.service.IService; +import com.foreverwin.modular.core.util.FrontPage; + +import java.util.List; + +/** + *

+ * 设备检验计划从表 服务类 + *

+ * + * @author pavel.Liu + * @since 2021-06-18 + */ +public interface InspectPlanUserGroupService extends IService { + + /** + * 分页查询 + * @param frontPage + * @return + */ + IPage selectPage(FrontPage frontPage, InspectPlanUserGroup inspectPlanUserGroup); + + List selectList(InspectPlanUserGroup inspectPlanUserGroup); + + void deleteAll(InspectPlanUserGroup inspectPlanUserGroup); +} \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectPlanService.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectPlanService.java index 48bf3351..a563e93b 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectPlanService.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectPlanService.java @@ -26,5 +26,12 @@ public interface ResourceInspectPlanService extends IService selectList(ResourceInspectPlan resourceInspectPlan); - boolean saveResourcePlanData(ResourceInspectPlan resourceInspectPlan); + void saveResourcePlanData(ResourceInspectPlan resourceInspectPlan); + + ResourceInspectPlan getInspectPlanByHandle(ResourceInspectPlan resourceInspectPlan); + + void deleteInspectionPlanByHandle(ResourceInspectPlan resourceInspectPlan); + + void autoCreateTaskByResourceInspectPlan(ResourceInspectPlan resourceInspectPlan); + } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectResourceService.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectResourceService.java index 4bae08ee..22809198 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectResourceService.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectResourceService.java @@ -25,4 +25,7 @@ public interface ResourceInspectResourceService extends IService selectPage(FrontPage frontPage, ResourceInspectResource resourceInspectResource); List selectList(ResourceInspectResource resourceInspectResource); + + void deleteAll(ResourceInspectResource resourceInspectResource); + } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java index 03c2e395..c7891d18 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java @@ -13,7 +13,7 @@ import java.util.List; *

* * @author pavel.Liu - * @since 2021-06-10 + * @since 2021-06-24 */ public interface ResourceInspectTaskService extends IService { diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/InspectPlanUserGroupServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/InspectPlanUserGroupServiceImpl.java new file mode 100644 index 00000000..450d63db --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/InspectPlanUserGroupServiceImpl.java @@ -0,0 +1,53 @@ +package com.foreverwin.mesnac.equip.service.impl; + +import com.foreverwin.modular.core.util.FrontPage; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.equip.model.InspectPlanUserGroup; +import com.foreverwin.mesnac.equip.mapper.InspectPlanUserGroupMapper; +import com.foreverwin.mesnac.equip.service.InspectPlanUserGroupService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +/** + *

+ * 设备检验计划从表 服务实现类 + *

+ * + * @author pavel.Liu + * @since 2021-06-18 + */ +@Service +@Transactional(rollbackFor = Exception.class) +public class InspectPlanUserGroupServiceImpl extends ServiceImpl implements InspectPlanUserGroupService { + + + @Autowired + private InspectPlanUserGroupMapper inspectPlanUserGroupMapper; + + @Override + public IPage selectPage(FrontPage frontPage, InspectPlanUserGroup inspectPlanUserGroup) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(inspectPlanUserGroup); + return super.page(frontPage.getPagePlus(), queryWrapper); + } + + @Override + public List selectList(InspectPlanUserGroup inspectPlanUserGroup) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(inspectPlanUserGroup); + return super.list(queryWrapper); + } + + @Override + public void deleteAll(InspectPlanUserGroup inspectPlanUserGroup) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(inspectPlanUserGroup); + super.remove(queryWrapper); + } + + +} \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectPlanServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectPlanServiceImpl.java index 868072f9..fc9c5830 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectPlanServiceImpl.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectPlanServiceImpl.java @@ -1,25 +1,33 @@ package com.foreverwin.mesnac.equip.service.impl; -import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.foreverwin.mesnac.common.constant.Constants; import com.foreverwin.mesnac.common.enums.HandleEnum; +import com.foreverwin.mesnac.common.helper.NextNumberHelper; import com.foreverwin.mesnac.common.model.InspectionItem; +import com.foreverwin.mesnac.common.model.InspectionItemDetail; import com.foreverwin.mesnac.common.service.InspectionItemDetailService; import com.foreverwin.mesnac.common.service.InspectionItemService; -import com.foreverwin.mesnac.equip.model.ResourceInspectResource; -import com.foreverwin.mesnac.equip.service.ResourceInspectResourceService; +import com.foreverwin.mesnac.common.service.NextNumberService; +import com.foreverwin.mesnac.equip.model.*; +import com.foreverwin.mesnac.equip.service.*; +import com.foreverwin.mesnac.meapi.model.UserGroup; +import com.foreverwin.mesnac.meapi.service.UserGroupService; +import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.foreverwin.mesnac.equip.model.ResourceInspectPlan; import com.foreverwin.mesnac.equip.mapper.ResourceInspectPlanMapper; -import com.foreverwin.mesnac.equip.service.ResourceInspectPlanService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; import java.util.List; /** *

@@ -33,22 +41,24 @@ import java.util.List; @Transactional(rollbackFor = Exception.class) public class ResourceInspectPlanServiceImpl extends ServiceImpl implements ResourceInspectPlanService { - @Autowired - private ResourceInspectPlanMapper resourceInspectPlanMapper; - + private NextNumberHelper nextNumberHelper; @Autowired public ResourceInspectPlanService resourceInspectPlanService; - @Autowired public InspectionItemService inspectionItemService; @Autowired public InspectionItemDetailService inspectionItemDetailService; - @Autowired public ResourceInspectResourceService resourceInspectResourceService; - - + @Autowired + public InspectPlanUserGroupService inspectPlanUserGroupService; + @Autowired + public UserGroupService userGroupService; + @Autowired + public ResourceInspectTaskService resourceInspectTaskService; + @Autowired + public ResourceInspectTaskParamService resourceInspectTaskParamService; @Override public IPage selectPage(FrontPage frontPage, ResourceInspectPlan resourceInspectPlan) { @@ -64,53 +74,363 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl resourceWrapper = new QueryWrapper<>(); + resourceWrapper.setEntity(resourceInspect); + resourceInspectResourceService.remove(resourceWrapper);*/ + // 删除用户组清单 + InspectPlanUserGroup inspectPlanUserGroup = new InspectPlanUserGroup(); + inspectPlanUserGroup.setResourceInspectPlanBo(handle); + inspectPlanUserGroupService.deleteAll(inspectPlanUserGroup); } - //2、计划存在: 更新计划主表 - + resourceInspectPlan.setHandle(handle); + // 任务数量-数字型 + Long planTaskCount = resourceInspectPlan.getPlanTaskCount(); //保存计划下设备清单(全删全增) - // 1、全删 - ResourceInspectResource resourceInspect = new ResourceInspectResource(); - resourceInspect.setResourceInspectPlanBo(handle); - QueryWrapper resourceWrapper = new QueryWrapper<>(); - resourceWrapper.setEntity(resourceInspect); -// resourceInspectResourceService.remove(resourceWrapper); - // 2、全增 List equips = resourceInspectPlan.getMaintainPlanEquipList(); + if (equips.size()<1||equips.equals(null)){ + throw BusinessException.build("未添加设备!!!"); + } for (ResourceInspectResource equip: equips) { equip.setResourceInspectPlanBo(handle); equip.setCreateUser(user); equip.setCreatedDateTime(LocalDateTime.now()); -// resourceInspectResourceService.save(equip); + equip.setHandle(handle+";"+equip.getResourceBo()); + resourceInspectResourceService.save(equip); } + // 保存用户组清单 + List userGroups = resourceInspectPlan.getInspectPlanUserGroupList(); + if (userGroups.size()>0||userGroups!=null){ + for (InspectPlanUserGroup userGroup: userGroups) { + userGroup.setResourceInspectPlanBo(handle); + userGroup.setCreateUser(user); + userGroup.setCreatedDateTime(LocalDateTime.now()); + userGroup.setHandle(handle+";"+userGroup.getUserGroupBo()); + inspectPlanUserGroupService.save(userGroup); + } + } + resourceInspectPlanService.saveOrUpdate(resourceInspectPlan); + // 当更新/保存计划时,自动创建任务 + // 计划是否启用,非启用状态不创建 + if (resourceInspectPlan.getStatus().equals("301")){ + resourceInspectPlanService.autoCreateTaskByResourceInspectPlan(resourceInspectPlan); + } + } - // 判断检验项目清单HANDLE是否存在 + /** + * 按HANDLE检索数据 + * 虽然参数是ResourceInspectPlan类型,但按主键检索,返回值只有一个 + * @param resourceInspectPlan + * @return + */ + @Override + public ResourceInspectPlan getInspectPlanByHandle(ResourceInspectPlan resourceInspectPlan) { + QueryWrapper planWrapper = new QueryWrapper<>(); + planWrapper.setEntity(resourceInspectPlan); + List planList = resourceInspectPlanService.list(planWrapper); +// ResourceInspectPlan inspectPlanById = resourceInspectPlanService.getById(resourceInspectPlan.getHandle()); + if (planList.size()<1||planList==null){ + throw BusinessException.build("检验计划编号不存在!!!"); + } + resourceInspectPlan = planList.get(0); + // 根据handle获取设备清单 + String handle = resourceInspectPlan.getHandle(); + ResourceInspectResource resourceInspectResource = new ResourceInspectResource(); + resourceInspectResource.setResourceInspectPlanBo(handle); + List resourceList = resourceInspectResourceService.selectList(resourceInspectResource); + + resourceInspectPlan.setMaintainPlanEquipList(resourceList); + // 项目明细清单——根据项目handle获取 String inspectionItemBo = resourceInspectPlan.getInspectionItemBo(); - InspectionItem inspectionItem = new InspectionItem(); - inspectionItem.setHandle(inspectionItemBo); - QueryWrapper inspectionItemWrapper = new QueryWrapper<>(); - inspectionItemWrapper.setEntity(inspectionItem); - List inspectionItems = inspectionItemService.list(inspectionItemWrapper); - // 如果不存在,则返回错误 - if (inspectionItems==null||inspectionItems.size()<1){ - return false; + InspectionItemDetail inspectionItemDetail = new InspectionItemDetail(); + inspectionItemDetail.setInspectionItemBo(inspectionItemBo); + List itemDetailList = inspectionItemDetailService.selectList(inspectionItemDetail); + resourceInspectPlan.setInspectionItemDetailList(itemDetailList); + // 用户组清单——根据项目计划handle获取 + InspectPlanUserGroup inspectPlanUserGroup = new InspectPlanUserGroup(); + inspectPlanUserGroup.setResourceInspectPlanBo(handle); + List userGroupList = inspectPlanUserGroupService.selectList(inspectPlanUserGroup); + for (InspectPlanUserGroup userGroup:userGroupList) { + String userGroupBo = userGroup.getUserGroupBo(); + UserGroup userGroupById = userGroupService.getById(userGroupBo); + userGroup.setDescription(userGroupById.getDescription()); + userGroup.setUserGroupNo(userGroupById.getUserGroup()); } - resourceInspectPlanService.saveOrUpdate(resourceInspectPlan); - return false; + resourceInspectPlan.setInspectPlanUserGroupList(userGroupList); + + return resourceInspectPlan; + } + + /** + * + * @param resourceInspectPlan + */ + @Override + public void deleteInspectionPlanByHandle(ResourceInspectPlan resourceInspectPlan) { + String handle = resourceInspectPlan.getHandle(); + ResourceInspectPlan inspectPlanById = resourceInspectPlanService.getById(handle); + if (inspectPlanById==null){ + throw BusinessException.build(""); + } + // 设备清单表数据删除 + ResourceInspectResource resourceInspectResource = new ResourceInspectResource(); + resourceInspectResource.setResourceInspectPlanBo(handle); + QueryWrapper resourceQueryWrapper = new QueryWrapper<>(); + resourceQueryWrapper.setEntity(resourceInspectResource); + resourceInspectResourceService.remove(resourceQueryWrapper); + // 用户组清单数据删除 + InspectPlanUserGroup userGroup = new InspectPlanUserGroup(); + userGroup.setResourceInspectPlanBo(handle); + QueryWrapper userGroupWrapper = new QueryWrapper<>(); + userGroupWrapper.setEntity(userGroup); + inspectPlanUserGroupService.remove(userGroupWrapper); + // 主表数据删除 + resourceInspectPlan.getHandle(); + QueryWrapper planQueryWrapper = new QueryWrapper<>(); + planQueryWrapper.setEntity(resourceInspectPlan); + resourceInspectPlanService.remove(planQueryWrapper); + } + + /** + * 自动创建任务 + * @param resourceInspectPlan + */ + @Override + public void autoCreateTaskByResourceInspectPlan(ResourceInspectPlan resourceInspectPlan) { + // 标记字段:0为启用;1为更新 + Integer sign = 0; + // 基本数据 + // 排程周期比较、有效期、任务数量 + String site = resourceInspectPlan.getSite(); + String frequencyUnit = resourceInspectPlan.getFrequencyUnit(); + Double frequency = resourceInspectPlan.getFrequency(); + LocalDateTime indateStart = resourceInspectPlan.getIndateStart(); + LocalDateTime indateEnd = resourceInspectPlan.getIndateEnd(); + Long planTaskCount = resourceInspectPlan.getPlanTaskCount(); + Integer taskCount = Integer.valueOf(planTaskCount.toString()); + // 检验项目清单handle + String planHanlde = resourceInspectPlan.getHandle(); + // 计划状态 + String planStatus = resourceInspectPlan.getStatus(); + // 设备清单 + List maintainPlanEquipList = resourceInspectPlan.getMaintainPlanEquipList(); + // 任务编号、任务handle + List taskNoList = nextNumberHelper.getNextNumber(site, Constants.RESOURCE_INSPECT_TASK, maintainPlanEquipList.size()*taskCount); + // 遍历设备 + int taskNoNum = 0; + for (ResourceInspectResource equip: maintainPlanEquipList) { + // 判断是否创建任务:状态,仅启用状态创建任务 + String equipStatus = equip.getStatus(); + if (!equipStatus.equals("301")){ + continue; + } + String resourceHandle = equip.getResourceBo(); + // 创建检验任务--用于模糊查询 + ResourceInspectTask resourceInspectTask = new ResourceInspectTask(); + // 外键HANDLE:计划HANDLE、设备HANDLE + resourceInspectTask.setResourceInspectPlanBo(planHanlde); + resourceInspectTask.setResourceBo(resourceHandle); + /** + * 按计划handle和设备handle,查询检验任务 + * bug:每次都会获取设备的所有检验任务,不做改动的情况下:数据会累加造成数据遍历量较大 + */ + List taskList = resourceInspectTaskService.selectList(resourceInspectTask); + // 遍历,并选取状态为新建及处理中401新建 301启用 + int taskNum = 0; + if (taskList.size()>0){ + sign = 1; + } + for (ResourceInspectTask task: taskList) { + // 检验任务状态:1、处理中501:不变更任务;2、新建301:将任务状态变为取消 + String taskStatus = task.getStatus(); + if (taskStatus.equals("501")){ + taskNum++; + }else { + if (taskStatus.equals("301")){ + task.setStatus("401"); + resourceInspectTaskService.saveOrUpdate(task); + } + } + } + if (taskNum < taskCount){ + taskNum = taskCount - taskNum; + }else{ + continue; + } + // 判断是否创建任务:任务生成时间在有效期内 + LocalDateTime taskCreateDate = equip.getTaskCreateDate(); + if (taskCreateDate.isAfter(indateStart) && taskCreateDate.isBefore(indateEnd)) { + Collection resourceInspectTaskList = new ArrayList<>(); + if (taskNum == taskCount){ + while (taskNum>0){ + resourceInspectTask.setTaskCreateDate(taskCreateDate); + ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign); + resourceInspectTaskList.add(equipInspectTask); + taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate); + taskNum--; + } + }else{ + // 获取处理中的任务数量 + resourceInspectTask.setStatus("501"); + List taskList2 = resourceInspectTaskService.selectList(resourceInspectTask); + // 获取状态为处理中的最新的任务时间 + LocalDateTime createdDateTime = taskList2.get(0).getCreatedDateTime(); + for (ResourceInspectTask task: taskList2){ + if (task.getCreatedDateTime().isAfter(createdDateTime)){ + createdDateTime = task.getCreatedDateTime(); + } + } + if (taskCreateDate.isAfter(createdDateTime)){ + // 循环创建检验任务 + for (int i = 0;i < taskNum;i++){ + resourceInspectTask.setTaskCreateDate(taskCreateDate); + ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign); + resourceInspectTaskList.add(equipInspectTask); + taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate); + } + }else { + while (taskCreateDate.isBefore(createdDateTime)){ + taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate); + } + for (int i = 0;i < taskNum;i++){ + resourceInspectTask.setTaskCreateDate(taskCreateDate); + ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign); + resourceInspectTaskList.add(equipInspectTask); + taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate); + } + } + } + for (ResourceInspectTask task:resourceInspectTaskList) { + task.setTaskNo(taskNoList.get(taskNoNum)); + task.setHandle(HandleEnum.RESOURCE_INSPECT_TASK.getHandle(site,taskNoList.get(taskNoNum))); + taskNoNum++; + } + resourceInspectTaskService.saveBatch(resourceInspectTaskList); + } + } + } + + /** + * 删除设备清单 + */ + private void deleteEquipList(String ResourceInspectPlanBo){ + ResourceInspectResource resourceInspectResource = new ResourceInspectResource(); + resourceInspectResource.setResourceInspectPlanBo(ResourceInspectPlanBo); + QueryWrapper resourceQueryWrapper = new QueryWrapper<>(); + resourceQueryWrapper.setEntity(resourceInspectResource); + resourceInspectResourceService.remove(resourceQueryWrapper); + } + + /** + * 删除用户组清单 + */ + private void deleteUserGroupList(String ResourceInspectPlanBo){ + InspectPlanUserGroup userGroup = new InspectPlanUserGroup(); + userGroup.setResourceInspectPlanBo(ResourceInspectPlanBo); + QueryWrapper userGroupWrapper = new QueryWrapper<>(); + userGroupWrapper.setEntity(userGroup); + inspectPlanUserGroupService.remove(userGroupWrapper); + } + + /** + * 时间+频率时间 + * 周期:单位、频率;时间 + */ + private LocalDateTime addTime(String frequencyUnit,double frequency,LocalDateTime taskTime){ + long minutes = 0; + switch (frequencyUnit){ + case "D": + minutes = Math.round(frequency*60*24); + break; + case "H": + minutes = Math.round(frequency*60); + break; + case "W": + minutes = Math.round(frequency*60*24*7); + break; + case "M": + minutes = Math.round(frequency*60*24*7*30); + break; + } + return taskTime.plusMinutes(minutes); + } + + /** + * 创建检验任务 + */ + private ResourceInspectTask setResourceInspectTask(ResourceInspectPlan resourceInspectPlan,ResourceInspectTask resourceInspectTask,Integer sign){ + ResourceInspectTask inspectTask = new ResourceInspectTask(); + // 基本字段录入:站点、状态、计划HANDLE、检验项清单HANDLE、检验类型 + inspectTask.setSite(resourceInspectPlan.getSite()); + inspectTask.setStatus("301"); + inspectTask.setResourceInspectPlanBo(resourceInspectPlan.getHandle()); + inspectTask.setInspectionItemBo(resourceInspectPlan.getInspectionItemBo()); + inspectTask.setCategory(resourceInspectPlan.getCategory()); + // 设备HANDLE + inspectTask.setResourceBo(resourceInspectTask.getResourceBo()); + // 任务创建时间 + inspectTask.setTaskCreateDate(resourceInspectTask.getTaskCreateDate()); + // 计划开始、计划完成时间 + LocalDateTime taskCreateDate = inspectTask.getTaskCreateDate(); + Long beforeTolerance = resourceInspectPlan.getBeforeTolerance(); + Long afterTolerance = resourceInspectPlan.getAfterTolerance(); + // 若不存在前后容差,则不提供计划完成时间;计划开始时间为任务创建时间 + if (beforeTolerance == null || beforeTolerance < 0 ){ + inspectTask.setPlanStartDate(taskCreateDate); + }else { + inspectTask.setPlanStartDate(taskCreateDate.minusDays(beforeTolerance)); + } + if (!(afterTolerance < 0 || afterTolerance == null)){ + inspectTask.setPlanCompleteDate(taskCreateDate.plusDays(afterTolerance)); + } + // 创建人员、创建时间;修改人员、修改时间 + if (sign==1){ // sign==1,更新,添加修改人员和修改时间 + inspectTask.setModifyUser(resourceInspectPlan.getModifyUser()); + inspectTask.setModifiedDateTime(resourceInspectPlan.getModifiedDateTime()); + } + inspectTask.setCreateUser(resourceInspectPlan.getCreateUser()); + inspectTask.setCreatedDateTime(LocalDateTime.now()); + return inspectTask; } diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectResourceServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectResourceServiceImpl.java index 7683467d..a4a14f9c 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectResourceServiceImpl.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectResourceServiceImpl.java @@ -42,5 +42,12 @@ public class ResourceInspectResourceServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(resourceInspectResource); + super.remove(queryWrapper); + } + } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java index 9f2e3619..1f268d47 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java @@ -18,7 +18,7 @@ import java.util.List; *

* * @author pavel.Liu - * @since 2021-06-10 + * @since 2021-06-24 */ @Service @Transactional(rollbackFor = Exception.class) diff --git a/equip/src/main/resources/mapper/InspectPlanUserGroupMapper.xml b/equip/src/main/resources/mapper/InspectPlanUserGroupMapper.xml new file mode 100644 index 00000000..840842e2 --- /dev/null +++ b/equip/src/main/resources/mapper/InspectPlanUserGroupMapper.xml @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + HANDLE, USER_GROUP_BO, RESOURCE_INSPECT_PLAN_BO, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO Z_INSPECT_PLAN_USER_GROUP + + HANDLE, + USER_GROUP_BO, + RESOURCE_INSPECT_PLAN_BO, + CREATE_USER, + CREATED_DATE_TIME, + MODIFY_USER, + MODIFIED_DATE_TIME, + VALUES + + #{handle}, + #{userGroupBo}, + #{resourceInspectPlanBo}, + #{createUser}, + #{createdDateTime}, + #{modifyUser}, + #{modifiedDateTime}, + + + + + INSERT INTO Z_INSPECT_PLAN_USER_GROUP + + + VALUES + + #{handle}, + #{userGroupBo}, + #{resourceInspectPlanBo}, + #{createUser}, + #{createdDateTime}, + #{modifyUser}, + #{modifiedDateTime}, + + + + + + UPDATE Z_INSPECT_PLAN_USER_GROUP + USER_GROUP_BO=#{et.userGroupBo}, + RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo}, + CREATE_USER=#{et.createUser}, + CREATED_DATE_TIME=#{et.createdDateTime}, + MODIFY_USER=#{et.modifyUser}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} + + + + + UPDATE Z_INSPECT_PLAN_USER_GROUP + USER_GROUP_BO=#{et.userGroupBo}, + RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo}, + CREATE_USER=#{et.createUser}, + CREATED_DATE_TIME=#{et.createdDateTime}, + MODIFY_USER=#{et.modifyUser}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} + + + + + UPDATE Z_INSPECT_PLAN_USER_GROUP + USER_GROUP_BO=#{et.userGroupBo}, + RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo}, + CREATE_USER=#{et.createUser}, + CREATED_DATE_TIME=#{et.createdDateTime}, + MODIFY_USER=#{et.modifyUser}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + + + + + HANDLE=#{ew.entity.handle} + AND USER_GROUP_BO=#{ew.entity.userGroupBo} + AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} + AND CREATE_USER=#{ew.entity.createUser} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + DELETE FROM Z_INSPECT_PLAN_USER_GROUP WHERE HANDLE=#{handle} + + + + DELETE FROM Z_INSPECT_PLAN_USER_GROUP + + + + + ${k} = #{cm[${k}]} + + + + + + + + DELETE FROM Z_INSPECT_PLAN_USER_GROUP + + + + + HANDLE=#{ew.entity.handle} + + AND USER_GROUP_BO=#{ew.entity.userGroupBo} + AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} + AND CREATE_USER=#{ew.entity.createUser} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + DELETE FROM Z_INSPECT_PLAN_USER_GROUP WHERE HANDLE IN ( + #{item} + ) + + + + diff --git a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml index 6fca8e59..96036da9 100644 --- a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml +++ b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml @@ -14,6 +14,7 @@ + @@ -28,7 +29,7 @@ - HANDLE, SITE, TASK_NO, CATEGORY, DESCRIPTION, STATUS, RESOURCE_INSPECT_PLAN_BO, INSPECTION_ITEM_BO, RESOURCE_BO, RESULT, PLAN_START_DATE, PLAN_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, EXECUTOR, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME + HANDLE, SITE, TASK_NO, CATEGORY, DESCRIPTION, STATUS, RESOURCE_INSPECT_PLAN_BO, INSPECTION_ITEM_BO, RESOURCE_BO, RESULT, TASK_CREATE_DATE, PLAN_START_DATE, PLAN_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, EXECUTOR, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME @@ -72,6 +73,7 @@ AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} AND RESULT=#{ew.entity.result} + AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} @@ -102,6 +104,7 @@ AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} AND RESULT=#{ew.entity.result} + AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} @@ -140,6 +143,7 @@ AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} AND RESULT=#{ew.entity.result} + AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} @@ -178,6 +182,7 @@ AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} AND RESULT=#{ew.entity.result} + AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} @@ -216,6 +221,7 @@ AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} AND RESULT=#{ew.entity.result} + AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} @@ -254,6 +260,7 @@ AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} AND RESULT=#{ew.entity.result} + AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} @@ -292,6 +299,7 @@ AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} AND RESULT=#{ew.entity.result} + AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} @@ -326,6 +334,7 @@ INSPECTION_ITEM_BO, RESOURCE_BO, RESULT, + TASK_CREATE_DATE, PLAN_START_DATE, PLAN_COMPLETE_DATE, ACTUAL_START_DATE, @@ -348,6 +357,7 @@ #{inspectionItemBo}, #{resourceBo}, #{result}, + #{taskCreateDate}, #{planStartDate}, #{planCompleteDate}, #{actualStartDate}, @@ -377,6 +387,7 @@ #{inspectionItemBo}, #{resourceBo}, #{result}, + #{taskCreateDate}, #{planStartDate}, #{planCompleteDate}, #{actualStartDate}, @@ -402,6 +413,7 @@ INSPECTION_ITEM_BO=#{et.inspectionItemBo}, RESOURCE_BO=#{et.resourceBo}, RESULT=#{et.result}, + TASK_CREATE_DATE=#{et.taskCreateDate}, PLAN_START_DATE=#{et.planStartDate}, PLAN_COMPLETE_DATE=#{et.planCompleteDate}, ACTUAL_START_DATE=#{et.actualStartDate}, @@ -427,6 +439,7 @@ INSPECTION_ITEM_BO=#{et.inspectionItemBo}, RESOURCE_BO=#{et.resourceBo}, RESULT=#{et.result}, + TASK_CREATE_DATE=#{et.taskCreateDate}, PLAN_START_DATE=#{et.planStartDate}, PLAN_COMPLETE_DATE=#{et.planCompleteDate}, ACTUAL_START_DATE=#{et.actualStartDate}, @@ -452,6 +465,7 @@ INSPECTION_ITEM_BO=#{et.inspectionItemBo}, RESOURCE_BO=#{et.resourceBo}, RESULT=#{et.result}, + TASK_CREATE_DATE=#{et.taskCreateDate}, PLAN_START_DATE=#{et.planStartDate}, PLAN_COMPLETE_DATE=#{et.planCompleteDate}, ACTUAL_START_DATE=#{et.actualStartDate}, @@ -476,6 +490,7 @@ AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} AND RESULT=#{ew.entity.result} + AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} @@ -531,6 +546,7 @@ AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} AND RESULT=#{ew.entity.result} + AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/UserGroupController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/UserGroupController.java new file mode 100644 index 00000000..46b6d53f --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/UserGroupController.java @@ -0,0 +1,122 @@ +package com.foreverwin.mesnac.meapi.controller; + +import com.foreverwin.modular.core.util.R; +import com.foreverwin.modular.core.util.FrontPage; +import com.foreverwin.modular.core.util.CommonMethods; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.foreverwin.mesnac.meapi.service.UserGroupService; +import com.foreverwin.mesnac.meapi.model.UserGroup; +import java.util.List; + +/** + * + * @author pavel.Liu + * @since 2021-06-18 + */ +@RestController +@RequestMapping("/USER-GROUP") +public class UserGroupController { + + @Autowired + public UserGroupService userGroupService; + + /** + * 根据id查询 + * + * @param id 主键 + * @return + */ + @ResponseBody + @GetMapping("/{id:.+}") + public R getUserGroupById(@PathVariable String id) { + return R.ok( userGroupService.getById(id)); + } + + /** + * 查询所有数据 + * + * @return + */ + @ResponseBody + @GetMapping("") + public R getUserGroupList(UserGroup userGroup){ + List result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(userGroup); + result = userGroupService.list(queryWrapper); + return R.ok(result); + } + + /** + * 分页查询数据 + * + * @param frontPage 分页信息 + * @return + */ + @ResponseBody + @GetMapping("/page") + public R page(FrontPage frontPage, UserGroup userGroup){ + IPage result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(userGroup); + if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { + //TODO modify global query + queryWrapper.lambda().and(wrapper -> wrapper + .like(UserGroup::getHandle, frontPage.getGlobalQuery()) + .or().like(UserGroup::getSite, frontPage.getGlobalQuery()) + .or().like(UserGroup::getUserGroup, frontPage.getGlobalQuery()) + .or().like(UserGroup::getDescription, frontPage.getGlobalQuery()) + .or().like(UserGroup::getWorkstationBo, frontPage.getGlobalQuery()) + ); + } + result = userGroupService.page(frontPage.getPagePlus(), queryWrapper); + return R.ok(result); + } + + /** + * 新增 + * @param userGroup 传递的实体 + * @return null 失败 实体成功 + */ + @PostMapping + public R save(@RequestBody UserGroup userGroup) { + return R.ok(userGroupService.save(userGroup)); + } + + /** + * 修改 + * @param userGroup 传递的实体 + * @return null 失败 实体成功 + */ + @PutMapping + public R updateById(@RequestBody UserGroup userGroup) { + return R.ok(userGroupService.updateById(userGroup)); + } + + /** + * 根据id删除对象 + * @param id 实体ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}") + public R removeById(@PathVariable("id") String id){ + return R.ok(userGroupService.removeById(id)); + } + + /** + * 批量删除对象 + * @param ids 实体集合ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.POST, value = "/delete-batch") + public R removeByIds(List ids){ + return R.ok(userGroupService.removeByIds(ids)); + } +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/UserGroupMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/UserGroupMapper.java new file mode 100644 index 00000000..e3c25641 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/UserGroupMapper.java @@ -0,0 +1,18 @@ +package com.foreverwin.mesnac.meapi.mapper; + +import com.foreverwin.mesnac.meapi.model.UserGroup; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author pavel.Liu + * @since 2021-06-18 + */ +@Repository +public interface UserGroupMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/UserGroup.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/UserGroup.java new file mode 100644 index 00000000..b972fd99 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/UserGroup.java @@ -0,0 +1,145 @@ +package com.foreverwin.mesnac.meapi.model; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import com.baomidou.mybatisplus.annotation.IdType; + +/** + *

+ * + *

+ * + * @author pavel.Liu + * @since 2021-06-18 + */ + +@TableName("USER_GROUP") + +public class UserGroup extends Model { + + private static final long serialVersionUID = 1L; + + @TableId(value = "HANDLE", type = IdType.INPUT) + private String handle; + @TableField("CHANGE_STAMP") + private Long changeStamp; + @TableField("SITE") + private String site; + @TableField("USER_GROUP") + private String userGroup; + @TableField("DESCRIPTION") + private String description; + @TableField("WORKSTATION_BO") + private String workstationBo; + @TableField("CREATED_DATE_TIME") + private LocalDateTime createdDateTime; + @TableField("MODIFIED_DATE_TIME") + private LocalDateTime modifiedDateTime; + + + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public Long getChangeStamp() { + return changeStamp; + } + + public void setChangeStamp(Long changeStamp) { + this.changeStamp = changeStamp; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getUserGroup() { + return userGroup; + } + + public void setUserGroup(String userGroup) { + this.userGroup = userGroup; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getWorkstationBo() { + return workstationBo; + } + + public void setWorkstationBo(String workstationBo) { + this.workstationBo = workstationBo; + } + + public LocalDateTime getCreatedDateTime() { + return createdDateTime; + } + + public void setCreatedDateTime(LocalDateTime createdDateTime) { + this.createdDateTime = createdDateTime; + } + + public LocalDateTime getModifiedDateTime() { + return modifiedDateTime; + } + + public void setModifiedDateTime(LocalDateTime modifiedDateTime) { + this.modifiedDateTime = modifiedDateTime; + } + +public static final String HANDLE = "HANDLE"; + +public static final String CHANGE_STAMP = "CHANGE_STAMP"; + +public static final String SITE = "SITE"; + +public static final String USER_GROUP = "USER_GROUP"; + +public static final String DESCRIPTION = "DESCRIPTION"; + +public static final String WORKSTATION_BO = "WORKSTATION_BO"; + +public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; + +public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; + + + @Override + protected Serializable pkVal() { + return this.handle; + } + + @Override + public String toString() { + return "UserGroup{" + + "handle = " + handle + + ", changeStamp = " + changeStamp + + ", site = " + site + + ", userGroup = " + userGroup + + ", description = " + description + + ", workstationBo = " + workstationBo + + ", createdDateTime = " + createdDateTime + + ", modifiedDateTime = " + modifiedDateTime + + "}"; + } +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/UserGroupService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/UserGroupService.java new file mode 100644 index 00000000..0371a0e7 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/UserGroupService.java @@ -0,0 +1,28 @@ +package com.foreverwin.mesnac.meapi.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.meapi.model.UserGroup; +import com.baomidou.mybatisplus.extension.service.IService; +import com.foreverwin.modular.core.util.FrontPage; + +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author pavel.Liu + * @since 2021-06-18 + */ +public interface UserGroupService extends IService { + + /** + * 分页查询 + * @param frontPage + * @return + */ + IPage selectPage(FrontPage frontPage, UserGroup userGroup); + + List selectList(UserGroup userGroup); +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/UserGroupServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/UserGroupServiceImpl.java new file mode 100644 index 00000000..fc8a1f66 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/UserGroupServiceImpl.java @@ -0,0 +1,46 @@ +package com.foreverwin.mesnac.meapi.service.impl; + +import com.foreverwin.modular.core.util.FrontPage; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.meapi.model.UserGroup; +import com.foreverwin.mesnac.meapi.mapper.UserGroupMapper; +import com.foreverwin.mesnac.meapi.service.UserGroupService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +/** + *

+ * 服务实现类 + *

+ * + * @author pavel.Liu + * @since 2021-06-18 + */ +@Service +@Transactional(rollbackFor = Exception.class) +public class UserGroupServiceImpl extends ServiceImpl implements UserGroupService { + + + @Autowired + private UserGroupMapper userGroupMapper; + + @Override + public IPage selectPage(FrontPage frontPage, UserGroup userGroup) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(userGroup); + return super.page(frontPage.getPagePlus(), queryWrapper); + } + + @Override + public List selectList(UserGroup userGroup) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(userGroup); + return super.list(queryWrapper); + } + + +} \ No newline at end of file diff --git a/meapi/src/main/resources/mapper/UserGroupMapper.xml b/meapi/src/main/resources/mapper/UserGroupMapper.xml new file mode 100644 index 00000000..0fe9eea3 --- /dev/null +++ b/meapi/src/main/resources/mapper/UserGroupMapper.xml @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + HANDLE, CHANGE_STAMP, SITE, USER_GROUP, DESCRIPTION, WORKSTATION_BO, CREATED_DATE_TIME, MODIFIED_DATE_TIME + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO USER_GROUP + + HANDLE, + CHANGE_STAMP, + SITE, + USER_GROUP, + DESCRIPTION, + WORKSTATION_BO, + CREATED_DATE_TIME, + MODIFIED_DATE_TIME, + VALUES + + #{handle}, + #{changeStamp}, + #{site}, + #{userGroup}, + #{description}, + #{workstationBo}, + #{createdDateTime}, + #{modifiedDateTime}, + + + + + INSERT INTO USER_GROUP + + + VALUES + + #{handle}, + #{changeStamp}, + #{site}, + #{userGroup}, + #{description}, + #{workstationBo}, + #{createdDateTime}, + #{modifiedDateTime}, + + + + + + + + + + UPDATE USER_GROUP + HANDLE=#{et.handle}, + CHANGE_STAMP=#{et.changeStamp}, + SITE=#{et.site}, + USER_GROUP=#{et.userGroup}, + DESCRIPTION=#{et.description}, + WORKSTATION_BO=#{et.workstationBo}, + CREATED_DATE_TIME=#{et.createdDateTime}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + + + + + HANDLE=#{ew.entity.handle} + AND CHANGE_STAMP=#{ew.entity.changeStamp} + AND SITE=#{ew.entity.site} + AND USER_GROUP=#{ew.entity.userGroup} + AND DESCRIPTION=#{ew.entity.description} + AND WORKSTATION_BO=#{ew.entity.workstationBo} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + + DELETE FROM USER_GROUP + + + + + ${k} = #{cm[${k}]} + + + + + + + + DELETE FROM USER_GROUP + + + + + HANDLE=#{ew.entity.handle} + + AND CHANGE_STAMP=#{ew.entity.changeStamp} + AND SITE=#{ew.entity.site} + AND USER_GROUP=#{ew.entity.userGroup} + AND DESCRIPTION=#{ew.entity.description} + AND WORKSTATION_BO=#{ew.entity.workstationBo} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + + From 23930608bd094e43456851c26f13c8c382ae19e1 Mon Sep 17 00:00:00 2001 From: zpl Date: Thu, 1 Jul 2021 14:51:38 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97--=E8=AE=BE=E5=A4=87=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=A8=A1=E5=9D=97=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/common/enums/HandleEnum.java | 7 +- .../ResourceInspectTaskController.java | 104 ++++- .../ResourceInspectTaskParamController.java | 11 +- .../ResourceInspectTaskSpareController.java | 126 +++++ .../mapper/ResourceInspectTaskMapper.java | 11 +- .../ResourceInspectTaskParamMapper.java | 2 +- .../ResourceInspectTaskSpareMapper.java | 18 + .../equip/model/ResourceInspectTask.java | 73 ++- .../equip/model/ResourceInspectTaskParam.java | 148 +++--- .../equip/model/ResourceInspectTaskSpare.java | 246 ++++++++++ .../ResourceInspectTaskParamService.java | 5 +- .../service/ResourceInspectTaskService.java | 22 + .../ResourceInspectTaskSpareService.java | 31 ++ .../ResourceInspectTaskParamServiceImpl.java | 9 +- .../impl/ResourceInspectTaskServiceImpl.java | 187 ++++++++ .../ResourceInspectTaskSpareServiceImpl.java | 53 +++ .../mapper/ResourceInspectTaskMapper.xml | 96 +++- .../mapper/ResourceInspectTaskParamMapper.xml | 190 +++++--- .../mapper/ResourceInspectTaskSpareMapper.xml | 434 ++++++++++++++++++ .../minth/generator/GeneratorApplication.java | 2 +- listener/listener.iml | 218 --------- .../meapi/controller/ItemController.java | 1 + .../src/main/resources/mapper/ItemMapper.xml | 2 +- 23 files changed, 1577 insertions(+), 419 deletions(-) create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskSpareController.java create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskSpareMapper.java create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTaskSpare.java create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskSpareService.java create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskSpareServiceImpl.java create mode 100644 equip/src/main/resources/mapper/ResourceInspectTaskSpareMapper.xml delete mode 100644 listener/listener.iml diff --git a/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java b/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java index 814bf48f..74168d4b 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java @@ -84,8 +84,13 @@ public enum HandleEnum { PROD_READY_TASK_DETAIL("ProdReadyTaskDetailBO", "ProdReadyTaskDetailBO:{0},{1}"), /**设备检验任务的检验项**/ - RESOURCE_INSPECT_TASK_PARAM("ResourceInspectTaskParamBo","ResourceInspectTaskParamBo:{0},{1}"); + RESOURCE_INSPECT_TASK_PARAM("ResourceInspectTaskParamBo","ResourceInspectTaskParamBo:{0},{1}"), + /**设备检验任务的检验项**/ + RESOURCE_INSPECT_TASK_SPARE("ResourceInspectTaskSpareBo","ResourceInspectTaskSpareBo:{0},{1}"), + + /**用户**/ + USR("UserBo","UserBo:{0},{1}"); private String prefix; 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 c34fc641..66a458a9 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 @@ -1,5 +1,7 @@ package com.foreverwin.mesnac.equip.controller; +import com.foreverwin.mesnac.common.enums.HandleEnum; +import com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto; import com.foreverwin.modular.core.util.R; import com.foreverwin.modular.core.util.FrontPage; import com.foreverwin.modular.core.util.CommonMethods; @@ -11,12 +13,14 @@ import org.springframework.web.bind.annotation.*; import com.foreverwin.mesnac.equip.service.ResourceInspectTaskService; import com.foreverwin.mesnac.equip.model.ResourceInspectTask; + +import java.time.LocalDateTime; import java.util.List; /** * * @author pavel.Liu - * @since 2021-06-24 + * @since 2021-07-01 */ @RestController @RequestMapping("/Z-RESOURCE-INSPECT-TASK") @@ -45,7 +49,11 @@ public class ResourceInspectTaskController { @ResponseBody @GetMapping("") public R getResourceInspectTaskList(ResourceInspectTask resourceInspectTask){ - return R.ok(resourceInspectTaskService.selectList(resourceInspectTask)); + List result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(resourceInspectTask); + result = resourceInspectTaskService.list(queryWrapper); + return R.ok(result); } /** @@ -72,9 +80,10 @@ public class ResourceInspectTaskController { .or().like(ResourceInspectTask::getResourceInspectPlanBo, frontPage.getGlobalQuery()) .or().like(ResourceInspectTask::getInspectionItemBo, frontPage.getGlobalQuery()) .or().like(ResourceInspectTask::getResourceBo, frontPage.getGlobalQuery()) - .or().like(ResourceInspectTask::getResult, frontPage.getGlobalQuery()) .or().like(ResourceInspectTask::getExecutor, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTask::getResult, frontPage.getGlobalQuery()) .or().like(ResourceInspectTask::getRemark, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTask::getReason, frontPage.getGlobalQuery()) .or().like(ResourceInspectTask::getCreateUser, frontPage.getGlobalQuery()) .or().like(ResourceInspectTask::getModifyUser, frontPage.getGlobalQuery()) ); @@ -125,11 +134,94 @@ public class ResourceInspectTaskController { return R.ok(resourceInspectTaskService.removeByIds(ids)); } + /** + * 模糊查询检验任务 + * @param resourceInspectTaskDto + * @return + */ + @ResponseBody + @GetMapping("/findResourceInspectTaskList") + public R findResourceInspectTaskList(ResourceInspectTaskDto resourceInspectTaskDto){ + String site = CommonMethods.getSite(); + String planNo = resourceInspectTaskDto.getPlanNo(); + String resourceNo = resourceInspectTaskDto.getResourceNo(); + String resourceTypeNo = resourceInspectTaskDto.getResourceTypeNo(); + if (planNo != null){ + resourceInspectTaskDto.setResourceInspectPlanBo(HandleEnum.RESOURCE_INSPECT_PLAN.getHandle(site,planNo)); + } + if (resourceNo != null){ + resourceInspectTaskDto.setResourceBo(HandleEnum.RESOURCE.getHandle(site,resourceNo)); + } + if (resourceTypeNo != null){ + resourceInspectTaskDto.setResourceTypeBo(HandleEnum.RESOURCE_TYPE.getHandle(site,resourceTypeNo)); + } + return R.ok(resourceInspectTaskService.findResourceInspectTaskList(resourceInspectTaskDto)); + } + + + /** + * 任务总览下:点击任务 + * 1、非新建任务,直接返回数据 + * 2、新建任务,需比对检验项清单HANDLE,并创建检验项明细 + * @param resourceInspectTask + * @return + */ + @ResponseBody + @GetMapping("/getAndCreateTaskParamList") + public R getOrCreateTaskParamList(ResourceInspectTask resourceInspectTask){ + ResourceInspectTask inspectTask; + try { + inspectTask = resourceInspectTaskService.getResourceInspectTaskAll(resourceInspectTask); + }catch (Exception e){ + return R.failed("获取数据失败" + e.getMessage()); + } + return R.ok(inspectTask); + } + + /** + * 任务执行:点击开始执行,仅修改任务状态,并绑定执行人 + * @param taskNo + * @return + */ @ResponseBody - @GetMapping("/selectResourceInspectTaskList") - public R selectResourceInspectTaskList(ResourceInspectTask resourceInspectTask){ - return R.ok(resourceInspectTaskService.selectList(resourceInspectTask)); + @GetMapping("/startAndUpdateTask") + public R startAndUpdateTask(String taskNo){ + String handle = HandleEnum.RESOURCE_INSPECT_TASK.getHandle(CommonMethods.getSite(), taskNo); + ResourceInspectTask task = resourceInspectTaskService.getById(handle); + task.setStatus("501"); + task.setActualStartDate(LocalDateTime.now()); + task.setExecutor(CommonMethods.getUser()); + // 保存的数据:id或者handle??? + //task.setExecutor(CommonMethods.getUser()); + try { + resourceInspectTaskService.saveOrUpdate(task); + }catch (Exception e){ + return R.failed("数据更新失败,开始执行异常" + e.getMessage()); + } + return R.ok(task); } + /*** + * 任务执行,状态为处理中/执行中时,点击保存、完成执行按钮: + * 1、仅保存数据 + * 2、完成,保存数据 + * @param + * @return + */ + + @PostMapping ("/saveOrUpdateTaskInfo") + public R saveOrUpdateTaskInfo(@RequestBody ResourceInspectTaskDto resourceInspectTaskDto){ + String user = CommonMethods.getUser(); + String executor = resourceInspectTaskDto.getExecutor(); + if (user.equals(executor)){ + try { + resourceInspectTaskService.saveOrUpdateTaskInfo(resourceInspectTaskDto); + }catch (Exception e){ + return R.failed("数据保存失败" + e.getMessage()); + } + return R.ok(); + } + return R.failed("当前操作用户与执行人不一致,无法保存!!!"); + } } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskParamController.java b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskParamController.java index 254c7b2b..fb097aba 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskParamController.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskParamController.java @@ -16,7 +16,7 @@ import java.util.List; /** * * @author pavel.Liu - * @since 2021-06-10 + * @since 2021-07-01 */ @RestController @RequestMapping("/Z-RESOURCE-INSPECT-TASK-PARAM") @@ -68,17 +68,16 @@ public class ResourceInspectTaskParamController { //TODO modify global query queryWrapper.lambda().and(wrapper -> wrapper .like(ResourceInspectTaskParam::getHandle, frontPage.getGlobalQuery()) - .or().like(ResourceInspectTaskParam::getResourceInspectTaskBo, frontPage.getGlobalQuery()) - .or().like(ResourceInspectTaskParam::getResourceBo, frontPage.getGlobalQuery()) .or().like(ResourceInspectTaskParam::getInspectNo, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskParam::getResourceInspectTaskBo, frontPage.getGlobalQuery()) .or().like(ResourceInspectTaskParam::getDescription, frontPage.getGlobalQuery()) .or().like(ResourceInspectTaskParam::getInspectMethod, frontPage.getGlobalQuery()) .or().like(ResourceInspectTaskParam::getInspectDataType, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskParam::getParamUnit, frontPage.getGlobalQuery()) .or().like(ResourceInspectTaskParam::getRequired, frontPage.getGlobalQuery()) .or().like(ResourceInspectTaskParam::getStandardValue, frontPage.getGlobalQuery()) - .or().like(ResourceInspectTaskParam::getResrceValue, frontPage.getGlobalQuery()) - .or().like(ResourceInspectTaskParam::getParamUnit, frontPage.getGlobalQuery()) - .or().like(ResourceInspectTaskParam::getResrce, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskParam::getResultValue, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskParam::getResult, frontPage.getGlobalQuery()) .or().like(ResourceInspectTaskParam::getRemark, frontPage.getGlobalQuery()) .or().like(ResourceInspectTaskParam::getCreateUser, frontPage.getGlobalQuery()) .or().like(ResourceInspectTaskParam::getModifyUser, frontPage.getGlobalQuery()) diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskSpareController.java b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskSpareController.java new file mode 100644 index 00000000..4a94ea27 --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectTaskSpareController.java @@ -0,0 +1,126 @@ +package com.foreverwin.mesnac.equip.controller; + +import com.foreverwin.modular.core.util.R; +import com.foreverwin.modular.core.util.FrontPage; +import com.foreverwin.modular.core.util.CommonMethods; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService; +import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare; +import java.util.List; + +/** + * + * @author pavel.Liu + * @since 2021-07-01 + */ +@RestController +@RequestMapping("/Z-RESOURCE-INSPECT-TASK-SPARE") +public class ResourceInspectTaskSpareController { + + @Autowired + public ResourceInspectTaskSpareService resourceInspectTaskSpareService; + + /** + * 根据id查询 + * + * @param id 主键 + * @return + */ + @ResponseBody + @GetMapping("/{id:.+}") + public R getResourceInspectTaskSpareById(@PathVariable String id) { + return R.ok( resourceInspectTaskSpareService.getById(id)); + } + + /** + * 查询所有数据 + * + * @return + */ + @ResponseBody + @GetMapping("") + public R getResourceInspectTaskSpareList(ResourceInspectTaskSpare resourceInspectTaskSpare){ + List result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(resourceInspectTaskSpare); + result = resourceInspectTaskSpareService.list(queryWrapper); + return R.ok(result); + } + + /** + * 分页查询数据 + * + * @param frontPage 分页信息 + * @return + */ + @ResponseBody + @GetMapping("/page") + public R page(FrontPage frontPage, ResourceInspectTaskSpare resourceInspectTaskSpare){ + IPage result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(resourceInspectTaskSpare); + if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { + //TODO modify global query + queryWrapper.lambda().and(wrapper -> wrapper + .like(ResourceInspectTaskSpare::getHandle, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskSpare::getSpareNo, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskSpare::getResourceInspectTaskBo, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskSpare::getItemBo, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskSpare::getDescription, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskSpare::getUnit, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskSpare::getRemark, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskSpare::getCreateUser, frontPage.getGlobalQuery()) + .or().like(ResourceInspectTaskSpare::getModifyUser, frontPage.getGlobalQuery()) + ); + } + result = resourceInspectTaskSpareService.page(frontPage.getPagePlus(), queryWrapper); + return R.ok(result); + } + + /** + * 新增 + * @param resourceInspectTaskSpare 传递的实体 + * @return null 失败 实体成功 + */ + @PostMapping + public R save(@RequestBody ResourceInspectTaskSpare resourceInspectTaskSpare) { + return R.ok(resourceInspectTaskSpareService.save(resourceInspectTaskSpare)); + } + + /** + * 修改 + * @param resourceInspectTaskSpare 传递的实体 + * @return null 失败 实体成功 + */ + @PutMapping + public R updateById(@RequestBody ResourceInspectTaskSpare resourceInspectTaskSpare) { + return R.ok(resourceInspectTaskSpareService.updateById(resourceInspectTaskSpare)); + } + + /** + * 根据id删除对象 + * @param id 实体ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}") + public R removeById(@PathVariable("id") String id){ + return R.ok(resourceInspectTaskSpareService.removeById(id)); + } + + /** + * 批量删除对象 + * @param ids 实体集合ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.POST, value = "/delete-batch") + public R removeByIds(List ids){ + return R.ok(resourceInspectTaskSpareService.removeByIds(ids)); + } +} \ No newline at end of file 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 00800775..961a746a 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 @@ -1,18 +1,27 @@ 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.springframework.stereotype.Repository; +import java.util.List; + /** *

* 设备检验任务表 Mapper 接口 *

* * @author pavel.Liu - * @since 2021-06-24 + * @since 2021-07-01 */ @Repository public interface ResourceInspectTaskMapper extends BaseMapper { + /** + * 自定义方法:查询检验任务---检验任务总览 + * @param resourceInspectTaskDto + * @return + */ + List findResourceInspectTaskList(ResourceInspectTaskDto resourceInspectTaskDto); } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskParamMapper.java b/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskParamMapper.java index 7f860924..bbabdd16 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskParamMapper.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskParamMapper.java @@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository; *

* * @author pavel.Liu - * @since 2021-06-10 + * @since 2021-07-01 */ @Repository public interface ResourceInspectTaskParamMapper extends BaseMapper { diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskSpareMapper.java b/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskSpareMapper.java new file mode 100644 index 00000000..28d6b742 --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/mapper/ResourceInspectTaskSpareMapper.java @@ -0,0 +1,18 @@ +package com.foreverwin.mesnac.equip.mapper; + +import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 设备检验任务-备品表 Mapper 接口 + *

+ * + * @author pavel.Liu + * @since 2021-07-01 + */ +@Repository +public interface ResourceInspectTaskSpareMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTask.java b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTask.java index f847f439..fa369638 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTask.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTask.java @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; +import java.util.List; + import com.baomidou.mybatisplus.annotation.IdType; /** @@ -16,7 +18,7 @@ import com.baomidou.mybatisplus.annotation.IdType; *

* * @author pavel.Liu - * @since 2021-06-24 + * @since 2021-07-01 */ @TableName("Z_RESOURCE_INSPECT_TASK") @@ -70,11 +72,6 @@ public class ResourceInspectTask extends Model { */ @TableField("RESOURCE_BO") private String resourceBo; - /** - * 检验结果 - */ - @TableField("RESULT") - private String result; /** * 任务创建时间 */ @@ -105,11 +102,21 @@ public class ResourceInspectTask extends Model { */ @TableField("EXECUTOR") private String executor; + /** + * 检验结果 + */ + @TableField("RESULT") + private String result; /** * 备注 */ @TableField("REMARK") private String remark; + /** + * 取消原因 + */ + @TableField("REASON") + private String reason; /** * 创建人 */ @@ -131,6 +138,27 @@ public class ResourceInspectTask extends Model { @TableField("MODIFIED_DATE_TIME") private LocalDateTime modifiedDateTime; + @TableField(exist = false) + private List taskItemDetailList; + + @TableField(exist = false) + private List taskSpareList; + + public List getTaskItemDetailList() { + return taskItemDetailList; + } + + public void setTaskItemDetailList(List taskItemDetailList) { + this.taskItemDetailList = taskItemDetailList; + } + + public List getTaskSpareList() { + return taskSpareList; + } + + public void setTaskSpareList(List taskSpareList) { + this.taskSpareList = taskSpareList; + } public String getHandle() { return handle; @@ -204,14 +232,6 @@ public class ResourceInspectTask extends Model { this.resourceBo = resourceBo; } - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result; - } - public LocalDateTime getTaskCreateDate() { return taskCreateDate; } @@ -260,6 +280,14 @@ public class ResourceInspectTask extends Model { this.executor = executor; } + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + public String getRemark() { return remark; } @@ -268,6 +296,14 @@ public class ResourceInspectTask extends Model { this.remark = remark; } + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + public String getCreateUser() { return createUser; } @@ -318,8 +354,6 @@ public static final String INSPECTION_ITEM_BO = "INSPECTION_ITEM_BO"; public static final String RESOURCE_BO = "RESOURCE_BO"; -public static final String RESULT = "RESULT"; - public static final String TASK_CREATE_DATE = "TASK_CREATE_DATE"; public static final String PLAN_START_DATE = "PLAN_START_DATE"; @@ -332,8 +366,12 @@ public static final String ACTUAL_COMPLETE_DATE = "ACTUAL_COMPLETE_DATE"; public static final String EXECUTOR = "EXECUTOR"; +public static final String RESULT = "RESULT"; + public static final String REMARK = "REMARK"; +public static final String REASON = "REASON"; + public static final String CREATE_USER = "CREATE_USER"; public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; @@ -360,14 +398,15 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; ", resourceInspectPlanBo = " + resourceInspectPlanBo + ", inspectionItemBo = " + inspectionItemBo + ", resourceBo = " + resourceBo + - ", result = " + result + ", taskCreateDate = " + taskCreateDate + ", planStartDate = " + planStartDate + ", planCompleteDate = " + planCompleteDate + ", actualStartDate = " + actualStartDate + ", actualCompleteDate = " + actualCompleteDate + ", executor = " + executor + + ", result = " + result + ", remark = " + remark + + ", reason = " + reason + ", createUser = " + createUser + ", createdDateTime = " + createdDateTime + ", modifyUser = " + modifyUser + diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTaskParam.java b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTaskParam.java index 50445978..afb363fd 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTaskParam.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTaskParam.java @@ -4,6 +4,7 @@ import java.io.Serializable; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; +import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; @@ -15,7 +16,7 @@ import com.baomidou.mybatisplus.annotation.IdType; *

* * @author pavel.Liu - * @since 2021-06-10 + * @since 2021-07-01 */ @TableName("Z_RESOURCE_INSPECT_TASK_PARAM") @@ -27,76 +28,71 @@ public class ResourceInspectTaskParam extends Model { /** * 主键 */ - @TableField("HANDLE") + @TableId(value = "HANDLE", type = IdType.INPUT) private String handle; - /** - * 设备编号HANDLE - */ - @TableField("RESOURCE_INSPECT_TASK_BO") - private String resourceInspectTaskBo; /** * 检验项目编号 */ - @TableField("RESOURCE_BO") - private String resourceBo; - /** - * 检验项目描述 - */ @TableField("INSPECT_NO") private String inspectNo; /** - * 检验方法 + * 任务HANDLE + */ + @TableField("RESOURCE_INSPECT_TASK_BO") + private String resourceInspectTaskBo; + /** + * 检验项目描述 */ @TableField("DESCRIPTION") private String description; /** - * 检验数据类型(文本T、数字N、布尔值B) + * 检验方式/方法 */ @TableField("INSPECT_METHOD") private String inspectMethod; /** - * 是否必填 + * 检验数据类型(文本T、数字N、布尔值B) */ @TableField("INSPECT_DATA_TYPE") private String inspectDataType; /** - * 最小值 + * 参数单位 + */ + @TableField("PARAM_UNIT") + private String paramUnit; + /** + * 是否必填【Y必填,N非必填】 */ @TableField("REQUIRED") private String required; /** - * 最大值 + * 最小值 */ @TableField("MIN_VALUE") private Double minValue; /** - * 标准值 + * 最大值 */ @TableField("MAX_VALUE") private Double maxValue; /** - * 检验值 + * 标准值 */ @TableField("STANDARD_VALUE") private String standardValue; /** - * 参数单位 + * 结果值 */ - @TableField("RESRCE_VALUE") - private String resrceValue; + @TableField("RESULT_VALUE") + private String resultValue; /** - * 检验结果【Y/N】 + * 结果【Y/N】 */ - @TableField("PARAM_UNIT") - private String paramUnit; + @TableField("RESULT") + private String result; /** * 备注 */ - @TableField("RESRCE") - private String resrce; - /** - * 执行人 - */ @TableField("REMARK") private String remark; /** @@ -120,29 +116,26 @@ public class ResourceInspectTaskParam extends Model { @TableField("MODIFIED_DATE_TIME") private LocalDateTime modifiedDateTime; + /** + * 序号 + * **/ + @TableField(exist = false) + private Integer seq; - public String getHandle() { - return handle; + public Integer getSeq() { + return seq; } - public void setHandle(String handle) { - this.handle = handle; - } - - public String getResourceInspectTaskBo() { - return resourceInspectTaskBo; - } - - public void setResourceInspectTaskBo(String resourceInspectTaskBo) { - this.resourceInspectTaskBo = resourceInspectTaskBo; + public void setSeq(Integer seq) { + this.seq = seq; } - public String getResourceBo() { - return resourceBo; + public String getHandle() { + return handle; } - public void setResourceBo(String resourceBo) { - this.resourceBo = resourceBo; + public void setHandle(String handle) { + this.handle = handle; } public String getInspectNo() { @@ -153,6 +146,14 @@ public class ResourceInspectTaskParam extends Model { this.inspectNo = inspectNo; } + public String getResourceInspectTaskBo() { + return resourceInspectTaskBo; + } + + public void setResourceInspectTaskBo(String resourceInspectTaskBo) { + this.resourceInspectTaskBo = resourceInspectTaskBo; + } + public String getDescription() { return description; } @@ -177,6 +178,14 @@ public class ResourceInspectTaskParam extends Model { this.inspectDataType = inspectDataType; } + public String getParamUnit() { + return paramUnit; + } + + public void setParamUnit(String paramUnit) { + this.paramUnit = paramUnit; + } + public String getRequired() { return required; } @@ -209,28 +218,20 @@ public class ResourceInspectTaskParam extends Model { this.standardValue = standardValue; } - public String getResrceValue() { - return resrceValue; + public String getResultValue() { + return resultValue; } - public void setResrceValue(String resrceValue) { - this.resrceValue = resrceValue; + public void setResultValue(String resultValue) { + this.resultValue = resultValue; } - public String getParamUnit() { - return paramUnit; - } - - public void setParamUnit(String paramUnit) { - this.paramUnit = paramUnit; + public String getResult() { + return result; } - public String getResrce() { - return resrce; - } - - public void setResrce(String resrce) { - this.resrce = resrce; + public void setResult(String result) { + this.result = result; } public String getRemark() { @@ -275,18 +276,18 @@ public class ResourceInspectTaskParam extends Model { public static final String HANDLE = "HANDLE"; -public static final String RESOURCE_INSPECT_TASK_BO = "RESOURCE_INSPECT_TASK_BO"; - -public static final String RESOURCE_BO = "RESOURCE_BO"; - public static final String INSPECT_NO = "INSPECT_NO"; +public static final String RESOURCE_INSPECT_TASK_BO = "RESOURCE_INSPECT_TASK_BO"; + public static final String DESCRIPTION = "DESCRIPTION"; public static final String INSPECT_METHOD = "INSPECT_METHOD"; public static final String INSPECT_DATA_TYPE = "INSPECT_DATA_TYPE"; +public static final String PARAM_UNIT = "PARAM_UNIT"; + public static final String REQUIRED = "REQUIRED"; public static final String MIN_VALUE = "MIN_VALUE"; @@ -295,11 +296,9 @@ public static final String MAX_VALUE = "MAX_VALUE"; public static final String STANDARD_VALUE = "STANDARD_VALUE"; -public static final String RESRCE_VALUE = "RESRCE_VALUE"; - -public static final String PARAM_UNIT = "PARAM_UNIT"; +public static final String RESULT_VALUE = "RESULT_VALUE"; -public static final String RESRCE = "RESRCE"; +public static final String RESULT = "RESULT"; public static final String REMARK = "REMARK"; @@ -321,19 +320,18 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; public String toString() { return "ResourceInspectTaskParam{" + "handle = " + handle + - ", resourceInspectTaskBo = " + resourceInspectTaskBo + - ", resourceBo = " + resourceBo + ", inspectNo = " + inspectNo + + ", resourceInspectTaskBo = " + resourceInspectTaskBo + ", description = " + description + ", inspectMethod = " + inspectMethod + ", inspectDataType = " + inspectDataType + + ", paramUnit = " + paramUnit + ", required = " + required + ", minValue = " + minValue + ", maxValue = " + maxValue + ", standardValue = " + standardValue + - ", resrceValue = " + resrceValue + - ", paramUnit = " + paramUnit + - ", resrce = " + resrce + + ", resultValue = " + resultValue + + ", result = " + result + ", remark = " + remark + ", createUser = " + createUser + ", createdDateTime = " + createdDateTime + diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTaskSpare.java b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTaskSpare.java new file mode 100644 index 00000000..ad7bc754 --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/model/ResourceInspectTaskSpare.java @@ -0,0 +1,246 @@ +package com.foreverwin.mesnac.equip.model; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import com.baomidou.mybatisplus.annotation.IdType; + +/** + *

+ * 设备检验任务-备品表 + *

+ * + * @author pavel.Liu + * @since 2021-07-01 + */ + +@TableName("Z_RESOURCE_INSPECT_TASK_SPARE") + +public class ResourceInspectTaskSpare extends Model { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "HANDLE", type = IdType.INPUT) + private String handle; + /** + * 备品编号 + */ + @TableField("SPARE_NO") + private String spareNo; + /** + * 任务HANDLE + */ + @TableField("RESOURCE_INSPECT_TASK_BO") + private String resourceInspectTaskBo; + /** + * 备品HANDLE + */ + @TableField("ITEM_BO") + private String itemBo; + /** + * 备品描述 + */ + @TableField("DESCRIPTION") + private String description; + /** + * 数量 + */ + @TableField("QTY") + private Double qty; + /** + * 单位 + */ + @TableField("UNIT") + private String unit; + /** + * 备注 + */ + @TableField("REMARK") + private String remark; + /** + * 创建人 + */ + @TableField("CREATE_USER") + private String createUser; + /** + * 创建时间 + */ + @TableField("CREATED_DATE_TIME") + private LocalDateTime createdDateTime; + /** + * 修改人 + */ + @TableField("MODIFY_USER") + private String modifyUser; + /** + * 修改时间 + */ + @TableField("MODIFIED_DATE_TIME") + private LocalDateTime modifiedDateTime; + + /** + * 序号 + * **/ + @TableField(exist = false) + private Integer seq; + + public Integer getSeq() { + return seq; + } + + public void setSeq(Integer seq) { + this.seq = seq; + } + + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public String getSpareNo() { + return spareNo; + } + + public void setSpareNo(String spareNo) { + this.spareNo = spareNo; + } + + public String getResourceInspectTaskBo() { + return resourceInspectTaskBo; + } + + public void setResourceInspectTaskBo(String resourceInspectTaskBo) { + this.resourceInspectTaskBo = resourceInspectTaskBo; + } + + public String getItemBo() { + return itemBo; + } + + public void setItemBo(String itemBo) { + this.itemBo = itemBo; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Double getQty() { + return qty; + } + + public void setQty(Double qty) { + this.qty = qty; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public LocalDateTime getCreatedDateTime() { + return createdDateTime; + } + + public void setCreatedDateTime(LocalDateTime createdDateTime) { + this.createdDateTime = createdDateTime; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public LocalDateTime getModifiedDateTime() { + return modifiedDateTime; + } + + public void setModifiedDateTime(LocalDateTime modifiedDateTime) { + this.modifiedDateTime = modifiedDateTime; + } + +public static final String HANDLE = "HANDLE"; + +public static final String SPARE_NO = "SPARE_NO"; + +public static final String RESOURCE_INSPECT_TASK_BO = "RESOURCE_INSPECT_TASK_BO"; + +public static final String ITEM_BO = "ITEM_BO"; + +public static final String DESCRIPTION = "DESCRIPTION"; + +public static final String QTY = "QTY"; + +public static final String UNIT = "UNIT"; + +public static final String REMARK = "REMARK"; + +public static final String CREATE_USER = "CREATE_USER"; + +public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; + +public static final String MODIFY_USER = "MODIFY_USER"; + +public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; + + + @Override + protected Serializable pkVal() { + return this.handle; + } + + @Override + public String toString() { + return "ResourceInspectTaskSpare{" + + "handle = " + handle + + ", spareNo = " + spareNo + + ", resourceInspectTaskBo = " + resourceInspectTaskBo + + ", itemBo = " + itemBo + + ", description = " + description + + ", qty = " + qty + + ", unit = " + unit + + ", remark = " + remark + + ", createUser = " + createUser + + ", createdDateTime = " + createdDateTime + + ", modifyUser = " + modifyUser + + ", modifiedDateTime = " + modifiedDateTime + + "}"; + } +} \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskParamService.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskParamService.java index 1eec60f6..b5d28e1f 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskParamService.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskParamService.java @@ -13,7 +13,7 @@ import java.util.List; *

* * @author pavel.Liu - * @since 2021-06-10 + * @since 2021-06-29 */ public interface ResourceInspectTaskParamService extends IService { @@ -25,4 +25,7 @@ public interface ResourceInspectTaskParamService extends IService selectPage(FrontPage frontPage, ResourceInspectTaskParam resourceInspectTaskParam); List selectList(ResourceInspectTaskParam resourceInspectTaskParam); + + void removeAll(ResourceInspectTaskParam resourceInspectTaskParam); + } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java index c7891d18..c35f8847 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java @@ -1,8 +1,10 @@ package com.foreverwin.mesnac.equip.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto; import com.foreverwin.mesnac.equip.model.ResourceInspectTask; import com.baomidou.mybatisplus.extension.service.IService; +import com.foreverwin.mesnac.equip.model.ResourceInspectTaskParam; import com.foreverwin.modular.core.util.FrontPage; import java.util.List; @@ -25,4 +27,24 @@ public interface ResourceInspectTaskService extends IService selectPage(FrontPage frontPage, ResourceInspectTask resourceInspectTask); List selectList(ResourceInspectTask resourceInspectTask); + + /** + * 任务总览 + * @param resourceInspectTaskDto + * @return + */ + List findResourceInspectTaskList(ResourceInspectTaskDto resourceInspectTaskDto); + + /**获取检验任务明细 + * 判断状态; + * 1、检验明细是否创建 + * 2、检验清单是否更新 + * **/ + ResourceInspectTask getResourceInspectTaskAll(ResourceInspectTask resourceInspectTask); + + /** + * 点击保存:保存任务主表,检验项从表、备品从表 + */ + void saveOrUpdateTaskInfo(ResourceInspectTaskDto resourceInspectTaskDto); + } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskSpareService.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskSpareService.java new file mode 100644 index 00000000..9be8a433 --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskSpareService.java @@ -0,0 +1,31 @@ +package com.foreverwin.mesnac.equip.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare; +import com.baomidou.mybatisplus.extension.service.IService; +import com.foreverwin.modular.core.util.FrontPage; + +import java.util.List; + +/** + *

+ * 设备检验任务-备品表 服务类 + *

+ * + * @author pavel.Liu + * @since 2021-06-30 + */ +public interface ResourceInspectTaskSpareService extends IService { + + /** + * 分页查询 + * @param frontPage + * @return + */ + IPage selectPage(FrontPage frontPage, ResourceInspectTaskSpare resourceInspectTaskSpare); + + List selectList(ResourceInspectTaskSpare resourceInspectTaskSpare); + + void removeAll(ResourceInspectTaskSpare resourceInspectTaskSpare); + +} \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskParamServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskParamServiceImpl.java index 378ee074..786c41bb 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskParamServiceImpl.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskParamServiceImpl.java @@ -18,7 +18,7 @@ import java.util.List; *

* * @author pavel.Liu - * @since 2021-06-10 + * @since 2021-06-29 */ @Service @Transactional(rollbackFor = Exception.class) @@ -42,5 +42,12 @@ public class ResourceInspectTaskParamServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(resourceInspectTaskParam); + super.remove(queryWrapper); + } + } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java index 1f268d47..bb9aefb2 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java @@ -1,5 +1,17 @@ package com.foreverwin.mesnac.equip.service.impl; +import com.foreverwin.mesnac.common.enums.HandleEnum; +import com.foreverwin.mesnac.common.model.InspectionItemDetail; +import com.foreverwin.mesnac.common.service.InspectionItemDetailService; +import com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto; +import com.foreverwin.mesnac.equip.model.ResourceInspectPlan; +import com.foreverwin.mesnac.equip.model.ResourceInspectTaskParam; +import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare; +import com.foreverwin.mesnac.equip.service.ResourceInspectPlanService; +import com.foreverwin.mesnac.equip.service.ResourceInspectTaskParamService; +import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService; +import com.foreverwin.modular.core.exception.BusinessException; +import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -11,7 +23,12 @@ import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Collection; import java.util.List; +import java.util.UUID; + /** *

* 设备检验任务表 服务实现类 @@ -27,6 +44,16 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, ResourceInspectTask resourceInspectTask) { @@ -42,5 +69,165 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl findResourceInspectTaskList(ResourceInspectTaskDto resourceInspectTaskDto) { + String currentUser = CommonMethods.getUser(); + String site = CommonMethods.getSite(); + String userBo = HandleEnum.USR.getHandle(site, currentUser); + resourceInspectTaskDto.setCurrentUser(userBo); + resourceInspectTaskDto.setSite(site); + List list = resourceInspectTaskMapper.findResourceInspectTaskList(resourceInspectTaskDto); + for (ResourceInspectTaskDto task:list) { + task.setResourceTypeNo(task.getResourceTypeBo().split(",")[1]); + task.setCycle(getCycle(task)); + task.setCurrentUser(currentUser); + } + return list; + } + + @Override + public ResourceInspectTask getResourceInspectTaskAll(ResourceInspectTask resourceInspectTask) { + List taskList = resourceInspectTaskService.selectList(resourceInspectTask); + if (taskList.size()==1){ + resourceInspectTask = taskList.get(0); + }else { + throw BusinessException.build("无法获取任务详情!!!"); + } + String taskHandle = resourceInspectTask.getHandle(); + String taskStatus = resourceInspectTask.getStatus(); + ResourceInspectTaskParam resourceInspectTaskParam = new ResourceInspectTaskParam(); + resourceInspectTaskParam.setResourceInspectTaskBo(taskHandle); + if (taskStatus.equals("401")){ + // 判断数据是否已创建 + List taskParams = resourceInspectTaskParamService.selectList(resourceInspectTaskParam); + // 任务状态为新建时,判断检验项是否更新 + String inspectionItemBo = resourceInspectTask.getInspectionItemBo(); + String resourceInspectPlanBo = resourceInspectTask.getResourceInspectPlanBo(); + ResourceInspectPlan resourceInspectPlan = resourceInspectPlanService.getById(resourceInspectPlanBo); + String planInspectionItemBo = resourceInspectPlan.getInspectionItemBo(); + // 检验项目清单修改:更新明细表 + if (inspectionItemBo.equals(planInspectionItemBo)){ + // 数据未创建——>全增 + if (taskParams.size() == 0){ + createAndSaveItemParams(taskHandle,inspectionItemBo); + } + }else{ + // 判断数据是否已存在:1、存在,则全删全增;2、不存在,全增 + if ( taskParams.size() > 0 ){ + resourceInspectTaskParamService.removeAll(resourceInspectTaskParam); + } + createAndSaveItemParams(taskHandle,planInspectionItemBo); + } + } + // 新建且检验项清单未变更/非新建状态,直接返回明细清单数据 + List itemParamList = resourceInspectTaskParamService.selectList(resourceInspectTaskParam); + ResourceInspectTaskSpare resourceInspectTaskSpare = new ResourceInspectTaskSpare(); + resourceInspectTaskSpare.setResourceInspectTaskBo(taskHandle); + List taskSpareList = resourceInspectTaskSpareService.selectList(resourceInspectTaskSpare); + resourceInspectTask.setTaskItemDetailList(itemParamList); + resourceInspectTask.setTaskSpareList(taskSpareList); + return resourceInspectTask; + } + + @Override + public void saveOrUpdateTaskInfo(ResourceInspectTaskDto resourceInspectTaskDto) { + // 站点、任务编号——任务handle + String site = CommonMethods.getSite(); + String taskNo = resourceInspectTaskDto.getTaskNo(); + String taskHandle = HandleEnum.RESOURCE_INSPECT_TASK.getHandle(site, taskNo); + String executor = resourceInspectTaskDto.getExecutor(); + // 检验项、备品清单 + List taskItemDetailList = resourceInspectTaskDto.getTaskItemDetailList(); + List taskSpareList = resourceInspectTaskDto.getTaskSpareList(); + // 任务主表字段:任务状态、修改人员、修改时间 + ResourceInspectTask task = resourceInspectTaskService.getById(taskHandle); + task.setStatus(resourceInspectTaskDto.getStatus()); + task.setModifyUser(executor); + task.setModifiedDateTime(LocalDateTime.now()); + resourceInspectTaskService.saveOrUpdate(task); + // 检验项全删、全增 + ResourceInspectTaskParam resourceInspectTaskParam = new ResourceInspectTaskParam(); + resourceInspectTaskParam.setResourceInspectTaskBo(taskHandle); + /*List taskParams = resourceInspectTaskParamService.selectList(resourceInspectTaskParam); + if ( taskParams.size() > 0 ){ + + }*/ + resourceInspectTaskParamService.removeAll(resourceInspectTaskParam); + for (ResourceInspectTaskParam taskParam:taskItemDetailList) { + taskParam.setCreatedDateTime(LocalDateTime.now()); + taskParam.setCreateUser(executor); + } + resourceInspectTaskParamService.saveBatch(taskItemDetailList); + // 备品全删、全增 + ResourceInspectTaskSpare resourceInspectTaskSpare = new ResourceInspectTaskSpare(); + resourceInspectTaskSpare.setResourceInspectTaskBo(taskHandle); + resourceInspectTaskSpareService.removeAll(resourceInspectTaskSpare); + for (ResourceInspectTaskSpare taskSpare:taskSpareList) { + if (taskSpare.getDescription()==null){ + continue; + } + taskSpare.setResourceInspectTaskBo(taskHandle); + taskSpare.setHandle(HandleEnum.RESOURCE_INSPECT_TASK_SPARE.getHandle(site,UUID.randomUUID().toString())); + taskSpare.setCreatedDateTime(LocalDateTime.now()); + taskSpare.setCreateUser(executor); + } + resourceInspectTaskSpareService.saveBatch(taskSpareList); + } + + /*** + * 任务创建周期 + */ + private String getCycle(ResourceInspectTaskDto task){ + String frequencyUnit = task.getFrequencyUnit(); + String frequency = task.getFrequency(); + StringBuffer cycle = new StringBuffer("每"); + switch (frequencyUnit){ + case "D": + cycle = cycle.append(frequency).append("天"); + break; + case "H": + cycle = cycle.append(frequency).append("时"); + break; + case "W": + cycle = cycle.append(frequency).append("周"); + break; + case "M": + cycle = cycle.append(frequency).append("月"); + break; + } + return cycle.toString(); + } + + /*** + * 创建检验明细表 + */ + private void createAndSaveItemParams(String taskHandel,String inspectionItemBo){ + InspectionItemDetail inspectionItemDetail = new InspectionItemDetail(); + inspectionItemDetail.setInspectionItemBo(inspectionItemBo); + List itemDetails = inspectionItemDetailService.selectList(inspectionItemDetail); + List paramList = new ArrayList<>(); + for (InspectionItemDetail detail:itemDetails) { + ResourceInspectTaskParam resourceInspectTaskParam = new ResourceInspectTaskParam(); + // 检验项编号、描述;外键:任务handle、设备handle + resourceInspectTaskParam.setHandle(taskHandel+";"+detail.getHandle()); + resourceInspectTaskParam.setInspectNo(detail.getParamNo()); + resourceInspectTaskParam.setDescription(detail.getDescription()); + resourceInspectTaskParam.setResourceInspectTaskBo(taskHandel); + // 检验方法、数据类型、单位、 + resourceInspectTaskParam.setInspectMethod(detail.getInspectionMethod()); + resourceInspectTaskParam.setInspectDataType(detail.getParamType()); + resourceInspectTaskParam.setParamUnit(detail.getParamUnit()); + // 是否必填、最大最、最小值、标准值 + resourceInspectTaskParam.setRequired(detail.getIsRequired()); + resourceInspectTaskParam.setMaxValue(detail.getMaxValue()); + resourceInspectTaskParam.setMinValue(detail.getMinValue()); + resourceInspectTaskParam.setStandardValue(detail.getStandardValue()); + resourceInspectTaskParam.setCreateUser("测试数据DEL"); + resourceInspectTaskParam.setCreatedDateTime(LocalDateTime.now()); + paramList.add(resourceInspectTaskParam); + } + resourceInspectTaskParamService.saveBatch(paramList); + } + } \ No newline at end of file diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskSpareServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskSpareServiceImpl.java new file mode 100644 index 00000000..44e6962a --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskSpareServiceImpl.java @@ -0,0 +1,53 @@ +package com.foreverwin.mesnac.equip.service.impl; + +import com.foreverwin.modular.core.util.FrontPage; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare; +import com.foreverwin.mesnac.equip.mapper.ResourceInspectTaskSpareMapper; +import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +/** + *

+ * 设备检验任务-备品表 服务实现类 + *

+ * + * @author pavel.Liu + * @since 2021-06-30 + */ +@Service +@Transactional(rollbackFor = Exception.class) +public class ResourceInspectTaskSpareServiceImpl extends ServiceImpl implements ResourceInspectTaskSpareService { + + + @Autowired + private ResourceInspectTaskSpareMapper resourceInspectTaskSpareMapper; + + @Override + public IPage selectPage(FrontPage frontPage, ResourceInspectTaskSpare resourceInspectTaskSpare) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(resourceInspectTaskSpare); + return super.page(frontPage.getPagePlus(), queryWrapper); + } + + @Override + public List selectList(ResourceInspectTaskSpare resourceInspectTaskSpare) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(resourceInspectTaskSpare); + return super.list(queryWrapper); + } + + @Override + public void removeAll(ResourceInspectTaskSpare resourceInspectTaskSpare) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(resourceInspectTaskSpare); + super.remove(queryWrapper); + } + + +} \ No newline at end of file diff --git a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml index 96036da9..f777da27 100644 --- a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml +++ b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml @@ -13,14 +13,15 @@ - + + @@ -29,7 +30,7 @@ - HANDLE, SITE, TASK_NO, CATEGORY, DESCRIPTION, STATUS, RESOURCE_INSPECT_PLAN_BO, INSPECTION_ITEM_BO, RESOURCE_BO, RESULT, TASK_CREATE_DATE, PLAN_START_DATE, PLAN_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, EXECUTOR, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME + HANDLE, SITE, TASK_NO, CATEGORY, DESCRIPTION, STATUS, RESOURCE_INSPECT_PLAN_BO, INSPECTION_ITEM_BO, RESOURCE_BO, TASK_CREATE_DATE, PLAN_START_DATE, PLAN_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, EXECUTOR, RESULT, REMARK, REASON, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME @@ -72,14 +73,15 @@ AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} - AND RESULT=#{ew.entity.result} AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate} AND EXECUTOR=#{ew.entity.executor} + AND RESULT=#{ew.entity.result} AND REMARK=#{ew.entity.remark} + AND REASON=#{ew.entity.reason} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFY_USER=#{ew.entity.modifyUser} @@ -103,14 +105,15 @@ AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} - AND RESULT=#{ew.entity.result} AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate} AND EXECUTOR=#{ew.entity.executor} + AND RESULT=#{ew.entity.result} AND REMARK=#{ew.entity.remark} + AND REASON=#{ew.entity.reason} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFY_USER=#{ew.entity.modifyUser} @@ -142,14 +145,15 @@ AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} - AND RESULT=#{ew.entity.result} AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate} AND EXECUTOR=#{ew.entity.executor} + AND RESULT=#{ew.entity.result} AND REMARK=#{ew.entity.remark} + AND REASON=#{ew.entity.reason} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFY_USER=#{ew.entity.modifyUser} @@ -181,14 +185,15 @@ AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} - AND RESULT=#{ew.entity.result} AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate} AND EXECUTOR=#{ew.entity.executor} + AND RESULT=#{ew.entity.result} AND REMARK=#{ew.entity.remark} + AND REASON=#{ew.entity.reason} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFY_USER=#{ew.entity.modifyUser} @@ -220,14 +225,15 @@ AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} - AND RESULT=#{ew.entity.result} AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate} AND EXECUTOR=#{ew.entity.executor} + AND RESULT=#{ew.entity.result} AND REMARK=#{ew.entity.remark} + AND REASON=#{ew.entity.reason} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFY_USER=#{ew.entity.modifyUser} @@ -259,14 +265,15 @@ AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} - AND RESULT=#{ew.entity.result} AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate} AND EXECUTOR=#{ew.entity.executor} + AND RESULT=#{ew.entity.result} AND REMARK=#{ew.entity.remark} + AND REASON=#{ew.entity.reason} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFY_USER=#{ew.entity.modifyUser} @@ -298,14 +305,15 @@ AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} - AND RESULT=#{ew.entity.result} AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate} AND EXECUTOR=#{ew.entity.executor} + AND RESULT=#{ew.entity.result} AND REMARK=#{ew.entity.remark} + AND REASON=#{ew.entity.reason} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFY_USER=#{ew.entity.modifyUser} @@ -333,14 +341,15 @@ RESOURCE_INSPECT_PLAN_BO, INSPECTION_ITEM_BO, RESOURCE_BO, - RESULT, TASK_CREATE_DATE, PLAN_START_DATE, PLAN_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, EXECUTOR, + RESULT, REMARK, + REASON, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, @@ -356,14 +365,15 @@ #{resourceInspectPlanBo}, #{inspectionItemBo}, #{resourceBo}, - #{result}, #{taskCreateDate}, #{planStartDate}, #{planCompleteDate}, #{actualStartDate}, #{actualCompleteDate}, #{executor}, + #{result}, #{remark}, + #{reason}, #{createUser}, #{createdDateTime}, #{modifyUser}, @@ -386,14 +396,15 @@ #{resourceInspectPlanBo}, #{inspectionItemBo}, #{resourceBo}, - #{result}, #{taskCreateDate}, #{planStartDate}, #{planCompleteDate}, #{actualStartDate}, #{actualCompleteDate}, #{executor}, + #{result}, #{remark}, + #{reason}, #{createUser}, #{createdDateTime}, #{modifyUser}, @@ -412,14 +423,15 @@ RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo}, INSPECTION_ITEM_BO=#{et.inspectionItemBo}, RESOURCE_BO=#{et.resourceBo}, - RESULT=#{et.result}, TASK_CREATE_DATE=#{et.taskCreateDate}, PLAN_START_DATE=#{et.planStartDate}, PLAN_COMPLETE_DATE=#{et.planCompleteDate}, ACTUAL_START_DATE=#{et.actualStartDate}, ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate}, EXECUTOR=#{et.executor}, + RESULT=#{et.result}, REMARK=#{et.remark}, + REASON=#{et.reason}, CREATE_USER=#{et.createUser}, CREATED_DATE_TIME=#{et.createdDateTime}, MODIFY_USER=#{et.modifyUser}, @@ -438,14 +450,15 @@ RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo}, INSPECTION_ITEM_BO=#{et.inspectionItemBo}, RESOURCE_BO=#{et.resourceBo}, - RESULT=#{et.result}, TASK_CREATE_DATE=#{et.taskCreateDate}, PLAN_START_DATE=#{et.planStartDate}, PLAN_COMPLETE_DATE=#{et.planCompleteDate}, ACTUAL_START_DATE=#{et.actualStartDate}, ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate}, EXECUTOR=#{et.executor}, + RESULT=#{et.result}, REMARK=#{et.remark}, + REASON=#{et.reason}, CREATE_USER=#{et.createUser}, CREATED_DATE_TIME=#{et.createdDateTime}, MODIFY_USER=#{et.modifyUser}, @@ -464,14 +477,15 @@ RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo}, INSPECTION_ITEM_BO=#{et.inspectionItemBo}, RESOURCE_BO=#{et.resourceBo}, - RESULT=#{et.result}, TASK_CREATE_DATE=#{et.taskCreateDate}, PLAN_START_DATE=#{et.planStartDate}, PLAN_COMPLETE_DATE=#{et.planCompleteDate}, ACTUAL_START_DATE=#{et.actualStartDate}, ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate}, EXECUTOR=#{et.executor}, + RESULT=#{et.result}, REMARK=#{et.remark}, + REASON=#{et.reason}, CREATE_USER=#{et.createUser}, CREATED_DATE_TIME=#{et.createdDateTime}, MODIFY_USER=#{et.modifyUser}, @@ -489,14 +503,15 @@ AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} - AND RESULT=#{ew.entity.result} AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate} AND EXECUTOR=#{ew.entity.executor} + AND RESULT=#{ew.entity.result} AND REMARK=#{ew.entity.remark} + AND REASON=#{ew.entity.reason} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFY_USER=#{ew.entity.modifyUser} @@ -545,14 +560,15 @@ AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo} AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo} AND RESOURCE_BO=#{ew.entity.resourceBo} - AND RESULT=#{ew.entity.result} AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate} AND PLAN_START_DATE=#{ew.entity.planStartDate} AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate} AND EXECUTOR=#{ew.entity.executor} + AND RESULT=#{ew.entity.result} AND REMARK=#{ew.entity.remark} + AND REASON=#{ew.entity.reason} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFY_USER=#{ew.entity.modifyUser} @@ -575,4 +591,50 @@ + + + diff --git a/equip/src/main/resources/mapper/ResourceInspectTaskParamMapper.xml b/equip/src/main/resources/mapper/ResourceInspectTaskParamMapper.xml index 2d68640b..d932e90e 100644 --- a/equip/src/main/resources/mapper/ResourceInspectTaskParamMapper.xml +++ b/equip/src/main/resources/mapper/ResourceInspectTaskParamMapper.xml @@ -4,20 +4,19 @@ - - - + + + - - - + + @@ -27,10 +26,13 @@ - HANDLE, RESOURCE_INSPECT_TASK_BO, RESOURCE_BO, INSPECT_NO, DESCRIPTION, INSPECT_METHOD, INSPECT_DATA_TYPE, REQUIRED, MIN_VALUE, MAX_VALUE, STANDARD_VALUE, RESRCE_VALUE, PARAM_UNIT, RESRCE, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME + HANDLE, INSPECT_NO, RESOURCE_INSPECT_TASK_BO, DESCRIPTION, INSPECT_METHOD, INSPECT_DATA_TYPE, PARAM_UNIT, REQUIRED, MIN_VALUE, MAX_VALUE, STANDARD_VALUE, RESULT_VALUE, RESULT, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME + + + SELECT FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE=#{handle} + + + + + + + + + + + + + + + + + + + + + + INSERT INTO Z_RESOURCE_INSPECT_TASK_SPARE + + HANDLE, + SPARE_NO, + RESOURCE_INSPECT_TASK_BO, + ITEM_BO, + DESCRIPTION, + QTY, + UNIT, + REMARK, + CREATE_USER, + CREATED_DATE_TIME, + MODIFY_USER, + MODIFIED_DATE_TIME, + VALUES + + #{handle}, + #{spareNo}, + #{resourceInspectTaskBo}, + #{itemBo}, + #{description}, + #{qty}, + #{unit}, + #{remark}, + #{createUser}, + #{createdDateTime}, + #{modifyUser}, + #{modifiedDateTime}, + + + + + INSERT INTO Z_RESOURCE_INSPECT_TASK_SPARE + + + VALUES + + #{handle}, + #{spareNo}, + #{resourceInspectTaskBo}, + #{itemBo}, + #{description}, + #{qty}, + #{unit}, + #{remark}, + #{createUser}, + #{createdDateTime}, + #{modifyUser}, + #{modifiedDateTime}, + + + + + + UPDATE Z_RESOURCE_INSPECT_TASK_SPARE + SPARE_NO=#{et.spareNo}, + RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo}, + ITEM_BO=#{et.itemBo}, + DESCRIPTION=#{et.description}, + QTY=#{et.qty}, + UNIT=#{et.unit}, + REMARK=#{et.remark}, + CREATE_USER=#{et.createUser}, + CREATED_DATE_TIME=#{et.createdDateTime}, + MODIFY_USER=#{et.modifyUser}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} + + + + + UPDATE Z_RESOURCE_INSPECT_TASK_SPARE + SPARE_NO=#{et.spareNo}, + RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo}, + ITEM_BO=#{et.itemBo}, + DESCRIPTION=#{et.description}, + QTY=#{et.qty}, + UNIT=#{et.unit}, + REMARK=#{et.remark}, + CREATE_USER=#{et.createUser}, + CREATED_DATE_TIME=#{et.createdDateTime}, + MODIFY_USER=#{et.modifyUser}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} + + + + + UPDATE Z_RESOURCE_INSPECT_TASK_SPARE + SPARE_NO=#{et.spareNo}, + RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo}, + ITEM_BO=#{et.itemBo}, + DESCRIPTION=#{et.description}, + QTY=#{et.qty}, + UNIT=#{et.unit}, + REMARK=#{et.remark}, + CREATE_USER=#{et.createUser}, + CREATED_DATE_TIME=#{et.createdDateTime}, + MODIFY_USER=#{et.modifyUser}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + + + + + HANDLE=#{ew.entity.handle} + AND SPARE_NO=#{ew.entity.spareNo} + AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo} + AND ITEM_BO=#{ew.entity.itemBo} + AND DESCRIPTION=#{ew.entity.description} + AND QTY=#{ew.entity.qty} + AND UNIT=#{ew.entity.unit} + AND REMARK=#{ew.entity.remark} + AND CREATE_USER=#{ew.entity.createUser} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE=#{handle} + + + + DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE + + + + + ${k} = #{cm[${k}]} + + + + + + + + DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE + + + + + HANDLE=#{ew.entity.handle} + + AND SPARE_NO=#{ew.entity.spareNo} + AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo} + AND ITEM_BO=#{ew.entity.itemBo} + AND DESCRIPTION=#{ew.entity.description} + AND QTY=#{ew.entity.qty} + AND UNIT=#{ew.entity.unit} + AND REMARK=#{ew.entity.remark} + AND CREATE_USER=#{ew.entity.createUser} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE IN ( + #{item} + ) + + + + diff --git a/generator/src/main/java/com/foreverwin/minth/generator/GeneratorApplication.java b/generator/src/main/java/com/foreverwin/minth/generator/GeneratorApplication.java index ccb0aadd..f359b7bf 100644 --- a/generator/src/main/java/com/foreverwin/minth/generator/GeneratorApplication.java +++ b/generator/src/main/java/com/foreverwin/minth/generator/GeneratorApplication.java @@ -34,7 +34,7 @@ public class GeneratorApplication { MpGenerator mpGenerator = mpGeneratorBuilder.dataSourceConfig(dataSourceConfig) .tablePrefix( "APS_", "DS_", "Z_" ) .packageName( "com.foreverwin.mesnac.equip" ) - .tables("Z_RESOURCE_INSPECT_PLAN","Z_RESOURCE_INSPECT_RESOURCE","Z_RESOURCE_INSPECT_TASK","Z_RESOURCE_INSPECT_TASK_PARAM") + .tables("Z_RESOURCE_INSPECT_TASK_SPARE") .author("pavel.Liu") .uiAppId("com.foreverwin.me") .uiPackage("com.foreverwin.me.migration") diff --git a/listener/listener.iml b/listener/listener.iml deleted file mode 100644 index 78998e74..00000000 --- a/listener/listener.iml +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java index d926d80d..7d97c9cd 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java @@ -32,6 +32,7 @@ public class ItemController { @GetMapping("") public R getItemList(Item item) { List result; + item.setSite(CommonMethods.getSite()); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.setEntity(item); result = itemService.list(queryWrapper); diff --git a/meapi/src/main/resources/mapper/ItemMapper.xml b/meapi/src/main/resources/mapper/ItemMapper.xml index ca10b032..2b516e93 100644 --- a/meapi/src/main/resources/mapper/ItemMapper.xml +++ b/meapi/src/main/resources/mapper/ItemMapper.xml @@ -253,7 +253,7 @@ ${ew.sqlSelect} - + FROM ITEM I From eaf7ea415661abec9239f45850dc5fd3591c6399 Mon Sep 17 00:00:00 2001 From: philip <244793088@qq.com> Date: Thu, 1 Jul 2021 16:34:08 +0800 Subject: [PATCH 3/4] pod --- .../meapi/controller/SfcController.java | 21 ++++++ .../mesnac/meapi/mapper/OperationMapper.java | 2 + .../mesnac/meapi/mapper/SfcMapper.java | 7 ++ .../meapi/service/OperationService.java | 2 + .../mesnac/meapi/service/SfcService.java | 5 ++ .../service/impl/OperationServiceImpl.java | 10 +++ .../meapi/service/impl/SfcServiceImpl.java | 7 ++ .../main/resources/mapper/OperationMapper.xml | 12 ++- meapi/src/main/resources/mapper/SfcMapper.xml | 8 ++ .../controller/PodTemplateController.java | 26 +++++++ .../production/mapper/SfcCrossMapper.java | 7 +- .../service/PodTemplateService.java | 5 ++ .../production/service/SfcCrossService.java | 44 +++++++++++ .../service/impl/PodTemplateServiceImpl.java | 75 +++++++++++++++---- .../service/impl/SfcCrossServiceImpl.java | 64 ++++++++++++++++ .../main/resources/mapper/SfcCrossMapper.xml | 62 ++++++--------- 16 files changed, 299 insertions(+), 58 deletions(-) create mode 100644 production/src/main/java/com/foreverwin/mesnac/production/service/SfcCrossService.java create mode 100644 production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java index 10421d8d..3199bd5a 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java @@ -62,7 +62,28 @@ public class SfcController { result = sfcService.list(queryWrapper); return R.ok(result); } + /** + * 分页查询数据 + * + * @param frontPage 分页信息 + * @return + */ + @ResponseBody + @GetMapping("/pageByResrce") + public R page(FrontPage frontPage, SfcDto sfc){ + IPage result; + try { + String site = CommonMethods.getSite(); + sfc.setSite(site); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(sfc); + result = sfcService.pageByResrce(frontPage.getPagePlus(), queryWrapper); + } catch (Exception e) { + return R.failed(e.getMessage()); + } + return R.ok(result); + } /** * 分页查询数据 * diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java index fd171b67..612d7b3e 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java @@ -23,4 +23,6 @@ public interface OperationMapper extends BaseMapper { Operation selectOperationBySfcBo(@Param("sfcBo") String sfcBo, @Param("locale") String locale); + Operation getCurrentRevisionRef(@Param("site") String site, @Param("operation") String operation); + } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/SfcMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/SfcMapper.java index 42dfb822..021b01b0 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/SfcMapper.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/SfcMapper.java @@ -1,5 +1,8 @@ package com.foreverwin.mesnac.meapi.mapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.foreverwin.mesnac.meapi.dto.SfcDto; import com.foreverwin.mesnac.meapi.model.Sfc; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -24,4 +27,8 @@ public interface SfcMapper extends BaseMapper { List getSfcListByResrceBO(String resrceBO); SfcDto findSfcData(@Param("site") String site, @Param("sfc") String sfc); + + Sfc findBySfc(@Param("sfc") Sfc sfc); + + IPage pageByResrce(Page pagePlus,@Param("ew") QueryWrapper queryWrapper,@Param("locale")String locale); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java index 6903de18..35342dfe 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java @@ -26,4 +26,6 @@ public interface OperationService extends IService { IPage selectPage(Page page, QueryWrapper operation); List selectList(Operation operation); + + Operation getCurrentRevisionRef(String site, String operation); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/SfcService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/SfcService.java index be4a8471..c89430ad 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/SfcService.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/SfcService.java @@ -1,7 +1,10 @@ package com.foreverwin.mesnac.meapi.service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; import com.foreverwin.mesnac.meapi.dto.SfcDto; import com.foreverwin.mesnac.meapi.model.Sfc; import com.foreverwin.modular.core.util.FrontPage; @@ -17,6 +20,7 @@ import java.util.List; * @since 2021-06-02 */ public interface SfcService extends IService { + IPage pageByResrce(Page pagePlus, QueryWrapper queryWrapper); /** * 分页查询 @@ -45,4 +49,5 @@ public interface SfcService extends IService { * @return */ SfcDto findSfcData(String site, String sfc); + } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java index 0429f6e2..71b6d230 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.foreverwin.mesnac.meapi.mapper.OperationMapper; import com.foreverwin.mesnac.meapi.model.Operation; import com.foreverwin.mesnac.meapi.service.OperationService; +import com.foreverwin.modular.core.exception.BaseException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; @@ -46,5 +47,14 @@ public class OperationServiceImpl extends ServiceImpl implements SfcSe @Autowired private SfcMapper sfcMapper; + @Override + public IPage pageByResrce(Page pagePlus, QueryWrapper queryWrapper) { + return sfcMapper.pageByResrce(pagePlus, queryWrapper, LocaleContextHolder.getLocale().getLanguage()); + } + @Override public IPage selectPage(FrontPage frontPage, Sfc sfc) { QueryWrapper queryWrapper = new QueryWrapper<>(); diff --git a/meapi/src/main/resources/mapper/OperationMapper.xml b/meapi/src/main/resources/mapper/OperationMapper.xml index f2506945..83ba455f 100644 --- a/meapi/src/main/resources/mapper/OperationMapper.xml +++ b/meapi/src/main/resources/mapper/OperationMapper.xml @@ -598,11 +598,21 @@ + + diff --git a/meapi/src/main/resources/mapper/SfcMapper.xml b/meapi/src/main/resources/mapper/SfcMapper.xml index 480f8b26..6e535505 100644 --- a/meapi/src/main/resources/mapper/SfcMapper.xml +++ b/meapi/src/main/resources/mapper/SfcMapper.xml @@ -663,4 +663,12 @@ LEFT JOIN OPERATION_T OTT ON SPLIT(OTT.OPERATION_BO,2) = ZSD.PREPOSITION_OPERATION AND OTT.LOCALE = 'zh' WHERE SC.SITE = #{site} AND SC.SFC = #{sfc} + + diff --git a/production/src/main/java/com/foreverwin/mesnac/production/controller/PodTemplateController.java b/production/src/main/java/com/foreverwin/mesnac/production/controller/PodTemplateController.java index 05f1e4d6..0e34c706 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/controller/PodTemplateController.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/controller/PodTemplateController.java @@ -9,6 +9,9 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + @Controller @RequestMapping("/sfcDataMains") public class PodTemplateController { @@ -37,4 +40,27 @@ public class PodTemplateController { public R sfcEnter(SfcDto sfcDto) { return R.ok(podTemplateService.sfcEnter(sfcDto)); } + + /** + * sfc开始 + * @param sfcDtoList + * @return + */ + @ResponseBody + @GetMapping("/sfcStart") + public R sfcStart(List sfcDtoList) { + podTemplateService.sfcStart(sfcDtoList); + return R.ok(); + } + + /** + * 生产操作员面板工作列表 + * @param sfcDto + * @return + */ + @ResponseBody + @GetMapping("/getSfcInfo") + public R getSfcInfo(SfcDto sfcDto) { + return R.ok(podTemplateService.getSfcInfo(sfcDto)); + } } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/mapper/SfcCrossMapper.java b/production/src/main/java/com/foreverwin/mesnac/production/mapper/SfcCrossMapper.java index 72bc3622..09244b09 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/mapper/SfcCrossMapper.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/mapper/SfcCrossMapper.java @@ -39,8 +39,6 @@ public interface SfcCrossMapper extends BaseMapper { */ List findRouterOperationByRouterBo(@Param("site") String site, @Param("routerBo") String routerBo, @Param("locale") String locale); -// String getDoneSfcItemBo(IPage page, @Param("dataAttr") String dataAttr, -// @Param("site") String site, @Param("statusBo") String statusBo); /** @@ -60,7 +58,6 @@ public interface SfcCrossMapper extends BaseMapper { List findShopOrderListByStatus(@Param("plannedWorkCenterBo") String plannedWorkCenterBo, @Param("status") String customStatus); - //List> findSfcListBySnList(@Param("site") String site, @Param("snList") List snList); /** * 查找工艺路线的最后一道工序 @@ -93,5 +90,7 @@ public interface SfcCrossMapper extends BaseMapper { Map querySfcData(@Param("site")String site, @Param("locale")String locale, @Param("dto")SfcDto sfcDto); - List> querySfcStep(@Param("site")String site, @Param("sfc")String sfc, @Param("operation")String operation); + Map getSfcInfo(@Param("site")String site, @Param("sfc")String sfc, @Param("operation")String operation); + + Integer getSfcDispatch(@Param("site") String site, @Param("sfc") String sfc, @Param("operation") String operation, @Param("stepId") String stepId,@Param("resrce")String resrce); } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java b/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java index de7e633e..b2200c76 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java @@ -3,10 +3,15 @@ package com.foreverwin.mesnac.production.service; import com.foreverwin.mesnac.meapi.dto.SfcDto; import com.foreverwin.mesnac.meapi.dto.WorkCenterDto; +import java.util.List; import java.util.Map; public interface PodTemplateService { Map resrceEnter(WorkCenterDto workCenterDto); Map sfcEnter(SfcDto workCenterDto); + + Object getSfcInfo(SfcDto sfcDto); + + void sfcStart(List sfcDto); } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/SfcCrossService.java b/production/src/main/java/com/foreverwin/mesnac/production/service/SfcCrossService.java new file mode 100644 index 00000000..e8f33804 --- /dev/null +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/SfcCrossService.java @@ -0,0 +1,44 @@ +package com.foreverwin.mesnac.production.service; + +import java.math.BigDecimal; + +/** + * 描述: 工序开始 + * 作者: philip + * 时间: 2021-6-30 + */ +public interface SfcCrossService { + /** + * 开始 + * @param site + * @param operationRef + * @param resource + * @param sfcRef + * @param qty + * @throws Exception + */ + void startAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception; + + /** + * 完成 + * @param site + * @param operationRef + * @param resource + * @param sfcRef + * @param qty + * @throws Exception + */ + void completeAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception; + + /** + * 开始完成单个SFC + * @param site + * @param operationRef + * @param resource + * @param sfcRef + * @param qty + * @throws Exception + */ + void passAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception; + +} diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java index ae844a1b..e2f1567f 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java @@ -2,16 +2,19 @@ package com.foreverwin.mesnac.production.service.impl; import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.service.CommonService; +import com.foreverwin.mesnac.common.util.ExceptionUtil; import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.meapi.dto.SfcDto; import com.foreverwin.mesnac.meapi.dto.WorkCenterDto; import com.foreverwin.mesnac.meapi.model.Operation; import com.foreverwin.mesnac.meapi.model.Resrce; import com.foreverwin.mesnac.meapi.model.Sfc; +import com.foreverwin.mesnac.meapi.service.OperationService; import com.foreverwin.mesnac.meapi.service.ResrceService; import com.foreverwin.mesnac.meapi.service.SfcService; import com.foreverwin.mesnac.production.mapper.SfcCrossMapper; import com.foreverwin.mesnac.production.service.PodTemplateService; +import com.foreverwin.mesnac.production.service.SfcCrossService; import com.foreverwin.modular.core.exception.BaseException; import com.foreverwin.modular.core.util.CommonMethods; import org.springframework.beans.factory.annotation.Autowired; @@ -19,6 +22,8 @@ import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -35,24 +40,27 @@ public class PodTemplateServiceImpl implements PodTemplateService { private CommonService commonService; @Autowired private SfcCrossMapper sfcCrossMapper; - + @Autowired + private SfcCrossService sfcCrossService; + @Autowired + private OperationService operationService; @Override public Map resrceEnter(WorkCenterDto workCenterDto) { String site = CommonMethods.getSite(); String resrce = workCenterDto.getResrce(); String resrceBO = HandleEnum.RESOURCE.getHandle(site, resrce); Resrce model = resrceService.getById(resrceBO); - if (model==null){ - throw new BaseException("资源 "+resrce+" 不存在"); + if (model == null) { + throw new BaseException("资源 " + resrce + " 不存在"); } String workCenter = workCenterDto.getWorkCenter(); //校验 String workShopBo = commonService.getWorkShopBo(resrceBO); - if (StringUtil.isBlank(workShopBo)){ - throw new BaseException("资源 "+resrce+" 未匹配到车间"); + if (StringUtil.isBlank(workShopBo)) { + throw new BaseException("资源 " + resrce + " 未匹配到车间"); } - if (!workCenter.equals(StringUtil.trimHandle(workShopBo))){ - throw new BaseException("资源 "+resrce+" 与车间不匹配"); + if (!workCenter.equals(StringUtil.trimHandle(workShopBo))) { + throw new BaseException("资源 " + resrce + " 与车间不匹配"); } //查询在该设备存在活动中的SFC @@ -70,26 +78,36 @@ public class PodTemplateServiceImpl implements PodTemplateService { String sfc = sfcDto.getSfc(); String operation = sfcDto.getOperation(); String locale = LocaleContextHolder.getLocale().getLanguage(); + String resrce = sfcDto.getResrce(); //校验产品条码是否存在 Sfc sfcById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc)); - if (sfcById==null){ - throw new BaseException("产品条码"+sfc+"不存在"); + if (sfcById == null) { + throw new BaseException("产品条码" + sfc + "不存在"); + } + String status = StringUtil.trimHandle(sfcById.getStatusBo()); + if (!status.equals("403") && !status.equals("401") && !status.equals("402")) { + throw new BaseException("产品条码" + sfc + "不在工作中或排队中"); } //校验产品条码是否在当前工序排队 Operation operationBySfcBo = commonService.getOperationBySfcBo(sfcById.getHandle()); - if (StringUtil.notBlank(operation)&&!operationBySfcBo.getOperation().equals(operation)){ + /* if (StringUtil.notBlank(operation)&&!operationBySfcBo.getOperation().equals(operation)){ throw new BaseException("产品条码"+sfc+"在"+operationBySfcBo.getOperation()+"/"+operationBySfcBo.getDescription()+"工序"); - } + }*/ //校验SFC+工序+设备+STEP_ID是否与当前设备确认的派工单匹配 + Integer integer = sfcCrossMapper.getSfcDispatch(site, sfc, operationBySfcBo.getOperation(), operationBySfcBo.getStepId(), resrce); + if (integer < 1) { + throw new BaseException("产品条码与当前设备工序确认的派工单不匹配"); + } String substep = ""; String substepHandle = ""; //构造前台所需要的数据 - Map resultMap = sfcCrossMapper.querySfcData(site,locale,sfcDto); - if(resultMap == null){ + Map resultMap = sfcCrossMapper.querySfcData(site, locale, sfcDto); + if (resultMap == null) { throw new BaseException("根据当前资源未找到条码[" + sfc + "]的基本信息!"); } - List> substepList = sfcCrossMapper.querySfcStep(site, sfc, operation); + //List> substepList = sfcCrossMapper.querySfcStep(site, sfc, operationBySfcBo.getOperation()); + List> substepList = new ArrayList<>(); resultMap.put("SFC_STEP_LIST", substepList); String stepId = (String) resultMap.get("STEP_ID"); @@ -194,6 +212,33 @@ public class PodTemplateServiceImpl implements PodTemplateService { }*/ resultMap.put("IS_CREATE_H", isCreateH); resultMap.put("IS_CREATE_Z", isCreateZ); - return null; + return resultMap; + } + + @Override + public Object getSfcInfo(SfcDto sfcDto) { + String site = CommonMethods.getSite(); + String operation = sfcDto.getOperation(); + String sfc = sfcDto.getSfc(); + Map substepList = sfcCrossMapper.getSfcInfo(site, sfc, operation); + return substepList; + } + + @Override + public void sfcStart(List sfcDtoList) { + sfcDtoList.forEach(sfcDto -> { + String site = CommonMethods.getSite(); + String operation = sfcDto.getOperation(); + Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation); + String resrce = sfcDto.getResrce(); + String sfc = sfcDto.getSfc(); + Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(sfc, sfc)); + BigDecimal qty=new BigDecimal(sfcServiceById.getQty().toString()); + try { + sfcCrossService.startAction(site, currentRevisionRef.getHandle(),resrce,sfcServiceById.getHandle(),qty); + } catch (Exception e) { + ExceptionUtil.throwException(e); + } + }); } } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java new file mode 100644 index 00000000..5b868a2f --- /dev/null +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java @@ -0,0 +1,64 @@ +package com.foreverwin.mesnac.production.service.impl; + + +import com.foreverwin.mesnac.production.service.SfcCrossService; +import com.foreverwin.modular.core.meext.MEServices; +import com.foreverwin.modular.core.util.CommonMethods; +import com.sap.me.plant.ResourceBOHandle; +import com.sap.me.production.*; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; + +/** + * 描述: 工序开始 + * 作者: philip + * 时间: 2021-06-30 + */ +@Service +@Transactional(rollbackFor = Exception.class) +public class SfcCrossServiceImpl implements SfcCrossService { + + @Override + public void startAction(String site, String operationRef, + String resource, String sfcRef, BigDecimal qty) throws Exception { + SfcStartServiceInterface sfcStartService = MEServices.create("com.sap.me.production", "SfcStartService", site); + StartSfcRequest paramStartSfcRequest = new StartSfcRequest(); + paramStartSfcRequest.setQty(qty); + paramStartSfcRequest.setOperationRef(operationRef); + paramStartSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue()); + paramStartSfcRequest.setSfcRef(sfcRef); + paramStartSfcRequest.setUserRef(CommonMethods.getUserBo()); + sfcStartService.startSfc(paramStartSfcRequest); + } + + @Override + public void completeAction(String site, String operationRef, + String resource, String sfcRef, BigDecimal qty) throws Exception { + SfcCompleteServiceInterface sfcCompleteService = MEServices.create("com.sap.me.production", "SfcCompleteService", site); + CompleteSfcRequest paramCompleteSfcRequest = new CompleteSfcRequest(); + paramCompleteSfcRequest.setOperationRef(operationRef); + paramCompleteSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue()); + paramCompleteSfcRequest.setSfcRef(sfcRef); + if(qty != null) { + paramCompleteSfcRequest.setQuantity(qty); + } + paramCompleteSfcRequest.setLocation(""); + sfcCompleteService.completeSfc(paramCompleteSfcRequest); + } + + @Override + public void passAction(String site, String operationRef, + String resource, String sfcRef, BigDecimal qty) throws Exception { + SfcCompleteServiceInterface sfcCompleteService = MEServices.create("com.sap.me.production", "SfcCompleteService", site); + CompleteSfcQuickRequest paramCompleteSfcRequest = new CompleteSfcQuickRequest(); + paramCompleteSfcRequest.setOperationRef(operationRef); + paramCompleteSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue()); + paramCompleteSfcRequest.setSfcRef(sfcRef); + if(qty != null) { + paramCompleteSfcRequest.setQuantity(qty); + } + sfcCompleteService.completeSfcQuick(paramCompleteSfcRequest); + } +} diff --git a/production/src/main/resources/mapper/SfcCrossMapper.xml b/production/src/main/resources/mapper/SfcCrossMapper.xml index 88d69a6c..d90b0ea9 100644 --- a/production/src/main/resources/mapper/SfcCrossMapper.xml +++ b/production/src/main/resources/mapper/SfcCrossMapper.xml @@ -139,8 +139,8 @@ WHERE sfc.site = #{site} and RO_CF2.VALUE TOOL ,SOD.HANDLE SFC_DISPATCH_DETAIL_BO, S.SFC,S.QTY SFC_QTY,RS.STEP_ID, SOD.DISPATCH_NO , TO_CHAR( SOD.PLANNED_START_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss')START_DATE, - TO_CHAR(SOD.PLANNED_COMPLETE_DATE + INTERVAL '8' HOUR ,'yyyy-mm-dd hh24:mi:ss')COMP_DATE, - TO_CHAR((SOD.PLANNED_COMPLETE_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H' ADD_DATE, + TO_CHAR(SOD.PLANNED_COMP_DATE + INTERVAL '8' HOUR ,'yyyy-mm-dd hh24:mi:ss')COMP_DATE, + TO_CHAR((SOD.PLANNED_COMP_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H' ADD_DATE, CASE WHEN OT.DESCRIPTION LIKE 'CH%' THEN SUBSTR(OT.DESCRIPTION, 0, 3) ELSE N'' END SLOT FROM SFC S INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO @@ -159,7 +159,7 @@ WHERE sfc.site = #{site} and INNER JOIN ITEM I ON I.HANDLE = S.ITEM_BO LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE =#{locale} INNER JOIN ( - SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMPLETE_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO + SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMP_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO FROM Z_PROD_READY_TASK RB INNER JOIN Z_SFC_DISPATCH SD ON SD.HANDLE = RB.SFC_DISPATCH_BO WHERE RB.SITE =#{site} AND RB.STATUS = 'F' @@ -170,42 +170,28 @@ WHERE sfc.site = #{site} and OP.OPERATION, OT.DESCRIPTION ,OP.OPERATION||'/'||RS.STEP_ID ,RO_CF2.VALUE, S.SFC,S.QTY ,RS.STEP_ID,SOD.DISPATCH_NO , SOD.HANDLE , TO_CHAR( SOD.PLANNED_START_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss'), - TO_CHAR(SOD.PLANNED_COMPLETE_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss'), - TO_CHAR((SOD.PLANNED_COMPLETE_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H', + TO_CHAR(SOD.PLANNED_COMP_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss'), + TO_CHAR((SOD.PLANNED_COMP_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H', CASE WHEN OT.DESCRIPTION LIKE 'CH%' THEN SUBSTR(OT.DESCRIPTION, 0, 3) ELSE N'' END - + SELECT O.OPERATION,SSTEP.STEP_ID,IT.DESCRIPTION,S.SFC,S.QTY, + CASE WHEN SSTEP.QTY_IN_WORK > 0 THEN '工作中' + WHEN SSTEP.QTY_IN_QUEUE > 0 THEN '排队中' + ELSE '新建' END STEP_STATUS + FROM SFC S + LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.HANDLE AND IT.LOCALE='zh' + INNER JOIN SFC_ROUTING SRI ON S.HANDLE=SRI.SFC_BO + INNER JOIN SFC_ROUTER SR ON SRI.HANDLE=SR.SFC_ROUTING_BO AND SR.IN_USE='true' + INNER JOIN ROUTER_STEP RS ON RS.ROUTER_BO=sr.ROUTER_BO + INNER JOIN SFC_STEP SSTEP ON SSTEP.SFC_ROUTER_BO=SR.HANDLE AND RS.STEP_ID= SSTEP.STEP_ID + AND (SSTEP.QTY_IN_QUEUE > 0 OR SSTEP.QTY_IN_WORK > 0) + INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO + INNER JOIN OPERATION O ON O.OPERATION=SPLIT(SSTEP.OPERATION_BO,2) AND O.SITE=S.SITE AND O.CURRENT_REVISION = 'true' + AND #{operation} = O.OPERATION + WHERE S.SFC=#{sfc} AND S.SITE=#{site} + + From 0b6960b7c72f74a461ad58c20e01aa1438bd0b9b Mon Sep 17 00:00:00 2001 From: zpl Date: Thu, 1 Jul 2021 16:39:04 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97--=E8=AE=BE=E5=A4=87=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=A8=A1=E5=9D=97=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equip/dto/ResourceInspectTaskDto.java | 356 ++++++++++++++++++ 1 file changed, 356 insertions(+) create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/dto/ResourceInspectTaskDto.java diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/dto/ResourceInspectTaskDto.java b/equip/src/main/java/com/foreverwin/mesnac/equip/dto/ResourceInspectTaskDto.java new file mode 100644 index 00000000..fb34c083 --- /dev/null +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/dto/ResourceInspectTaskDto.java @@ -0,0 +1,356 @@ +package com.foreverwin.mesnac.equip.dto; + +import com.foreverwin.mesnac.equip.model.ResourceInspectTaskParam; +import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +/** + *

+ * 设备检验任务实体类 + *

+ * + * @author pavel.Liu + * @since 2021-06-24 + */ + +public class ResourceInspectTaskDto implements Serializable { + + /**序号**/ + private Integer itemSeq; + /**主键**/ + private String handle; + /**站点**/ + private String site; + /**任务编号**/ + private String taskNo; + /**类型(自动AUTO/手动)**/ + private String category; + /**任务描述**/ + private String description; + /**任务状态(新建/处理中/完成/关闭)**/ + private String status; + /**设备检验计划HANDLE**/ + private String resourceInspectPlanBo; + /**检验项目清单HANDLE**/ + private String inspectionItemBo; + /**设备HANDLE**/ + private String resourceBo; + /**检验结果**/ + private String result; + /**任务创建时间**/ + private LocalDateTime taskCreateDate; + /**计划开始时间**/ + private LocalDateTime planStartDate; + /**计划完成时间**/ + private LocalDateTime planCompleteDate; + /**实际开始时间**/ + private LocalDateTime actualStartDate; + /**实际完成时间**/ + private LocalDateTime actualCompleteDate; + /**执行人**/ + private String executor; + /**备注**/ + private String remark; + /**检索时间段的开始时间**/ + private LocalDateTime compareStartTime; + /**检索时间段的结束时间**/ + private LocalDateTime compareEndTime; + /**设备编号NO**/ + private String resourceNo; + /**设备描述**/ + private String resourceDescription; + /**设备类型编号NO**/ + private String resourceTypeNo; + /**设备类型描述**/ + private String resourceTypeDescription; + /**设备类型HANDLE**/ + private String resourceTypeBo; + /**计划编号NO**/ + private String planNo; + /**计划描述**/ + private String planDescription; + /**频率**/ + private String frequency; + /**周期单位**/ + private String frequencyUnit; + /**周期**/ + private String cycle; + /**当前用户**/ + private String currentUser; + /**车间**/ + private String workCenter; + /**任务检验项明细**/ + private List taskItemDetailList; + /**消耗备品**/ + private List taskSpareList; + + public List getTaskItemDetailList() { + return taskItemDetailList; + } + + public void setTaskItemDetailList(List taskItemDetailList) { + this.taskItemDetailList = taskItemDetailList; + } + + public List getTaskSpareList() { + return taskSpareList; + } + + public void setTaskSpareList(List taskSpareList) { + this.taskSpareList = taskSpareList; + } + + public ResourceInspectTaskDto() { + } + + public String getResourceNo() { + return resourceNo; + } + + public void setResourceNo(String resourceNo) { + this.resourceNo = resourceNo; + } + + public String getResourceDescription() { + return resourceDescription; + } + + public void setResourceDescription(String resourceDescription) { + this.resourceDescription = resourceDescription; + } + + public String getPlanNo() { + return planNo; + } + + public void setPlanNo(String planNo) { + this.planNo = planNo; + } + + public String getPlanDescription() { + return planDescription; + } + + public void setPlanDescription(String planDescription) { + this.planDescription = planDescription; + } + + public String getCycle() { + return cycle; + } + + public void setCycle(String cycle) { + this.cycle = cycle; + } + + public String getFrequency() { + return frequency; + } + + public void setFrequency(String frequency) { + this.frequency = frequency; + } + + public String getFrequencyUnit() { + return frequencyUnit; + } + + public void setFrequencyUnit(String frequencyUnit) { + this.frequencyUnit = frequencyUnit; + } + + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getTaskNo() { + return taskNo; + } + + public void setTaskNo(String taskNo) { + this.taskNo = taskNo; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getResourceInspectPlanBo() { + return resourceInspectPlanBo; + } + + public void setResourceInspectPlanBo(String resourceInspectPlanBo) { + this.resourceInspectPlanBo = resourceInspectPlanBo; + } + + public String getInspectionItemBo() { + return inspectionItemBo; + } + + public void setInspectionItemBo(String inspectionItemBo) { + this.inspectionItemBo = inspectionItemBo; + } + + public String getResourceBo() { + return resourceBo; + } + + public void setResourceBo(String resourceBo) { + this.resourceBo = resourceBo; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + + public LocalDateTime getTaskCreateDate() { + return taskCreateDate; + } + + public void setTaskCreateDate(LocalDateTime taskCreateDate) { + this.taskCreateDate = taskCreateDate; + } + + public LocalDateTime getPlanStartDate() { + return planStartDate; + } + + public void setPlanStartDate(LocalDateTime planStartDate) { + this.planStartDate = planStartDate; + } + + public LocalDateTime getPlanCompleteDate() { + return planCompleteDate; + } + + public void setPlanCompleteDate(LocalDateTime planCompleteDate) { + this.planCompleteDate = planCompleteDate; + } + + public LocalDateTime getActualStartDate() { + return actualStartDate; + } + + public void setActualStartDate(LocalDateTime actualStartDate) { + this.actualStartDate = actualStartDate; + } + + public LocalDateTime getActualCompleteDate() { + return actualCompleteDate; + } + + public void setActualCompleteDate(LocalDateTime actualCompleteDate) { + this.actualCompleteDate = actualCompleteDate; + } + + public String getExecutor() { + return executor; + } + + public void setExecutor(String executor) { + this.executor = executor; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public LocalDateTime getCompareStartTime() { + return compareStartTime; + } + + public void setCompareStartTime(LocalDateTime compareStartTime) { + this.compareStartTime = compareStartTime; + } + + public LocalDateTime getCompareEndTime() { + return compareEndTime; + } + + public void setCompareEndTime(LocalDateTime compareEndTime) { + this.compareEndTime = compareEndTime; + } + + public String getCurrentUser() { + return currentUser; + } + + public void setCurrentUser(String currentUser) { + this.currentUser = currentUser; + } + + public String getResourceTypeNo() { + return resourceTypeNo; + } + + public void setResourceTypeNo(String resourceTypeNo) { + this.resourceTypeNo = resourceTypeNo; + } + + public String getResourceTypeDescription() { + return resourceTypeDescription; + } + + public void setResourceTypeDescription(String resourceTypeDescription) { + this.resourceTypeDescription = resourceTypeDescription; + } + + public String getResourceTypeBo() { + return resourceTypeBo; + } + + public void setResourceTypeBo(String resourceTypeBo) { + this.resourceTypeBo = resourceTypeBo; + } + + public String getWorkCenter() { + return workCenter; + } + + public void setWorkCenter(String workCenter) { + this.workCenter = workCenter; + } +} \ No newline at end of file