38 changed files with 709 additions and 37 deletions
@ -0,0 +1,65 @@ |
|||
package com.epmet.commons.tools.redis.common; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.feign.CommonAggFeignClient; |
|||
import com.epmet.commons.tools.redis.RedisKeys; |
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.collections4.MapUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import javax.annotation.PostConstruct; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 楼栋 |
|||
* 房屋 |
|||
* 小区这三个的缓存放这吧 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
public class CustomerIcHouseRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
@Autowired |
|||
private CommonAggFeignClient commonAggFeignClient; |
|||
private static CustomerIcHouseRedis customerIcHouseRedis; |
|||
|
|||
@PostConstruct |
|||
public void init() { |
|||
customerIcHouseRedis = this; |
|||
customerIcHouseRedis.redisUtils = this.redisUtils; |
|||
customerIcHouseRedis.commonAggFeignClient = this.commonAggFeignClient; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* @Description 获取楼栋信息 |
|||
* @param buildingId |
|||
* @author yinzuomei |
|||
* @date 2022/03/09 |
|||
*/ |
|||
public static BuildingInfoCache getBuildingInfo(String buildingId){ |
|||
String key = RedisKeys.getBuildingInfoKey(buildingId); |
|||
Map<String, Object> build = customerIcHouseRedis.redisUtils.hGetAll(key); |
|||
if (!MapUtils.isEmpty(build)) { |
|||
return ConvertUtils.mapToEntity(build, BuildingInfoCache.class); |
|||
} |
|||
Result<BuildingInfoCache> buildInfoResult = customerIcHouseRedis.commonAggFeignClient.queryBuildingInfo(buildingId); |
|||
if (!buildInfoResult.success()){ |
|||
throw new RenException("查询楼栋信息失败..."); |
|||
} |
|||
if (null == buildInfoResult.getData()){ |
|||
return null; |
|||
} |
|||
Map<String, Object> map = BeanUtil.beanToMap(buildInfoResult.getData(), false, true); |
|||
customerIcHouseRedis.redisUtils.hMSet(key, map); |
|||
return buildInfoResult.getData(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.epmet.commons.tools.redis.common.bean; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 楼栋信息缓存 |
|||
*/ |
|||
@Data |
|||
public class BuildingInfoCache implements Serializable { |
|||
/** |
|||
* !!!!!楼栋id |
|||
*/ |
|||
private String buildingId; |
|||
|
|||
/** |
|||
* 楼栋名称 |
|||
*/ |
|||
private String buildingName; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* XXX组织-网格名 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 小区id |
|||
*/ |
|||
private String neighborHoodId; |
|||
|
|||
/** |
|||
* 小区名称 |
|||
*/ |
|||
private String neighborHoodName; |
|||
private String agencyId; |
|||
|
|||
// 后续用到啥再加吧........
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.epmet.dataaggre.dao.govorg; |
|||
|
|||
import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface IcBuildingDao { |
|||
|
|||
/** |
|||
* 查询楼栋信息,返回楼栋明,小区名....简要信息 |
|||
* @param buildingId |
|||
* @return |
|||
*/ |
|||
BuildingInfoCache selectBuildInfo(String buildingId); |
|||
} |
@ -0,0 +1,24 @@ |
|||
<?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"> |
|||
|
|||
<mapper namespace="com.epmet.dataaggre.dao.govorg.IcBuildingDao"> |
|||
|
|||
<select id="selectBuildInfo" parameterType="java.lang.String" resultType="com.epmet.commons.tools.redis.common.bean.BuildingInfoCache"> |
|||
SELECT |
|||
ib.id as buildingId, |
|||
ib.BUILDING_NAME as buildingName, |
|||
ib.NEIGHBOR_HOOD_ID as neighborHoodId, |
|||
ih.NEIGHBOR_HOOD_NAME as neighborHoodName, |
|||
ih.GRID_ID as gridId, |
|||
ih.AGENCY_ID as agencyId |
|||
FROM |
|||
ic_building ib |
|||
INNER JOIN ic_neighbor_hood ih ON ( ib.NEIGHBOR_HOOD_ID = ih.id ) |
|||
WHERE |
|||
ib.id = #{buildingId} |
|||
AND ib.DEL_FLAG = '0' |
|||
AND ih.DEL_FLAG = '0' |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
Binary file not shown.
@ -0,0 +1,22 @@ |
|||
CREATE TABLE `ic_form_list_item` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', |
|||
`FORM_ITEM_ID` varchar(64) NOT NULL COMMENT 'ic_form_item.id', |
|||
`FORM_CODE` varchar(64) NOT NULL COMMENT 'ic_form.form_code,举例:resi_base_info', |
|||
`SORT` int(11) NOT NULL COMMENT '排序', |
|||
`DEL_FLAG` int(10) NOT NULL COMMENT '0未删除,1已删除', |
|||
`REVISION` int(10) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) USING BTREE |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='列表展示项'; |
|||
|
|||
insert into ic_form_list_item |
|||
select UUID(),i.CUSTOMER_ID,i.id,i.FORM_CODE,i.sort, |
|||
'0','0','APP_USER',NOW(),'APP_USER',NOW() |
|||
from ic_form_item i |
|||
where i.DEL_FLAG='0' |
|||
and i.LIST_DISPLAY='1' |
|||
order by i.sort asc; |
@ -0,0 +1,26 @@ |
|||
update ic_form_list_item set sort='1' where DEL_FLAG='0' and FORM_ITEM_ID like '%1006' ; |
|||
update ic_form_list_item set sort='2' where DEL_FLAG='0' and FORM_ITEM_ID like '%1001' ; |
|||
update ic_form_list_item set sort='3' where DEL_FLAG='0' and FORM_ITEM_ID like '%1004' ; |
|||
update ic_form_list_item set sort='4' where DEL_FLAG='0' and FORM_ITEM_ID like '%1007' ; |
|||
update ic_form_list_item set sort='5' where DEL_FLAG='0' and FORM_ITEM_ID like '%1008' ; |
|||
update ic_form_list_item set sort='6' where DEL_FLAG='0' and FORM_ITEM_ID like '%1009' ; |
|||
update ic_form_list_item set sort='7' where DEL_FLAG='0' and FORM_ITEM_ID like '%1010' ; |
|||
update ic_form_list_item set sort='8' where DEL_FLAG='0' and FORM_ITEM_ID like '%1011' ; |
|||
update ic_form_list_item set sort='9' where DEL_FLAG='0' and FORM_ITEM_ID like '%1015' ; |
|||
update ic_form_list_item set sort='10' where DEL_FLAG='0' and FORM_ITEM_ID like '%1016' ; |
|||
update ic_form_list_item set sort='11' where DEL_FLAG='0' and FORM_ITEM_ID like '%1017' ; |
|||
update ic_form_list_item set sort='12' where DEL_FLAG='0' and FORM_ITEM_ID like '%1018' ; |
|||
update ic_form_list_item set sort='13' where DEL_FLAG='0' and FORM_ITEM_ID like '%1019' ; |
|||
update ic_form_list_item set sort='14' where DEL_FLAG='0' and FORM_ITEM_ID like '%1020' ; |
|||
update ic_form_list_item set sort='15' where DEL_FLAG='0' and FORM_ITEM_ID like '%1021' ; |
|||
update ic_form_list_item set sort='16' where DEL_FLAG='0' and FORM_ITEM_ID like '%1022' ; |
|||
update ic_form_list_item set sort='17' where DEL_FLAG='0' and FORM_ITEM_ID like '%1023' ; |
|||
update ic_form_list_item set sort='18' where DEL_FLAG='0' and FORM_ITEM_ID like '%1024' ; |
|||
update ic_form_list_item set sort='19' where DEL_FLAG='0' and FORM_ITEM_ID like '%1025' ; |
|||
update ic_form_list_item set sort='20' where DEL_FLAG='0' and FORM_ITEM_ID like '%1026' ; |
|||
update ic_form_list_item set sort='21' where DEL_FLAG='0' and FORM_ITEM_ID like '%1027' ; |
|||
update ic_form_list_item set sort='22' where DEL_FLAG='0' and FORM_ITEM_ID like '%1028' ; |
|||
update ic_form_list_item set sort='23' where DEL_FLAG='0' and FORM_ITEM_ID like '%1029' ; |
|||
update ic_form_list_item set sort='24' where DEL_FLAG='0' and FORM_ITEM_ID like '%1030' ; |
|||
update ic_form_list_item set sort='25' where DEL_FLAG='0' and FORM_ITEM_ID like '%1031' ; |
|||
update ic_form_list_item set sort='26' where DEL_FLAG='0' and FORM_ITEM_ID like '%10310' ; |
@ -0,0 +1,2 @@ |
|||
ALTER TABLE `epmet_oper_customize`.`ic_form_list_item` |
|||
ADD COLUMN `WIDTH` int(3) NULL COMMENT '表头宽度' AFTER `FORM_CODE`; |
Binary file not shown.
@ -0,0 +1,27 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 人员预警通知入参 |
|||
*/ |
|||
@Data |
|||
public class IcUserWarnNoticeFormDTO implements Serializable { |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@NotBlank(message = "组织id不能为空",groups = AddGroup.class) |
|||
private String agencyId; |
|||
/** |
|||
* |
|||
*/ |
|||
@NotBlank(message = "客户id不能为空",groups = AddGroup.class) |
|||
private String customerId; |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 人员预警通知返参 |
|||
*/ |
|||
@Data |
|||
public class IcUserWarnNoticeResultDTO implements Serializable { |
|||
|
|||
/** |
|||
* 预警配置id |
|||
*/ |
|||
private String configId; |
|||
/** |
|||
* 预警内容:南宁路社区第二网格亿联小区2号楼失业人员超出预警! |
|||
*/ |
|||
private String noticeContent; |
|||
// @JsonIgnore
|
|||
private String buildingId; |
|||
/** |
|||
* desc:该号楼有多少个符合条件的人 |
|||
*/ |
|||
private Integer count; |
|||
} |
Loading…
Reference in new issue