Commit 79b9b57c authored by KeYong's avatar KeYong

提交应急4.0相关功能

parent bdc2d581
......@@ -7,6 +7,9 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
* 数据字典
*
......@@ -51,10 +54,22 @@ public class DataDictionary extends BaseEntity {
@ApiModelProperty(value = "树code")
@TableField(exist = false)
private String treeCode;
private String treeCode;
@ApiModelProperty(value = "数量")
@TableField(exist = false)
private String num;
@ApiModelProperty(value = "树id")
@TableField(exist = false)
private String id;
@ApiModelProperty(value = "树父节点id")
@TableField(exist = false)
private Long parentId;
@ApiModelProperty(value = "子类")
@TableField(exist = false)
private List<DataDictionary> children;
}
......@@ -84,6 +84,17 @@ public class SocialPowerController extends AbstractBaseController {
@PutMapping(value = "/update")
@ApiOperation(httpMethod = "PUT", value = "根据id更新社会力量", notes = "根据id更新社会力量")
public ResponseModel<SocialPower> updateByIdWlSocialPower(@RequestBody SocialPower model) {
model.setContactUser(StringUtil.isNotEmpty(model.getContactUser()) ? model.getContactUser() : null);
model.setContactPhone(StringUtil.isNotEmpty(model.getContactPhone()) ? model.getContactPhone() : null);
model.setArrivalDistance(StringUtil.isNotEmpty(model.getArrivalDistance()) ? model.getArrivalDistance() : null);
model.setArrivalTime(StringUtil.isNotEmpty(model.getArrivalTime()) ? model.getArrivalTime() : null);
model.setRemark(StringUtil.isNotEmpty(model.getRemark()) ? model.getRemark() : null);
model.setAttachFiles(CollectionUtils.isEmpty(model.getAttachFiles()) ? null : model.getAttachFiles());
if (CollectionUtils.isEmpty(model.getAttachFiles())) {
Map<String, Object> map = new HashMap<>();
map.put("object_id", model.getId());
iUploadFileService.removeByMap(map);
}
boolean bool = socialPowerService.updateById(model);
if (!CollectionUtils.isEmpty(model.getAttachFiles())) {
if (0 < model.getAttachFiles().size() && bool) {
......
......@@ -795,6 +795,12 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map<String, String> getSystemStateByIndexKey(@Param("code")String code, @Param("typeCode")String typeCode, @Param("equipmentCodeForStart")String equipmentCodeForStart,
@Param("indexKeyForStart")String indexKeyForStart, @Param("bizOrgCode")String bizOrgCode);
Map<String, String> getSystemSpecialEquipState(@Param("code")String code, @Param("typeCode")String typeCode, @Param("equipmentCodeForStart")String equipmentCodeForStart,
@Param("indexKeyForStart")String indexKeyForStart, @Param("bizOrgCode")String bizOrgCode);
Map<String, String> getFireFoamSystemStateByIndexKey(@Param("code")String code, @Param("typeCode")String typeCode, @Param("equipmentCodeForStart")String equipmentCodeForStart,
@Param("indexKeyForStart")String indexKeyForStart, @Param("bizOrgCode")String bizOrgCode);
List<Map<String, Object>> getWaterSystemLinkedEquip(@Param("code")String code, @Param("typeCode")String typeCode,
@Param("linkedEquipmentCode")String linkedEquipmentCode, @Param("linkedEquipmentIndexKey")String linkedEquipmentIndexKey,
@Param("bizOrgCode")String bizOrgCode);
......
......@@ -44,7 +44,6 @@ import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*;
import liquibase.pro.packaged.O;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.io.IOUtils;
......@@ -2941,10 +2940,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
List<SystemInfoDto> infoDtos = JSONObject.parseArray(json, SystemInfoDto.class);
SystemInfoDto dto = infoDtos.stream().filter(x -> "泡沫消防系统".equals(x.getName())).collect(Collectors.toList()).get(0);
Map<String, String> systemState = fireFightingSystemMapper.getSystemStateByIndexKey(dto.getCode(), dto.getTypeCode(), dto.getEquipmentCodeForStart(),
Map<String, String> systemState = fireFightingSystemMapper.getFireFoamSystemStateByIndexKey(dto.getCode(), dto.getTypeCode(), dto.getEquipmentCodeForStart(),
dto.getIndexKeyForStart(), bizOrgCode);
resMap.put("status", ObjectUtils.isEmpty(systemState) ? "--" : systemState.get("status"));
Map<String, String> systemSpecialEquipState = fireFightingSystemMapper.getSystemStateByIndexKey(dto.getCode(), dto.getTypeCode(),
resMap.put("system", ObjectUtils.isEmpty(systemState) ? "--" : systemState.get("status"));
Map<String, String> systemSpecialEquipState = fireFightingSystemMapper.getSystemSpecialEquipState(dto.getCode(), dto.getTypeCode(),
dto.getEquipmentCodeForSpecialEquip(), dto.getIndexKeyForSpecialEquip(), bizOrgCode);
resMap.put("cabinet", ObjectUtils.isEmpty(systemSpecialEquipState) ? "--" : systemSpecialEquipState.get("status"));
List<Map<String, Object>> systemEquipInfoList = fireFightingSystemMapper.getSystemFoamTankInfoListByIndexKey(dto.getCode(), dto.getTypeCode(), dto.getLinkedEquipmentCode(), dto.getLinkedEquipmentIndexKey(), bizOrgCode);
......@@ -3148,15 +3147,28 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<DataDictionary> childMenu = new ArrayList<>();
for (DataDictionary mu : menuList) {
//遍历出父id等于参数的id,add进子节点集合
if (mu.getTreeCode() == treeCode) {
if (mu.getTreeCode().equals(treeCode)) {
//递归遍历下一级
treeMenuList(menuList, mu.getTreeCode());
childMenu.add(mu);
childMenu = getChildren(mu.getChildren(), treeCode);
break;
}
}
return childMenu;
}
public static List<DataDictionary> getChildren(List<DataDictionary> list, String pid) {
List<DataDictionary> voList = new ArrayList<>();
for (DataDictionary vo : list) {
//遍历出父id等于参数的id,add进子节点集合
if (!ObjectUtils.isEmpty(vo.getParentId()) && 0 != vo.getParentId() && String.valueOf(vo.getParentId()).equals(pid)) {
//递归遍历下一级
getChildren(list, vo.getId());
voList.add(vo);
}
}
return voList;
}
@Override
public List<EquipCountBySystemVO> getFireEquipConfigInfo(String bizOrgCode) {
List<DataDictionary> fireConfigInfoList = jcsFeignClient.getDictListByType("ZYGL_XFQC").getResult();
......
......@@ -19,7 +19,7 @@
"indexKeyForStart": "WSS_Host_RunStatus",
"nameForSpecialEquip": "泡沫消防控制柜",
"equipmentCodeForSpecialEquip": "92040700",
"indexKeyForSpecialEquip": "FAS_TemperatureCable_Fault",
"indexKeyForSpecialEquip": "",
"linkedEquipmentCode": "92031900",
"linkedEquipmentIndexKey": ""
}
......
......@@ -7789,6 +7789,7 @@
equipment_specific_id
ORDER BY
update_date DESC
LIMIT 1
</select>
<select id="getWaterSystemLinkedEquip" resultType="java.util.Map">
......@@ -7796,7 +7797,13 @@
spe.id,
spe.`name`,
spe.`code`,
CASE when 'false' = spe.realtime_iot_index_value or spe.realtime_iot_index_value is null or spe.realtime_iot_index_value = '' then '正常' ELSE spe.realtime_iot_index_name END as status,
IFNULL((SELECT CASE
WHEN wesi.value = 'true' THEN
'开启'
WHEN (wesi.value = 'false') THEN
'关闭'
ELSE '--'
END AS systemStatus FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = spe.id AND equipment_index_key = 'WSS_DelugeValve_Start' ), '--' ) AS status,
wle.shbz_img shbzImg,
ei.is_alarm AS type,
IFNULL( spe.realtime_iot_index_value, '--' ) AS realtimeValue,
......@@ -7854,10 +7861,119 @@
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'volume' ), 0 ) AS volume
FROM
wl_equipment_specific wes
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, wes.system_id )
WHERE
wes.equipment_code LIKE concat( '920319', '%' )
fs.system_type_code IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<if test="code != null and code != ''">
AND fs.code = #{code}
</if>
<if test="typeCode != null and typeCode != ''">
AND fs.system_type_code = #{typeCode}
</if>
<if test="linkedEquipmentCode != null and linkedEquipmentCode != ''">
AND wes.equipment_code LIKE concat(#{linkedEquipmentCode}, '%' )
</if>
) temp
ORDER BY temp.nowLevel DESC
</select>
<select id="getFireFoamSystemStateByIndexKey" resultType="java.util.Map">
SELECT
IFNULL(systemStatus, '--') AS status
FROM
(
SELECT
wesi.equipment_specific_id,
CASE
WHEN (wesi.value = 'false' and wesi.equipment_index_key = 'FFS_Host_SystemHalt') or (wesi.value = 'true' and wesi.equipment_index_key = 'FFS_Host_SystemActions') THEN
'开启'
WHEN (wesi.value = 'true' and wesi.equipment_index_key = 'FFS_Host_SystemHalt') or (wesi.value = 'false' and wesi.equipment_index_key = 'FFS_Host_SystemActions') THEN
'关闭'
ELSE
'--'
END AS systemStatus,
wesi.update_date,
ROW_NUMBER() OVER ( PARTITION BY wesi.equipment_specific_id ORDER BY wesi.update_date DESC ) AS rn
FROM
wl_equipment_specific_index wesi
JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, wes.system_id )
<where>
fs.system_type_code IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<if test="code != null and code != ''">
AND fs.code = #{code}
</if>
<if test="typeCode != null and typeCode != ''">
AND fs.system_type_code = #{typeCode}
</if>
<!-- <if test="indexKeyForStart != null and indexKeyForStart != ''">-->
<!-- AND wesi.equipment_index_key = #{indexKeyForStart}-->
<!-- </if>-->
<if test="equipmentCodeForStart != null and equipmentCodeForStart != ''">
AND LOCATE(#{equipmentCodeForStart}, wes.equipment_code) > 0
</if>
AND wesi.equipment_index_key IN ('FFS_Host_SystemHalt', 'FFS_Host_SystemActions')
</where>
) t
WHERE
t.rn = 1
GROUP BY
equipment_specific_id
ORDER BY
update_date DESC
LIMIT 1
</select>
<select id="getSystemSpecialEquipState" resultType="java.util.Map">
SELECT
IFNULL(systemStatus, '--') AS status
FROM
(
SELECT
wesi.equipment_specific_id,
CASE
WHEN (wesi.value = 'false' and wesi.equipment_index_key = 'FFS_Host_AutomaticStatus') or (wesi.value = 'true' and wesi.equipment_index_key = 'FFS_Host_ManualState') THEN
'手动'
WHEN (wesi.value = 'true' and wesi.equipment_index_key = 'FFS_Host_AutomaticStatus') or (wesi.value = 'false' and wesi.equipment_index_key = 'FFS_Host_ManualState') THEN
'自动'
ELSE
'--'
END AS systemStatus,
wesi.update_date,
ROW_NUMBER() OVER ( PARTITION BY wesi.equipment_specific_id ORDER BY wesi.update_date DESC ) AS rn
FROM
wl_equipment_specific_index wesi
JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, wes.system_id )
<where>
fs.system_type_code IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<if test="code != null and code != ''">
AND fs.code = #{code}
</if>
<if test="typeCode != null and typeCode != ''">
AND fs.system_type_code = #{typeCode}
</if>
<if test="equipmentCodeForStart != null and equipmentCodeForStart != ''">
AND LOCATE(#{equipmentCodeForStart}, wes.equipment_code) > 0
</if>
AND wesi.equipment_index_key IN ('FFS_Host_AutomaticStatus', 'FFS_Host_ManualState')
</where>
) t
WHERE
t.rn = 1
GROUP BY
equipment_specific_id
ORDER BY
update_date DESC
LIMIT 1
</select>
</mapper>
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