From 4fbe2431794ce4842a4a7d1a7242d53db86182ef Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期三, 03 七月 2024 15:06:54 +0800
Subject: [PATCH] add quality and test items Api
---
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java | 21 ++++++++--
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderCtrl.java | 2 +
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java | 68 +++++++++++++++++++++++++++-------
3 files changed, 73 insertions(+), 18 deletions(-)
diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
index 754eaac..66d7081 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
@@ -2,13 +2,14 @@
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems;
+import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
/**
*璁板綍缁勮鍚勬楠�
@@ -44,4 +45,16 @@
return BaseResponseUtils.buildSuccess(true);
}
}
+ @GetMapping(path = "getQualityItems")
+ public BaseResponse<List<PltProductQualityInspectionItems>> getQualityItems(String proId) {
+ log.info("AssemblyStepCtrl.getQualityItems()");
+ List<PltProductQualityInspectionItems> result = sv.getQualityItems(proId);
+ return BaseResponseUtils.buildSuccess(result);
+ }
+ @GetMapping(path = "getTestItems")
+ public BaseResponse<List<PltProductTestInspectionItems>> getTestItems(String proId) {
+ log.info("AssemblyStepCtrl.getTestItems()");
+ List<PltProductTestInspectionItems> result = sv.getTestItems(proId);
+ return BaseResponseUtils.buildSuccess(result);
+ }
}
diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
index 4db7548..cbd6c1e 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
@@ -1,9 +1,13 @@
package com.dy.pmsStation.assemblyStep;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.dy.pmsGlobal.daoPlt.PltProductQualityInspectionItemsMapper;
+import com.dy.pmsGlobal.daoPlt.PltProductTestInspectionItemsMapper;
import com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper;
import com.dy.pmsGlobal.daoPr.PrProductionNodeMapper;
import com.dy.pmsGlobal.daoSta.*;
+import com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems;
+import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems;
import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
import com.dy.pmsGlobal.pojoPr.PrProductionNode;
import com.dy.pmsGlobal.pojoSta.*;
@@ -30,40 +34,60 @@
private StaDeviceProductionLogMapper deviceProductionLogDao;
private StaAssemblyWorkLastMapper assemblyWorkLastDao;
private PrAssemblyPlanMapper assemblyPlanDao;
-// private PrProductionProcessMapper processDao;
+ // private PrProductionProcessMapper processDao;
private PrProductionNodeMapper nodeDao;
private StaRepairInfoMapper repairInfoDao;
+ private PltProductQualityInspectionItemsMapper qualityItemsDao;
+ private PltProductTestInspectionItemsMapper testItemsDao;
+
@Autowired
public void setDeviceLastDao(StaDeviceLastMapper deviceLastDao) {
this.deviceLastDao = deviceLastDao;
}
+
@Autowired
public void setDeviceLifeDao(StaDeviceLifeMapper deviceLifeDao) {
this.deviceLifeDao = deviceLifeDao;
}
+
@Autowired
public void setWipSnExDao(StaWipSnExMapper wipSnExDao) {
this.wipSnExDao = wipSnExDao;
}
+
@Autowired
public void setDeviceProductionLogDao(StaDeviceProductionLogMapper deviceProductionLogDao) {
this.deviceProductionLogDao = deviceProductionLogDao;
}
+
@Autowired
public void setAssemblyWorkLastDao(StaAssemblyWorkLastMapper assemblyWorkLastDao) {
this.assemblyWorkLastDao = assemblyWorkLastDao;
}
+
@Autowired
public void setAssemblyPlanDao(PrAssemblyPlanMapper assemblyPlanDao) {
this.assemblyPlanDao = assemblyPlanDao;
}
+
@Autowired
public void setNodeDao(PrProductionNodeMapper nodeDao) {
this.nodeDao = nodeDao;
}
+
@Autowired
public void setRepairInfoDao(StaRepairInfoMapper repairInfoDao) {
this.repairInfoDao = repairInfoDao;
+ }
+
+ @Autowired
+ public void setQualityItemsDao(PltProductQualityInspectionItemsMapper qualityItemsDao) {
+ this.qualityItemsDao = qualityItemsDao;
+ }
+
+ @Autowired
+ public void setTestItemsDao(PltProductTestInspectionItemsMapper testItemsDao) {
+ this.testItemsDao = testItemsDao;
}
@Transactional
@@ -89,7 +113,7 @@
});
if (deviceList.isEmpty()) {
- throw new RuntimeException("璁惧鍙�("+ params.deviceNo +")鍧囦笉灞炰簬褰撳墠浠诲姟璁″垝");
+ throw new RuntimeException("璁惧鍙�(" + params.deviceNo + ")鍧囦笉灞炰簬褰撳墠浠诲姟璁″垝");
}
if (deviceList.size() > 1) {
throw new RuntimeException("璁惧鍙锋湁涓斿彧鑳芥湁涓�涓睘浜庡綋鍓嶄换鍔¤鍒�");
@@ -124,12 +148,12 @@
deviceLifeDao.insertSelective(life);
}
- private StaDeviceLast buildDeviceLast(QueryVo params, StaAssemblyWorkLast workLast, String deviceNo){
+ private StaDeviceLast buildDeviceLast(QueryVo params, StaAssemblyWorkLast workLast, String deviceNo) {
//缁勮鏁版嵁
StaDeviceLast record = new StaDeviceLast();
StaDeviceLast preRecord = deviceLastDao.selectByDeviceNo(deviceNo);
- if(preRecord != null){
+ if (preRecord != null) {
record.id = preRecord.id;
record.inTime = preRecord.outTime;
}
@@ -147,14 +171,15 @@
PrProductionNode node = nodeDao.selectByPrimaryKey(workLast.nodeId);
record.nodeContent = node.content;
- if(node.isRecord){
+ if (node.isRecord) {
record.equipCycleContent = node.equipCycleContent;
}
- record.status = getStatus(params.status,node.isEnd);
+ record.status = getStatus(params.status, node.isEnd);
return record;
}
- private void saveSnEx(StaAssemblyWorkLast workLast, List<String> deviceList,List<String> materialList, PrAssemblyPlan plan){
- for (String material:materialList) {
+
+ private void saveSnEx(StaAssemblyWorkLast workLast, List<String> deviceList, List<String> materialList, PrAssemblyPlan plan) {
+ for (String material : materialList) {
StaWipSnEx snEx = new StaWipSnEx();
snEx.deviceNo = deviceList.get(0);
snEx.productId = plan.process.proId;
@@ -165,15 +190,17 @@
wipSnExDao.insertSelective(snEx);
}
}
+
/**
* 鐘舵��: 1:缁勮涓�,2:瀹屾垚,3:缁翠慨,4:鎶ュ簾
- * @param status 鐘舵��
+ *
+ * @param status 鐘舵��
* @param isEndNode 鏄惁缁撴潫鑺傜偣
* @return 鐘舵��
*/
- private int getStatus(String status,boolean isEndNode){
+ private int getStatus(String status, boolean isEndNode) {
return switch (status) {
- case QrCodeConstant.MarkOk -> isEndNode? STATUS_COMPLETE:STATUS_OK;
+ case QrCodeConstant.MarkOk -> isEndNode ? STATUS_COMPLETE : STATUS_OK;
case QrCodeConstant.MarkUnqualified -> STATUS_REPAIR;
case QrCodeConstant.MarkWaste -> STATUS_WASTE;
default -> throw new RuntimeException("鐘舵�侀敊璇�");
@@ -203,10 +230,10 @@
deviceLast.assistants = vo.assistants;
//濡傛灉鍘熻妭鐐规槸缁撴潫鑺傜偣鎴栦箣鍚庣殑鑺傜偣锛屾槸鍒欐洿鏂颁负瀹屾垚,鍚﹀垯鏇存柊涓虹粍瑁呬腑(榛樿缁翠慨鑺傜偣鐨勭姸鎬佸彧鑳戒负 纭畾鎴� 鎶ュ簾)
boolean isEndNode = nodeDao.isEndNode(preDeviceRecord.currNode);
- if(QrCodeConstant.MarkWaste.equals(vo.status)){
+ if (QrCodeConstant.MarkWaste.equals(vo.status)) {
deviceLast.status = STATUS_WASTE;
- }else{
- deviceLast.status = isEndNode? STATUS_COMPLETE:STATUS_OK;
+ } else {
+ deviceLast.status = isEndNode ? STATUS_COMPLETE : STATUS_OK;
}
int count = deviceLast.id == null ? deviceLastDao.insertSelective(deviceLast) :
deviceLastDao.updateByPrimaryKeySelective(deviceLast);
@@ -217,4 +244,17 @@
}
return count;
}
+
+ public List<PltProductQualityInspectionItems> getQualityItems(String proId) {
+ Map<String, Object> params = new HashMap<>();
+ params.put("proId", proId);//item start count
+ //鏌ヨ绗﹀悎鏉′欢鐨勮褰�
+ return qualityItemsDao.selectSome(params);
+ }
+
+ public List<PltProductTestInspectionItems> getTestItems(String proId) {
+ Map<String, Object> params = new HashMap<>();
+ params.put("proId", proId);
+ return testItemsDao.selectSome(params);
+ }
}
diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderCtrl.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderCtrl.java
index 19e17db..4cb4a24 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderCtrl.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderCtrl.java
@@ -113,6 +113,7 @@
*/
@PostMapping(path="addAssistant")
public BaseResponse<Boolean> addAssistant(String workId ,String assistant){
+ log.info("WorkOrderCtrl.addAssistant()");
int count = sv.addAssistant(workId,assistant);
if (count <= 0) {
return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
@@ -127,6 +128,7 @@
*/
@PostMapping(path="removeAssistant")
public BaseResponse<Boolean> removeAssistant(String workId ,String assistant){
+ log.info("WorkOrderCtrl.removeAssistant()");
int count = sv.removeAssistant(workId,assistant);
if (count <= 0) {
return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
--
Gitblit v1.8.0