Commit 5b1bef51 authored by chenzhao's avatar chenzhao

手动同步16bug修复代码

parent 087b24ba
...@@ -154,4 +154,16 @@ public class AlertCalled extends BaseEntity { ...@@ -154,4 +154,16 @@ public class AlertCalled extends BaseEntity {
private String systemSourceCode; private String systemSourceCode;
@ApiModelProperty(value = "物联报警关联Id") @ApiModelProperty(value = "物联报警关联Id")
private String relationId; private String relationId;
@TableField(exist=false)
@ApiModelProperty(value = "航班号")
private String forcedLandingTrack;
@TableField(exist=false)
@ApiModelProperty(value = "迫降跑道")
private String flightNumber;
@TableField(exist=false)
@ApiModelProperty(value = "落地时间")
private String landingTime;
} }
...@@ -96,4 +96,24 @@ public class ESAlertCalled { ...@@ -96,4 +96,24 @@ public class ESAlertCalled {
*/ */
private Double coordinateY; private Double coordinateY;
/**
* 落地时间
*/
@Field(type = FieldType.Long)
private Long landingTime;
/**
*航班号
*/
@Field(type = FieldType.Text)
private String forcedLandingTrack;
/**
*迫降跑道
*/
@Field(type = FieldType.Text)
private String flightNumber;
} }
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
and a.alert_source_code = #{alertSourceCode} and a.alert_source_code = #{alertSourceCode}
</if> </if>
<if test="systemSourceCode!= null "> <if test="systemSourceCode!= null ">
and a.system_source_code in (${systemSourceCode}) and a.system_source_code in (#{systemSourceCode})
</if> </if>
<if test="isFatherAlert != null and isFatherAlert == 'true' "> <if test="isFatherAlert != null and isFatherAlert == 'true' ">
and j.alert_called_id = a.sequence_nbr and j.alert_called_id = a.sequence_nbr
...@@ -448,7 +448,7 @@ ...@@ -448,7 +448,7 @@
and a.alert_source_code = #{alertSourceCode} and a.alert_source_code = #{alertSourceCode}
</if> </if>
<if test="systemSourceCode!= null "> <if test="systemSourceCode!= null ">
and a.system_source_code in (${systemSourceCode}) and a.system_source_code in (#{systemSourceCode})
</if> </if>
<if test="isFatherAlert!= null and isFatherAlert == 'true' "> <if test="isFatherAlert!= null and isFatherAlert == 'true' ">
and j.alert_called_id = a.sequence_nbr and j.alert_called_id = a.sequence_nbr
......
...@@ -155,7 +155,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -155,7 +155,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return map1.get("deptId").toString().compareTo(map2.get("deptId").toString()); return map1.get("deptId").toString().compareTo(map2.get("deptId").toString());
} }
}else { }else {
return map1.get("companyId").toString().compareTo(map2.get("companyId").toString()); return map2.get("companyId").toString().compareTo(map1.get("companyId").toString());
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} catch (Exception e) { } catch (Exception e) {
...@@ -668,7 +668,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -668,7 +668,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return map1.get("deptId").toString().compareTo(map2.get("deptId").toString()); return map1.get("deptId").toString().compareTo(map2.get("deptId").toString());
} }
}else { }else {
return map1.get("companyId").toString().compareTo(map2.get("companyId").toString()); return map2.get("companyId").toString().compareTo(map1.get("companyId").toString());
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} catch (Exception e) { } catch (Exception e) {
......
...@@ -28,6 +28,7 @@ import com.yeejoin.amos.boot.module.common.api.enums.WaterResourceTypeEnum; ...@@ -28,6 +28,7 @@ import com.yeejoin.amos.boot.module.common.api.enums.WaterResourceTypeEnum;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.WaterResourceMapper; import com.yeejoin.amos.boot.module.common.api.mapper.WaterResourceMapper;
import com.yeejoin.amos.boot.module.common.api.service.IWaterResourceService; import com.yeejoin.amos.boot.module.common.api.service.IWaterResourceService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -406,6 +407,18 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -406,6 +407,18 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
}else { }else {
detail.put("num", 0); detail.put("num", 0);
} }
if (ObjectUtils.isNotEmpty( detail.getJSONArray("children"))){
JSONArray children = detail.getJSONArray("children");
for (Object child : children) {
JSONObject childDetail = JSONObject.parseObject(JSONObject.toJSONString(child));
String codeStrChild = childDetail.getString("code");
if(map!=null && map.containsKey(codeStrChild)) {
int parentNum = Integer.parseInt(detail.get("num").toString());
int sum = parentNum+Integer.parseInt( map.get(codeStrChild).toString());
detail.put("num", sum);
}
}
}
// if ("93060100".equals(codeStr) && map.containsKey("pool") // if ("93060100".equals(codeStr) && map.containsKey("pool")
// ) { // ) {
// num = num + Integer.parseInt(map.get("pool").toString()); // num = num + Integer.parseInt(map.get("pool").toString());
......
...@@ -259,9 +259,10 @@ public class EquipmentDetailController extends AbstractBaseController { ...@@ -259,9 +259,10 @@ public class EquipmentDetailController extends AbstractBaseController {
if (exists > 0) { if (exists > 0) {
throw new BadRequest("设备物联编码重复"); throw new BadRequest("设备物联编码重复");
} }
if(StringUtils.isNotEmpty(haveUsedIotPrefix) && Arrays.stream(haveUsedIotPrefix.split(",")).anyMatch(iotCode::startsWith)){ if(StringUtils.isNotEmpty(sysCode) && StringUtils.isNotEmpty(sysCode.trim())){
throw new BadRequest("物联编码航班已占用"); if(sysCode.startsWith("20210003")||sysCode.startsWith("20210004")||sysCode.startsWith("20210005")){
} throw new BadRequest("物联编码航班已占用");
}
} }
//1.更新装备实例Detail数据 //1.更新装备实例Detail数据
EquipmentDetail equipmentDetail = equipmentDate.getEquipmentDetail(); EquipmentDetail equipmentDetail = equipmentDate.getEquipmentDetail();
......
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.entity.dto.MonitorEventDto; import com.yeejoin.equipmanage.common.entity.dto.MonitorEventDto;
import com.yeejoin.equipmanage.service.impl.MonitorEventService; import com.yeejoin.equipmanage.service.impl.MonitorEventService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -42,6 +44,8 @@ public class MonitorEventController extends AbstractBaseController { ...@@ -42,6 +44,8 @@ public class MonitorEventController extends AbstractBaseController {
public ResponseModel<MonitorEventDto> updateAgency(@RequestBody MonitorEventDto model, public ResponseModel<MonitorEventDto> updateAgency(@RequestBody MonitorEventDto model,
@PathVariable("id") Long id) { @PathVariable("id") Long id) {
model.setId(id); model.setId(id);
ReginParams reginParams = getSelectedOrgInfo();
model.setDisposalUserName(reginParams.getPersonIdentity().getPersonName());
return ResponseHelper.buildResponse(monitorEventService.udpateMonitorEvent(model, this.getUserInfo())); return ResponseHelper.buildResponse(monitorEventService.udpateMonitorEvent(model, this.getUserInfo()));
} }
......
...@@ -95,7 +95,7 @@ public class MonitorEventService ...@@ -95,7 +95,7 @@ public class MonitorEventService
Bean.copyExistPropertis(model, oldModel); Bean.copyExistPropertis(model, oldModel);
oldModel.setDisposalUserId(agencyUserModel.getUserId()); oldModel.setDisposalUserId(agencyUserModel.getUserId());
oldModel.setDisposalUserName(agencyUserModel.getUserName()); //oldModel.setDisposalUserName(agencyUserModel.getUserName());
oldModel.setDisposalDate(new Date()); oldModel.setDisposalDate(new Date());
this.updateWithModel(oldModel); this.updateWithModel(oldModel);
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AirportStand; import com.yeejoin.amos.boot.module.jcs.api.entity.AirportStand;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List; import java.util.List;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AirportStandServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AirportStandServiceImpl;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -47,6 +49,9 @@ public class AirportStandController extends BaseController { ...@@ -47,6 +49,9 @@ public class AirportStandController extends BaseController {
QueryWrapper<AirportStand> queryWrapper = new QueryWrapper<>(); QueryWrapper<AirportStand> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stand_code",standCode); queryWrapper.eq("stand_code",standCode);
AirportStand airportStand = airportStandServiceImpl.getOne(queryWrapper); AirportStand airportStand = airportStandServiceImpl.getOne(queryWrapper);
if (ObjectUtils.isEmpty(airportStand)){
throw new BadRequest("该机位未维护地址");
}
AirportStandDto airportStandDto = new AirportStandDto(); AirportStandDto airportStandDto = new AirportStandDto();
BeanUtils.copyProperties(airportStand,airportStandDto); BeanUtils.copyProperties(airportStand,airportStandDto);
return ResponseHelper.buildResponse(airportStandDto); return ResponseHelper.buildResponse(airportStandDto);
......
...@@ -366,7 +366,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -366,7 +366,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
} }
} }
} }
if (systemSourceCode != null && systemSourceCode .contains("[")){
systemSourceCode = systemSourceCode.replace("[","");
systemSourceCode = systemSourceCode.replace("]","");
}
String data = split != null ? RedisKey.humpToLine(split[0]) : null; String data = split != null ? RedisKey.humpToLine(split[0]) : null;
/* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 end */ /* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 end */
String lift = split != null ? split[1] : null; String lift = split != null ? split[1] : null;
...@@ -512,6 +516,17 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -512,6 +516,17 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalled.setResponseLevelCode(alertFormValue.getFieldValueCode()); alertCalled.setResponseLevelCode(alertFormValue.getFieldValueCode());
alertCalled.setResponseLevel(alertFormValue.getFieldValue()); alertCalled.setResponseLevel(alertFormValue.getFieldValue());
} }
if (alertFormValue.getFieldCode().equals("forcedLandingTrack")) {
alertCalled.setForcedLandingTrack(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("flightNumber")) {
alertCalled.setFlightNumber(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("landingTime")) {
alertCalled.setLandingTime(alertFormValue.getFieldValue());
}
}); });
} }
......
...@@ -34,8 +34,10 @@ import com.yeejoin.amos.boot.module.command.api.dto.FrontlineLiaisonDto; ...@@ -34,8 +34,10 @@ import com.yeejoin.amos.boot.module.command.api.dto.FrontlineLiaisonDto;
import com.yeejoin.amos.boot.module.command.biz.service.impl.FrontlineLiaisonServiceImpl; import com.yeejoin.amos.boot.module.command.biz.service.impl.FrontlineLiaisonServiceImpl;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService; import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.jcs.api.entity.*; import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import com.yeejoin.amos.boot.module.jcs.api.enums.*;
import com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper;
import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -47,6 +49,8 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc; ...@@ -47,6 +49,8 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum; import org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc; import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -118,12 +122,6 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto; ...@@ -118,12 +122,6 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateDto; import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateExtendDto; import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateExtendDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.VoiceRecordFileDto; import com.yeejoin.amos.boot.module.jcs.api.dto.VoiceRecordFileDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSchedulingTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSubmitTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
...@@ -146,9 +144,12 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -146,9 +144,12 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
@Service @Service
public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, AlertSubmitted, AlertSubmittedMapper> implements IAlertSubmittedService { public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, AlertSubmitted, AlertSubmittedMapper> implements IAlertSubmittedService {
private final static Logger log = LoggerFactory.getLogger(AlertSubmittedServiceImpl.class);
@Autowired @Autowired
IAlertSubmittedObjectService iAlertSubmittedObjectService; IAlertSubmittedObjectService iAlertSubmittedObjectService;
@Autowired @Autowired
private ESAlertCalledRepository esAlertCalledRepository;
@Autowired
AlertSubmittedObjectServiceImpl alertSubmittedObjectServiceImpl; AlertSubmittedObjectServiceImpl alertSubmittedObjectServiceImpl;
@Autowired @Autowired
AlertCalledServiceImpl alertCalledService; AlertCalledServiceImpl alertCalledService;
...@@ -167,6 +168,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -167,6 +168,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired @Autowired
ESAlertCalledService esAlertCalledService;
@Autowired
private FirefightersServiceImpl firefightersService; private FirefightersServiceImpl firefightersService;
@Autowired @Autowired
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
...@@ -363,9 +366,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -363,9 +366,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
model.setRelationId(String.valueOf(alertCalled.getSequenceNbr())); model.setRelationId(String.valueOf(alertCalled.getSequenceNbr()));
model.setIsRead(true); model.setIsRead(true);
model.setMsgType("jcs119"); model.setMsgType("jcs119");
Systemctl.messageClient.update(model); try {
} Systemctl.messageClient.update(model);
} catch (Exception e) {
log.info("规则调用失败");
}
}
ESAlertCalled esAlertCalled = esAlertCalledService.queryById(alertSubmittedDto.getAlertCalledId());
if (alertCalled.getAlertStatus())
{
esAlertCalled.setAlertStatusStr(AlertStatusEnum.CLOSED.getCode());
}else
{
esAlertCalled.setAlertStatusStr(AlertStatusEnum.UNCLOSED.getCode());
}
esAlertCalledRepository.deleteById(alertSubmittedDto.getAlertCalledId());
esAlertCalledRepository.save(esAlertCalled);
} catch (MqttException e) { } catch (MqttException e) {
throw new RuntimeException(); throw new RuntimeException();
} }
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.LinkedList; import java.util.LinkedList;
...@@ -7,8 +8,11 @@ import java.util.List; ...@@ -7,8 +8,11 @@ import java.util.List;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
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;
import org.elasticsearch.search.sort.SortBuilders;
import org.elasticsearch.search.sort.SortOrder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.DependsOn; import org.springframework.context.annotation.DependsOn;
...@@ -138,6 +142,13 @@ public class ESAlertCalledService { ...@@ -138,6 +142,13 @@ public class ESAlertCalledService {
esAlertCalled.setAddress(alertCalled.getAddress()); esAlertCalled.setAddress(alertCalled.getAddress());
esAlertCalled.setAlertStage(alertCalled.getAlertStage()); esAlertCalled.setAlertStage(alertCalled.getAlertStage());
esAlertCalled.setAlertStatus(alertCalled.getAlertStatus()); esAlertCalled.setAlertStatus(alertCalled.getAlertStatus());
esAlertCalled.setForcedLandingTrack(alertCalled.getForcedLandingTrack());
esAlertCalled.setFlightNumber(alertCalled.getFlightNumber());
if(alertCalled.getLandingTime() != null ){
Date date = new Date();
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(alertCalled.getLandingTime());
esAlertCalled.setLandingTime(date.getTime());
}
if (alertCalled.getAlertStatus()) if (alertCalled.getAlertStatus())
{ {
esAlertCalled.setAlertStatusStr(AlertStatusEnum.CLOSED.getCode()); esAlertCalled.setAlertStatusStr(AlertStatusEnum.CLOSED.getCode());
...@@ -298,29 +309,54 @@ public class ESAlertCalledService { ...@@ -298,29 +309,54 @@ public class ESAlertCalledService {
.must(QueryBuilders.matchQuery("unitInvolved", alertCalled.getUnitInvolved())); .must(QueryBuilders.matchQuery("unitInvolved", alertCalled.getUnitInvolved()));
boolMust.should(qb5); boolMust.should(qb5);
} }
//过滤120警情
BoolQueryBuilder qb6 = QueryBuilders.boolQuery()
.mustNot(QueryBuilders.termQuery("alertTypeCode", "1214"));
boolMust.should(qb6);
if (!ValidationUtil.isEmpty(alertCalledVo.getAlertFormValue())){
List<AlertFormValue> alertFormValue = alertCalledVo.getAlertFormValue();
for (AlertFormValue formValue : alertFormValue) {
if (formValue.getFieldCode().equals("forcedLandingTrack")&& formValue.getFieldValue() != null){
BoolQueryBuilder qb7 = QueryBuilders.boolQuery()
.must(QueryBuilders.termQuery("forcedLandingTrack.keyword", formValue.getFieldValue()));
boolMust.must(qb7);
}
if (formValue.getFieldCode().equals("flightNumber") && formValue.getFieldValue() != null){
BoolQueryBuilder qb8 = QueryBuilders.boolQuery()
.must(QueryBuilders.termQuery("flightNumber.keyword", formValue.getFieldValue()));
boolMust.must(qb8);
}
if (formValue.getFieldCode().equals("landingTime")&& formValue.getFieldValue() != null){
BoolQueryBuilder qb9 = QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery("landingTime").gte(currentTime));
boolMust.must(qb9);
}
}
/**
}
/**
* 一般火灾,条件构造 * 一般火灾,条件构造
*/ */
boolMust.minimumShouldMatch(1);//至少满足一个 // boolMust.minimumShouldMatch(1);//至少满足一个
boolMustAll.must(boolMust); boolMustAll.must(boolMust);
BoolQueryBuilder qb120 = QueryBuilders.boolQuery()
.mustNot(QueryBuilders.termQuery("alertTypeCode.keyword", "1214"));
// 创建查询构造器 // 创建查询构造器
NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder() NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder()
// 分页 //过滤条件
.withPageable(PageRequest.of(current, size)) .withQuery(boolMustAll)
// 排序 // 排序
// .withSort(SortBuilders.fieldSort("callTimeLong").order(SortOrder.DESC)) .withSort(SortBuilders.fieldSort("callTimeLong").order(SortOrder.DESC))
//过滤条件 // 分页
.withQuery(boolMustAll) .withPageable(PageRequest.of(current, size))
.withQuery(qb120)
; ;
List<ESAlertCalledDto> list = new LinkedList<>(); List<ESAlertCalledDto> list = new LinkedList<>();
......
...@@ -1641,13 +1641,20 @@ public class ExcelServiceImpl { ...@@ -1641,13 +1641,20 @@ public class ExcelServiceImpl {
private void initDutyPersonData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) { private void initDutyPersonData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) {
// 遍历行,i = 1,从第二行开始,第一行是表头跳过。 // 遍历行,i = 1,从第二行开始,第一行是表头跳过。
for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { for (int i = 0; i < sheet.getPhysicalNumberOfRows(); i++) {
DutyPersonDto dutyPersonDto = new DutyPersonDto(); DutyPersonDto dutyPersonDto = new DutyPersonDto();
// row是一行数据,row.getCell(i),代表拿到这一行,第i列数据 // row是一行数据,row.getCell(i),代表拿到这一行,第i列数据
Row row = sheet.getRow(i); Row row = sheet.getRow(i);
if (row == null) { if (row == null) {
continue; continue;
} }
if (i == 0){
if ( !row.getCell(1).toString().equals("用户ID")){
throw new BadRequest("上传模板类型不正确");
}else {
continue;
}
}
Cell cell4 = row.getCell(4); Cell cell4 = row.getCell(4);
if(cell4 ==null) { if(cell4 ==null) {
continue; continue;
......
...@@ -4,7 +4,9 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl; ...@@ -4,7 +4,9 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper; import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper; import com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResourcesMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResourcesMapper;
...@@ -335,59 +337,59 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -335,59 +337,59 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
} }
// int num = 0; int num = 0;
// String todayTime = DateUtils.getDateNowShortStr(); String todayTime = DateUtils.getDateNowShortStr();
// String beginDate = todayTime; String beginDate = todayTime;
// beginDate = beginDate + " 00:00:00"; beginDate = beginDate + " 00:00:00";
// String endDate = todayTime; String endDate = todayTime;
// endDate = endDate + " 23:59:59"; endDate = endDate + " 23:59:59";
// LambdaQueryWrapper<DutyShift> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DutyShift> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq(BaseEntity::getIsDelete, false); wrapper.eq(BaseEntity::getIsDelete, false);
// List<DutyShift> dutyShifts = dutyShiftMapper.selectList(wrapper); List<DutyShift> dutyShifts = dutyShiftMapper.selectList(wrapper);
//
// String[] dutyShiftName = {" "}; String[] dutyShiftName = {" "};
//
// dutyShifts.forEach(e -> { dutyShifts.forEach(e -> {
// String startTime = e.getStartTime(); String startTime = e.getStartTime();
// Date startDate = null; Date startDate = null;
// Date dateEnd = null; Date dateEnd = null;
// if (startTime.startsWith("当日:")) { if (startTime.startsWith("当日:")) {
// String resultTime = startTime.replace("当日:", todayTime) + ":00"; String resultTime = startTime.replace("当日:", todayTime) + ":00";
// startDate = DateUtils.longStr2Date(resultTime); startDate = DateUtils.longStr2Date(resultTime);
// } else if (startTime.startsWith("次日:")) { } else if (startTime.startsWith("次日:")) {
// Date dateNow = DateUtils.getDateNow(); Date dateNow = DateUtils.getDateNow();
// Date date = DateUtils.dateAddDays(dateNow, 1); Date date = DateUtils.dateAddDays(dateNow, 1);
// String s = DateUtils.convertDateToString(date, DateUtils.DATE_PATTERN); String s = DateUtils.convertDateToString(date, DateUtils.DATE_PATTERN);
// String resultTime = startTime.replace("次日:", s) + ":00"; String resultTime = startTime.replace("次日:", s) + ":00";
// startDate = DateUtils.longStr2Date(resultTime); startDate = DateUtils.longStr2Date(resultTime);
// } }
// String endTime = e.getEndTime(); String endTime = e.getEndTime();
// if (endTime.startsWith("当日:")) { if (endTime.startsWith("当日:")) {
// String resultTime = endTime.replace("当日:", todayTime) + ":00"; String resultTime = endTime.replace("当日:", todayTime) + ":00";
// dateEnd = DateUtils.longStr2Date(resultTime); dateEnd = DateUtils.longStr2Date(resultTime);
// } else if (endTime.startsWith("次日:")) { } else if (endTime.startsWith("次日:")) {
// Date dateNow = DateUtils.getDateNow(); Date dateNow = DateUtils.getDateNow();
// Date date = DateUtils.dateAddDays(dateNow, 1); Date date = DateUtils.dateAddDays(dateNow, 1);
// String s = DateUtils.convertDateToString(date, DateUtils.DATE_PATTERN); String s = DateUtils.convertDateToString(date, DateUtils.DATE_PATTERN);
// String resultTime = endTime.replace("次日:", s) + ":00"; String resultTime = endTime.replace("次日:", s) + ":00";
// dateEnd = DateUtils.longStr2Date(resultTime); dateEnd = DateUtils.longStr2Date(resultTime);
// } }
//
// if (DateUtils.belongCalendar(DateUtils.getDateNow(), startDate, dateEnd)) { if (DateUtils.belongCalendar(DateUtils.getDateNow(), startDate, dateEnd)) {
// dutyShiftName[0] = dutyShiftName[0].replace(" ", e.getName()); dutyShiftName[0] = dutyShiftName[0].replace(" ", e.getName());
// } }
// }); });
//
// if (resultList != null) { if (resultList != null) {
// resultList.forEach(e -> { resultList.forEach(e -> {
// if (e.containsKey(dutyShiftName[0])) { if (e.containsKey(dutyShiftName[0])) {
// String personNum = e.get(dutyShiftName[0]); String personNum = e.get(dutyShiftName[0]);
// fireCarDto.setPersonCount(Integer.valueOf(personNum)); fireCarDto.setPersonCount(Integer.valueOf(personNum));
// } }
// }); });
// } else { } else {
// fireCarDto.setPersonCount(num); fireCarDto.setPersonCount(num);
// } }
} }
fireCarDtoList.add(fireCarDto); fireCarDtoList.add(fireCarDto);
......
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