add:点检、润滑、保养、维修定时任务
This commit is contained in:
@@ -0,0 +1,182 @@
|
||||
package org.nl.wms.device_manage.auToTask.bean;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 自动创建润滑单
|
||||
* @author Liuxy
|
||||
* @date 2022-06-27
|
||||
**/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoCreateLubricate {
|
||||
public void run() {
|
||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 档案表
|
||||
WQLObject planMstTab = WQLObject.getWQLObject("em_bi_devicelubricateplanmst"); // 设备润滑计划主表
|
||||
WQLObject mainMstTab = WQLObject.getWQLObject("em_bi_devicelubricatemst"); // 设备润滑单主表
|
||||
|
||||
// 1.查询 设备档案表 中状态为:正常10、闲置11、故障20、维修30、保养40状态的设备
|
||||
// 2.根据查询出来的记录 查询 设备保养计划表 中启用状态 = 启用的记录
|
||||
JSONArray jsonPlanMstArr = WQL.getWO("EM_BI_DEVICEREPAIR_02").addParam("flag","6").process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonPlanMstArr)) {
|
||||
for (int j = 0; j < jsonPlanMstArr.size(); j++) {
|
||||
JSONObject jsonPlanMst = jsonPlanMstArr.getJSONObject(j);
|
||||
// 2.1 判断保养计划表中:实际开始时间、实际结束时间 为空
|
||||
String real_start_date = jsonPlanMst.getString("real_start_date");
|
||||
String real_end_date = jsonPlanMst.getString("real_end_date");
|
||||
|
||||
// 2.2 根据源单号为保养计划id查询 保养单 --条件未删除、未审核
|
||||
JSONObject jsonMainMst = mainMstTab.query("source_bill_id = '" + jsonPlanMst.getString("maint_plan_id") + "' and is_delete = '0' and invstatus != '99'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(real_start_date) && ObjectUtil.isEmpty(real_end_date)) {
|
||||
if (ObjectUtil.isEmpty(jsonMainMst)) {
|
||||
// 2.3 判断周期
|
||||
String maintenancecycle = jsonPlanMst.getString("maintenancecycle");
|
||||
String plan_start_date = jsonPlanMst.getString("plan_start_date");
|
||||
String today = DateUtil.today();
|
||||
// 准备参数
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("devicerecord_id",jsonPlanMst.getString("devicerecord_id"));
|
||||
param.put("maintenancecycle","01");
|
||||
param.put("plan_start_date",jsonPlanMst.getString("plan_start_date"));
|
||||
param.put("source_bill_id",jsonPlanMst.getString("maint_plan_id"));
|
||||
param.put("source_bill_code",jsonPlanMst.getString("maint_plan_code"));
|
||||
param.put("maint_object",jsonPlanMst.getString("maint_object"));
|
||||
|
||||
// 计算 维修计划日期 - 当前日期 后的天数
|
||||
Date today2 = DateUtil.parse(today);
|
||||
Date plan_start_date2 = DateUtil.parse(plan_start_date);
|
||||
long num = (int) DateUtil.between(today2,plan_start_date2, DateUnit.DAY);
|
||||
// 周期为年 :当前日期-保养计划日期 <= 15 天时,新增保养单
|
||||
if (StrUtil.equals(maintenancecycle,"01")) {
|
||||
if (num <= 15) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为月 :当前日期-保养计划日期 <= 7 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"02")) {
|
||||
if (num <= 7) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为周 :当前日期-保养计划日期 <= 3 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"03")) {
|
||||
if (num <= 3) {
|
||||
this.createMain(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 3 如果保养实际开始时间 和 保养实际结束时间不为空 并且查不到对应单据
|
||||
if (ObjectUtil.isEmpty(jsonMainMst)) {
|
||||
// 取保养实际结束日期:用当前日期 - 保养实际结束日期
|
||||
String maintenancecycle = jsonPlanMst.getString("maintenancecycle");
|
||||
String rep_real_end_date = jsonPlanMst.getString("real_end_date");
|
||||
String today = DateUtil.today();
|
||||
|
||||
// 准备参数
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("devicerecord_id",jsonPlanMst.getString("devicerecord_id"));
|
||||
param.put("maintenancecycle","01");
|
||||
param.put("plan_start_date",jsonPlanMst.getString("plan_start_date"));
|
||||
param.put("source_bill_id",jsonPlanMst.getString("maint_plan_id"));
|
||||
param.put("source_bill_code",jsonPlanMst.getString("maint_plan_code"));
|
||||
param.put("maint_object",jsonPlanMst.getString("maint_object"));
|
||||
|
||||
// 计算 当前日期 - 维修实际结束 后的天数
|
||||
Date today2 = DateUtil.parse(today);
|
||||
Date rep_real_end_date2 = DateUtil.parse(rep_real_end_date);
|
||||
long num = (int) DateUtil.between(today2,rep_real_end_date2, DateUnit.DAY);
|
||||
// 周期为年 :当前日期-保养实际结束 <= 15 天时,新增保养单
|
||||
if (StrUtil.equals(maintenancecycle,"01")) {
|
||||
if (num >= 15) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为月 :当前日期-保养实际结束 <= 7 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"02")) {
|
||||
if (num >= 7) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为周 :当前日期-保养实际结束 <= 3 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"03")) {
|
||||
if (num >= 3) {
|
||||
this.createMain(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建润滑单共用方法
|
||||
* json: {
|
||||
* 设备档案标识:devicerecord_id,
|
||||
* 单据类型:maintenancecycle,
|
||||
* 计划开始日期:plan_start_date,
|
||||
* 来源单据标识:source_bill_id,
|
||||
* 来源单据编码:source_bill_code,
|
||||
* }
|
||||
*/
|
||||
public void createMain(JSONObject json) {
|
||||
Long currentUserId = 1L;
|
||||
String nickName = "管理员";
|
||||
Long deptId = 1L;
|
||||
|
||||
WQLObject mainMstTab = WQLObject.getWQLObject("em_bi_devicelubricatemst"); // 设备润滑单主表
|
||||
WQLObject mainDtlTab = WQLObject.getWQLObject("em_bi_devicelubricatedtl"); // 设备润滑单明细表
|
||||
WQLObject planDtlTab = WQLObject.getWQLObject("em_bi_devicelubricateplandtl"); // 设备润滑计划明细表
|
||||
WQLObject planDtlMstTab = WQLObject.getWQLObject("em_bi_devicelubricateplanmst"); // 设备润滑计划主表
|
||||
|
||||
JSONArray planDtlArr = planDtlTab.query("maint_plan_id = '" + json.getString("source_bill_id") + "'").getResultJSONArray(0);
|
||||
|
||||
// 保养单主表
|
||||
JSONObject jsonMainMst = new JSONObject();
|
||||
jsonMainMst.put("maint_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonMainMst.put("maint_code", CodeUtil.getNewCode("MAINT_CODE"));
|
||||
jsonMainMst.put("devicerecord_id",json.get("devicerecord_id"));
|
||||
jsonMainMst.put("maintenancecycle",json.getString("maintenancecycle"));
|
||||
jsonMainMst.put("invstatus","01");
|
||||
jsonMainMst.put("plan_start_date",json.getString("plan_start_date"));
|
||||
jsonMainMst.put("maint_object",json.getString("maint_object"));
|
||||
jsonMainMst.put("detail_count",planDtlArr.size());
|
||||
jsonMainMst.put("source_bill_id",json.get("source_bill_id"));
|
||||
jsonMainMst.put("source_bill_type","RHJY");
|
||||
jsonMainMst.put("source_bill_code",json.getString("source_bill_code"));
|
||||
jsonMainMst.put("input_optid",currentUserId);
|
||||
jsonMainMst.put("input_optname",nickName);
|
||||
jsonMainMst.put("input_time", DateUtil.now());
|
||||
jsonMainMst.put("sysdeptid", deptId);
|
||||
jsonMainMst.put("syscompanyid", deptId);
|
||||
mainMstTab.insert(jsonMainMst);
|
||||
|
||||
// 保养单明细表
|
||||
for (int i = 0; i < planDtlArr.size(); i++) {
|
||||
JSONObject jsonObject = planDtlArr.getJSONObject(i);
|
||||
JSONObject jsonMainDtl = new JSONObject();
|
||||
jsonMainDtl.put("maint_dtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonMainDtl.put("maint_id", jsonMainMst.get("maint_id"));
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package org.nl.wms.device_manage.auToTask.bean;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 自动创建维修单
|
||||
* @author Liuxy
|
||||
* @date 2022-06-27
|
||||
**/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoCreateRepair {
|
||||
public void run() {
|
||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 档案表
|
||||
WQLObject planMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairPlanMst"); // 设备维修计划主表
|
||||
WQLObject repairMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 设备维修单主表
|
||||
|
||||
// 1.查询 设备档案表 中状态为:正常10、闲置11、故障20、维修30、保养40状态的设备的 设备维修计划主表
|
||||
// 2.根据查询出来的记录 查询 设备维修计划表 中启用状态 = 启用的记录
|
||||
JSONArray jsonPlanMstArr = WQL.getWO("EM_BI_DEVICEREPAIR_02").addParam("flag","3").process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonPlanMstArr)) {
|
||||
for (int j = 0; j < jsonPlanMstArr.size(); j++) {
|
||||
JSONObject jsonPlanMst = jsonPlanMstArr.getJSONObject(j);
|
||||
// 2.1 判断维修计划表中:实际开始时间、实际结束时间 为空
|
||||
String real_start_date = jsonPlanMst.getString("real_start_date");
|
||||
String real_end_date = jsonPlanMst.getString("real_end_date");
|
||||
|
||||
// 2.2 根据源单号为维修计划id查询 维修单 --条件未删除、未审核
|
||||
JSONObject jsonRepairMst = repairMstTab.query("source_bill_id = '" + jsonPlanMst.getString("repair_plan_id") + "' and is_delete = '0' and invstatus != '99'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(real_start_date) && ObjectUtil.isEmpty(real_end_date)) {
|
||||
if (ObjectUtil.isEmpty(jsonRepairMst)) {
|
||||
// 2.3 判断周期
|
||||
String maintenancecycle = jsonPlanMst.getString("maintenancecycle");
|
||||
String plan_start_date = jsonPlanMst.getString("plan_start_date");
|
||||
String today = DateUtil.today();
|
||||
// 准备参数
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("devicerecord_id",jsonPlanMst.getString("devicerecord_id"));
|
||||
param.put("maintenancecycle","01");
|
||||
param.put("plan_start_date",jsonPlanMst.getString("plan_start_date"));
|
||||
param.put("source_bill_id",jsonPlanMst.getString("repair_plan_id"));
|
||||
param.put("source_bill_code",jsonPlanMst.getString("repair_plan_code"));
|
||||
|
||||
// 计算 维修计划日期 - 当前日期 后的天数
|
||||
Date today2 = DateUtil.parse(today);
|
||||
Date plan_start_date2 = DateUtil.parse(plan_start_date);
|
||||
long num = (int) DateUtil.between(plan_start_date2,today2, DateUnit.DAY);
|
||||
|
||||
// 周期为年 : 维修计划日期 - 当前日期 <= 15 天时,新增维修单
|
||||
if (StrUtil.equals(maintenancecycle,"01")) {
|
||||
if (num <= 15) {
|
||||
this.createRepair(param);
|
||||
}
|
||||
// 周期为季度 : 维修计划日期 - 当前日期 <= 10 天时,新增维修单
|
||||
} else if (StrUtil.equals(maintenancecycle,"02")) {
|
||||
if (num <= 10) {
|
||||
this.createRepair(param);
|
||||
}
|
||||
// 周期为月 : 维修计划日期 - 当前日期 <= 7 天时,新增维修单
|
||||
} else if (StrUtil.equals(maintenancecycle,"03")) {
|
||||
if (num <= 7) {
|
||||
this.createRepair(param);
|
||||
}
|
||||
// 周期为周 : 维修计划日期 - 当前日期 <= 3 天时,新增维修单
|
||||
} else if (StrUtil.equals(maintenancecycle,"04")) {
|
||||
if (num <= 3) {
|
||||
this.createRepair(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 3 如果保养实际开始时间 和 保养实际结束时间不为空 并且查不到对应单据
|
||||
if (ObjectUtil.isEmpty(jsonRepairMst)) {
|
||||
// 取维修实际结束日期:用当前日期 - 维修实际结束日期
|
||||
String maintenancecycle = jsonPlanMst.getString("maintenancecycle");
|
||||
String rep_real_end_date = jsonPlanMst.getString("real_end_date");
|
||||
String today = DateUtil.today();
|
||||
|
||||
// 准备参数
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("devicerecord_id",jsonPlanMst.getString("devicerecord_id"));
|
||||
param.put("maintenancecycle","01");
|
||||
param.put("plan_start_date",jsonPlanMst.getString("plan_start_date"));
|
||||
param.put("source_bill_id",jsonPlanMst.getString("repair_plan_id"));
|
||||
param.put("source_bill_code",jsonPlanMst.getString("repair_plan_code"));
|
||||
// 计算 当前日期 - 维修实际结束 后的天数
|
||||
Date today2 = DateUtil.parse(today);
|
||||
Date rep_real_end_date2 = DateUtil.parse(rep_real_end_date);
|
||||
long num = (int) DateUtil.between(today2,rep_real_end_date2, DateUnit.DAY);
|
||||
// 周期为年 :当前日期-维修实际结束 <= 15 天时,新增维修单
|
||||
if (StrUtil.equals(maintenancecycle,"01")) {
|
||||
if (num >= 15) {
|
||||
this.createRepair(param);
|
||||
}
|
||||
// 周期为季度 :当前日期-维修实际结束 <= 10 天时,新增维修单
|
||||
} else if (StrUtil.equals(maintenancecycle,"02")) {
|
||||
if (num >= 10) {
|
||||
this.createRepair(param);
|
||||
}
|
||||
// 周期为月 :当前日期-维修实际结束 <= 7 天时,新增维修单
|
||||
} else if (StrUtil.equals(maintenancecycle,"03")) {
|
||||
if (num >= 7) {
|
||||
this.createRepair(param);
|
||||
}
|
||||
// 周期为周 :当前日期-维修实际结束 <= 3 天时,新增维修单
|
||||
} else if (StrUtil.equals(maintenancecycle,"04")) {
|
||||
if (num >= 3) {
|
||||
this.createRepair(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建维修单共用方法
|
||||
* json: {
|
||||
* 设备档案标识:devicerecord_id,
|
||||
* 单据类型:maintenancecycle,
|
||||
* 计划开始日期:plan_start_date,
|
||||
* 来源单据标识:source_bill_id,
|
||||
* 来源单据编码:source_bill_code,
|
||||
* }
|
||||
*/
|
||||
public void createRepair(JSONObject json) {
|
||||
Long currentUserId = 1L;
|
||||
String nickName = "管理员";
|
||||
Long deptId = 1L;
|
||||
|
||||
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);
|
||||
|
||||
// 维修单主表
|
||||
JSONObject jsonRepaiMst = new JSONObject();
|
||||
jsonRepaiMst.put("repair_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonRepaiMst.put("repair_code", CodeUtil.getNewCode("REPAIR_CODE"));
|
||||
jsonRepaiMst.put("devicerecord_id",json.get("devicerecord_id"));
|
||||
jsonRepaiMst.put("maintenancecycle",json.getString("maintenancecycle"));
|
||||
jsonRepaiMst.put("invstatus","01");
|
||||
jsonRepaiMst.put("fault_level","01");
|
||||
jsonRepaiMst.put("plan_start_date",json.getString("plan_start_date"));
|
||||
jsonRepaiMst.put("detail_count",planDtlArr.size());
|
||||
jsonRepaiMst.put("source_bill_id",json.get("source_bill_id"));
|
||||
jsonRepaiMst.put("source_bill_type","WXJH");
|
||||
jsonRepaiMst.put("source_bill_code",json.getString("source_bill_code"));
|
||||
jsonRepaiMst.put("input_optid",currentUserId);
|
||||
jsonRepaiMst.put("input_optname",nickName);
|
||||
jsonRepaiMst.put("input_time", DateUtil.now());
|
||||
jsonRepaiMst.put("sysdeptid", deptId);
|
||||
jsonRepaiMst.put("syscompanyid", deptId);
|
||||
repaiMstTab.insert(jsonRepaiMst);
|
||||
|
||||
// 维修单明细表
|
||||
for (int i = 0; i < planDtlArr.size(); i++) {
|
||||
JSONObject jsonObject = planDtlArr.getJSONObject(i);
|
||||
JSONObject jsonMainDtl = new JSONObject();
|
||||
jsonMainDtl.put("repair_dtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonMainDtl.put("repair_id", jsonRepaiMst.get("repair_id"));
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package org.nl.wms.device_manage.auToTask.bean;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 自动创建点检单
|
||||
* @author Liuxy
|
||||
* @date 2022-06-27
|
||||
**/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoCreateSportCheck {
|
||||
public void run() {
|
||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 档案表
|
||||
WQLObject planMstTab = WQLObject.getWQLObject("em_bi_devicesportcheckplanmst"); // 设备点检计划主表
|
||||
WQLObject mainMstTab = WQLObject.getWQLObject("em_bi_devicesportcheckmst"); // 设备点检单主表
|
||||
|
||||
// 1.查询 设备档案表 中状态为:正常10、闲置11、故障20、维修30、保养40状态的设备
|
||||
// 2.根据查询出来的记录 查询 设备保养计划表 中启用状态 = 启用的记录
|
||||
JSONArray jsonPlanMstArr = WQL.getWO("EM_BI_DEVICEREPAIR_02").addParam("flag","5").process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonPlanMstArr)) {
|
||||
for (int j = 0; j < jsonPlanMstArr.size(); j++) {
|
||||
JSONObject jsonPlanMst = jsonPlanMstArr.getJSONObject(j);
|
||||
// 2.1 判断保养计划表中:实际开始时间、实际结束时间 为空
|
||||
String real_start_date = jsonPlanMst.getString("real_start_date");
|
||||
String real_end_date = jsonPlanMst.getString("real_end_date");
|
||||
|
||||
// 2.2 根据源单号为保养计划id查询 保养单 --条件未删除、未审核
|
||||
JSONObject jsonMainMst = mainMstTab.query("source_bill_id = '" + jsonPlanMst.getString("maint_plan_id") + "' and is_delete = '0' and invstatus != '99'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(real_start_date) && ObjectUtil.isEmpty(real_end_date)) {
|
||||
if (ObjectUtil.isEmpty(jsonMainMst)) {
|
||||
// 2.3 判断周期
|
||||
String maintenancecycle = jsonPlanMst.getString("maintenancecycle");
|
||||
String plan_start_date = jsonPlanMst.getString("plan_start_date");
|
||||
String today = DateUtil.today();
|
||||
// 准备参数
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("devicerecord_id",jsonPlanMst.getString("devicerecord_id"));
|
||||
param.put("maintenancecycle","01");
|
||||
param.put("plan_start_date",jsonPlanMst.getString("plan_start_date"));
|
||||
param.put("source_bill_id",jsonPlanMst.getString("maint_plan_id"));
|
||||
param.put("source_bill_code",jsonPlanMst.getString("maint_plan_code"));
|
||||
param.put("maint_object",jsonPlanMst.getString("maint_object"));
|
||||
|
||||
// 计算 维修计划日期 - 当前日期 后的天数
|
||||
Date today2 = DateUtil.parse(today);
|
||||
Date plan_start_date2 = DateUtil.parse(plan_start_date);
|
||||
long num = (int) DateUtil.between(today2,plan_start_date2, DateUnit.DAY);
|
||||
// 周期为年 :当前日期-保养计划日期 <= 15 天时,新增保养单
|
||||
if (StrUtil.equals(maintenancecycle,"01")) {
|
||||
if (num <= 15) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为月 :当前日期-保养计划日期 <= 7 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"02")) {
|
||||
if (num <= 7) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为周 :当前日期-保养计划日期 <= 3 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"03")) {
|
||||
if (num <= 3) {
|
||||
this.createMain(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 3 如果保养实际开始时间 和 保养实际结束时间不为空 并且查不到对应单据
|
||||
if (ObjectUtil.isEmpty(jsonMainMst)) {
|
||||
// 取保养实际结束日期:用当前日期 - 保养实际结束日期
|
||||
String maintenancecycle = jsonPlanMst.getString("maintenancecycle");
|
||||
String rep_real_end_date = jsonPlanMst.getString("real_end_date");
|
||||
String today = DateUtil.today();
|
||||
|
||||
// 准备参数
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("devicerecord_id",jsonPlanMst.getString("devicerecord_id"));
|
||||
param.put("maintenancecycle","01");
|
||||
param.put("plan_start_date",jsonPlanMst.getString("plan_start_date"));
|
||||
param.put("source_bill_id",jsonPlanMst.getString("maint_plan_id"));
|
||||
param.put("source_bill_code",jsonPlanMst.getString("maint_plan_code"));
|
||||
param.put("maint_object",jsonPlanMst.getString("maint_object"));
|
||||
|
||||
// 计算 当前日期 - 维修实际结束 后的天数
|
||||
Date today2 = DateUtil.parse(today);
|
||||
Date rep_real_end_date2 = DateUtil.parse(rep_real_end_date);
|
||||
long num = (int) DateUtil.between(today2,rep_real_end_date2, DateUnit.DAY);
|
||||
// 周期为年 :当前日期-保养实际结束 <= 15 天时,新增保养单
|
||||
if (StrUtil.equals(maintenancecycle,"01")) {
|
||||
if (num >= 15) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为月 :当前日期-保养实际结束 <= 7 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"02")) {
|
||||
if (num >= 7) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为周 :当前日期-保养实际结束 <= 3 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"03")) {
|
||||
if (num >= 3) {
|
||||
this.createMain(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建点检单共用方法
|
||||
* json: {
|
||||
* 设备档案标识:devicerecord_id,
|
||||
* 单据类型:maintenancecycle,
|
||||
* 计划开始日期:plan_start_date,
|
||||
* 来源单据标识:source_bill_id,
|
||||
* 来源单据编码:source_bill_code,
|
||||
* }
|
||||
*/
|
||||
public void createMain(JSONObject json) {
|
||||
Long currentUserId = 1L;
|
||||
String nickName = "管理员";
|
||||
Long deptId = 1L;
|
||||
|
||||
WQLObject mainMstTab = WQLObject.getWQLObject("em_bi_devicesportcheckmst"); // 设备点检单主表
|
||||
WQLObject mainDtlTab = WQLObject.getWQLObject("em_bi_devicesportcheckdtl"); // 设备点检单明细表
|
||||
WQLObject planDtlTab = WQLObject.getWQLObject("em_bi_devicesportcheckplandtl"); // 设备保养计划明细表
|
||||
WQLObject planDtlMstTab = WQLObject.getWQLObject("em_bi_devicesportcheckplanmst"); // 设备点检计划主表
|
||||
|
||||
JSONArray planDtlArr = planDtlTab.query("maint_plan_id = '" + json.getString("source_bill_id") + "'").getResultJSONArray(0);
|
||||
|
||||
// 保养单主表
|
||||
JSONObject jsonMainMst = new JSONObject();
|
||||
jsonMainMst.put("maint_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonMainMst.put("maint_code", CodeUtil.getNewCode("MAINT_CODE"));
|
||||
jsonMainMst.put("devicerecord_id",json.get("devicerecord_id"));
|
||||
jsonMainMst.put("maintenancecycle",json.getString("maintenancecycle"));
|
||||
jsonMainMst.put("invstatus","01");
|
||||
jsonMainMst.put("plan_start_date",json.getString("plan_start_date"));
|
||||
jsonMainMst.put("maint_object",json.getString("maint_object"));
|
||||
jsonMainMst.put("detail_count",planDtlArr.size());
|
||||
jsonMainMst.put("source_bill_id",json.get("source_bill_id"));
|
||||
jsonMainMst.put("source_bill_type","DJJH");
|
||||
jsonMainMst.put("source_bill_code",json.getString("source_bill_code"));
|
||||
jsonMainMst.put("input_optid",currentUserId);
|
||||
jsonMainMst.put("input_optname",nickName);
|
||||
jsonMainMst.put("input_time", DateUtil.now());
|
||||
jsonMainMst.put("sysdeptid", deptId);
|
||||
jsonMainMst.put("syscompanyid", deptId);
|
||||
mainMstTab.insert(jsonMainMst);
|
||||
|
||||
// 保养单明细表
|
||||
for (int i = 0; i < planDtlArr.size(); i++) {
|
||||
JSONObject jsonObject = planDtlArr.getJSONObject(i);
|
||||
JSONObject jsonMainDtl = new JSONObject();
|
||||
jsonMainDtl.put("maint_dtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonMainDtl.put("maint_id", jsonMainMst.get("maint_id"));
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package org.nl.wms.device_manage.auToTask.bean;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 自动创建保养单
|
||||
* @author Liuxy
|
||||
* @date 2022-06-27
|
||||
**/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoCreateUpkeep {
|
||||
public void run() {
|
||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 档案表
|
||||
WQLObject planMstTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenancePlanMst"); // 设备保养计划主表
|
||||
WQLObject mainMstTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenanceMst"); // 设备保养单主表
|
||||
|
||||
// 1.查询 设备档案表 中状态为:正常10、闲置11、故障20、维修30、保养40状态的设备
|
||||
// 2.根据查询出来的记录 查询 设备保养计划表 中启用状态 = 启用的记录
|
||||
JSONArray jsonPlanMstArr = WQL.getWO("EM_BI_DEVICEREPAIR_02").addParam("flag","4").process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonPlanMstArr)) {
|
||||
for (int j = 0; j < jsonPlanMstArr.size(); j++) {
|
||||
JSONObject jsonPlanMst = jsonPlanMstArr.getJSONObject(j);
|
||||
// 2.1 判断保养计划表中:实际开始时间、实际结束时间 为空
|
||||
String real_start_date = jsonPlanMst.getString("real_start_date");
|
||||
String real_end_date = jsonPlanMst.getString("real_end_date");
|
||||
|
||||
// 2.2 根据源单号为保养计划id查询 保养单 --条件未删除、未审核
|
||||
JSONObject jsonMainMst = mainMstTab.query("source_bill_id = '" + jsonPlanMst.getString("maint_plan_id") + "' and is_delete = '0' and invstatus != '99'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(real_start_date) && ObjectUtil.isEmpty(real_end_date)) {
|
||||
if (ObjectUtil.isEmpty(jsonMainMst)) {
|
||||
// 2.3 判断周期
|
||||
String maintenancecycle = jsonPlanMst.getString("maintenancecycle");
|
||||
String plan_start_date = jsonPlanMst.getString("plan_start_date");
|
||||
String today = DateUtil.today();
|
||||
// 准备参数
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("devicerecord_id",jsonPlanMst.getString("devicerecord_id"));
|
||||
param.put("maintenancecycle","01");
|
||||
param.put("plan_start_date",jsonPlanMst.getString("plan_start_date"));
|
||||
param.put("source_bill_id",jsonPlanMst.getString("maint_plan_id"));
|
||||
param.put("source_bill_code",jsonPlanMst.getString("maint_plan_code"));
|
||||
param.put("maint_object",jsonPlanMst.getString("maint_object"));
|
||||
|
||||
// 计算 维修计划日期 - 当前日期 后的天数
|
||||
Date today2 = DateUtil.parse(today);
|
||||
Date plan_start_date2 = DateUtil.parse(plan_start_date);
|
||||
long num = (int) DateUtil.between(today2,plan_start_date2, DateUnit.DAY);
|
||||
// 周期为年 :当前日期-保养计划日期 <= 15 天时,新增保养单
|
||||
if (StrUtil.equals(maintenancecycle,"01")) {
|
||||
if (num <= 15) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为月 :当前日期-保养计划日期 <= 7 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"02")) {
|
||||
if (num <= 7) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为周 :当前日期-保养计划日期 <= 3 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"03")) {
|
||||
if (num <= 3) {
|
||||
this.createMain(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 3 如果保养实际开始时间 和 保养实际结束时间不为空 并且查不到对应单据
|
||||
if (ObjectUtil.isEmpty(jsonMainMst)) {
|
||||
// 取保养实际结束日期:用当前日期 - 保养实际结束日期
|
||||
String maintenancecycle = jsonPlanMst.getString("maintenancecycle");
|
||||
String rep_real_end_date = jsonPlanMst.getString("real_end_date");
|
||||
String today = DateUtil.today();
|
||||
|
||||
// 准备参数
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("devicerecord_id",jsonPlanMst.getString("devicerecord_id"));
|
||||
param.put("maintenancecycle","01");
|
||||
param.put("plan_start_date",jsonPlanMst.getString("plan_start_date"));
|
||||
param.put("source_bill_id",jsonPlanMst.getString("maint_plan_id"));
|
||||
param.put("source_bill_code",jsonPlanMst.getString("maint_plan_code"));
|
||||
param.put("maint_object",jsonPlanMst.getString("maint_object"));
|
||||
|
||||
// 计算 当前日期 - 维修实际结束 后的天数
|
||||
Date today2 = DateUtil.parse(today);
|
||||
Date rep_real_end_date2 = DateUtil.parse(rep_real_end_date);
|
||||
long num = (int) DateUtil.between(today2,rep_real_end_date2, DateUnit.DAY);
|
||||
// 周期为年 :当前日期-保养实际结束 <= 15 天时,新增保养单
|
||||
if (StrUtil.equals(maintenancecycle,"01")) {
|
||||
if (num >= 15) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为月 :当前日期-保养实际结束 <= 7 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"02")) {
|
||||
if (num >= 7) {
|
||||
this.createMain(param);
|
||||
}
|
||||
// 周期为周 :当前日期-保养实际结束 <= 3 天时,新增保养单
|
||||
} else if (StrUtil.equals(maintenancecycle,"03")) {
|
||||
if (num >= 3) {
|
||||
this.createMain(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建保养单共用方法
|
||||
* json: {
|
||||
* 设备档案标识:devicerecord_id,
|
||||
* 单据类型:maintenancecycle,
|
||||
* 计划开始日期:plan_start_date,
|
||||
* 来源单据标识:source_bill_id,
|
||||
* 来源单据编码:source_bill_code,
|
||||
* }
|
||||
*/
|
||||
public void createMain(JSONObject json) {
|
||||
Long currentUserId = 1L;
|
||||
String nickName = "管理员";
|
||||
Long deptId = 1L;
|
||||
|
||||
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);
|
||||
|
||||
// 保养单主表
|
||||
JSONObject jsonMainMst = new JSONObject();
|
||||
jsonMainMst.put("maint_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonMainMst.put("maint_code", CodeUtil.getNewCode("MAINT_CODE"));
|
||||
jsonMainMst.put("devicerecord_id",json.get("devicerecord_id"));
|
||||
jsonMainMst.put("maintenancecycle",json.getString("maintenancecycle"));
|
||||
jsonMainMst.put("invstatus","01");
|
||||
jsonMainMst.put("plan_start_date",json.getString("plan_start_date"));
|
||||
jsonMainMst.put("maint_object",json.getString("maint_object"));
|
||||
jsonMainMst.put("detail_count",planDtlArr.size());
|
||||
jsonMainMst.put("source_bill_id",json.get("source_bill_id"));
|
||||
jsonMainMst.put("source_bill_type","BYJH");
|
||||
jsonMainMst.put("source_bill_code",json.getString("source_bill_code"));
|
||||
jsonMainMst.put("input_optid",currentUserId);
|
||||
jsonMainMst.put("input_optname",nickName);
|
||||
jsonMainMst.put("input_time", DateUtil.now());
|
||||
jsonMainMst.put("sysdeptid", deptId);
|
||||
jsonMainMst.put("syscompanyid", deptId);
|
||||
mainMstTab.insert(jsonMainMst);
|
||||
|
||||
// 保养单明细表
|
||||
for (int i = 0; i < planDtlArr.size(); i++) {
|
||||
JSONObject jsonObject = planDtlArr.getJSONObject(i);
|
||||
JSONObject jsonMainDtl = new JSONObject();
|
||||
jsonMainDtl.put("maint_dtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonMainDtl.put("maint_id", jsonMainMst.get("maint_id"));
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
[交易说明]
|
||||
交易名: 维修单维护-Excel
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.devicerecord_id TYPEAS s_string
|
||||
输入.repair_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
file.*,
|
||||
dept.name AS dept_name
|
||||
FROM
|
||||
EM_BI_EquipmentFile file
|
||||
LEFT JOIN sys_dept dept ON file.use_groupid = dept.dept_id
|
||||
WHERE
|
||||
file.is_delete = '0'
|
||||
|
||||
OPTION 输入.devicerecord_id <> ""
|
||||
file.devicerecord_id = 输入.devicerecord_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
recourd.*,
|
||||
mater.material_name,
|
||||
mater.material_code
|
||||
FROM
|
||||
EM_BI_DeviceRepairReplaceRecord recourd
|
||||
LEFT JOIN md_me_materialbase mater ON recourd.material_id = mater.material_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.repair_id <> ""
|
||||
recourd.repair_id = 输入.repair_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
PlanMst.*
|
||||
FROM
|
||||
EM_BI_DeviceRepairPlanMst PlanMst
|
||||
INNER JOIN EM_BI_EquipmentFile EquipmentFile ON PlanMst.devicerecord_id = EquipmentFile.devicerecord_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND EquipmentFile.STATUS IN ( 10, 11, 20, 30, 40 )
|
||||
AND EquipmentFile.is_delete = '0'
|
||||
AND PlanMst.is_active = '1'
|
||||
AND PlanMst.is_delete = '0'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
PlanMst.*
|
||||
FROM
|
||||
EM_BI_DeviceMaintenancePlanMst PlanMst
|
||||
INNER JOIN EM_BI_EquipmentFile EquipmentFile ON PlanMst.devicerecord_id = EquipmentFile.devicerecord_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND EquipmentFile.STATUS IN ( 10, 11, 20, 30, 40 )
|
||||
AND EquipmentFile.is_delete = '0'
|
||||
AND PlanMst.is_active = '1'
|
||||
AND PlanMst.is_delete = '0'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "5"
|
||||
QUERY
|
||||
SELECT
|
||||
PlanMst.*
|
||||
FROM
|
||||
em_bi_devicesportcheckplanmst PlanMst
|
||||
INNER JOIN EM_BI_EquipmentFile EquipmentFile ON PlanMst.devicerecord_id = EquipmentFile.devicerecord_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND EquipmentFile.STATUS IN ( 10, 11, 20, 30, 40 )
|
||||
AND EquipmentFile.is_delete = '0'
|
||||
AND PlanMst.is_active = '1'
|
||||
AND PlanMst.is_delete = '0'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "6"
|
||||
QUERY
|
||||
SELECT
|
||||
PlanMst.*
|
||||
FROM
|
||||
em_bi_devicelubricateplanmst PlanMst
|
||||
INNER JOIN EM_BI_EquipmentFile EquipmentFile ON PlanMst.devicerecord_id = EquipmentFile.devicerecord_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND EquipmentFile.STATUS IN ( 10, 11, 20, 30, 40 )
|
||||
AND EquipmentFile.is_delete = '0'
|
||||
AND PlanMst.is_active = '1'
|
||||
AND PlanMst.is_delete = '0'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -122,6 +122,8 @@
|
||||
<el-table-column prop="confirm_time" label="确认时间" min-width="140" />
|
||||
<el-table-column prop="audit_optname" label="审核人" min-width="90" />
|
||||
<el-table-column prop="audit_time" label="审核时间" min-width="140" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" min-width="150px" />
|
||||
<el-table-column prop="source_bill_type" label="源单业务类型" min-width="120" />
|
||||
<el-table-column v-permission="[]" label="操作" min-width="125" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
@@ -88,7 +88,7 @@
|
||||
@click="submit"
|
||||
>
|
||||
提交
|
||||
</el-button>-->
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
@@ -118,7 +118,7 @@
|
||||
<el-table-column prop="confirm_time" label="确认时间" min-width="140" />
|
||||
<el-table-column prop="audit_optname" label="审核人" min-width="120px" />
|
||||
<el-table-column prop="audit_time" label="审核时间" min-width="140" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" min-width="120px" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" min-width="150px" />
|
||||
<el-table-column prop="source_bill_type" label="源单业务类型" min-width="120" />
|
||||
<el-table-column v-permission="[]" label="操作" min-width="125" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
|
||||
@@ -122,6 +122,8 @@
|
||||
<el-table-column prop="confirm_time" label="确认时间" min-width="140" />
|
||||
<el-table-column prop="audit_optname" label="审核人" min-width="90" />
|
||||
<el-table-column prop="audit_time" label="审核时间" min-width="140" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" min-width="150px" />
|
||||
<el-table-column prop="source_bill_type" label="源单业务类型" min-width="120" />
|
||||
<el-table-column v-permission="[]" label="操作" min-width="125" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
|
||||
@@ -122,6 +122,8 @@
|
||||
<el-table-column prop="confirm_time" label="确认时间" min-width="140" />
|
||||
<el-table-column prop="audit_optname" label="审核人" min-width="90" />
|
||||
<el-table-column prop="audit_time" label="审核时间" min-width="140" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" min-width="150px" />
|
||||
<el-table-column prop="source_bill_type" label="源单业务类型" min-width="120" />
|
||||
<el-table-column v-permission="[]" label="操作" min-width="125" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
|
||||
Reference in New Issue
Block a user