69 changed files with 806 additions and 97 deletions
@ -0,0 +1,46 @@ |
|||
package com.epmet.commons.tools.enums; |
|||
|
|||
/** |
|||
* desc:数字社区平台-表单配置枚举类 |
|||
* |
|||
* @author jianjun liu |
|||
* @date 2020-07-03 11:14 |
|||
**/ |
|||
public enum IcFormCodeEnum { |
|||
/** |
|||
* 表单code枚举 |
|||
*/ |
|||
RESI_BASE_INFO("resi_base_info", "居民信息"), |
|||
|
|||
; |
|||
|
|||
private String code; |
|||
private String name; |
|||
|
|||
|
|||
|
|||
IcFormCodeEnum(String code, String name) { |
|||
this.code = code; |
|||
this.name = name; |
|||
} |
|||
|
|||
public static IcFormCodeEnum getEnum(String code) { |
|||
IcFormCodeEnum[] values = IcFormCodeEnum.values(); |
|||
for (IcFormCodeEnum value : values) { |
|||
if (value.getCode().equals(code)) { |
|||
return value; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
public String getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.epmet.evaluationindex.screen.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 市北数字社区-组织先进排行榜 查询结果dto |
|||
* @ClassName OrgRankDataResultDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-21 11:16 |
|||
*/ |
|||
@Data |
|||
public class OrgRankDataShibeiResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -7874641768141936572L; |
|||
|
|||
private String orgId; |
|||
/** |
|||
* 名称 XXXX社区党委 |
|||
* */ |
|||
private String name; |
|||
|
|||
/** |
|||
* 党员数 |
|||
* */ |
|||
private BigDecimal score; |
|||
|
|||
/** |
|||
* 数据所属月份 |
|||
*/ |
|||
private String monthId; |
|||
} |
@ -0,0 +1,42 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.datareport.dao.evaluationindex.screen; |
|||
|
|||
import com.epmet.evaluationindex.screen.dto.form.AdvancedBranchRankFormDTO; |
|||
import com.epmet.evaluationindex.screen.dto.result.OrgRankDataShibeiResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 党建引领-组织排行榜 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-08-18 |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenOrgRankDataShibeiDao { |
|||
|
|||
/** |
|||
* @return |
|||
* @Description 查询指定机关的所有直属网格月度数据 |
|||
* @author wangc |
|||
* @date 2020.08.21 13:58 |
|||
**/ |
|||
List<OrgRankDataShibeiResultDTO> selectGridRankList(AdvancedBranchRankFormDTO formDTO); |
|||
} |
@ -0,0 +1,29 @@ |
|||
<?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.datareport.dao.evaluationindex.screen.ScreenOrgRankDataShibeiDao"> |
|||
|
|||
<!-- 查询指定机关的直属网格月度数据 --> |
|||
<select id="selectGridRankList" resultType="com.epmet.evaluationindex.screen.dto.result.OrgRankDataShibeiResultDTO"> |
|||
SELECT |
|||
rankData.ORG_NAME AS NAME, |
|||
round(rankData.SCORE,1) score, |
|||
rankData.ORG_ID as orgId, |
|||
rankData.MONTH_ID |
|||
FROM |
|||
screen_org_rank_data_shibei rankData |
|||
LEFT JOIN screen_customer_agency agency |
|||
ON rankData.PARENT_ID = agency.AGENCY_ID AND agency.DEL_FLAG = 0 |
|||
WHERE |
|||
rankData.DEL_FLAG = '0' |
|||
AND rankData.ORG_TYPE = 'grid' |
|||
AND rankData.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') |
|||
AND rankData.MONTH_ID = #{monthId} |
|||
AND rankData.CUSTOMER_ID = #{customerId} |
|||
ORDER BY |
|||
rankData.SCORE DESC |
|||
LIMIT #{topNum} |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,106 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.constant.StrConstant; |
|||
import com.epmet.commons.tools.enums.BizTypeEnum; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.redis.RedisKeys; |
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.StatsFormDTO; |
|||
import com.epmet.dto.extract.form.ExtractOriginFormDTO; |
|||
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; |
|||
import com.epmet.service.StatsProjectService; |
|||
import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.LinkedHashSet; |
|||
import java.util.List; |
|||
import java.util.Set; |
|||
|
|||
/** |
|||
* desc:市北数字社区 单独部署 job入口 【用户积分排名及项目状态数据】 |
|||
*/ |
|||
@RequestMapping("shibeiICJob") |
|||
@RestController |
|||
@Slf4j |
|||
public class ShiBeiICJobController { |
|||
@Autowired |
|||
private ScreenGrassrootsGovernDataAbsorptionService screenGrassrootsGovernDataAbsorptionService; |
|||
@Autowired |
|||
private StatsProjectService statsProjectService; |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
@PostMapping("userPointAndProjectStatus/{bizType}") |
|||
public Result<String> userPointAndProjectStatus(@PathVariable("bizType") String bizType, @RequestBody ExtractOriginFormDTO formDTO) { |
|||
if (StringUtils.isBlank(formDTO.getCustomerId())){ |
|||
return new Result<String>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误cid不能为空"); |
|||
} |
|||
long start = System.currentTimeMillis(); |
|||
Set<String> result = new LinkedHashSet<>(); |
|||
if (StringUtils.isNotBlank(formDTO.getStartDate()) && StringUtils.isNotBlank(formDTO.getEndDate())) { |
|||
List<String> daysBetween = DateUtils.getDaysBetween(formDTO.getStartDate(), formDTO.getEndDate()); |
|||
daysBetween.forEach(d -> { |
|||
executeMethod(bizType, formDTO.getCustomerId(), d); |
|||
result.add(d); |
|||
redisUtils.hSet(RedisKeys.getBackDoorbizExcuteResult("userPointAndProjectStatus-"+bizType), formDTO.getCustomerId(), result, 3 * 24 * 60 * 60L); |
|||
}); |
|||
} else { |
|||
if (StringUtils.isBlank(formDTO.getDateId())){ |
|||
formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); |
|||
} |
|||
executeMethod(bizType, formDTO.getCustomerId(), formDTO.getDateId()); |
|||
result.add(formDTO.getDateId()); |
|||
redisUtils.hSet(RedisKeys.getBackDoorbizExcuteResult("userPointAndProjectStatus-"+bizType), formDTO.getCustomerId(), result, 3 * 24 * 60 * 60L); |
|||
} |
|||
long end = System.currentTimeMillis(); |
|||
long l = (end - start) / 1000; |
|||
return new Result<String>().ok("userPointAndProjectStatus耗时-"+bizType + l + "s"); |
|||
} |
|||
|
|||
private void executeMethod(String bizType, String customerId, String d) { |
|||
if (bizType.equals(BizTypeEnum.USER.getType())){ |
|||
this.extractUserPointData(customerId, d); |
|||
} |
|||
if (bizType.equals(BizTypeEnum.PROJECT.getType())) { |
|||
this.agencyProjectStats(customerId, d); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-机关日(月)统计 |
|||
**/ |
|||
private void agencyProjectStats(String customerId, String dateId) { |
|||
try { |
|||
if (StringUtils.isNotBlank(dateId)) { |
|||
dateId = DateUtils.format(DateUtils.parseDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD)); |
|||
} |
|||
StatsFormDTO formDTO = new StatsFormDTO(); |
|||
formDTO.setCustomerId(customerId); |
|||
formDTO.setDate(dateId); |
|||
|
|||
statsProjectService.agencyProjectStats(formDTO); |
|||
} catch (Exception e) { |
|||
log.error("市北-项目状态数据写入失败,参数为:{}" + customerId + StrConstant.HYPHEN + dateId, e); |
|||
} |
|||
new Result(); |
|||
} |
|||
|
|||
private void extractUserPointData(String customerId, String dateId) { |
|||
try { |
|||
//基层治理 - 热心市民 screen_party_user_rank_data
|
|||
ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO(); |
|||
param.setCustomerId(customerId); |
|||
param.setDateId(dateId); |
|||
screenGrassrootsGovernDataAbsorptionService.userScoreDataHub(param); |
|||
} catch (Exception e) { |
|||
log.error("市北-热心市民/党员得分数据写入失败,参数为:{}" + customerId + StrConstant.HYPHEN + dateId, e); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,49 @@ |
|||
-- 服务事项从需求分类字典表中抽离出来了,对应历史数据修改如下 |
|||
-- 1、联建单位的服务事项置空 |
|||
update ic_party_unit set SERVICE_MATTER =''; |
|||
-- 2、联建活动的服务事项修改为新的编码 |
|||
update ic_party_activity set SERVICE_MATTER='1006' where SERVICE_MATTER = '10100006'; |
|||
update ic_party_activity set SERVICE_MATTER='1008' where SERVICE_MATTER = '10100008'; |
|||
update ic_party_activity set SERVICE_MATTER='1002' where SERVICE_MATTER = '10100002'; |
|||
update ic_party_activity set SERVICE_MATTER='1009' where SERVICE_MATTER = '10100009'; |
|||
update ic_party_activity set SERVICE_MATTER='1017' where SERVICE_MATTER = '10100017'; |
|||
update ic_party_activity set SERVICE_MATTER='1021' where SERVICE_MATTER = '10100021'; |
|||
update ic_party_activity set SERVICE_MATTER='1015' where SERVICE_MATTER = '10100015'; |
|||
update ic_party_activity set SERVICE_MATTER='1011' where SERVICE_MATTER = '10100011'; |
|||
update ic_party_activity set SERVICE_MATTER='1018' where SERVICE_MATTER = '10100018'; |
|||
update ic_party_activity set SERVICE_MATTER='1005' where SERVICE_MATTER = '10100005'; |
|||
update ic_party_activity set SERVICE_MATTER='1010' where SERVICE_MATTER = '10100010'; |
|||
update ic_party_activity set SERVICE_MATTER='1003' where SERVICE_MATTER = '10100003'; |
|||
update ic_party_activity set SERVICE_MATTER='1020' where SERVICE_MATTER = '10100020'; |
|||
update ic_party_activity set SERVICE_MATTER='1022' where SERVICE_MATTER = '10100022'; |
|||
update ic_party_activity set SERVICE_MATTER='1014' where SERVICE_MATTER = '10100014'; |
|||
update ic_party_activity set SERVICE_MATTER='1007' where SERVICE_MATTER = '10100007'; |
|||
update ic_party_activity set SERVICE_MATTER='1001' where SERVICE_MATTER = '10100001'; |
|||
update ic_party_activity set SERVICE_MATTER='1004' where SERVICE_MATTER = '10100004'; |
|||
update ic_party_activity set SERVICE_MATTER='1016' where SERVICE_MATTER = '10100016'; |
|||
update ic_party_activity set SERVICE_MATTER='1013' where SERVICE_MATTER = '10100013'; |
|||
update ic_party_activity set SERVICE_MATTER='1012' where SERVICE_MATTER = '10100012'; |
|||
update ic_party_activity set SERVICE_MATTER='1019' where SERVICE_MATTER = '10100019'; |
|||
-- 3、爱心互助-活动类型为联建活动,对应的服务事项编码改为新的 |
|||
update act_info set SERVICE_MATTER='1006' where ACT_TYPE='party' and SERVICE_MATTER='10100006' ; |
|||
update act_info set SERVICE_MATTER='1008' where ACT_TYPE='party' and SERVICE_MATTER='10100008' ; |
|||
update act_info set SERVICE_MATTER='1002' where ACT_TYPE='party' and SERVICE_MATTER='10100002' ; |
|||
update act_info set SERVICE_MATTER='1009' where ACT_TYPE='party' and SERVICE_MATTER='10100009' ; |
|||
update act_info set SERVICE_MATTER='1017' where ACT_TYPE='party' and SERVICE_MATTER='10100017' ; |
|||
update act_info set SERVICE_MATTER='1021' where ACT_TYPE='party' and SERVICE_MATTER='10100021' ; |
|||
update act_info set SERVICE_MATTER='1015' where ACT_TYPE='party' and SERVICE_MATTER='10100015' ; |
|||
update act_info set SERVICE_MATTER='1011' where ACT_TYPE='party' and SERVICE_MATTER='10100011' ; |
|||
update act_info set SERVICE_MATTER='1018' where ACT_TYPE='party' and SERVICE_MATTER='10100018' ; |
|||
update act_info set SERVICE_MATTER='1005' where ACT_TYPE='party' and SERVICE_MATTER='10100005' ; |
|||
update act_info set SERVICE_MATTER='1010' where ACT_TYPE='party' and SERVICE_MATTER='10100010' ; |
|||
update act_info set SERVICE_MATTER='1003' where ACT_TYPE='party' and SERVICE_MATTER='10100003' ; |
|||
update act_info set SERVICE_MATTER='1020' where ACT_TYPE='party' and SERVICE_MATTER='10100020' ; |
|||
update act_info set SERVICE_MATTER='1022' where ACT_TYPE='party' and SERVICE_MATTER='10100022' ; |
|||
update act_info set SERVICE_MATTER='1014' where ACT_TYPE='party' and SERVICE_MATTER='10100014' ; |
|||
update act_info set SERVICE_MATTER='1007' where ACT_TYPE='party' and SERVICE_MATTER='10100007' ; |
|||
update act_info set SERVICE_MATTER='1001' where ACT_TYPE='party' and SERVICE_MATTER='10100001' ; |
|||
update act_info set SERVICE_MATTER='1004' where ACT_TYPE='party' and SERVICE_MATTER='10100004' ; |
|||
update act_info set SERVICE_MATTER='1016' where ACT_TYPE='party' and SERVICE_MATTER='10100016' ; |
|||
update act_info set SERVICE_MATTER='1013' where ACT_TYPE='party' and SERVICE_MATTER='10100013' ; |
|||
update act_info set SERVICE_MATTER='1012' where ACT_TYPE='party' and SERVICE_MATTER='10100012' ; |
|||
update act_info set SERVICE_MATTER='1019' where ACT_TYPE='party' and SERVICE_MATTER='10100019' ; |
@ -0,0 +1,33 @@ |
|||
package com.epmet.task.ic; |
|||
|
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.tools.enums.BizTypeEnum; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.extract.form.ExtractOriginFormDTO; |
|||
import com.epmet.feign.DataStatisticalOpenFeignClient; |
|||
import com.epmet.task.ITask; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* desc:数字社区私有化部署 任务之一还有【autoEvaluateDemandTask,statsDemandTask,dailyStatisticalVoteTask,IcPrivateDeploySupportUserPointTask】 |
|||
*/ |
|||
@Slf4j |
|||
@Component("icPrivateDeploySupportProjectTask") |
|||
public class IcPrivateDeploySupportProjectTask implements ITask { |
|||
@Autowired |
|||
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; |
|||
|
|||
@Override |
|||
public void run(String params) { |
|||
ExtractOriginFormDTO formDTO = new ExtractOriginFormDTO(); |
|||
if (StringUtils.isNotBlank(params)) { |
|||
formDTO = JSON.parseObject(params, ExtractOriginFormDTO.class); |
|||
} |
|||
Result result = dataStatisticalOpenFeignClient.userPointAndProjectStatus(BizTypeEnum.PROJECT.getType(), formDTO); |
|||
log.info("icPrivateDeploySupportProjectTask excute end,param:{},result:{}",params,result); |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.task.ic; |
|||
|
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.tools.enums.BizTypeEnum; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.extract.form.ExtractOriginFormDTO; |
|||
import com.epmet.feign.DataStatisticalOpenFeignClient; |
|||
import com.epmet.task.ITask; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* desc:数字社区私有化部署 任务之一还有【autoEvaluateDemandTask,statsDemandTask,dailyStatisticalVoteTask,icPrivateDeploySupportProjectTask】 |
|||
*/ |
|||
@Slf4j |
|||
@Component("icPrivateDeploySupportUserPointTask") |
|||
public class IcPrivateDeploySupportUserPointTask implements ITask { |
|||
@Autowired |
|||
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; |
|||
|
|||
@Override |
|||
public void run(String params) { |
|||
ExtractOriginFormDTO formDTO = new ExtractOriginFormDTO(); |
|||
if (StringUtils.isNotBlank(params)) { |
|||
formDTO = JSON.parseObject(params, ExtractOriginFormDTO.class); |
|||
} |
|||
Result result = dataStatisticalOpenFeignClient.userPointAndProjectStatus(BizTypeEnum.USER.getType(), formDTO); |
|||
log.info("icPrivateDeploySupportUserPointTask excute end,param:{},result:{}",params,result); |
|||
} |
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2022/1/17 10:52 上午 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class IndividualCategoryAllListResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3294223041221531203L; |
|||
|
|||
/** |
|||
* 标签 |
|||
*/ |
|||
private String label; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
private String managementIcon; |
|||
|
|||
/** |
|||
* 字段名 |
|||
*/ |
|||
private String columnName; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
private String id; |
|||
|
|||
/** |
|||
* 是否选中 true:是;false:否 |
|||
*/ |
|||
private boolean isSelected = false; |
|||
} |
@ -1,3 +1,3 @@ |
|||
ALTER TABLE `ic_user_change_detailed` |
|||
ADD COLUMN `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT ''组织的所有上级Id'' AFTER `IC_USER_CHANGE_RECORD_ID`; |
|||
ADD COLUMN `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织的所有上级Id' AFTER `IC_USER_CHANGE_RECORD_ID`; |
|||
|
|||
|
Loading…
Reference in new issue