Commit 1553b8b0 authored by 田涛's avatar 田涛

Merge remote-tracking branch 'origin/dev_upgrade-1225' into dev_upgrade-1225

parents 2b7da872 78ba6319
......@@ -94,8 +94,12 @@ public class EquipmentSpecificController extends BaseController{
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "pageNumber",required = false) int pageNumber,
@RequestParam(value = "pageSize",required = false) int pageSize,
@RequestParam(value = "equipmentId",required = false) Long equipmentId ) {
return CommonResponseUtil.success(equipmentSpecificService.getEquipmentBySpeV2(name, pageNumber, pageSize,equipmentId));
@RequestParam(value = "equipmentId",required = false) String equipmentId ) {
Long aLong = null;
if (!"null".equals(equipmentId) && equipmentId != null && !"".equals(equipmentId.trim())){
aLong = Long.valueOf(equipmentId);
}
return CommonResponseUtil.success(equipmentSpecificService.getEquipmentBySpeV2(name, pageNumber, pageSize,aLong));
}
@GetMapping(value = "/list-tree", produces = "application/json;charset=UTF-8")
......
......@@ -16,6 +16,7 @@ import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.yeejoin.amos.fas.business.util.DataSyncUtil;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -118,6 +119,9 @@ public class View3dServiceImpl implements IView3dService {
@Autowired
private RemoteSecurityService remoteSecurityService;
@Autowired
private DataSyncUtil dataSyncUtil;
@Override
@Transactional(rollbackFor = Exception.class)
public CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList) {
......@@ -248,6 +252,7 @@ public class View3dServiceImpl implements IView3dService {
if(ue4Rotation != null) riskSource.setUe4Rotation(pointBo.getUe4Rotation());
if(position3d != null) riskSource.setPosition3d(position3d);
iRiskSourceDao.save(riskSource);
dataSyncUtil.astDataSync(String.join("_", com.yeejoin.dataprocess.common.enums.AstDataSyncTopic.AST_REGION_SAVE.getValue(), String.valueOf(riskSource.getId())), JSON.toJSONString(riskSource));
}
}
......
package com.yeejoin.amos.fas.business.util;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.util
* @ClassName: DataSyncUtil
* @Author: Jianqiang Gao
* @Description: 数据同步工具类
* @Date: 2021/3/24 15:31
* @Version: 1.0
*/
@Component
public class DataSyncUtil {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private WebMqttComponent webMqttComponent;
public void astDataSync(String topic, String message) {
redisTemplate.opsForValue().set(topic, message);
webMqttComponent.publish(topic.substring(0, topic.lastIndexOf("_")), message);
}
}
\ No newline at end of file
package com.yeejoin.dataprocess.common.enums;
/**
* @ProjectName: YeeFireDataProcessRoot
* @Package: com.yeejoin.dataprocess.common.enums
* @ClassName: TopicName
* @Author: Jianqiang Gao
* @Description: TopicName
* @Date: 2021/3/23 15:55
* @Version: 1.0
*/
public enum AstDataSyncTopic {
AST_REGION_SAVE(10, "ast_save"),
AST_REGION_SAVE_ALL(11, "ast_save_all"),
AST_REGION_DELETE_BY_ID(12, "ast_delete_by_id");
private final Integer key;
private final String value;
private AstDataSyncTopic(Integer key, String value) {
this.key = key;
this.value = value;
}
public Integer getKey() {
return key;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return this.value;
}
}
\ No newline at end of file
......@@ -51,6 +51,7 @@
left join wl_equipment_category as cate on equ.category_id = cate.id
left join f_fire_fighting_system as manage on spe.system_id = manage.id
where sto.amount <![CDATA[>]]> 0
and spe.id is not null
<if test="name != null and name!='null' ">
and (det.name like CONCAT('%',#{name},'%') or ware.full_name like CONCAT('%',#{name},'%') or spe.iot_code like CONCAT('%',#{name},'%') or spe.code like CONCAT('%',#{name},'%'))
</if>
......@@ -83,6 +84,7 @@
left join wl_equipment_category as cate on equ.category_id = cate.id
left join f_fire_fighting_system as manage on spe.system_id = manage.id
where sto.amount <![CDATA[>]]> 0
and spe.id is not null
<if test="name != null and name!='null' ">
and (det.name like CONCAT('%',#{name},'%') or ware.full_name like CONCAT('%',#{name},'%') or spe.iot_code like CONCAT('%',#{name},'%') or spe.code like CONCAT('%',#{name},'%'))
</if>
......
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