代码更新

This commit is contained in:
2022-07-21 10:49:53 +08:00
parent 646619b06c
commit ade3f8a31b
2 changed files with 27 additions and 14 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}
}