diff --git a/ruoyi-common/hwmom-common-mom/src/main/java/org/dromara/common/provider/DynamicBaseSqlProvider.java b/ruoyi-common/hwmom-common-mom/src/main/java/org/dromara/common/provider/DynamicBaseSqlProvider.java index f20e99f7..48707117 100644 --- a/ruoyi-common/hwmom-common-mom/src/main/java/org/dromara/common/provider/DynamicBaseSqlProvider.java +++ b/ruoyi-common/hwmom-common-mom/src/main/java/org/dromara/common/provider/DynamicBaseSqlProvider.java @@ -26,16 +26,25 @@ public class DynamicBaseSqlProvider { "#{entity.productOrderId}", "#{entity.dispatchCode}", "#{entity.processOrder}", "#{entity.materialBomId}"); break; case "prod_product_plan_detail": - sql.INTO_COLUMNS("plan_detail_code", "plan_id", "plan_code", "user_id", "user_name", - "classes_id", "team_id", "complete_amount", "unit_id", "unit_name", "real_begin_time", "real_end_time", - "attach_id", "material_barcode", "return_barcode", "train_number", "tooling_id", "capsule_id", "shift_change_id", - "alarm_flag", "supple_flag", "remark", "create_dept", "create_by", "create_time"); - sql.INTO_VALUES("#{entity.planDetailCode}", "#{entity.planId}", "#{entity.planCode}", - "#{entity.userId}", "#{entity.userName}", "#{entity.classesId}", "#{entity.teamId}", "#{entity.completeAmount}", - "#{entity.unitId}", "#{entity.unitName}", "#{entity.realBeginTime}", "#{entity.realEndTime}", "#{entity.attachId}", - "#{entity.materialBarcode}", "#{entity.returnBarcode}", "#{entity.trainNumber}", "#{entity.toolingId}", - "#{entity.capsuleId}", "#{entity.shiftChangeId}", "#{entity.alarmFlag}", - "#{entity.suppleFlag}", "#{entity.remark}", "#{entity.createDept}", "#{entity.createBy}", "#{entity.createTime}"); + sql.INTO_COLUMNS("plan_detail_code", "plan_id", "plan_code", + "user_id", "user_name", "shift_id", "class_team_id", + "complete_amount", "unit_id", "unit_name", "real_begin_time", + "real_end_time", "attach_id", "material_barcode", "return_barcode", + "train_number", "tooling_id", "capsule_id", "shift_change_id", + "sfp_detail_id", "forming_detail_id", "vul_detail_id", + "plan_detail_status", "first_flag", "alarm_flag", "supple_flag", + "remark", "create_dept", "create_by", "create_time", "remaining_amount"); + sql.INTO_VALUES("#{entity.planDetailCode}", "#{entity.planId}", + "#{entity.planCode}", "#{entity.userId}", "#{entity.userName}", + "#{entity.shiftId}", "#{entity.classTeamId}", "#{entity.completeAmount}", + "#{entity.unitId}", "#{entity.unitName}", "#{entity.realBeginTime}", + "#{entity.realEndTime}", "#{entity.attachId}", "#{entity.materialBarcode}", + "#{entity.returnBarcode}", "#{entity.trainNumber}", "#{entity.toolingId}", + "#{entity.capsuleId}", "#{entity.shiftChangeId}", "#{entity.sfpDetailId}", + "#{entity.formingDetailId}", "#{entity.vulDetailId}", "#{entity.planDetailStatus}", + "#{entity.firstFlag}", "#{entity.alarmFlag}", "#{entity.suppleFlag}", + "#{entity.remark}", "#{entity.createDept}", "#{entity.createBy}", + "#{entity.createTime}", "#{entity.remainingAmount}"); break; } return sql.toString(); @@ -67,6 +76,9 @@ public class DynamicBaseSqlProvider { if (hasFieldValue(entity, "dispatchAmount")) { sql.SET("dispatch_amount = #{entity.dispatchAmount}"); } + if (hasFieldValue(entity, "completeAmount")) { + sql.SET("complete_amount = #{entity.completeAmount}"); + } if (hasFieldValue(entity, "planBeginTime")) { sql.SET("plan_begin_time = #{entity.planBeginTime}"); } diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/controller/ProdPlanInfoController.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/controller/ProdPlanInfoController.java index 736f3cc1..3dfb5a66 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/controller/ProdPlanInfoController.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/controller/ProdPlanInfoController.java @@ -180,6 +180,15 @@ public class ProdPlanInfoController extends BaseController { return toAjax(prodPlanInfoService.orderAddMesProductPlanList(productPlanEditVo)); } + /** + * 机加生产工单新增生产派工List + */ + @PostMapping("/orderAddProductPlanJJList") + @RepeatSubmit(message = "正在提交,请稍后") + public R orderAddMesProductPlanJJList(@RequestBody MesProductPlanEditVo productPlanEditVo) { + return toAjax(prodPlanInfoService.orderAddMesProductPlanJJList(productPlanEditVo)); + } + /** * 下发选中计划 * @param workshopId @@ -232,6 +241,57 @@ public class ProdPlanInfoController extends BaseController { return prodPlanInfoService.sendEvent(planId, event); } + /** + * 开始工单(更新工单状态为已开始) + * @param planId 工单ID + * @return + */ + @SaCheckPermission("mes:planInfo:edit") + @Log(title = "生产工单信息", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("/start/{planId}") + public R startPlan(@NotNull(message = "主键不能为空") @PathVariable Long planId) { + return toAjax(prodPlanInfoService.startPlan(planId)); + } + + /** + * 停工 + * @param planId 工单ID + * @return + */ + @SaCheckPermission("mes:planInfo:edit") + @Log(title = "生产工单信息", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("/stop/{planId}") + public R stopPlan(@NotNull(message = "主键不能为空") @PathVariable Long planId) { + return toAjax(prodPlanInfoService.stopPlan(planId)); + } + + /** + * 复工(更新工单状态为已开始) + * @param planId 工单ID + * @return + */ + @SaCheckPermission("mes:planInfo:edit") + @Log(title = "生产工单信息", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("/resume/{planId}") + public R resumePlan(@NotNull(message = "主键不能为空") @PathVariable Long planId) { + return toAjax(prodPlanInfoService.resumePlan(planId)); + } + + /** + * 报工 + * @param bo 报工信息 + * @return + */ + @SaCheckPermission("mes:planInfo:edit") + @Log(title = "生产工单信息", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PostMapping("/report") + public R reportWork(@Validated @RequestBody ProdPlanInfoBo bo) { + return toAjax(prodPlanInfoService.reportWork(bo)); + } // @SaCheckPermission("mes:planInfo:export") // @Log(title = "生产计划监控", businessType = BusinessType.EXPORT) diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/bo/ProdPlanInfoBo.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/bo/ProdPlanInfoBo.java index 5d5fd0ef..2d22e571 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/bo/ProdPlanInfoBo.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/bo/ProdPlanInfoBo.java @@ -198,5 +198,15 @@ public class ProdPlanInfoBo extends BaseEntity { private List planIds; + /** + * 报工数量(用于报工接口) + */ + private BigDecimal reportQuantity; + + /** + * 不良数量(用于报工接口) + */ + private BigDecimal defectiveQuantity; + } diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/vo/MesProductPlanEditVo.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/vo/MesProductPlanEditVo.java index 3d8b24d0..80d703bd 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/vo/MesProductPlanEditVo.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/vo/MesProductPlanEditVo.java @@ -31,4 +31,9 @@ public class MesProductPlanEditVo { * 待删除的生产计划ID列表 */ private Long[] toDeletedPlanIds; + + /** + * 机台Ids + */ + private Long[] machineIds; } diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/IProdPlanInfoService.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/IProdPlanInfoService.java index 93c2e007..e01fccfd 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/IProdPlanInfoService.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/IProdPlanInfoService.java @@ -102,6 +102,14 @@ public interface IProdPlanInfoService { */ int orderAddMesProductPlanList(MesProductPlanEditVo mesProductPlanEditVo); + /** + * 机加生产工单新增生产派工List + * + * @param mesProductPlanEditVo 生产派工VO对象 + * @return + */ + int orderAddMesProductPlanJJList(MesProductPlanEditVo mesProductPlanEditVo); + /** * 下发选中计划 * @param workshopId @@ -120,7 +128,33 @@ public interface IProdPlanInfoService { public boolean sendEvent(Long planId, PlanEventEnum event); + /** + * 开始工单(更新工单状态为已开始) + * @param planId 工单ID + * @return 是否成功 + */ + Boolean startPlan(Long planId); + /** + * 停工(更新工单状态为已下发) + * @param planId 工单ID + * @return 是否成功 + */ + Boolean stopPlan(Long planId); + + /** + * 复工(更新工单状态为已开始) + * @param planId 工单ID + * @return 是否成功 + */ + Boolean resumePlan(Long planId); + + /** + * 报工(更新报工数量和不良数量,存入生产信息) + * @param bo 报工信息 + * @return 是否成功 + */ + Boolean reportWork(ProdPlanInfoBo bo); /** * 导出生产计划监控列表 diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/IProdProductPlanDetailService.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/IProdProductPlanDetailService.java index 732e4618..eec5fa35 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/IProdProductPlanDetailService.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/IProdProductPlanDetailService.java @@ -49,6 +49,14 @@ public interface IProdProductPlanDetailService { */ Boolean insertByBo(ProdProductPlanDetailBo bo); + /** + * 新增机加生产信息 + * + * @param bo 生产信息 + * @return 是否新增成功 + */ + Boolean insertJJByBo(ProdProductPlanDetailBo bo); + /** * 修改生产信息 * diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdPlanInfoServiceImpl.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdPlanInfoServiceImpl.java index 030c4f5d..d0cf7fd1 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdPlanInfoServiceImpl.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdPlanInfoServiceImpl.java @@ -26,7 +26,9 @@ import org.dromara.mes.enums.PlanStatusEnum; import org.dromara.mes.mapper.ProdPlanInfoMapper; import org.dromara.mes.service.IProdPlanInfoService; import org.dromara.mes.service.IProdOrderInfoService; +import org.dromara.mes.service.IProdProductPlanDetailService; import org.dromara.mes.domain.bo.ProdOrderInfoBo; +import org.dromara.mes.domain.bo.ProdProductPlanDetailBo; import org.dromara.system.api.RemoteCodeRuleService; import org.apache.dubbo.config.annotation.DubboReference; import org.slf4j.Logger; @@ -67,6 +69,9 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService { @Autowired(required = false) private IProdOrderInfoService prodOrderInfoService; + @Autowired(required = false) + private IProdProductPlanDetailService prodProductPlanDetailService; + @DubboReference private RemoteCodeRuleService remoteCodeRuleService; @@ -116,7 +121,6 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService { } private MPJLambdaWrapper buildQueryWrapper(ProdPlanInfoBo bo) { - System.out.println("wo;" + bo.getWorkshopId()); Map params = bo.getParams(); MPJLambdaWrapper lqw = JoinWrappers.lambda(ProdPlanInfo.class) .selectAll(ProdPlanInfo.class) @@ -244,6 +248,15 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService { return Seq.getId(Seq.mesPlanCodeSeqType, Seq.mesPlanCodeCode); } + /** + * 获取生产明细编号 + * + * @return 生产明细编号 + */ + private String getPlanDetailCode() { + return remoteCodeRuleService.selectCodeRuleCode("6"); + } + /** * 查询生产派工列表,join process * @@ -279,6 +292,47 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService { @Override @Transactional(rollbackFor = Exception.class) public int orderAddMesProductPlanList(MesProductPlanEditVo mesProductPlanEditVo) { + Long[] machineIds = mesProductPlanEditVo.getMachineIds(); + //要新增的派工数据列表 + List mesProductPlanList = mesProductPlanEditVo.getMesProductPlanList(); + if (ObjectUtils.isEmpty(mesProductPlanList)) { + throw new ServiceException("无有效的派工数据提交"); + }else { + for (ProdPlanInfoBo mesProductPlanBo : mesProductPlanList) { + //设置编号 + mesProductPlanBo.setProductOrderId(mesProductPlanEditVo.getProductOrderId()); + mesProductPlanBo.setPlanCode(getDispatchCode()); + mesProductPlanBo.setDispatchAmount(mesProductPlanBo.getPlanAmount()); + mesProductPlanBo.setImportFlag("0"); + } + } + + int successCount = 0; + for (Long machineId : machineIds) { + for (ProdPlanInfoBo productPlanBo : mesProductPlanList) { + productPlanBo.setReleaseId(machineId); + boolean flag = this.insertByBo(productPlanBo); + if (flag) { + successCount++; + } + } + } + + if (successCount == 0) { + throw new ServiceException("派工数据保存失败"); + } + return successCount; + } + + /** + * 机加生产工单新增生产派工List + * + * @param mesProductPlanEditVo 生产派工VO对象 + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int orderAddMesProductPlanJJList(MesProductPlanEditVo mesProductPlanEditVo) { Long productOrderId = mesProductPlanEditVo.getProductOrderId(); Long dispatchAmount = mesProductPlanEditVo.getDispatchAmount(); List mesProductPlanList = mesProductPlanEditVo.getMesProductPlanList(); @@ -370,6 +424,9 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService { @Transactional(rollbackFor = Exception.class) public Boolean issuePlanByPlanIds(Long workshopId, List planIds) { ProdPlanInfoBo bo = new ProdPlanInfoBo(); + if (workshopId.equals(0L)){ + workshopId = null; + } bo.setWorkshopId(workshopId); bo.setPlanIds(planIds); List prodPlanInfoVoList = queryList(bo); @@ -387,6 +444,206 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService { return true; } + /** + * 开始工单(更新工单状态为已开始) + * + * @param planId 工单ID + * @return 是否成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean startPlan(Long planId) { + // 查询工单信息 + ProdPlanInfoVo planInfoVo = queryById(planId); + if ("3".equals(planInfoVo.getReleaseType()) && planInfoVo.getReleaseId() != null) { + ProdPlanInfoBo queryBo = new ProdPlanInfoBo(); + queryBo.setReleaseType("3"); + queryBo.setReleaseId(planInfoVo.getReleaseId()); + queryBo.setPlanStatus("2"); // 已开始状态 + List existingPlans = queryList(queryBo); + if (existingPlans != null && !existingPlans.isEmpty()) { + // 检查是否有其他工单(不是当前工单)已开始 + boolean hasOtherStartedPlan = existingPlans.stream() + .anyMatch(p -> !p.getPlanId().equals(planId)); + if (hasOtherStartedPlan) { + throw new ServiceException("该工位已有工单正在执行,每个工位只能有一个工单处于已开始状态!"); + } + } + } + // 更新工单状态为已开始 + ProdPlanInfoBo updateBo = new ProdPlanInfoBo(); + updateBo.setPlanId(planId); + updateBo.setPlanStatus("2"); // 已开始 + updateBo.setRealBeginTime(new Date()); // 记录实际开始时间 + return this.updateByBo(updateBo); + } + + /** + * 停工(更新工单状态为已下发) + * + * @param planId 工单ID + * @return 是否成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean stopPlan(Long planId) { + // 查询工单信息 + ProdPlanInfoVo planInfoVo = queryById(planId); + if (planInfoVo == null) { + throw new ServiceException("工单不存在"); + } + + // 校验工单状态,必须是已开始状态(2)才能停工 + if (!"2".equals(planInfoVo.getPlanStatus())) { + throw new ServiceException("工单状态不是已开始,无法停工!当前状态:" + planInfoVo.getPlanStatus()); + } + + // 更新工单状态为已下发 + ProdPlanInfoBo updateBo = new ProdPlanInfoBo(); + updateBo.setPlanId(planId); + updateBo.setPlanStatus("1"); // 已下发 + return this.updateByBo(updateBo); + } + + /** + * 复工(更新工单状态为已开始) + * + * @param planId 工单ID + * @return 是否成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean resumePlan(Long planId) { + // 查询工单信息 + ProdPlanInfoVo planInfoVo = queryById(planId); + if (planInfoVo == null) { + throw new ServiceException("工单不存在"); + } + + // 校验工单状态,必须是已下发状态(1)才能复工 + if (!"1".equals(planInfoVo.getPlanStatus())) { + throw new ServiceException("工单状态不是已下发,无法复工!当前状态:" + planInfoVo.getPlanStatus()); + } + + // 如果下达类型是工位(releaseType = "3"),需要检查该工位是否已有已开始的工单 + if ("3".equals(planInfoVo.getReleaseType()) && planInfoVo.getReleaseId() != null) { + ProdPlanInfoBo queryBo = new ProdPlanInfoBo(); + queryBo.setReleaseType("3"); + queryBo.setReleaseId(planInfoVo.getReleaseId()); + queryBo.setPlanStatus("2"); // 已开始状态 + List existingPlans = queryList(queryBo); + if (existingPlans != null && !existingPlans.isEmpty()) { + // 检查是否有其他工单(不是当前工单)已开始 + boolean hasOtherStartedPlan = existingPlans.stream() + .anyMatch(p -> !p.getPlanId().equals(planId)); + if (hasOtherStartedPlan) { + throw new ServiceException("该工位已有工单正在执行,每个工位只能有一个工单处于已开始状态!"); + } + } + } + + // 更新工单状态为已开始 + ProdPlanInfoBo updateBo = new ProdPlanInfoBo(); + updateBo.setPlanId(planId); + updateBo.setPlanStatus("2"); // 已开始 + return this.updateByBo(updateBo); + } + + /** + * 报工(更新报工数量和不良数量,存入生产信息) + * + * @param bo 报工信息 + * @return 是否成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean reportWork(ProdPlanInfoBo bo) { + // 参数校验 + if (bo.getPlanId() == null) { + throw new ServiceException("工单ID不能为空"); + } + BigDecimal reportQuantity = bo.getReportQuantity() != null ? bo.getReportQuantity() : BigDecimal.ZERO; + BigDecimal defectiveQuantity = bo.getDefectiveQuantity() != null ? bo.getDefectiveQuantity() : BigDecimal.ZERO; + + if (reportQuantity.compareTo(BigDecimal.ZERO) <= 0) { + throw new ServiceException("报工数量必须大于0"); + } + + // 查询并校验工单 + ProdPlanInfoVo planInfoVo = queryById(bo.getPlanId()); + if (planInfoVo == null) { + throw new ServiceException("工单不存在"); + } + if (!"2".equals(planInfoVo.getPlanStatus())) { + throw new ServiceException("工单状态不是已开始,无法报工!当前状态:" + planInfoVo.getPlanStatus()); + } + + // 计算并校验可报工量 + BigDecimal planAmount = planInfoVo.getPlanAmount() != null ? planInfoVo.getPlanAmount() : BigDecimal.ZERO; + BigDecimal currentCompleteAmount = planInfoVo.getCompleteAmount() != null ? planInfoVo.getCompleteAmount() : BigDecimal.ZERO; + BigDecimal reportableQuantity = planAmount.subtract(currentCompleteAmount); + + if (reportQuantity.compareTo(reportableQuantity) > 0) { + throw new ServiceException("报工数量不能超过可报工量,可报工量:" + reportableQuantity); + } + + // 更新工单完成数量 + BigDecimal newCompleteAmount = currentCompleteAmount.add(reportQuantity); + ProdPlanInfoBo updateBo = new ProdPlanInfoBo(); + updateBo.setPlanId(bo.getPlanId()); + updateBo.setCompleteAmount(newCompleteAmount); + + // 如果完成数量达到计划数量,更新状态为已完成 + if (newCompleteAmount.compareTo(planAmount) >= 0) { + updateBo.setPlanStatus("3"); + updateBo.setRealEndTime(new Date()); + } + + // 更新工单 + Boolean updateResult = this.updateByBo(updateBo); + if (!updateResult) { + throw new ServiceException("更新工单完成数量失败"); + } + + // 创建报工记录到生产信息表 + createReportDetail(planInfoVo, reportQuantity, defectiveQuantity); + + return true; + } + + /** + * 创建报工明细记录 + * + * @param planInfoVo 工单信息 + * @param reportQuantity 报工数量(对应complete_amount) + * @param defectiveQuantity 不良数量(对应defective_amount) + */ + private void createReportDetail(ProdPlanInfoVo planInfoVo, BigDecimal reportQuantity, BigDecimal defectiveQuantity) { + + try { + ProdProductPlanDetailBo detailBo = new ProdProductPlanDetailBo(); + detailBo.setPlanDetailCode(getPlanDetailCode()); // 通过编码规则生成明细编号 + detailBo.setPlanId(planInfoVo.getPlanId()); + detailBo.setPlanCode(planInfoVo.getPlanCode()); + detailBo.setCompleteAmount(reportQuantity); + detailBo.setRemainingAmount(defectiveQuantity); + detailBo.setRealBeginTime(new Date()); + detailBo.setPlanDetailStatus("3"); + detailBo.setShiftId(planInfoVo.getShiftId()); + detailBo.setClassTeamId(planInfoVo.getClassTeamId()); + + String remark = "报工数量:" + reportQuantity; + if (defectiveQuantity.compareTo(BigDecimal.ZERO) > 0) { + remark += ",不良数量:" + defectiveQuantity; + } + detailBo.setRemark(remark); + + prodProductPlanDetailService.insertJJByBo(detailBo); + } catch (Exception e) { + log.warn("创建报工记录失败: {}", e.getMessage(), e); + } + } + /** * 查询生产计划监控列表(不分页) */ diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdProductPlanDetailServiceImpl.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdProductPlanDetailServiceImpl.java index 38912238..0906dc1d 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdProductPlanDetailServiceImpl.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdProductPlanDetailServiceImpl.java @@ -146,6 +146,23 @@ public class ProdProductPlanDetailServiceImpl implements IProdProductPlanDetailS return flag; } + /** + * 新增机加生产信息 + * + * @param bo 生产信息 + * @return 是否新增成功 + */ + @Override + public Boolean insertJJByBo(ProdProductPlanDetailBo bo) { + ProdProductPlanDetail add = MapstructUtils.convert(bo, ProdProductPlanDetail.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setPlanDetailId(add.getPlanDetailId()); + } + return flag; + } + /** * 修改生产信息 * diff --git a/ruoyi-modules/hwmom-mes/src/main/resources/mapper/mes/ProdBaseRouteProcessMapper.xml b/ruoyi-modules/hwmom-mes/src/main/resources/mapper/mes/ProdBaseRouteProcessMapper.xml index bbe748ec..e6e982ad 100644 --- a/ruoyi-modules/hwmom-mes/src/main/resources/mapper/mes/ProdBaseRouteProcessMapper.xml +++ b/ruoyi-modules/hwmom-mes/src/main/resources/mapper/mes/ProdBaseRouteProcessMapper.xml @@ -32,8 +32,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mbpi.process_name,mbpi.process_type,mbpi.production_time from prod_base_route_process mbrp left join prod_base_process_info mbpi on mbrp.process_id=mbpi.process_id - + and mbrp.del_flag = '0' and mbrp.route_id = #{routeId} and mbrp.process_id = #{processId} and mbrp.process_order = #{processOrder}