Commit 9b85b95e authored by maoying's avatar maoying

重置画布数据接口

parent 267ad873
......@@ -34,7 +34,7 @@ public class EquipmentSpecificVo implements Serializable {
private int single;
@ApiModelProperty(value = "所属系统")
private Long systemId;
private String systemId;
@ApiModelProperty(value = "物联code")
private String iotCode;
......
......@@ -19,6 +19,6 @@ public class SceneContentVo {
private Map<String,Object> boardConfig;
private List<PointTreeVo> children;
private List<ScenePointTreeVo> children;
}
package com.yeejoin.equipmanage.common.entity.vo;
import java.util.List;
import java.util.Map;
import lombok.Data;
/**
* 树返回实体
*/
@Data
public class ScenePointTreeVo {
/**
* 组态参数-component
*/
private String template;
/**
* 组态参数-true
*/
private boolean openStatus;
/**
* 组态参数-是否绑定
*/
private boolean isBinding;
public boolean isIsBinding() {
return isBinding;
}
public void setIsBinding(boolean isBinding) {
this.isBinding = isBinding;
}
/**
* 装备名称
*/
private String displayName;
/**
* 页面展示大小
*/
private String initStyle;
/**
* 组态参数-CommonEquip 装备
*/
private String componentName;
/**
* id
*/
private String sequenceNbr;
/**
* 组态参数-equipment
*/
private String componentKey;
/**
* 装备点图标
*/
private String imgPath;
/**
* 装备二维码
*/
private String equipCode;
/**
* 装备分类id
*/
private String equipId;
/**
* 装备分类code
*/
private String categoryCode;
/**
* 装备类型名称
*/
private String equipName;
/**
* 装备系统id
*/
private String equipSyetemId;
/**
* 组态需要参数
* 图片地址 map.put("imgPath", fileUrl + p.getImgPath());
* 装备唯一编码 map.put("equipCode", p.getEquipCode());
* 装备详情api map.put("detailApi", "http://" + equipmentdataUrl + p.getSequenceNbr());
* 装备性能指标api map.put("speindexApi", "http://" +speindexUrl + p.getSequenceNbr());
* 装备系统id map.put("equipSyetemId", p.getEquipSyetemId());
* 装备类型id map.put("equipTypeId", p.getEquipId());
*/
private Map<String,Object> dataConfig;
private Map<String,Object> visualParams;
/**
* 父id
*/
private String parentId;
/**
* 区域标识
*/
private String isRegion;
/**
* 子数据
*/
private List<ScenePointTreeVo> children;
/**
* 画布信息
*/
private String content;
/**
* 部门code
*/
private String orgCode;
/**
* 排序
*/
private Long sort;
/**
* 画布id
*/
private Long sceneId;
/**
* 状态
*/
private String status;
/**
* iot码
*/
private String iotCode;
private String key;
private String groupId;
private String groupName;
private String ip;
private String token;
private String address;
/**
* 装备编码
*/
private String code;
//建筑类型
private String groupType;
private List componentSetting;
private String tag;
private String eid;
}
......@@ -948,5 +948,17 @@ public class FireFightingSystemController extends AbstractBaseController {
public Object getSystemAlarmInfoList(@RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate) throws Exception {
return fireFightingSystemService.getSystemAlarmInfoList(startDate, endDate);
}
/**
* 重置画布数据
*
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "重置画布数据", notes = "重置画布数据")
@GetMapping(value = "/reset/morphic")
public void resetMorphic(){
fireFightingSystemService.resetMorphic();
}
}
......@@ -27,6 +27,6 @@ public interface IdxFeign {
* @Date 2022/9/27 17:46
*/
@RequestMapping(value = "/defect/alarm/{alarmLogId}", method = RequestMethod.GET)
ResponseModel<JSONObject> queryDefectByBatchId(@PathVariable String alarmLogId);
ResponseModel<JSONObject> queryDefectByBatchId(@PathVariable(value = "alarmLogId") String alarmLogId);
}
......@@ -184,7 +184,7 @@ public interface JcsFeign {
* @return ResponseModel<OrgUsrDto>
*/
@GetMapping(value = "/org-usr/listCompanyTree")
FeignClientResult<List<OrgUsrDto>> getlistCompanyTree( @RequestParam(required = false) String orgType);
FeignClientResult<List<OrgUsrDto>> getlistCompanyTree( @RequestParam(required = false,value = "orgType") String orgType);
/**
* 查询用户单位信息
......@@ -192,9 +192,9 @@ public interface JcsFeign {
* @return ResponseModel<ReginParams.PersonIdentity>
*/
@GetMapping(value = "/org-person/getUser/{id}")
FeignClientResult selectById(@PathVariable String id);
FeignClientResult selectById(@PathVariable(value = "id") String id);
@GetMapping(value = "/org-usr/getCompany")
FeignClientResult getCompany( @RequestParam("bizOrgCode") String bizOrgCode);
FeignClientResult getCompany( @RequestParam(value = "bizOrgCode") String bizOrgCode);
}
......@@ -2350,56 +2350,62 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return fireFightingSystemMapper.getStationStatusStatistics();
}
@Override
public void resetMorphic() {
try {
QueryWrapper<SourceScene> wrapper = new QueryWrapper();
List<SourceScene> sourceScenes = sourceSceneMapper.selectList(wrapper);
if(ObjectUtils.isEmpty(sourceScenes)){
sourceScenes.forEach(sourceScene->{
if(!ObjectUtils.isEmpty(sourceScenes)){
for(SourceScene sourceScene:sourceScenes){
ResourceDTO resourceDTO = Morphic.morphicSubjectClient.seleteOne(sourceScene.getSceneId()).getResult();
String content = resourceDTO.getContent();
SceneContentVo parse = (SceneContentVo) JSON.parse(content);
List<PointTreeVo> pointList = (List<PointTreeVo>) parse.getChildren();
if(!ObjectUtils.isEmpty(pointList)){
List<PointTreeVo> newPointList = new ArrayList<>();
String pointInScene = "";
String videoInScene = "";
for(PointTreeVo action:pointList){
if("equipment".equals(action.getKey())){
EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectById(action.getSequenceNbr());
if(ObjectUtils.isEmpty(equipmentSpecific)){
continue;
}
action.setIotCode(equipmentSpecific.getIotCode());
action.setDisplayName(equipmentSpecific.getName());
action.setEquipSyetemId(equipmentSpecific.getSystemId());
newPointList.add(action);
pointInScene = "".equals(pointInScene) ? action.getSequenceNbr().toString()
: pointInScene + "," + action.getSequenceNbr();
}else{
Video video = videoMapper.selectById(action.getSequenceNbr());
if(ObjectUtils.isEmpty(video)){
continue;
if(!ObjectUtils.isEmpty(resourceDTO)){
JSONObject content = JSONObject.parseObject(resourceDTO.getContent());
SceneContentVo parse = JSONObject.toJavaObject(content, SceneContentVo.class);
List<ScenePointTreeVo> pointList = (List<ScenePointTreeVo>) parse.getChildren();
if(!ObjectUtils.isEmpty(pointList)){
List<ScenePointTreeVo> newPointList = new ArrayList<>();
String pointInScene = "";
String videoInScene = "";
for(ScenePointTreeVo action:pointList){
if("equipment".equals(action.getKey())){
EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectById(action.getSequenceNbr());
if(ObjectUtils.isEmpty(equipmentSpecific)){
continue;
}
action.setIotCode(equipmentSpecific.getIotCode());
action.setDisplayName(equipmentSpecific.getName());
action.setEquipSyetemId(equipmentSpecific.getSystemId());
newPointList.add(action);
pointInScene = "".equals(pointInScene) ? action.getSequenceNbr().toString()
: pointInScene + "," + action.getSequenceNbr();
}else{
Video video = videoMapper.selectById(action.getSequenceNbr());
if(ObjectUtils.isEmpty(video)){
continue;
}
action.setIotCode(video.getCode());
action.setDisplayName(video.getName());
newPointList.add(action);
videoInScene = "".equals(videoInScene) ? action.getSequenceNbr().toString()
: videoInScene + "," + action.getSequenceNbr();
}
action.setIotCode(video.getCode());
action.setDisplayName(video.getName());
newPointList.add(action);
videoInScene = "".equals(videoInScene) ? action.getSequenceNbr().toString()
: videoInScene + "," + action.getSequenceNbr();
}
parse.setChildren(newPointList);
System.out.println("parse="+JSONObject.toJSONString(parse));
resourceDTO.setContent(JSONObject.toJSONString(parse));
System.out.println("resourceDTO="+JSONObject.toJSONString(resourceDTO));
FeignUtil.remoteCall(() -> Morphic.morphicSubjectClient.update(resourceDTO));
sourceScene.setPointInScene(pointInScene);
sourceScene.setVideoInScene(videoInScene);
System.out.println("sourceScene="+JSONObject.toJSONString(sourceScene));
iSourceSceneService.saveOrUpdate(sourceScene);
}
parse.setChildren(newPointList);
resourceDTO.setContent(content);
FeignUtil.remoteCall(() -> Morphic.morphicSubjectClient.update(resourceDTO));
sourceScene.setPointInScene(pointInScene);
sourceScene.setVideoInScene(videoInScene);
iSourceSceneService.saveOrUpdate(sourceScene);
}
});
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
......
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