diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index 9e6d7ef077..c9a19fa8b8 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -13,6 +13,7 @@ import com.epmet.constant.TokenHeaderKeyConstant; import com.epmet.openapi.constant.AuthTypes; import com.epmet.openapi.constant.RequestParamKeys; import com.epmet.utils.ServerHttpRequestUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,9 +68,11 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory tranSerials = request.getHeaders().get(AppClientConstant.TRANSACTION_SERIAL_KEY); + if (CollectionUtils.isEmpty(tranSerials) || StringUtils.isBlank(tranSerials.get(0))) { + request.mutate().header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{getTransactionSerial()}); + } String authType = getAuthType(request); String requestUri = request.getPath().pathWithinApplication().value(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java index 773e902e00..809826e6fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java @@ -10,7 +10,7 @@ import com.epmet.dto.extract.form.ExtractIndexFormDTO; */ public interface IndexOriginExtractService { /** - * desc:从统计库对象抽取指标数据 + * desc:[月]从统计库对象抽取指标数据 * * @param formDTO */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index 926b253910..e93b4eba0c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -75,7 +75,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount()); BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount()); if (grid.getResolveProjectCount() != NumConstant.ZERO) { - entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setGovernRatio(ratio); } })); } @@ -87,7 +91,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); } })); } @@ -138,7 +146,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); } })); } @@ -149,7 +161,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setGovernRatio(ratio); } })); } @@ -198,7 +214,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); } })); } @@ -209,7 +229,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setGovernRatio(ratio); } })); } @@ -258,7 +282,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); } })); } @@ -269,7 +297,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setGovernRatio(ratio); } })); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java index 9eb8ac99ea..7430c1abe7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java @@ -471,6 +471,12 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl { r.setOrgType(level); r.setDateId(dateId); + // 这么写的目的是:防止把孔村,锦水,榆山的 orgType 赋值成 区县级别 + if (level.equals(ScreenConstant.DISTRICT)){ + if (r.getOrgId().equals(PingYinConstant.KONG_CUN_AGENCY_ID) || r.getOrgId().equals(PingYinConstant.YU_SHAN_AGENCY_ID) || r.getOrgId().equals(PingYinConstant.JIN_SHUI_AGENCY_ID)){ + r.setOrgType(ScreenConstant.STREET); + } + } }); } } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java index 8da5ab5729..b727bb5d1b 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -12,6 +14,11 @@ import java.io.Serializable; @Data public class GroupPointFormDTO implements Serializable { private static final long serialVersionUID = -3231073030413434313L; + + public interface GroupPoint extends CustomerClientShowGroup {} + public interface GridRank extends CustomerClientShowGroup {} + @NotBlank(message = "小组Id不能为空", groups = {GroupPoint.class, GridRank.class}) private String groupId; + @NotBlank(message = "网格Id不能为空", groups = {GridRank.class}) private String gridId; } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java index 4984d2ce0b..eed49d25d6 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java @@ -3,11 +3,12 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.GroupPointFormDTO; -import com.epmet.dto.result.GroupPointRuleResultDTO; -import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO; import com.epmet.dto.result.GroupPointRankingResultDTO; +import com.epmet.dto.result.GroupPointRuleResultDTO; import com.epmet.dto.result.PointRankingResultDTO; +import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO; import com.epmet.service.BizPointTotalDetailService; import com.epmet.service.BizPointUserTotalDetailService; import com.epmet.service.PointRuleService; @@ -47,6 +48,7 @@ public class GroupPointController { */ @PostMapping("pointranking") public Result> pointRanking(@LoginUser TokenDto tokenDto, @RequestBody GroupPointFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.GroupPoint.class); List list = bizPointUserTotalDetailService.pointRanking(tokenDto, formDTO); return new Result>().ok(list); } @@ -61,6 +63,7 @@ public class GroupPointController { */ @PostMapping("grouppointranking") public Result> groupPointRanking(@RequestBody GroupPointFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.GridRank.class); List list = bizPointTotalDetailService.groupPointRanking(formDTO); return new Result>().ok(list); } @@ -75,6 +78,7 @@ public class GroupPointController { */ @PostMapping("pointdetail") public Result pointDetail(@RequestBody GroupPointFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.GroupPoint.class); GroupPointDetailResultDTO result = bizPointTotalDetailService.pointDetail(formDTO); return new Result().ok(result); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java index 51684f9648..f7c93c7f0f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java @@ -166,13 +166,13 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl ) - ORDER BY pd.SERIAL_NUM DESC)t GROUP BY ID + GROUP BY pr.STAFF_ID ORDER BY pr.CREATED_TIME DESC)t