代码更新
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
mst.*,
|
||||
class.class_name,
|
||||
file.device_code,
|
||||
file.material_type_id,
|
||||
file.device_name,
|
||||
file.extend_code,
|
||||
d1.name AS dept_name,
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
package org.nl.wms.sb.stat.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.annotation.Log;
|
||||
import org.nl.wms.sb.stat.service.DevicePairQueryService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-09-30
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "维修记录")
|
||||
@RequestMapping("/api/devicerepairquery")
|
||||
@Slf4j
|
||||
public class DevicePairQueryController {
|
||||
|
||||
private final DevicePairQueryService devicePairQueryService;
|
||||
|
||||
@GetMapping
|
||||
@Log("维修记录查询")
|
||||
@ApiOperation("维修记录查询")
|
||||
//@PreAuthorize("@el.check('devicesparepartivt:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(devicePairQueryService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
|
||||
devicePairQueryService.download(whereJson, response);
|
||||
}
|
||||
|
||||
@PostMapping("/getDeviceInfo")
|
||||
@ApiOperation("获取数据")
|
||||
@Log("获取数据")
|
||||
public ResponseEntity<Object> getDeviceInfo(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(devicePairQueryService.getDeviceInfo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
package org.nl.wms.sb.stat.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-06-28
|
||||
**/
|
||||
public interface DevicePairQueryService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
void download(Map whereJson, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
* @param whereJson
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject getDeviceInfo(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package org.nl.wms.sb.stat.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
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.service.DeptService;
|
||||
import org.nl.utils.FileUtil;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.sb.stat.service.DevicePairQueryService;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class DevicePairQueryServiceImpl implements DevicePairQueryService {
|
||||
private final ClassstandardService classstandardService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
||||
|
||||
String repair_code = MapUtil.getStr(whereJson, "repair_code");
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
String invstatus = MapUtil.getStr(whereJson, "invstatus");
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
String class_idStr = (String) whereJson.get("class_idStr");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("invstatus",invstatus);
|
||||
map.put("begin_time",begin_time);
|
||||
map.put("end_time",end_time);
|
||||
if (ObjectUtil.isNotEmpty(repair_code)) map.put("repair_code","%"+repair_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code","%"+device_code+"%");
|
||||
//处理物料当前节点的所有子节点
|
||||
if (!StrUtil.isEmpty(material_type_id)) {
|
||||
map.put("material_type_id", material_type_id);
|
||||
String classIds = classstandardService.getChildIdStr(material_type_id);
|
||||
map.put("classIds", classIds);
|
||||
} else if (ObjectUtil.isNotEmpty(class_idStr)) {
|
||||
String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
// 归属部门
|
||||
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
||||
if (!StrUtil.isEmpty(dept_id)) {
|
||||
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
||||
map.put("deptIds", deptIds);
|
||||
}
|
||||
JSONObject json = WQL.getWO("EM_BI_DEVICEPAIRQUERY01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
|
||||
JSONArray content = json.getJSONArray("content");
|
||||
for (int i = 0; i < content.size(); i++) {
|
||||
JSONObject jsonObject = content.getJSONObject(i);
|
||||
|
||||
String real_start_date = jsonObject.getString("real_start_date");
|
||||
String real_end_date = jsonObject.getString("real_end_date");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(real_start_date) && ObjectUtil.isNotEmpty(real_end_date)) {
|
||||
Date date1 = DateUtil.parse(real_start_date);
|
||||
Date date2 = DateUtil.parse(real_end_date);
|
||||
long betweenDay = DateUtil.between(date1, date2, DateUnit.HOUR);
|
||||
jsonObject.put("repair_time",String.valueOf(betweenDay));
|
||||
}
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(Map whereJson, HttpServletResponse response) throws IOException {
|
||||
DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
||||
|
||||
String repair_code = MapUtil.getStr(whereJson, "repair_code");
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
String invstatus = MapUtil.getStr(whereJson, "invstatus");
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
String class_idStr = (String) whereJson.get("class_idStr");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("invstatus",invstatus);
|
||||
map.put("begin_time",begin_time);
|
||||
map.put("end_time",end_time);
|
||||
if (ObjectUtil.isNotEmpty(repair_code)) map.put("repair_code","%"+repair_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code","%"+device_code+"%");
|
||||
//处理物料当前节点的所有子节点
|
||||
if (!StrUtil.isEmpty(material_type_id)) {
|
||||
map.put("material_type_id", material_type_id);
|
||||
String classIds = classstandardService.getChildIdStr(material_type_id);
|
||||
map.put("classIds", classIds);
|
||||
} else if (ObjectUtil.isNotEmpty(class_idStr)) {
|
||||
String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
// 归属部门
|
||||
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
||||
if (!StrUtil.isEmpty(dept_id)) {
|
||||
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
|
||||
map.put("deptIds", deptIds);
|
||||
}
|
||||
|
||||
JSONArray rows = WQL.getWO("EM_BI_DEVICEPAIRQUERY01").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject jo = rows.getJSONObject(i);
|
||||
String real_start_date = jo.getString("real_start_date");
|
||||
String real_end_date = jo.getString("real_end_date");
|
||||
|
||||
String repair_time = "";
|
||||
if (ObjectUtil.isNotEmpty(real_start_date) && ObjectUtil.isNotEmpty(real_end_date)) {
|
||||
Date date1 = DateUtil.parse(real_start_date);
|
||||
Date date2 = DateUtil.parse(real_end_date);
|
||||
long betweenDay = DateUtil.between(date1, date2, DateUnit.HOUR);
|
||||
repair_time = String.valueOf(betweenDay);
|
||||
}
|
||||
|
||||
|
||||
Map<String, Object> dtl_map = new LinkedHashMap<>();
|
||||
dtl_map.put("维修单号", jo.getString("repair_code"));
|
||||
dtl_map.put("设备编码", jo.getString("device_code"));
|
||||
dtl_map.put("设备名称", jo.getString("device_name"));
|
||||
dtl_map.put("设备自编码", jo.getString("extend_code"));
|
||||
dtl_map.put("使用班组", jo.getString("use_name"));
|
||||
dtl_map.put("故障等级", jo.getString("fault_level"));
|
||||
dtl_map.put("单据状态", jo.getString("invstatus"));
|
||||
dtl_map.put("计划维修日期", jo.getString("plan_start_date"));
|
||||
dtl_map.put("创建人", jo.getString("input_optname"));
|
||||
dtl_map.put("创建时间", jo.getString("input_time"));
|
||||
dtl_map.put("报修人", jo.getString("bx_name"));
|
||||
dtl_map.put("报修时间", jo.getString("bx_time"));
|
||||
dtl_map.put("维修人", jo.getString("update_optname"));
|
||||
dtl_map.put("维修开始时间", jo.getString("real_start_date"));
|
||||
dtl_map.put("维修结束时间", jo.getString("real_end_date"));
|
||||
dtl_map.put("维修用时(h)", repair_time);
|
||||
dtl_map.put("委外申请人", jo.getString("outsourceaskfor_optname"));
|
||||
dtl_map.put("委外申请时间", jo.getString("outsourceaskfor_time"));
|
||||
dtl_map.put("委外单位", jo.getString("outsourceback_remark"));
|
||||
dtl_map.put("委外验收人", jo.getString("outsourceback_optname"));
|
||||
dtl_map.put("委外验收时间", jo.getString("outsourceback_time"));
|
||||
dtl_map.put("维修确认人", jo.getString("confirm_optname"));
|
||||
dtl_map.put("维修确认时间", jo.getString("confirm_time"));
|
||||
dtl_map.put("故障类别", jo.getString("device_faultclass_name"));
|
||||
dtl_map.put("故障描述", jo.getString("fault_comment"));
|
||||
dtl_map.put("故障原因", jo.getString("fault_cause"));
|
||||
dtl_map.put("问题分析", jo.getString("fault_analysis"));
|
||||
dtl_map.put("处理措施", jo.getString("measure"));
|
||||
dtl_map.put("审核人", jo.getString("audit_optname"));
|
||||
dtl_map.put("审核时间", jo.getString("audit_time"));
|
||||
dtl_map.put("源单号", jo.getString("source_bill_code"));
|
||||
dtl_map.put("源单业务类型", jo.getString("source_bill_type"));
|
||||
list.add(dtl_map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceInfo(JSONObject whereJson) {
|
||||
String repair_id = whereJson.getString("repair_id");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("repair_id", repair_id);
|
||||
JSONObject json = WQL.getWO("EM_BI_DEVICEPAIRQUERY01").addParamMap(map).process().uniqueResult(0);
|
||||
|
||||
// 查询维修项目
|
||||
map.put("flag", "3");
|
||||
JSONArray dtlArr = WQL.getWO("EM_BI_DEVICEPAIRQUERY01").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
// 查询维修记录更换记录
|
||||
map.put("flag", "4");
|
||||
JSONArray relArr = WQL.getWO("EM_BI_DEVICEPAIRQUERY01").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
json.put("tableData1", dtlArr);
|
||||
json.put("tableData2", relArr);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,266 @@
|
||||
[交易说明]
|
||||
交易名: 维修记录分页查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.classIds TYPEAS f_string
|
||||
输入.repair_type TYPEAS s_string
|
||||
输入.invstatus TYPEAS s_string
|
||||
输入.repair_code TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.device_code TYPEAS s_string
|
||||
输入.repair_id TYPEAS s_string
|
||||
输入.deptIds TYPEAS f_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
mst.repair_id,
|
||||
mst.devicerecord_id,
|
||||
|
||||
mst.repair_code,
|
||||
file.device_code,
|
||||
file.device_name,
|
||||
file.extend_code,
|
||||
d2.name AS use_name,
|
||||
mst.fault_level,
|
||||
mst.invstatus,
|
||||
mst.plan_start_date,
|
||||
mst.input_optname,
|
||||
mst.input_time,
|
||||
|
||||
st.create_name AS bx_name,
|
||||
st.create_time AS bx_time,
|
||||
|
||||
mst.update_optname,
|
||||
mst.real_start_date,
|
||||
mst.real_end_date,
|
||||
mst.outsourceaskfor_optname,
|
||||
mst.outsourceaskfor_time,
|
||||
mst.outsourceback_remark,
|
||||
mst.outsourceback_optname,
|
||||
mst.outsourceback_time,
|
||||
mst.confirm_optname,
|
||||
mst.confirm_time,
|
||||
|
||||
fau.device_faultclass_name,
|
||||
re.fault_comment,
|
||||
re.fault_cause,
|
||||
re.fault_analysis,
|
||||
re.measure,
|
||||
mst.audit_optname,
|
||||
mst.audit_time,
|
||||
mst.source_bill_code,
|
||||
mst.source_bill_type
|
||||
|
||||
FROM
|
||||
EM_BI_DeviceRepairMst mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = mst.devicerecord_id
|
||||
LEFT JOIN md_pb_classstandard class ON file.material_type_id = class.class_id
|
||||
LEFT JOIN sys_dept d2 ON file.use_groupid = d2.dept_id
|
||||
LEFT JOIN EM_BI_DeviceRepairRequest st ON st.request_id = mst.source_bill_id AND mst.source_bill_type = 'BXD'
|
||||
LEFT JOIN EM_BI_DeviceFaultClass fau ON st.device_faultclass_id = fau.device_faultclass_id
|
||||
LEFT JOIN EM_BI_DeviceRepairRecord re ON mst.repair_id = re.repair_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
|
||||
OPTION 输入.repair_code <> ""
|
||||
(mst.repair_code like 输入.repair_code or
|
||||
mst.repair_code like 输入.repair_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.classIds <> ""
|
||||
class.class_id in 输入.classIds
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.invstatus <> ""
|
||||
mst.invstatus = 输入.invstatus
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.repair_type <> ""
|
||||
mst.repair_type = 输入.repair_type
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
mst.plan_start_date >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
mst.plan_start_date <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.deptIds <> ""
|
||||
d2.dept_id in 输入.deptIds
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
mst.repair_code,
|
||||
mst.plan_start_date,
|
||||
mst.maintenancecycle,
|
||||
file.device_code,
|
||||
dept.name AS use_name,
|
||||
(
|
||||
CASE
|
||||
mst.fault_level
|
||||
WHEN '01' THEN '紧急'
|
||||
WHEN '02' THEN '一般'
|
||||
WHEN '03' THEN '不紧急'
|
||||
END
|
||||
) AS fault_level,
|
||||
fau.device_faultclass_name,
|
||||
(
|
||||
CASE
|
||||
mst.invstatus
|
||||
WHEN '01' THEN '生成'
|
||||
WHEN '02' THEN '提交'
|
||||
WHEN '03' THEN '维修开始'
|
||||
WHEN '04' THEN '委外维修'
|
||||
WHEN '05' THEN '委外验收'
|
||||
WHEN '06' THEN '维修结束'
|
||||
WHEN '07' THEN '班组确认'
|
||||
WHEN '99' THEN '审核完毕'
|
||||
END
|
||||
) AS invstatus,
|
||||
mst.remark,
|
||||
|
||||
st.create_time,
|
||||
st.create_name,
|
||||
st.product_person_name,
|
||||
mst.real_start_date,
|
||||
mst.real_end_date,
|
||||
mst.update_optname,
|
||||
mst.outsourceaskfor_time,
|
||||
mst.outsourceaskfor_optname,
|
||||
mst.outsourceback_remark,
|
||||
mst.outsourceback_time,
|
||||
mst.outsourceback_optname,
|
||||
mst.confirm_time,
|
||||
mst.confirm_optname,
|
||||
mst.audit_time,
|
||||
mst.audit_optname,
|
||||
|
||||
re.fault_comment,
|
||||
re.fault_cause,
|
||||
re.fault_analysis,
|
||||
re.measure
|
||||
|
||||
FROM
|
||||
EM_BI_DeviceRepairMst mst
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON mst.devicerecord_id = file.devicerecord_id
|
||||
LEFT JOIN sys_dept dept ON file.use_groupid = dept.dept_id
|
||||
LEFT JOIN EM_BI_DeviceRepairRequest st ON mst.source_bill_id = st.request_id
|
||||
LEFT JOIN EM_BI_DeviceFaultClass fau ON fau.device_faultclass_id = st.device_faultclass_id
|
||||
LEFT JOIN EM_BI_DeviceRepairRecord re ON re.repair_id = mst.repair_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
|
||||
OPTION 输入.repair_id <> ""
|
||||
mst.repair_id = 输入.repair_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
item.repair_item_code,
|
||||
item.repair_item_name,
|
||||
item.requirement,
|
||||
(
|
||||
CASE
|
||||
dtl.isfinish
|
||||
WHEN '0' THEN '否'
|
||||
ELSE '是'
|
||||
END
|
||||
) AS isfinish
|
||||
FROM
|
||||
EM_BI_DeviceRepairDtl dtl
|
||||
LEFT JOIN EM_BI_DeviceRepairItems item ON dtl.repair_item_id = item.repair_item_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.repair_id <> ""
|
||||
dtl.repair_id = 输入.repair_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
item.repair_item_code,
|
||||
file.device_code,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
re.new_sparepart_only_id,
|
||||
re.old_sparepart_only_id
|
||||
FROM
|
||||
EM_BI_DeviceRepairReplaceRecord re
|
||||
LEFT JOIN EM_BI_DeviceRepairItems item ON re.repair_item_id = item.repair_item_id
|
||||
LEFT JOIN EM_BI_DeviceRepairMst mst ON mst.repair_id = re.repair_id
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON mst.devicerecord_id = file.devicerecord_id
|
||||
LEFT JOIN md_me_materialbase mater ON re.material_id = mater.material_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
|
||||
OPTION 输入.repair_id <> ""
|
||||
re.repair_id = 输入.repair_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -53,6 +53,7 @@
|
||||
mst.*,
|
||||
class.class_name,
|
||||
file.device_code,
|
||||
file.material_type_id,
|
||||
file.device_name,
|
||||
file.extend_code,
|
||||
d1.name AS dept_name,
|
||||
@@ -298,6 +299,7 @@
|
||||
mst.*,
|
||||
class.class_name,
|
||||
file.device_code,
|
||||
file.material_type_id,
|
||||
file.device_name,
|
||||
file.extend_code,
|
||||
d1.name AS dept_name,
|
||||
|
||||
Reference in New Issue
Block a user