diff --git a/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderWorkorderController.java b/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderWorkorderController.java index d26b46a3..c408f8ea 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderWorkorderController.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderWorkorderController.java @@ -167,13 +167,21 @@ public class ProOrderWorkorderController extends BaseController { ArrayList strings = new ArrayList<>(); for (ProOrderWorkorder proOrderWorkorder : proOrderWorkorders) { String status = proOrderWorkorder.getStatus(); - strings.add(status); +// strings.add(status); + // 更新代码逻辑-wws + if (status.equals("w0")){ + strings.add(proOrderWorkorder.getWorkorderId()); + } else { + throw new ServiceException("工单已经下单,不能删除!"); + } // 判断是否含有湿料计划 boolean值(存在为true,不存在为false) if (proWetMaterialPlanDetailService.selectProWetMaterialPlanDetailByWorkId(proOrderWorkorder.getWorkorderId())) { throw new ServiceException("工单已创建湿料计划,不能删除!"); } } String[] orderWorkerIds= strings.toArray(new String[0]); + // 更新代码逻辑-wws + /* for (String orderWorkerId : orderWorkerIds) { if (orderWorkerId.equals("w0")){ return toAjax(proOrderWorkorderService.deleteProOrderWorkorderByWorkorderIds(workorderIds)); @@ -181,6 +189,7 @@ public class ProOrderWorkorderController extends BaseController { throw new ServiceException("工单已经下单,不能删除!"); } } + */ // ProOrderWorkorder proOrderWorkorder = new ProOrderWorkorder(); @@ -197,7 +206,11 @@ public class ProOrderWorkorderController extends BaseController { // throw new ServiceException("订单未拆分或工单已经下单"); // } // } - return toAjax(proOrderWorkorderService.deleteProOrderWorkorderByWorkorderIds(workorderIds)); + + // 更新代码逻辑-wws + //return toAjax(proOrderWorkorderService.deleteProOrderWorkorderByWorkorderIds(workorderIds)); + + return toAjax(proOrderWorkorderService.deleteProOrderWorkorderByWorkorderIds(orderWorkerIds)); } /** diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java index 9bab2f9e..ea61a50c 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java @@ -22,7 +22,7 @@ public interface ProOrderWorkorderMapper { /** * 查询生产工单 * - * @param workorderId 工单code + * @param workorderId 工单id 或 工单code * @return 生产工单 */ public ProOrderWorkorder selectProOrderWorkorderByWorkorderId(String workorderId); diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java index 4e1e9b2a..21590aa1 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java @@ -590,7 +590,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { // 通过班次id查询班次名称 String shiftDesc = proOrderMapper.selectShiftNameById(proOrderWorkorder.getShiftId()); // 通过设备code查询出机型名称 - String prodLineName = proOrderMapper.selectProdLineName(proOrderWorkorderMapper.selectProOrderWorkorderByWorkorderId(proOrderWorkorder.getWorkorderCode()).getProdLineCode()); + String prodLineName = proOrderMapper.selectProdLineName(proOrderWorkorderMapper.selectProOrderWorkorderByWorkorderId(proOrderWorkorder.getWorkorderId()).getProdLineCode()); // 通过工单id查询批次号 List batchCodeList = proOrderMapper.selectBatchCodesById(proOrderWorkorder.getWorkorderId()); List batchCodes = new ArrayList<>(); diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml index 64e529e6..076a7382 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml @@ -81,7 +81,7 @@