Commit c486a859 authored by tianyiming's avatar tianyiming

refactor: 修改员工类型查询逻辑

parent 5984e9e2
...@@ -1874,8 +1874,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -1874,8 +1874,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public JSONArray queryRYLX(JSONObject params) { public JSONArray queryRYLX(JSONObject params) {
JSONArray result = new JSONArray(); JSONArray result = new JSONArray();
JSONArray type = params.containsKey("type") ? JSONObject.parseArray(JSONObject.toJSONString(params.get("type"))) : new JSONArray(); JSONArray unitType = params.containsKey("unitType") && !"".equals(params.get("unitType")) ? JSONObject.parseArray(JSONObject.toJSONString(params.get("unitType"))) : new JSONArray();
String subType = params.containsKey("subType") ? params.get("subType").toString() : ""; String newPost = params.containsKey("newPost") ? params.get("newPost").toString() : "";
List<String> typeList = new ArrayList<>(Arrays.asList( List<String> typeList = new ArrayList<>(Arrays.asList(
"QYRYGW", "QYRYGW",
...@@ -1891,21 +1891,21 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -1891,21 +1891,21 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
.in(DataDictionary::getType, typeList) .in(DataDictionary::getType, typeList)
.list(); .list();
if (!"".equals(subType)) { if (!"".equals(newPost)) {
List<DataDictionary> childrenrylx = dataDictionaryService.lambdaQuery() List<DataDictionary> childrenrylx = dataDictionaryService.lambdaQuery()
.in(DataDictionary::getParent, subType) .in(DataDictionary::getParent, newPost)
.like(DataDictionary::getType, "QYRYGW") .like(DataDictionary::getType, "QYRYGW")
.orderByAsc(DataDictionary::getSortNum) .orderByAsc(DataDictionary::getSortNum)
.list(); .list();
result = deployDictionary(childrenrylx); result = deployDictionary(childrenrylx);
} }
if (!ObjectUtils.isEmpty(type) && !type.contains("all")) { if (!ObjectUtils.isEmpty(unitType) && !unitType.contains("all")) {
try { try {
ArrayList<String> postDictCodeList = new ArrayList<>(); ArrayList<String> postDictCodeList = new ArrayList<>();
JsonNode jsonNode = new ObjectMapper().readTree(unitTypeLimitUserType.getInputStream()); JsonNode jsonNode = new ObjectMapper().readTree(unitTypeLimitUserType.getInputStream());
type.forEach(unitType -> { unitType.forEach(item -> {
JsonNode companyTypeNode = jsonNode.get(unitType.toString()); JsonNode companyTypeNode = jsonNode.get(item.toString());
if (companyTypeNode != null && companyTypeNode.isObject()) { if (companyTypeNode != null && companyTypeNode.isObject()) {
Iterator<Map.Entry<String, JsonNode>> fields = companyTypeNode.fields(); Iterator<Map.Entry<String, JsonNode>> fields = companyTypeNode.fields();
while (fields.hasNext()) { while (fields.hasNext()) {
...@@ -1923,7 +1923,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -1923,7 +1923,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
} }
} }
if ("".equals(subType) && (ObjectUtils.isEmpty(type) || type.contains("all"))) { if ("".equals(newPost) && (ObjectUtils.isEmpty(unitType) || unitType.contains("all"))) {
result = deployDictionary(allPost); result = deployDictionary(allPost);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment