代码更新
This commit is contained in:
Binary file not shown.
@@ -40,6 +40,14 @@ public class DevicerepairrequestController {
|
||||
return new ResponseEntity<>(devicerepairrequestService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/query2")
|
||||
@Log("查询设备报修2")
|
||||
@ApiOperation("查询设备报修2")
|
||||
//@PreAuthorize("@el.check('devicerepairrequest:list')")
|
||||
public ResponseEntity<Object> query2(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(devicerepairrequestService.query2(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增设备报修")
|
||||
@ApiOperation("新增设备报修")
|
||||
|
||||
@@ -26,6 +26,15 @@ public interface DevicerepairrequestService {
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> query2(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
*
|
||||
|
||||
@@ -80,4 +80,7 @@ public class DevicerepairrequestDto implements Serializable {
|
||||
|
||||
/** 公司ID */
|
||||
private Long syscompanyid;
|
||||
|
||||
/** 班组配合人 */
|
||||
private String product_person_name;
|
||||
}
|
||||
|
||||
@@ -289,6 +289,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
// 1. 更新设备维修单主表
|
||||
JSONObject jsonReMst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
|
||||
jsonReMst.put("invstatus", "03");
|
||||
jsonReMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
jsonReMst.put("real_start_date", DateUtil.now());
|
||||
reMstTab.update(jsonReMst);
|
||||
// 2.更新设备档案表
|
||||
@@ -381,7 +382,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
|
||||
// 1.更新维修主表
|
||||
JSONObject jsonReMst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
|
||||
jsonReMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
// jsonReMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
jsonReMst.put("product_person_name", whereJson.getString("product_person_name"));
|
||||
jsonReMst.put("update_time", DateUtil.now());
|
||||
reMstTab.update(jsonReMst);
|
||||
|
||||
@@ -8,7 +8,9 @@ import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.security.service.dto.JwtUserDto;
|
||||
import org.nl.modules.system.service.DeptService;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.sb.repair.service.DevicerepairrequestService;
|
||||
import org.nl.wms.sb.repair.service.dto.DevicerepairrequestDto;
|
||||
@@ -74,6 +76,44 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> query2(Map whereJson, Pageable page) {
|
||||
DeptService deptService = SpringContextHolder.getBean(DeptService.class);
|
||||
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
String request_code = MapUtil.getStr(whereJson, "request_code");
|
||||
String status = MapUtil.getStr(whereJson, "status");
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
String class_idStr = (String) whereJson.get("class_idStr");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "3");
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
map.put("status", status);
|
||||
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code","%"+device_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(request_code)) map.put("request_code","%"+request_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_DEVICEREPAIRREQUEST001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.create_time DESC");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevicerepairrequestDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicerepairrequest");
|
||||
@@ -176,7 +216,7 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
||||
jsonFile.put("status","20");
|
||||
fileTab.update(jsonFile);
|
||||
|
||||
// 2.更新设备保修单
|
||||
// 2.更新设备报修单
|
||||
JSONObject jsonRequest = requestTab.query("request_id = '" + whereJson.getString("request_id") + "'").uniqueResult(0);
|
||||
jsonRequest.put("is_passed", "1");
|
||||
jsonRequest.put("status", "02");
|
||||
@@ -192,6 +232,7 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
||||
jsonReMst.put("devicerecord_id", jsonRequest.get("devicerecord_id"));
|
||||
jsonReMst.put("maintenancecycle", "02");
|
||||
jsonReMst.put("invstatus", "01");
|
||||
jsonReMst.put("product_person_name", jsonRequest.getString("product_person_name"));
|
||||
jsonReMst.put("fault_desc", jsonRequest.getString("fault_desc"));
|
||||
jsonReMst.put("fault_level", jsonRequest.getString("fault_level"));
|
||||
jsonReMst.put("plan_start_date", DateUtil.today());
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
输入.request_code TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.deptIds TYPEAS f_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -107,5 +108,61 @@
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
mst.*,
|
||||
class.class_name,
|
||||
file.device_code,
|
||||
file.device_name,
|
||||
file.extend_code,
|
||||
class2.device_faultclass_name,
|
||||
d1.name AS dept_name,
|
||||
d2.name AS use_name
|
||||
FROM
|
||||
EM_BI_DeviceRepairRequest 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 EM_BI_DeviceFaultClass class2 ON mst.device_faultclass_id = class2.device_faultclass_id
|
||||
LEFT JOIN sys_dept d1 ON file.belong_deptid = d1.dept_id
|
||||
LEFT JOIN sys_dept d2 ON file.use_groupid = d2.dept_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
AND file.is_delete = '0'
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.request_code <> ""
|
||||
(mst.request_code like 输入.request_code or
|
||||
mst.request_code like 输入.request_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.classIds <> ""
|
||||
class.class_id in 输入.classIds
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.deptIds <> ""
|
||||
d1.dept_id in 输入.deptIds
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.status <> ""
|
||||
mst.status = 输入.status
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
mst.create_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
mst.create_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user