pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrAssemblyPlanMapper.java
@@ -34,4 +34,6 @@ int deleteLogicById(Long id); boolean exists(String name, Long id); List<PrAssemblyPlan> selectList(PrAssemblyPlan params); } pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml
@@ -56,6 +56,51 @@ where id = #{id,jdbcType=BIGINT} </select> <select id="selectList" resultMap="BaseResultMap" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> select <include refid="Base_Column_List" /> from pr_assembly_plan <trim prefix="where" suffixOverrides="and"> <if test="proId != null"> pro_id = #{proId,jdbcType=BIGINT} and </if> <if test="batchId != null"> batch_id = #{batchId,jdbcType=BIGINT} and </if> <if test="processId != null"> process_id = #{processId,jdbcType=BIGINT} and </if> <if test="name != null"> name = #{name,jdbcType=VARCHAR} and </if> <if test="number != null"> number = #{number,jdbcType=INTEGER} and </if> <if test="status != null"> status = #{status,jdbcType=TINYINT} and </if> <if test="creator != null"> creator = #{creator,jdbcType=VARCHAR} and </if> <if test="dt != null"> dt = #{dt,jdbcType=TIMESTAMP} and </if> <if test="startDate != null"> start_date = #{startDate,jdbcType=VARCHAR} and </if> <if test="endDate != null"> end_date = #{endDate,jdbcType=VARCHAR} and </if> <if test="deleted != null"> deleted = #{deleted,jdbcType=TINYINT} and </if> <if test="content != null"> content = #{content,jdbcType=VARCHAR} and </if> </trim> order by id desc </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> delete from pr_assembly_plan where id = #{id,jdbcType=BIGINT} pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proItems/ProItemsCtrl.java
@@ -118,7 +118,7 @@ @PostMapping(path="disabled") @SsoPowerAop(power = "10100011") @Log("禁用或启用质检项目") public BaseResponse<Boolean> disabled(@RequestBody PltProductUnqualifiedReason reason){ public BaseResponse<Boolean> disabled(@RequestBody PltProductQualityInspectionItems reason){ int count = sv.disabled(reason.id,reason.disabled); if (count <= 0) { pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proTestItems/ProTestItemsCtrl.java
@@ -29,13 +29,13 @@ } /** * 保存产品品质检查项目 * 保存产品测试检查项目 * @param item * @return */ @PostMapping(path="save") @SsoPowerAop(power = "10300003") @Log("保存产品品质检查项目信息") @Log("保存产品测试检查项目信息") public BaseResponse<Boolean> save(@RequestBody @Valid PltProductTestInspectionItems item){ item.deleted = false; item.disabled = false; @@ -49,13 +49,13 @@ /** * 更新产品品质检查项目信息 * 更新产品测试检查项目信息 * @param item * @return */ @PostMapping(path="update") @SsoPowerAop(power = "10300003") @Log("更新产品品质检查项目信息") @Log("更新产品测试检查项目信息") public BaseResponse<Boolean> update(@RequestBody @Valid PltProductTestInspectionItems item){ int count = sv.update(item); if (count <= 0) { @@ -66,13 +66,13 @@ } /** * 删除产品品质检查项目信息 * 删除产品测试检查项目信息 * @param id * @return */ @GetMapping(path="delete") @SsoPowerAop(power = "10300003") @Log("删除产品品质检查项目信息") @Log("删除产品测试检查项目信息") public BaseResponse<Boolean> delete(String id){ int count = sv.delete(Long.parseLong(id)); @@ -86,25 +86,25 @@ /** * 根据ID查询产品品质检查项目信息 * 根据ID查询产品测试检查项目信息 * @return */ @GetMapping(path="one") @SsoPowerAop(power = "10300002") //登录与权限同时验证 @Log("根据ID查询产品品质检查项目信息") @Log("根据ID查询产品测试检查项目信息") public BaseResponse<PltProductTestInspectionItems> one(String id){ PltProductTestInspectionItems item=sv.selectById(id); return BaseResponseUtils.buildSuccess(JSON.toJSON(item)); } /** * 查询产品品质检查项目信息 * 查询产品测试检查项目信息 * @param vo * @return */ @PostMapping(path="some") @SsoPowerAop(power = "10300002") @Log("查询产品品质检查项目信息") @Log("查询产品测试检查项目信息") public BaseResponse<QueryResultVo<List<PltProductTestInspectionItems>>> some(@RequestBody QueryVo vo){ QueryResultVo<List<PltProductTestInspectionItems>> list = sv.selectSome(vo) ; return BaseResponseUtils.buildSuccess(list); @@ -116,8 +116,8 @@ */ @PostMapping(path="disabled") @SsoPowerAop(power = "10100011") @Log("禁用或启用质检项目") public BaseResponse<Boolean> disabled(@RequestBody PltProductUnqualifiedReason reason){ @Log("禁用或启用测试项目") public BaseResponse<Boolean> disabled(@RequestBody PltProductTestInspectionItems reason){ int count = sv.disabled(reason.id,reason.disabled); if (count <= 0) { pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderCtrl.java
@@ -2,10 +2,13 @@ import com.dy.common.webUtil.BaseResponse; import com.dy.common.webUtil.BaseResponseUtils; import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan; import com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * 生产任务认领控制器 @@ -14,6 +17,38 @@ @RestController @RequestMapping(path = "workOrder") public class WorkOrderCtrl { private WorkOrderSv sv; @Autowired public void setWorkOrderSv(WorkOrderSv workOrderSv) { this.sv = workOrderSv; } /** * 查询工站是否已经被占用 * @param * @return */ @GetMapping(path="isStationUsed") public BaseResponse<Boolean> isStationUsed(StaAssemblyWorkLast last){ String message = sv.isStationUsed(last); if ("".equals(message)) { return BaseResponseUtils.buildSuccess(true); } else { return BaseResponseUtils.buildFail(message); } } /** * 查询全部执行中的组装任务清单 * @param * @return */ @GetMapping(path="planList") public BaseResponse<List<PrAssemblyPlan>> selectOnLineList(){ PrAssemblyPlan params = new PrAssemblyPlan(); params.setStatus(1); List<PrAssemblyPlan> list = sv.selectList(params); return BaseResponseUtils.buildSuccess(list); } @GetMapping(path = "test") public BaseResponse test() { pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
New file @@ -0,0 +1,58 @@ package com.dy.pmsStation.workOrder; import com.alibaba.excel.util.StringUtils; import com.dy.common.webUtil.BaseResponseUtils; import com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper; import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan; import com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Slf4j @Service public class WorkOrderSv { private PrAssemblyPlanMapper assemblyDao; @Autowired public void setAssemblyDao(PrAssemblyPlanMapper assemblyDao) { this.assemblyDao = assemblyDao; } public String isStationUsed(StaAssemblyWorkLast last){ String stationId = ""; String userId = ""; //判断哪个是人员, 哪个是工站信息 /* if(last.getStationId() != null && last.getStationId().toString().startsWith("103")){ } if(last.getUserId() != null && last.getStationId().toString().startsWith("103")){ } PrAssemblyPlan params = new PrAssemblyPlan(); params.setStatus(1); List<PrAssemblyPlan> list = sv.selectList(params); return BaseResponseUtils.buildSuccess(list); log.info("获取工站编号"); String maxCode = dao.selectMaxCode(); if (StringUtils.isBlank(maxCode)) { return DEFAULT_CODE; } else { int nextCode = Integer.parseInt(maxCode) + 1; // 检查溢出 if (nextCode > 9999) { throw new RuntimeException("工站编号溢出"); } return String.format(CODE_FORMAT, nextCode); }*/ return "OK"; } public List<PrAssemblyPlan> selectList(PrAssemblyPlan params){ List<PrAssemblyPlan> planList = assemblyDao.selectList(params); return planList; } }