From 016ded5bc0571842d27823f6037794ea6f4c02ab Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 21 Sep 2020 14:08:46 +0800 Subject: [PATCH 01/24] =?UTF-8?q?=E5=A2=9E=E5=8A=A0footbar=E7=BC=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 10 ++++++ .../controller/CustomerFootBarController.java | 24 +++++++++++++ .../impl/CustomerFootBarServiceImpl.java | 35 +++++++++++++++++++ 3 files changed, 69 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index ea8f100f6c..e88a2d92af 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -335,4 +335,14 @@ public class RedisKeys { public static String getCustomerStatsCalKeyPrefix() { return rootPrefix.concat("stats:calflag"); } + + /** + * footbar缓存key + * @param customerId + * @param appType + * @return + */ + public static String getCustomerFootbarKey(String customerId, String appType) { + return rootPrefix.concat("footbar").concat(":").concat(customerId).concat(":").concat(appType); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java index 5b9c7a0da8..924dbc5b4b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java @@ -18,6 +18,8 @@ package com.epmet.controller; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -31,8 +33,12 @@ import com.epmet.dto.result.CustomerFootBarResultDTO; import com.epmet.entity.CustomerFootBarEntity; import com.epmet.excel.CustomerFootBarExcel; import com.epmet.service.CustomerFootBarService; +import com.epmet.service.impl.CustomerFunctionDetailServiceImpl; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; @@ -51,9 +57,14 @@ import java.util.Map; @RequestMapping("customerfootbar") public class CustomerFootBarController { + private Logger logger = LogManager.getLogger(CustomerFootBarController.class); + @Autowired private CustomerFootBarService customerFootBarService; + @Autowired + private RedisUtils redisUtils; + @GetMapping("page") public Result> page(@RequestParam Map params){ PageData page = customerFootBarService.page(params); @@ -107,6 +118,13 @@ public class CustomerFootBarController { String customerId = formDTO.getCustomerId(); String appType = formDTO.getAppType(); + // 优先查询缓存 + List bars = (List)redisUtils.get(RedisKeys.getCustomerFootbarKey(customerId, appType)); + if (bars != null) { + new Result>().ok(bars); + } + + // 查询db List footbars = customerFootBarService.listCustomerFootBars(customerId, appType); List barDTOS = new LinkedList<>(); footbars.forEach(barEntity -> { @@ -117,6 +135,12 @@ public class CustomerFootBarController { barDTO.setDefaultBarName(defaultFootBarEntity.getBarName()); barDTOS.add(barDTO); }); + + try { + redisUtils.set(RedisKeys.getCustomerFootbarKey(customerId, appType), barDTOS); + } catch (Exception e) { + logger.error("将客户footbar放入缓存失败,customerId:{}, appType:{}", customerId, appType); + } return new Result>().ok(barDTOS); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java index 594674b283..5205059bc0 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java @@ -23,6 +23,8 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.CustomerFootBarDao; @@ -36,10 +38,12 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.Optional; /** * APP底部菜单栏信息 @@ -53,6 +57,9 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -160,6 +167,7 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl { + // 删除缓存中的footbar。若缓存删除失败,则事务回滚,db中的不应该成功 + redisUtils.delete(RedisKeys.getCustomerFootbarKey(c.getCustomerId(), c.getAppType())); + }); + } + } @Override @@ -204,9 +227,17 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl { + // 删除缓存中的footbar。若缓存删除失败,则事务回滚,db中的不应该成功 + redisUtils.delete(RedisKeys.getCustomerFootbarKey(c.getCustomerId(), c.getAppType())); + }); } @Transactional @@ -230,10 +261,14 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl Date: Tue, 27 Oct 2020 09:16:53 +0800 Subject: [PATCH 02/24] =?UTF-8?q?=E5=A4=87=E6=B3=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/controller/screen/DistributionController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index 25bf9e5434..bf29a4c4d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -39,7 +39,7 @@ public class DistributionController { } /** - * @Description 2、用户分布 【只显示 screen_customer_biz_org 表中存在的orgId的数据】 + * @Description 2、用户分布 【只显示 is_display = 1 的数据】 * @param userFormDTO * @author zxc * @date 2020/8/18 11:10 上午 @@ -51,7 +51,7 @@ public class DistributionController { } /** - * @Description 3、党员分布 【只显示 screen_customer_biz_org 表中存在的orgId的数据】 + * @Description 3、党员分布 【只显示 is_display = 1 的数据】 * @param parymemberFormDTO * @author zxc * @date 2020/8/18 11:20 上午 From 92e24b68cc51ba0419841e20b955070400fa7725 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 27 Oct 2020 13:32:27 +0800 Subject: [PATCH 03/24] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/form/BranchCountFormDTO.java | 24 ++++++++++ .../dto/result/BranchCountResultDTO.java | 45 +++++++++++++++++++ .../screen/DistributionController.java | 12 +++++ .../screen/ScreenCustomerGridDao.java | 8 ++++ .../screen/DistributionService.java | 8 ++++ .../screen/impl/DistributionServiceImpl.java | 15 +++++++ .../mapper/screen/ScreenCustomerGridDao.xml | 22 ++++++++- .../screen/ScreenPartyLinkMassesDataDao.xml | 13 +++--- 8 files changed, 139 insertions(+), 8 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchCountFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchCountFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchCountFormDTO.java new file mode 100644 index 0000000000..1d2d9cb77f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchCountFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/27 11:08 上午 + */ +@Data +public class BranchCountFormDTO implements Serializable { + + private static final long serialVersionUID = -4869326660700557193L; + + public interface BranchCount{} + + /** + * 机关ID + */ + @NotBlank(message = "机关ID不能为空",groups = {BranchCount.class}) + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java new file mode 100644 index 0000000000..53dbb106c4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/27 11:03 上午 + */ +@Data +public class BranchCountResultDTO implements Serializable { + + private static final long serialVersionUID = -5915969126291502360L; + + private String agencyId; + + /** + * 机关名称 + */ + private String name; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 社区下的党支部数 + */ + private Integer totalNum; + + /** + * 坐标区域 + */ + private String areaMarks; + + public BranchCountResultDTO() { + this.agencyId = ""; + this.name = ""; + this.centerMark = ""; + this.totalNum = 0; + this.areaMarks = ""; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index bf29a4c4d1..fb9eeb8860 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -38,6 +38,18 @@ public class DistributionController { return new Result>().ok(distributionService.branch(formDTO)); } + /** + * @Description 查询机关下的党支部 + * @Param branchCountFormDTO + * @author zxc + * @date 2020/10/27 11:11 上午 + */ + @PostMapping("branchcount") + public Result branchCount(@RequestBody BranchCountFormDTO branchCountFormDTO){ + ValidatorUtils.validateEntity(branchCountFormDTO, BranchCountFormDTO.BranchCount.class); + return new Result().ok(distributionService.branchCount(branchCountFormDTO)); + } + /** * @Description 2、用户分布 【只显示 is_display = 1 的数据】 * @param userFormDTO diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java index b6196411f8..e0a36b8fc3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -48,6 +48,14 @@ public interface ScreenCustomerGridDao { */ List selectBranch(@Param("agencyId")String agencyId); + /** + * @Description 查询机关下的党支部 + * @Param branchCountFormDTO + * @author zxc + * @date 2020/10/27 11:11 上午 + */ + BranchCountResultDTO selectBranchCount(@Param("agencyId")String agencyId); + /** * @Description 查询子级用户分布【网格级别】 * @param parentId diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java index a73d1ccfcd..9f2552329b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java @@ -21,6 +21,14 @@ public interface DistributionService { */ List branch(BranchFormDTO formDTO); + /** + * @Description 查询机关下的党支部 + * @Param branchCountFormDTO + * @author zxc + * @date 2020/10/27 11:11 上午 + */ + BranchCountResultDTO branchCount(BranchCountFormDTO branchCountFormDTO); + /** * @Description 2、用户分布 * @param userFormDTO diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index b65c0fe059..456ef83a92 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -50,6 +50,21 @@ public class DistributionServiceImpl implements DistributionService { return branchResultDTOS; } + /** + * @Description 查询机关下的党支部 + * @Param branchCountFormDTO + * @author zxc + * @date 2020/10/27 11:11 上午 + */ + @Override + public BranchCountResultDTO branchCount(BranchCountFormDTO branchCountFormDTO) { + BranchCountResultDTO branchCountResultDTO = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); + if (null == branchCountFormDTO){ + return new BranchCountResultDTO(); + } + return branchCountResultDTO; + } + /** * @Description 2、用户分布 * @param userFormDTO diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index c072214600..eccb843876 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -26,10 +26,10 @@ scg.party_mark AS partyMark FROM screen_customer_grid scg - LEFT JOIN screen_customer_biz_org bo ON bo.ORG_ID = scg.PARENT_AGENCY_ID + LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = scg.PARENT_AGENCY_ID AND sca.IS_DISPLAY = 1 WHERE scg.del_flag = 0 - AND bo.BIZ_TYPE = 'community' + AND sca.DEL_FLAG = 0 AND scg.all_parent_ids LIKE concat('%', #{agencyId}, '%') @@ -84,4 +84,22 @@ ORDER BY created_time DESC + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml index 2bbdece16c..7a59c7f16d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -6,13 +6,14 @@ \ No newline at end of file From bd480623dff3a9c883bfec966692dfede0da7101 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 27 Oct 2020 14:22:40 +0800 Subject: [PATCH 04/24] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenCustomerGridDao.java | 3 +- .../screen/impl/DistributionServiceImpl.java | 3 +- .../mapper/screen/ScreenCustomerGridDao.xml | 30 ++++++++++++------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java index e0a36b8fc3..741a6956eb 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -54,7 +54,8 @@ public interface ScreenCustomerGridDao { * @author zxc * @date 2020/10/27 11:11 上午 */ - BranchCountResultDTO selectBranchCount(@Param("agencyId")String agencyId); + BranchCountResultDTO selectAgencyInfo(@Param("agencyId")String agencyId); + Integer selectBranchCount(@Param("agencyId")String agencyId); /** * @Description 查询子级用户分布【网格级别】 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index 456ef83a92..a55b4e5e69 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -58,10 +58,11 @@ public class DistributionServiceImpl implements DistributionService { */ @Override public BranchCountResultDTO branchCount(BranchCountFormDTO branchCountFormDTO) { - BranchCountResultDTO branchCountResultDTO = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); + BranchCountResultDTO branchCountResultDTO = screenCustomerGridDao.selectAgencyInfo(branchCountFormDTO.getAgencyId()); if (null == branchCountFormDTO){ return new BranchCountResultDTO(); } + branchCountResultDTO.setTotalNum(screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId())); return branchCountResultDTO; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index eccb843876..39b4cd2153 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -86,20 +86,28 @@ - SELECT - scg.PARENT_AGENCY_ID AS agencyId, - sca.AGENCY_NAME AS name, - IFNULL(sca.PARTY_MARK,'') AS partyMark, - IFNULL(sca.CENTER_MARK,'[]') AS centerMark, - COUNT(scg.ID) AS totalNum + AGENCY_ID, + AGENCY_NAME AS name, + IFNULL(PARTY_MARK,''), + IFNULL(CENTER_MARK,'') FROM - screen_customer_grid scg - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = scg.PARENT_AGENCY_ID AND sca.IS_DISPLAY = 1 + screen_customer_agency WHERE - scg.del_flag = 0 - AND sca.DEL_FLAG = 0 - AND scg.all_parent_ids LIKE concat('%', #{agencyId}, '%') + DEL_FLAG = 0 + AND IS_DISPLAY = 1 + AND AGENCY_ID = #{agencyId} + + + \ No newline at end of file From 0bc88795f46d47d2fe5d81405232aba7496d1d57 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 27 Oct 2020 16:18:35 +0800 Subject: [PATCH 05/24] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/impl/DistributionServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index a55b4e5e69..9802d31fdd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -62,7 +62,8 @@ public class DistributionServiceImpl implements DistributionService { if (null == branchCountFormDTO){ return new BranchCountResultDTO(); } - branchCountResultDTO.setTotalNum(screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId())); + Integer totalNum = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); + branchCountResultDTO.setTotalNum(null == totalNum ? NumConstant.ZERO : totalNum); return branchCountResultDTO; } From 02915fc883b106492fb0711e705d9c1cadfc900f Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 27 Oct 2020 16:23:40 +0800 Subject: [PATCH 06/24] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AE=B0=E5=BD=95=E6=A0=A1=E9=AA=8C=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E7=BD=91=E6=A0=BCId=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E5=9C=A8=E4=B8=80=E4=B8=AA=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E4=B8=8B=E7=94=B3=E8=AF=B7=E4=BA=86=E5=85=9A=E5=91=98=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E5=85=B6=E4=BD=99=E7=BD=91=E6=A0=BC=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=86=8D=E6=AC=A1=E7=94=B3=E8=AF=B7=E5=85=9A=E5=91=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partymember/service/impl/PartyMemberConfirmServiceImpl.java | 2 +- .../main/resources/mapper/partymember/PartymemberInfoDao.xml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 7713b97928..d837871e65 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -97,7 +97,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService // 获取党员认证信息,判断是否提交认证 PartymemberInfoDTO partyMemberInfoParam = new PartymemberInfoDTO(); partyMemberInfoParam.setCustomerId(fromDto.getCustomerId()); - partyMemberInfoParam.setGridId(fromDto.getGridId()); + //partyMemberInfoParam.setGridId(fromDto.getGridId()); partyMemberInfoParam.setUserId(fromDto.getUserId()); PartymemberInfoDTO partyMemberInfoResult = partymemberInfoService.getPartyMemberInfo(partyMemberInfoParam); // 若已提交,获取提交的党员信息 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml index 35447099f8..ece58ea009 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml @@ -38,7 +38,6 @@ AND pcm.DEL_FLAG = 0 WHERE pi.CUSTOMER_ID = #{customerId} - AND pi.GRID_ID = #{gridId} AND pi.USER_ID = #{userId} AND pi.CONFIRM_RESULT = 'auto_confirm_failed' AND pi.DEL_FLAG = 0 From 39bc9f6f4c7be6210ac41f26446b7434b1ff46d5 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 27 Oct 2020 16:36:22 +0800 Subject: [PATCH 07/24] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/impl/DistributionServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index 9802d31fdd..766b92168c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -59,7 +59,7 @@ public class DistributionServiceImpl implements DistributionService { @Override public BranchCountResultDTO branchCount(BranchCountFormDTO branchCountFormDTO) { BranchCountResultDTO branchCountResultDTO = screenCustomerGridDao.selectAgencyInfo(branchCountFormDTO.getAgencyId()); - if (null == branchCountFormDTO){ + if (null == branchCountResultDTO){ return new BranchCountResultDTO(); } Integer totalNum = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); From 2822de7c57174b8d75838fc73406bdfa9ac7e6b7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 27 Oct 2020 17:32:31 +0800 Subject: [PATCH 08/24] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/BranchCountResultDTO.java | 23 ++++-------- .../dto/result/SubBranchCountResultDTO.java | 37 +++++++++++++++++++ .../screen/ScreenCustomerGridDao.java | 2 +- .../screen/impl/DistributionServiceImpl.java | 8 +++- .../mapper/screen/ScreenCustomerGridDao.xml | 21 ++++++++--- 5 files changed, 66 insertions(+), 25 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java index 53dbb106c4..5a2c8cd391 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java @@ -1,8 +1,11 @@ package com.epmet.evaluationindex.screen.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; /** * @Author zxc @@ -20,26 +23,14 @@ public class BranchCountResultDTO implements Serializable { */ private String name; - /** - * 中心点位 - */ - private String centerMark; + @JsonIgnore + private String level; - /** - * 社区下的党支部数 - */ - private Integer totalNum; - - /** - * 坐标区域 - */ - private String areaMarks; + private List partyDistribution; public BranchCountResultDTO() { this.agencyId = ""; this.name = ""; - this.centerMark = ""; - this.totalNum = 0; - this.areaMarks = ""; + this.partyDistribution = new ArrayList<>(); } } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java new file mode 100644 index 0000000000..93466fedf4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/27 5:22 下午 + */ +@Data +public class SubBranchCountResultDTO implements Serializable { + + private static final long serialVersionUID = -4174988002147169566L; + + private String subId; + + /** + * 机关名称 + */ + private String name; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 社区下的党支部数 + */ + private Integer totalNum; + + /** + * 坐标区域 + */ + private String areaMarks; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 741a6956eb..a024d60791 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -55,7 +55,7 @@ public interface ScreenCustomerGridDao { * @date 2020/10/27 11:11 上午 */ BranchCountResultDTO selectAgencyInfo(@Param("agencyId")String agencyId); - Integer selectBranchCount(@Param("agencyId")String agencyId); + List selectBranchCount(@Param("agencyId")String agencyId); /** * @Description 查询子级用户分布【网格级别】 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index 766b92168c..af0ba2d939 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -14,6 +14,7 @@ import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; @@ -62,8 +63,11 @@ public class DistributionServiceImpl implements DistributionService { if (null == branchCountResultDTO){ return new BranchCountResultDTO(); } - Integer totalNum = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); - branchCountResultDTO.setTotalNum(null == totalNum ? NumConstant.ZERO : totalNum); + if (branchCountResultDTO.getLevel().equals(ScreenConstant.COMMUNITY)){ + return new BranchCountResultDTO(); + } + List subList = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); + branchCountResultDTO.setPartyDistribution(CollectionUtils.isEmpty(subList) ? new ArrayList<>() : subList); return branchCountResultDTO; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 39b4cd2153..ae272334e0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -91,7 +91,8 @@ AGENCY_ID, AGENCY_NAME AS name, IFNULL(PARTY_MARK,''), - IFNULL(CENTER_MARK,'') + IFNULL(CENTER_MARK,''), + level FROM screen_customer_agency WHERE @@ -100,14 +101,22 @@ AND AGENCY_ID = #{agencyId} - SELECT - COUNT( ID ) AS totalNum + COUNT( scg.ID ) AS totalNum, + sca.AGENCY_ID AS subId, + IFNULL(sca.CENTER_MARK,'') AS centerMark, + sca.AGENCY_NAME AS name, + IFNULL(sca.AREA_MARKS,'') AS areaMarks FROM - screen_customer_grid + screen_customer_grid scg + LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = scg.PARENT_AGENCY_ID WHERE - DEL_FLAG = 0 - AND all_parent_ids LIKE concat('%',#{agencyId}, '%') + scg.DEL_FLAG = 0 + AND sca.DEL_FLAG = 0 + AND sca.IS_DISPLAY = 1 + AND sca.PID = #{agencyId} + GROUP BY scg.PARENT_AGENCY_ID \ No newline at end of file From ccd91e28ea4ab103083fbc9507303911f713c7d3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 27 Oct 2020 17:39:31 +0800 Subject: [PATCH 09/24] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/screen/ScreenCustomerGridDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index ae272334e0..e631c98dea 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -115,7 +115,7 @@ scg.DEL_FLAG = 0 AND sca.DEL_FLAG = 0 AND sca.IS_DISPLAY = 1 - AND sca.PID = #{agencyId} + AND scg.all_parent_ids LIKE concat('%', #{agencyId}, '%') GROUP BY scg.PARENT_AGENCY_ID From 2176fa35e4932f33fc5f54160a817c9fe5879575 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 28 Oct 2020 11:00:42 +0800 Subject: [PATCH 10/24] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/SubBranchCountResultDTO.java | 15 +++++++++++++ .../screen/ScreenCustomerAgencyDao.java | 8 +++++++ .../screen/impl/DistributionServiceImpl.java | 22 ++++++++++++++++++- .../mapper/screen/ScreenCustomerAgencyDao.xml | 14 ++++++++++++ .../mapper/screen/ScreenCustomerGridDao.xml | 4 +++- 5 files changed, 61 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java index 93466fedf4..eac362ef84 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.evaluationindex.screen.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -34,4 +35,18 @@ public class SubBranchCountResultDTO implements Serializable { * 坐标区域 */ private String areaMarks; + + @JsonIgnore + private String allParentIds; + @JsonIgnore + private String subAgencyId; + + public SubBranchCountResultDTO() { + this.subId = ""; + this.name = ""; + this.centerMark = ""; + this.totalNum = 0; + this.areaMarks = ""; + this.subAgencyId = ""; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 7efd4d1853..52ddea4bd0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -104,4 +104,12 @@ public interface ScreenCustomerAgencyDao { * @date 2020/10/23 3:54 下午 */ CompartmentResultDTO getAgencyInfoByAegncyId(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织的下级组织ID + * @Param agencyId + * @author zxc + * @date 2020/10/28 10:33 上午 + */ + List selectSubAgencyId(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index af0ba2d939..ed03621cfd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -18,6 +18,8 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * 中央区相关各指标查询 @@ -66,8 +68,26 @@ public class DistributionServiceImpl implements DistributionService { if (branchCountResultDTO.getLevel().equals(ScreenConstant.COMMUNITY)){ return new BranchCountResultDTO(); } + List agencyIds = screenCustomerAgencyDao.selectSubAgencyId(branchCountFormDTO.getAgencyId()); List subList = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); - branchCountResultDTO.setPartyDistribution(CollectionUtils.isEmpty(subList) ? new ArrayList<>() : subList); + if (!CollectionUtils.isEmpty(subList)){ + subList.forEach(sub -> { + agencyIds.forEach(agencyId -> { + if (sub.getAllParentIds().contains(agencyId.getSubId())){ + sub.setSubAgencyId(agencyId.getSubId()); + } + }); + }); + } + Map> groupBySubAgency = subList.stream().collect(Collectors.groupingBy(sub -> sub.getSubAgencyId())); + agencyIds.forEach(a -> { + groupBySubAgency.forEach((agencyId,value) -> { + if (a.getSubId().equals(agencyId)){ + a.setTotalNum(value.stream().collect(Collectors.summingInt(v -> v.getTotalNum()))); + } + }); + }); + branchCountResultDTO.setPartyDistribution(CollectionUtils.isEmpty(agencyIds) ? new ArrayList<>() : agencyIds); return branchCountResultDTO; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index f16395c129..4fc074bbf4 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -197,4 +197,18 @@ del_flag = 0 AND agency_id = #{agencyId} + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index e631c98dea..be82c07755 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -107,7 +107,9 @@ sca.AGENCY_ID AS subId, IFNULL(sca.CENTER_MARK,'') AS centerMark, sca.AGENCY_NAME AS name, - IFNULL(sca.AREA_MARKS,'') AS areaMarks + IFNULL(sca.AREA_MARKS,'') AS areaMarks, + scg.ALL_PARENT_IDS, + sca.PID FROM screen_customer_grid scg LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = scg.PARENT_AGENCY_ID From 0195e7ec548b7e8d11d809c88a5e727ea08657f7 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 28 Oct 2020 11:17:21 +0800 Subject: [PATCH 11/24] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=86=85=E5=A4=96?= =?UTF-8?q?=E9=83=A8=E8=AE=A4=E8=AF=81=EF=BC=8C=E6=94=AF=E6=8C=81=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E4=BD=BF=E7=94=A8=E5=86=85=E5=A4=96=E9=83=A8=E8=AE=A4?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/auth/AuthProcessor.java | 10 +--------- .../com/epmet/auth/ExternalAuthProcessor.java | 10 ++++++---- .../com/epmet/auth/InternalAuthProcessor.java | 15 +++++++++------ .../com/epmet/constant/AuthTypeConstant.java | 1 + .../epmet/filter/CpAuthGatewayFilterFactory.java | 16 +++++++++++++--- 5 files changed, 30 insertions(+), 22 deletions(-) diff --git a/epmet-gateway/src/main/java/com/epmet/auth/AuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/AuthProcessor.java index 4ef47a2eae..e5a2027e56 100644 --- a/epmet-gateway/src/main/java/com/epmet/auth/AuthProcessor.java +++ b/epmet-gateway/src/main/java/com/epmet/auth/AuthProcessor.java @@ -13,14 +13,6 @@ import java.nio.charset.StandardCharsets; public abstract class AuthProcessor { - abstract Mono auth(ServerWebExchange exchange, GatewayFilterChain chain); - - protected Mono response(ServerWebExchange exchange, Object object) { - String json = JSON.toJSONString(object); - DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(json.getBytes(StandardCharsets.UTF_8)); - exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON_UTF8); - exchange.getResponse().setStatusCode(HttpStatus.OK); - return exchange.getResponse().writeWith(Flux.just(buffer)); - } + abstract ServerWebExchange auth(ServerWebExchange exchange, GatewayFilterChain chain); } diff --git a/epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java index baf5151766..18854a8776 100644 --- a/epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java +++ b/epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java @@ -50,7 +50,7 @@ public class ExternalAuthProcessor extends AuthProcessor { private CpProperty cpProperty; @Override - public Mono auth(ServerWebExchange exchange, GatewayFilterChain chain) { + public ServerWebExchange auth(ServerWebExchange exchange, GatewayFilterChain chain) { ServerHttpRequest request = exchange.getRequest(); // 只有在外部应用urls中的url才会允许外部应用访问,否则不允许访问 @@ -92,12 +92,14 @@ public class ExternalAuthProcessor extends AuthProcessor { throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "未知的外部认证类型"); } } catch (RenException e) { - return response(exchange, new Result<>().error(e.getCode(), e.getMsg())); + //return response(exchange, new Result<>().error(e.getCode(), e.getMsg())); + throw new RenException(e.getCode(),e.getMsg()); } catch (Exception e) { logger.error("外部应用请求认证发生未知错误:" + ExceptionUtils.getErrorStackTrace(e)); - return response(exchange, new Result<>().error("外部应用请求认证发生未知错误")); + //return response(exchange, new Result<>().error("外部应用请求认证发生未知错误")); + throw new RenException("外部应用请求认证发生未知错误"); } - return chain.filter(exchange); + return exchange; } } diff --git a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java index c87f9dbe6b..6690bb2374 100644 --- a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java +++ b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java @@ -44,7 +44,7 @@ public class InternalAuthProcessor extends AuthProcessor { private CpProperty cpProperty; @Override - public Mono auth(ServerWebExchange exchange, GatewayFilterChain chain) { + public ServerWebExchange auth(ServerWebExchange exchange, GatewayFilterChain chain) { ServerHttpRequest request = exchange.getRequest(); String requestUri = request.getPath().pathWithinApplication().value(); @@ -56,7 +56,8 @@ public class InternalAuthProcessor extends AuthProcessor { try{ baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); }catch(RenException e){ - return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); + //return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); + throw new RenException(e.getCode(), e.getMsg()); } }else{ baseTokenDto = null; @@ -92,12 +93,14 @@ public class InternalAuthProcessor extends AuthProcessor { if (needAuth(requestUri)) { // 校验token if (StringUtils.isBlank(token)) { - return response(exchange, new Result<>().error(EpmetErrorCode.ERR10005.getCode(), EpmetErrorCode.ERR10005.getMsg())); + //return response(exchange, new Result<>().error(EpmetErrorCode.ERR10005.getCode(), EpmetErrorCode.ERR10005.getMsg())); + throw new RenException(EpmetErrorCode.ERR10005.getCode(), EpmetErrorCode.ERR10005.getMsg()); } try { validateTokenDto(baseTokenDto, token); } catch (RenException e) { - return response(exchange, new Result<>().error(e.getCode(), e.getMsg())); + //return response(exchange, new Result<>().error(e.getCode(), e.getMsg())); + throw new RenException(e.getCode(), e.getMsg()); } } @@ -119,10 +122,10 @@ public class InternalAuthProcessor extends AuthProcessor { exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); } ServerHttpRequest build = exchange.getRequest().mutate().build(); - return chain.filter(exchange.mutate().request(build).build()); + return exchange.mutate().request(build).build(); } - return chain.filter(exchange); + return exchange; } /** diff --git a/epmet-gateway/src/main/java/com/epmet/constant/AuthTypeConstant.java b/epmet-gateway/src/main/java/com/epmet/constant/AuthTypeConstant.java index d2123966f6..5b75030ae7 100644 --- a/epmet-gateway/src/main/java/com/epmet/constant/AuthTypeConstant.java +++ b/epmet-gateway/src/main/java/com/epmet/constant/AuthTypeConstant.java @@ -1,6 +1,7 @@ package com.epmet.constant; public class AuthTypeConstant { + public static final String AUTH_TYPE_ALL = "all"; public static final String AUTH_TYPE_INTERNAL = "internal"; public static final String AUTH_TYPE_EXTERNAL = "external"; public static final String AUTH_TYPE_NO_NEED = "no_need"; 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 971f4938b1..9051c001d8 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -74,10 +74,13 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory().error(e.getCode(), e.getMessage())); @@ -105,7 +108,14 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory Date: Wed, 28 Oct 2020 11:20:26 +0800 Subject: [PATCH 12/24] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 4fc074bbf4..8dd92ec0d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -209,6 +209,7 @@ screen_customer_agency WHERE DEL_FLAG = 0 + AND IS_DISPLAY = 1 AND pid = #{agencyId} \ No newline at end of file From fbffc6be9c3b355aaa6a3ccc47e568a312e4c2ca Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 28 Oct 2020 13:57:06 +0800 Subject: [PATCH 13/24] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/DistributionServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index ed03621cfd..d97d1c9643 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.datareport.service.evaluationindex.screen.DistributionService; import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -27,6 +28,7 @@ import java.util.stream.Collectors; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:19 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class DistributionServiceImpl implements DistributionService { @@ -62,6 +64,7 @@ public class DistributionServiceImpl implements DistributionService { @Override public BranchCountResultDTO branchCount(BranchCountFormDTO branchCountFormDTO) { BranchCountResultDTO branchCountResultDTO = screenCustomerGridDao.selectAgencyInfo(branchCountFormDTO.getAgencyId()); + log.info("本级机关信息"+branchCountResultDTO.toString()); if (null == branchCountResultDTO){ return new BranchCountResultDTO(); } @@ -69,7 +72,9 @@ public class DistributionServiceImpl implements DistributionService { return new BranchCountResultDTO(); } List agencyIds = screenCustomerAgencyDao.selectSubAgencyId(branchCountFormDTO.getAgencyId()); + log.info("下级机关信息:"+agencyIds.toString()); List subList = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); + log.info("党支部数"+subList.toString()); if (!CollectionUtils.isEmpty(subList)){ subList.forEach(sub -> { agencyIds.forEach(agencyId -> { @@ -79,7 +84,9 @@ public class DistributionServiceImpl implements DistributionService { }); }); } + log.info("给党支部赋值subAgencyId"+subList.toString()); Map> groupBySubAgency = subList.stream().collect(Collectors.groupingBy(sub -> sub.getSubAgencyId())); + log.info("subList分组"+groupBySubAgency.toString()); agencyIds.forEach(a -> { groupBySubAgency.forEach((agencyId,value) -> { if (a.getSubId().equals(agencyId)){ @@ -87,7 +94,9 @@ public class DistributionServiceImpl implements DistributionService { } }); }); + log.info("赋值之后的"+agencyIds.toString()); branchCountResultDTO.setPartyDistribution(CollectionUtils.isEmpty(agencyIds) ? new ArrayList<>() : agencyIds); + log.info("最后结果:"+branchCountResultDTO); return branchCountResultDTO; } From cbda37996277d9077d8098a693e0a06e68704111 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 28 Oct 2020 14:04:16 +0800 Subject: [PATCH 14/24] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/AddToTemplateFormDTO.java | 16 ++++ .../epmet/dto/form/DeleteTemplateFormDTO.java | 16 ++++ .../result/TemplateDraftListResultDTO.java | 34 ++++++++ .../com/epmet/controller/CodeController.java | 39 +++++++++ .../java/com/epmet/service/CodeService.java | 27 ++++++ .../epmet/service/impl/CodeServiceImpl.java | 71 ++++++++++++++++ .../wxapi/constant/WxMaCodeConstant.java | 15 ++++ .../epmet/wxapi/param/WxAddToTemplateReq.java | 18 ++++ .../wxapi/param/WxDeleteTemplateReq.java | 18 ++++ .../result/WxTemplateDraftListResult.java | 51 ++++++++++++ .../epmet/wxapi/service/WxMaCodeService.java | 29 +++++++ .../service/impl/WxMaCodeServiceImpl.java | 83 +++++++++++++++++++ 12 files changed, 417 insertions(+) create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AddToTemplateFormDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/DeleteTemplateFormDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateDraftListResultDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxAddToTemplateReq.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxDeleteTemplateReq.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxTemplateDraftListResult.java diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AddToTemplateFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AddToTemplateFormDTO.java new file mode 100644 index 0000000000..10de3b3d28 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AddToTemplateFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/28 9:55 + */ +@Data +public class AddToTemplateFormDTO implements Serializable { + private static final long serialVersionUID = -7759275805971446460L; + private String draftId; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/DeleteTemplateFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/DeleteTemplateFormDTO.java new file mode 100644 index 0000000000..843d17a0eb --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/DeleteTemplateFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/28 9:57 + */ +@Data +public class DeleteTemplateFormDTO implements Serializable { + private static final long serialVersionUID = -6516706760708801090L; + private String templateId; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateDraftListResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateDraftListResultDTO.java new file mode 100644 index 0000000000..f5908d773d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateDraftListResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/28 9:52 + */ +@NoArgsConstructor +@Data +public class TemplateDraftListResultDTO implements Serializable { + + private static final long serialVersionUID = 8249448254837721428L; + /** + * 开发者上传草稿时间戳 + */ + private String createTime; + /** + * 版本号,开发者自定义字段 + */ + private String userVersion; + /** + * 版本描述 开发者自定义字段 + */ + private String userDesc; + /** + * 草稿 id + */ + private String draftId; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java index cdaa2a6742..c7457e048f 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java @@ -251,5 +251,44 @@ public class CodeController { return new Result<>(); } + /** + * 获取代码草稿列表 + * @author zhaoqifeng + * @date 2020/10/28 9:59 + * @param + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("gettemplatedraftlist") + public Result> getTemplateDraftList() { + List list = codeService.getTemplateDraftList(); + return new Result>().ok(list); + } + + /** + * 将草稿添加到代码模板库 + * @author zhaoqifeng + * @date 2020/10/28 10:00 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("addtotemplate") + public Result addToTemplate(@RequestBody AddToTemplateFormDTO formDTO) { + codeService.addToTemplate(formDTO); + return new Result<>(); + } + + /** + * 删除指定代码模板 + * @author zhaoqifeng + * @date 2020/10/28 10:03 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("deletetemplate") + public Result deleteTemplate(@RequestBody DeleteTemplateFormDTO formDTO) { + codeService.deleteTemplate(formDTO); + return new Result<>(); + } + } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java index 38e409d79b..32fce29360 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java @@ -217,4 +217,31 @@ public interface CodeService { */ void revertCodeRelease(CodeCommonFormDTO formDTO); + /** + * 获取代码草稿列表 + * @author zhaoqifeng + * @date 2020/10/28 10:02 + * @param + * @return java.util.List + */ + List getTemplateDraftList(); + + /** + * 将草稿添加到代码模板库 + * @author zhaoqifeng + * @date 2020/10/28 10:02 + * @param formDTO + * @return void + */ + void addToTemplate(AddToTemplateFormDTO formDTO); + + /** + * 删除指定代码模板 + * @author zhaoqifeng + * @date 2020/10/28 10:03 + * @param formDTO + * @return void + */ + void deleteTemplate(DeleteTemplateFormDTO formDTO); + } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index c8f51e8e40..7e1208dcc4 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -741,6 +741,77 @@ public class CodeServiceImpl implements CodeService { codeCustomerService.deleteById(codeCustomerDTO.getId()); } + /** + * 获取代码草稿列表 + * + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/28 10:02 + */ + @Override + public List getTemplateDraftList() { + List resultList = new ArrayList<>(); + //获取COMPONENT_ACCESS_TOKEN + String accessToken = componentAccessTokenDao.getComponentAccessToken(); + //调用微信API获取模板列表 + WxResult wxResult = wxMaCodeService.getTemplateDraftList(accessToken); + if (!wxResult.success()) { + throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); + } + if (null == wxResult.getData() || wxResult.getData().getDraftList().size() == NumConstant.ZERO) { + return resultList; + } + wxResult.getData().getDraftList().forEach(temp -> { + TemplateDraftListResultDTO dto = new TemplateDraftListResultDTO(); + dto.setDraftId(temp.getDraftId()); + dto.setUserVersion(temp.getUserVersion()); + dto.setUserDesc(temp.getUserDesc()); + dto.setCreateTime(DateUtils.formatTimestamp(temp.getCreateTime(), DateUtils.DATE_TIME_PATTERN)); + resultList.add(dto); + }); + return resultList; + } + + /** + * 将草稿添加到代码模板库 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/10/28 10:02 + */ + @Override + public void addToTemplate(AddToTemplateFormDTO formDTO) { + //获取COMPONENT_ACCESS_TOKEN + String accessToken = componentAccessTokenDao.getComponentAccessToken(); + WxAddToTemplateReq request = new WxAddToTemplateReq(); + request.setDraftId(formDTO.getDraftId()); + WxResult result = wxMaCodeService.addToTemplate(accessToken, request); + if (!result.success()) { + throw new RenException(result.getErrorCode(), result.getErrorMsg()); + } + } + + /** + * 删除指定代码模板 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/10/28 10:03 + */ + @Override + public void deleteTemplate(DeleteTemplateFormDTO formDTO) { + //获取COMPONENT_ACCESS_TOKEN + String accessToken = componentAccessTokenDao.getComponentAccessToken(); + WxDeleteTemplateReq request = new WxDeleteTemplateReq(); + request.setTemplateId(formDTO.getTemplateId()); + WxResult result = wxMaCodeService.deleteTemplate(accessToken, request); + if (!result.success()) { + throw new RenException(result.getErrorCode(), result.getErrorMsg()); + } + } + private void saveOperation(String customerId, String clientType, String codeId, String version, String operation, String describe) { CodeOperationHistoryDTO operationDTO = new CodeOperationHistoryDTO(); operationDTO.setCustomerId(customerId); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index c0d11dca5b..7d1263e3b3 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -185,4 +185,19 @@ public interface WxMaCodeConstant { * 加急审核申请 */ String SPEED_UP_AUDIT_URL = "https://api.weixin.qq.com/wxa/speedupaudit"; + + /** + * 获取代码草稿列表 + */ + String GET_TEMPLATE_DRAFT_LIST_URL = "https://api.weixin.qq.com/wxa/gettemplatedraftlist"; + + /** + * 将草稿添加到代码模板库 + */ + String ADD_TO_TEMPLATE_URL = "https://api.weixin.qq.com/wxa/addtotemplate"; + + /** + * 获取代码草稿列表 + */ + String DELETE_TEMPLATE_URL = "https://api.weixin.qq.com/wxa/deletetemplate"; } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxAddToTemplateReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxAddToTemplateReq.java new file mode 100644 index 0000000000..997f959342 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxAddToTemplateReq.java @@ -0,0 +1,18 @@ +package com.epmet.wxapi.param; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/28 10:20 + */ +@Data +public class WxAddToTemplateReq implements Serializable { + private static final long serialVersionUID = -4667328954236033227L; + @SerializedName("draft_id") + private String draftId; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxDeleteTemplateReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxDeleteTemplateReq.java new file mode 100644 index 0000000000..1a70b18e9e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxDeleteTemplateReq.java @@ -0,0 +1,18 @@ +package com.epmet.wxapi.param; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/28 10:21 + */ +@Data +public class WxDeleteTemplateReq implements Serializable { + private static final long serialVersionUID = 3099244896895201612L; + @SerializedName("template_id") + private String templateId; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxTemplateDraftListResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxTemplateDraftListResult.java new file mode 100644 index 0000000000..e77437af53 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxTemplateDraftListResult.java @@ -0,0 +1,51 @@ +package com.epmet.wxapi.result; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/28 10:12 + */ + +@NoArgsConstructor +@Data +public class WxTemplateDraftListResult implements Serializable { + private static final long serialVersionUID = -7316579770340890368L; + /** + * 错误码 + */ + private Integer errcode; + /** + * 错误信息 + */ + private String errmsg; + @SerializedName("draft_list") + private List draftList; + + public boolean success(){ + return errcode == 0; + } + + @NoArgsConstructor + @Data + public static class DraftListBean { + /** + * create_time + */ + @SerializedName("create_time") + private Long createTime; + @SerializedName("user_version") + private String userVersion; + @SerializedName("user_desc") + private String userDesc; + @SerializedName("draft_id") + private String draftId; + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java index 1918e79603..452ad866e1 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java @@ -202,4 +202,33 @@ public interface WxMaCodeService { * @return com.epmet.wxapi.result.WxResult */ WxResult revertCodeRelease(String accessToken); + + /** + * 获取代码草稿列表 + * @author zhaoqifeng + * @date 2020/10/28 10:18 + * @param accessToken + * @return com.epmet.wxapi.result.WxResult + */ + WxResult getTemplateDraftList(String accessToken); + + /** + * 将草稿添加到代码模板库 + * @author zhaoqifeng + * @date 2020/10/28 10:23 + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + */ + WxResult addToTemplate(String accessToken, WxAddToTemplateReq request); + + /** + * 删除指定代码模板 + * @author zhaoqifeng + * @date 2020/10/28 10:23 + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + */ + WxResult deleteTemplate(String accessToken, WxDeleteTemplateReq request); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java index 1ce1c55b68..8c859debec 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java @@ -387,6 +387,89 @@ public class WxMaCodeServiceImpl implements WxMaCodeService { return result; } + /** + * 获取代码草稿列表 + * + * @param accessToken + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/10/28 10:18 + */ + @Override + public WxResult getTemplateDraftList(String accessToken) { + WxResult result = new WxResult<>(); + String url = WxMaCodeConstant.GET_TEMPLATE_DRAFT_LIST_URL + "?" + "access_token=" + accessToken; + Result templateListResult = HttpClientManager.getInstance().sendGet(url, null); + if (!templateListResult.success()) { + result.setErrorCode(templateListResult.getCode()); + result.setErrorMsg(templateListResult.getMsg()); + return result; + } + Gson gson = new Gson(); + WxTemplateDraftListResult templateList = gson.fromJson(templateListResult.getData(), WxTemplateDraftListResult.class); + result.setErrorCode(templateList.getErrcode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(templateList.getErrcode())); + result.setData(templateList); + WxTemplateDraftListResult draftListResult = JSONObject.parseObject(templateListResult.getData(), WxTemplateDraftListResult.class); + if (!draftListResult.success()) { + result.setErrorCode(draftListResult.getErrcode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(draftListResult.getErrcode())); + return result; + } + result.ok(draftListResult); + return result; + } + + /** + * 将草稿添加到代码模板库 + * + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/10/28 10:23 + */ + @Override + public WxResult addToTemplate(String accessToken, WxAddToTemplateReq request) { + WxResult result = new WxResult(); + String url = WxMaCodeConstant.ADD_TO_TEMPLATE_URL + "?" + "access_token=" + accessToken; + Result submitResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!submitResult.success()) { + result.setErrorCode(submitResult.getCode()); + result.setErrorMsg(submitResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(submitResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE))); + return result; + } + + /** + * 删除指定代码模板 + * + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/10/28 10:23 + */ + @Override + public WxResult deleteTemplate(String accessToken, WxDeleteTemplateReq request) { + WxResult result = new WxResult(); + String url = WxMaCodeConstant.DELETE_TEMPLATE_URL + "?" + "access_token=" + accessToken; + Result submitResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!submitResult.success()) { + result.setErrorCode(submitResult.getCode()); + result.setErrorMsg(submitResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(submitResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE))); + return result; + } + private String toJson(Object object) { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.setPrettyPrinting(); From 4208adc39369e4dafd6bba59e9f9cc079da7cb46 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 28 Oct 2020 14:08:57 +0800 Subject: [PATCH 15/24] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/DistributionServiceImpl.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index d97d1c9643..c94e85dc89 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -61,10 +61,10 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/10/27 11:11 上午 */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public BranchCountResultDTO branchCount(BranchCountFormDTO branchCountFormDTO) { BranchCountResultDTO branchCountResultDTO = screenCustomerGridDao.selectAgencyInfo(branchCountFormDTO.getAgencyId()); - log.info("本级机关信息"+branchCountResultDTO.toString()); if (null == branchCountResultDTO){ return new BranchCountResultDTO(); } @@ -72,9 +72,7 @@ public class DistributionServiceImpl implements DistributionService { return new BranchCountResultDTO(); } List agencyIds = screenCustomerAgencyDao.selectSubAgencyId(branchCountFormDTO.getAgencyId()); - log.info("下级机关信息:"+agencyIds.toString()); List subList = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); - log.info("党支部数"+subList.toString()); if (!CollectionUtils.isEmpty(subList)){ subList.forEach(sub -> { agencyIds.forEach(agencyId -> { @@ -84,9 +82,7 @@ public class DistributionServiceImpl implements DistributionService { }); }); } - log.info("给党支部赋值subAgencyId"+subList.toString()); Map> groupBySubAgency = subList.stream().collect(Collectors.groupingBy(sub -> sub.getSubAgencyId())); - log.info("subList分组"+groupBySubAgency.toString()); agencyIds.forEach(a -> { groupBySubAgency.forEach((agencyId,value) -> { if (a.getSubId().equals(agencyId)){ @@ -94,9 +90,7 @@ public class DistributionServiceImpl implements DistributionService { } }); }); - log.info("赋值之后的"+agencyIds.toString()); branchCountResultDTO.setPartyDistribution(CollectionUtils.isEmpty(agencyIds) ? new ArrayList<>() : agencyIds); - log.info("最后结果:"+branchCountResultDTO); return branchCountResultDTO; } From fef3d604182f8502edb60099d66c0d3bde34cd90 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 28 Oct 2020 14:41:51 +0800 Subject: [PATCH 16/24] =?UTF-8?q?=E6=97=A0=E5=8F=82=E6=9E=84=E9=80=A0?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/result/DepartmentNameListResultDTO.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java index 94cfb8fc51..033acfa1ed 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java @@ -2,6 +2,7 @@ package com.epmet.evaluationindex.screen.dto.result; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; @@ -12,6 +13,7 @@ import java.util.List; */ @Data @AllArgsConstructor +@NoArgsConstructor public class DepartmentNameListResultDTO implements Serializable { private static final long serialVersionUID = -801407836277197080L; From e0e61800c80cb44e758b74d4b7f0b81e13faf56e Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 28 Oct 2020 15:38:08 +0800 Subject: [PATCH 17/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AFIp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/aspect/BaseRequestLogAspect.java | 1 - .../epmet/commons/tools/utils/IpUtils.java | 73 ++++++++++++++++--- .../com/epmet/auth/InternalAuthProcessor.java | 3 - .../filter/CpAuthGatewayFilterFactory.java | 6 +- 4 files changed, 64 insertions(+), 19 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java index 3e7af3ced6..b8a38908a0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java @@ -12,7 +12,6 @@ import org.springframework.dao.DuplicateKeyException; import javax.servlet.http.HttpServletRequest; import java.time.Duration; import java.time.LocalDateTime; -import java.util.UUID; /** * 日志切面 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java index b100daac7a..d051717d8d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IpUtils.java @@ -8,12 +8,17 @@ package com.epmet.commons.tools.utils; +import com.epmet.commons.tools.constant.StrConstant; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.http.server.reactive.ServerHttpRequest; import javax.servlet.http.HttpServletRequest; import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Optional; import java.util.regex.Pattern; /** @@ -24,43 +29,87 @@ import java.util.regex.Pattern; */ public class IpUtils { private static Logger logger = LoggerFactory.getLogger(IpUtils.class); - public static final String LOCALHOST = "127.0.0.1"; + private static final String LOCALHOST = "127.0.0.1"; - public static final String ANYHOST = "0.0.0.0"; + private static final String ANYHOST = "0.0.0.0"; + + private static final String IP_UNKNOWN = "unknown"; private static final Pattern IP_PATTERN = Pattern.compile("\\d{1,3}(\\.\\d{1,3}){3,5}$"); public static String getIpAddr(HttpServletRequest request) { + String ip = null; try { ip = request.getHeader("x-forwarded-for"); - logger.debug("x-forwarded-for:"+ip); - if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { + logger.debug("x-forwarded-for:" + ip); + if (StringUtils.isEmpty(ip) || IP_UNKNOWN.equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } - if (StringUtils.isEmpty(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + if (StringUtils.isEmpty(ip) || ip.length() == 0 || IP_UNKNOWN.equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } - if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { + if (StringUtils.isEmpty(ip) || IP_UNKNOWN.equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_CLIENT_IP"); } - if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { + if (StringUtils.isEmpty(ip) || IP_UNKNOWN.equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_X_FORWARDED_FOR"); } - if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { + if (StringUtils.isEmpty(ip) || IP_UNKNOWN.equalsIgnoreCase(ip)) { ip = request.getHeader("X-Real-IP"); } - if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { + if (StringUtils.isEmpty(ip) || IP_UNKNOWN.equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } //对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割 if (ip != null) { //"***.***.***.***".length() = 15 - if (ip.indexOf(",") > 0) { - ip = ip.substring(0, ip.indexOf(",")); + if (ip.indexOf(StrConstant.COMMA) > 0) { + ip = ip.split(StrConstant.COMMA)[0]; + ; + } + } + } catch (Exception e) { + logger.error("IpUtils getIpAddr ERROR ", e); + } + + return ip; + } + + public static String getClientIp(ServerHttpRequest request) { + String ip = null; + try { + HttpHeaders headers = request.getHeaders(); + String ipAddress = headers.getFirst("x-forwarded-for"); + if (ipAddress == null || ipAddress.length() == 0 || IP_UNKNOWN.equalsIgnoreCase(ipAddress)) { + ipAddress = headers.getFirst("Proxy-Client-IP"); + } + if (ipAddress == null || ipAddress.length() == 0 || IP_UNKNOWN.equalsIgnoreCase(ipAddress)) { + ipAddress = headers.getFirst("WL-Proxy-Client-IP"); + } + if (ipAddress == null || ipAddress.length() == 0 || IP_UNKNOWN.equalsIgnoreCase(ipAddress)) { + ipAddress = Optional.ofNullable(request.getRemoteAddress()) + .map(address -> address.getAddress().getHostAddress()) + .orElse(""); + if (LOCALHOST.equals(ipAddress)) { + // 根据网卡取本机配置的IP + try { + InetAddress inet = InetAddress.getLocalHost(); + ipAddress = inet.getHostAddress(); + } catch (UnknownHostException e) { + // ignore + } + } + } + + // 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割 + if (ip != null) { //"***.***.***.***".length() = 15 + if (ip.indexOf(StrConstant.COMMA) > 0) { + ip = ip.substring(0, ip.indexOf(StrConstant.COMMA)); } } + return ipAddress; } catch (Exception e) { - logger.error("IpUtils ERROR ", e); + logger.error("IpUtils getIpAddr ERROR ", e); } return ip; diff --git a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java index 6690bb2374..43895ce9af 100644 --- a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java +++ b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java @@ -8,7 +8,6 @@ import com.epmet.commons.tools.security.dto.BaseTokenDto; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; -import com.epmet.commons.tools.utils.Result; import com.epmet.filter.CpProperty; import com.epmet.jwt.JwtTokenUtils; import io.jsonwebtoken.Claims; @@ -22,7 +21,6 @@ import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.stereotype.Component; import org.springframework.util.AntPathMatcher; import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Mono; /** * 内部认证处理器 @@ -48,7 +46,6 @@ public class InternalAuthProcessor extends AuthProcessor { ServerHttpRequest request = exchange.getRequest(); String requestUri = request.getPath().pathWithinApplication().value(); - logger.info("CpAuthGatewayFilterFactory当前requestUri=[" + requestUri + "]CpAuthGatewayFilterFactory拦截成功"); String token = getTokenFromRequest(request); //BaseTokenDto baseTokenDto = StringUtils.isNotBlank(token) ? getBaseTokenDto(token, jwtTokenUtils) : null; BaseTokenDto baseTokenDto; 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 9051c001d8..72139e59e1 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -5,9 +5,8 @@ import com.alibaba.fastjson.JSON; import com.epmet.auth.ExternalAuthProcessor; import com.epmet.auth.InternalAuthProcessor; import com.epmet.commons.tools.constant.AppClientConstant; -import com.epmet.commons.tools.constant.Constant; -import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.AuthTypeConstant; import com.epmet.constant.TokenHeaderKeyConstant; @@ -23,7 +22,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.stereotype.Component; -import org.springframework.util.AntPathMatcher; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -71,7 +69,9 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory Date: Wed, 28 Oct 2020 17:07:19 +0800 Subject: [PATCH 18/24] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java | 3 +++ 1 file changed, 3 insertions(+) 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 72139e59e1..bb97dc2be7 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -77,10 +77,13 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory().error(e.getCode(), e.getMessage())); From cd418b03bcbd9cc22adb13e5111274ed62d3229b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 29 Oct 2020 09:23:27 +0800 Subject: [PATCH 19/24] =?UTF-8?q?redisson=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distributedlock/DistributedLock.java | 79 +++++++++++++++++++ .../tools/distributedlock/LockConstants.java | 12 +++ .../impl/FactIndexCollectServiceImpl.java | 23 ++---- .../com/epmet/stats/test/RedissonTest.java | 48 ++++++++++- .../java/com/epmet/stats/test/zxc/ZxcDTO.java | 21 +++++ 5 files changed, 163 insertions(+), 20 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/LockConstants.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/zxc/ZxcDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java new file mode 100644 index 0000000000..298a0b238f --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java @@ -0,0 +1,79 @@ +package com.epmet.commons.tools.distributedlock; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import org.apache.commons.lang3.StringUtils; +import org.redisson.api.RLock; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * @Author zxc + * @DateTime 2020/10/28 9:05 上午 + */ +@Component +public class DistributedLock { + + @Autowired + private RedissonClient redissonClient; + + /** + * @Description 抢锁🔒 每个锁持有十分钟 + * @Param name + * @author zxc + * @date 2020/10/28 2:52 下午 + */ + public RLock getLock(String name){ + RLock lock = null; + if (StringUtils.isNotBlank(name)) { + lock = redissonClient.getLock(name); + // 持续时间为 -1 时,直到其明确释放锁才会释放【宕机就完蛋了】, + lock.lock(10,TimeUnit.MINUTES); + } + return lock; + } + + /** + * @Description + * @Param name 锁名 + * @Param leaseTime 持锁时间 单位:min + * @Param waitTime 获取锁最长等待时间 单位:min + * @author zxc + * @date 2020/10/29 9:04 上午 + */ + public RLock getLock(String name,Long leaseTime,Long waitTime){ + RLock lock = null; + if (StringUtils.isNotBlank(name) && leaseTime > 0 && waitTime > 0 ){ + lock = redissonClient.getLock(name); + Boolean lockStatus; + try { + lockStatus = lock.tryLock(waitTime,leaseTime,TimeUnit.MINUTES); + if (!lockStatus){ + throw new RenException("获取锁🔒失败了......"); + } + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + return lock; + } + + /** + * @Description 释放锁🔒 + * @Param rLock + * @author zxc + * @date 2020/10/28 2:52 下午 + */ + public void unLock(RLock rLock){ + if (null != rLock){ + if (rLock.isHeldByCurrentThread()){ + rLock.unlock(); + } + } + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/LockConstants.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/LockConstants.java new file mode 100644 index 0000000000..3174a43a8e --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/LockConstants.java @@ -0,0 +1,12 @@ +package com.epmet.commons.tools.distributedlock; + +/** + * @Author zxc + * @DateTime 2020/10/28 9:23 上午 + */ +public interface LockConstants { + + String TEST_LOCK_NAME = "testLock"; + + String STATS_LOCK_NAME = "stats"; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 83ad985174..70b38697ce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -3,7 +3,8 @@ package com.epmet.service.evaluationindex.indexcoll.impl; 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.redis.RedisKeys; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.distributedlock.LockConstants; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; @@ -29,7 +30,6 @@ import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import lombok.extern.slf4j.Slf4j; import org.redisson.api.RLock; -import org.redisson.api.RedissonClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -89,7 +89,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; @Autowired - private RedissonClient redissonClient; + private DistributedLock distributedLock; @Override @Transactional(rollbackFor = Exception.class) @@ -216,15 +216,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { if (NumConstant.SIX != monthId.length()) { throw new RuntimeException("入参monthId格式不正确:monthId =" + monthId); } - RLock lock = redissonClient.getLock(RedisKeys.getScreenIndexDataLockKey()); + RLock lock = distributedLock.getLock(LockConstants.STATS_LOCK_NAME); try { - AtomicInteger tryTimes = new AtomicInteger(0); - boolean lockFlag = false; - do { - lockFlag = lock.tryLock(1, 10, TimeUnit.MINUTES); - } while (!lockFlag && tryTimes.addAndGet(1) < 3); - if (!lockFlag) { - log.error("插入大屏指数方法获取锁失败"); + if (null==lock) { return; } allParentIds.cleanUp(); @@ -250,13 +244,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly this.insertIndexDataYear(monthId, customerId); allParentIds.invalidateAll(); - } catch (InterruptedException inter) { - log.error("插入计算指标数据异常", inter); } finally { - //判断是否是当前线程 持有锁 - if (lock.isHeldByCurrentThread()) { - lock.unlock(); - } + distributedLock.unLock(lock); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/RedissonTest.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/RedissonTest.java index 6f01774eab..9df96f6d70 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/RedissonTest.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/RedissonTest.java @@ -1,6 +1,10 @@ package com.epmet.stats.test; +import com.alibaba.fastjson.JSON; import com.epmet.DataStatsApplication; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.distributedlock.LockConstants; +import com.epmet.stats.test.zxc.ZxcDTO; import lombok.extern.slf4j.Slf4j; import org.junit.Test; import org.junit.runner.RunWith; @@ -10,6 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; import java.util.concurrent.TimeUnit; /** @@ -22,8 +29,43 @@ public class RedissonTest { @Autowired private RedissonClient redissonClient; + @Autowired + private DistributedLock distributedLock; @Test + public void lock(){ + long start = System.currentTimeMillis(); + RLock lock = distributedLock.getLock(LockConstants.TEST_LOCK_NAME); + if (null==lock){ + System.out.println("shibai"); + } + try { + List list = new ArrayList<>(); + for (int i = 0; i < 50000; i++) { + ZxcDTO zxcDTO = new ZxcDTO(); + zxcDTO.setA(UUID.randomUUID().toString()); + zxcDTO.setB(UUID.randomUUID().toString()); + zxcDTO.setC(UUID.randomUUID().toString()); + zxcDTO.setD(UUID.randomUUID().toString()); + zxcDTO.setE(UUID.randomUUID().toString()); + zxcDTO.setF(i); + zxcDTO.setG(i+1); + zxcDTO.setH(i+2); + list.add(zxcDTO); + } +// log.info(JSON.toJSONString(list)); + + + }finally { +// distributedLock.unLock(lock); + } + long end = System.currentTimeMillis(); + log.info((end-start)+"hs"); + + + } + + /*@Test public void lockTest() { //获取一个名为 lockName 的锁实例 RLock lock = redissonClient.getLock("lockName"); @@ -38,10 +80,10 @@ public class RedissonTest { //lock.lock(); //异步方式 - /* RFuture future = lock.lockAsync(); + *//* RFuture future = lock.lockAsync(); if (future.isSuccess()){ //todo something - }*/ + }*//* if (bs) { // 业务代码 System.out.println("进入业务代码: " + 123); @@ -56,6 +98,6 @@ public class RedissonTest { lock.unlock(); } } - } + }*/ } diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/zxc/ZxcDTO.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/zxc/ZxcDTO.java new file mode 100644 index 0000000000..148310ef15 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/zxc/ZxcDTO.java @@ -0,0 +1,21 @@ +package com.epmet.stats.test.zxc; + +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2020/10/28 3:15 下午 + */ +@Data +public class ZxcDTO { + + private String a; + private String b; + private String c; + private String d; + private String e; + private Integer f; + private Integer g; + private Integer h; + +} From c9c78f3f56383fa22fcd1842fc8cc5a9489ad855 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 29 Oct 2020 10:50:36 +0800 Subject: [PATCH 20/24] =?UTF-8?q?=E4=B8=8B=E7=BA=A7=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=8E=92=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AnNingSubAgencyIndexRankResultDTO.java | 22 +++++++++++++++++++ .../screen/ScreenIndexDataMonthlyDao.xml | 3 +++ 2 files changed, 25 insertions(+) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AnNingSubAgencyIndexRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AnNingSubAgencyIndexRankResultDTO.java index c4653c9a71..38df1662f2 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AnNingSubAgencyIndexRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AnNingSubAgencyIndexRankResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.evaluationindex.screen.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -38,6 +39,21 @@ public class AnNingSubAgencyIndexRankResultDTO implements Serializable { */ private Double serviceAbility = 0.0; + /** + * 党建能力权重 + */ + private Double partyWeight; + + /** + * 治理能力权重 + */ + private Double governWeight; + + /** + * 服务能力权重 + */ + private Double serviceWeight; + /** * 组织id或者网格id */ @@ -47,4 +63,10 @@ public class AnNingSubAgencyIndexRankResultDTO implements Serializable { * 组织类型 */ private String orgType = ""; + + public AnNingSubAgencyIndexRankResultDTO() { + this.partyWeight = NumConstant.ZERO_DOT_ZERO; + this.governWeight = NumConstant.ZERO_DOT_ZERO; + this.serviceWeight = NumConstant.ZERO_DOT_ZERO; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index c5a9a6305d..55dd281ff5 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -69,6 +69,9 @@ service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility, party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility, govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility, + PARTY_DEV_WEIGHT AS partyWeight, + GOVERN_ABLITY_WEIGHT AS governWeight, + SERVICE_ABLITY_WEIGHT AS serviceWeight, ORG_ID orgId, ORG_TYPE orgType FROM From 80dd7f70e0d1db5acbd3162cc4895c305d8425f5 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 29 Oct 2020 14:42:58 +0800 Subject: [PATCH 21/24] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/impl/AgencyServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 24a5367d87..a3b686410c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -143,6 +143,9 @@ public class AgencyServiceImpl implements AgencyService { subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); }else { subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COLON + sub.getValue()); + if (null == subAgency){ + subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COLON + sub.getValue()); + } } sub.setChildren(subAgency); } @@ -176,6 +179,9 @@ public class AgencyServiceImpl implements AgencyService { subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); }else { subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COLON + sub.getValue()); + if (null == subAgency){ + subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COLON + sub.getValue()); + } } sub.setChildren(subAgency); } From e6f38829c2371863432728ec75e181d40457786d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 29 Oct 2020 14:50:26 +0800 Subject: [PATCH 22/24] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/impl/AgencyServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index a3b686410c..463b12dd4d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -144,7 +144,7 @@ public class AgencyServiceImpl implements AgencyService { }else { subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COLON + sub.getValue()); if (null == subAgency){ - subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COLON + sub.getValue()); + subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); } } sub.setChildren(subAgency); @@ -180,7 +180,7 @@ public class AgencyServiceImpl implements AgencyService { }else { subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COLON + sub.getValue()); if (null == subAgency){ - subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COLON + sub.getValue()); + subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); } } sub.setChildren(subAgency); From 5069696731932ff315b8a588675495e1cfb04482 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 29 Oct 2020 14:53:01 +0800 Subject: [PATCH 23/24] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/evaluationindex/screen/impl/AgencyServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 463b12dd4d..b8aa97a5cd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -180,7 +180,7 @@ public class AgencyServiceImpl implements AgencyService { }else { subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COLON + sub.getValue()); if (null == subAgency){ - subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); + subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); } } sub.setChildren(subAgency); From a45548c5e2b9e151d61f0de46f0e6a85a7aa28b0 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 29 Oct 2020 14:58:53 +0800 Subject: [PATCH 24/24] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/impl/AgencyServiceImpl.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index b8aa97a5cd..3232cf7793 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -138,15 +138,7 @@ public class AgencyServiceImpl implements AgencyService { }); sub.setChildren(treeResultDTOS); }else { - List subAgency = new ArrayList<>(); - if (sub.getPids().contains(ScreenConstant.COMMA)){ - subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); - }else { - subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COLON + sub.getValue()); - if (null == subAgency){ - subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); - } - } + List subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); sub.setChildren(subAgency); } });