Commit 546aefd3 authored by tangwei's avatar tangwei

修改扫描bug

parent 5b66aa10
...@@ -16,11 +16,11 @@ public class IndexLogsRequest { ...@@ -16,11 +16,11 @@ public class IndexLogsRequest {
private String timeEnd; private String timeEnd;
private String fieldKey; private String fieldKey;
private String equipmentIndex; private String equipmentIndex;
private Long page; private long page;
private Long total; private long total;
private Long size; private long size;
public IndexLogsRequest( String timeStart, String timeEnd, String equipmentIndex, Long page, Long size) { public IndexLogsRequest( String timeStart, String timeEnd, String equipmentIndex, long page, long size) {
this.timeStart = timeStart; this.timeStart = timeStart;
this.timeEnd = timeEnd; this.timeEnd = timeEnd;
this.equipmentIndex = equipmentIndex; this.equipmentIndex = equipmentIndex;
......
package com.yeejoin.equipmanage.fegin; package com.yeejoin.equipmanage.fegin;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.entity.dto.IndexLogsRequest; import com.yeejoin.equipmanage.common.entity.dto.IndexLogsRequest;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -71,5 +72,5 @@ public interface IotFeign { ...@@ -71,5 +72,5 @@ public interface IotFeign {
@RequestMapping(value = "v1/livedata/index/logs", method = RequestMethod.POST, consumes = "application/json") @RequestMapping(value = "v1/livedata/index/logs", method = RequestMethod.POST, consumes = "application/json")
ResponseModel<List<Map<String ,Object>>> getEquipAlarmLog( @RequestBody IndexLogsRequest indexLogsRequest ); ResponseModel<Map<String ,Object>> getEquipAlarmLog(@RequestBody IndexLogsRequest indexLogsRequest );
} }
...@@ -119,18 +119,19 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS ...@@ -119,18 +119,19 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
endTime= endTime.replace("00:00:00","23:59:59"); endTime= endTime.replace("00:00:00","23:59:59");
IndexLogsRequest indexLogsRequest=new IndexLogsRequest( startTime, endTime, iotCode, current, pageSize); IndexLogsRequest indexLogsRequest=new IndexLogsRequest( startTime, endTime, "YJ210093SBMC0001FHS_FirePump_PowerRunStatus", current, pageSize);
//调用iot 获取数据 //调用iot 获取数据
ResponseModel<List<Map<String, Object>>> date = iotFeign.getEquipAlarmLog(indexLogsRequest); ResponseModel<Map<String, Object>> date = iotFeign.getEquipAlarmLog(indexLogsRequest);
if (date.getStatus() != 200 ) { if (date.getStatus() != 200 ) {
throw new BadRequest("系统错误!"); throw new BadRequest("系统错误!");
} }
List<Map<String, Object>> listObject = date.getResult(); Map<String, Object> listObject = date.getResult();
if (listObject != null) { if (listObject != null) {
List<Map<String, Object>> listObjectdate=( List<Map<String, Object>>)listObject.get("records");
//数据处理 //数据处理
for (Map<String, Object> map : listObject) { for (Map<String, Object> map : listObjectdate) {
//过滤告警 //过滤告警
String key=map.get("iotCode").toString()+map.get("indexName"); String key=map.get("iotCode").toString()+map.get("indexName");
if(mapkey.containsKey(key)){ if(mapkey.containsKey(key)){
...@@ -145,11 +146,17 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS ...@@ -145,11 +146,17 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
} }
} }
} }
pageBean.setTotal(listDate.size());
pageBean.setRecords(listDate); pageBean.setRecords(listDate);
//由于iot 分页 ,没有数据时返回int,有数据时返回字符串,还是Double类型字符串,需统一处理。
Double tot= Double.valueOf(listObject.get("total").toString());
pageBean.setTotal(tot.intValue());
return pageBean; return pageBean;
} }
public String getReadableStatus(String value ) { public String getReadableStatus(String value ) {
if("true".equals(value)){ if("true".equals(value)){
return "是"; return "是";
......
...@@ -20,7 +20,7 @@ public class DispatchMapServiceImpl implements IHomePageService { ...@@ -20,7 +20,7 @@ public class DispatchMapServiceImpl implements IHomePageService {
//实现首页dispatchMap //实现首页dispatchMap
@Autowired @Autowired
AlertCalledMapper alertCalledMapper; AlertCalledMapper alertCalledMapper;
private static AlertCalledMapper alertCalledMapper1; private AlertCalledMapper alertCalledMapper1;
@PostConstruct @PostConstruct
public void init(){ public void init(){
......
...@@ -19,7 +19,7 @@ public class DispatchTaskServiceImpl implements IHomePageService { ...@@ -19,7 +19,7 @@ public class DispatchTaskServiceImpl implements IHomePageService {
//实现首页dispatchMap //实现首页dispatchMap
@Autowired @Autowired
AlertCalledMapper alertCalledMapper; AlertCalledMapper alertCalledMapper;
private static AlertCalledMapper alertCalledMapper1; private AlertCalledMapper alertCalledMapper1;
@PostConstruct @PostConstruct
public void init(){ public void init(){
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -8,6 +9,7 @@ import java.util.List; ...@@ -8,6 +9,7 @@ import java.util.List;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
...@@ -33,6 +35,8 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; ...@@ -33,6 +35,8 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.ESAlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.ESAlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository; import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
/** /**
* *
* <pre> * <pre>
...@@ -56,7 +60,8 @@ public class ESAlertCalledService { ...@@ -56,7 +60,8 @@ public class ESAlertCalledService {
@Value("${alertcall.es.synchrony.time}") @Value("${alertcall.es.synchrony.time}")
private Long time; private Long time;
private static final String CALLTIMELONG="callTimeLong";
@PostConstruct @PostConstruct
public void init() throws Exception public void init() throws Exception
...@@ -68,7 +73,7 @@ public class ESAlertCalledService { ...@@ -68,7 +73,7 @@ public class ESAlertCalledService {
/** /**
* 重建索引 * 重建索引
*/ */
public Boolean initEs() throws Exception { public Boolean initEs() {
esAlertCalledRepository.deleteAll(); esAlertCalledRepository.deleteAll();
/** /**
* 同步历史48小时以内的警情处置记录 * 同步历史48小时以内的警情处置记录
...@@ -91,10 +96,7 @@ public class ESAlertCalledService { ...@@ -91,10 +96,7 @@ public class ESAlertCalledService {
List<AlertCalled> alertCalleds = alertCalledService.list(wrapper); List<AlertCalled> alertCalleds = alertCalledService.list(wrapper);
if (!ValidationUtil.isEmpty(alertCalleds)) if (!ValidationUtil.isEmpty(alertCalleds))
{ {
// for (AlertCalled alertCalled : alertCalleds)
// {
// saveAlertCalledToES(alertCalled);
// }
saveAlertCalledToES(alertCalleds); saveAlertCalledToES(alertCalleds);
} }
...@@ -108,9 +110,9 @@ public class ESAlertCalledService { ...@@ -108,9 +110,9 @@ public class ESAlertCalledService {
* 批量保存 * 批量保存
* </pre> * </pre>
* *
* @param list 警情信息列表 * @param
*/ */
public void saveAll(List<AlertCalled> alertCalleds) throws Exception{ public void saveAll(List<AlertCalled> alertCalleds) {
if (!ValidationUtil.isEmpty(alertCalleds)) if (!ValidationUtil.isEmpty(alertCalleds))
{ {
...@@ -127,9 +129,9 @@ public class ESAlertCalledService { ...@@ -127,9 +129,9 @@ public class ESAlertCalledService {
* 根据警情记录批量保存 * 根据警情记录批量保存
* </pre> * </pre>
* *
* @param alertCalleds 警情信息列表 * @param
*/ */
public ESAlertCalled saveAlertCalledToES(AlertCalled alertCalled) throws Exception public ESAlertCalled saveAlertCalledToES(AlertCalled alertCalled)
{ {
ESAlertCalled esAlertCalled = new ESAlertCalled(); ESAlertCalled esAlertCalled = new ESAlertCalled();
esAlertCalled.setSequenceNbr(alertCalled.getSequenceNbr()); esAlertCalled.setSequenceNbr(alertCalled.getSequenceNbr());
...@@ -146,7 +148,11 @@ public class ESAlertCalledService { ...@@ -146,7 +148,11 @@ public class ESAlertCalledService {
esAlertCalled.setFlightNumber(alertCalled.getFlightNumber()); esAlertCalled.setFlightNumber(alertCalled.getFlightNumber());
if(alertCalled.getLandingTime() != null ){ if(alertCalled.getLandingTime() != null ){
Date date = new Date(); Date date = new Date();
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(alertCalled.getLandingTime()); try {
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(alertCalled.getLandingTime());
} catch (ParseException e) {
throw new BadRequest("系统异常");
}
esAlertCalled.setLandingTime(date.getTime()); esAlertCalled.setLandingTime(date.getTime());
} }
if (alertCalled.getAlertStatus()) if (alertCalled.getAlertStatus())
...@@ -167,7 +173,7 @@ public class ESAlertCalledService { ...@@ -167,7 +173,7 @@ public class ESAlertCalledService {
} }
public List<ESAlertCalled> saveAlertCalledToES(List<AlertCalled> alertCalleds) throws Exception public List<ESAlertCalled> saveAlertCalledToES(List<AlertCalled> alertCalleds)
{ {
List<ESAlertCalled> list1=new ArrayList<>(); List<ESAlertCalled> list1=new ArrayList<>();
for (AlertCalled alertCalled : alertCalleds) for (AlertCalled alertCalled : alertCalleds)
...@@ -214,7 +220,7 @@ public class ESAlertCalledService { ...@@ -214,7 +220,7 @@ public class ESAlertCalledService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public Boolean deleteById(List<Long> ids) throws Exception{ public Boolean deleteById(List<Long> ids){
if (!ValidationUtil.isEmpty(ids)) { if (!ValidationUtil.isEmpty(ids)) {
for (Long sequenceNbr : ids) { for (Long sequenceNbr : ids) {
if (esAlertCalledRepository.existsById(sequenceNbr)) { if (esAlertCalledRepository.existsById(sequenceNbr)) {
...@@ -239,7 +245,7 @@ public class ESAlertCalledService { ...@@ -239,7 +245,7 @@ public class ESAlertCalledService {
/** /**
* 根据关键字查询文档,关键字不为空时按相关性从大到小排序 * 根据关键字查询文档,关键字不为空时按相关性从大到小排序
* *
* @param queryStr 关键字 * @param
* @param current 当前页码 * @param current 当前页码
* @param size 页面大小 * @param size 页面大小
* @return * @return
...@@ -281,7 +287,7 @@ public class ESAlertCalledService { ...@@ -281,7 +287,7 @@ public class ESAlertCalledService {
long currentTime = System.currentTimeMillis() ; long currentTime = System.currentTimeMillis() ;
currentTime = currentTime - 30*60*1000; currentTime = currentTime - 30*60*1000;
BoolQueryBuilder qb1 = QueryBuilders.boolQuery() BoolQueryBuilder qb1 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime)); .must(QueryBuilders.rangeQuery(CALLTIMELONG).gte(currentTime));
boolMust.should(qb1); boolMust.should(qb1);
//报警人及报警电话一致 //报警人及报警电话一致
if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone())) if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone()))
...@@ -354,7 +360,7 @@ public class ESAlertCalledService { ...@@ -354,7 +360,7 @@ public class ESAlertCalledService {
//过滤条件 //过滤条件
.withQuery(boolMustAll) .withQuery(boolMustAll)
// 排序 // 排序
.withSort(SortBuilders.fieldSort("callTimeLong").order(SortOrder.DESC)) .withSort(SortBuilders.fieldSort(CALLTIMELONG).order(SortOrder.DESC))
// 分页 // 分页
.withPageable(PageRequest.of(current, size)) .withPageable(PageRequest.of(current, size))
; ;
...@@ -367,8 +373,8 @@ public class ESAlertCalledService { ...@@ -367,8 +373,8 @@ public class ESAlertCalledService {
for (SearchHit searchHit : searchHits.getSearchHits()) for (SearchHit searchHit : searchHits.getSearchHits())
{ {
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(searchHit.getContent()); JSONObject jsonObject = (JSONObject) JSON.toJSON(searchHit.getContent());
ESAlertCalledDto eSAlertCalled =JSONObject.toJavaObject(jsonObject, ESAlertCalledDto.class); ESAlertCalledDto eSAlertCalled = JSON.toJavaObject(jsonObject, ESAlertCalledDto.class);
list.add(eSAlertCalled); list.add(eSAlertCalled);
} }
totle =searchHits.getTotalHits(); totle =searchHits.getTotalHits();
...@@ -419,7 +425,7 @@ public class ESAlertCalledService { ...@@ -419,7 +425,7 @@ public class ESAlertCalledService {
long currentTime = System.currentTimeMillis() ; long currentTime = System.currentTimeMillis() ;
currentTime = currentTime - 30*60*1000; currentTime = currentTime - 30*60*1000;
BoolQueryBuilder qb1 = QueryBuilders.boolQuery() BoolQueryBuilder qb1 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime)); .must(QueryBuilders.rangeQuery(CALLTIMELONG).gte(currentTime));
boolMust.should(qb1); boolMust.should(qb1);
//报警人及报警电话一致 //报警人及报警电话一致
if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone())) if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone()))
...@@ -439,7 +445,6 @@ public class ESAlertCalledService { ...@@ -439,7 +445,6 @@ public class ESAlertCalledService {
//警情类型一致 //警情类型一致
BoolQueryBuilder qb4 = QueryBuilders.boolQuery() BoolQueryBuilder qb4 = QueryBuilders.boolQuery()
.must(QueryBuilders.termQuery("alertTypeCode.keyword", alertCalled.getAlertTypeCode())); .must(QueryBuilders.termQuery("alertTypeCode.keyword", alertCalled.getAlertTypeCode()));
//boolMust.should(qb4);
//事发单位名称一致 //事发单位名称一致
if (!ValidationUtil.isEmpty(alertCalled.getUnitInvolved())) if (!ValidationUtil.isEmpty(alertCalled.getUnitInvolved()))
{ {
...@@ -465,7 +470,7 @@ public class ESAlertCalledService { ...@@ -465,7 +470,7 @@ public class ESAlertCalledService {
// 分页 // 分页
.withPageable(PageRequest.of(current, size)) .withPageable(PageRequest.of(current, size))
// 排序 // 排序
.withSort(SortBuilders.fieldSort("callTimeLong").order(SortOrder.DESC)) .withSort(SortBuilders.fieldSort(CALLTIMELONG).order(SortOrder.DESC))
//过滤条件 //过滤条件
.withQuery(boolMustAll) .withQuery(boolMustAll)
; ;
...@@ -479,8 +484,8 @@ public class ESAlertCalledService { ...@@ -479,8 +484,8 @@ public class ESAlertCalledService {
for (SearchHit searchHit : searchHits.getSearchHits()) for (SearchHit searchHit : searchHits.getSearchHits())
{ {
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(searchHit.getContent()); JSONObject jsonObject = (JSONObject) JSON.toJSON(searchHit.getContent());
ESAlertCalledDto eSAlertCalled =JSONObject.toJavaObject(jsonObject, ESAlertCalledDto.class); ESAlertCalledDto eSAlertCalled =JSON.toJavaObject(jsonObject, ESAlertCalledDto.class);
list.add(eSAlertCalled); list.add(eSAlertCalled);
} }
totle =searchHits.getTotalHits(); totle =searchHits.getTotalHits();
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto; import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
...@@ -64,10 +65,10 @@ public class ESCarService implements IESCarService { ...@@ -64,10 +65,10 @@ public class ESCarService implements IESCarService {
{ {
SearchHits<ESCar> searchHits =elasticsearchTemplate.search(queryBuilder.build(), ESCar.class); SearchHits<ESCar> searchHits =elasticsearchTemplate.search(queryBuilder.build(), ESCar.class);
for (SearchHit searchHit : searchHits.getSearchHits()) for (SearchHit<ESCar> searchHit : searchHits.getSearchHits())
{ {
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(searchHit.getContent()); JSONObject jsonObject = (JSONObject) JSON.toJSON(searchHit.getContent());
ESCar eSCar =JSONObject.toJavaObject(jsonObject, ESCar.class); ESCar eSCar = JSON.toJavaObject(jsonObject, ESCar.class);
list.add(eSCar); list.add(eSCar);
} }
...@@ -77,8 +78,11 @@ public class ESCarService implements IESCarService { ...@@ -77,8 +78,11 @@ public class ESCarService implements IESCarService {
e.printStackTrace(); e.printStackTrace();
} }
if(list.size()>0){
return list.get(0);
}
return list!=null&&list.size()>0?list.get(0):null; return null;
} }
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -50,9 +51,10 @@ public class EquipmentServiceImpl { ...@@ -50,9 +51,10 @@ public class EquipmentServiceImpl {
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
private static final String CHILDREN="children";
public List<MenuFrom> getFireSystemList() { public List<MenuFrom> getFireSystemList() {
// 导出模板增加权限
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule("fire_water_info"); PermissionInterceptorContext.setDataAuthRule("fire_water_info");
ResponseModel<Object> response = equipFeignClient.getFireSystemListAll(); ResponseModel<Object> response = equipFeignClient.getFireSystemListAll();
...@@ -71,14 +73,13 @@ public class EquipmentServiceImpl { ...@@ -71,14 +73,13 @@ public class EquipmentServiceImpl {
stopWatch.start(); stopWatch.start();
ResponseModel<Object> response = equipFeignClient.getBuildingTree(); ResponseModel<Object> response = equipFeignClient.getBuildingTree();
stopWatch.stop(); stopWatch.stop();
System.out.printf("耗时%f秒/n", stopWatch.getTotalTimeSeconds());
List<Map<String, Object>> buildingMapList = (List<Map<String, Object>>) response.getResult(); List<Map<String, Object>> buildingMapList = (List<Map<String, Object>>) response.getResult();
List<MenuFrom> buildingTreeList = Lists.newArrayList(); List<MenuFrom> buildingTreeList = Lists.newArrayList();
buildingMapList.forEach(building -> { buildingMapList.forEach(building -> {
MenuFrom menuFrom = new MenuFrom((String) building.get("id"), "全部建筑", (String) building.get("parentId"), MenuFrom menuFrom = new MenuFrom((String) building.get("id"), "全部建筑", (String) building.get("parentId"),
"0"); "0");
List<Map<String, Object>> children = (List<Map<String, Object>>) building.get("children"); List<Map<String, Object>> children = (List<Map<String, Object>>) building.get(CHILDREN);
menuFrom.setChildren(parseTree(menuFrom, children)); menuFrom.setChildren(parseTree(menuFrom, children));
menuFrom.setIsLeaf(false); menuFrom.setIsLeaf(false);
buildingTreeList.add(menuFrom); buildingTreeList.add(menuFrom);
...@@ -92,8 +93,8 @@ public class EquipmentServiceImpl { ...@@ -92,8 +93,8 @@ public class EquipmentServiceImpl {
children.forEach(child -> { children.forEach(child -> {
MenuFrom menuFrom = new MenuFrom((String) child.get("id"), (String) child.get("name"), MenuFrom menuFrom = new MenuFrom((String) child.get("id"), (String) child.get("name"),
(String) child.get("parentId"), "0"); (String) child.get("parentId"), "0");
if (!ValidationUtil.isEmpty(child.get("children"))) { if (!ValidationUtil.isEmpty(child.get(CHILDREN))) {
parseTree(menuFrom, (List<Map<String, Object>>) child.get("children")); parseTree(menuFrom, (List<Map<String, Object>>) child.get(CHILDREN));
if(parent!=null){ if(parent!=null){
parent.setIsLeaf(false); parent.setIsLeaf(false);
} }
......
...@@ -19,7 +19,7 @@ public class FaultServiceImpl implements IHomePageService { ...@@ -19,7 +19,7 @@ public class FaultServiceImpl implements IHomePageService {
@Autowired @Autowired
EquipFeignClient quipFeignClient; EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1; private EquipFeignClient quipFeignClient1;
@PostConstruct @PostConstruct
public void init(){ public void init(){
......
...@@ -20,7 +20,7 @@ public class FireAlarmServiceImpl implements IHomePageService { ...@@ -20,7 +20,7 @@ public class FireAlarmServiceImpl implements IHomePageService {
@Autowired @Autowired
EquipFeignClient quipFeignClient; EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1; private EquipFeignClient quipFeignClient1;
@PostConstruct @PostConstruct
public void init(){ public void init(){
......
...@@ -39,7 +39,7 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke ...@@ -39,7 +39,7 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke
@Override @Override
public ResponseModel<Page<Object>> getAirEquipSpecificPage(EquipSpecificDto equipSpecificDto, int current, int size) { public ResponseModel<Page<Object>> getAirEquipSpecificPage(EquipSpecificDto equipSpecificDto, int current, int size) {
Page page = new Page(current, size); Page<Object> page = new Page<Object>(current, size);
equipSpecificDto.setPage(page); equipSpecificDto.setPage(page);
ResponseModel<Page<Object>> airEquipSpecificPage = equipFeignClient.getAirEquipSpecificPage(equipSpecificDto); ResponseModel<Page<Object>> airEquipSpecificPage = equipFeignClient.getAirEquipSpecificPage(equipSpecificDto);
return airEquipSpecificPage; return airEquipSpecificPage;
......
...@@ -42,7 +42,7 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD ...@@ -42,7 +42,7 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD
@Override @Override
public ResponseModel<Page<Object>> getAirEquipSpecificPage(EquipSpecificDto equipSpecificDto, int current, int size) { public ResponseModel<Page<Object>> getAirEquipSpecificPage(EquipSpecificDto equipSpecificDto, int current, int size) {
Page page = new Page(current, size); Page<Object> page = new Page<Object>(current, size);
equipSpecificDto.setPage(page); equipSpecificDto.setPage(page);
ResponseModel<Page<Object>> airEquipSpecificPage = equipFeignClient.getAirEquipSpecificPage(equipSpecificDto); ResponseModel<Page<Object>> airEquipSpecificPage = equipFeignClient.getAirEquipSpecificPage(equipSpecificDto);
return airEquipSpecificPage; return airEquipSpecificPage;
......
...@@ -26,6 +26,8 @@ public class FusionServiceImpl implements IFusionService { ...@@ -26,6 +26,8 @@ public class FusionServiceImpl implements IFusionService {
@Value("${ifc.url}") @Value("${ifc.url}")
private String voiceURL; private String voiceURL;
private static String LOGD="访问融合终端失败";
@Override @Override
public JSONObject getAllOnlineUser() { public JSONObject getAllOnlineUser() {
JSONObject jsonObject = null; JSONObject jsonObject = null;
...@@ -33,7 +35,7 @@ public class FusionServiceImpl implements IFusionService { ...@@ -33,7 +35,7 @@ public class FusionServiceImpl implements IFusionService {
jsonObject = RestTemplateUtil.getRestInstance().getForObject(String.format("%s/GetAllOnlineUser", voiceURL), JSONObject.class); jsonObject = RestTemplateUtil.getRestInstance().getForObject(String.format("%s/GetAllOnlineUser", voiceURL), JSONObject.class);
} catch (RestClientException e) { } catch (RestClientException e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("访问融合终端失败"); throw new BadRequest(LOGD);
} }
return jsonObject; return jsonObject;
} }
...@@ -46,7 +48,7 @@ public class FusionServiceImpl implements IFusionService { ...@@ -46,7 +48,7 @@ public class FusionServiceImpl implements IFusionService {
jsonObject = RestTemplateUtil.getRestInstance().getForObject(url, JSONObject.class); jsonObject = RestTemplateUtil.getRestInstance().getForObject(url, JSONObject.class);
} catch (RestClientException e) { } catch (RestClientException e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("访问融合终端失败"); throw new BadRequest(LOGD);
} }
return jsonObject; return jsonObject;
} }
...@@ -60,7 +62,7 @@ public class FusionServiceImpl implements IFusionService { ...@@ -60,7 +62,7 @@ public class FusionServiceImpl implements IFusionService {
jsonObject = RestTemplateUtil.getRestInstance().postForObject(String.format("%s/GetGISByEmployeeID", voiceURL), requestEntity, JSONObject.class); jsonObject = RestTemplateUtil.getRestInstance().postForObject(String.format("%s/GetGISByEmployeeID", voiceURL), requestEntity, JSONObject.class);
} catch (RestClientException e) { } catch (RestClientException e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("访问融合终端失败"); throw new BadRequest(LOGD);
} }
return getResult(jsonObject); return getResult(jsonObject);
} }
...@@ -75,7 +77,7 @@ public class FusionServiceImpl implements IFusionService { ...@@ -75,7 +77,7 @@ public class FusionServiceImpl implements IFusionService {
jsonObject = RestTemplateUtil.getRestInstance().postForObject(String.format("%s/GetCallRecordByNumber", voiceURL), requestEntity, JSONObject.class); jsonObject = RestTemplateUtil.getRestInstance().postForObject(String.format("%s/GetCallRecordByNumber", voiceURL), requestEntity, JSONObject.class);
} catch (RestClientException e) { } catch (RestClientException e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("访问融合终端失败"); throw new BadRequest(LOGD);
} }
return getResult(jsonObject); return getResult(jsonObject);
} }
...@@ -89,7 +91,7 @@ public class FusionServiceImpl implements IFusionService { ...@@ -89,7 +91,7 @@ public class FusionServiceImpl implements IFusionService {
jsonObject = RestTemplateUtil.getRestInstance().postForObject(String.format("%s/GetCallRecordByCID", voiceURL), requestEntity, JSONObject.class); jsonObject = RestTemplateUtil.getRestInstance().postForObject(String.format("%s/GetCallRecordByCID", voiceURL), requestEntity, JSONObject.class);
} catch (RestClientException e) { } catch (RestClientException e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("访问融合终端失败"); throw new BadRequest(LOGD);
} }
return getResult(jsonObject); return getResult(jsonObject);
} }
...@@ -142,7 +144,7 @@ public class FusionServiceImpl implements IFusionService { ...@@ -142,7 +144,7 @@ public class FusionServiceImpl implements IFusionService {
jsonObject = RestTemplateUtil.getRestInstance().postForObject(String.format("%s/selectCallRecordByConditions", voiceURL), requestEntity, JSONObject.class); jsonObject = RestTemplateUtil.getRestInstance().postForObject(String.format("%s/selectCallRecordByConditions", voiceURL), requestEntity, JSONObject.class);
} catch (RestClientException e) { } catch (RestClientException e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("访问融合终端失败"); throw new BadRequest(LOGD);
} }
return jsonObject; return jsonObject;
} }
...@@ -153,7 +155,7 @@ public class FusionServiceImpl implements IFusionService { ...@@ -153,7 +155,7 @@ public class FusionServiceImpl implements IFusionService {
public Map<String, String> getResult(JSONObject jsonObject) { public Map<String, String> getResult(JSONObject jsonObject) {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
if (ValidationUtil.isEmpty(jsonObject)) { if (ValidationUtil.isEmpty(jsonObject)) {
throw new BadRequest("访问融合终端失败"); throw new BadRequest(LOGD);
} }
if (jsonObject.get("data") instanceof Map) { if (jsonObject.get("data") instanceof Map) {
JSONObject data = jsonObject.getJSONObject("data"); JSONObject data = jsonObject.getJSONObject("data");
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
find_in_set(#{systemId},spe.system_id) and spe.single = true and wlsd.`status` = 1 find_in_set(#{systemId},spe.system_id) and spe.single = true and wlsd.`status` = 1
</select> </select>
<select id="getEquiplistBySystemIdList" resultMap="EquiplistBySystemId"> <select id="getEquiplistBySystemIdList" resultType="com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO">
SELECT SELECT
det.`name` equipmentName, det.`name` equipmentName,
spe.`iot_code` iotCode, spe.`iot_code` iotCode,
......
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