From ade3f8a31b57499f00e21038e0157d34f2fa86ae Mon Sep 17 00:00:00 2001 From: liuxy Date: Thu, 21 Jul 2022 10:49:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/wms/sb/auToTask/AutoCreateRepair.java | 22 ++++++++++++------- .../nl/wms/sb/auToTask/AutoCreateUpkeep.java | 19 +++++++++++----- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/auToTask/AutoCreateRepair.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/auToTask/AutoCreateRepair.java index be2f752b..c79006da 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/auToTask/AutoCreateRepair.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/auToTask/AutoCreateRepair.java @@ -66,22 +66,22 @@ public class AutoCreateRepair { // 周期为年 :当前日期-维修计划开始时间 <= 15 天时,新增维修单 if (StrUtil.equals(maintenancecycle,"01")) { - if (Integer.parseInt(num) <= 15) { + if (Integer.parseInt(num) >= 15) { this.createRepair(param); } // 周期为季度 :当前日期-维修计划开始时间 <= 10 天时,新增维修单 } else if (StrUtil.equals(maintenancecycle,"02")) { - if (Integer.parseInt(num) <= 10) { + if (Integer.parseInt(num) >= 10) { this.createRepair(param); } // 周期为月 :当前日期-维修计划开始时间 <= 7 天时,新增维修单 } else if (StrUtil.equals(maintenancecycle,"03")) { - if (Integer.parseInt(num) <= 7) { + if (Integer.parseInt(num) >= 7) { this.createRepair(param); } // 周期为周 :当前日期-维修计划开始时间 <= 3 天时,新增维修单 } else if (StrUtil.equals(maintenancecycle,"04")) { - if (Integer.parseInt(num) <= 3) { + if (Integer.parseInt(num) >= 3) { this.createRepair(param); } } @@ -106,22 +106,22 @@ public class AutoCreateRepair { // 周期为年 :当前日期-维修实际结束 <= 15 天时,新增维修单 if (StrUtil.equals(maintenancecycle,"01")) { - if (Integer.parseInt(num) <= 15) { + if (Integer.parseInt(num) >= 15) { this.createRepair(param); } // 周期为季度 :当前日期-维修实际结束 <= 10 天时,新增维修单 } else if (StrUtil.equals(maintenancecycle,"02")) { - if (Integer.parseInt(num) <= 10) { + if (Integer.parseInt(num) >= 10) { this.createRepair(param); } // 周期为月 :当前日期-维修实际结束 <= 7 天时,新增维修单 } else if (StrUtil.equals(maintenancecycle,"03")) { - if (Integer.parseInt(num) <= 7) { + if (Integer.parseInt(num) >= 7) { this.createRepair(param); } // 周期为周 :当前日期-维修实际结束 <= 3 天时,新增维修单 } else if (StrUtil.equals(maintenancecycle,"04")) { - if (Integer.parseInt(num) <= 3) { + if (Integer.parseInt(num) >= 3) { this.createRepair(param); } } @@ -151,6 +151,7 @@ public class AutoCreateRepair { WQLObject repaiMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 设备维修单主表 WQLObject repaiDtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairDtl"); // 设备维修单主明细表 WQLObject planDtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairPlanDtl"); // 设备维修计划明细表 + WQLObject planMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairPlanMst"); // 设备维修计划主表 JSONArray planDtlArr = planDtlTab.query("repair_plan_id = '" + json.getString("source_bill_id") + "'").getResultJSONArray(0); @@ -183,5 +184,10 @@ public class AutoCreateRepair { jsonMainDtl.put("repair_item_id", jsonObject.get("repair_item_id")); repaiDtlTab.insert(jsonMainDtl); } + + JSONObject jsonReMst = planMstTab.query("repair_plan_id = '" + json.get("source_bill_id") + "'").uniqueResult(0); + jsonReMst.put("real_start_date", ""); + jsonReMst.put("real_end_date", ""); + planMstTab.update(jsonReMst); } } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/auToTask/AutoCreateUpkeep.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/auToTask/AutoCreateUpkeep.java index 54bd4a54..ca1aa05e 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/auToTask/AutoCreateUpkeep.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/sb/auToTask/AutoCreateUpkeep.java @@ -66,17 +66,17 @@ public class AutoCreateUpkeep { // 周期为年 :当前日期-保养计划日期 <= 15 天时,新增保养单 if (StrUtil.equals(maintenancecycle,"01")) { - if (Integer.parseInt(num) <= 15) { + if (Integer.parseInt(num) >= 15) { this.createMain(param); } // 周期为月 :当前日期-保养计划日期 <= 7 天时,新增保养单 } else if (StrUtil.equals(maintenancecycle,"02")) { - if (Integer.parseInt(num) <= 7) { + if (Integer.parseInt(num) >= 7) { this.createMain(param); } // 周期为周 :当前日期-保养计划日期 <= 3 天时,新增保养单 } else if (StrUtil.equals(maintenancecycle,"03")) { - if (Integer.parseInt(num) <= 3) { + if (Integer.parseInt(num) >= 3) { this.createMain(param); } } @@ -101,17 +101,17 @@ public class AutoCreateUpkeep { // 周期为年 :当前日期-保养实际结束 <= 15 天时,新增保养单 if (StrUtil.equals(maintenancecycle,"01")) { - if (Integer.parseInt(num) <= 15) { + if (Integer.parseInt(num) >= 15) { this.createMain(param); } // 周期为月 :当前日期-保养实际结束 <= 7 天时,新增保养单 } else if (StrUtil.equals(maintenancecycle,"02")) { - if (Integer.parseInt(num) <= 7) { + if (Integer.parseInt(num) >= 7) { this.createMain(param); } // 周期为周 :当前日期-保养实际结束 <= 3 天时,新增保养单 } else if (StrUtil.equals(maintenancecycle,"03")) { - if (Integer.parseInt(num) <= 3) { + if (Integer.parseInt(num) >= 3) { this.createMain(param); } } @@ -140,6 +140,7 @@ public class AutoCreateUpkeep { WQLObject mainMstTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenanceMst"); // 设备保养单主表 WQLObject mainDtlTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenanceDtl"); // 设备保养单主明细表 WQLObject planDtlTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenancePlanDtl"); // 设备保养计划明细表 + WQLObject planDtlMstTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenancePlanMst"); // 设备保养计划主表 JSONArray planDtlArr = planDtlTab.query("maint_plan_id = '" + json.getString("source_bill_id") + "'").getResultJSONArray(0); @@ -171,5 +172,11 @@ public class AutoCreateUpkeep { jsonMainDtl.put("device_item_id", jsonObject.get("maint_item_id")); mainDtlTab.insert(jsonMainDtl); } + + // 更新保养计划主表 + JSONObject jsonPlanMst = planDtlMstTab.query("maint_plan_id = '" + json.getString("source_bill_id") + "'").uniqueResult(0); + jsonPlanMst.put("real_start_date", ""); + jsonPlanMst.put("real_end_date", ""); + planDtlMstTab.update(jsonPlanMst); } }