代码更新
This commit is contained in:
@@ -40,6 +40,14 @@ public class DevicerepairmstController {
|
|||||||
return new ResponseEntity<>(devicerepairmstService.queryAll(whereJson, page), HttpStatus.OK);
|
return new ResponseEntity<>(devicerepairmstService.queryAll(whereJson, page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/query")
|
||||||
|
@Log("查询维修单维护2")
|
||||||
|
@ApiOperation("查询维修单维护2")
|
||||||
|
//@PreAuthorize("@el.check('devicerepairmst:list')")
|
||||||
|
public ResponseEntity<Object> query2(@RequestParam Map whereJson, Pageable page) {
|
||||||
|
return new ResponseEntity<>(devicerepairmstService.query(whereJson, page), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/queryBom")
|
@GetMapping("/queryBom")
|
||||||
@Log("查询备件bom")
|
@Log("查询备件bom")
|
||||||
@ApiOperation("查询备件bom")
|
@ApiOperation("查询备件bom")
|
||||||
|
|||||||
@@ -27,6 +27,15 @@ public interface DevicerepairmstService {
|
|||||||
*/
|
*/
|
||||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
*
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param page 分页参数
|
||||||
|
* @return Map<String, Object>
|
||||||
|
*/
|
||||||
|
Map<String, Object> query(Map whereJson, Pageable page);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有数据不分页
|
* 查询所有数据不分页
|
||||||
*
|
*
|
||||||
@@ -172,4 +181,5 @@ public interface DevicerepairmstService {
|
|||||||
void submitReceive(JSONObject whereJson);
|
void submitReceive(JSONObject whereJson);
|
||||||
|
|
||||||
Map<String, Object> queryBom(Map whereJson, Pageable page);
|
Map<String, Object> queryBom(Map whereJson, Pageable page);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,38 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> query(Map whereJson, Pageable page) {
|
||||||
|
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||||
|
String repair_code = MapUtil.getStr(whereJson, "repair_code");
|
||||||
|
String maintenancecycle = MapUtil.getStr(whereJson, "maintenancecycle");
|
||||||
|
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", "6");
|
||||||
|
map.put("maintenancecycle",maintenancecycle);
|
||||||
|
map.put("invstatus",invstatus);
|
||||||
|
map.put("begin_time",begin_time);
|
||||||
|
map.put("end_time",end_time);
|
||||||
|
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code","%"+device_code+"%");
|
||||||
|
if (ObjectUtil.isNotEmpty(repair_code)) map.put("repair_code","%"+repair_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);
|
||||||
|
}
|
||||||
|
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIR001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DevicerepairmstDto> queryAll(Map whereJson) {
|
public List<DevicerepairmstDto> queryAll(Map whereJson) {
|
||||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicerepairmst");
|
WQLObject wo = WQLObject.getWQLObject("em_bi_devicerepairmst");
|
||||||
|
|||||||
@@ -99,6 +99,56 @@
|
|||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "6"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT
|
||||||
|
mst.*,
|
||||||
|
class.class_name,
|
||||||
|
file.device_code,
|
||||||
|
file.device_name
|
||||||
|
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
|
||||||
|
WHERE
|
||||||
|
mst.is_delete = '0'
|
||||||
|
AND file.is_delete = '0'
|
||||||
|
AND mst.invstatus in (07,99)
|
||||||
|
|
||||||
|
OPTION 输入.device_code <> ""
|
||||||
|
(file.device_code like 输入.device_code or
|
||||||
|
file.device_name like 输入.device_code)
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.repair_code <> ""
|
||||||
|
(mst.repair_code like 输入.repair_code or
|
||||||
|
mst.repair_code like 输入.repair_code)
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.classIds <> ""
|
||||||
|
class.class_id in 输入.classIds
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.invstatus <> ""
|
||||||
|
mst.invstatus = 输入.invstatus
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.maintenancecycle <> ""
|
||||||
|
mst.maintenancecycle = 输入.maintenancecycle
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.begin_time <> ""
|
||||||
|
mst.plan_start_date >= 输入.begin_time
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.end_time <> ""
|
||||||
|
mst.plan_start_date <= 输入.end_time
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
IF 输入.flag = "2"
|
IF 输入.flag = "2"
|
||||||
QUERY
|
QUERY
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@@ -40,6 +40,14 @@ public class DevicemaintenancemstController {
|
|||||||
return new ResponseEntity<>(devicemaintenancemstService.queryAll(whereJson, page), HttpStatus.OK);
|
return new ResponseEntity<>(devicemaintenancemstService.queryAll(whereJson, page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/query")
|
||||||
|
@Log("查询设备保养单2")
|
||||||
|
@ApiOperation("查询设备保养单2")
|
||||||
|
//@PreAuthorize("@el.check('devicemaintenancemst:list')")
|
||||||
|
public ResponseEntity<Object> query2(@RequestParam Map whereJson, Pageable page) {
|
||||||
|
return new ResponseEntity<>(devicemaintenancemstService.query2(whereJson, page), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@Log("新增设备保养单")
|
@Log("新增设备保养单")
|
||||||
@ApiOperation("新增设备保养单")
|
@ApiOperation("新增设备保养单")
|
||||||
|
|||||||
@@ -27,6 +27,15 @@ public interface DevicemaintenancemstService {
|
|||||||
*/
|
*/
|
||||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
*
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param page 分页参数
|
||||||
|
* @return Map<String, Object>
|
||||||
|
*/
|
||||||
|
Map<String, Object> query2(Map whereJson, Pageable page);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有数据不分页
|
* 查询所有数据不分页
|
||||||
*
|
*
|
||||||
@@ -121,4 +130,5 @@ public interface DevicemaintenancemstService {
|
|||||||
* @param whereJson /
|
* @param whereJson /
|
||||||
*/
|
*/
|
||||||
void auditMaintain(JSONObject whereJson);
|
void auditMaintain(JSONObject whereJson);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,38 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> query2(Map whereJson, Pageable page) {
|
||||||
|
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||||
|
String class_idStr = MapUtil.getStr(whereJson, "class_idStr");
|
||||||
|
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||||
|
String maintenancecycle = MapUtil.getStr(whereJson, "maintenancecycle");
|
||||||
|
String maint_code = MapUtil.getStr(whereJson, "maint_code");
|
||||||
|
String invstatus = MapUtil.getStr(whereJson, "invstatus");
|
||||||
|
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||||
|
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||||
|
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
map.put("flag", "3");
|
||||||
|
map.put("maintenancecycle",maintenancecycle);
|
||||||
|
map.put("invstatus",invstatus);
|
||||||
|
map.put("begin_time", begin_time);
|
||||||
|
map.put("end_time", end_time);
|
||||||
|
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code","%"+device_code+"%");
|
||||||
|
if (ObjectUtil.isNotEmpty(maint_code)) map.put("maint_code","%"+maint_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);
|
||||||
|
}
|
||||||
|
JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCE001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DevicemaintenancemstDto> queryAll(Map whereJson) {
|
public List<DevicemaintenancemstDto> queryAll(Map whereJson) {
|
||||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicemaintenancemst");
|
WQLObject wo = WQLObject.getWQLObject("em_bi_devicemaintenancemst");
|
||||||
@@ -264,12 +296,22 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void endMaintain(JSONObject whereJson) {
|
public void endMaintain(JSONObject whereJson) {
|
||||||
|
String maint_id = whereJson.getString("maint_id");
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getNickName();
|
String nickName = SecurityUtils.getNickName();
|
||||||
|
|
||||||
WQLObject mainMstTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenanceMst"); // 保养单主表
|
WQLObject mainMstTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenanceMst"); // 保养单主表
|
||||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 设备档案表
|
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 设备档案表
|
||||||
WQLObject lifeTab = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle"); // 设备声明周期表
|
WQLObject lifeTab = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle"); // 设备声明周期表
|
||||||
|
WQLObject dtlTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenanceDtl");
|
||||||
|
|
||||||
|
|
||||||
|
// 1.明细中的是否完成 :必须为全部完成
|
||||||
|
JSONArray dtlArr = dtlTab.query("maint_id = '" + maint_id + "'").getResultJSONArray(0);
|
||||||
|
for (int i = 0; i < dtlArr.size(); i++) {
|
||||||
|
JSONObject json = dtlArr.getJSONObject(i);
|
||||||
|
if (StrUtil.equals(json.getString("isfinish"), "0")) throw new BadRequestException("保养项目未完成");
|
||||||
|
}
|
||||||
|
|
||||||
// 更新保养单主表
|
// 更新保养单主表
|
||||||
JSONObject jsonMainMst = mainMstTab.query("maint_id = '" + whereJson.getString("maint_id") + "'").uniqueResult(0);
|
JSONObject jsonMainMst = mainMstTab.query("maint_id = '" + whereJson.getString("maint_id") + "'").uniqueResult(0);
|
||||||
|
|||||||
@@ -95,6 +95,56 @@
|
|||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "3"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT
|
||||||
|
mst.*,
|
||||||
|
class.class_name,
|
||||||
|
file.device_code,
|
||||||
|
file.device_name
|
||||||
|
FROM
|
||||||
|
EM_BI_DeviceMaintenanceMst 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
|
||||||
|
WHERE
|
||||||
|
mst.is_delete = '0'
|
||||||
|
AND file.is_delete = '0'
|
||||||
|
AND mst.invstatus in (05,99)
|
||||||
|
|
||||||
|
OPTION 输入.device_code <> ""
|
||||||
|
(file.device_code like 输入.device_code or
|
||||||
|
file.device_name like 输入.device_code)
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.maint_code <> ""
|
||||||
|
(mst.maint_code like 输入.maint_code or
|
||||||
|
mst.maint_code like 输入.maint_code)
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.classIds <> ""
|
||||||
|
class.class_id in 输入.classIds
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.maintenancecycle <> ""
|
||||||
|
mst.maintenancecycle = 输入.maintenancecycle
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.begin_time <> ""
|
||||||
|
mst.plan_start_date >= 输入.begin_time
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.end_time <> ""
|
||||||
|
mst.plan_start_date <= 输入.end_time
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.invstatus <> ""
|
||||||
|
mst.invstatus = 输入.invstatus
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
IF 输入.flag = "2"
|
IF 输入.flag = "2"
|
||||||
QUERY
|
QUERY
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ export default {
|
|||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
title: '维修单审核',
|
title: '维修单审核',
|
||||||
url: 'api/devicerepairmst',
|
url: 'api/devicerepairmst/query',
|
||||||
idField: 'repair_id',
|
idField: 'repair_id',
|
||||||
sort: 'repair_id,desc',
|
sort: 'repair_id,desc',
|
||||||
crudMethod: { ...crudDevicerepairmst },
|
crudMethod: { ...crudDevicerepairmst },
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export default {
|
|||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
title: '保养单审核',
|
title: '保养单审核',
|
||||||
url: 'api/devicemaintenancemst',
|
url: 'api/devicemaintenancemst/query',
|
||||||
idField: 'maint_id',
|
idField: 'maint_id',
|
||||||
sort: 'maint_id,desc',
|
sort: 'maint_id,desc',
|
||||||
crudMethod: { ...crudDevicemaintenancemst },
|
crudMethod: { ...crudDevicemaintenancemst },
|
||||||
|
|||||||
Reference in New Issue
Block a user