src/main/java/org/jeecg/modules/mes/controller/MesProductionWorkOrderController.java
@@ -37,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; @@ -174,8 +175,8 @@ public Result<String> publish(@RequestParam("ids") String ids) { List<String> idList = Arrays.asList(ids.split(",")); List<MesProductionWorkOrder> list = mesProductionWorkOrderService.list(new LambdaQueryWrapper<MesProductionWorkOrder>() .in(MesProductionWorkOrder::getId, idList) .eq(MesProductionWorkOrder::getDelFlag, CommonConstant.DEL_FLAG_0)).stream() .in(MesProductionWorkOrder::getId, idList) .eq(MesProductionWorkOrder::getDelFlag, CommonConstant.DEL_FLAG_0)).stream() .filter(i -> !ProductionWorkOrderStatus.NEW.name().equals(i.getWorkOrderStatus())) .collect(Collectors.toList()); if (!list.isEmpty()) { @@ -195,7 +196,7 @@ } @AutoLog(value = "排产工单-重发布排产计划") @ApiOperation(value="排产工单-重发布排产计划", notes="重发布排产计划") @ApiOperation(value = "排产工单-重发布排产计划", notes = "重发布排产计划") //@RequiresPermissions("org.jeecg.modules:mes_production_work_order:republish") @PostMapping(value = "/republish") public Result<String> republish(@RequestBody MesProductionWorkOrderRepublishRequest request) { @@ -215,7 +216,7 @@ } @AutoLog(value = "排产工单-齐套性检查") @ApiOperation(value="排产工单-齐套性检查", notes="齐套性检查") @ApiOperation(value = "排产工单-齐套性检查", notes = "齐套性检查") //@RequiresPermissions("org.jeecg.modules:mes_production_work_order:workOrderCompletenessCheck") @GetMapping(value = "/workOrderCompletenessCheck") public Result<List<MesKittingCompletenessCheck>> workOrderCompletenessCheck(@RequestParam("id") String id) { @@ -443,4 +444,20 @@ return super.importExcel(request, response, MesProductionWorkOrder.class); } /** * 物料拉动选择排产工单列表查询 * * @param pageNo * @param pageSize * @return */ @ApiOperation(value = "排产工单-物料拉动工单列表", notes = "排产工单-物料拉动工单列表") @GetMapping(value = "/queryWorkOrderByTransfer") public Result<IPage<MesProductionWorkOrder>> queryWorkOrderByTransfer(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { Page<MesProductionWorkOrder> page = new Page<>(pageNo, pageSize); IPage<MesProductionWorkOrder> pageList = mesProductionWorkOrderService.queryWorkOrderByTransfer(page); return Result.OK(pageList); } } src/main/java/org/jeecg/modules/mes/mapper/MesProductionWorkOrderMapper.java
@@ -1,15 +1,12 @@ package org.jeecg.modules.mes.mapper; import java.util.List; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Param; import org.jeecg.modules.mes.entity.MesProductionWorkOrder; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 排产工单 @@ -21,4 +18,11 @@ IPage<MesProductionWorkOrder> queryPageList(Page<MesProductionWorkOrder> page, @Param(Constants.WRAPPER) Wrapper<MesProductionWorkOrder> queryWrapper); /** * 物料拉动工单查询 * @param page * @return */ IPage<MesProductionWorkOrder> queryWorkOrderByTransfer(Page<MesProductionWorkOrder> page); } src/main/java/org/jeecg/modules/mes/mapper/xml/MesProductionWorkOrderMapper.xml
@@ -15,4 +15,14 @@ LEFT JOIN base_shift t3 ON t1.shift_id = t3.id ${ew.customSqlSegment} </select> <select id="queryWorkOrderByTransfer" resultType="org.jeecg.modules.mes.entity.MesProductionWorkOrder"> SELECT t1.* FROM mes_production_work_order t1 LEFT JOIN base_factory t2 ON t1.factory_id = t2.id where t1.work_order_status = 'PUBLISHED' and t2.production_type in ('ASSEMBLE', 'HEATTREATMENT') and t1.plan_quantity > 0 order by t1.create_time desc </select> </mapper> src/main/java/org/jeecg/modules/mes/service/IMesProductionWorkOrderService.java
@@ -25,4 +25,11 @@ List<MesKittingCompletenessCheck> workOrderCompletenessCheck(MesProductionWorkOrder workOrder); List<MesKittingCompletenessCheck> workOrderCompletenessCheckOnHeatTreatment(MesProductionWorkOrder workOrder); /** * 物料拉动工单查询 * @param page * @return */ IPage<MesProductionWorkOrder> queryWorkOrderByTransfer(Page<MesProductionWorkOrder> page); } src/main/java/org/jeecg/modules/mes/service/impl/MesProductionWorkOrderServiceImpl.java
@@ -288,4 +288,9 @@ .setCheckFlag(materialInventoryVo.getStockQuantity().compareTo(workOrder.getPlanQuantity()) > 0 ? CommonConstant.DEFAULT_1 : CommonConstant.DEFAULT_0); return Collections.singletonList(completenessCheck); } @Override public IPage<MesProductionWorkOrder> queryWorkOrderByTransfer(Page<MesProductionWorkOrder> page) { return this.getBaseMapper().queryWorkOrderByTransfer(page); } } src/main/java/org/jeecg/modules/pms/mapper/PmsProcessBillMaterialsDetailMapper.java
@@ -24,4 +24,12 @@ * @return */ List<PmsProcessBillMaterialsDetail> queryByMaterialNumber(String materialNumber); /** * 物料拉动选择物料使用 * 根据热处理毛坯物料查询 * @param materialNumber 热处理物料编码 * @return */ List<PmsProcessBillMaterialsDetail> queryByMaterialNumberOnly(String materialNumber); } src/main/java/org/jeecg/modules/pms/mapper/xml/PmsProcessBillMaterialsDetailMapper.xml
@@ -23,4 +23,9 @@ and t1.material_id = t2.id) </select> <select id="queryByMaterialNumberOnly" resultType="org.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail"> select DISTINCT t1.material_number, t1.material_name, t1.production_unit from pms_process_bill_materials_detail t1 where t1.material_number = #{materialNumber} </select> </mapper> src/main/java/org/jeecg/modules/pms/service/impl/PmsProcessBillMaterialsDetailServiceImpl.java
@@ -54,6 +54,11 @@ if (StringUtils.isBlank(materialNumber)) { return Collections.emptyList(); } return this.getBaseMapper().queryByMaterialNumber(materialNumber); List<PmsProcessBillMaterialsDetail> list = this.getBaseMapper().queryByMaterialNumber(materialNumber); if (CollectionUtil.isEmpty(list)) { //如果是热处理,则代表选择排产工单生产的毛坯 return this.getBaseMapper().queryByMaterialNumberOnly(materialNumber); } return list; } }