From d7e416ca3ef54e449cd54feb3577d5199d8f6ade Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期五, 21 六月 2024 10:50:32 +0800
Subject: [PATCH] plan add note
---
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java | 112 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 79 insertions(+), 33 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 1e56963..6b82f7a 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
@@ -3,15 +3,25 @@
import com.alibaba.excel.util.StringUtils;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pmsGlobal.daoBa.BaUserMapper;
+import com.dy.pmsGlobal.daoOth.OthFileMapper;
import com.dy.pmsGlobal.daoPlt.PltStationMapper;
import com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper;
+import com.dy.pmsGlobal.daoPr.PrProductionNodeMapper;
+import com.dy.pmsGlobal.daoPr.PrProductionProcessMapper;
+import com.dy.pmsGlobal.daoPr.PrWorkingInstructionMapper;
import com.dy.pmsGlobal.daoSta.StaAssemblyWorkLastMapper;
+import com.dy.pmsGlobal.dyFile.FileOperate;
+import com.dy.pmsGlobal.dyFile.FileRestVo;
import com.dy.pmsGlobal.pojoBa.BaUser;
+import com.dy.pmsGlobal.pojoOth.OthFile;
import com.dy.pmsGlobal.pojoPlt.PltStation;
import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
+import com.dy.pmsGlobal.pojoPr.PrWorkingInstruction;
import com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast;
+import com.dy.pmsGlobal.util.UserUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -23,7 +33,10 @@
private BaUserMapper baUserDao;
private PltStationMapper pltStationDao;
private StaAssemblyWorkLastMapper assemblyWorkLastDao;
-
+ private FileOperate fileOperate;
+ private OthFileMapper othFileMapper;
+ @Value("${dy.webFile.fmUrl}")
+ private String fmUrl ;
@Autowired
public void setAssemblyDao(PrAssemblyPlanMapper assemblyDao) {
this.assemblyDao = assemblyDao;
@@ -40,59 +53,72 @@
private void setStaAssemblyWorkLastDao(StaAssemblyWorkLastMapper assemblyWorkLastDao){
this.assemblyWorkLastDao = assemblyWorkLastDao;
}
+ @Autowired
+ public void setFileOperate(FileOperate fileOperate){
+ this.fileOperate = fileOperate;
+ }
+ @Autowired
+ public void setOthFileMapper(OthFileMapper othFileMapper){
+ this.othFileMapper = othFileMapper;
+ }
- public String checkUser(Long id){
- Long userId = id;
+ public String checkUser(String id){
+ Long userId = null;
String message = "USER";
- //宸ョ珯103
- if(userId != null && userId.toString().startsWith("103")){
- message = checkStation(id);
- return message;
- }
- if(userId == null){
+ if(StringUtils.isBlank(id)){
message = "FALSE^鍛樺伐缂栫爜涓嶈兘涓虹┖";
return message;
}
+ //宸ョ珯103
+ if((!StringUtils.isBlank(id)) && id.toString().startsWith("103")){
+ message = checkStation(id);
+ return message;
+ }
//鐢ㄦ埛101
- if(userId.toString().startsWith("101")){
- userId = Long.parseLong(userId.toString().substring(3));
+ if(id.toString().startsWith("101")){
+ userId = Long.parseLong(id.toString().substring(3));
+ }else{
+ userId = Long.parseLong(id.toString());
}
BaUser userInfo = baUserDao.selectByPrimaryKey(userId);
if(userInfo == null){
- message = "FALSE^鍛樺伐缂栫爜涓嶅湪绯荤粺涓�,璇峰厛缁存姢鍛樺伐淇℃伅";
+ message = "FALSE^鍛樺伐缂栫爜:"+ userId +"涓嶅湪绯荤粺涓�,璇峰厛缁存姢鍛樺伐淇℃伅";
+ return message;
}
message += "^"+ userId;
return message;
}
- public String checkStation(Long id){
- Long stationId = id;
+ public String checkStation(String id){
+ Long stationId = null;
String message = "STATION";
- //鐢ㄦ埛101
- if(stationId != null && stationId.toString().startsWith("101")){
- message = checkUser(id);
- return message;
- }
- if(stationId == null){
+ if(StringUtils.isBlank(id)){
message = "FALSE^宸ョ珯缂栫爜涓嶈兘涓虹┖";
return message;
}
+ //鐢ㄦ埛101
+ if((!StringUtils.isBlank(id)) && id.toString().startsWith("101")){
+ message = checkUser(id);
+ return message;
+ }
//宸ョ珯103
- if(stationId.toString().startsWith("103")){
- stationId = Long.parseLong(stationId.toString().substring(3));
+ if(id.toString().startsWith("103")){
+ stationId = Long.parseLong(id.toString().substring(3));
+ }else{
+ stationId = Long.parseLong(id.toString());
}
PltStation record = new PltStation();
record.setId(stationId);
List<PltStation> stationInfo = pltStationDao.selectStationList(record);
if(stationInfo.size() == 0){
- message = "FALSE^宸ョ珯缂栫爜涓嶅湪绯荤粺涓�,璇峰厛缁存姢宸ョ珯淇℃伅";
+ message = "FALSE^宸ョ珯缂栫爜:"+ stationId +"涓嶅湪绯荤粺涓�,璇峰厛缁存姢宸ョ珯淇℃伅";
return message;
}
//妫�鏌ュ伐绔�
message += "^"+ stationId;
return message;
}
- public String checkStationIsUsed(StaAssemblyWorkLast last){
+ public String checkStationUsed(QueryVo last){
String message = "OK";
Long userId = null;
Long stationId = null;
@@ -100,7 +126,7 @@
String stationMsg = checkStation(last.getStationId());
if(userMsg.startsWith("FALSE") || stationMsg.startsWith("FALSE")){
if(userMsg.startsWith("FALSE") && stationMsg.startsWith("FALSE")){
- message = userMsg +","+ stationMsg.split("^")[1];
+ message = userMsg +","+ stationMsg.split("\\^")[1];
}else if(userMsg.startsWith("FALSE")){
message = userMsg;
}else if(stationMsg.startsWith("FALSE")){
@@ -109,23 +135,22 @@
return message;
}else{//鏍规嵁缁撴灉 鎵惧埌瀵瑰簲鐨処D鍊�
if(userMsg.startsWith("USER")){
- userId = Long.parseLong(userMsg.split("^")[1]);
+ userId = Long.parseLong(userMsg.split("\\^")[1]);
}else if(userMsg.startsWith("STATION")){
- stationId = Long.parseLong(userMsg.split("^")[1]);
+ stationId = Long.parseLong(userMsg.split("\\^")[1]);
}
if(stationMsg.startsWith("USER")){
- userId = Long.parseLong(stationMsg.split("^")[1]);
+ userId = Long.parseLong(stationMsg.split("\\^")[1]);
}else if(stationMsg.startsWith("STATION")){
- stationId = Long.parseLong(stationMsg.split("^")[1]);
+ stationId = Long.parseLong(stationMsg.split("\\^")[1]);
}
}
if(userId == null || stationId == null){
message = "FALSE^鍛樺伐缂栫爜:"+ last.getUserId() + "鎴栧伐绔欑紪鐮�:" + last.getStationId() + "涓嶆纭�,璇锋鏌�";
return message;
}
- //妫�鏌ヨ〃涓槸涓嶆槸宸茬粡瀛樺湪
+ //妫�鏌ヨ〃涓璼tationId鏄惁宸茬粡瀛樺湪
StaAssemblyWorkLast param = new StaAssemblyWorkLast();
- param.setUserId(userId);
param.setStationId(stationId);
param.setStatus(1);
List<StaAssemblyWorkLast> userStationList = assemblyWorkLastDao.selectList(param);
@@ -134,8 +159,29 @@
}//message = "OK^鍛樺伐缂栫爜:"+ userId+ "宸茬粡缁戝畾璇ュ伐绔欑紪鐮�:" + stationId + ".楠岃瘉閫氳繃";
return message;
}
- public List<PrAssemblyPlan> selectList(PrAssemblyPlan params){
- List<PrAssemblyPlan> planList = assemblyDao.selectList(params);
+ public List<PrAssemblyPlan> selectAssyPlanList(PrAssemblyPlan params){
+ List<PrAssemblyPlan> planList = assemblyDao.selectAssyPlanList(params);
+ planList.stream().forEach(process -> {
+ process.nodes.forEach(node -> {
+ if(node.instruction != null){
+ addUrl(node.instruction);
+ }
+ });
+ });
return planList;
}
+ private void addUrl(PrWorkingInstruction ins){
+ if (ins == null || ins.fileId == null) {
+ return;
+ }
+ OthFile file = othFileMapper.selectByPrimaryKey(ins.fileId);
+ if (file == null) {
+ return;
+ }
+ FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash);
+ ins.webUrl = fileRestVo.fileSysRestUrl + fileRestVo.fileWebDownloadPath + ins.fileId;
+ ins.orgName = file.orgName;
+ ins.extName = file.extName;
+ }
+
}
--
Gitblit v1.8.0