From 1d27648989e69042db607d14c474d9ea90f86d7b Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期五, 19 七月 2024 14:39:33 +0800
Subject: [PATCH] lineName change
---
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java | 1
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java | 4
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java | 82 +++++++++++++++------------
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/process/ProcessSv.java | 4
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java | 42 ++++++++++---
5 files changed, 81 insertions(+), 52 deletions(-)
diff --git a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java
index 4d220a8..75a83d1 100644
--- a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java
+++ b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java
@@ -85,12 +85,12 @@
boolean flag = false;
List<PltStation> stations = dao.selectByName(station.getName());
for (int i = 0; i < stations.size(); i++) {
- if(stations.get(i).getId().equals(station.getId())){
+ if(!stations.get(i).getId().equals(station.getId())){
flag = true;
break;
}
}
- if(!flag){
+ if(flag){
throw new RuntimeException("宸ョ珯鍚嶇О("+station.getName()+")宸插瓨鍦�,鍚嶇О涓嶅厑璁搁噸澶嶆坊鍔�,璇峰彉鏇�");
}
int count = dao.updateByPrimaryKeySelective(station);
diff --git a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/process/ProcessSv.java b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/process/ProcessSv.java
index 50c55f4..4f2a3b7 100644
--- a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/process/ProcessSv.java
+++ b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/process/ProcessSv.java
@@ -107,11 +107,11 @@
if (CollectionUtils.isNotEmpty(planList)) {
if (planList.stream().anyMatch(plan -> plan.getInputNumber() > 0)) { //瀛樺湪浠诲姟宸茬粡鎶曞叆鐢熶骇
if (!originProductionProcess.getProId().equals(process.getProId())) {
- throw new RuntimeException("瀛樺湪宸茬粡鎶曞叆鐢熶骇缁戝畾鐨勪换鍔�,浜у搧涓嶈兘淇敼");
+ throw new RuntimeException("瀛樺湪宸茬粡鎶曞叆鐢熶骇鐨勭粦瀹氫换鍔�,浜у搧涓嶈兘淇敼");
}
//鑺傜偣id涓嶈兘鍒犻櫎
if (!originProductionProcess.getNodes().stream().allMatch(node -> process.getNodes().stream().anyMatch(newNode -> node.getId().equals(newNode.getId())))) {
- throw new RuntimeException("瀛樺湪宸茬粡鎶曞叆鐢熶骇缁戝畾鐨勪换鍔�,鑺傜偣涓嶈兘鍒犻櫎");
+ throw new RuntimeException("宸叉湁缁戝畾鐨勪换鍔℃姇鍏ョ敓浜�,鑺傜偣涓嶈兘鍒犻櫎");
}
} else if (CollectionUtils.isNotEmpty(onlinePlanList)) {
//鍏堝皢缁勮浠诲姟缃负鏆傚仠鐘舵��
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 1e21a89..2ca4b2c 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
@@ -45,7 +45,6 @@
/**
* 娴嬭瘯鎴栧搧妫�閮借皟鐢ㄨ繖涓帴鍙�
- *
* @param vo
* @return
*/
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 24aea10..f30c5d3 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
@@ -325,16 +325,6 @@
}
throw new RuntimeException("鐘舵�侀敊璇紝鏃犳晥鐨勮妭鐐圭被鍨�: " + workType);
}
-
-
-
-
-
-
-
-
-
-
public int repair(QueryVo vo) {
long workId = Long.parseLong(vo.workId);
StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId);
@@ -495,6 +485,7 @@
map.put("proName", "");
map.put("proType", "");
map.put("proId", "");
+ map.put("proCode", "");
//鍒ゆ柇鏄笉鏄槸鏈巶鐗╂枡
if(CollectionUtils.isEmpty(productList)){
productList = productDao.selectAll(null);
@@ -509,10 +500,41 @@
map.put("proType", product.getType());
BigInteger proId = BigInteger.valueOf(product.getId());
map.put("proId", proId.toString());
+ map.put("proCode",product.getCode());
}
return map;
}
+ /* public PrAssemblyPlan queryPlanByDeviceNo(String deviceNo) {
+ String proCode = "";
+ String lotCode = "";
+ if (StringUtils.isNotEmpty(deviceNo) && deviceNo.length() == 22) {
+ proCode = deviceNo.substring(3,6);
+ lotCode = deviceNo.substring(6,15);
+ }
+ Map<String, String> map = new HashMap<>();
+ map.put("deviceNo", deviceNo);
+ map.put("proName", "");
+ map.put("proType", "");
+ map.put("proId", "");
+ map.put("proCode", "");
+ //鍒ゆ柇鏄笉鏄槸鏈巶鐗╂枡
+ if(CollectionUtils.isEmpty(productList)){
+ productList = productDao.selectAll(null);
+ }
+ PltProduct product = null;
+
+ if (product != null) {
+ map.put("deviceNo", deviceNo);
+ map.put("proName", product.getName());
+ map.put("proType", product.getType());
+ BigInteger proId = BigInteger.valueOf(product.getId());
+ map.put("proId", proId.toString());
+ map.put("proCode",product.getCode());
+ }
+ return map;
+ }
+*/
public List<StaDeviceLife> queryLifeByDeviceNo(String deviceNo) {
return deviceLifeDao.selectByDeviceNo(deviceNo);
}
diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
index bd51d42..43c43f0 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
@@ -34,6 +34,11 @@
private static final int STATUS_REPAIR = 3;
private static final int STATUS_WASTE = 4;
+ private static final String WORK_TYPE_ASSEMBLY = "1";
+ private static final String WORK_TYPE_TEST = "2";
+ private static final String WORK_TYPE_INSPECTION = "3";
+ private static final String WORK_TYPE_REPAIR = "4";
+
private static final String USER_PREFIX = "101";
private static final String STATION_PREFIX = "103";
@@ -186,43 +191,46 @@
}
BaUser userInfo = getUserInfo(result.getUserId().toString());
PltStation stationInfo = getStationInfo(result.getStationId().toString());
- //鏍¢獙planId processId nodeId
- PrAssemblyPlan assyPlan = assemblyDao.selectByPrimaryKey(result.getPlanId());
- boolean hasNodeId = assyPlan.getProcess().getNodes().stream()
- .anyMatch(node -> node.id.equals(result.getNodeId()));
- if (userInfo == null || stationInfo == null || assyPlan == null || (!hasNodeId)) {
- //鐩存帴鍒犻櫎璁板綍
- logout(result.getId().toString());
- result.setId(null);
- result.setStatus(STATUS_WORK_LAST_LOGOUT);
- if (userInfo == null) {
- result.setUserId(null);
- result.setUserName("");
- }
- if (stationInfo == null) {
- result.setStationId(null);
- result.setStationName("");
- }
- if (assyPlan == null) {
- result.setPlanId(null);
- result.setPlanName("");
- }
- if (!hasNodeId) {
- result.setNodeId(null);
- result.setNodeName("");
- }
- return result;
- } else {
- result.setPlanName(assyPlan.getName());
- result.setProcessName(assyPlan.getProcessName());
- result.setNodeName(assyPlan.getProcess().getNodes().get(0).getContent());
- //鎵惧埌瀵瑰簲鐨勪骇鍝佷俊鎭�
- PltProduct product = productDao.selectByPrimaryKey(assyPlan.getProId());
- if (product != null) {
- result.setProId(product.getId());
- result.setProName(product.getName());
- String devicePrefix = QrCodeConstant.TypeProduct + product.getCode() + assyPlan.getBatchNo();
- result.setDevicePrefix(devicePrefix);
+ //濡傛灉鏄淮淇畐ork_type 娌℃湁 planId processId nodeId
+ if (WORK_TYPE_REPAIR.equals(result.getWorkType())) {
+ //鏍¢獙planId processId nodeId
+ PrAssemblyPlan assyPlan = assemblyDao.selectByPrimaryKey(result.getPlanId());
+ boolean hasNodeId = assyPlan.getProcess().getNodes().stream()
+ .anyMatch(node -> node.id.equals(result.getNodeId()));
+ if (userInfo == null || stationInfo == null || assyPlan == null || (!hasNodeId)) {
+ //鐩存帴鍒犻櫎璁板綍
+ logout(result.getId().toString());
+ result.setId(null);
+ result.setStatus(STATUS_WORK_LAST_LOGOUT);
+ if (userInfo == null) {
+ result.setUserId(null);
+ result.setUserName("");
+ }
+ if (stationInfo == null) {
+ result.setStationId(null);
+ result.setStationName("");
+ }
+ if (assyPlan == null) {
+ result.setPlanId(null);
+ result.setPlanName("");
+ }
+ if (!hasNodeId) {
+ result.setNodeId(null);
+ result.setNodeName("");
+ }
+ return result;
+ } else {
+ result.setPlanName(assyPlan.getName());
+ result.setProcessName(assyPlan.getProcessName());
+ result.setNodeName(assyPlan.getProcess().getNodes().get(0).getContent());
+ //鎵惧埌瀵瑰簲鐨勪骇鍝佷俊鎭�
+ PltProduct product = productDao.selectByPrimaryKey(assyPlan.getProId());
+ if (product != null) {
+ result.setProId(product.getId());
+ result.setProName(product.getName());
+ String devicePrefix = QrCodeConstant.TypeProduct + product.getCode() + assyPlan.getBatchNo();
+ result.setDevicePrefix(devicePrefix);
+ }
}
}
result.setStationId(stationInfo.getId());
--
Gitblit v1.8.0