This commit is contained in:
zds
2022-11-01 19:53:32 +08:00
parent 657008b33f
commit a5328d48f6
4 changed files with 59 additions and 9 deletions

View File

@@ -897,9 +897,13 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
public void createExcel(Map whereJson, HttpServletResponse response) {
String repair_id = MapUtil.getStr(whereJson,"repair_id");
WQLObject reMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 维修单主表
WQLObject EM_BI_DeviceRepairRecord = WQLObject.getWQLObject("EM_BI_DeviceRepairRecord"); // 维修单主表
WQLObject EM_BI_DeviceRepairRequest = WQLObject.getWQLObject("EM_BI_DeviceRepairRequest"); // 维修单主表
try {
JSONObject jsonReMst = reMstTab.query("repair_id = '" + repair_id + "'").uniqueResult(0);
JSONObject RepairRequest = EM_BI_DeviceRepairRequest.query("request_id='"+jsonReMst.getString("source_bill_id")+"'").uniqueResult(0);
JSONObject RepairRecord = EM_BI_DeviceRepairRecord.query("repair_id = '" + repair_id + "'").uniqueResult(0);
HashMap<String, String> param1 = new HashMap<>();
param1.put("flag", "1");
@@ -924,9 +928,45 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
map.put("dept_name", jsonFile.getString("dept_name")); // 部门
map.put("device_name", jsonFile.getString("device_name")); // 设备名称
}
if (ObjectUtil.isNotEmpty(RepairRequest)) {
map.put("product_person_name", RepairRequest.getString("product_person_name")); // 班组配合人
}
String invstatus = jsonReMst.getString("invstatus");
if ("01".equals(invstatus)) {
map.put("invstatusname", "生成");
}else if ("02".equals(invstatus)) {
map.put("invstatusname","提交");
}else if ("03".equals(invstatus)) {
map.put("invstatusname", "维修开始");
}else if ("04".equals(invstatus)) {
map.put("invstatusname", "委外维修");
}else if ("05".equals(invstatus)) {
map.put("invstatusname", "委外验收");
}else if ("06".equals(invstatus)) {
map.put("invstatusname", "维修结束");
}else if ("07".equals(invstatus)) {
map.put("invstatusname","班组确认");
}else if ("99".equals(invstatus)) {
map.put("invstatusname", "审核完毕");
}
if (ObjectUtil.isNotEmpty(RepairRecord)) {
// 故障原因
map.put("fault_cause", RepairRecord.getString("fault_cause"));
// 问题分析
map.put("fault_analysis", RepairRecord.getString("fault_analysis"));
// 处理措施
map.put("measure", RepairRecord.getString("measure"));
}
map.put("input_time", jsonReMst.getString("input_time").substring(0,10)); // 故障发生时间
map.put("plan_start_date", jsonReMst.getString("plan_start_date")); // 计划维修时间
map.put("real_start_date", jsonReMst.getString("real_start_date").substring(0,10)); // 实际维修时间
map.put("create_time", jsonReMst.getString("input_time").substring(0,10)); // 通知时间2022-10-22
map.put("year", jsonReMst.getString("input_time").substring(0,4)); // 通知时间
map.put("mouth", jsonReMst.getString("input_time").substring(5,7)); // 通知时间
map.put("day", jsonReMst.getString("input_time").substring(8,10)); // 通知时间
map.put("fault_desc", jsonReMst.getString("fault_desc")); // 故障描述
map.put("confirm_optname", jsonReMst.getString("confirm_optname")); // 验收人
// 维修内容
map.put("update_optname", jsonReMst.getString("update_optname")); // 维修人员
map.put("real_end_date", jsonReMst.getString("real_end_date").substring(0,10)); // 完工时间
@@ -943,6 +983,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
JSONObject json = changArr.getJSONObject(i);
HashMap<String, Object> mapData = new HashMap<>();
mapData.put("material_name",json.getString("material_name")); // 配件名称
mapData.put("material_code",json.getString("material_code")); // 配件编码
mapData.put("real_qty",json.getString("real_qty")); // 配件数量
data.add(mapData);
}

View File

@@ -63,7 +63,8 @@
QUERY
SELECT
recourd.*,
mater.material_name
mater.material_name,
mater.material_code
FROM
EM_BI_DeviceRepairReplaceRecord recourd
LEFT JOIN md_me_materialbase mater ON recourd.material_id = mater.material_id

View File

@@ -482,10 +482,20 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
// 1.准备数据 - 单组填充
HashMap<String, String> sheetMap = new HashMap<>();
sheetMap.put("input_time", jsonMainMst.getString("input_time").substring(0, 10)); // 时间
sheetMap.put("plan_start_date", jsonMainMst.getString("plan_start_date")); // 计划日期
sheetMap.put("plan_start_date", jsonMainMst.getString("plan_start_date").substring(0, 10)); // 计划日期
sheetMap.put("real_start_date", jsonMainMst.getString("real_start_date").substring(0, 10));
// 计划日期
sheetMap.put("update_optname1", jsonMainMst.getString("update_optname"));
sheetMap.put("update_optname2", jsonMainMst.getString("update_optname"));
sheetMap.put("update_optname3", jsonMainMst.getString("update_optname"));
sheetMap.put("confirm_optname", jsonMainMst.getString("confirm_optname"));
sheetMap.put("confirm_optname2", jsonMainMst.getString("confirm_optname"));
sheetMap.put("audit_optname", jsonMainMst.getString("audit_optname"));
if (ObjectUtil.isNotEmpty(jsonFile)) {
sheetMap.put("device_name", jsonFile.getString("device_name")); // 设备名称
sheetMap.put("leavefactory_number", jsonFile.getString("leavefactory_number")); // 出厂编号
sheetMap.put("extend_code", jsonFile.getString("extend_code")); // 出厂编号
sheetMap.put("device_model", jsonFile.getString("device_model")); // 型号
sheetMap.put("dept_name", jsonFile.getString("dept_name")); // 班组
}
@@ -504,7 +514,7 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
JSONObject json = jsonMainDtlArr.getJSONObject(i);
HashMap<String, Object> dataMap1 = new HashMap<>();
HashMap<String, Object> dataMap2 = new HashMap<>();
dataMap1.put("requirement", String.valueOf(i+1) + "." + json.getString("requirement"));
dataMap1.put("contents", String.valueOf(i+1) + "." + json.getString("contents"));
dataMap2.put("acceptancecriteria", String.valueOf(i+1) + "." + json.getString("acceptancecriteria"));
data1.add(dataMap1);
data2.add(dataMap2);

View File

@@ -63,18 +63,16 @@
QUERY
SELECT
dtl.*,
item.requirement,
item.contents,
item.acceptancecriteria
FROM
EM_BI_DeviceMaintenanceDtl dtl
LEFT JOIN EM_BI_DeviceMaintenanceItems item ON dtl.device_item_id = item.maint_item_id
WHERE
1=1
OPTION 输入.maint_id <> ""
dtl.maint_id = 输入.maint_id
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF
ENDIF