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 | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 45 insertions(+), 3 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 a86b7c6..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; @@ -39,6 +52,14 @@ @Autowired 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(String id){ @@ -138,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