From c880be92a08503ddd119616a05f164563ddc1fd2 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 14 Sep 2020 11:13:52 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=88=86=E7=BB=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java index c37afa2921..6ccb0b2a51 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java @@ -27,6 +27,6 @@ public class CommonPageUserFormDTO implements Serializable { private Integer pageSize = 10; - @NotBlank(message = "获取不到用户Id" , groups = PageUserGroup.class) + @NotBlank(message = "获取不到客户Id" , groups = PageUserGroup.class) private String customerId; } From d867bee4be2247edaa26f5981aff2795e1959ebd Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 14 Sep 2020 17:50:35 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=AE=A4=E8=AF=81bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partymember/service/impl/PartyMemberConfirmServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2004930351..7713b97928 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 @@ -225,7 +225,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService //人工审核数据状态设为通过 PartymemberConfirmManualDTO partymemberConfirmManualDTO = - partymemberConfirmManualService.getInfoByPartyMemberInfoId(partyMemberInfoDTO.getId()); + partymemberConfirmManualService.getInfoByPartyMemberInfoId(partyMemberInfoEntity.getId()); if (null != partymemberConfirmManualDTO) { partymemberConfirmManualDTO.setAuditStatus(PartyMemberConstant.APPROVED); partymemberConfirmManualService.updateById(ConvertUtils.sourceToTarget(partymemberConfirmManualDTO, From 5dcba91dab91ebb13796671705db868c2dc8f657 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 17 Sep 2020 16:39:42 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=80=80=E5=9B=9E?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=B0=86=E8=A2=AB=E9=80=80?= =?UTF-8?q?=E5=9B=9E=E7=9A=84=E9=A1=B9=E7=9B=AE=E7=9B=B8=E5=85=B3=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E8=8A=82=E7=82=B9=E7=9A=84=E5=88=9B=E5=BB=BA=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=B5=8B=E5=80=BC=E7=BB=99=E6=96=B0=E5=A2=9E=E7=9A=84?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BA=BA=E5=91=98=E8=8A=82=E7=82=B9=E7=9A=84?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=EF=BC=8C=E5=90=A6=E5=88=99?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E5=B0=86=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E8=AF=AF=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/ProjectServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 0fc60dcbb5..1717c2fef9 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -458,6 +458,8 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Thu, 17 Sep 2020 16:40:36 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E4=B8=80=E5=B9=B6=E7=BD=AE=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/ProjectServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 1717c2fef9..38f5ac64a7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -460,6 +460,7 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Thu, 24 Sep 2020 18:40:19 +0800 Subject: [PATCH 05/11] =?UTF-8?q?Ext=5FJson=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/CodeServiceImpl.java | 54 +++++++++++++++---- 1 file changed, 44 insertions(+), 10 deletions(-) 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 8f8c57ea58..c8f51e8e40 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 @@ -7,8 +7,10 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CodeConstant; +import com.epmet.constant.ModuleConstant; import com.epmet.dao.AuthorizationInfoDao; import com.epmet.dao.ComponentAccessTokenDao; import com.epmet.dao.MiniInfoDao; @@ -17,7 +19,9 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.feign.OssFeignClient; +import com.epmet.redis.RedisThird; import com.epmet.service.*; +import com.epmet.wxapi.constant.WxMaCodeConstant; import com.epmet.wxapi.param.*; import com.epmet.wxapi.result.*; import com.epmet.wxapi.service.WxMaCodeService; @@ -27,6 +31,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -71,6 +76,11 @@ public class CodeServiceImpl implements CodeService { private MiniInfoDao miniInfoDao; @Autowired private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Autowired + private RedisThird redisThird; + + @Value("${third.platform.appId}") + private String componentAppId; @Override public List templateList() { @@ -117,29 +127,42 @@ public class CodeServiceImpl implements CodeService { if (null == authInfo) { throw new RenException("未授权"); } - /*CustomerDTO customerFormDTO = new CustomerDTO(); - customerFormDTO.setId(formDTO.getCustomerId()); - Result result = operCrmOpenFeignClient.getCustomerInfo(customerFormDTO); - if (!result.success()) { - throw new RenException(result.getCode(), result.getMsg()); - }*/ + String customerName = ""; + Result> customerList = operCrmOpenFeignClient.getAllCustomerList(); + if (customerList.success()) { + for (CustomerDTO dto : customerList.getData()) { + if(formDTO.getCustomerId().equals(dto.getId())) { + customerName = dto.getCustomerName(); + } + } + } + String resiName = ""; + String workName = ""; + if(CodeConstant.RESI.equals(formDTO.getClientType())) { + resiName = getNickName(authInfo.getAuthorizerAppid()); + AuthorizationInfoDTO workAuthInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), CodeConstant.WORK); + workName = getNickName(workAuthInfo.getAuthorizerAppid()); + } else { + workName = getNickName(authInfo.getAuthorizerAppid()); + AuthorizationInfoDTO resiAuthInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), CodeConstant.RESI); + resiName = getNickName(resiAuthInfo.getAuthorizerAppid()); + } //获取小程序居民端与工作端名称 - String resiName = miniInfoDao.getNickName(formDTO.getCustomerId(), CodeConstant.RESI); - String workName = miniInfoDao.getNickName(formDTO.getCustomerId(), CodeConstant.WORK); + String extJson = getExtJson(formDTO); WxExtJson wxExtJson = JSONObject.parseObject(extJson, WxExtJson.class); wxExtJson.setExtAppid(authInfo.getAuthorizerAppid()); wxExtJson.getExt().setExtAppid(authInfo.getAuthorizerAppid()); wxExtJson.getExt().setResiName(resiName); wxExtJson.getExt().setWorkName(workName); - //wxExtJson.getExt().setCustomerName(null == result.getData().getCustomerName()?"":result.getData().getCustomerName()); - wxExtJson.getExt().setCustomerName(""); + wxExtJson.getExt().setCustomerName(customerName); if (CodeConstant.RESI.equals(formDTO.getClientType())) { wxExtJson.getWindow().setNavigationBarTitleText(resiName); } else { wxExtJson.getWindow().setNavigationBarTitleText(workName); } extJson = JSON.toJSONString(wxExtJson); + log.info(extJson); CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); if (null == codeExtDTO) { codeExtDTO = new CodeExtDTO(); @@ -729,4 +752,15 @@ public class CodeServiceImpl implements CodeService { codeOperationHistoryService.save(operationDTO); } + private String getNickName(String appId) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put(ModuleConstant.COMPONENT_APP_ID,componentAppId); + jsonObject.put(ModuleConstant.AUTHORIZER_APP_ID,appId); + String componentAccessToken = componentAccessTokenDao.getComponentAccessToken(); + String data = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_GET_AUTHORIZER_INFO + componentAccessToken , JSON.toJSONString(jsonObject)).getData(); + Map map = JSON.parseObject(data, Map.class); + Map authInfo = (Map) map.get(ModuleConstant.AUTHORIZER_INFO); + return ConvertUtils.mapToEntity(authInfo, MiniInfoFormDTO.class).getNick_name(); + } + } From d6dd4f668ea8ee5661b12aa75e377b149f8977bb Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 28 Sep 2020 14:18:10 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E=20?= =?UTF-8?q?=E8=BE=83=E4=B8=8A=E6=9C=88=E5=A2=9E=E9=95=BF/=E4=B8=8B?= =?UTF-8?q?=E9=99=8D=E7=8E=87=20=E8=BF=94=E5=9B=9E=E7=BB=9D=E5=AF=B9?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/PublicPartiProfileResultDTO.java | 7 +++++-- .../impl/GrassRootsGovernServiceImpl.java | 21 +++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java index c5744d0cdd..8d06845555 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java @@ -33,14 +33,17 @@ public class PublicPartiProfileResultDTO implements Serializable { /** * 较上月趋势:incr上升,decr下降 - * */ + */ private String issueCompareLatestTrend = ""; /** * 平均参与度 - * */ + */ private Integer averageJoin = NumConstant.ZERO; + /** + * 较上月百分比 + */ private String joinCompareLatestMonth = ""; private String joinCompareLatestTrend = ""; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index d750c1ee03..7afd0f4362 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -108,18 +108,17 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); //保证获取公众参与概率数据的最大可能性 int time = NumConstant.TWELVE; - while(null == latest && time > NumConstant.ONE) - { - time --; - monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); - latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); - } + while (null == latest && time > NumConstant.ONE) { + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); + latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + } - if(null == latest) return new PublicPartiProfileResultDTO(); - PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest,PublicPartiProfileResultDTO.class); - result.setMonthIncr(convertPercentStr(latest.getMonthIncr(),NumConstant.ZERO)); - result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth(),NumConstant.ZERO)); - result.setIssueCompareLatestMonth(convertPercentStr(latest.getIssueCompareLatestMonth(),NumConstant.ZERO)); + if (null == latest) return new PublicPartiProfileResultDTO(); + PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest, PublicPartiProfileResultDTO.class); + result.setMonthIncr(convertPercentStr(latest.getMonthIncr(), NumConstant.ZERO)); + result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth().abs(), NumConstant.ZERO)); + result.setIssueCompareLatestMonth(convertPercentStr(latest.getIssueCompareLatestMonth().abs(), NumConstant.ZERO)); return result; } From de33afd6141bff05cb167c5339c4df4dd88a0759 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Sep 2020 14:46:21 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=BC=95=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/extract/toscreen/PartyGuideService.java | 6 +++--- .../extract/toscreen/impl/PartyGuideServiceImpl.java | 3 ++- .../extract/toscreen/impl/ScreenExtractServiceImpl.java | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java index 2628a50ced..2d8ac15142 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java @@ -1,6 +1,6 @@ package com.epmet.service.evaluationindex.extract.toscreen; -import com.epmet.dto.extract.form.ScreenExtractFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; /** * @Author zxc @@ -10,10 +10,10 @@ public interface PartyGuideService { /** * @Description 党建引领抽取 - * @param screenExtractFormDTO + * @param formDTO * @author zxc * @date 2020/9/24 5:10 下午 */ - Boolean partyGuideExtract(ScreenExtractFormDTO screenExtractFormDTO); + Boolean partyGuideExtract(ExtractScreenFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java index b58a38ee7e..48167f4263 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.ScreenConstant; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.extract.form.ScreenExtractFormDTO; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; @@ -64,7 +65,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { * @date 2020/9/24 5:10 下午 */ @Override - public Boolean partyGuideExtract(ScreenExtractFormDTO screenExtractFormDTO) { + public Boolean partyGuideExtract(ExtractScreenFormDTO screenExtractFormDTO) { int pageNo = NumConstant.ONE; int pageSize = NumConstant.ONE_HUNDRED; List customerIds = new ArrayList<>(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 5712789d6c..946c965fde 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -29,6 +29,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { @Autowired private PartyBaseInfoService partyBaseInfoService; @Autowired + private PartyGuideService partyGuideService; + @Autowired private PioneerDataExtractService pioneerDataExtractService; @Autowired private PublicPartExtractService publicPartExtractService; @@ -140,5 +142,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { orgRankExtractService.extractGridData(customerId, monthId); orgRankExtractService.extractCommunityData(customerId, monthId); orgRankExtractService.extractStreetData(customerId, monthId); + + // 党建引领 screen_party_branch_data,screen_party_link_masses_data + partyGuideService.partyGuideExtract(formDTO); } } From af9a5e988cbfaf5d4a6386e0c2173476d492fd0f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Sep 2020 15:19:15 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=BC=95=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toscreen/impl/PartyGuideServiceImpl.java | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java index 48167f4263..091b920adc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java @@ -182,14 +182,18 @@ public class PartyGuideServiceImpl implements PartyGuideService { */ public void disPoseParty(List agencyIdList, Boolean isGrid, String customerId, String monthId) { List result = new ArrayList<>(); + // 判断当前级别agency是否为空 if (!CollectionUtils.isEmpty(agencyIdList)){ + // 获取agencyIds List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); if (isGrid == true){ agencyIdList.forEach(agency -> { + // 计算社区级别的下级(实际就是网格) GridPartyGuideDTO gridPartyGuideDTO = communityLevelSubGrid(customerId, monthId, agency); orgIds.addAll(gridPartyGuideDTO.getOrgIds()); result.addAll(gridPartyGuideDTO.getResult()); }); + // 根据agencyId分组,计算各个社区的 Map> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId)); groupByAgency.forEach((agencyId,gridList) -> { ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); @@ -225,6 +229,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { // 不为空 存在直属网格 if (!CollectionUtils.isEmpty(disGridIds)){ List gridResult = new ArrayList<>(); + // 查询党员创建组,组内成员数 List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); List orgNameList = agencyService.selectOrgNameGrid(partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); if (!CollectionUtils.isEmpty(partyLinkMassesDataList)){ @@ -240,6 +245,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { } delAndInsertLink(gridResult,customerId,monthId,disGridIds); } + // 查询直属网格的信息 + 下级机关的信息 = agency的机关信息 List screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); List screenPartyLinkMassesDataList = linkMassesDataService.selectPartyLinkMassesInfo(customerId, monthId, agencyId); screenPartyLinkMassesDataList.addAll(screenPartyLinkMassesDataGrid); @@ -263,6 +269,12 @@ public class PartyGuideServiceImpl implements PartyGuideService { /** * @Description 处理【参与人数,组织次数】 + * eg:假设 组织A:A1 组织的直属网格:A1-G1 + * 统计 A1的参与人数、组织次数应为 + * + * 组织次数:以A1的名义组织活动次数 + 以A1-G1的名义组织活动次数 = A1组织活动总次数 + * 参与人数:以A1的名义组织活动参与人数和 + 以A1-G1的名义组织活动参与人数和 = A1组织活动参与人数总数 + * * @Param agencyIdList * @Param isGrid * @Param customerId @@ -272,7 +284,9 @@ public class PartyGuideServiceImpl implements PartyGuideService { */ public void disPoseOrganize(List agencyIdList, Boolean isGrid, String customerId, String monthId){ if (!CollectionUtils.isEmpty(agencyIdList)){ + // 包括 gridId 和 agencyId List orgIds = new ArrayList<>(); + // orgIdsAgency 客户下某个级别的所有agencyId List orgIdsAgency = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); orgIds.addAll(orgIdsAgency); orgIdsAgency.forEach(orgId -> { @@ -284,8 +298,11 @@ public class PartyGuideServiceImpl implements PartyGuideService { if (isGrid == false){ orgIds.addAll(directGridIds.stream().map(m -> m.getGridId()).collect(Collectors.toList())); } + // 查询客户下所有机关,网格下的参与人数 List joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, null); + // 查询机关界别的组织次数 List screenPartyBranchDataByAgencyList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.AGENCY, orgIds); + // 查询客户下所有网格和所有机关 List screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId); List screenPartyBranchDataListAgencyAll = gridService.selectAllGridIdToOrganize(customerId, monthId); screenPartyBranchDataListAgencyAll.addAll(screenPartyBranchData); @@ -297,10 +314,10 @@ public class PartyGuideServiceImpl implements PartyGuideService { } }); }); + // 查询所有机关、网格组织次数 List screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, null, orgIds); if (isGrid == true){ agencyIdList.forEach(agency -> { - finalResult.forEach(fl -> { screenPartyBranchDataList.forEach(sp -> { if (fl.getOrgId().equals(sp.getOrgId())){ @@ -325,6 +342,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { if (fl.getOrgId().equals(agencyId)){ fl.setOrganizeCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); fl.setJoinUserCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); + // 如果存在本级名义的, 下级机关 + 本级 screenPartyBranchDataByAgencyList.forEach(organize -> { if (organize.getOrgId().equals(agencyId)){ fl.setOrganizeCount(calAdd(organize.getOrganizeCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); @@ -378,6 +396,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { if (form.getOrgId().equals(agencyId)) { form.setJoinUserCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); form.setOrganizeCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); + // 如果存在本级名义的, 下级机关 + 本级 screenPartyBranchDataByParentList.forEach(organize -> { if (organize.getOrgId().equals(agencyId)) { form.setOrganizeCount(calAdd(organize.getOrganizeCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); @@ -398,6 +417,13 @@ public class PartyGuideServiceImpl implements PartyGuideService { } } + /** + * @Description 加法运算 + * @Param a + * @Param b + * @author zxc + * @date 2020/9/28 3:17 下午 + */ public Integer calAdd(Integer a, Integer b){ if (null != a && null != b){ return a + b; @@ -474,7 +500,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { } /** - * @Description + * @Description 【组织次数,参与人数】添加 * @Param result * @Param customerId * @Param monthId @@ -490,6 +516,14 @@ public class PartyGuideServiceImpl implements PartyGuideService { }); } + /** + * @Description 【组织次数,参与人数】旧纪录删除 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/28 3:18 下午 + */ @Transactional(rollbackFor = Exception.class) public void delOrganize(String customerId, String monthId, List orgIds){ Integer delNum; From bfd588af06de61d35ed1b014bf4822c71e34478c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 28 Sep 2020 15:27:34 +0800 Subject: [PATCH 09/11] =?UTF-8?q?factorigin/extractall=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/FactOriginExtractController.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java index 9610137079..7a6e11f801 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java @@ -1,6 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.extract.form.ExtractOriginFormDTO; @@ -12,8 +11,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.List; - /** * 原始数据清洗 @@ -43,7 +40,7 @@ public class FactOriginExtractController { */ @PostMapping("extractall") public Result extractAll(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { - if (StringUtils.isNotBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isNotBlank(extractOriginFormDTO.getEndDate())) { + /*if (StringUtils.isNotBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isNotBlank(extractOriginFormDTO.getEndDate())) { List daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate()); for (int i = 0; i < daysBetween.size(); i++) { String dateDimId = daysBetween.get(i); @@ -52,7 +49,7 @@ public class FactOriginExtractController { } } else { factOriginExtractService.extractAll(extractOriginFormDTO); - } + }*/ factOriginExtractService.extractAll(extractOriginFormDTO); return new Result(); } From 539a76a45c1031405ca573a5ac2b9ecc21dbe898 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Sep 2020 15:33:27 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=BC=95=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/DemoController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index ad2c65e67d..f4f237b306 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -17,6 +17,7 @@ import com.epmet.dao.stats.DimDateDao; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.extract.form.ScreenExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; @@ -657,7 +658,7 @@ public class DemoController { private PartyGuideService partyGuideService; @PostMapping("zxczxc") - public Result getZxcZxc(@RequestBody ScreenExtractFormDTO formDTO){ + public Result getZxcZxc(@RequestBody ExtractScreenFormDTO formDTO){ partyGuideService.partyGuideExtract(formDTO); return new Result(); } From bc6659d84aadc478886d76ba03b66cf886cd4033 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 28 Sep 2020 16:38:51 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/project/ProjectProcessDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index ed36efbeed..0307d76d45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -59,7 +59,7 @@