Commit 55b13bea authored by maoying's avatar maoying

Merge branch 'temp' into develop_temp_v3.7.0.6

parents 370e597e 9b85b95e
...@@ -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;
......
package com.yeejoin.equipmanage.common.entity.vo;
import java.util.List;
import java.util.Map;
import lombok.Data;
/**
* 画布实例
*/
@Data
public class SceneContentVo {
private String layout;
private Map<String,Object> boardStyle;
private Map<String,Object> dataConfig;
private Map<String,Object> boardConfig;
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);
} }
...@@ -309,5 +309,12 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -309,5 +309,12 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Map<String, Object> getStationConnectStatus(); Map<String, Object> getStationConnectStatus();
List<Map<String, Object>> getStationStatusStatistics(); List<Map<String, Object>> getStationStatusStatistics();
/**
* 重置画布
*
* @param resourceDTO 参数
*/
void resetMorphic();
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.service.impl; ...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -140,6 +141,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -140,6 +141,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Autowired @Autowired
private JCSRemoteService jcsRemoteService; private JCSRemoteService jcsRemoteService;
@Autowired
private EquipmentSpecificMapper equipmentSpecificMapper;
@Autowired
private VideoMapper videoMapper;
@Value("${systemctl.sync.switch}") @Value("${systemctl.sync.switch}")
private Boolean syncSwitch; private Boolean syncSwitch;
...@@ -2343,4 +2350,67 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2343,4 +2350,67 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return fireFightingSystemMapper.getStationStatusStatistics(); return fireFightingSystemMapper.getStationStatusStatistics();
} }
@Override
public void resetMorphic() {
try {
QueryWrapper<SourceScene> wrapper = new QueryWrapper();
List<SourceScene> sourceScenes = sourceSceneMapper.selectList(wrapper);
if(!ObjectUtils.isEmpty(sourceScenes)){
for(SourceScene sourceScene:sourceScenes){
ResourceDTO resourceDTO = Morphic.morphicSubjectClient.seleteOne(sourceScene.getSceneId()).getResult();
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();
}
}
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);
}
}
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new BadRequest("保存画布失败");
}
}
} }
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