Commit 2e23c0a5 authored by KeYong's avatar KeYong

Merge branch 'develop_ccs' of 172.16.10.76:moa/amos-boot-biz into develop_ccs

parents 77c46594 6a70aff4
...@@ -79,26 +79,13 @@ public class PermissionInterceptor implements Interceptor { ...@@ -79,26 +79,13 @@ public class PermissionInterceptor implements Interceptor {
if(!ValidationUtil.isEmpty(dataAuth)){ if(!ValidationUtil.isEmpty(dataAuth)){
dataAuthRule = !ValidationUtil.isEmpty(dataAuthRule) ? dataAuthRule : dataAuth.interfacePath(); dataAuthRule = !ValidationUtil.isEmpty(dataAuthRule) ? dataAuthRule : dataAuth.interfacePath();
} }
// 数据权限地址为空返回空数据
if(ValidationUtil.isEmpty(dataAuthRule)){
// method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext.clean();
return method.getReturnType().isPrimitive() ? invocation.proceed() : null;
}
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId() ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId()
, RequestContext.getToken())).toString(), ReginParams.class); , RequestContext.getToken())).toString(), ReginParams.class);
if (ValidationUtil.isEmpty(reginParam) || ValidationUtil.isEmpty(reginParam.getUserModel())) {
// method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext.clean();
return method.getReturnType().isPrimitive() ? invocation.proceed() : null;
}
// 用户数据权限配置信息 // 用户数据权限配置信息
Map<String, List<PermissionDataruleModel>> dataAuthorization = Privilege.permissionDataruleClient.queryByUser(reginParam.getUserModel().getUserId(), Map<String, List<PermissionDataruleModel>> dataAuthorization = null;
dataAuthRule).getResult(); if (!ValidationUtil.isEmpty(reginParam) && !ValidationUtil.isEmpty(reginParam.getUserModel())) {
// 没有数据权限直接返回空数据 dataAuthorization = Privilege.permissionDataruleClient.queryByUser(reginParam.getUserModel().getUserId(),
if (ValidationUtil.isEmpty(dataAuthorization)) { dataAuthRule).getResult();
PermissionInterceptorContext.clean();
return method.getReturnType().isPrimitive() ? invocation.proceed() : null;
} }
BoundSql boundSql = (BoundSql) metaObject.getValue("delegate.boundSql"); BoundSql boundSql = (BoundSql) metaObject.getValue("delegate.boundSql");
...@@ -194,15 +181,19 @@ public class PermissionInterceptor implements Interceptor { ...@@ -194,15 +181,19 @@ public class PermissionInterceptor implements Interceptor {
mainTable : selectBody.getFromItem().getAlias().getName(); mainTable : selectBody.getFromItem().getAlias().getName();
String authSql; String authSql;
// 过滤没有配置数据权限的用户组 if (ValidationUtil.isEmpty(dataAuthorization)) {
Map<String, List<PermissionDataruleModel>> nonEmptyDataAuthorization =
dataAuthorization.entrySet().stream().filter(map -> !ValidationUtil.isEmpty(map.getValue())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
// 没有配置数据权限直接返回 false 条件
if (ValidationUtil.isEmpty(nonEmptyDataAuthorization)) {
authSql = falseCondition; authSql = falseCondition;
} else { } else {
// 解析数据权限sql // 过滤没有配置数据权限的用户组
authSql = parseDataAuthorization(nonEmptyDataAuthorization, reginParams, mainTableAlias, boundSql); Map<String, List<PermissionDataruleModel>> nonEmptyDataAuthorization =
dataAuthorization.entrySet().stream().filter(map -> !ValidationUtil.isEmpty(map.getValue())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
// 没有配置数据权限直接返回 false 条件
if (ValidationUtil.isEmpty(nonEmptyDataAuthorization)) {
authSql = falseCondition;
} else {
// 解析数据权限sql
authSql = parseDataAuthorization(nonEmptyDataAuthorization, reginParams, mainTableAlias, boundSql);
}
} }
// 替换数据权限 // 替换数据权限
if (!ValidationUtil.isEmpty(authSql)) { if (!ValidationUtil.isEmpty(authSql)) {
......
...@@ -58,7 +58,7 @@ public class MyBatisPlusConfig { ...@@ -58,7 +58,7 @@ public class MyBatisPlusConfig {
}; };
} }
@ConditionalOnProperty(name = "mybatis.interceptor.enabled",havingValue = "true") @ConditionalOnProperty(name = "mybatis.interceptor.enabled",havingValue = "true", matchIfMissing = true)
@Bean @Bean
public PermissionInterceptor permissionInterceptor() { public PermissionInterceptor permissionInterceptor() {
return new PermissionInterceptor(); return new PermissionInterceptor();
......
package com.yeejoin.amos.boot.module.common.api.dto; package com.yeejoin.amos.boot.module.common.api.dto;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint; import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date;
/** /**
* 微型消防站 * 微型消防站
* *
...@@ -38,6 +39,9 @@ public class FireStationDto extends BaseDto { ...@@ -38,6 +39,9 @@ public class FireStationDto extends BaseDto {
@ExcelProperty(value = "所在建筑", index = 1) @ExcelProperty(value = "所在建筑", index = 1)
@ApiModelProperty(value = "所在建筑物名称") @ApiModelProperty(value = "所在建筑物名称")
private String whereBuilding; private String whereBuilding;
@ExcelIgnore
private String parentBuildingId;
@ExcelProperty(value = "地址", index = 2) @ExcelProperty(value = "地址", index = 2)
@ApiModelProperty(value = "地址") @ApiModelProperty(value = "地址")
......
...@@ -37,6 +37,9 @@ public class KeySiteDto extends BaseDto implements Serializable{ ...@@ -37,6 +37,9 @@ public class KeySiteDto extends BaseDto implements Serializable{
@ApiModelProperty(value = "所属建筑id") @ApiModelProperty(value = "所属建筑id")
private Long buildingId; private Long buildingId;
@ApiModelProperty("当前所在建筑物id的所有父节点id")
private String parentBuildingId;
@ApiModelProperty(value = "所属建筑名称") @ApiModelProperty(value = "所属建筑名称")
private String buildingName; private String buildingName;
......
...@@ -29,7 +29,7 @@ public class KeySiteExcleDto implements Serializable { ...@@ -29,7 +29,7 @@ public class KeySiteExcleDto implements Serializable {
private String name; private String name;
@ExcelProperty(value = "所属单位/部门id", index = 1) @ExcelProperty(value = "所属单位/部门id", index = 1)
@ExplicitConstraint(indexNum = 1, sourceClass = CommonExplicitConstraint.class, method = "getkeySiteCompanyDetailTree") //固定下拉内容 @ExplicitConstraint(indexNum = 1, sourceClass = CommonExplicitConstraint.class, method = "getKeySiteCompanyDetailTree") //固定下拉内容
@ApiModelProperty(value = "所属单位/部门id") @ApiModelProperty(value = "所属单位/部门id")
private String belongName; private String belongName;
......
...@@ -37,6 +37,9 @@ public class FireStation extends BaseEntity { ...@@ -37,6 +37,9 @@ public class FireStation extends BaseEntity {
@ApiModelProperty(value = "所在建筑物名称") @ApiModelProperty(value = "所在建筑物名称")
private String whereBuilding; private String whereBuilding;
@ApiModelProperty("当前所在建筑物id的所有父节点id")
private String parentBuildingId;
@ApiModelProperty(value = "装备简要情况") @ApiModelProperty(value = "装备简要情况")
private String equipmentBrief; private String equipmentBrief;
......
...@@ -33,7 +33,7 @@ public class KeySite extends BaseEntity { ...@@ -33,7 +33,7 @@ public class KeySite extends BaseEntity {
*/ */
@TableField("belong_id") @TableField("belong_id")
private Long belongId; private Long belongId;
/** /**
* 所属单位/部门名称 * 所属单位/部门名称
...@@ -46,6 +46,12 @@ public class KeySite extends BaseEntity { ...@@ -46,6 +46,12 @@ public class KeySite extends BaseEntity {
@TableField("building_id") @TableField("building_id")
private Long buildingId; private Long buildingId;
/**
* 所属父节点的建筑id集合
*/
@TableField("parent_building_id")
private String parentBuildingId;
@TableField("building_name") @TableField("building_name")
private String buildingName; private String buildingName;
......
...@@ -4,8 +4,8 @@ import java.util.LinkedHashMap; ...@@ -4,8 +4,8 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig; import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.boot.module.common.api.dto.EquipmentIndexDto; import com.yeejoin.amos.boot.module.common.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.common.api.dto.PerfQuotaIotDTO; import com.yeejoin.amos.boot.module.common.api.dto.PerfQuotaIotDTO;
...@@ -367,4 +368,10 @@ public interface EquipFeignClient { ...@@ -367,4 +368,10 @@ public interface EquipFeignClient {
//获取消防装备权限 //获取消防装备权限
@RequestMapping(value = "/equipment-detail/permissions/export", method = RequestMethod.GET) @RequestMapping(value = "/equipment-detail/permissions/export", method = RequestMethod.GET)
ResponseModel<ReginParams> getPermissions() ; ResponseModel<ReginParams> getPermissions() ;
@RequestMapping(value = "/building/getBuildingList", method = RequestMethod.GET)
ResponseModel<List<Map<String, Object>>> getBuildingTreeList();
@RequestMapping(value = "/building/companyBuildingTree", method = RequestMethod.GET)
public ResponseModel<Object> getCompanyBuildingTree();
} }
...@@ -29,9 +29,10 @@ public interface FireStationMapper extends BaseMapper<FireStation> { ...@@ -29,9 +29,10 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
+ "<if test='par.bizCompanyCode!=null'> and a.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>" + "<if test='par.bizCompanyCode!=null'> and a.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+ "<if test='par.address!=null'> and a.address like CONCAT('',#{par.address},'%') </if>" + "<if test='par.address!=null'> and a.address like CONCAT('',#{par.address},'%') </if>"
+ "<if test='par.bizOrgCode != null'> and a.biz_org_code like CONCAT(#{par.bizOrgCode},'%') </if>" + "<if test='par.bizOrgCode != null'> and a.biz_org_code like CONCAT(#{par.bizOrgCode},'%') </if>"
+"<if test='nodeIds != null' > AND where_building_id in <foreach collection='nodeIds' item='buildingId' open='(' close=')' separator=','> #{buildingId} </foreach></if>"
+" order by a.rec_date desc limit #{pageNum},#{pageSize}" +" order by a.rec_date desc limit #{pageNum},#{pageSize}"
+ "</script>") + "</script>")
List<FireStationDto>getFireStation(@Param("pageNum")int pageNum,@Param("pageSize")int pageSize,@Param("par")FireStationDto par); List<FireStationDto>getFireStation(@Param("pageNum")int pageNum,@Param("pageSize")int pageSize,@Param("par")FireStationDto par,List<String> nodeIds);
@Select("<script>" @Select("<script>"
+ "select COUNT(cb_fire_station.sequence_nbr) num from cb_fire_station where cb_fire_station.is_delete=0 " + "select COUNT(cb_fire_station.sequence_nbr) num from cb_fire_station where cb_fire_station.is_delete=0 "
+ "<if test='par.name!=null'> and cb_fire_station.name like CONCAT('%',#{par.name},'%') </if>" + "<if test='par.name!=null'> and cb_fire_station.name like CONCAT('%',#{par.name},'%') </if>"
...@@ -39,8 +40,9 @@ public interface FireStationMapper extends BaseMapper<FireStation> { ...@@ -39,8 +40,9 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
+ "<if test='par.bizCompanyCode!=null'> and cb_fire_station.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>" + "<if test='par.bizCompanyCode!=null'> and cb_fire_station.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+ "<if test='par.address!=null'> and cb_fire_station.address like CONCAT('',#{par.address},'%') </if>" + "<if test='par.address!=null'> and cb_fire_station.address like CONCAT('',#{par.address},'%') </if>"
+ "<if test='par.bizOrgCode != null'> and biz_org_code like CONCAT(#{par.bizOrgCode},'%') </if>" + "<if test='par.bizOrgCode != null'> and biz_org_code like CONCAT(#{par.bizOrgCode},'%') </if>"
+"<if test='nodeIds != null' > AND where_building_id in <foreach collection='nodeIds' item='buildingId' open='(' close=')' separator=','> #{buildingId} </foreach></if>"
+ "</script>") + "</script>")
Map<String, Long> getFireStationCount(@Param("par")FireStationDto par); Map<String, Long> getFireStationCount(@Param("par")FireStationDto par,List<String> nodeIds);
...@@ -58,4 +60,6 @@ public interface FireStationMapper extends BaseMapper<FireStation> { ...@@ -58,4 +60,6 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
Integer getStationListCount(@Param("par")RequestData par); Integer getStationListCount(@Param("par")RequestData par);
FireStationDto getFireStationDetails(Long id); FireStationDto getFireStationDetails(Long id);
List<Map<String, Object>> getfireStatioCount(String bizOrgCode);
} }
package com.yeejoin.amos.boot.module.common.api.mapper; package com.yeejoin.amos.boot.module.common.api.mapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -7,9 +10,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto; ...@@ -7,9 +10,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite; import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
import java.util.List;
import java.util.Map;
/** /**
* 重点部位 Mapper 接口 * 重点部位 Mapper 接口
* *
...@@ -21,7 +21,7 @@ public interface KeySiteMapper extends BaseMapper<KeySite> { ...@@ -21,7 +21,7 @@ public interface KeySiteMapper extends BaseMapper<KeySite> {
* 分页查询 * 分页查询
*/ */
public IPage<KeySiteDto> getPageList(Page<KeySiteDto> page, String name, Long buildingId, String fireEnduranceRate, public IPage<KeySiteDto> getPageList(Page<KeySiteDto> page, String name, List<Long> buildingIds, String fireEnduranceRate,
String useNature, String fireFacilitiesInfo, String bizOrgCode); String useNature, String fireFacilitiesInfo, String bizOrgCode);
/** /**
* 获取所有的重点部位数据 * 获取所有的重点部位数据
...@@ -40,4 +40,11 @@ public KeySiteDto getSequenceNbr(Long sequenceNbr); ...@@ -40,4 +40,11 @@ public KeySiteDto getSequenceNbr(Long sequenceNbr);
public List<KeySiteDateDto> getKeySiteDate(Long id); public List<KeySiteDateDto> getKeySiteDate(Long id);
public List<String> getAddress(); public List<String> getAddress();
/**
* 查询该单位下对应建筑的重点部位数量
* @param belong_id
* @return
*/
public List<Map<String, Object>> getKeySiteCount(String bizOrgCode);
} }
...@@ -114,4 +114,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -114,4 +114,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> listByOrgTypes(@Param("orgTypeList") List<String> orgTypeList,@Param("bizOrgCode") String bizOrgCode); List<OrgUsr> listByOrgTypes(@Param("orgTypeList") List<String> orgTypeList,@Param("bizOrgCode") String bizOrgCode);
String getParentList(@Param("id") String id); String getParentList(@Param("id") String id);
List<OrgUsr> selectPersonListByCompanyIdList(@Param("companyIdList") List<String> companyIdList);
} }
package com.yeejoin.amos.boot.module.common.api.service; package com.yeejoin.amos.boot.module.common.api.service;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
...@@ -8,8 +11,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto; ...@@ -8,8 +11,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite; import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import java.util.List;
/** /**
* 重点部位接口类 * 重点部位接口类
* *
...@@ -75,4 +76,10 @@ public List<KeySiteDateDto> getKeySiteDate(Long id); ...@@ -75,4 +76,10 @@ public List<KeySiteDateDto> getKeySiteDate(Long id);
public List<KeySite> getKeySiteDateByNameLike(Long companyId); public List<KeySite> getKeySiteDateByNameLike(Long companyId);
public List<Map<String, Object>> keySiteCountAndBuildingTree(String bizOrgCode);
public Map<String, String> getNodeAllParentIds(List<String> ids) ;
public List<Long> getNodeAllnodeIds(Long id) ;
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.FireStationMapper"> <mapper
namespace="com.yeejoin.amos.boot.module.common.api.mapper.FireStationMapper">
<select id="getStationList" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto"> <select id="getStationList"
resultType="com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto">
SELECT SELECT
a.sequence_nbr sequenceNbr, a.sequence_nbr sequenceNbr,
a.person_charge_name personChargeName, a.person_charge_name personChargeName,
a.longitude, a.longitude,
a.name, a.name,
a.latitude, a.latitude,
a.person_charge_telephone personChargeTelephone, a.person_charge_telephone personChargeTelephone,
(SELECT count(i.instance_id) (SELECT count(i.instance_id)
from from
cb_dynamic_form_instance i cb_dynamic_form_instance i
where where
i.field_value = a.sequence_nbr ) As userNum, i.field_value = a.sequence_nbr ) As userNum,
(SELECT COUNT(*)FROM jc_firestation_jacket WHERE firefighters_id = a.sequence_nbr and is_delete =0) AS eqNum, (SELECT COUNT(*)FROM jc_firestation_jacket WHERE firefighters_id =
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance a.sequence_nbr and is_delete =0) AS eqNum,
FROM cb_fire_station a Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
where a.is_delete=0 and a.longitude is not null and a.latitude is not null AS distance
<if test='par.distance!=null'> FROM cb_fire_station a
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= #{par.distance} where a.is_delete=0 and a.longitude is not null and a.latitude is not null
</if> <if test='par.distance!=null'>
ORDER BY distance limit #{pageNum},#{pageSize} Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
</select> &lt;= #{par.distance}
</if>
ORDER BY distance limit #{pageNum},#{pageSize}
</select>
<select id="getStationListCount" resultType="Integer"> <select id="getStationListCount" resultType="Integer">
SELECT SELECT
COUNT(a.sequence_nbr) num COUNT(a.sequence_nbr) num
FROM cb_fire_station a FROM cb_fire_station a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if test='par.distance!=null'> <if test='par.distance!=null'>
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= #{par.distance} Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
</if> &lt;= #{par.distance}
</select> </if>
</select>
<select id="getFireStationDetails" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireStationDto"> <select id="getFireStationDetails"
SELECT resultType="com.yeejoin.amos.boot.module.common.api.dto.FireStationDto">
a.*, SELECT
(SELECT a.*,
count(i.instance_id) (SELECT
from count(i.instance_id)
cb_dynamic_form_instance i from
where cb_dynamic_form_instance i
i.field_value = #{id}) As userNum where
FROM cb_fire_station a i.field_value = #{id}) As userNum
where FROM cb_fire_station a
a.sequence_nbr = #{id} where
</select> a.sequence_nbr = #{id}
</select>
<select id="getfireStatioCount" resultType="map">
SELECT
parent_building_id,
count(1) as count
FROM
cb_fire_station
WHERE is_delete= false
and parent_building_id is not null
<if test="bizOrgCode != null and bizOrgCode != ''">
AND biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
where_building_id
</select>
</mapper> </mapper>
...@@ -3,22 +3,27 @@ ...@@ -3,22 +3,27 @@
<mapper <mapper
namespace="com.yeejoin.amos.boot.module.common.api.mapper.KeySiteMapper"> namespace="com.yeejoin.amos.boot.module.common.api.mapper.KeySiteMapper">
<select id="getPageList" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"> <select id="getPageList"
resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto">
SELECT SELECT
c.`name` as name, c.`name` as name,
c.belong_id as belongId, c.belong_id as belongId,
c.biz_org_name as belongName, c.biz_org_name as
belongName,
c.building_id as buildingId, c.building_id as buildingId,
c.building_name as buildingName, c.building_name as
buildingName,
c.address_desc as addressDesc, c.address_desc as addressDesc,
c.building_area as buildingArea, c.building_area as
buildingArea,
c.building_height as buildingHeight, c.building_height as buildingHeight,
c.fire_endurance_rate as fireEnduranceRate, c.fire_endurance_rate as fireEnduranceRate,
c.use_nature as useNature, c.use_nature as useNature,
c.charge_person AS chargePerson, c.charge_person AS chargePerson,
c.sequence_nbr AS sequenceNbr, c.sequence_nbr AS sequenceNbr,
c.charge_person_id AS chargePersonId, c.charge_person_id AS chargePersonId,
c.key_prevention_reason AS keyPreventionReason, c.key_prevention_reason AS
keyPreventionReason,
c.fire_facilities_info AS fireFacilitiesInfo, c.fire_facilities_info AS fireFacilitiesInfo,
c.fire_prevention_flag AS firePreventionFlag, c.fire_prevention_flag AS firePreventionFlag,
c.hazard AS hazard, c.hazard AS hazard,
...@@ -27,9 +32,11 @@ ...@@ -27,9 +32,11 @@
c.remark AS remark, c.remark AS remark,
c.is_delete AS isDelete, c.is_delete AS isDelete,
c.rec_user_id AS recUserId, c.rec_user_id AS recUserId,
c.rec_user_name AS recUserName, c.rec_user_name AS
recUserName,
c.rec_date AS recDate, c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName, c.fire_endurance_rate_name as
fireEnduranceRateName,
c.use_nature_name as useNatureName c.use_nature_name as useNatureName
FROM FROM
cb_key_site c cb_key_site c
...@@ -37,8 +44,11 @@ ...@@ -37,8 +44,11 @@
<if test="name != null and name != ''"> <if test="name != null and name != ''">
AND c.`name` like concat('%',#{name}, '%') AND c.`name` like concat('%',#{name}, '%')
</if> </if>
<if test="buildingId != null and buildingId != -1"> <if test="buildingIds != null">
AND c.`building_id`= #{buildingId} AND c.`building_id` in
<foreach collection="buildingIds" item="buildingId" open="(" close=")" separator=",">
#{buildingId}
</foreach>
</if> </if>
<if test="fireEnduranceRate != null and fireEnduranceRate != ''"> <if test="fireEnduranceRate != null and fireEnduranceRate != ''">
AND c.`fire_endurance_rate`= #{fireEnduranceRate} AND c.`fire_endurance_rate`= #{fireEnduranceRate}
...@@ -54,69 +64,72 @@ ...@@ -54,69 +64,72 @@
</if> </if>
order by c.rec_date desc order by c.rec_date desc
</select> </select>
<select id="getSequenceNbr" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"> <select id="getSequenceNbr"
SELECT c.`name` as name, resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto">
c.belong_id as belongId, SELECT c.`name` as name,
cou.biz_org_name as belongName, c.belong_id as belongId,
c.building_id as buildingId, cou.biz_org_name as belongName,
c.building_name as buildingName, c.building_id as buildingId,
c.address_desc as addressDesc, c.building_name as buildingName,
c.building_area as buildingArea, c.address_desc as addressDesc,
c.building_height as buildingHeight, c.building_area as buildingArea,
c.fire_endurance_rate as fireEnduranceRate, c.building_height as buildingHeight,
c.use_nature as useNature, c.fire_endurance_rate as fireEnduranceRate,
c.charge_person AS chargePerson, c.use_nature as useNature,
c.sequence_nbr AS sequenceNbr, c.charge_person AS chargePerson,
c.charge_person_id AS chargePersonId, c.sequence_nbr AS sequenceNbr,
c.key_prevention_reason AS keyPreventionReason, c.charge_person_id AS chargePersonId,
c.fire_facilities_info AS fireFacilitiesInfo, c.key_prevention_reason AS keyPreventionReason,
c.fire_prevention_flag AS firePreventionFlag, c.fire_facilities_info AS fireFacilitiesInfo,
c.hazard AS hazard, c.fire_prevention_flag AS firePreventionFlag,
c.safety_management_measures AS safetyManagementMeasures, c.hazard AS hazard,
c.preventive_measures AS preventiveMeasures, c.safety_management_measures AS safetyManagementMeasures,
c.remark AS remark, c.preventive_measures AS preventiveMeasures,
c.is_delete AS isDelete, c.remark AS remark,
c.rec_user_id AS recUserId, c.is_delete AS isDelete,
c.rec_user_name AS recUserName, c.rec_user_id AS recUserId,
c.rec_date AS recDate, c.rec_user_name AS recUserName,
c.fire_endurance_rate_name as fireEnduranceRateName, c.rec_date AS recDate,
c.use_nature_name as useNatureName, c.fire_endurance_rate_name as fireEnduranceRateName,
c.biz_org_name as bizOrgName, c.use_nature_name as useNatureName,
c.biz_org_code as bizOrgCode c.biz_org_name as bizOrgName,
c.biz_org_code as bizOrgCode
FROM cb_key_site c FROM cb_key_site c
left join cb_org_usr cou on c.belong_id = cou.sequence_nbr left join cb_org_usr cou on c.belong_id = cou.sequence_nbr
where c.sequence_nbr = #{sequenceNbr} where
and c.is_delete = FALSE; c.sequence_nbr = #{sequenceNbr}
and c.is_delete = FALSE;
</select> </select>
<select id="getKeySiteList" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"> <select id="getKeySiteList"
SELECT c.`name` as name, resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto">
c.belong_id as belongId, SELECT c.`name` as name,
c.biz_org_name as belongName, c.belong_id as belongId,
c.building_id as buildingId, c.biz_org_name as belongName,
c.building_name as buildingName, c.building_id as buildingId,
c.address_desc as addressDesc, c.building_name as buildingName,
c.building_area as buildingArea, c.address_desc as addressDesc,
c.building_height as buildingHeight, c.building_area as buildingArea,
c.fire_endurance_rate as fireEnduranceRate, c.building_height as buildingHeight,
c.use_nature as useNature, c.fire_endurance_rate as fireEnduranceRate,
c.charge_person AS chargePerson, c.use_nature as useNature,
c.sequence_nbr AS sequenceNbr, c.charge_person AS chargePerson,
c.charge_person_id AS chargePersonId, c.sequence_nbr AS sequenceNbr,
c.key_prevention_reason AS keyPreventionReason, c.charge_person_id AS chargePersonId,
c.fire_facilities_info AS fireFacilitiesInfo, c.key_prevention_reason AS keyPreventionReason,
c.fire_prevention_flag AS firePreventionFlag, c.fire_facilities_info AS fireFacilitiesInfo,
c.hazard AS hazard, c.fire_prevention_flag AS firePreventionFlag,
c.safety_management_measures AS safetyManagementMeasures, c.hazard AS hazard,
c.preventive_measures AS preventiveMeasures, c.safety_management_measures AS safetyManagementMeasures,
c.remark AS remark, c.preventive_measures AS preventiveMeasures,
c.is_delete AS isDelete, c.remark AS remark,
c.rec_user_id AS recUserId, c.is_delete AS isDelete,
c.rec_user_name AS recUserName, c.rec_user_id AS recUserId,
c.rec_date AS recDate, c.rec_user_name AS recUserName,
c.fire_endurance_rate_name as fireEnduranceRateName, c.rec_date AS recDate,
c.use_nature_name as useNatureName c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName
FROM cb_key_site c FROM cb_key_site c
where c.is_delete = FALSE where c.is_delete = FALSE
<if test="name != null and name != ''"> <if test="name != null and name != ''">
...@@ -139,18 +152,22 @@ ...@@ -139,18 +152,22 @@
</if> </if>
</select> </select>
<select id="getKeySiteDate" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto"> <select id="getKeySiteDate"
resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto">
SELECT SELECT
c.sequence_nbr AS `key`, c.sequence_nbr AS `key`,
c.sequence_nbr AS `value`, c.sequence_nbr AS `value`,
c.`name` as label, c.`name` as
c.address_desc as fireLocation, label,
c.longitude as floorLongitude, c.address_desc as fireLocation,
c.latitude AS floorLatitude, c.longitude as floorLongitude,
cou.biz_org_name as belongName, c.latitude AS floorLatitude,
c.belong_id as belongId cou.biz_org_name as belongName,
FROM cb_key_site c LEFT JOIN cb_org_usr cou on cou.sequence_nbr = c.belong_id c.belong_id as belongId
where c.is_delete=FALSE FROM cb_key_site c LEFT JOIN
cb_org_usr cou on cou.sequence_nbr = c.belong_id
where
c.is_delete=FALSE
<if test="id != null and id != -1"> <if test="id != null and id != -1">
AND c.`belong_id`= #{id} AND c.`belong_id`= #{id}
</if> </if>
...@@ -158,14 +175,30 @@ ...@@ -158,14 +175,30 @@
<select id="getAddress" resultType="string"> <select id="getAddress" resultType="string">
SELECT SELECT
cb_key_site.address_desc cb_key_site.address_desc
FROM
cb_key_site
WHERE
cb_key_site.is_delete = FALSE AND
cb_key_site.address_desc IS NOT NULL AND
cb_key_site.address_desc != ''
GROUP BY
cb_key_site.address_desc
</select>
<select id="getKeySiteCount" resultType="map">
SELECT
parent_building_id,
count(1) as count
FROM FROM
cb_key_site cb_key_site
WHERE WHERE
cb_key_site.is_delete = FALSE AND is_delete=false
cb_key_site.address_desc IS NOT NULL AND and parent_building_id is not null
cb_key_site.address_desc != '' <if test="bizOrgCode != null and bizOrgCode != ''">
and biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY GROUP BY
cb_key_site.address_desc building_id
</select> </select>
</mapper> </mapper>
...@@ -824,7 +824,18 @@ LEFT JOIN ( ...@@ -824,7 +824,18 @@ LEFT JOIN (
<select id="getParentList" resultType="java.lang.String"> <select id="getParentList" resultType="java.lang.String">
select getParentList(#{id}) as id; select getParentList(#{id}) as id;
</select> </select>
<select id="selectPersonListByCompanyIdList"
resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
select *
from cb_org_usr
where biz_org_type = 'PERSON'
and is_delete = 0
and biz_org_code regexp
(select GROUP_CONCAT(biz_org_code SEPARATOR '|') from cb_org_usr where sequence_nbr in
<foreach collection="companyIdList" item="companyId" open="(" close=")" separator=",">
#{companyId}
</foreach>);
</select>
</mapper> </mapper>
...@@ -34,4 +34,7 @@ public class VideoSource { ...@@ -34,4 +34,7 @@ public class VideoSource {
@TableField(exist = false) @TableField(exist = false)
private Date createDate; private Date createDate;
@ApiModelProperty(value = "本级及父级建筑ids,冗余树形搜索")
private String parentSourceIds;
} }
...@@ -5,12 +5,6 @@ import io.swagger.annotations.ApiModel; ...@@ -5,12 +5,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
......
...@@ -32,6 +32,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -32,6 +32,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
...@@ -190,4 +191,12 @@ public class FireStationController extends BaseController { ...@@ -190,4 +191,12 @@ public class FireStationController extends BaseController {
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
return ResponseHelper.buildResponse(iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey())); return ResponseHelper.buildResponse(iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey()));
} }
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/fireStationCountAndBuildingTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登录人角色获取当前单位下的所在建筑的微型消防站统计值", notes = "根据登录人角色获取当前单位下的所在建筑的微型消防站统计值")
public ResponseModel<List<Map<String, Object>>> fireStationCountAndBuildingTree(
@RequestParam(required = false) String bizOrgCode) {
return ResponseHelper.buildResponse(fireStationServiceImpl.fireStationCountAndBuildingTree(bizOrgCode));
}
} }
...@@ -197,7 +197,29 @@ public class FireTeamController extends BaseController { ...@@ -197,7 +197,29 @@ public class FireTeamController extends BaseController {
return ResponseHelper.buildResponse(menus); return ResponseHelper.buildResponse(menus);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{companyId}/listTreetypeLikeCode", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "查询所属单位下消防队伍树", notes = "查询所属单位下消防队伍树")
public ResponseModel<List<Menu>> getlistTreeByCompanyIdLike(
@PathVariable(value = "companyId") String companyId) throws Exception {
QueryWrapper<FireTeam> fireTeamQueryWrapper = new QueryWrapper<>();
fireTeamQueryWrapper.eq("is_delete",0);
OrgUsr our=iOrgUsrService.getById(companyId);
//车辆装备需要判断
if(our.getParentId()!=null){
//判断是不是部门
if(our.getBizOrgType().equals("COMPANY")){
fireTeamQueryWrapper.likeRight("biz_org_code",our.getBizOrgCode());
}else{
String id= orgUsrMapper.getParentList(companyId);
OrgUsr ourf=iOrgUsrService.getById(id);
fireTeamQueryWrapper.likeRight("biz_org_code",ourf.getBizOrgCode());
}
}
List<Menu> menus = iFireTeamService.getTeamTreeLikeCode(fireTeamQueryWrapper);
return ResponseHelper.buildResponse(menus);
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{companyId}/getBizCode", method = RequestMethod.GET) @RequestMapping(value = "/{companyId}/getBizCode", method = RequestMethod.GET)
......
...@@ -178,15 +178,10 @@ public class OrgPersonController { ...@@ -178,15 +178,10 @@ public class OrgPersonController {
* *
* @return * @return
*/ */
@PersonIdentify
@TycloudOperation( ApiLevel = UserType.AGENCY) @TycloudOperation( ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询") @ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public ResponseModel<Object> listPage(@RequestParam Map<String, Object> requestBody) { public ResponseModel<Object> listPage(@RequestParam Map<String, Object> requestBody) {
// 权限处理
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
PermissionInterceptorContext.setDataAuthRule(authKey);
requestBody.put("bizOrgCode", reginParams.getPersonIdentity().getBizOrgCode());
return ResponseHelper.buildResponse(iOrgUsrService.pagePerson( return ResponseHelper.buildResponse(iOrgUsrService.pagePerson(
requestBody.containsKey("pageNum") ? requestBody.get("pageNum").toString() : null , requestBody.containsKey("pageNum") ? requestBody.get("pageNum").toString() : null ,
......
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
...@@ -31,6 +32,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -31,6 +32,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -706,5 +708,21 @@ public class OrgUsrController extends BaseController { ...@@ -706,5 +708,21 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse(menus); return ResponseHelper.buildResponse(menus);
} }
/**
* 查询多个组织机构下面的所有人员列表信息
*
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询多个组织机构下面的所有人员列表信息", notes = "查询多个组织机构下面的所有人员列表信息")
@GetMapping(value = "/company/person/list")
public ResponseModel<List<OrgUsr>> getPersonListByCompanyIdList(@RequestParam String companyIds) {
List<OrgUsr> orgUserList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(companyIds)) {
List<String> companyIdList = Lists.newArrayList(companyIds.split(","));
orgUserList = iOrgUsrService.getPersonListByCompanyIdList(companyIdList);
}
return ResponseHelper.buildResponse(orgUserList);
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant; import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
...@@ -12,6 +16,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -12,6 +16,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition; import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
...@@ -24,6 +29,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto; ...@@ -24,6 +29,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData; import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation; import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.FireStationMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FireStationMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper; import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFireStationService; import com.yeejoin.amos.boot.module.common.api.service.IFireStationService;
...@@ -43,8 +49,14 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat ...@@ -43,8 +49,14 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
FireStationMapper fireStationMapper; FireStationMapper fireStationMapper;
@Autowired @Autowired
OrgUsrMapper orgUsrMapper; OrgUsrMapper orgUsrMapper;
@Autowired @Autowired
OrgUsrServiceImpl orgUsrService; OrgUsrServiceImpl orgUsrService;
@Autowired
EquipFeignClient equipFeignClient;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -69,8 +81,12 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat ...@@ -69,8 +81,12 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
@Override @Override
public Page<FireStationDto> getFirefighters(int pageNum, int pageSize, FireStationDto par) { public Page<FireStationDto> getFirefighters(int pageNum, int pageSize, FireStationDto par) {
List<FireStationDto> list = fireStationMapper.getFireStation((pageNum - 1) * pageSize, pageSize, par); List<String> ids=null;
Map<String, Long> num = fireStationMapper.getFireStationCount(par); if(!"-1".equals(par.getWhereBuildingId())) {
ids= getNodeAllnodeIds(par.getWhereBuildingId());
}
List<FireStationDto> list = fireStationMapper.getFireStation((pageNum - 1) * pageSize, pageSize, par,ids);
Map<String, Long> num = fireStationMapper.getFireStationCount(par,ids);
Page<FireStationDto> pageBean = new Page<>(pageNum, pageSize, num.get("num")); Page<FireStationDto> pageBean = new Page<>(pageNum, pageSize, num.get("num"));
return pageBean.setRecords(list); return pageBean.setRecords(list);
} }
...@@ -200,4 +216,107 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat ...@@ -200,4 +216,107 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
root.setChildren(menuList); root.setChildren(menuList);
return Lists.newArrayList(root); return Lists.newArrayList(root);
} }
@SuppressWarnings("unchecked")
public List<Map<String, Object>> fireStationCountAndBuildingTree(String bizOrgCode) {
Map<String, Integer> FireStationCountMap = parseFireStationCount(bizOrgCode);
ResponseModel<Object> response = equipFeignClient.getBuildingTree();
List<Map<String, Object>> buildingMapList = (List<Map<String, Object>>) response.getResult();
if(buildingMapList==null || buildingMapList.size()<1) {
return null;
}
return parseTree((List<Map<String, Object>>)buildingMapList.get(0).get("children"),FireStationCountMap);
}
@SuppressWarnings("unchecked")
private List<Map<String, Object>> parseTree(List<Map<String, Object>> children,
Map<String, Integer> keySiteCountMap) {
if (!ValidationUtil.isEmpty(children)) {
for (Map<String, Object> child : children) {
if (child.get("id") != null) {
if (keySiteCountMap.containsKey(child.get("id").toString())) {
child.put("count",keySiteCountMap.get(child.get("id").toString()));
}else {
child.put("count",0);
}
}else {
child.put("count",0);
}
if (!ValidationUtil.isEmpty(child.get("children"))) {
parseTree((List<Map<String, Object>>) child.get("children"), keySiteCountMap);
}
}
}
return children;
}
private Map<String, Integer> parseFireStationCount(String bizOrgCode) {
Map<String, Integer> map = new HashMap<String, Integer>();
List<Map<String, Object>> list = fireStationMapper.getfireStatioCount(bizOrgCode);
for (Map<String, Object> map2 : list) {
Object parentBuilingIdString = map2.get("parent_building_id");
if (ObjectUtils.isEmpty(parentBuilingIdString)) {
continue;
}
String[] parentBuilingIdArray = parentBuilingIdString.toString().split(",");
for (int i = 0; i < parentBuilingIdArray.length; i++) {
if (map.containsKey(parentBuilingIdArray[i])) {
int num = map.get(parentBuilingIdArray[i]).intValue();
num = num + Integer.parseInt(map2.get("count").toString());
map.put(parentBuilingIdArray[i], num);
} else {
map.put(parentBuilingIdArray[i], Integer.parseInt(map2.get("count").toString()));
}
}
}
return map;
}
public Map<String, String> getNodeAllParentIds(List<String> ids) {
Map<String, String> map =new HashMap<String, String>();
ResponseModel<List<Map<String, Object>>> response= equipFeignClient.getBuildingTreeList();
List<Map<String, Object>> responseList =response.getResult();
if(response.getStatus()!=200 && response.getResult().size()<1) {
return null;
}
ids.stream().forEach(i->{
String tegartString = getNodeAllParentIds( responseList,i,i);
map.put(i, tegartString);
});
return map;
}
private String getNodeAllParentIds(List<Map<String, Object>> list , String id,String tegartString){
for (Map<String, Object> map : list) {
if(map.get("id").toString().equals(id) && map.get("parentId")!=null ) {
tegartString=tegartString+","+map.get("parentId").toString();
getNodeAllParentIds(list,map.get("parentId").toString(),tegartString);
}
}
return tegartString;
}
public List<String> getNodeAllnodeIds(String id) {
List<String> resultList = new ArrayList<String>();
resultList.add(id);
ResponseModel<List<Map<String, Object>>> response= equipFeignClient.getBuildingTreeList();
List<Map<String, Object>> responseList =response.getResult();
if(response.getResult()==null && response.getResult().size()<1) {
return null;
}
return getNodeAllnodeIds(resultList, responseList,id.toString());
}
private List<String> getNodeAllnodeIds(List<String> resultList,List<Map<String, Object>> list,String id){
for (Map<String, Object> map : list) {
if(map.get("parentId").toString().equals(id) && map.get("parentId")!=null ) {
resultList.add(map.get("id").toString());
getNodeAllnodeIds(resultList,list,map.get("id").toString());
}
}
return resultList;
}
} }
...@@ -183,6 +183,11 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -183,6 +183,11 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
null); null);
} }
public List<Menu> getTeamTreeLikeCode(QueryWrapper<FireTeam> columnMap) throws Exception {
Collection<FireTeam> list = this.list(columnMap);
return TreeParser.getTree(null, list, FireTeam.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
null);
}
/** /**
* 获取机场单位-队伍树 * 获取机场单位-队伍树
* *
......
...@@ -2174,4 +2174,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -2174,4 +2174,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
})).start(); })).start();
} }
/**
* 查询多个组织机构下面的所有人员列表信息
*
* @param companyIdList
* @return
*/
public List<OrgUsr> getPersonListByCompanyIdList(List<String> companyIdList) {
if (ValidationUtil.isEmpty(companyIdList)) {
return Lists.newArrayList();
}
return this.baseMapper.selectPersonListByCompanyIdList(companyIdList);
}
} }
...@@ -4,6 +4,7 @@ import java.util.LinkedHashMap; ...@@ -4,6 +4,7 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -105,7 +106,12 @@ public class BuildingController extends AbstractBaseController { ...@@ -105,7 +106,12 @@ public class BuildingController extends AbstractBaseController {
public List<BuildingTreeVo> getBuildingTree() { public List<BuildingTreeVo> getBuildingTree() {
return buildService.getBuildingTree(); return buildService.getBuildingTree();
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树列表信息")
@GetMapping(value = "/getBuildingList")
public List<Map<String, Object>> getBuildingTreeList() {
return buildService.getBuildingDetaiList();
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑层级树") @ApiOperation("消防建筑层级树")
@GetMapping(value = "/tierTree") @GetMapping(value = "/tierTree")
...@@ -297,4 +303,12 @@ public class BuildingController extends AbstractBaseController { ...@@ -297,4 +303,12 @@ public class BuildingController extends AbstractBaseController {
return buildService.getCompanyBuildingTree(null); return buildService.getCompanyBuildingTree(null);
} }
@ApiOperation(value = "查询指定单位的建筑树")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{bizOrgCode}/tree")
public List<BuildingTreeVo> buildingTree(
@ApiParam(value = "单位编码") @PathVariable String bizOrgCode){
return buildService.getBuildingTreeInOrgCode(bizOrgCode);
}
} }
...@@ -35,14 +35,14 @@ public class BuildingVideoController extends AbstractBaseController { ...@@ -35,14 +35,14 @@ public class BuildingVideoController extends AbstractBaseController {
IBuilldService buildService; IBuilldService buildService;
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑视监控树") @ApiOperation("消防建筑视监控树")
@GetMapping(value = "/tree") @GetMapping(value = "/tree")
public List<BuildingTreeVo> getBuildingTree() { public List<BuildingTreeVo> getBuildingTree() {
return buildService.getBuildingVideoTree(); return buildService.getBuildingVideoTree();
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑视屏监控树") @ApiOperation("物联监控->单位建筑树(视频节点数量)")
@GetMapping(value = "/getBuildingVideoTree") @GetMapping(value = "/getBuildingVideoTree")
public List<BuildingTreeVo> getBuildingVideoTree() { public List<BuildingTreeVo> getBuildingVideoTree() {
return buildService.getBuildingVideoTreeNew(); return buildService.getBuildingVideoTreeNew();
......
...@@ -36,8 +36,8 @@ public interface JcsFeign { ...@@ -36,8 +36,8 @@ public interface JcsFeign {
@RequestHeader("appKey") String appKey, @RequestHeader("appKey") String appKey,
@RequestHeader("product") String product, @RequestHeader("product") String product,
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestParam(value = "current") int current, @RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "size") int size, @RequestParam(value = "pageSize") int pageSize,
@RequestParam(value = "name") String name, @RequestParam(value = "name") String name,
@RequestParam(value = "belongBuildingId") List<Long> belongBuildingId, @RequestParam(value = "belongBuildingId") List<Long> belongBuildingId,
@RequestParam(value = "belongFightingSystemId") Long belongFightingSystemId, @RequestParam(value = "belongFightingSystemId") Long belongFightingSystemId,
......
...@@ -87,4 +87,6 @@ public interface VideoMapper extends BaseMapper<Video> { ...@@ -87,4 +87,6 @@ public interface VideoMapper extends BaseMapper<Video> {
List<Video>listByCode(@Param("code")String code); List<Video>listByCode(@Param("code")String code);
List<Video> selectListBySourceId(Long floorId); List<Video> selectListBySourceId(Long floorId);
String getParentSourceIds(String childrenId);
} }
...@@ -302,10 +302,18 @@ public interface IBuilldService extends IService<Building> { ...@@ -302,10 +302,18 @@ public interface IBuilldService extends IService<Building> {
List<BuildingTreeVo> getBuildingVideoTreeNew(); List<BuildingTreeVo> getBuildingVideoTreeNew();
List<Map<String, Object>> getBuildingDetaiList();
/** /**
* 查询指定楼层下装备、摄像头 * 查询指定楼层下装备、摄像头
* @param floorId 楼层id * @param floorId 楼层id
* @return List<EquiplistSpecificBySystemVO> * @return List<EquiplistSpecificBySystemVO>
*/ */
List<EquiplistSpecificBySystemVO> getPointInFloor(Long floorId); List<EquiplistSpecificBySystemVO> getPointInFloor(Long floorId);
/**
* 建筑树
* @param bizOrgCode 所在公司
* @return List<BuildingTreeVo>
*/
List<BuildingTreeVo> getBuildingTreeInOrgCode(String bizOrgCode);
} }
...@@ -279,7 +279,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA ...@@ -279,7 +279,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
} }
private List<UnitAreaTreeVo> getChildrenFromData(Long parentId, List<UnitAreaTreeVo> areaTreeList) { private List<UnitAreaTreeVo> getChildrenFromData(Long parentId, List<UnitAreaTreeVo> areaTreeList) {
return areaTreeList.stream().filter(a->a.getParentId().equals(parentId)).peek(e-> e.setChildren(getChildrenFromData(e.getId(),areaTreeList))).collect(Collectors.toList()); return areaTreeList.stream().filter(a->parentId.equals(a.getParentId())).peek(e-> e.setChildren(getChildrenFromData(e.getId(),areaTreeList))).collect(Collectors.toList());
} }
......
...@@ -1162,9 +1162,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS ...@@ -1162,9 +1162,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
carInfoVo.setEquipmentName(equipment != null ? equipment.getName() : ""); carInfoVo.setEquipmentName(equipment != null ? equipment.getName() : "");
carInfoVo.setCategoryId(equipment != null ? equipment.getCategoryId() : null); carInfoVo.setCategoryId(equipment != null ? equipment.getCategoryId() : null);
carInfoVo.setCategoryName(categoryMap.get(carInfoVo.getCategoryId())); carInfoVo.setCategoryName(categoryMap.get(carInfoVo.getCategoryId()));
carInfoVo.setName(car.getName());
carInfoVo.setName(car.getName()+"("+car.getCarNum()+")");
if (car.getImg() != null){ if (car.getImg() != null){
List<String> img = new ArrayList<>(); List<String> img = new ArrayList<>();
......
...@@ -191,11 +191,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -191,11 +191,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
}); });
String userId = remoteSecurityService.getAgencyUser().getUserId(); String userId = remoteSecurityService.getAgencyUser().getUserId();
vo.setRecUserId(userId);
// 冗余名称,数据同步使用 // 冗余名称,数据同步使用
this.setChargePersonName(vo); this.setChargePersonName(vo);
String s = String.valueOf(System.currentTimeMillis()); String s = String.valueOf(System.currentTimeMillis());
vo.setId(s); vo.setId(s);
vo.setRecUserId(userId);
vo.setSort(s); vo.setSort(s);
DynamicFormGroup dynamicFormGroup = iEqDynamicFormGroupService.getById(vo.getFormGroupId()); DynamicFormGroup dynamicFormGroup = iEqDynamicFormGroupService.getById(vo.getFormGroupId());
vo.setSystemType(dynamicFormGroup.getRelationId() != null ? dynamicFormGroup.getRelationId().toString() : ""); vo.setSystemType(dynamicFormGroup.getRelationId() != null ? dynamicFormGroup.getRelationId().toString() : "");
...@@ -273,8 +273,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -273,8 +273,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
private void setChargePersonName(FireFightingSystemVo vo) { private void setChargePersonName(FireFightingSystemVo vo) {
if (StringUtil.isNotEmpty(vo.getChargePerson())) { if (StringUtil.isNotEmpty(vo.getRecUserId())) {
FeignClientResult<AgencyUserModel> result = Privilege.agencyUserClient.queryByUserId(vo.getChargePerson()); FeignClientResult<AgencyUserModel> result = Privilege.agencyUserClient.queryByUserId(vo.getRecUserId());
AgencyUserModel userModel = result == null ? new AgencyUserModel() : result.getResult(); AgencyUserModel userModel = result == null ? new AgencyUserModel() : result.getResult();
vo.setChargePersonName(userModel.getRealName()); vo.setChargePersonName(userModel.getRealName());
} }
...@@ -1040,7 +1040,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1040,7 +1040,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<EquipmentCategory> equipmentTypeList = responseList.stream() List<EquipmentCategory> equipmentTypeList = responseList.stream()
.filter(i -> !i.getCode().startsWith("2") && "2".equals(i.getIndustryCode())) .filter(i -> !i.getCode().startsWith("2") && "2".equals(i.getIndustryCode()))
.collect(Collectors.toList()); .collect(Collectors.toList());
List<EquipmentCategory> list = typeListTree(equipmentTypeList, bizOrgCode, SourceTypeEnum.EQUIPMENT); List<EquipmentCategory> list = typeListTree(equipmentTypeList, bizOrgCode, SourceTypeEnum.IOT);
redisUtils.set("iotTypeAndCount" + bizOrgCode, list, 86400); redisUtils.set("iotTypeAndCount" + bizOrgCode, list, 86400);
return list; return list;
} }
......
...@@ -100,15 +100,16 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -100,15 +100,16 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
List<VideoSource> videoSources = new ArrayList<>(); List<VideoSource> videoSources = new ArrayList<>();
if (videoSave.getIds() != null && videoSave.getIds().size() > 0) { if (videoSave.getIds() != null && videoSave.getIds().size() > 0) {
videoSave.getIds().forEach(x -> { videoSave.getIds().forEach(x -> {
if (x != null && x.indexOf("equip") != -1) { if (x != null && x.contains("equip")) {
VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific(); VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
videoEquipmentSpecific.setEquipmentSpecificId(Long.valueOf(x.substring(5))); videoEquipmentSpecific.setEquipmentSpecificId(Long.valueOf(x.substring(5)));
videoEquipmentSpecific.setVideoId(videoSave.getVideo().getId()); videoEquipmentSpecific.setVideoId(videoSave.getVideo().getId());
videoEquipmentSpecifics.add(videoEquipmentSpecific); videoEquipmentSpecifics.add(videoEquipmentSpecific);
} else if (x != null && x.indexOf("region") != -1) { } else if (x != null && x.contains("region")) {
VideoSource videoSource = new VideoSource(); VideoSource videoSource = new VideoSource();
videoSource.setVideoId(videoSave.getVideo().getId()); videoSource.setVideoId(videoSave.getVideo().getId());
videoSource.setSourceId(Long.valueOf(x.substring(6))); videoSource.setSourceId(Long.valueOf(x.substring(6)));
videoSource.setParentSourceIds(getParentSourceIds(videoSource.getSourceId().toString()));
videoSources.add(videoSource); videoSources.add(videoSource);
} }
}); });
...@@ -130,6 +131,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -130,6 +131,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
return videoSave.getVideo(); return videoSave.getVideo();
} }
private String getParentSourceIds(String childrenId){
return this.videoMapper.getParentSourceIds(childrenId);
}
@Transactional @Transactional
@Override @Override
public Boolean delVideo(List<Long> ids) { public Boolean delVideo(List<Long> ids) {
...@@ -173,15 +178,16 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -173,15 +178,16 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
List<VideoSource> videoSources = new ArrayList<>(); List<VideoSource> videoSources = new ArrayList<>();
if (videoSave.getIds() != null && videoSave.getIds().size() > 0) { if (videoSave.getIds() != null && videoSave.getIds().size() > 0) {
videoSave.getIds().forEach(x -> { videoSave.getIds().forEach(x -> {
if (x != null && x.indexOf("equip") != -1) { if (x != null && x.contains("equip")) {
VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific(); VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
videoEquipmentSpecific.setEquipmentSpecificId(Long.valueOf(x.substring(5))); videoEquipmentSpecific.setEquipmentSpecificId(Long.valueOf(x.substring(5)));
videoEquipmentSpecific.setVideoId(videoSave.getVideo().getId()); videoEquipmentSpecific.setVideoId(videoSave.getVideo().getId());
videoEquipmentSpecifics.add(videoEquipmentSpecific); videoEquipmentSpecifics.add(videoEquipmentSpecific);
} else if (x != null && x.indexOf("region") != -1) { } else if (x != null && x.contains("region")) {
VideoSource videoSource = new VideoSource(); VideoSource videoSource = new VideoSource();
videoSource.setVideoId(videoSave.getVideo().getId()); videoSource.setVideoId(videoSave.getVideo().getId());
videoSource.setSourceId(Long.valueOf(x.substring(6))); videoSource.setSourceId(Long.valueOf(x.substring(6)));
videoSource.setParentSourceIds(getParentSourceIds(videoSource.getSourceId().toString()));
videoSources.add(videoSource); videoSources.add(videoSource);
} }
}); });
......
...@@ -122,7 +122,7 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur ...@@ -122,7 +122,7 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur
for (WarehouseStructure it : treeNodes) { for (WarehouseStructure it : treeNodes) {
if (treeNode.getId().equals(it.getParentId())) { if (treeNode.getId().equals(it.getParentId())) {
if (treeNode.getChildren() == null) { if (treeNode.getChildren() == null) {
treeNode.setChildren(new ArrayList<WarehouseStructure>()); treeNode.setChildren(new ArrayList<>());
} }
treeNode.getChildren().add(findChildren(it, treeNodes)); treeNode.getChildren().add(findChildren(it, treeNodes));
} }
......
...@@ -83,6 +83,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts; ...@@ -83,6 +83,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation; import com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost; import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersWorkexperience; import com.yeejoin.amos.boot.module.common.api.entity.FirefightersWorkexperience;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany; import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment; import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment;
...@@ -786,7 +787,9 @@ public class ExcelServiceImpl { ...@@ -786,7 +787,9 @@ public class ExcelServiceImpl {
} }
private void excelImportFireStation(MultipartFile multipartFile) throws Exception { private void excelImportFireStation(MultipartFile multipartFile) throws Exception {
List<FireStationDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireStationDto.class, 1); List<FireStationDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireStationDto.class, 1);
Map<String, String> maps = getAllBuildingIdForParentBuilingIds(excelDtoList);
List<FireStation> excelEntityList = new ArrayList<>(); List<FireStation> excelEntityList = new ArrayList<>();
excelDtoList.forEach(item -> { excelDtoList.forEach(item -> {
FireStation fireStation = new FireStation(); FireStation fireStation = new FireStation();
...@@ -796,6 +799,9 @@ public class ExcelServiceImpl { ...@@ -796,6 +799,9 @@ public class ExcelServiceImpl {
String[] whereBuilding = fireStation.getWhereBuilding().split("@"); String[] whereBuilding = fireStation.getWhereBuilding().split("@");
fireStation.setWhereBuilding(whereBuilding[0]); fireStation.setWhereBuilding(whereBuilding[0]);
fireStation.setWhereBuildingId(whereBuilding[1]); fireStation.setWhereBuildingId(whereBuilding[1]);
if(maps.containsKey(whereBuilding[1])){
fireStation.setParentBuildingId(maps.get(whereBuilding[1]));
}
} }
if (fireStation.getBizCompany() != null) { if (fireStation.getBizCompany() != null) {
String[] bizCompany = fireStation.getBizCompany().split("@"); String[] bizCompany = fireStation.getBizCompany().split("@");
...@@ -817,7 +823,17 @@ public class ExcelServiceImpl { ...@@ -817,7 +823,17 @@ public class ExcelServiceImpl {
}); });
fireStationService.saveBatch(excelEntityList); fireStationService.saveBatch(excelEntityList);
} }
public Map<String, String> getAllBuildingIdForParentBuilingIds(List<FireStationDto> excelDtoList) {
List<String> list = new ArrayList<String>();
for (FireStationDto fireStation : excelDtoList) {
if (org.apache.commons.lang3.StringUtils.isNotBlank(fireStation.getWhereBuilding())) {
String[] whereBuilding = fireStation.getWhereBuilding().split("@");
fireStation.setWhereBuildingId(whereBuilding[1]);
list.add(whereBuilding[1]);
}
}
return keySiteService.getNodeAllParentIds(list);
}
private void excelImportFireTeam(MultipartFile multipartFile) throws Exception { private void excelImportFireTeam(MultipartFile multipartFile) throws Exception {
List<FireTeamDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireTeamDto.class, 1); List<FireTeamDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireTeamDto.class, 1);
List<FireTeam> excelEntityList = new ArrayList<>(); List<FireTeam> excelEntityList = new ArrayList<>();
......
...@@ -75,4 +75,13 @@ public interface JCSFeignClient { ...@@ -75,4 +75,13 @@ public interface JCSFeignClient {
**/ **/
@RequestMapping(value = "jcs/org-usr/amos/{orgUserId}", method = RequestMethod.GET) @RequestMapping(value = "jcs/org-usr/amos/{orgUserId}", method = RequestMethod.GET)
ResponseModel<AgencyUserModel> getAmosIdByUserId(@PathVariable String orgUserId); ResponseModel<AgencyUserModel> getAmosIdByUserId(@PathVariable String orgUserId);
/**
* 根据机场单位id获取单位人员列表
*
* @param companyIds 机场单位ids
* @return
*/
@RequestMapping(value = "jcs/org-usr/company/person/list", method = RequestMethod.GET)
FeignClientResult<List<OrgUsrFormDto>> getPersonListByCompanyIdList(@RequestParam("companyIds") String companyIds);
} }
...@@ -8,18 +8,23 @@ import com.google.common.base.Joiner; ...@@ -8,18 +8,23 @@ import com.google.common.base.Joiner;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel; import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.supervision.business.constants.XJConstant; import com.yeejoin.amos.supervision.business.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dao.mapper.PlanMapper; import com.yeejoin.amos.supervision.business.dao.mapper.PlanMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper; import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskMapper; import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.PointMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RoutePointItemMapper; import com.yeejoin.amos.supervision.business.dao.mapper.RoutePointItemMapper;
import com.yeejoin.amos.supervision.business.dao.repository.*; import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckChkExListBo; import com.yeejoin.amos.supervision.business.entity.mybatis.CheckChkExListBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo; import com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo;
import com.yeejoin.amos.supervision.business.feign.Business; import com.yeejoin.amos.supervision.business.feign.Business;
import com.yeejoin.amos.supervision.business.feign.EquipFeign; import com.yeejoin.amos.supervision.business.feign.EquipFeign;
import com.yeejoin.amos.supervision.business.feign.JCSFeignClient;
import com.yeejoin.amos.supervision.business.param.CheckPtListPageParam; import com.yeejoin.amos.supervision.business.param.CheckPtListPageParam;
import com.yeejoin.amos.supervision.business.param.PlanTaskPageParam; import com.yeejoin.amos.supervision.business.param.PlanTaskPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.ICheckService; import com.yeejoin.amos.supervision.business.service.intfc.ICheckService;
...@@ -43,15 +48,16 @@ import com.yeejoin.amos.supervision.dao.entity.Check; ...@@ -43,15 +48,16 @@ import com.yeejoin.amos.supervision.dao.entity.Check;
import com.yeejoin.amos.supervision.dao.entity.Plan; import com.yeejoin.amos.supervision.dao.entity.Plan;
import com.yeejoin.amos.supervision.dao.entity.PlanTask; import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail; import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail;
import com.yeejoin.amos.supervision.dao.entity.Point;
import com.yeejoin.amos.supervision.exception.YeeException; import com.yeejoin.amos.supervision.exception.YeeException;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService; import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import com.yeejoin.amos.supervision.quartz.IJobService; import com.yeejoin.amos.supervision.quartz.IJobService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.ibatis.annotations.Param; import com.google.common.collect.Lists;
import org.assertj.core.util.Lists;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -113,6 +119,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -113,6 +119,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired
PointMapper pointMapper;
@Autowired
private JCSFeignClient jcsFeignClient;
// 防火监督检查负责人角色名称
@Value("${supervision.person.charger.role:Person_charge_unit_fire_protection_supervision_inspection}")
private String supervisionPersonChargerRole;
@Override @Override
public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) { public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) {
long total = planTaskMapper.countPlanTask(params); long total = planTaskMapper.countPlanTask(params);
...@@ -537,9 +553,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -537,9 +553,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表 // 2.保存执行数据明细表
planTaskDetail.saveAndFlush(planTaskDetailInstance); planTaskDetail.saveAndFlush(planTaskDetailInstance);
// 规则推送消息
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划生成, pointId.longValue());
} }
sendMessage(plan);
// 定时任务监控 // 定时任务监控
jobService.planTaskAddJob(planTask); jobService.planTaskAddJob(planTask);
} }
...@@ -570,6 +585,34 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -570,6 +585,34 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
} }
public void sendMessage(Plan plan) throws Exception {
// 查询检查对象对应防火监督负责人id
List<String> extraUserIds = Lists.newArrayList();
List<Point> pointList = pointMapper.getPointByPlanId(String.valueOf(plan.getId()));
if (!ValidationUtil.isEmpty(pointList)) {
List<String> originalIdList = Lists.transform(pointList, Point::getOriginalId);
List<OrgUsrFormDto> personList =
jcsFeignClient.getPersonListByCompanyIdList(Joiner.on(",").join(originalIdList)).getResult();
List<String> personIdList = Lists.transform(personList, OrgUsrFormDto::getAmosOrgId);
List<RoleModel> roleList =
Privilege.roleClient.queryRoleList(supervisionPersonChargerRole, null).getResult();
if (!ValidationUtil.isEmpty(roleList)) {
List<AgencyUserModel> agencyUserModelList = Privilege.agencyUserClient.queryByRoleId(
String.valueOf(roleList.get(0).getSequenceNbr()), null).getResult();
if (!ValidationUtil.isEmpty(agencyUserModelList)) {
agencyUserModelList.forEach(userModel -> {
if (personIdList.contains(userModel.getUserId())) {
extraUserIds.add(userModel.getUserId());
}
});
}
}
}
log.info(String.format("计划对象:%s", JSON.toJSON(plan)));
// 规则推送消息
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划生成, extraUserIds);
}
@Override @Override
public List<PlanTask> getPlanTaskByRouteId(Long routeId) { public List<PlanTask> getPlanTaskByRouteId(Long routeId) {
List<PlanTask> planTaskList = planTaskMapper.getPlanTaskByRouteId(routeId); List<PlanTask> planTaskList = planTaskMapper.getPlanTaskByRouteId(routeId);
......
...@@ -1211,10 +1211,10 @@ public class PointServiceImpl implements IPointService { ...@@ -1211,10 +1211,10 @@ public class PointServiceImpl implements IPointService {
if (!ObjectUtils.isEmpty(hiddenDangerList)) { if (!ObjectUtils.isEmpty(hiddenDangerList)) {
String ids = Joiner.on(",").join(hiddenDangerList.stream().map(HiddenDanger::getLatentDangerId).collect(Collectors.toList())); String ids = Joiner.on(",").join(hiddenDangerList.stream().map(HiddenDanger::getLatentDangerId).collect(Collectors.toList()));
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("ids", ids); map.put("dangerIds", ids);
FeignClientResult<List<DangerDto>> listFeignClientResult = dangerFeignClient.listAll(map); FeignClientResult<List<DangerDto>> listFeignClientResult = dangerFeignClient.listAll(map);
if (ObjectUtils.isEmpty(listFeignClientResult.getResult()) || listFeignClientResult.getStatus() != HTTP_OK_STATUS) { if (listFeignClientResult.getStatus() != HTTP_OK_STATUS) {
throw new RuntimeException(listFeignClientResult.getDevMessage()); throw new RuntimeException("服务调用异常");
} }
List<DangerDto> dangerDtoList = listFeignClientResult.getResult(); List<DangerDto> dangerDtoList = listFeignClientResult.getResult();
if (!ObjectUtils.isEmpty(dangerDtoList)) { if (!ObjectUtils.isEmpty(dangerDtoList)) {
......
...@@ -43,23 +43,14 @@ public class RulePlanService { ...@@ -43,23 +43,14 @@ public class RulePlanService {
private final String packageId = "消息/addPlanRule"; private final String packageId = "消息/addPlanRule";
private final String msgType = "supervision"; private final String msgType = "supervision";
@Value("${supervision.person.charger.role:Person_charge_unit_fire_protection_supervision_inspection}")
private String supervisionPersonChargerRole;
@Autowired @Autowired
private RuleTrigger ruleTrigger; private RuleTrigger ruleTrigger;
@Autowired @Autowired
private JCSFeignClient jcsFeignClient; private JCSFeignClient jcsFeignClient;
@Autowired public Boolean addPlanRule(Plan plan, List<String> userIds, RuleTypeEnum ruleType, List<String> extraUserIds) throws Exception {
private RemoteSecurityService remoteSecurityService; PlanRo planRo = buildPlanRo(plan, userIds, ruleType, extraUserIds);
@Autowired
private PointServiceImpl pointService;
public Boolean addPlanRule(Plan plan, List<String> userIds, RuleTypeEnum ruleType, Long pointId) throws Exception {
PlanRo planRo = buildPlanRo(plan, userIds, ruleType, pointId);
//触发规则 //触发规则
ruleTrigger.publish(planRo, packageId, new String[0]); ruleTrigger.publish(planRo, packageId, new String[0]);
return true; return true;
...@@ -73,7 +64,7 @@ public class RulePlanService { ...@@ -73,7 +64,7 @@ public class RulePlanService {
return true; return true;
} }
private PlanRo buildPlanRo(Plan plan, List<String> userIds, RuleTypeEnum ruleType, Long pointId) { private PlanRo buildPlanRo(Plan plan, List<String> userIds, RuleTypeEnum ruleType, List<String> extraUserIds) {
// 设置token // 设置token
// if (ValidationUtil.isEmpty(RequestContext.getToken())) { // if (ValidationUtil.isEmpty(RequestContext.getToken())) {
// Toke tokenObj = remoteSecurityService.getServerToken(); // Toke tokenObj = remoteSecurityService.getServerToken();
...@@ -112,28 +103,15 @@ public class RulePlanService { ...@@ -112,28 +103,15 @@ public class RulePlanService {
leadPeopleIds += "," + plan.getUserId(); leadPeopleIds += "," + plan.getUserId();
} }
userIds = (List<String>) jcsFeignClient.getAmosIdListByUserIds(leadPeopleIds).getResult(); userIds = (List<String>) jcsFeignClient.getAmosIdListByUserIds(leadPeopleIds).getResult();
// pointId是被检查单位id }
if (!ValidationUtil.isEmpty(pointId)) { if (!ValidationUtil.isEmpty(extraUserIds)) {
Point point = pointService.queryPointById(pointId); List<String> finalUserIds = userIds;
List<OrgUsrFormDto> personList = extraUserIds.forEach(id -> {
jcsFeignClient.getPersonListByCompanyId(point.getOriginalId()).getResult(); if (!finalUserIds.contains(id)) {
List<String> personIdList = Lists.transform(personList, OrgUsrFormDto::getAmosOrgId); finalUserIds.add(id);
List<RoleModel> roleList =
Privilege.roleClient.queryRoleList(supervisionPersonChargerRole, null).getResult();
if (!ValidationUtil.isEmpty(roleList)) {
List<AgencyUserModel> agencyUserModelList = Privilege.agencyUserClient.queryByRoleId(
String.valueOf(roleList.get(0).getSequenceNbr()), null).getResult();
if (!ValidationUtil.isEmpty(agencyUserModelList)) {
List<String> finalUserIds = userIds;
agencyUserModelList.forEach(userModel -> {
if (personIdList.contains(userModel.getUserId()) && !finalUserIds.contains(userModel.getUserId())) {
finalUserIds.add(userModel.getUserId());
}
});
userIds = finalUserIds;
}
} }
} });
userIds = finalUserIds;
} }
planRo.setSendTime(DateUtil.date2LongStr(new Date())); planRo.setSendTime(DateUtil.date2LongStr(new Date()));
planRo.setRecivers(userIds); planRo.setRecivers(userIds);
......
...@@ -2385,4 +2385,46 @@ ...@@ -2385,4 +2385,46 @@
alter table `wl_equipment_specific` modify column `team_id` varchar(32) DEFAULT NULL COMMENT '所属队伍id(来源于平台)'; alter table `wl_equipment_specific` modify column `team_id` varchar(32) DEFAULT NULL COMMENT '所属队伍id(来源于平台)';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="shg" id="1644459872903-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_video_source" columnName="parent_source_ids"/>
</not>
</preConditions>
<comment>wl_video_source add column parent_source_ids 本级及父级建筑ids,冗余树形搜索</comment>
<sql>
alter table `wl_video_source` add column `parent_source_ids` text COMMENT '本级及父级建筑ids,冗余树形搜索';
</sql>
</changeSet>
<changeSet author="shg" id="1644459872903-1" runAlways="true">
<comment>`getBuildingParentIds` 存在前后顺序依赖关系所以放在这里</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `getBuildingParentIds`#
CREATE DEFINER=`root`@`%` FUNCTION `getBuildingParentIds`(`childrenId` VARCHAR(32)) RETURNS varchar(1000) CHARSET utf8
BEGIN
DECLARE ptemp VARCHAR(1000);
DECLARE ctemp VARCHAR(1000);
DECLARE ctempName VARCHAR(1000);
SET ptemp ='';
SET ctemp = childrenId;
WHILE ctemp != '0' DO
SET ptemp = concat(ptemp,',',ctemp);
SELECT IFNULL((SELECT parentId
FROM get_building_tree
WHERE instanceId = ctemp),'0') INTO ctemp;
END WHILE;
SET ptemp = SUBSTR(ptemp,2);
RETURN ptemp;
END#
</sql>
</changeSet>
<changeSet author="shg" id="1644459872903-3">
<preConditions onFail="MARK_RAN">
<columnExists tableName="wl_video_source" columnName="parent_source_ids"/>
</preConditions>
<comment>wl_video_source 存量数据修改parent_source_ids</comment>
<sql>
update wl_video_source s set s.parent_source_ids = (SELECT getBuildingParentIds(s.source_id)) ;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -663,13 +663,13 @@ ...@@ -663,13 +663,13 @@
<if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''"> <if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''">
AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%') AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if> </if>
)s1 )s1 WHERE 1=1
<if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''"> <if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''">
where s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%') AND s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if> </if>
<if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''"> <if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''">
where s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%') AND s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
</if> </if>
...@@ -745,7 +745,7 @@ ...@@ -745,7 +745,7 @@
</if> </if>
)s2 )s2
<if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''"> <if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''">
where s2.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%') AND s2.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if> </if>
<if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''"> <if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''">
where s2.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%') where s2.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
...@@ -1844,13 +1844,13 @@ FROM ...@@ -1844,13 +1844,13 @@ FROM
<if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''"> <if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''">
AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%') AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if> </if>
)s1 )s1 WHERE 1=1
<if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''"> <if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''">
where s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%') AND s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if> </if>
<if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''"> <if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''">
where s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%') AND s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
</if> </if>
order by createDate DESC order by createDate DESC
</select> </select>
...@@ -1960,13 +1960,13 @@ FROM ...@@ -1960,13 +1960,13 @@ FROM
<if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''"> <if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''">
AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%') AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if> </if>
)s1 )s1 WHERE 1=1
<if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''"> <if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''">
where s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%') and s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if> </if>
<if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''"> <if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''">
where s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%') and s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
</if> </if>
......
...@@ -502,7 +502,7 @@ WHERE ...@@ -502,7 +502,7 @@ WHERE
COUNT( vs.video_id ) AS total COUNT( vs.video_id ) AS total
FROM FROM
get_building_tree b get_building_tree b
LEFT JOIN wl_video_source vs ON FIND_IN_SET( vs.source_id, getBuildChildIdsByRootId ( b.instanceId ) ) LEFT JOIN wl_video_source vs ON FIND_IN_SET( b.instanceId, vs.parent_source_ids )
GROUP BY GROUP BY
b.instanceId b.instanceId
</select> </select>
......
...@@ -61,14 +61,15 @@ ...@@ -61,14 +61,15 @@
v.token AS token, v.token AS token,
v.url AS url, v.url AS url,
v.code AS code, v.code AS code,
getBuildingNames(vc.source_id) as location, ws.full_name as location,
v.address, v.address,
v.preset_position as presetPosition v.preset_position as presetPosition
FROM wl_video v FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id JOIN wl_video_source vc ON vc.video_id = v.id
left join wl_warehouse_structure ws on ws.id = vc.source_id
<where> <where>
<if test="dto.buildingId!=null and dto.buildingId!=''"> <if test="dto.buildingId!=null and dto.buildingId!=''">
FIND_IN_SET(vc.source_id, getBuildChildIdsByRootId(#{dto.buildingId})) FIND_IN_SET(#{dto.buildingId}, vc.parent_source_ids)
</if> </if>
<if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''"> <if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''">
and v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%') and v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%')
...@@ -377,4 +378,7 @@ ...@@ -377,4 +378,7 @@
where vs.source_id = #{floorId} where vs.source_id = #{floorId}
and vs.video_id = v.id and vs.video_id = v.id
</select> </select>
<select id="getParentSourceIds" resultType="java.lang.String">
select getBuildingParentIds(#{childrenId})
</select>
</mapper> </mapper>
...@@ -2723,7 +2723,29 @@ ...@@ -2723,7 +2723,29 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet id="chenhao-2022-02-08-1" author="chenhao">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_key_site" columnName="parent_building_id"/>
</not>
</preConditions>
<comment>cb_key_site add column parent_building_id 所属建筑节点的所有父节点id集合</comment>
<sql>
ALTER TABLE cb_key_site ADD parent_building_id varchar(500) NULL COMMENT '所属建筑节点的所有父节点id集合';
</sql>
</changeSet>
<changeSet id="chenhao-2022-02-09-1" author="chenhao">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_fire_station" columnName="parent_building_id"/>
</not>
</preConditions>
<comment>cb_fire_station add column parent_building_id 所属建筑节点的所有父节点id集合</comment>
<sql>
ALTER TABLE cb_fire_station ADD parent_building_id varchar(1000) NULL COMMENT '所属建筑节点的所有父节点id集合';
</sql>
</changeSet>
<changeSet author="tw" id="20220207-1" runAlways="true"> <changeSet author="tw" id="20220207-1" runAlways="true">
<comment>`getParentList`</comment> <comment>`getParentList`</comment>
<sql endDelimiter="#"> <sql endDelimiter="#">
...@@ -2748,7 +2770,5 @@ ...@@ -2748,7 +2770,5 @@
END# END#
</sql> </sql>
</changeSet> </changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -4,7 +4,7 @@ spring.datasource.url = jdbc:mysql://172.16.6.60:3306/amos_supervision_v1\ ...@@ -4,7 +4,7 @@ spring.datasource.url = jdbc:mysql://172.16.6.60:3306/amos_supervision_v1\
spring.datasource.username= root spring.datasource.username= root
spring.datasource.password= root_123 spring.datasource.password= root_123
## eureka properties: ## eureka properties:
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://172.16.3.135:10001/eureka/
security.password=a1234560 security.password=a1234560
security.loginId=jc_wjk006 security.loginId=jc_wjk006
...@@ -13,10 +13,10 @@ security.productApp=STUDIO_APP_MOBILE ...@@ -13,10 +13,10 @@ security.productApp=STUDIO_APP_MOBILE
security.appKey=studio_normalapp_3168830 security.appKey=studio_normalapp_3168830
#redis 配置 #redis 配置
spring.redis.database=0 spring.redis.database=1
spring.redis.host=172.16.10.85 spring.redis.host=172.16.6.60
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=amos2019Redis spring.redis.password=yeejoin@2020
spring.redis.jedis.pool.max-active=200 spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10 spring.redis.jedis.pool.max-idle=10
...@@ -29,7 +29,7 @@ params.isPush = false ...@@ -29,7 +29,7 @@ params.isPush = false
params.work.flow.normalProcessDefinitionKey=normalHazardManagement params.work.flow.normalProcessDefinitionKey=normalHazardManagement
params.work.flow.processDefinitionKey=hazardManagement params.work.flow.processDefinitionKey=hazardManagement
params.work.flow.address=http://172.16.10.80:30040 params.work.flow.address=http://172.16.11.30:30040
params.spc.address=http://172.16.3.89:9001 params.spc.address=http://172.16.3.89:9001
#websocket #websocket
...@@ -46,10 +46,11 @@ linux.img.path = / ...@@ -46,10 +46,11 @@ linux.img.path = /
## emqx ## emqx
emqx.clean-session=true emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}-1 emqx.client-id=${spring.application.name}-${random.int[1024,65536]}-1
emqx.broker=tcp://172.16.10.85:1883 emqx.broker=tcp://39.98.45.134:1883
emqx.user-name=super emqx.user-name=super
emqx.password=a123456 emqx.password=a123456
emqx.max-inflight=1000 emqx.max-inflight=1000
rule.definition.localIp=172.16.3.121 rule.definition.localIp=172.16.3.89
file.url=http://39.98.45.134:9000/ file.url=http://39.98.45.134:9000/
\ No newline at end of file supervision.person.charger.role=Person_charge_unit_fire_protection_supervision_inspection
\ No newline at end of file
...@@ -2041,12 +2041,12 @@ ...@@ -2041,12 +2041,12 @@
<!-- <if test="orgCode != null">--> <!-- <if test="orgCode != null">-->
<!-- AND c.org_code = #{orgCode}--> <!-- AND c.org_code = #{orgCode}-->
<!-- </if>--> <!-- </if>-->
ORDER BY c.check_time DESC
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</where> </where>
ORDER BY c.check_time DESC
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select> </select>
<select id="getCheckListByTaskId" resultType="com.yeejoin.amos.supervision.dao.entity.Check"> <select id="getCheckListByTaskId" resultType="com.yeejoin.amos.supervision.dao.entity.Check">
......
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