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/workOrder/WorkOrderSv.java | 82 ++++++++++++++++++++++------------------
1 files changed, 45 insertions(+), 37 deletions(-)
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