Commit 40c00e9b authored by 李腾威's avatar 李腾威

任务 4263 4264

parent 59c376ad
......@@ -23,7 +23,7 @@ public class AlertSubmittedZHDto {
@ApiModelProperty(value = "主键ID")
protected Long sequenceNbr;
@ApiModelProperty(value = "业务类型(警情续报、非警情确认、警情结案)")
@ApiModelProperty(value = "业务类型(警情续报、非警情确认、警情结案,警情归并)")
private String businessType;
@ApiModelProperty(value = "报送时间")
......@@ -38,4 +38,7 @@ public class AlertSubmittedZHDto {
@ApiModelProperty(value = "人员名称")
private String userName;
@ApiModelProperty(value = "警情信息")
private AlertCalledFormDto alertCalledFormDto;
}
......@@ -31,13 +31,17 @@ public class InstructionsZHDto {
@ApiModelProperty(value = "发送单位")
private String company="119值班中心";
@ApiModelProperty(value = "警情信息")
private AlertCalledFormDto alertCalledFormDto;
public InstructionsZHDto(Long sequenceNbr, String type, Date submissionTime, String content) {
public InstructionsZHDto(Long sequenceNbr, String type, Date submissionTime, String content, AlertCalledFormDto alertCalledFormDto) {
this.sequenceNbr = sequenceNbr;
this.type = type;
this.submissionTime = submissionTime;
this.content = content;
this.alertCalledFormDto = alertCalledFormDto;
}
public InstructionsZHDto() {
......
......@@ -41,6 +41,8 @@ public interface IAlertCalledService {
* **/
Object selectAlertCalledById( Long id);
Object selectAlertCalledByIdNoRedis(Long id);
Map<String,Object> selectAlertCalledKeyValueLabelById( Long id);
......
......@@ -117,6 +117,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
private String topic;
@Value("${redis.cache.failure.time}")
private long time;
@Value("${mqtt.topic.command.power.deployment}")
private String topic1;
@Autowired
private OrgUsrServiceImpl iOrgUsrService;
......@@ -247,6 +249,29 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
/**
* 根据灾情id 查询灾情详情
**/
@Override
public Object selectAlertCalledByIdNoRedis(Long id) {
// 警情基本信息
AlertCalled alertCalled = this.getById(id);
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
// 警情动态表单数据
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
List<FormValue> formValue = new ArrayList<FormValue>();
if (list != null && list.size() > 0) {
for (AlertFormValue alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
"text", alertFormValue.getFieldValue(), alertFormValue.getBlock());
formValue.add(value);
}
}
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalled, formValue);
return alertCalledFormVo;
}
/**
* <pre>
* 保存警情信息
* </pre>
......@@ -304,6 +329,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
});
// 保存动态表单数据
iAlertFormValueService.saveBatch(alertFormValuelist);
emqKeeper.getMqttClient().publish(topic1, "1".getBytes(), RuleConfig.DEFAULT_QOS, true);
} else {
// 警情报送
// ****************************************************待确认开发
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -14,6 +15,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto;
......@@ -43,7 +45,9 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService;
import com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.ObjectUtils;
import org.checkerframework.checker.units.qual.A;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -490,7 +494,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} else {
content = "调派" + PowerTransferCompanyZHDto.getCompanyName() + PowerTransferCompanyZHDto.getSubmissionContent() + "前往" + PowerTransferCompanyZHDto.getAddress();
}
InstructionsZHDto instruct = new InstructionsZHDto(PowerTransferCompanyZHDto.getSequenceNbr(), PowerTransferCompanyZHDto.getDispatchType(), PowerTransferCompanyZHDto.getRecDate(), content);
InstructionsZHDto instruct = new InstructionsZHDto(PowerTransferCompanyZHDto.getSequenceNbr(), PowerTransferCompanyZHDto.getDispatchType(), PowerTransferCompanyZHDto.getRecDate(), content, null);
listInstructionsZHDto.add(instruct);
});
......@@ -527,12 +531,28 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
break;
}
InstructionsZHDto instruct = new InstructionsZHDto(AlertSubmittedZHDto.getSequenceNbr(), AlertSubmittedZHDto.getBusinessType(), AlertSubmittedZHDto.getSubmissionTime(), content);
InstructionsZHDto instruct = new InstructionsZHDto(AlertSubmittedZHDto.getSequenceNbr(), AlertSubmittedZHDto.getBusinessType(), AlertSubmittedZHDto.getSubmissionTime(), content,null);
listInstructionsZHDto.add(instruct);
});
// 获取归并得警情信息
LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(AlertCalled::getFatherAlert,id);
List<AlertCalled> alertCalleds = alertCalledService.getBaseMapper().selectList(queryWrapper);
alertCalleds.stream().forEach(e->{
AlertSubmittedZHDto alertSubmittedZHDto = new AlertSubmittedZHDto();
AlertCalledFormDto alertCalledFormDto = (AlertCalledFormDto) alertCalledService.selectAlertCalledByIdNoRedis(e.getSequenceNbr());
alertSubmittedZHDto.setAlertCalledFormDto(alertCalledFormDto);
alertSubmittedZHDto.setSequenceNbr(e.getSequenceNbr());
alertSubmittedZHDto.setBusinessType("警情归并");
alertSubmittedZHDto.setSubmissionTime(alertCalledFormDto.getAlertCalled().getCallTime());
alertSubmittedZHDto.setCompanyName(alertCalledFormDto.getAlertCalled().getCompanyName());
alertSubmittedZHDto.setUserName(alertCalledFormDto.getAlertCalled().getRecUserName());
InstructionsZHDto instruct = new InstructionsZHDto(alertSubmittedZHDto.getSequenceNbr(), alertSubmittedZHDto.getBusinessType(), alertSubmittedZHDto.getSubmissionTime(), null, alertSubmittedZHDto.getAlertCalledFormDto());
listInstructionsZHDto.add(instruct);
});
//排序时间倒序
/* Bug 2613 修改排序 按照发送时间排序 2021-09-01 陈召 开始*/
Collections.sort(listInstructionsZHDto, new Comparator<InstructionsZHDto>() {
......
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