queryWrapper = new QueryWrapper<>();
+ queryWrapper.setEntity(resourceInspectTaskParam);
+ super.remove(queryWrapper);
+ }
+
}
\ No newline at end of file
diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java
index 1f268d47..bb9aefb2 100644
--- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java
+++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskServiceImpl.java
@@ -1,5 +1,17 @@
package com.foreverwin.mesnac.equip.service.impl;
+import com.foreverwin.mesnac.common.enums.HandleEnum;
+import com.foreverwin.mesnac.common.model.InspectionItemDetail;
+import com.foreverwin.mesnac.common.service.InspectionItemDetailService;
+import com.foreverwin.mesnac.equip.dto.ResourceInspectTaskDto;
+import com.foreverwin.mesnac.equip.model.ResourceInspectPlan;
+import com.foreverwin.mesnac.equip.model.ResourceInspectTaskParam;
+import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
+import com.foreverwin.mesnac.equip.service.ResourceInspectPlanService;
+import com.foreverwin.mesnac.equip.service.ResourceInspectTaskParamService;
+import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
+import com.foreverwin.modular.core.exception.BusinessException;
+import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -11,7 +23,12 @@ import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
+import java.util.UUID;
+
/**
*
* 设备检验任务表 服务实现类
@@ -27,6 +44,16 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, ResourceInspectTask resourceInspectTask) {
@@ -42,5 +69,165 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl findResourceInspectTaskList(ResourceInspectTaskDto resourceInspectTaskDto) {
+ String currentUser = CommonMethods.getUser();
+ String site = CommonMethods.getSite();
+ String userBo = HandleEnum.USR.getHandle(site, currentUser);
+ resourceInspectTaskDto.setCurrentUser(userBo);
+ resourceInspectTaskDto.setSite(site);
+ List list = resourceInspectTaskMapper.findResourceInspectTaskList(resourceInspectTaskDto);
+ for (ResourceInspectTaskDto task:list) {
+ task.setResourceTypeNo(task.getResourceTypeBo().split(",")[1]);
+ task.setCycle(getCycle(task));
+ task.setCurrentUser(currentUser);
+ }
+ return list;
+ }
+
+ @Override
+ public ResourceInspectTask getResourceInspectTaskAll(ResourceInspectTask resourceInspectTask) {
+ List taskList = resourceInspectTaskService.selectList(resourceInspectTask);
+ if (taskList.size()==1){
+ resourceInspectTask = taskList.get(0);
+ }else {
+ throw BusinessException.build("无法获取任务详情!!!");
+ }
+ String taskHandle = resourceInspectTask.getHandle();
+ String taskStatus = resourceInspectTask.getStatus();
+ ResourceInspectTaskParam resourceInspectTaskParam = new ResourceInspectTaskParam();
+ resourceInspectTaskParam.setResourceInspectTaskBo(taskHandle);
+ if (taskStatus.equals("401")){
+ // 判断数据是否已创建
+ List taskParams = resourceInspectTaskParamService.selectList(resourceInspectTaskParam);
+ // 任务状态为新建时,判断检验项是否更新
+ String inspectionItemBo = resourceInspectTask.getInspectionItemBo();
+ String resourceInspectPlanBo = resourceInspectTask.getResourceInspectPlanBo();
+ ResourceInspectPlan resourceInspectPlan = resourceInspectPlanService.getById(resourceInspectPlanBo);
+ String planInspectionItemBo = resourceInspectPlan.getInspectionItemBo();
+ // 检验项目清单修改:更新明细表
+ if (inspectionItemBo.equals(planInspectionItemBo)){
+ // 数据未创建——>全增
+ if (taskParams.size() == 0){
+ createAndSaveItemParams(taskHandle,inspectionItemBo);
+ }
+ }else{
+ // 判断数据是否已存在:1、存在,则全删全增;2、不存在,全增
+ if ( taskParams.size() > 0 ){
+ resourceInspectTaskParamService.removeAll(resourceInspectTaskParam);
+ }
+ createAndSaveItemParams(taskHandle,planInspectionItemBo);
+ }
+ }
+ // 新建且检验项清单未变更/非新建状态,直接返回明细清单数据
+ List itemParamList = resourceInspectTaskParamService.selectList(resourceInspectTaskParam);
+ ResourceInspectTaskSpare resourceInspectTaskSpare = new ResourceInspectTaskSpare();
+ resourceInspectTaskSpare.setResourceInspectTaskBo(taskHandle);
+ List taskSpareList = resourceInspectTaskSpareService.selectList(resourceInspectTaskSpare);
+ resourceInspectTask.setTaskItemDetailList(itemParamList);
+ resourceInspectTask.setTaskSpareList(taskSpareList);
+ return resourceInspectTask;
+ }
+
+ @Override
+ public void saveOrUpdateTaskInfo(ResourceInspectTaskDto resourceInspectTaskDto) {
+ // 站点、任务编号——任务handle
+ String site = CommonMethods.getSite();
+ String taskNo = resourceInspectTaskDto.getTaskNo();
+ String taskHandle = HandleEnum.RESOURCE_INSPECT_TASK.getHandle(site, taskNo);
+ String executor = resourceInspectTaskDto.getExecutor();
+ // 检验项、备品清单
+ List taskItemDetailList = resourceInspectTaskDto.getTaskItemDetailList();
+ List taskSpareList = resourceInspectTaskDto.getTaskSpareList();
+ // 任务主表字段:任务状态、修改人员、修改时间
+ ResourceInspectTask task = resourceInspectTaskService.getById(taskHandle);
+ task.setStatus(resourceInspectTaskDto.getStatus());
+ task.setModifyUser(executor);
+ task.setModifiedDateTime(LocalDateTime.now());
+ resourceInspectTaskService.saveOrUpdate(task);
+ // 检验项全删、全增
+ ResourceInspectTaskParam resourceInspectTaskParam = new ResourceInspectTaskParam();
+ resourceInspectTaskParam.setResourceInspectTaskBo(taskHandle);
+ /*List taskParams = resourceInspectTaskParamService.selectList(resourceInspectTaskParam);
+ if ( taskParams.size() > 0 ){
+
+ }*/
+ resourceInspectTaskParamService.removeAll(resourceInspectTaskParam);
+ for (ResourceInspectTaskParam taskParam:taskItemDetailList) {
+ taskParam.setCreatedDateTime(LocalDateTime.now());
+ taskParam.setCreateUser(executor);
+ }
+ resourceInspectTaskParamService.saveBatch(taskItemDetailList);
+ // 备品全删、全增
+ ResourceInspectTaskSpare resourceInspectTaskSpare = new ResourceInspectTaskSpare();
+ resourceInspectTaskSpare.setResourceInspectTaskBo(taskHandle);
+ resourceInspectTaskSpareService.removeAll(resourceInspectTaskSpare);
+ for (ResourceInspectTaskSpare taskSpare:taskSpareList) {
+ if (taskSpare.getDescription()==null){
+ continue;
+ }
+ taskSpare.setResourceInspectTaskBo(taskHandle);
+ taskSpare.setHandle(HandleEnum.RESOURCE_INSPECT_TASK_SPARE.getHandle(site,UUID.randomUUID().toString()));
+ taskSpare.setCreatedDateTime(LocalDateTime.now());
+ taskSpare.setCreateUser(executor);
+ }
+ resourceInspectTaskSpareService.saveBatch(taskSpareList);
+ }
+
+ /***
+ * 任务创建周期
+ */
+ private String getCycle(ResourceInspectTaskDto task){
+ String frequencyUnit = task.getFrequencyUnit();
+ String frequency = task.getFrequency();
+ StringBuffer cycle = new StringBuffer("每");
+ switch (frequencyUnit){
+ case "D":
+ cycle = cycle.append(frequency).append("天");
+ break;
+ case "H":
+ cycle = cycle.append(frequency).append("时");
+ break;
+ case "W":
+ cycle = cycle.append(frequency).append("周");
+ break;
+ case "M":
+ cycle = cycle.append(frequency).append("月");
+ break;
+ }
+ return cycle.toString();
+ }
+
+ /***
+ * 创建检验明细表
+ */
+ private void createAndSaveItemParams(String taskHandel,String inspectionItemBo){
+ InspectionItemDetail inspectionItemDetail = new InspectionItemDetail();
+ inspectionItemDetail.setInspectionItemBo(inspectionItemBo);
+ List itemDetails = inspectionItemDetailService.selectList(inspectionItemDetail);
+ List paramList = new ArrayList<>();
+ for (InspectionItemDetail detail:itemDetails) {
+ ResourceInspectTaskParam resourceInspectTaskParam = new ResourceInspectTaskParam();
+ // 检验项编号、描述;外键:任务handle、设备handle
+ resourceInspectTaskParam.setHandle(taskHandel+";"+detail.getHandle());
+ resourceInspectTaskParam.setInspectNo(detail.getParamNo());
+ resourceInspectTaskParam.setDescription(detail.getDescription());
+ resourceInspectTaskParam.setResourceInspectTaskBo(taskHandel);
+ // 检验方法、数据类型、单位、
+ resourceInspectTaskParam.setInspectMethod(detail.getInspectionMethod());
+ resourceInspectTaskParam.setInspectDataType(detail.getParamType());
+ resourceInspectTaskParam.setParamUnit(detail.getParamUnit());
+ // 是否必填、最大最、最小值、标准值
+ resourceInspectTaskParam.setRequired(detail.getIsRequired());
+ resourceInspectTaskParam.setMaxValue(detail.getMaxValue());
+ resourceInspectTaskParam.setMinValue(detail.getMinValue());
+ resourceInspectTaskParam.setStandardValue(detail.getStandardValue());
+ resourceInspectTaskParam.setCreateUser("测试数据DEL");
+ resourceInspectTaskParam.setCreatedDateTime(LocalDateTime.now());
+ paramList.add(resourceInspectTaskParam);
+ }
+ resourceInspectTaskParamService.saveBatch(paramList);
+ }
+
}
\ No newline at end of file
diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskSpareServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskSpareServiceImpl.java
new file mode 100644
index 00000000..44e6962a
--- /dev/null
+++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectTaskSpareServiceImpl.java
@@ -0,0 +1,53 @@
+package com.foreverwin.mesnac.equip.service.impl;
+
+import com.foreverwin.modular.core.util.FrontPage;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
+import com.foreverwin.mesnac.equip.mapper.ResourceInspectTaskSpareMapper;
+import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+/**
+ *
+ * 设备检验任务-备品表 服务实现类
+ *
+ *
+ * @author pavel.Liu
+ * @since 2021-06-30
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class ResourceInspectTaskSpareServiceImpl extends ServiceImpl implements ResourceInspectTaskSpareService {
+
+
+ @Autowired
+ private ResourceInspectTaskSpareMapper resourceInspectTaskSpareMapper;
+
+ @Override
+ public IPage selectPage(FrontPage frontPage, ResourceInspectTaskSpare resourceInspectTaskSpare) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.setEntity(resourceInspectTaskSpare);
+ return super.page(frontPage.getPagePlus(), queryWrapper);
+ }
+
+ @Override
+ public List selectList(ResourceInspectTaskSpare resourceInspectTaskSpare) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.setEntity(resourceInspectTaskSpare);
+ return super.list(queryWrapper);
+ }
+
+ @Override
+ public void removeAll(ResourceInspectTaskSpare resourceInspectTaskSpare) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.setEntity(resourceInspectTaskSpare);
+ super.remove(queryWrapper);
+ }
+
+
+}
\ No newline at end of file
diff --git a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml
index 96036da9..f777da27 100644
--- a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml
+++ b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml
@@ -13,14 +13,15 @@
-
+
+
@@ -29,7 +30,7 @@
- HANDLE, SITE, TASK_NO, CATEGORY, DESCRIPTION, STATUS, RESOURCE_INSPECT_PLAN_BO, INSPECTION_ITEM_BO, RESOURCE_BO, RESULT, TASK_CREATE_DATE, PLAN_START_DATE, PLAN_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, EXECUTOR, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
+ HANDLE, SITE, TASK_NO, CATEGORY, DESCRIPTION, STATUS, RESOURCE_INSPECT_PLAN_BO, INSPECTION_ITEM_BO, RESOURCE_BO, TASK_CREATE_DATE, PLAN_START_DATE, PLAN_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, EXECUTOR, RESULT, REMARK, REASON, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
@@ -72,14 +73,15 @@
AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}
AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}
AND RESOURCE_BO=#{ew.entity.resourceBo}
- AND RESULT=#{ew.entity.result}
AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}
AND PLAN_START_DATE=#{ew.entity.planStartDate}
AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}
AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}
AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
AND EXECUTOR=#{ew.entity.executor}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
+ AND REASON=#{ew.entity.reason}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
AND MODIFY_USER=#{ew.entity.modifyUser}
@@ -103,14 +105,15 @@
AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}
AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}
AND RESOURCE_BO=#{ew.entity.resourceBo}
- AND RESULT=#{ew.entity.result}
AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}
AND PLAN_START_DATE=#{ew.entity.planStartDate}
AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}
AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}
AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
AND EXECUTOR=#{ew.entity.executor}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
+ AND REASON=#{ew.entity.reason}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
AND MODIFY_USER=#{ew.entity.modifyUser}
@@ -142,14 +145,15 @@
AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}
AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}
AND RESOURCE_BO=#{ew.entity.resourceBo}
- AND RESULT=#{ew.entity.result}
AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}
AND PLAN_START_DATE=#{ew.entity.planStartDate}
AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}
AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}
AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
AND EXECUTOR=#{ew.entity.executor}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
+ AND REASON=#{ew.entity.reason}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
AND MODIFY_USER=#{ew.entity.modifyUser}
@@ -181,14 +185,15 @@
AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}
AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}
AND RESOURCE_BO=#{ew.entity.resourceBo}
- AND RESULT=#{ew.entity.result}
AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}
AND PLAN_START_DATE=#{ew.entity.planStartDate}
AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}
AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}
AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
AND EXECUTOR=#{ew.entity.executor}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
+ AND REASON=#{ew.entity.reason}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
AND MODIFY_USER=#{ew.entity.modifyUser}
@@ -220,14 +225,15 @@
AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}
AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}
AND RESOURCE_BO=#{ew.entity.resourceBo}
- AND RESULT=#{ew.entity.result}
AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}
AND PLAN_START_DATE=#{ew.entity.planStartDate}
AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}
AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}
AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
AND EXECUTOR=#{ew.entity.executor}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
+ AND REASON=#{ew.entity.reason}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
AND MODIFY_USER=#{ew.entity.modifyUser}
@@ -259,14 +265,15 @@
AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}
AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}
AND RESOURCE_BO=#{ew.entity.resourceBo}
- AND RESULT=#{ew.entity.result}
AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}
AND PLAN_START_DATE=#{ew.entity.planStartDate}
AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}
AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}
AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
AND EXECUTOR=#{ew.entity.executor}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
+ AND REASON=#{ew.entity.reason}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
AND MODIFY_USER=#{ew.entity.modifyUser}
@@ -298,14 +305,15 @@
AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}
AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}
AND RESOURCE_BO=#{ew.entity.resourceBo}
- AND RESULT=#{ew.entity.result}
AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}
AND PLAN_START_DATE=#{ew.entity.planStartDate}
AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}
AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}
AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
AND EXECUTOR=#{ew.entity.executor}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
+ AND REASON=#{ew.entity.reason}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
AND MODIFY_USER=#{ew.entity.modifyUser}
@@ -333,14 +341,15 @@
RESOURCE_INSPECT_PLAN_BO,
INSPECTION_ITEM_BO,
RESOURCE_BO,
- RESULT,
TASK_CREATE_DATE,
PLAN_START_DATE,
PLAN_COMPLETE_DATE,
ACTUAL_START_DATE,
ACTUAL_COMPLETE_DATE,
EXECUTOR,
+ RESULT,
REMARK,
+ REASON,
CREATE_USER,
CREATED_DATE_TIME,
MODIFY_USER,
@@ -356,14 +365,15 @@
#{resourceInspectPlanBo},
#{inspectionItemBo},
#{resourceBo},
- #{result},
#{taskCreateDate},
#{planStartDate},
#{planCompleteDate},
#{actualStartDate},
#{actualCompleteDate},
#{executor},
+ #{result},
#{remark},
+ #{reason},
#{createUser},
#{createdDateTime},
#{modifyUser},
@@ -386,14 +396,15 @@
#{resourceInspectPlanBo},
#{inspectionItemBo},
#{resourceBo},
- #{result},
#{taskCreateDate},
#{planStartDate},
#{planCompleteDate},
#{actualStartDate},
#{actualCompleteDate},
#{executor},
+ #{result},
#{remark},
+ #{reason},
#{createUser},
#{createdDateTime},
#{modifyUser},
@@ -412,14 +423,15 @@
RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo},
INSPECTION_ITEM_BO=#{et.inspectionItemBo},
RESOURCE_BO=#{et.resourceBo},
- RESULT=#{et.result},
TASK_CREATE_DATE=#{et.taskCreateDate},
PLAN_START_DATE=#{et.planStartDate},
PLAN_COMPLETE_DATE=#{et.planCompleteDate},
ACTUAL_START_DATE=#{et.actualStartDate},
ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},
EXECUTOR=#{et.executor},
+ RESULT=#{et.result},
REMARK=#{et.remark},
+ REASON=#{et.reason},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
@@ -438,14 +450,15 @@
RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo},
INSPECTION_ITEM_BO=#{et.inspectionItemBo},
RESOURCE_BO=#{et.resourceBo},
- RESULT=#{et.result},
TASK_CREATE_DATE=#{et.taskCreateDate},
PLAN_START_DATE=#{et.planStartDate},
PLAN_COMPLETE_DATE=#{et.planCompleteDate},
ACTUAL_START_DATE=#{et.actualStartDate},
ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},
EXECUTOR=#{et.executor},
+ RESULT=#{et.result},
REMARK=#{et.remark},
+ REASON=#{et.reason},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
@@ -464,14 +477,15 @@
RESOURCE_INSPECT_PLAN_BO=#{et.resourceInspectPlanBo},
INSPECTION_ITEM_BO=#{et.inspectionItemBo},
RESOURCE_BO=#{et.resourceBo},
- RESULT=#{et.result},
TASK_CREATE_DATE=#{et.taskCreateDate},
PLAN_START_DATE=#{et.planStartDate},
PLAN_COMPLETE_DATE=#{et.planCompleteDate},
ACTUAL_START_DATE=#{et.actualStartDate},
ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},
EXECUTOR=#{et.executor},
+ RESULT=#{et.result},
REMARK=#{et.remark},
+ REASON=#{et.reason},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
@@ -489,14 +503,15 @@
AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}
AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}
AND RESOURCE_BO=#{ew.entity.resourceBo}
- AND RESULT=#{ew.entity.result}
AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}
AND PLAN_START_DATE=#{ew.entity.planStartDate}
AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}
AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}
AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
AND EXECUTOR=#{ew.entity.executor}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
+ AND REASON=#{ew.entity.reason}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
AND MODIFY_USER=#{ew.entity.modifyUser}
@@ -545,14 +560,15 @@
AND RESOURCE_INSPECT_PLAN_BO=#{ew.entity.resourceInspectPlanBo}
AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}
AND RESOURCE_BO=#{ew.entity.resourceBo}
- AND RESULT=#{ew.entity.result}
AND TASK_CREATE_DATE=#{ew.entity.taskCreateDate}
AND PLAN_START_DATE=#{ew.entity.planStartDate}
AND PLAN_COMPLETE_DATE=#{ew.entity.planCompleteDate}
AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}
AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
AND EXECUTOR=#{ew.entity.executor}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
+ AND REASON=#{ew.entity.reason}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
AND MODIFY_USER=#{ew.entity.modifyUser}
@@ -575,4 +591,50 @@
+
+
+ SELECT ZK.* ,RIP.PLAN_NO AS PLAN_NO ,RIP.FREQUENCY ,RIP.FREQUENCY_UNIT ,
+ R.RESRCE AS RESOURCE_NO ,R.DESCRIPTION AS RESOURCE_DESCRIPTION ,
+ RTR.RESOURCE_TYPE_BO,WCT.DESCRIPTION AS WORK_CENTER
+ FROM ( SELECT * FROM Z_RESOURCE_INSPECT_TASK SD
+ WHERE SD.SITE = #{site}
+
+ AND SD.TASK_NO = #{taskNo}
+
+
+ AND SD.CATEGORY = #{category}
+
+
+ AND SD.STATUS = #{status}
+
+
+ AND SD.RESOURCE_INSPECT_PLAN_BO = #{resourceInspectPlanBo}
+
+
+ AND SD.RESOURCE_BO = #{resourceBo}
+
+
+ AND SD.TASK_CREATE_DATE > #{compareStartTime}
+
+
+ AND SD.TASK_CREATE_DATE < #{compareEndTime}
+
+ ) ZK
+ LEFT JOIN Z_INSPECT_PLAN_USER_GROUP ZG ON ZG.RESOURCE_INSPECT_PLAN_BO = ZK.RESOURCE_INSPECT_PLAN_BO
+ LEFT JOIN USER_GROUP_MEMBER UGM ON UGM.USER_GROUP_BO = ZG.USER_GROUP_BO
+ LEFT JOIN Z_RESOURCE_INSPECT_PLAN RIP ON ZK.RESOURCE_INSPECT_PLAN_BO = RIP.HANDLE
+ LEFT JOIN RESRCE R ON R.HANDLE = ZK.RESOURCE_BO
+ LEFT JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = ZK.RESOURCE_BO
+ LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCM.WORK_CENTER_BO
+ INNER JOIN RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = ZK.RESOURCE_BO
+ WHERE
+ (ZG.USER_GROUP_BO IS NULL OR (ZG.USER_GROUP_BO IS NOT NULL AND UGM.USER_OR_GROUP_GBO = #{currentUser}))
+
+ AND RTR.RESOURCE_TYPE_BO = #{resourceTypeBo}
+
+
+ AND WCM.WORK_CENTER_BO = #{workCenter}
+
+
+
diff --git a/equip/src/main/resources/mapper/ResourceInspectTaskParamMapper.xml b/equip/src/main/resources/mapper/ResourceInspectTaskParamMapper.xml
index 2d68640b..d932e90e 100644
--- a/equip/src/main/resources/mapper/ResourceInspectTaskParamMapper.xml
+++ b/equip/src/main/resources/mapper/ResourceInspectTaskParamMapper.xml
@@ -4,20 +4,19 @@
-
-
-
+
+
+
-
-
-
+
+
@@ -27,10 +26,13 @@
- HANDLE, RESOURCE_INSPECT_TASK_BO, RESOURCE_BO, INSPECT_NO, DESCRIPTION, INSPECT_METHOD, INSPECT_DATA_TYPE, REQUIRED, MIN_VALUE, MAX_VALUE, STANDARD_VALUE, RESRCE_VALUE, PARAM_UNIT, RESRCE, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
+ HANDLE, INSPECT_NO, RESOURCE_INSPECT_TASK_BO, DESCRIPTION, INSPECT_METHOD, INSPECT_DATA_TYPE, PARAM_UNIT, REQUIRED, MIN_VALUE, MAX_VALUE, STANDARD_VALUE, RESULT_VALUE, RESULT, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
+
+ SELECT FROM Z_RESOURCE_INSPECT_TASK_PARAM WHERE HANDLE=#{handle}
+
SELECT
@@ -46,6 +48,12 @@
+
+ SELECT
+ FROM Z_RESOURCE_INSPECT_TASK_PARAM WHERE HANDLE IN (
+ #{item}
+ )
+
SELECT FROM Z_RESOURCE_INSPECT_TASK_PARAM
@@ -53,19 +61,18 @@
HANDLE=#{ew.handle}
- AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
- AND RESOURCE_BO=#{ew.entity.resourceBo}
AND INSPECT_NO=#{ew.entity.inspectNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
AND DESCRIPTION=#{ew.entity.description}
AND INSPECT_METHOD=#{ew.entity.inspectMethod}
AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}
+ AND PARAM_UNIT=#{ew.entity.paramUnit}
AND REQUIRED=#{ew.entity.required}
AND MIN_VALUE=#{ew.entity.minValue}
AND MAX_VALUE=#{ew.entity.maxValue}
AND STANDARD_VALUE=#{ew.entity.standardValue}
- AND RESRCE_VALUE=#{ew.entity.resrceValue}
- AND PARAM_UNIT=#{ew.entity.paramUnit}
- AND RESRCE=#{ew.entity.resrce}
+ AND RESULT_VALUE=#{ew.entity.resultValue}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
@@ -82,19 +89,18 @@
HANDLE=#{ew.entity.handle}
- AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
- AND RESOURCE_BO=#{ew.entity.resourceBo}
AND INSPECT_NO=#{ew.entity.inspectNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
AND DESCRIPTION=#{ew.entity.description}
AND INSPECT_METHOD=#{ew.entity.inspectMethod}
AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}
+ AND PARAM_UNIT=#{ew.entity.paramUnit}
AND REQUIRED=#{ew.entity.required}
AND MIN_VALUE=#{ew.entity.minValue}
AND MAX_VALUE=#{ew.entity.maxValue}
AND STANDARD_VALUE=#{ew.entity.standardValue}
- AND RESRCE_VALUE=#{ew.entity.resrceValue}
- AND PARAM_UNIT=#{ew.entity.paramUnit}
- AND RESRCE=#{ew.entity.resrce}
+ AND RESULT_VALUE=#{ew.entity.resultValue}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
@@ -119,19 +125,18 @@
HANDLE=#{ew.entity.handle}
- AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
- AND RESOURCE_BO=#{ew.entity.resourceBo}
AND INSPECT_NO=#{ew.entity.inspectNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
AND DESCRIPTION=#{ew.entity.description}
AND INSPECT_METHOD=#{ew.entity.inspectMethod}
AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}
+ AND PARAM_UNIT=#{ew.entity.paramUnit}
AND REQUIRED=#{ew.entity.required}
AND MIN_VALUE=#{ew.entity.minValue}
AND MAX_VALUE=#{ew.entity.maxValue}
AND STANDARD_VALUE=#{ew.entity.standardValue}
- AND RESRCE_VALUE=#{ew.entity.resrceValue}
- AND PARAM_UNIT=#{ew.entity.paramUnit}
- AND RESRCE=#{ew.entity.resrce}
+ AND RESULT_VALUE=#{ew.entity.resultValue}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
@@ -156,19 +161,18 @@
HANDLE=#{ew.entity.handle}
- AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
- AND RESOURCE_BO=#{ew.entity.resourceBo}
AND INSPECT_NO=#{ew.entity.inspectNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
AND DESCRIPTION=#{ew.entity.description}
AND INSPECT_METHOD=#{ew.entity.inspectMethod}
AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}
+ AND PARAM_UNIT=#{ew.entity.paramUnit}
AND REQUIRED=#{ew.entity.required}
AND MIN_VALUE=#{ew.entity.minValue}
AND MAX_VALUE=#{ew.entity.maxValue}
AND STANDARD_VALUE=#{ew.entity.standardValue}
- AND RESRCE_VALUE=#{ew.entity.resrceValue}
- AND PARAM_UNIT=#{ew.entity.paramUnit}
- AND RESRCE=#{ew.entity.resrce}
+ AND RESULT_VALUE=#{ew.entity.resultValue}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
@@ -193,19 +197,18 @@
HANDLE=#{ew.entity.handle}
- AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
- AND RESOURCE_BO=#{ew.entity.resourceBo}
AND INSPECT_NO=#{ew.entity.inspectNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
AND DESCRIPTION=#{ew.entity.description}
AND INSPECT_METHOD=#{ew.entity.inspectMethod}
AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}
+ AND PARAM_UNIT=#{ew.entity.paramUnit}
AND REQUIRED=#{ew.entity.required}
AND MIN_VALUE=#{ew.entity.minValue}
AND MAX_VALUE=#{ew.entity.maxValue}
AND STANDARD_VALUE=#{ew.entity.standardValue}
- AND RESRCE_VALUE=#{ew.entity.resrceValue}
- AND PARAM_UNIT=#{ew.entity.paramUnit}
- AND RESRCE=#{ew.entity.resrce}
+ AND RESULT_VALUE=#{ew.entity.resultValue}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
@@ -230,19 +233,18 @@
HANDLE=#{ew.entity.handle}
- AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
- AND RESOURCE_BO=#{ew.entity.resourceBo}
AND INSPECT_NO=#{ew.entity.inspectNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
AND DESCRIPTION=#{ew.entity.description}
AND INSPECT_METHOD=#{ew.entity.inspectMethod}
AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}
+ AND PARAM_UNIT=#{ew.entity.paramUnit}
AND REQUIRED=#{ew.entity.required}
AND MIN_VALUE=#{ew.entity.minValue}
AND MAX_VALUE=#{ew.entity.maxValue}
AND STANDARD_VALUE=#{ew.entity.standardValue}
- AND RESRCE_VALUE=#{ew.entity.resrceValue}
- AND PARAM_UNIT=#{ew.entity.paramUnit}
- AND RESRCE=#{ew.entity.resrce}
+ AND RESULT_VALUE=#{ew.entity.resultValue}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
@@ -267,19 +269,18 @@
HANDLE=#{ew.entity.handle}
- AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
- AND RESOURCE_BO=#{ew.entity.resourceBo}
AND INSPECT_NO=#{ew.entity.inspectNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
AND DESCRIPTION=#{ew.entity.description}
AND INSPECT_METHOD=#{ew.entity.inspectMethod}
AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}
+ AND PARAM_UNIT=#{ew.entity.paramUnit}
AND REQUIRED=#{ew.entity.required}
AND MIN_VALUE=#{ew.entity.minValue}
AND MAX_VALUE=#{ew.entity.maxValue}
AND STANDARD_VALUE=#{ew.entity.standardValue}
- AND RESRCE_VALUE=#{ew.entity.resrceValue}
- AND PARAM_UNIT=#{ew.entity.paramUnit}
- AND RESRCE=#{ew.entity.resrce}
+ AND RESULT_VALUE=#{ew.entity.resultValue}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
@@ -300,19 +301,18 @@
INSERT INTO Z_RESOURCE_INSPECT_TASK_PARAM
HANDLE,
- RESOURCE_INSPECT_TASK_BO,
- RESOURCE_BO,
INSPECT_NO,
+ RESOURCE_INSPECT_TASK_BO,
DESCRIPTION,
INSPECT_METHOD,
INSPECT_DATA_TYPE,
+ PARAM_UNIT,
REQUIRED,
MIN_VALUE,
MAX_VALUE,
STANDARD_VALUE,
- RESRCE_VALUE,
- PARAM_UNIT,
- RESRCE,
+ RESULT_VALUE,
+ RESULT,
REMARK,
CREATE_USER,
CREATED_DATE_TIME,
@@ -321,19 +321,18 @@
VALUES
#{handle},
- #{resourceInspectTaskBo},
- #{resourceBo},
#{inspectNo},
+ #{resourceInspectTaskBo},
#{description},
#{inspectMethod},
#{inspectDataType},
+ #{paramUnit},
#{required},
#{minValue},
#{maxValue},
#{standardValue},
- #{resrceValue},
- #{paramUnit},
- #{resrce},
+ #{resultValue},
+ #{result},
#{remark},
#{createUser},
#{createdDateTime},
@@ -349,19 +348,18 @@
VALUES
#{handle},
- #{resourceInspectTaskBo},
- #{resourceBo},
#{inspectNo},
+ #{resourceInspectTaskBo},
#{description},
#{inspectMethod},
#{inspectDataType},
+ #{paramUnit},
#{required},
#{minValue},
#{maxValue},
#{standardValue},
- #{resrceValue},
- #{paramUnit},
- #{resrce},
+ #{resultValue},
+ #{result},
#{remark},
#{createUser},
#{createdDateTime},
@@ -371,26 +369,66 @@
+
+ UPDATE Z_RESOURCE_INSPECT_TASK_PARAM
+ INSPECT_NO=#{et.inspectNo},
+ RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},
+ DESCRIPTION=#{et.description},
+ INSPECT_METHOD=#{et.inspectMethod},
+ INSPECT_DATA_TYPE=#{et.inspectDataType},
+ PARAM_UNIT=#{et.paramUnit},
+ REQUIRED=#{et.required},
+ MIN_VALUE=#{et.minValue},
+ MAX_VALUE=#{et.maxValue},
+ STANDARD_VALUE=#{et.standardValue},
+ RESULT_VALUE=#{et.resultValue},
+ RESULT=#{et.result},
+ REMARK=#{et.remark},
+ CREATE_USER=#{et.createUser},
+ CREATED_DATE_TIME=#{et.createdDateTime},
+ MODIFY_USER=#{et.modifyUser},
+ MODIFIED_DATE_TIME=#{et.modifiedDateTime},
+ WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}
+
+
+ UPDATE Z_RESOURCE_INSPECT_TASK_PARAM
+ INSPECT_NO=#{et.inspectNo},
+ RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},
+ DESCRIPTION=#{et.description},
+ INSPECT_METHOD=#{et.inspectMethod},
+ INSPECT_DATA_TYPE=#{et.inspectDataType},
+ PARAM_UNIT=#{et.paramUnit},
+ REQUIRED=#{et.required},
+ MIN_VALUE=#{et.minValue},
+ MAX_VALUE=#{et.maxValue},
+ STANDARD_VALUE=#{et.standardValue},
+ RESULT_VALUE=#{et.resultValue},
+ RESULT=#{et.result},
+ REMARK=#{et.remark},
+ CREATE_USER=#{et.createUser},
+ CREATED_DATE_TIME=#{et.createdDateTime},
+ MODIFY_USER=#{et.modifyUser},
+ MODIFIED_DATE_TIME=#{et.modifiedDateTime},
+ WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}
+
UPDATE Z_RESOURCE_INSPECT_TASK_PARAM
- HANDLE=#{et.handle},
- RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},
- RESOURCE_BO=#{et.resourceBo},
INSPECT_NO=#{et.inspectNo},
+ RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},
DESCRIPTION=#{et.description},
INSPECT_METHOD=#{et.inspectMethod},
INSPECT_DATA_TYPE=#{et.inspectDataType},
+ PARAM_UNIT=#{et.paramUnit},
REQUIRED=#{et.required},
MIN_VALUE=#{et.minValue},
MAX_VALUE=#{et.maxValue},
STANDARD_VALUE=#{et.standardValue},
- RESRCE_VALUE=#{et.resrceValue},
- PARAM_UNIT=#{et.paramUnit},
- RESRCE=#{et.resrce},
+ RESULT_VALUE=#{et.resultValue},
+ RESULT=#{et.result},
REMARK=#{et.remark},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
@@ -401,19 +439,18 @@
HANDLE=#{ew.entity.handle}
- AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
- AND RESOURCE_BO=#{ew.entity.resourceBo}
AND INSPECT_NO=#{ew.entity.inspectNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
AND DESCRIPTION=#{ew.entity.description}
AND INSPECT_METHOD=#{ew.entity.inspectMethod}
AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}
+ AND PARAM_UNIT=#{ew.entity.paramUnit}
AND REQUIRED=#{ew.entity.required}
AND MIN_VALUE=#{ew.entity.minValue}
AND MAX_VALUE=#{ew.entity.maxValue}
AND STANDARD_VALUE=#{ew.entity.standardValue}
- AND RESRCE_VALUE=#{ew.entity.resrceValue}
- AND PARAM_UNIT=#{ew.entity.paramUnit}
- AND RESRCE=#{ew.entity.resrce}
+ AND RESULT_VALUE=#{ew.entity.resultValue}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
@@ -430,6 +467,9 @@
+
+ DELETE FROM Z_RESOURCE_INSPECT_TASK_PARAM WHERE HANDLE=#{handle}
+
DELETE FROM Z_RESOURCE_INSPECT_TASK_PARAM
@@ -452,19 +492,18 @@
HANDLE=#{ew.entity.handle}
- AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
- AND RESOURCE_BO=#{ew.entity.resourceBo}
AND INSPECT_NO=#{ew.entity.inspectNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
AND DESCRIPTION=#{ew.entity.description}
AND INSPECT_METHOD=#{ew.entity.inspectMethod}
AND INSPECT_DATA_TYPE=#{ew.entity.inspectDataType}
+ AND PARAM_UNIT=#{ew.entity.paramUnit}
AND REQUIRED=#{ew.entity.required}
AND MIN_VALUE=#{ew.entity.minValue}
AND MAX_VALUE=#{ew.entity.maxValue}
AND STANDARD_VALUE=#{ew.entity.standardValue}
- AND RESRCE_VALUE=#{ew.entity.resrceValue}
- AND PARAM_UNIT=#{ew.entity.paramUnit}
- AND RESRCE=#{ew.entity.resrce}
+ AND RESULT_VALUE=#{ew.entity.resultValue}
+ AND RESULT=#{ew.entity.result}
AND REMARK=#{ew.entity.remark}
AND CREATE_USER=#{ew.entity.createUser}
AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
@@ -481,6 +520,11 @@
+
+ DELETE FROM Z_RESOURCE_INSPECT_TASK_PARAM WHERE HANDLE IN (
+ #{item}
+ )
+
diff --git a/equip/src/main/resources/mapper/ResourceInspectTaskSpareMapper.xml b/equip/src/main/resources/mapper/ResourceInspectTaskSpareMapper.xml
new file mode 100644
index 00000000..ab4e9a67
--- /dev/null
+++ b/equip/src/main/resources/mapper/ResourceInspectTaskSpareMapper.xml
@@ -0,0 +1,434 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ HANDLE, SPARE_NO, RESOURCE_INSPECT_TASK_BO, ITEM_BO, DESCRIPTION, QTY, UNIT, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
+
+
+
+
+ SELECT FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE=#{handle}
+
+
+
+ SELECT
+ FROM Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+
+
+ ${k} = #{cm[${k}]}
+
+
+
+
+
+
+
+ SELECT
+ FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE IN (
+ #{item}
+ )
+
+
+
+ SELECT FROM Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+ HANDLE=#{ew.handle}
+
+ AND SPARE_NO=#{ew.entity.spareNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
+ AND ITEM_BO=#{ew.entity.itemBo}
+ AND DESCRIPTION=#{ew.entity.description}
+ AND QTY=#{ew.entity.qty}
+ AND UNIT=#{ew.entity.unit}
+ AND REMARK=#{ew.entity.remark}
+ AND CREATE_USER=#{ew.entity.createUser}
+ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
+ AND MODIFY_USER=#{ew.entity.modifyUser}
+ AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
+
+
+
+
+ SELECT COUNT(1) FROM Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+
+
+ HANDLE=#{ew.entity.handle}
+
+ AND SPARE_NO=#{ew.entity.spareNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
+ AND ITEM_BO=#{ew.entity.itemBo}
+ AND DESCRIPTION=#{ew.entity.description}
+ AND QTY=#{ew.entity.qty}
+ AND UNIT=#{ew.entity.unit}
+ AND REMARK=#{ew.entity.remark}
+ AND CREATE_USER=#{ew.entity.createUser}
+ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
+ AND MODIFY_USER=#{ew.entity.modifyUser}
+ AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ SELECT ${ew.sqlSelect} FROM Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+
+
+ HANDLE=#{ew.entity.handle}
+
+ AND SPARE_NO=#{ew.entity.spareNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
+ AND ITEM_BO=#{ew.entity.itemBo}
+ AND DESCRIPTION=#{ew.entity.description}
+ AND QTY=#{ew.entity.qty}
+ AND UNIT=#{ew.entity.unit}
+ AND REMARK=#{ew.entity.remark}
+ AND CREATE_USER=#{ew.entity.createUser}
+ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
+ AND MODIFY_USER=#{ew.entity.modifyUser}
+ AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ SELECT ${ew.sqlSelect} FROM Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+
+
+ HANDLE=#{ew.entity.handle}
+
+ AND SPARE_NO=#{ew.entity.spareNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
+ AND ITEM_BO=#{ew.entity.itemBo}
+ AND DESCRIPTION=#{ew.entity.description}
+ AND QTY=#{ew.entity.qty}
+ AND UNIT=#{ew.entity.unit}
+ AND REMARK=#{ew.entity.remark}
+ AND CREATE_USER=#{ew.entity.createUser}
+ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
+ AND MODIFY_USER=#{ew.entity.modifyUser}
+ AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ SELECT ${ew.sqlSelect} FROM Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+
+
+ HANDLE=#{ew.entity.handle}
+
+ AND SPARE_NO=#{ew.entity.spareNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
+ AND ITEM_BO=#{ew.entity.itemBo}
+ AND DESCRIPTION=#{ew.entity.description}
+ AND QTY=#{ew.entity.qty}
+ AND UNIT=#{ew.entity.unit}
+ AND REMARK=#{ew.entity.remark}
+ AND CREATE_USER=#{ew.entity.createUser}
+ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
+ AND MODIFY_USER=#{ew.entity.modifyUser}
+ AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ SELECT ${ew.sqlSelect} FROM Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+
+
+ HANDLE=#{ew.entity.handle}
+
+ AND SPARE_NO=#{ew.entity.spareNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
+ AND ITEM_BO=#{ew.entity.itemBo}
+ AND DESCRIPTION=#{ew.entity.description}
+ AND QTY=#{ew.entity.qty}
+ AND UNIT=#{ew.entity.unit}
+ AND REMARK=#{ew.entity.remark}
+ AND CREATE_USER=#{ew.entity.createUser}
+ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
+ AND MODIFY_USER=#{ew.entity.modifyUser}
+ AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ SELECT ${ew.sqlSelect} FROM Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+
+
+ HANDLE=#{ew.entity.handle}
+
+ AND SPARE_NO=#{ew.entity.spareNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
+ AND ITEM_BO=#{ew.entity.itemBo}
+ AND DESCRIPTION=#{ew.entity.description}
+ AND QTY=#{ew.entity.qty}
+ AND UNIT=#{ew.entity.unit}
+ AND REMARK=#{ew.entity.remark}
+ AND CREATE_USER=#{ew.entity.createUser}
+ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
+ AND MODIFY_USER=#{ew.entity.modifyUser}
+ AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ INSERT INTO Z_RESOURCE_INSPECT_TASK_SPARE
+
+ HANDLE,
+ SPARE_NO,
+ RESOURCE_INSPECT_TASK_BO,
+ ITEM_BO,
+ DESCRIPTION,
+ QTY,
+ UNIT,
+ REMARK,
+ CREATE_USER,
+ CREATED_DATE_TIME,
+ MODIFY_USER,
+ MODIFIED_DATE_TIME,
+ VALUES
+
+ #{handle},
+ #{spareNo},
+ #{resourceInspectTaskBo},
+ #{itemBo},
+ #{description},
+ #{qty},
+ #{unit},
+ #{remark},
+ #{createUser},
+ #{createdDateTime},
+ #{modifyUser},
+ #{modifiedDateTime},
+
+
+
+
+ INSERT INTO Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+ VALUES
+
+ #{handle},
+ #{spareNo},
+ #{resourceInspectTaskBo},
+ #{itemBo},
+ #{description},
+ #{qty},
+ #{unit},
+ #{remark},
+ #{createUser},
+ #{createdDateTime},
+ #{modifyUser},
+ #{modifiedDateTime},
+
+
+
+
+
+ UPDATE Z_RESOURCE_INSPECT_TASK_SPARE
+ SPARE_NO=#{et.spareNo},
+ RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},
+ ITEM_BO=#{et.itemBo},
+ DESCRIPTION=#{et.description},
+ QTY=#{et.qty},
+ UNIT=#{et.unit},
+ REMARK=#{et.remark},
+ CREATE_USER=#{et.createUser},
+ CREATED_DATE_TIME=#{et.createdDateTime},
+ MODIFY_USER=#{et.modifyUser},
+ MODIFIED_DATE_TIME=#{et.modifiedDateTime},
+ WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}
+
+
+
+
+ UPDATE Z_RESOURCE_INSPECT_TASK_SPARE
+ SPARE_NO=#{et.spareNo},
+ RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},
+ ITEM_BO=#{et.itemBo},
+ DESCRIPTION=#{et.description},
+ QTY=#{et.qty},
+ UNIT=#{et.unit},
+ REMARK=#{et.remark},
+ CREATE_USER=#{et.createUser},
+ CREATED_DATE_TIME=#{et.createdDateTime},
+ MODIFY_USER=#{et.modifyUser},
+ MODIFIED_DATE_TIME=#{et.modifiedDateTime},
+ WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}
+
+
+
+
+ UPDATE Z_RESOURCE_INSPECT_TASK_SPARE
+ SPARE_NO=#{et.spareNo},
+ RESOURCE_INSPECT_TASK_BO=#{et.resourceInspectTaskBo},
+ ITEM_BO=#{et.itemBo},
+ DESCRIPTION=#{et.description},
+ QTY=#{et.qty},
+ UNIT=#{et.unit},
+ REMARK=#{et.remark},
+ CREATE_USER=#{et.createUser},
+ CREATED_DATE_TIME=#{et.createdDateTime},
+ MODIFY_USER=#{et.modifyUser},
+ MODIFIED_DATE_TIME=#{et.modifiedDateTime},
+
+
+
+
+ HANDLE=#{ew.entity.handle}
+ AND SPARE_NO=#{ew.entity.spareNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
+ AND ITEM_BO=#{ew.entity.itemBo}
+ AND DESCRIPTION=#{ew.entity.description}
+ AND QTY=#{ew.entity.qty}
+ AND UNIT=#{ew.entity.unit}
+ AND REMARK=#{ew.entity.remark}
+ AND CREATE_USER=#{ew.entity.createUser}
+ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
+ AND MODIFY_USER=#{ew.entity.modifyUser}
+ AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE=#{handle}
+
+
+
+ DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+
+
+ ${k} = #{cm[${k}]}
+
+
+
+
+
+
+
+ DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE
+
+
+
+
+ HANDLE=#{ew.entity.handle}
+
+ AND SPARE_NO=#{ew.entity.spareNo}
+ AND RESOURCE_INSPECT_TASK_BO=#{ew.entity.resourceInspectTaskBo}
+ AND ITEM_BO=#{ew.entity.itemBo}
+ AND DESCRIPTION=#{ew.entity.description}
+ AND QTY=#{ew.entity.qty}
+ AND UNIT=#{ew.entity.unit}
+ AND REMARK=#{ew.entity.remark}
+ AND CREATE_USER=#{ew.entity.createUser}
+ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}
+ AND MODIFY_USER=#{ew.entity.modifyUser}
+ AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ ${ew.sqlSegment}
+
+
+
+
+ DELETE FROM Z_RESOURCE_INSPECT_TASK_SPARE WHERE HANDLE IN (
+ #{item}
+ )
+
+
+
+
diff --git a/generator/src/main/java/com/foreverwin/minth/generator/GeneratorApplication.java b/generator/src/main/java/com/foreverwin/minth/generator/GeneratorApplication.java
index ccb0aadd..f359b7bf 100644
--- a/generator/src/main/java/com/foreverwin/minth/generator/GeneratorApplication.java
+++ b/generator/src/main/java/com/foreverwin/minth/generator/GeneratorApplication.java
@@ -34,7 +34,7 @@ public class GeneratorApplication {
MpGenerator mpGenerator = mpGeneratorBuilder.dataSourceConfig(dataSourceConfig)
.tablePrefix( "APS_", "DS_", "Z_" )
.packageName( "com.foreverwin.mesnac.equip" )
- .tables("Z_RESOURCE_INSPECT_PLAN","Z_RESOURCE_INSPECT_RESOURCE","Z_RESOURCE_INSPECT_TASK","Z_RESOURCE_INSPECT_TASK_PARAM")
+ .tables("Z_RESOURCE_INSPECT_TASK_SPARE")
.author("pavel.Liu")
.uiAppId("com.foreverwin.me")
.uiPackage("com.foreverwin.me.migration")
diff --git a/listener/listener.iml b/listener/listener.iml
deleted file mode 100644
index 78998e74..00000000
--- a/listener/listener.iml
+++ /dev/null
@@ -1,218 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java
index d926d80d..7d97c9cd 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java
@@ -32,6 +32,7 @@ public class ItemController {
@GetMapping("")
public R getItemList(Item item) {
List- result;
+ item.setSite(CommonMethods.getSite());
QueryWrapper
- queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(item);
result = itemService.list(queryWrapper);
diff --git a/meapi/src/main/resources/mapper/ItemMapper.xml b/meapi/src/main/resources/mapper/ItemMapper.xml
index ca10b032..2b516e93 100644
--- a/meapi/src/main/resources/mapper/ItemMapper.xml
+++ b/meapi/src/main/resources/mapper/ItemMapper.xml
@@ -253,7 +253,7 @@
${ew.sqlSelect}
-
+
FROM ITEM I
From eaf7ea415661abec9239f45850dc5fd3591c6399 Mon Sep 17 00:00:00 2001
From: philip <244793088@qq.com>
Date: Thu, 1 Jul 2021 16:34:08 +0800
Subject: [PATCH 3/4] pod
---
.../meapi/controller/SfcController.java | 21 ++++++
.../mesnac/meapi/mapper/OperationMapper.java | 2 +
.../mesnac/meapi/mapper/SfcMapper.java | 7 ++
.../meapi/service/OperationService.java | 2 +
.../mesnac/meapi/service/SfcService.java | 5 ++
.../service/impl/OperationServiceImpl.java | 10 +++
.../meapi/service/impl/SfcServiceImpl.java | 7 ++
.../main/resources/mapper/OperationMapper.xml | 12 ++-
meapi/src/main/resources/mapper/SfcMapper.xml | 8 ++
.../controller/PodTemplateController.java | 26 +++++++
.../production/mapper/SfcCrossMapper.java | 7 +-
.../service/PodTemplateService.java | 5 ++
.../production/service/SfcCrossService.java | 44 +++++++++++
.../service/impl/PodTemplateServiceImpl.java | 75 +++++++++++++++----
.../service/impl/SfcCrossServiceImpl.java | 64 ++++++++++++++++
.../main/resources/mapper/SfcCrossMapper.xml | 62 ++++++---------
16 files changed, 299 insertions(+), 58 deletions(-)
create mode 100644 production/src/main/java/com/foreverwin/mesnac/production/service/SfcCrossService.java
create mode 100644 production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java
index 10421d8d..3199bd5a 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java
@@ -62,7 +62,28 @@ public class SfcController {
result = sfcService.list(queryWrapper);
return R.ok(result);
}
+ /**
+ * 分页查询数据
+ *
+ * @param frontPage 分页信息
+ * @return
+ */
+ @ResponseBody
+ @GetMapping("/pageByResrce")
+ public R page(FrontPage frontPage, SfcDto sfc){
+ IPage result;
+ try {
+ String site = CommonMethods.getSite();
+ sfc.setSite(site);
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.setEntity(sfc);
+ result = sfcService.pageByResrce(frontPage.getPagePlus(), queryWrapper);
+ } catch (Exception e) {
+ return R.failed(e.getMessage());
+ }
+ return R.ok(result);
+ }
/**
* 分页查询数据
*
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java
index fd171b67..612d7b3e 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java
@@ -23,4 +23,6 @@ public interface OperationMapper extends BaseMapper {
Operation selectOperationBySfcBo(@Param("sfcBo") String sfcBo, @Param("locale") String locale);
+ Operation getCurrentRevisionRef(@Param("site") String site, @Param("operation") String operation);
+
}
\ No newline at end of file
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/SfcMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/SfcMapper.java
index 42dfb822..021b01b0 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/SfcMapper.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/SfcMapper.java
@@ -1,5 +1,8 @@
package com.foreverwin.mesnac.meapi.mapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -24,4 +27,8 @@ public interface SfcMapper extends BaseMapper {
List getSfcListByResrceBO(String resrceBO);
SfcDto findSfcData(@Param("site") String site, @Param("sfc") String sfc);
+
+ Sfc findBySfc(@Param("sfc") Sfc sfc);
+
+ IPage pageByResrce(Page pagePlus,@Param("ew") QueryWrapper queryWrapper,@Param("locale")String locale);
}
\ No newline at end of file
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java
index 6903de18..35342dfe 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java
@@ -26,4 +26,6 @@ public interface OperationService extends IService {
IPage selectPage(Page page, QueryWrapper operation);
List selectList(Operation operation);
+
+ Operation getCurrentRevisionRef(String site, String operation);
}
\ No newline at end of file
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/SfcService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/SfcService.java
index be4a8471..c89430ad 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/SfcService.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/SfcService.java
@@ -1,7 +1,10 @@
package com.foreverwin.mesnac.meapi.service;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.modular.core.util.FrontPage;
@@ -17,6 +20,7 @@ import java.util.List;
* @since 2021-06-02
*/
public interface SfcService extends IService {
+ IPage pageByResrce(Page pagePlus, QueryWrapper queryWrapper);
/**
* 分页查询
@@ -45,4 +49,5 @@ public interface SfcService extends IService {
* @return
*/
SfcDto findSfcData(String site, String sfc);
+
}
\ No newline at end of file
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java
index 0429f6e2..71b6d230 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.meapi.mapper.OperationMapper;
import com.foreverwin.mesnac.meapi.model.Operation;
import com.foreverwin.mesnac.meapi.service.OperationService;
+import com.foreverwin.modular.core.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
@@ -46,5 +47,14 @@ public class OperationServiceImpl extends ServiceImpl implements SfcSe
@Autowired
private SfcMapper sfcMapper;
+ @Override
+ public IPage pageByResrce(Page pagePlus, QueryWrapper queryWrapper) {
+ return sfcMapper.pageByResrce(pagePlus, queryWrapper, LocaleContextHolder.getLocale().getLanguage());
+ }
+
@Override
public IPage selectPage(FrontPage frontPage, Sfc sfc) {
QueryWrapper queryWrapper = new QueryWrapper<>();
diff --git a/meapi/src/main/resources/mapper/OperationMapper.xml b/meapi/src/main/resources/mapper/OperationMapper.xml
index f2506945..83ba455f 100644
--- a/meapi/src/main/resources/mapper/OperationMapper.xml
+++ b/meapi/src/main/resources/mapper/OperationMapper.xml
@@ -598,11 +598,21 @@
- SELECT OP.HANDLE, OP.OPERATION,OT.DESCRIPTION FROM SFC_ROUTING SR
+ SELECT OP.HANDLE, OP.OPERATION,OT.DESCRIPTION ,SS.STEP_ID FROM SFC_ROUTING SR
JOIN SFC_ROUTER SR2 ON SR.HANDLE =SR2.SFC_ROUTING_BO AND SR2.IN_USE = 'true'
JOIN SFC_STEP SS ON SR2.HANDLE =SS.SFC_ROUTER_BO
JOIN OPERATION OP ON 'OperationBO:'|| OP.SITE ||','|| OP.OPERATION||',#'=SS.OPERATION_BO
LEFT JOIN OPERATION_T OT ON OP.HANDLE = OT.OPERATION_BO AND OT.LOCALE = #{locale}
WHERE SR.SFC_BO =#{sfcBo} AND (SS.QTY_IN_QUEUE>0 or SS.QTY_IN_WORK>0)
+
+
+ SELECT
+ HANDLE,OPERATION,
+ REVISION
+ FROM OPERATION
+ WHERE SITE = #{site}
+ AND OPERATION = #{operation}
+ AND CURRENT_REVISION = 'true'
+
diff --git a/meapi/src/main/resources/mapper/SfcMapper.xml b/meapi/src/main/resources/mapper/SfcMapper.xml
index 480f8b26..6e535505 100644
--- a/meapi/src/main/resources/mapper/SfcMapper.xml
+++ b/meapi/src/main/resources/mapper/SfcMapper.xml
@@ -663,4 +663,12 @@
LEFT JOIN OPERATION_T OTT ON SPLIT(OTT.OPERATION_BO,2) = ZSD.PREPOSITION_OPERATION AND OTT.LOCALE = 'zh'
WHERE SC.SITE = #{site} AND SC.SFC = #{sfc}
+
+
+ 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> findSfcListBySnList(@Param("site") String site, @Param("snList") List snList);
/**
* 查找工艺路线的最后一道工序
@@ -93,5 +90,7 @@ public interface SfcCrossMapper extends BaseMapper {
Map querySfcData(@Param("site")String site, @Param("locale")String locale, @Param("dto")SfcDto sfcDto);
- List> querySfcStep(@Param("site")String site, @Param("sfc")String sfc, @Param("operation")String operation);
+ Map getSfcInfo(@Param("site")String site, @Param("sfc")String sfc, @Param("operation")String operation);
+
+ Integer getSfcDispatch(@Param("site") String site, @Param("sfc") String sfc, @Param("operation") String operation, @Param("stepId") String stepId,@Param("resrce")String resrce);
}
diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java b/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java
index de7e633e..b2200c76 100644
--- a/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java
+++ b/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java
@@ -3,10 +3,15 @@ package com.foreverwin.mesnac.production.service;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
+import java.util.List;
import java.util.Map;
public interface PodTemplateService {
Map resrceEnter(WorkCenterDto workCenterDto);
Map sfcEnter(SfcDto workCenterDto);
+
+ Object getSfcInfo(SfcDto sfcDto);
+
+ void sfcStart(List sfcDto);
}
diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/SfcCrossService.java b/production/src/main/java/com/foreverwin/mesnac/production/service/SfcCrossService.java
new file mode 100644
index 00000000..e8f33804
--- /dev/null
+++ b/production/src/main/java/com/foreverwin/mesnac/production/service/SfcCrossService.java
@@ -0,0 +1,44 @@
+package com.foreverwin.mesnac.production.service;
+
+import java.math.BigDecimal;
+
+/**
+ * 描述: 工序开始
+ * 作者: philip
+ * 时间: 2021-6-30
+ */
+public interface SfcCrossService {
+ /**
+ * 开始
+ * @param site
+ * @param operationRef
+ * @param resource
+ * @param sfcRef
+ * @param qty
+ * @throws Exception
+ */
+ void startAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception;
+
+ /**
+ * 完成
+ * @param site
+ * @param operationRef
+ * @param resource
+ * @param sfcRef
+ * @param qty
+ * @throws Exception
+ */
+ void completeAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception;
+
+ /**
+ * 开始完成单个SFC
+ * @param site
+ * @param operationRef
+ * @param resource
+ * @param sfcRef
+ * @param qty
+ * @throws Exception
+ */
+ void passAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception;
+
+}
diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java
index ae844a1b..e2f1567f 100644
--- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java
+++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java
@@ -2,16 +2,19 @@ package com.foreverwin.mesnac.production.service.impl;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.service.CommonService;
+import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.meapi.model.Operation;
import com.foreverwin.mesnac.meapi.model.Resrce;
import com.foreverwin.mesnac.meapi.model.Sfc;
+import com.foreverwin.mesnac.meapi.service.OperationService;
import com.foreverwin.mesnac.meapi.service.ResrceService;
import com.foreverwin.mesnac.meapi.service.SfcService;
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
import com.foreverwin.mesnac.production.service.PodTemplateService;
+import com.foreverwin.mesnac.production.service.SfcCrossService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.util.CommonMethods;
import org.springframework.beans.factory.annotation.Autowired;
@@ -19,6 +22,8 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import java.math.BigDecimal;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -35,24 +40,27 @@ public class PodTemplateServiceImpl implements PodTemplateService {
private CommonService commonService;
@Autowired
private SfcCrossMapper sfcCrossMapper;
-
+ @Autowired
+ private SfcCrossService sfcCrossService;
+ @Autowired
+ private OperationService operationService;
@Override
public Map resrceEnter(WorkCenterDto workCenterDto) {
String site = CommonMethods.getSite();
String resrce = workCenterDto.getResrce();
String resrceBO = HandleEnum.RESOURCE.getHandle(site, resrce);
Resrce model = resrceService.getById(resrceBO);
- if (model==null){
- throw new BaseException("资源 "+resrce+" 不存在");
+ if (model == null) {
+ throw new BaseException("资源 " + resrce + " 不存在");
}
String workCenter = workCenterDto.getWorkCenter();
//校验
String workShopBo = commonService.getWorkShopBo(resrceBO);
- if (StringUtil.isBlank(workShopBo)){
- throw new BaseException("资源 "+resrce+" 未匹配到车间");
+ if (StringUtil.isBlank(workShopBo)) {
+ throw new BaseException("资源 " + resrce + " 未匹配到车间");
}
- if (!workCenter.equals(StringUtil.trimHandle(workShopBo))){
- throw new BaseException("资源 "+resrce+" 与车间不匹配");
+ if (!workCenter.equals(StringUtil.trimHandle(workShopBo))) {
+ throw new BaseException("资源 " + resrce + " 与车间不匹配");
}
//查询在该设备存在活动中的SFC
@@ -70,26 +78,36 @@ public class PodTemplateServiceImpl implements PodTemplateService {
String sfc = sfcDto.getSfc();
String operation = sfcDto.getOperation();
String locale = LocaleContextHolder.getLocale().getLanguage();
+ String resrce = sfcDto.getResrce();
//校验产品条码是否存在
Sfc sfcById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
- if (sfcById==null){
- throw new BaseException("产品条码"+sfc+"不存在");
+ if (sfcById == null) {
+ throw new BaseException("产品条码" + sfc + "不存在");
+ }
+ String status = StringUtil.trimHandle(sfcById.getStatusBo());
+ if (!status.equals("403") && !status.equals("401") && !status.equals("402")) {
+ throw new BaseException("产品条码" + sfc + "不在工作中或排队中");
}
//校验产品条码是否在当前工序排队
Operation operationBySfcBo = commonService.getOperationBySfcBo(sfcById.getHandle());
- if (StringUtil.notBlank(operation)&&!operationBySfcBo.getOperation().equals(operation)){
+ /* if (StringUtil.notBlank(operation)&&!operationBySfcBo.getOperation().equals(operation)){
throw new BaseException("产品条码"+sfc+"在"+operationBySfcBo.getOperation()+"/"+operationBySfcBo.getDescription()+"工序");
- }
+ }*/
//校验SFC+工序+设备+STEP_ID是否与当前设备确认的派工单匹配
+ Integer integer = sfcCrossMapper.getSfcDispatch(site, sfc, operationBySfcBo.getOperation(), operationBySfcBo.getStepId(), resrce);
+ if (integer < 1) {
+ throw new BaseException("产品条码与当前设备工序确认的派工单不匹配");
+ }
String substep = "";
String substepHandle = "";
//构造前台所需要的数据
- Map resultMap = sfcCrossMapper.querySfcData(site,locale,sfcDto);
- if(resultMap == null){
+ Map resultMap = sfcCrossMapper.querySfcData(site, locale, sfcDto);
+ if (resultMap == null) {
throw new BaseException("根据当前资源未找到条码[" + sfc + "]的基本信息!");
}
- List> substepList = sfcCrossMapper.querySfcStep(site, sfc, operation);
+ //List> substepList = sfcCrossMapper.querySfcStep(site, sfc, operationBySfcBo.getOperation());
+ List> substepList = new ArrayList<>();
resultMap.put("SFC_STEP_LIST", substepList);
String stepId = (String) resultMap.get("STEP_ID");
@@ -194,6 +212,33 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}*/
resultMap.put("IS_CREATE_H", isCreateH);
resultMap.put("IS_CREATE_Z", isCreateZ);
- return null;
+ return resultMap;
+ }
+
+ @Override
+ public Object getSfcInfo(SfcDto sfcDto) {
+ String site = CommonMethods.getSite();
+ String operation = sfcDto.getOperation();
+ String sfc = sfcDto.getSfc();
+ Map substepList = sfcCrossMapper.getSfcInfo(site, sfc, operation);
+ return substepList;
+ }
+
+ @Override
+ public void sfcStart(List sfcDtoList) {
+ sfcDtoList.forEach(sfcDto -> {
+ String site = CommonMethods.getSite();
+ String operation = sfcDto.getOperation();
+ Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
+ String resrce = sfcDto.getResrce();
+ String sfc = sfcDto.getSfc();
+ Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(sfc, sfc));
+ BigDecimal qty=new BigDecimal(sfcServiceById.getQty().toString());
+ try {
+ sfcCrossService.startAction(site, currentRevisionRef.getHandle(),resrce,sfcServiceById.getHandle(),qty);
+ } catch (Exception e) {
+ ExceptionUtil.throwException(e);
+ }
+ });
}
}
diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java
new file mode 100644
index 00000000..5b868a2f
--- /dev/null
+++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java
@@ -0,0 +1,64 @@
+package com.foreverwin.mesnac.production.service.impl;
+
+
+import com.foreverwin.mesnac.production.service.SfcCrossService;
+import com.foreverwin.modular.core.meext.MEServices;
+import com.foreverwin.modular.core.util.CommonMethods;
+import com.sap.me.plant.ResourceBOHandle;
+import com.sap.me.production.*;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+
+/**
+ * 描述: 工序开始
+ * 作者: philip
+ * 时间: 2021-06-30
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class SfcCrossServiceImpl implements SfcCrossService {
+
+ @Override
+ public void startAction(String site, String operationRef,
+ String resource, String sfcRef, BigDecimal qty) throws Exception {
+ SfcStartServiceInterface sfcStartService = MEServices.create("com.sap.me.production", "SfcStartService", site);
+ StartSfcRequest paramStartSfcRequest = new StartSfcRequest();
+ paramStartSfcRequest.setQty(qty);
+ paramStartSfcRequest.setOperationRef(operationRef);
+ paramStartSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue());
+ paramStartSfcRequest.setSfcRef(sfcRef);
+ paramStartSfcRequest.setUserRef(CommonMethods.getUserBo());
+ sfcStartService.startSfc(paramStartSfcRequest);
+ }
+
+ @Override
+ public void completeAction(String site, String operationRef,
+ String resource, String sfcRef, BigDecimal qty) throws Exception {
+ SfcCompleteServiceInterface sfcCompleteService = MEServices.create("com.sap.me.production", "SfcCompleteService", site);
+ CompleteSfcRequest paramCompleteSfcRequest = new CompleteSfcRequest();
+ paramCompleteSfcRequest.setOperationRef(operationRef);
+ paramCompleteSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue());
+ paramCompleteSfcRequest.setSfcRef(sfcRef);
+ if(qty != null) {
+ paramCompleteSfcRequest.setQuantity(qty);
+ }
+ paramCompleteSfcRequest.setLocation("");
+ sfcCompleteService.completeSfc(paramCompleteSfcRequest);
+ }
+
+ @Override
+ public void passAction(String site, String operationRef,
+ String resource, String sfcRef, BigDecimal qty) throws Exception {
+ SfcCompleteServiceInterface sfcCompleteService = MEServices.create("com.sap.me.production", "SfcCompleteService", site);
+ CompleteSfcQuickRequest paramCompleteSfcRequest = new CompleteSfcQuickRequest();
+ paramCompleteSfcRequest.setOperationRef(operationRef);
+ paramCompleteSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue());
+ paramCompleteSfcRequest.setSfcRef(sfcRef);
+ if(qty != null) {
+ paramCompleteSfcRequest.setQuantity(qty);
+ }
+ sfcCompleteService.completeSfcQuick(paramCompleteSfcRequest);
+ }
+}
diff --git a/production/src/main/resources/mapper/SfcCrossMapper.xml b/production/src/main/resources/mapper/SfcCrossMapper.xml
index 88d69a6c..d90b0ea9 100644
--- a/production/src/main/resources/mapper/SfcCrossMapper.xml
+++ b/production/src/main/resources/mapper/SfcCrossMapper.xml
@@ -139,8 +139,8 @@ WHERE sfc.site = #{site} and
RO_CF2.VALUE TOOL ,SOD.HANDLE SFC_DISPATCH_DETAIL_BO,
S.SFC,S.QTY SFC_QTY,RS.STEP_ID, SOD.DISPATCH_NO ,
TO_CHAR( SOD.PLANNED_START_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss')START_DATE,
- TO_CHAR(SOD.PLANNED_COMPLETE_DATE + INTERVAL '8' HOUR ,'yyyy-mm-dd hh24:mi:ss')COMP_DATE,
- TO_CHAR((SOD.PLANNED_COMPLETE_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H' ADD_DATE,
+ TO_CHAR(SOD.PLANNED_COMP_DATE + INTERVAL '8' HOUR ,'yyyy-mm-dd hh24:mi:ss')COMP_DATE,
+ TO_CHAR((SOD.PLANNED_COMP_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H' ADD_DATE,
CASE WHEN OT.DESCRIPTION LIKE 'CH%' THEN SUBSTR(OT.DESCRIPTION, 0, 3) ELSE N'' END SLOT
FROM SFC S
INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO
@@ -159,7 +159,7 @@ WHERE sfc.site = #{site} and
INNER JOIN ITEM I ON I.HANDLE = S.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE =#{locale}
INNER JOIN (
- SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMPLETE_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO
+ SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMP_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO
FROM Z_PROD_READY_TASK RB
INNER JOIN Z_SFC_DISPATCH SD ON SD.HANDLE = RB.SFC_DISPATCH_BO
WHERE RB.SITE =#{site} AND RB.STATUS = 'F'
@@ -170,42 +170,28 @@ WHERE sfc.site = #{site} and
OP.OPERATION, OT.DESCRIPTION ,OP.OPERATION||'/'||RS.STEP_ID ,RO_CF2.VALUE,
S.SFC,S.QTY ,RS.STEP_ID,SOD.DISPATCH_NO , SOD.HANDLE ,
TO_CHAR( SOD.PLANNED_START_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss'),
- TO_CHAR(SOD.PLANNED_COMPLETE_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss'),
- TO_CHAR((SOD.PLANNED_COMPLETE_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H',
+ TO_CHAR(SOD.PLANNED_COMP_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss'),
+ TO_CHAR((SOD.PLANNED_COMP_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H',
CASE WHEN OT.DESCRIPTION LIKE 'CH%' THEN SUBSTR(OT.DESCRIPTION, 0, 3) ELSE N'' END
-
- SELECT B1.OPERATION,B1.STEP_ID,B1.DESCRIPTION STEP_DESC,B1.STATE,
- B1.HANDLE,B1."SEQUENCE",
- CASE WHEN B1."SEQUENCE"=B1.MAXSEQ THEN 'true'
- ELSE 'false' END IS_SEQTRUE,B1.LONG_DESCRIPTION,
- CASE WHEN B1.STATE ='FINISHED' THEN N'已完工'
- WHEN B1."SEQUENCE"=B1.MAXSEQ AND B1.STATE ='READY' AND B1.STATUS ='403' THEN N'加工中'
- ELSE N'未加工'
- END STEP_STATUS
- FROM (
- SELECT A1.*,MAX(A1.SELECTSEQ) OVER(PARTITION BY OPERATION) MAXSEQ
- FROM (
- SELECT O.OPERATION,SST.SUBSTEP STEP_ID,SS.STATE,
- NVL(SST.DESCRIPTION,SU.DESCRIPTION) DESCRIPTION,
- CASE WHEN SS.STATE ='FINISHED' THEN N'已完工' ELSE N'加工中' END STEP_STATUS,
- SS.HANDLE,SS."SEQUENCE",
- CASE WHEN SS.STATE='FINISHED' THEN SST."SEQUENCE"+1 ELSE 0 END SELECTSEQ,ST.STATUS,
- NVL(SST.LONG_DESCRIPTION,SU.LONG_DESCRIPTION) LONG_DESCRIPTION
- FROM SFC_SUBSTEP SS
- INNER JOIN SFC_STEP SSTEP ON SS.SFC_STEP_BO=SSTEP.HANDLE AND SSTEP.DONE='false'
- AND (SSTEP.QTY_IN_QUEUE > 0 OR SSTEP.QTY_IN_WORK > 0)
- INNER JOIN SFC_ROUTER SR ON SR.HANDLE=SSTEP.SFC_ROUTER_BO
- INNER JOIN SFC_ROUTING SRI ON SRI.HANDLE=SR.SFC_ROUTING_BO
- INNER JOIN ROUTER_SUBSTEP SST ON SS.ROUTER_SUBSTEP_BO = SST.HANDLE
- LEFT JOIN SUBSTEP SU ON SU.SUBSTEP = SST.SUBSTEP AND SU.CURRENT_REVISION = 'true' AND SU.SITE = #{site}
- INNER JOIN SFC S ON S.HANDLE=SRI.SFC_BO
- INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO
- INNER JOIN OPERATION O ON O.OPERATION=SPLIT(SSTEP.OPERATION_BO,2) AND O.SITE=S.SITE AND O.CURRENT_REVISION = 'true'
- AND #{operation} IS NULL OR #{operation} = O.OPERATION)
- WHERE S.SFC=#{sfc} AND S.SITE= #{site} ORDER BY SST."SEQUENCE"
- ) A1
- ) B1 ORDER BY B1."SEQUENCE" ASC
-
+
+ SELECT O.OPERATION,SSTEP.STEP_ID,IT.DESCRIPTION,S.SFC,S.QTY,
+ CASE WHEN SSTEP.QTY_IN_WORK > 0 THEN '工作中'
+ WHEN SSTEP.QTY_IN_QUEUE > 0 THEN '排队中'
+ ELSE '新建' END STEP_STATUS
+ FROM SFC S
+ LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.HANDLE AND IT.LOCALE='zh'
+ INNER JOIN SFC_ROUTING SRI ON S.HANDLE=SRI.SFC_BO
+ INNER JOIN SFC_ROUTER SR ON SRI.HANDLE=SR.SFC_ROUTING_BO AND SR.IN_USE='true'
+ INNER JOIN ROUTER_STEP RS ON RS.ROUTER_BO=sr.ROUTER_BO
+ INNER JOIN SFC_STEP SSTEP ON SSTEP.SFC_ROUTER_BO=SR.HANDLE AND RS.STEP_ID= SSTEP.STEP_ID
+ AND (SSTEP.QTY_IN_QUEUE > 0 OR SSTEP.QTY_IN_WORK > 0)
+ INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO
+ INNER JOIN OPERATION O ON O.OPERATION=SPLIT(SSTEP.OPERATION_BO,2) AND O.SITE=S.SITE AND O.CURRENT_REVISION = 'true'
+ AND #{operation} = O.OPERATION
+ WHERE S.SFC=#{sfc} AND S.SITE=#{site}
+
+
+ SELECT COUNT(HANDLE) FROM Z_SFC_DISPATCH zsd WHERE OPERATION= #{operation} AND SFC= #{sfc} AND STEP_ID= #{stepId} AND SITE= #{site} AND RESRCE=#{resrce}
From 0b6960b7c72f74a461ad58c20e01aa1438bd0b9b Mon Sep 17 00:00:00 2001
From: zpl
Date: Thu, 1 Jul 2021 16:39:04 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E6=A8=A1=E5=9D=97--=E8=AE=BE=E5=A4=87=E6=A3=80=E9=AA=8C?=
=?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=A8=A1=E5=9D=97=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../equip/dto/ResourceInspectTaskDto.java | 356 ++++++++++++++++++
1 file changed, 356 insertions(+)
create mode 100644 equip/src/main/java/com/foreverwin/mesnac/equip/dto/ResourceInspectTaskDto.java
diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/dto/ResourceInspectTaskDto.java b/equip/src/main/java/com/foreverwin/mesnac/equip/dto/ResourceInspectTaskDto.java
new file mode 100644
index 00000000..fb34c083
--- /dev/null
+++ b/equip/src/main/java/com/foreverwin/mesnac/equip/dto/ResourceInspectTaskDto.java
@@ -0,0 +1,356 @@
+package com.foreverwin.mesnac.equip.dto;
+
+import com.foreverwin.mesnac.equip.model.ResourceInspectTaskParam;
+import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ *
+ * 设备检验任务实体类
+ *
+ *
+ * @author pavel.Liu
+ * @since 2021-06-24
+ */
+
+public class ResourceInspectTaskDto implements Serializable {
+
+ /**序号**/
+ private Integer itemSeq;
+ /**主键**/
+ private String handle;
+ /**站点**/
+ private String site;
+ /**任务编号**/
+ private String taskNo;
+ /**类型(自动AUTO/手动)**/
+ private String category;
+ /**任务描述**/
+ private String description;
+ /**任务状态(新建/处理中/完成/关闭)**/
+ private String status;
+ /**设备检验计划HANDLE**/
+ private String resourceInspectPlanBo;
+ /**检验项目清单HANDLE**/
+ private String inspectionItemBo;
+ /**设备HANDLE**/
+ private String resourceBo;
+ /**检验结果**/
+ private String result;
+ /**任务创建时间**/
+ private LocalDateTime taskCreateDate;
+ /**计划开始时间**/
+ private LocalDateTime planStartDate;
+ /**计划完成时间**/
+ private LocalDateTime planCompleteDate;
+ /**实际开始时间**/
+ private LocalDateTime actualStartDate;
+ /**实际完成时间**/
+ private LocalDateTime actualCompleteDate;
+ /**执行人**/
+ private String executor;
+ /**备注**/
+ private String remark;
+ /**检索时间段的开始时间**/
+ private LocalDateTime compareStartTime;
+ /**检索时间段的结束时间**/
+ private LocalDateTime compareEndTime;
+ /**设备编号NO**/
+ private String resourceNo;
+ /**设备描述**/
+ private String resourceDescription;
+ /**设备类型编号NO**/
+ private String resourceTypeNo;
+ /**设备类型描述**/
+ private String resourceTypeDescription;
+ /**设备类型HANDLE**/
+ private String resourceTypeBo;
+ /**计划编号NO**/
+ private String planNo;
+ /**计划描述**/
+ private String planDescription;
+ /**频率**/
+ private String frequency;
+ /**周期单位**/
+ private String frequencyUnit;
+ /**周期**/
+ private String cycle;
+ /**当前用户**/
+ private String currentUser;
+ /**车间**/
+ private String workCenter;
+ /**任务检验项明细**/
+ private List taskItemDetailList;
+ /**消耗备品**/
+ private List taskSpareList;
+
+ public List getTaskItemDetailList() {
+ return taskItemDetailList;
+ }
+
+ public void setTaskItemDetailList(List taskItemDetailList) {
+ this.taskItemDetailList = taskItemDetailList;
+ }
+
+ public List getTaskSpareList() {
+ return taskSpareList;
+ }
+
+ public void setTaskSpareList(List taskSpareList) {
+ this.taskSpareList = taskSpareList;
+ }
+
+ public ResourceInspectTaskDto() {
+ }
+
+ public String getResourceNo() {
+ return resourceNo;
+ }
+
+ public void setResourceNo(String resourceNo) {
+ this.resourceNo = resourceNo;
+ }
+
+ public String getResourceDescription() {
+ return resourceDescription;
+ }
+
+ public void setResourceDescription(String resourceDescription) {
+ this.resourceDescription = resourceDescription;
+ }
+
+ public String getPlanNo() {
+ return planNo;
+ }
+
+ public void setPlanNo(String planNo) {
+ this.planNo = planNo;
+ }
+
+ public String getPlanDescription() {
+ return planDescription;
+ }
+
+ public void setPlanDescription(String planDescription) {
+ this.planDescription = planDescription;
+ }
+
+ public String getCycle() {
+ return cycle;
+ }
+
+ public void setCycle(String cycle) {
+ this.cycle = cycle;
+ }
+
+ public String getFrequency() {
+ return frequency;
+ }
+
+ public void setFrequency(String frequency) {
+ this.frequency = frequency;
+ }
+
+ public String getFrequencyUnit() {
+ return frequencyUnit;
+ }
+
+ public void setFrequencyUnit(String frequencyUnit) {
+ this.frequencyUnit = frequencyUnit;
+ }
+
+ public String getHandle() {
+ return handle;
+ }
+
+ public void setHandle(String handle) {
+ this.handle = handle;
+ }
+
+ public String getSite() {
+ return site;
+ }
+
+ public void setSite(String site) {
+ this.site = site;
+ }
+
+ public String getTaskNo() {
+ return taskNo;
+ }
+
+ public void setTaskNo(String taskNo) {
+ this.taskNo = taskNo;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getResourceInspectPlanBo() {
+ return resourceInspectPlanBo;
+ }
+
+ public void setResourceInspectPlanBo(String resourceInspectPlanBo) {
+ this.resourceInspectPlanBo = resourceInspectPlanBo;
+ }
+
+ public String getInspectionItemBo() {
+ return inspectionItemBo;
+ }
+
+ public void setInspectionItemBo(String inspectionItemBo) {
+ this.inspectionItemBo = inspectionItemBo;
+ }
+
+ public String getResourceBo() {
+ return resourceBo;
+ }
+
+ public void setResourceBo(String resourceBo) {
+ this.resourceBo = resourceBo;
+ }
+
+ public String getResult() {
+ return result;
+ }
+
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ public LocalDateTime getTaskCreateDate() {
+ return taskCreateDate;
+ }
+
+ public void setTaskCreateDate(LocalDateTime taskCreateDate) {
+ this.taskCreateDate = taskCreateDate;
+ }
+
+ public LocalDateTime getPlanStartDate() {
+ return planStartDate;
+ }
+
+ public void setPlanStartDate(LocalDateTime planStartDate) {
+ this.planStartDate = planStartDate;
+ }
+
+ public LocalDateTime getPlanCompleteDate() {
+ return planCompleteDate;
+ }
+
+ public void setPlanCompleteDate(LocalDateTime planCompleteDate) {
+ this.planCompleteDate = planCompleteDate;
+ }
+
+ public LocalDateTime getActualStartDate() {
+ return actualStartDate;
+ }
+
+ public void setActualStartDate(LocalDateTime actualStartDate) {
+ this.actualStartDate = actualStartDate;
+ }
+
+ public LocalDateTime getActualCompleteDate() {
+ return actualCompleteDate;
+ }
+
+ public void setActualCompleteDate(LocalDateTime actualCompleteDate) {
+ this.actualCompleteDate = actualCompleteDate;
+ }
+
+ public String getExecutor() {
+ return executor;
+ }
+
+ public void setExecutor(String executor) {
+ this.executor = executor;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public LocalDateTime getCompareStartTime() {
+ return compareStartTime;
+ }
+
+ public void setCompareStartTime(LocalDateTime compareStartTime) {
+ this.compareStartTime = compareStartTime;
+ }
+
+ public LocalDateTime getCompareEndTime() {
+ return compareEndTime;
+ }
+
+ public void setCompareEndTime(LocalDateTime compareEndTime) {
+ this.compareEndTime = compareEndTime;
+ }
+
+ public String getCurrentUser() {
+ return currentUser;
+ }
+
+ public void setCurrentUser(String currentUser) {
+ this.currentUser = currentUser;
+ }
+
+ public String getResourceTypeNo() {
+ return resourceTypeNo;
+ }
+
+ public void setResourceTypeNo(String resourceTypeNo) {
+ this.resourceTypeNo = resourceTypeNo;
+ }
+
+ public String getResourceTypeDescription() {
+ return resourceTypeDescription;
+ }
+
+ public void setResourceTypeDescription(String resourceTypeDescription) {
+ this.resourceTypeDescription = resourceTypeDescription;
+ }
+
+ public String getResourceTypeBo() {
+ return resourceTypeBo;
+ }
+
+ public void setResourceTypeBo(String resourceTypeBo) {
+ this.resourceTypeBo = resourceTypeBo;
+ }
+
+ public String getWorkCenter() {
+ return workCenter;
+ }
+
+ public void setWorkCenter(String workCenter) {
+ this.workCenter = workCenter;
+ }
+}
\ No newline at end of file