Commit c486a859 authored by tianyiming's avatar tianyiming

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

parent 5984e9e2
......@@ -1874,8 +1874,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public JSONArray queryRYLX(JSONObject params) {
JSONArray result = new JSONArray();
JSONArray type = params.containsKey("type") ? JSONObject.parseArray(JSONObject.toJSONString(params.get("type"))) : new JSONArray();
String subType = params.containsKey("subType") ? params.get("subType").toString() : "";
JSONArray unitType = params.containsKey("unitType") && !"".equals(params.get("unitType")) ? JSONObject.parseArray(JSONObject.toJSONString(params.get("unitType"))) : new JSONArray();
String newPost = params.containsKey("newPost") ? params.get("newPost").toString() : "";
List<String> typeList = new ArrayList<>(Arrays.asList(
"QYRYGW",
......@@ -1891,21 +1891,21 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
.in(DataDictionary::getType, typeList)
.list();
if (!"".equals(subType)) {
if (!"".equals(newPost)) {
List<DataDictionary> childrenrylx = dataDictionaryService.lambdaQuery()
.in(DataDictionary::getParent, subType)
.in(DataDictionary::getParent, newPost)
.like(DataDictionary::getType, "QYRYGW")
.orderByAsc(DataDictionary::getSortNum)
.list();
result = deployDictionary(childrenrylx);
}
if (!ObjectUtils.isEmpty(type) && !type.contains("all")) {
if (!ObjectUtils.isEmpty(unitType) && !unitType.contains("all")) {
try {
ArrayList<String> postDictCodeList = new ArrayList<>();
JsonNode jsonNode = new ObjectMapper().readTree(unitTypeLimitUserType.getInputStream());
type.forEach(unitType -> {
JsonNode companyTypeNode = jsonNode.get(unitType.toString());
unitType.forEach(item -> {
JsonNode companyTypeNode = jsonNode.get(item.toString());
if (companyTypeNode != null && companyTypeNode.isObject()) {
Iterator<Map.Entry<String, JsonNode>> fields = companyTypeNode.fields();
while (fields.hasNext()) {
......@@ -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);
}
......
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