From 94d3c6d6119ac0a1c8a24d20fe82bfa20411316c Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期二, 30 七月 2024 10:27:07 +0800
Subject: [PATCH] add other method detail
---
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java | 17 +++++++++++++++--
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java | 26 +++++++++++++++++---------
2 files changed, 32 insertions(+), 11 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 9c1ddde..7b0a15f 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
@@ -75,8 +75,21 @@
return BaseResponseUtils.buildSuccess(true);
}
}
-
-
+ /**
+ * 鏃犱换鍔″伐浣滀腑鐨勫叾浠栭〉闈�
+ * @param vo
+ * @return
+ */
+ @PostMapping(path = "otherWork")
+ public BaseResponse<Boolean> otherWork(QueryVo vo) {
+ log.info("AssemblyStepCtrl.otherWork():" + vo);
+ int count = sv.otherWork(vo);
+ if (count <= 0) {
+ return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
+ } else {
+ return BaseResponseUtils.buildSuccess(true);
+ }
+ }
@PostMapping(path = "repair")
public BaseResponse repair(@RequestBody @Valid QueryVo vo) {
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 336c43f..ddc69aa 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
@@ -392,20 +392,28 @@
}
//鏃犱换鍔¤鍒掍腑鐨勫叾浠� 浼爓orkId ,鎵嬪啓宸ヤ綔鍐呭 , 鏁伴噺
@Transactional
- public int other(QueryVo vo) {
+ public int otherWork(QueryVo vo) {
long workId = Long.parseLong(vo.workId);
StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId);
if (workLast == null) {
throw new RuntimeException("绯荤粺涓病鏈夎鏉$櫥褰曚俊鎭�");
}
- StaDeviceLast deviceLast = buildDeviceLast(vo, workLast, vo.deviceNo[0]);
- int count = deviceLast.id == null ? deviceLastDao.insertSelective(deviceLast) :
- deviceLastDao.updateByPrimaryKeySelective(deviceLast);
- saveDeviceProductionLog(deviceLast);
- PrProductionNode node = nodeDao.selectByPrimaryKey(workLast.nodeId);
- if (node.isRecord) {
- saveDeviceLife(deviceLast);
- }
+ //淇濆瓨宸ヤ綔璁板綍
+ StaDeviceProductionLog log = new StaDeviceProductionLog();
+ log.setId(null); // 璁惧鐢熶骇鏃ュ織ID璁句负null锛岃〃绀烘柊澧�
+ log.setDeviceNo(""); //RepairId planId currNode deviceCycleContent memo
+ log.setWorkId(workId);
+ log.setStationId(workLast.getStationId());
+ log.setNodeContent(vo.getContent());
+ log.setStatus(DeviceStatus.COMPLETED.getCode());//瀹屾垚鐘舵��
+ log.setResult(DeviceResult.PASS.getCode());//閫氳繃
+ log.setErrorMsg(vo.getErrorMsg());
+ log.setAssistants(workLast.getAssistants());
+ log.setInTime(new Date());
+ log.setOutTime(new Date());
+ log.setUpdatedBy(workLast.getUserId());
+ log.setNumber(vo.getNumber());
+ int count = deviceProductionLogDao.insertSelective(log);
return count;
}
//鏍规嵁鑺傜偣鏌ュ嚭鑺傜偣浣滀笟鎸囧涔�
--
Gitblit v1.8.0