Commit 9b85b95e authored by maoying's avatar maoying

重置画布数据接口

parent 267ad873
...@@ -34,7 +34,7 @@ public class EquipmentSpecificVo implements Serializable { ...@@ -34,7 +34,7 @@ public class EquipmentSpecificVo implements Serializable {
private int single; private int single;
@ApiModelProperty(value = "所属系统") @ApiModelProperty(value = "所属系统")
private Long systemId; private String systemId;
@ApiModelProperty(value = "物联code") @ApiModelProperty(value = "物联code")
private String iotCode; private String iotCode;
......
...@@ -19,6 +19,6 @@ public class SceneContentVo { ...@@ -19,6 +19,6 @@ public class SceneContentVo {
private Map<String,Object> boardConfig; 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 { ...@@ -948,5 +948,17 @@ public class FireFightingSystemController extends AbstractBaseController {
public Object getSystemAlarmInfoList(@RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate) throws Exception { public Object getSystemAlarmInfoList(@RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate) throws Exception {
return fireFightingSystemService.getSystemAlarmInfoList(startDate, endDate); 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 { ...@@ -27,6 +27,6 @@ public interface IdxFeign {
* @Date 2022/9/27 17:46 * @Date 2022/9/27 17:46
*/ */
@RequestMapping(value = "/defect/alarm/{alarmLogId}", method = RequestMethod.GET) @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 { ...@@ -184,7 +184,7 @@ public interface JcsFeign {
* @return ResponseModel<OrgUsrDto> * @return ResponseModel<OrgUsrDto>
*/ */
@GetMapping(value = "/org-usr/listCompanyTree") @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 { ...@@ -192,9 +192,9 @@ public interface JcsFeign {
* @return ResponseModel<ReginParams.PersonIdentity> * @return ResponseModel<ReginParams.PersonIdentity>
*/ */
@GetMapping(value = "/org-person/getUser/{id}") @GetMapping(value = "/org-person/getUser/{id}")
FeignClientResult selectById(@PathVariable String id); FeignClientResult selectById(@PathVariable(value = "id") String id);
@GetMapping(value = "/org-usr/getCompany") @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 ...@@ -2350,56 +2350,62 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return fireFightingSystemMapper.getStationStatusStatistics(); return fireFightingSystemMapper.getStationStatusStatistics();
} }
@Override @Override
public void resetMorphic() { public void resetMorphic() {
try { try {
QueryWrapper<SourceScene> wrapper = new QueryWrapper(); QueryWrapper<SourceScene> wrapper = new QueryWrapper();
List<SourceScene> sourceScenes = sourceSceneMapper.selectList(wrapper); List<SourceScene> sourceScenes = sourceSceneMapper.selectList(wrapper);
if(ObjectUtils.isEmpty(sourceScenes)){ if(!ObjectUtils.isEmpty(sourceScenes)){
sourceScenes.forEach(sourceScene->{ for(SourceScene sourceScene:sourceScenes){
ResourceDTO resourceDTO = Morphic.morphicSubjectClient.seleteOne(sourceScene.getSceneId()).getResult(); ResourceDTO resourceDTO = Morphic.morphicSubjectClient.seleteOne(sourceScene.getSceneId()).getResult();
String content = resourceDTO.getContent(); if(!ObjectUtils.isEmpty(resourceDTO)){
SceneContentVo parse = (SceneContentVo) JSON.parse(content); JSONObject content = JSONObject.parseObject(resourceDTO.getContent());
List<PointTreeVo> pointList = (List<PointTreeVo>) parse.getChildren(); SceneContentVo parse = JSONObject.toJavaObject(content, SceneContentVo.class);
if(!ObjectUtils.isEmpty(pointList)){ List<ScenePointTreeVo> pointList = (List<ScenePointTreeVo>) parse.getChildren();
List<PointTreeVo> newPointList = new ArrayList<>(); if(!ObjectUtils.isEmpty(pointList)){
String pointInScene = ""; List<ScenePointTreeVo> newPointList = new ArrayList<>();
String videoInScene = ""; String pointInScene = "";
for(PointTreeVo action:pointList){ String videoInScene = "";
if("equipment".equals(action.getKey())){ for(ScenePointTreeVo action:pointList){
EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectById(action.getSequenceNbr()); if("equipment".equals(action.getKey())){
if(ObjectUtils.isEmpty(equipmentSpecific)){ EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectById(action.getSequenceNbr());
continue; if(ObjectUtils.isEmpty(equipmentSpecific)){
} continue;
action.setIotCode(equipmentSpecific.getIotCode()); }
action.setDisplayName(equipmentSpecific.getName()); action.setIotCode(equipmentSpecific.getIotCode());
action.setEquipSyetemId(equipmentSpecific.getSystemId()); action.setDisplayName(equipmentSpecific.getName());
newPointList.add(action); action.setEquipSyetemId(equipmentSpecific.getSystemId());
pointInScene = "".equals(pointInScene) ? action.getSequenceNbr().toString() newPointList.add(action);
: pointInScene + "," + action.getSequenceNbr(); pointInScene = "".equals(pointInScene) ? action.getSequenceNbr().toString()
}else{ : pointInScene + "," + action.getSequenceNbr();
Video video = videoMapper.selectById(action.getSequenceNbr()); }else{
if(ObjectUtils.isEmpty(video)){ Video video = videoMapper.selectById(action.getSequenceNbr());
continue; 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) { } catch (Exception e) {
log.error(e.getMessage(), 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