Commit de6b8ad1 authored by tianyiming's avatar tianyiming

修改bug

parent 5286a248
......@@ -17,9 +17,9 @@ public enum DataQualityScoreEnum {
* *设备等级
*/
I("一级(使用登记证信息齐全)","一级", "1"),
II("二级(只有设备名称和使用登记证编号)","二级", "2"),
III("三级(只有设备名称)","三级", "3");
I("一类(使用登记证信息齐全)","一类", "1"),
II("二类(只有设备名称和使用登记证编号)","二类", "2"),
III("三类(只有设备名称)","三类", "3");
private String name;
private String label;
......
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
......@@ -16,11 +17,11 @@ public enum EquipStateEnum {
* *设备状态
*/
WDJ("未登记", "0"),
// WDJ("未登记", "0"),
ZY("在用", "1"),
TY("停用", "2"),
BF("报废", "3"),
ZX("注销", "4"),
BF("报废", "3")
;
private String name;
......@@ -48,4 +49,13 @@ public enum EquipStateEnum {
}
return jsonArray;
}
public static String getNameByCode(String code) {
for (EquipStateEnum e : EnumSet.allOf(EquipStateEnum.class)) {
if(e.getCode().equals(code)){
return e.getName();
}
}
return null;
}
}
......@@ -54,7 +54,7 @@ public enum UnitTypeNewEnum {
}
public static JSONArray getUnitTypeByType(String category) {
if (ObjectUtils.isEmpty(category)) {
if (ObjectUtils.isEmpty(category) || category.equals("all")) {
return getAll();
}
JSONArray jsonArray = new JSONArray();
......
......@@ -577,7 +577,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
queryBuilder.minimumShouldMatch(1);
boolMust.must(queryBuilder);
} else if (k.equals("unitCategory")) {
if (!"".equals(v) && !ObjectUtils.isEmpty(v)) {
if (!"".equals(v) && !ObjectUtils.isEmpty(v) && !"all".equals(v)) {
String category = v.toString();
JSONArray unitTypeByType = UnitTypeNewEnum.getUnitTypeByType(category);
List<String> list = unitTypeByType.stream().map(e -> JSONObject.parseObject(JSONObject.toJSONString(e)).get("value").toString()).collect(Collectors.toList());
......@@ -888,6 +888,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
dto.put("WHETHER_VEHICLE_CYLINDER", ObjectUtils.isEmpty(dto.get("WHETHER_VEHICLE_CYLINDER")) ? "" : "1".equals(dto.get("WHETHER_VEHICLE_CYLINDER")) ? "是" : "否");
dto.put("WHETHER_SKID_MOUNTED_PRESSURE_VESSEL", ObjectUtils.isEmpty(dto.get("WHETHER_SKID_MOUNTED_PRESSURE_VESSEL")) ? "" : "1".equals(dto.get("WHETHER_SKID_MOUNTED_PRESSURE_VESSEL")) ? "是" : "否");
dto.put("whetherSphericalTank", ObjectUtils.isEmpty(dto.get("whetherSphericalTank")) ? "" : "1".equals(dto.get("whetherSphericalTank")) ? "是" : "否");
dto.put("EQU_STATE", ObjectUtils.isEmpty(dto.get("EQU_STATE")) ? null : EquipStateEnum.getNameByCode(dto.get("EQU_STATE").toString()));
list.add(dto);
}
totle = Objects.requireNonNull(response.getInternalResponse().hits().getTotalHits()).value;
......@@ -1685,9 +1686,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private static JSONArray getUnitCategory() {
JSONArray unitCategory = new JSONArray();
for (int i = 0; i < 2; i++) {
for (int i = 0; i < 3; i++) {
JSONObject object = new JSONObject();
if (0 == i) {
object.put("key", "all");
object.put("value", "all");
object.put("label", "全部");
} else if (1 == i) {
object.put("key", "use");
object.put("value", "use");
object.put("label", "使用单位");
......@@ -1841,8 +1846,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"))) : null;
String subType = params.containsKey("subType") ? params.get("subType").toString() : null;
JSONArray type = params.containsKey("type") ? JSONObject.parseArray(JSONObject.toJSONString(params.get("type"))) : new JSONArray();
String subType = params.containsKey("subType") ? params.get("subType").toString() : "";
List<String> typeList = new ArrayList<>(Arrays.asList(
"QYRYGW",
......@@ -1858,7 +1863,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
.in(DataDictionary::getType, typeList)
.list();
if (subType != null) {
if (!"".equals(subType)) {
List<DataDictionary> childrenrylx = dataDictionaryService.lambdaQuery()
.in(DataDictionary::getParent, subType)
.like(DataDictionary::getType, "QYRYGW")
......@@ -1867,11 +1872,14 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
result = deployDictionary(childrenrylx);
}
if (type != null) {
if (!ObjectUtils.isEmpty(type) && !type.contains("all")) {
try {
ArrayList<String> postDictCodeList = new ArrayList<>();
JsonNode jsonNode = new ObjectMapper().readTree(unitTypeLimitUserType.getInputStream());
type.forEach(unitType -> {
if (unitType.equals("企业")) {
unitType = "使用单位";
}
JsonNode companyTypeNode = jsonNode.get(unitType.toString());
if (companyTypeNode != null && companyTypeNode.isObject()) {
Iterator<Map.Entry<String, JsonNode>> fields = companyTypeNode.fields();
......@@ -1890,7 +1898,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
if (subType == null && type == null) {
if ("".equals(subType) && (ObjectUtils.isEmpty(type) || type.contains("all"))) {
result = deployDictionary(allPost);
}
......
......@@ -404,6 +404,21 @@
"value": "4000"
},
{
"key": "144",
"label": "客运索道",
"value": "9000"
},
{
"key": "80",
"label": "大型游乐设施",
"value": "6000"
},
{
"key": "76",
"label": "场(厂)内专用机动车辆",
"value": "5000"
},
{
"key": "1",
"label": "锅炉",
"value": "1000"
......@@ -417,21 +432,6 @@
"key": "133",
"label": "压力管道",
"value": "8000"
},
{
"key": "80",
"label": "大型游乐设施",
"value": "6000"
},
{
"key": "144",
"label": "客运索道",
"value": "9000"
},
{
"key": "76",
"label": "场(厂)内专用机动车辆",
"value": "5000"
}
]
}
\ No newline at end of file
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