Browse Source

Merge remote-tracking branch 'origin/dev_bugfix_ljj' into dev_temp

# Conflicts:
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
master
zxc 4 years ago
parent
commit
6f52475340
  1. 70
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/KongCunCustomerEnvEnum.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java
  3. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java
  4. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  5. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml
  6. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml
  7. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml
  8. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java

70
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/KongCunCustomerEnvEnum.java

@ -0,0 +1,70 @@
package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.utils.SpringContextUtils;
import org.springframework.core.env.Environment;
/**
* 系统环境变量枚举类
* dev|test|prod
*
* @author jianjun liu
* @date 2020-07-03 11:14
**/
public enum KongCunCustomerEnvEnum {
/**
* 环境变量枚举
*/
DEV("dev", "开发环境", "613cc61a6b8ce4c70d21bd413dac72cc"),
TEST("test", "体验环境", "b272625617e53620b2b3cbc65d1ecbbb"),
PROD("prod", "生产环境", "6f203e30de1a65aab7e69c058826cd80"),
UN_KNOWN("prod", "生产环境", "6f203e30de1a65aab7e69c058826cd80")
;
private String code;
private String name;
private String customerId;
KongCunCustomerEnvEnum(String code, String name, String customerId) {
this.code = code;
this.name = name;
this.customerId = customerId;
}
public static KongCunCustomerEnvEnum getEnum(String code) {
KongCunCustomerEnvEnum[] values = KongCunCustomerEnvEnum.values();
for (KongCunCustomerEnvEnum value : values) {
if (value.getCode().equals(code)) {
return value;
}
}
return KongCunCustomerEnvEnum.UN_KNOWN;
}
public static KongCunCustomerEnvEnum getCurrentEnv(){
try {
Environment environment = SpringContextUtils.getBean(Environment.class);
String[] activeProfiles = environment.getActiveProfiles();
if (activeProfiles.length > 0) {
return getEnum(activeProfiles[0]);
}
} catch (Exception e) {
e.printStackTrace();
}
return KongCunCustomerEnvEnum.UN_KNOWN;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public String getCustomerId(){
return customerId;
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java

@ -86,7 +86,7 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao<FactIndexGovr
* @author zxc
* @date 2021/3/11 下午5:21
*/
List<Map<String,Object>> selectCommunityGovernAbilityIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectCommunityGovernAbilityIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("customerId")String customerId);
List<Map<String,Object>> selectCommunityGovernAbilityIsKongCunNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
/**

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java

@ -90,7 +90,7 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao<FactIndexSe
*/
List<Map<String,Object>> selectActivityCountMapExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectActivityCountMapExistsSubNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
List<Map<String,Object>> selectActivityCountMapIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectActivityCountMapIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("customerId")String customerId);
List<Map<String,Object>> selectActivityCountMapIsKongCunNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);
List<Map<String,Object>> selectActivityCountMapExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode);
List<Map<String,Object>> selectActivityCountMapExistsSubNotSelfNew(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId);

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.KongCunCustomerEnvEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
@ -349,7 +350,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
} else {
// 治理能力的六个五级指标
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityNew(customerId, monthId,IndexCalConstant.STREET_LEVEL,quarterId,yearId);
log.info("streetGovernAbilityCalculate: {}",JSON.toJSONString(communityGovernAbility));
if (CollectionUtils.isEmpty(communityGovernAbility)){
log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL);
}else{
@ -386,7 +386,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount);
});
insertDetail(result);
log.info("streetGovernAbilityCalculate: result{}",JSON.toJSONString(result));
return true;
}
@ -662,7 +661,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
//下属所有社区的党建能力平均值
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
List<SubCommunityAvgResultDTO> subCommPartyAvgScore = disposeSubAvg(dispose, form);
if (CollectionUtils.isEmpty(subCommPartyAvgScore)) {
log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL);
@ -741,7 +740,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) {
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
List<SubCommunityAvgResultDTO> subGridGovernAvg = disposeSubAvg(dispose,form);
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.warn("查询街道下属所有社区治理能力汇总为空");
@ -819,7 +818,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) {
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode());
List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId);
List<SubCommunityAvgResultDTO> subCommServiceAvg = disposeSubAvg(dispose,form);
if (CollectionUtils.isEmpty(subCommServiceAvg)) {
log.warn("查询街道下属社区服务能力得分平均值为空");
@ -961,7 +960,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
String yearId = DateUtils.getYearId(formDTO.getMonthId());
List<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelfNew(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET,quarterId,yearId);
List<Map<String, Object>> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode());
List<Map<String, Object>> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), KongCunCustomerEnvEnum.getCurrentEnv().getCustomerId());
if (!CollectionUtils.isEmpty(kongCunGovernAbility)){
kongCunGovernAbility.forEach(k -> {
k.put("AGENCY_ID",k.get("PARENT_ID"));
@ -982,7 +981,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
String yearId = DateUtils.getYearId(formDTO.getMonthId());
List<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(formDTO.getMonthId(),formDTO.getCustomerAreaCode());
List<Map<String, Object>> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode());
List<Map<String, Object>> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode(),KongCunCustomerEnvEnum.getCurrentEnv().getCustomerId());
if (!CollectionUtils.isEmpty(kongCunActivityCountList)){
kongCunActivityCountList.forEach(k -> {
k.put("AGENCY_ID",k.get("PARENT_ID"));

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml

@ -164,7 +164,8 @@
AND fics.index_code = #{indexCode}
)
WHERE sca.DEL_FLAG = 0
AND sca.PARENT_AREA_CODE = #{areaCode}
AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND sca.`LEVEL` = 'community'
GROUP BY agencyId
</select>
<select id="selectSubCommAvgScoreExistSubNotSelf"

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml

@ -278,6 +278,7 @@
AND gm.month_id = #{monthId}
AND gm.DATA_TYPE = 'street'
AND sca.PARENT_AREA_CODE = #{areaCode}
AND sca.CUSTOMER_ID = #{customerId}
AND gm.PARENT_ID != '0'
</select>
<select id="selectCommunityGovernAbilityIsKongCunNew" resultType="java.util.Map">

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml

@ -190,6 +190,7 @@
sm.del_flag = '0'
AND sm.DATA_TYPE = 'street'
AND sca.PARENT_AREA_CODE = #{areaCode}
AND sca.CUSTOMER_ID = #{customerId}
AND sm.month_id = #{monthId}
AND sm.PARENT_ID != '0'
</select>

4
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java

@ -6,7 +6,6 @@ import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.UserPointActionLogService;
import dto.form.SendPointFormDTO;
@ -75,7 +74,6 @@ public class MqPointCallbackController {
}
List<BasePointEventMsg> formList = JSON.parseArray(mqMsg.getMsg(), BasePointEventMsg.class);
try {
//TODO 调用调整积分方法去给用户加减积分 userPointActionLogService.
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(EventEnum.REGISTER_VOLUNTEER.getEventTag(),obj);
});
@ -103,9 +101,7 @@ public class MqPointCallbackController {
return new Result<Boolean>().ok(true);
}
List<BasePointEventMsg> formList = JSON.parseArray(mqMsg.getMsg(), BasePointEventMsg.class);
//BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class);
try {
//TODO 调用调整积分方法去给用户加减积分 userPointActionLogService.
formList.forEach(obj -> {
userPointActionLogService.grantPointByEvent(EventEnum.ACTIVE_INSERT_LIVE.getEventTag(),obj);
});

Loading…
Cancel
Save