Commit cf9823f8 authored by tianyiming's avatar tianyiming

设备列表修改

parent 809648fa
......@@ -167,4 +167,10 @@ public class ESEquipmentCategoryDto {
@Field(type = FieldType.Keyword)
private String PROJECT_CONTRAPTION;
/**
* 信息化
*/
@Field(type = FieldType.Text)
private String INFORMATION_SITUATION;
}
package com.yeejoin.amos.boot.module.statistics.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.*;
@AllArgsConstructor
@Getter
public enum InformationManageTypeEnum {
/**
* 信息化管理情况枚举
*/
TYPE_QR_CODE("1", "二维码"),
TYPE_STAMP("2", "电子标签"),
TYPE_NO("99", "无");
private String code;
private String name;
public static String getName(String code) {
Optional<String> op = Arrays.stream(InformationManageTypeEnum.values()).filter(e -> e.getCode().equals(code)).map(InformationManageTypeEnum::getName).findFirst();
return op.orElse("");
}
public static List<Map<String, Object>> getEnumList() {
List<Map<String, Object>> list = new ArrayList<>();
for (InformationManageTypeEnum testEnum : EnumSet.allOf(InformationManageTypeEnum.class)) {
HashMap<String, Object> map = new HashMap<>();
map.put("name", testEnum.name);
map.put("code", testEnum.code);
list.add(map);
}
return list;
}
}
......@@ -126,12 +126,19 @@ public class ZLDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/updateEquipInfo")
@ApiOperation(httpMethod = "POST", value = "更新es设备信息化字段", notes = "更新es设备信息化字段")
@GetMapping(value = "/updateEquipInfo")
@ApiOperation(httpMethod = "GET", value = "更新es设备信息化字段", notes = "更新es设备信息化字段")
public ResponseModel<Object> updateEquipInfo() {
return ResponseHelper.buildResponse(statisticsService.updateEquipInfo());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取信息化下拉接口", notes = "获取信息化下拉接口")
@GetMapping(value = "/getInformationManageType")
public ResponseModel<List<Map<String, Object>>> getInformationManageType() {
return ResponseHelper.buildResponse(statisticsService.getInformationManageType());
}
/**
* 根据设备种类code获取设备类别下拉
*
......
......@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.AlertStatistics;
import com.yeejoin.amos.boot.module.common.api.enums.UnitTypeEnum;
import com.yeejoin.amos.boot.module.common.api.enums.UserPostEnum;
import com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.statistics.api.enums.InformationManageTypeEnum;
import com.yeejoin.amos.boot.module.statistics.api.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.ZLStatisticsMapper;
......@@ -79,6 +80,8 @@ public class ZLDPStatisticsServiceImpl {
// 设备纳管 纳管:true 未纳管:false
public static final String IS_INTO_MANAGEMENT = "IS_INTO_MANAGEMENT";
// 信信息化管理情况:1-二维码;2-电子标签;99-无
public static final String INFORMATION_SITUATION = "INFORMATION_SITUATION";
@Value("classpath:/json/equipCategory.json")
private Resource equipCategory;
......@@ -884,10 +887,10 @@ public class ZLDPStatisticsServiceImpl {
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("INFORMATION_SITUATION"))) {
if (!ObjectUtils.isEmpty(map.getString(INFORMATION_SITUATION))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString("INFORMATION_SITUATION"));
meBuilder.must(QueryBuilders.matchPhraseQuery("INFORMATION_SITUATION", "*" + test + "*"));
String test = QueryParser.escape(map.getString(INFORMATION_SITUATION));
meBuilder.must(QueryBuilders.matchPhraseQuery(INFORMATION_SITUATION, "*" + test + "*"));
boolMust.must(meBuilder);
}
......@@ -942,6 +945,10 @@ public class ZLDPStatisticsServiceImpl {
String status = EquimentEnum.getName.get(integer);
dto2.put(EQU_STATE, status);
}
if (!ValidationUtil.isEmpty(dto2.get(INFORMATION_SITUATION))) {
String informationSituation = InformationManageTypeEnum.getName(dto2.get(INFORMATION_SITUATION).toString());
dto2.put(INFORMATION_SITUATION, informationSituation);
}
list.add(dto2);
}
totle = response.getInternalResponse().hits().getTotalHits().value;
......@@ -1115,7 +1122,7 @@ public class ZLDPStatisticsServiceImpl {
if (idxBizJgOtherInfoPage.getTotal() > 0) {
idxBizJgOtherInfoPage.getRecords().forEach(e->{
Map<String,Object> map = new HashMap<>();
map.put("INFORMATION_SITUATION", e.getInformationSituation());
map.put(INFORMATION_SITUATION, e.getInformationSituation());
updataMap.put(e.getRecord(), map);
});
}
......@@ -1123,4 +1130,8 @@ public class ZLDPStatisticsServiceImpl {
}
return "信息化字段更新完成";
}
public List<Map<String, Object>> getInformationManageType() {
return InformationManageTypeEnum.getEnumList();
}
}
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