Commit 5ed1a444 authored by tianyiming's avatar tianyiming

fix: 修复字段名称错误并调整单位类型更新逻辑

parent 018dd050
...@@ -27,6 +27,10 @@ public class RefreshCmService { ...@@ -27,6 +27,10 @@ public class RefreshCmService {
if ((oldUnitType.contains(jyjcjg) || oldUnitType.contains(jyjg) || oldUnitType.contains(jcjg)) && !ListUtils.isEmpty(unitLicences)) { if ((oldUnitType.contains(jyjcjg) || oldUnitType.contains(jyjg) || oldUnitType.contains(jcjg)) && !ListUtils.isEmpty(unitLicences)) {
long jydwCount = unitLicences.stream().filter(e -> jyjgCode.equals(e.getCertTypeCode()) || jyjg.equals(e.getCertType())).count(); long jydwCount = unitLicences.stream().filter(e -> jyjgCode.equals(e.getCertTypeCode()) || jyjg.equals(e.getCertType())).count();
long jcdwCount = unitLicences.stream().filter(e -> jcjgCode.equals(e.getCertTypeCode()) || jcjg.equals(e.getCertType())).count(); long jcdwCount = unitLicences.stream().filter(e -> jcjgCode.equals(e.getCertTypeCode()) || jcjg.equals(e.getCertType())).count();
// 如果资质中不包含检测机构但历史的单位类型中包含检验检测机构,将此单位类型修改为检测机构
if (jcdwCount == 0 && oldUnitType.contains(jyjcjg)) {
jydwCount += 1;
}
// 如果资质中不含有检验和检测资质,则不更新单位类型 // 如果资质中不含有检验和检测资质,则不更新单位类型
if (jydwCount == 0 && jcdwCount == 0) { if (jydwCount == 0 && jcdwCount == 0) {
return oldUnitType; return oldUnitType;
......
...@@ -544,6 +544,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -544,6 +544,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
field = "newPost"; field = "newPost";
} else if (field.equals("superviseOrgName")) { } else if (field.equals("superviseOrgName")) {
field = "superviseOrgCode"; field = "superviseOrgCode";
} else if (field.equals("licensesStauts")){
field = "licenseMinExpiryDate";
} }
builder.sort(field, sort.getString("order").equals("desc") ? SortOrder.DESC : SortOrder.ASC); builder.sort(field, sort.getString("order").equals("desc") ? SortOrder.DESC : SortOrder.ASC);
} }
...@@ -566,7 +568,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -566,7 +568,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// 排序 // 排序
if (!ObjectUtils.isEmpty(filter.get("sort"))) { if (!ObjectUtils.isEmpty(filter.get("sort"))) {
JSONObject sort = JSONObject.parseObject(JSONObject.toJSONString(filter.get("sort"))); JSONObject sort = JSONObject.parseObject(JSONObject.toJSONString(filter.get("sort")));
String field = sort.getString("field").equals("permissionStatus") ? "licenses.expiryDate" : sort.getString("field") + ".keyword"; String field = sort.getString("field").equals("permissionStatus") ? "licenseMinExpiryDate" : sort.getString("field") + ".keyword";
SortOrder sortOrder = sort.getString("order").equals("desc") ? SortOrder.DESC : SortOrder.ASC; SortOrder sortOrder = sort.getString("order").equals("desc") ? SortOrder.DESC : SortOrder.ASC;
FieldSortBuilder sortBuilder = SortBuilders.fieldSort(field).order(sortOrder); FieldSortBuilder sortBuilder = SortBuilders.fieldSort(field).order(sortOrder);
builder.sort(sortBuilder); builder.sort(sortBuilder);
......
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