代码更新

This commit is contained in:
2022-09-05 15:10:01 +08:00
parent ab4f712f48
commit 1613117ece
10 changed files with 333 additions and 25 deletions

View File

@@ -3,12 +3,14 @@ package org.nl.wms.basedata.em.service.impl;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import lombok.RequiredArgsConstructor;
import org.nl.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.wms.basedata.em.service.DevicemaintenanceitemsService;
import org.nl.wms.basedata.em.service.dto.DevicemaintenanceitemsDto;
import org.nl.wms.basedata.master.service.ClassstandardService;
import org.nl.wql.WQL;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -40,8 +42,13 @@ import cn.hutool.core.util.ObjectUtil;
@Slf4j
public class DevicemaintenanceitemsServiceImpl implements DevicemaintenanceitemsService {
private final ClassstandardService classstandardService;
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
String class_idStr = (String) whereJson.get("class_idStr");
String maint_item_code = MapUtil.getStr(whereJson, "maint_item_code");
String contents = MapUtil.getStr(whereJson, "contents");
String requirement = MapUtil.getStr(whereJson, "requirement");
@@ -54,6 +61,15 @@ public class DevicemaintenanceitemsServiceImpl implements Devicemaintenanceitems
if (ObjectUtil.isNotEmpty(contents)) map.put("contents","%"+contents+"%");
if (ObjectUtil.isNotEmpty(requirement)) map.put("requirement","%"+requirement+"%");
//处理物料当前节点的所有子节点
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("QEM_BI_DEVICEMAINTAIN001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "update_time DESC");
return json;
}
@@ -97,6 +113,7 @@ public class DevicemaintenanceitemsServiceImpl implements Devicemaintenanceitems
json.put("maint_item_id", IdUtil.getSnowflake(1,1).nextId());
json.put("maint_item_code", CodeUtil.getNewCode("MAINT_ITEM_CODE"));
json.put("maint_item_name", whereJson.getString("maint_item_name"));
json.put("material_type_id", whereJson.get("material_type_id"));
json.put("item_level", whereJson.getString("item_level"));
json.put("contents", whereJson.getString("contents"));
json.put("requirement", whereJson.getString("requirement"));
@@ -121,6 +138,7 @@ public class DevicemaintenanceitemsServiceImpl implements Devicemaintenanceitems
JSONObject json = wo.query("maint_item_id = '" + whereJson.getString("maint_item_id") + "'").uniqueResult(0);
json.put("maint_item_name", whereJson.getString("maint_item_name"));
json.put("material_type_id", whereJson.get("material_type_id"));
json.put("item_level", whereJson.getString("item_level"));
json.put("contents", whereJson.getString("contents"));
json.put("requirement", whereJson.getString("requirement"));

View File

@@ -3,12 +3,14 @@ package org.nl.wms.basedata.em.service.impl;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import lombok.RequiredArgsConstructor;
import org.nl.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.wms.basedata.em.service.DevicerepairitemsService;
import org.nl.wms.basedata.em.service.dto.DevicerepairitemsDto;
import org.nl.wms.basedata.master.service.ClassstandardService;
import org.nl.wql.WQL;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -39,9 +41,12 @@ import cn.hutool.core.util.ObjectUtil;
@RequiredArgsConstructor
@Slf4j
public class DevicerepairitemsServiceImpl implements DevicerepairitemsService {
private final ClassstandardService classstandardService;
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
String class_idStr = (String) whereJson.get("class_idStr");
String repair_item_code = MapUtil.getStr(whereJson, "repair_item_code");
String requirement = MapUtil.getStr(whereJson, "requirement");
@@ -50,6 +55,16 @@ public class DevicerepairitemsServiceImpl implements DevicerepairitemsService {
if (ObjectUtil.isNotEmpty(repair_item_code)) map.put("repair_item_code","%"+repair_item_code+"%");
if (ObjectUtil.isNotEmpty(requirement)) map.put("requirement","%"+requirement+"%");
//处理物料当前节点的所有子节点
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("QEM_BI_DEVICEREPAIRITEMS01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "update_time DESC");
return json;
}
@@ -93,6 +108,7 @@ public class DevicerepairitemsServiceImpl implements DevicerepairitemsService {
json.put("repair_item_id", IdUtil.getSnowflake(1,1).nextId());
json.put("repair_item_code", CodeUtil.getNewCode("REPAIR_ITEM_CODE"));
json.put("repair_item_name", whereJson.getString("repair_item_name"));
json.put("material_type_id", whereJson.get("material_type_id"));
json.put("requirement", whereJson.getString("requirement"));
json.put("remark", whereJson.getString("remark"));
json.put("create_id",currentUserId );
@@ -117,6 +133,7 @@ public class DevicerepairitemsServiceImpl implements DevicerepairitemsService {
JSONObject json = wo.query("repair_item_id = '" + whereJson.getString("repair_item_id") + "'").uniqueResult(0);
json.put("repair_item_name", whereJson.getString("repair_item_name"));
json.put("material_type_id", whereJson.get("material_type_id"));
json.put("requirement", whereJson.getString("requirement"));
json.put("remark", whereJson.getString("remark"));
json.put("update_optid",currentUserId );

View File

@@ -18,6 +18,7 @@
输入.contents TYPEAS s_string
输入.requirement TYPEAS s_string
输入.item_level TYPEAS s_string
输入.classIds TYPEAS f_string
[临时表]
@@ -45,27 +46,33 @@
IF 输入.flag = "1"
PAGEQUERY
SELECT
*
item.*,
class.class_name
FROM
EM_BI_DeviceMaintenanceItems
EM_BI_DeviceMaintenanceItems item
LEFT JOIN md_pb_classstandard class ON item.material_type_id = class.class_id
WHERE
is_delete = '0'
item.is_delete = '0'
OPTION 输入.item_level <> ""
item_level = 输入.item_level
item.item_level = 输入.item_level
ENDOPTION
OPTION 输入.maint_item_code <> ""
(maint_item_code like 输入.maint_item_code or
maint_item_name like 输入.maint_item_code)
(item.maint_item_code like 输入.maint_item_code or
item.maint_item_name like 输入.maint_item_code)
ENDOPTION
OPTION 输入.contents <> ""
contents like 输入.contents
item.contents like 输入.contents
ENDOPTION
OPTION 输入.requirement <> ""
requirement like 输入.requirement
item.requirement like 输入.requirement
ENDOPTION
OPTION 输入.classIds <> ""
class.class_id in 输入.classIds
ENDOPTION
ENDSELECT

View File

@@ -16,6 +16,7 @@
输入.flag TYPEAS s_string
输入.repair_item_code TYPEAS s_string
输入.requirement TYPEAS s_string
输入.classIds TYPEAS f_string
[临时表]
@@ -43,19 +44,25 @@
IF 输入.flag = "1"
PAGEQUERY
SELECT
*
item.*,
class.class_name
FROM
EM_BI_DeviceRepairItems
EM_BI_DeviceRepairItems item
LEFT JOIN md_pb_classstandard class ON item.material_type_id = class.class_id
WHERE
is_delete = '0'
item.is_delete = '0'
OPTION 输入.classIds <> ""
class.class_id in 输入.classIds
ENDOPTION
OPTION 输入.requirement <> ""
requirement like 输入.requirement
item.requirement like 输入.requirement
ENDOPTION
OPTION 输入.repair_item_code <> ""
(repair_item_code like 输入.repair_item_code or
repair_item_name like 输入.repair_item_code)
(item.repair_item_code like 输入.repair_item_code or
item.repair_item_name like 输入.repair_item_code)
ENDOPTION
ENDSELECT