pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrAssemblyPlanMapper.java
@@ -35,5 +35,5 @@ boolean exists(String name, Long id); List<PrAssemblyPlan> selectList(PrAssemblyPlan params); List<PrAssemblyPlan> selectAssyPlanList(PrAssemblyPlan params); } pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrAssemblyPlan.java
@@ -6,11 +6,13 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.dy.common.po.BaseEntity; import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.*; import java.util.Date; import java.util.List; /** * 组装生产任务计划 @@ -50,6 +52,11 @@ @NotNull(message = "生产流程实体编号不能为空") public Long processId; @TableField(exist = false) @Valid @NotEmpty(message = "流程节点不能为空") public List<PrProductionNode> nodes; /** * 名称 */ pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml
@@ -26,6 +26,8 @@ select="com.dy.pmsGlobal.daoPr.PrBatchNumberMapper.selectBatchNoById" fetchType="eager" /> <association property="processName" column="process_id" javaType="java.lang.Long" select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectProcessNameById" fetchType="eager" /> <collection property="nodes" ofType="com.dy.pmsGlobal.pojoPr.PrProductionNode" select="selectByProcess" fetchType="eager" column="process_id" /> </resultMap> <sql id="Base_Column_List"> @@ -55,8 +57,12 @@ from pr_assembly_plan where id = #{id,jdbcType=BIGINT} </select> <select id="selectList" resultMap="BaseResultMap" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> <select id="selectByProcess" resultMap="com.dy.pmsGlobal.daoPr.PrProductionNodeMapper.BaseResultMap"> select * from pr_production_node where process_id = #{processId,jdbcType=BIGINT} </select> <select id="selectAssyPlanList" resultMap="BaseResultMap" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> select <include refid="Base_Column_List" /> from pr_assembly_plan pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderCtrl.java
@@ -42,13 +42,24 @@ * @return */ @GetMapping(path="planList") public BaseResponse<List<PrAssemblyPlan>> selectOnLineList(){ public BaseResponse<List<PrAssemblyPlan>> selectAssyPlanList(){ PrAssemblyPlan params = new PrAssemblyPlan(); params.setStatus(1); List<PrAssemblyPlan> list = sv.selectAssyPlanList(params); return BaseResponseUtils.buildSuccess(list); } /** * 根据组装任务查询节点信息 * @param * @return */ /* @GetMapping(path="nodeList") public BaseResponse<List<PrAssemblyPlan>> selectOnLineList(String processId){ PrAssemblyPlan params = new PrAssemblyPlan(); params.setStatus(1); List<PrAssemblyPlan> list = sv.selectList(params); return BaseResponseUtils.buildSuccess(list); } }*/ @GetMapping(path = "test") public BaseResponse test() { log.info("test"); 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; } }