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 954a830d..1c48f152 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
@@ -16,5 +16,8 @@ public interface Constants {
String STATUS_Y = "Y";
String STATUS_N = "N";
+ //任务编号常量
+ String RESOURCE_INSPECT_TASK = "RESOURCE_INSPECT_TASK";
+
String SITE_ADMIN = "SITE_ADMIN";
}
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 531b0ed8..45b70501 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
@@ -106,7 +106,12 @@ public enum HandleEnum {
NC_CODE("NCCodeBO","NCCodeBO:{0},{1}"),
/**不良代码组**/
- NC_GROUP("NCGroupBO","NCGroupBO:{0},{1}");
+ NC_GROUP("NCGroupBO","NCGroupBO:{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/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..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-10
+ * @since 2021-07-01
*/
@RestController
@RequestMapping("/Z-RESOURCE-INSPECT-TASK")
@@ -76,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())
);
@@ -128,4 +133,95 @@ public class ResourceInspectTaskController {
public R removeByIds(List ids){
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("/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/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
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..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-10
+ * @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/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..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-10
+ * @since 2021-07-01
*/
@TableName("Z_RESOURCE_INSPECT_TASK")
@@ -71,10 +73,10 @@ public class ResourceInspectTask extends Model {
@TableField("RESOURCE_BO")
private String resourceBo;
/**
- * 检验结果
+ * 任务创建时间
*/
- @TableField("RESULT")
- private String result;
+ @TableField("TASK_CREATE_DATE")
+ private LocalDateTime taskCreateDate;
/**
* 计划开始时间
*/
@@ -100,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;
/**
* 创建人
*/
@@ -126,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;
@@ -199,12 +232,12 @@ public class ResourceInspectTask extends Model {
this.resourceBo = resourceBo;
}
- public String getResult() {
- return result;
+ public LocalDateTime getTaskCreateDate() {
+ return taskCreateDate;
}
- public void setResult(String result) {
- this.result = result;
+ public void setTaskCreateDate(LocalDateTime taskCreateDate) {
+ this.taskCreateDate = taskCreateDate;
}
public LocalDateTime getPlanStartDate() {
@@ -247,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;
}
@@ -255,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;
}
@@ -305,7 +354,7 @@ 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";
@@ -317,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";
@@ -345,13 +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/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/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 03c2e395..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;
@@ -13,7 +15,7 @@ import java.util.List;
*
*
* @author pavel.Liu
- * @since 2021-06-10
+ * @since 2021-06-24
*/
public interface ResourceInspectTaskService extends IService {
@@ -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/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/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 9f2e3619..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,14 +23,19 @@ 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;
+
/**
*
* 设备检验任务表 服务实现类
*
*
* @author pavel.Liu
- * @since 2021-06-10
+ * @since 2021-06-24
*/
@Service
@Transactional(rollbackFor = Exception.class)
@@ -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/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..f777da27 100644
--- a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml
+++ b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml
@@ -13,13 +13,15 @@
-
+
+
+
@@ -28,7 +30,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, 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
@@ -71,13 +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}
@@ -101,13 +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}
@@ -139,13 +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}
@@ -177,13 +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}
@@ -215,13 +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}
@@ -253,13 +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}
@@ -291,13 +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}
@@ -325,13 +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,
@@ -347,13 +365,15 @@
#{resourceInspectPlanBo},
#{inspectionItemBo},
#{resourceBo},
- #{result},
+ #{taskCreateDate},
#{planStartDate},
#{planCompleteDate},
#{actualStartDate},
#{actualCompleteDate},
#{executor},
+ #{result},
#{remark},
+ #{reason},
#{createUser},
#{createdDateTime},
#{modifyUser},
@@ -376,13 +396,15 @@
#{resourceInspectPlanBo},
#{inspectionItemBo},
#{resourceBo},
- #{result},
+ #{taskCreateDate},
#{planStartDate},
#{planCompleteDate},
#{actualStartDate},
#{actualCompleteDate},
#{executor},
+ #{result},
#{remark},
+ #{reason},
#{createUser},
#{createdDateTime},
#{modifyUser},
@@ -401,13 +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},
@@ -426,13 +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},
@@ -451,13 +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},
@@ -475,13 +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}
@@ -530,13 +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}
@@ -559,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 S.SFC,S.QTY,IT.DESCRIPTION ITEM_DESCRIPTION FROM SFC S
+ LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.HANDLE AND IT.LOCALE=#{locale}
+ JOIN Z_SFC_DISPATCH zsd ON S.SFC=zsd.SFC AND S.SITE=zsd.SITE
+ WHERE S.SITE=#{ew.entity.site} AND ZSD.RESRCE=#{ew.entity.resrce} AND ZSD.DISPATCH_STATUS!='CANCEL'
+ AND S.STATUS_BO IN ('StatusBO:'||#{ew.entity.site}||',401','StatusBO:'||#{ew.entity.site}||',402','StatusBO:'||#{ew.entity.site}||',403')
+
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