Commit 506e790c authored by tangwei's avatar tangwei

同步16迭代

parent 94779628
<component name="libraryTable">
<library name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
......@@ -16,6 +16,15 @@ public class CarTaskDto {
private String code;
private int type;
private String remarks;
private Long powerTransferCompanyResourcesId;
public Long getPowerTransferCompanyResourcesId() {
return powerTransferCompanyResourcesId;
}
public void setPowerTransferCompanyResourcesId(Long powerTransferCompanyResourcesId) {
this.powerTransferCompanyResourcesId = powerTransferCompanyResourcesId;
}
public List<String> getPhotos() {
return photos;
......
......@@ -20,12 +20,15 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
public class ESCar {
@Id
private String id;
@Field(type = FieldType.Long)
private Long sequenceNbr;
@Field(type = FieldType.Double)
@Field(type = FieldType.Text)
private String longitude;
@Field(type = FieldType.Double)
@Field(type = FieldType.Text)
private String latitude;
@Field(type = FieldType.Long)
......
......@@ -33,4 +33,11 @@ public class JcSituationDetail extends BaseEntity {
@ApiModelProperty(value = "图片")
@TableField(exist = false)
private List<String> photos;
@ApiModelProperty(value = "调派资源id")
private Long powerTransferCompanyResourcesId;
}
......@@ -13,4 +13,6 @@ public interface IESCarService {
public ESCar saveESCar(ESCar Car) throws Exception;
public Iterable<ESCar> findAllById(List<Long> ids) throws Exception;
public ESCar findAllByCarId(Long id);
}
......@@ -24,6 +24,7 @@ public interface IPowerTransferCompanyResourcesService {
void updatePowerTransferCompanyResourcesService(Long alertCalledId, Long carId, String code, int type, String remarks, List<String> photos);
List<JcSituationDetail> getTaskFeedback(Long carid, Long alertCalledId);
/**
......
......@@ -1299,6 +1299,14 @@ public class CommandController extends BaseController {
}
String sequenceNbr = e.get("sequenceNbr").toString();
//查询最新的经纬度
ESCar es= esCarService.findAllByCarId(Long.valueOf(sequenceNbr));
if(es!=null){
e.put("longitude", es.getLongitude());
e.put("latitude",es.getLatitude());
}
//同步力量调派车辆任务状态
alertFormValue.stream().forEach(v -> {
if (v.getResourcesId().equals(sequenceNbr)) {
......@@ -1827,6 +1835,7 @@ public class CommandController extends BaseController {
try {
Date date1= new Date();
esCar.setId(UUID.randomUUID().toString().trim().replaceAll("-",""));
esCar.setTime(date1.getTime());
esCarService.saveESCar(esCar);
//给App端发送
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
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.ESAlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.ESCar;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.service.IESCarService;
import com.yeejoin.amos.boot.module.jcs.biz.dao.ESCarRepository;
import org.elasticsearch.index.query.MatchQueryBuilder;
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.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.stereotype.Service;
import java.util.LinkedList;
import java.util.List;
/**
* @description:
* @author: tw
......@@ -38,4 +50,36 @@ public class ESCarService implements IESCarService {
}
@Override
public ESCar findAllByCarId(Long id) {
MatchQueryBuilder matchQueryBuilder= QueryBuilders.matchQuery("sequenceNbr", id);
NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder()
.withQuery(matchQueryBuilder)
.withPageable(PageRequest.of(1, 1))
.withSort(SortBuilders.fieldSort("Time").order(SortOrder.DESC));
List<ESCar> list = new LinkedList<>();
long totle = 0;
try
{
SearchHits<ESCar> searchHits =elasticsearchTemplate.search(queryBuilder.build(), ESCar.class);
for (SearchHit searchHit : searchHits.getSearchHits())
{
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(searchHit.getContent());
ESCar eSCar =JSONObject.toJavaObject(jsonObject, ESCar.class);
list.add(eSCar);
}
}
catch (Exception e)
{
e.printStackTrace();
}
return list!=null&&list.size()>0?list.get(0):null;
}
}
......@@ -127,6 +127,10 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
if (CollectionUtils.isNotEmpty(photos)){
jcSituationDetail.setInfo(info+"/photos:"+Joiner.on(",").join(photos));
}
jcSituationDetail.setPowerTransferCompanyResourcesId(powerTransferCompanyResources.getSequenceNbr());
jcSituationDetailMapper.insert(jcSituationDetail);
// 车辆状态更改消息推送
// 定义指令信息消息推送 页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
......@@ -138,12 +142,14 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
@Override
public List<JcSituationDetail> getTaskFeedback(Long carid, Long alertCalledId) {
PowerTransferCompanyResources powerTransferCompanyResources = powerTransferCompanyResourcesMapper.getByAlertCalledIdCarId(alertCalledId, carid);
LambdaQueryWrapper<JcSituationDetail> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(JcSituationDetail::getAlertCalledId,alertCalledId);
wrapper.like(JcSituationDetail::getInfo,powerTransferCompanyResources.getResourcesNum());
wrapper.eq(JcSituationDetail::getInfoType,"车辆反馈");
wrapper.eq(JcSituationDetail::getPowerTransferCompanyResourcesId,powerTransferCompanyResources.getSequenceNbr());
wrapper.orderByDesc(BaseEntity::getRecDate);
List<JcSituationDetail> list = jcSituationDetailMapper.selectList(wrapper);
list.stream().forEach(e->{
......
......@@ -1194,7 +1194,7 @@ public class PointServiceImpl implements IPointService {
} else {
classifyJson = new JSONObject();
}
JSONArray riskDescArr;
JSONArray riskDr;
if (classifyJson.containsKey(riskDesc)) {
riskDescArr = classifyJson.getJSONArray(riskDesc);
} else {
......
......@@ -3495,6 +3495,21 @@
ADD person_of_day varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '当日驻站消防队总人数(可变)';
</sql>
</changeSet>
<changeSet author="TW" id="2022-09-09-21">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_situation_detail"/>
<primaryKeyExists primaryKeyName="power_transfer_company_resources_id" tableName="jc_situation_detail"/>
</preConditions>
<comment>增加任务单id</comment>
<sql>
ALTER TABLE `jc_situation_detail` ADD power_transfer_company_resources_id BIGINT ( 20 ) COMMENT '任务单id',
</sql>
</changeSet>
</databaseChangeLog>
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