From 2c0ded5042139328e933a03ba0fc863fbfaf53fb Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 21 Sep 2020 13:57:09 +0800 Subject: [PATCH 01/10] =?UTF-8?q?group=5Fmain=E6=9B=B4=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E5=80=99bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/impl/GroupExtractServiceImpl.java | 9 ++++++--- .../extract/FactOriginGroupMainDailyDao.xml | 6 ++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java index 089fa9fdbd..9c664f4007 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java @@ -137,9 +137,12 @@ public class GroupExtractServiceImpl implements GroupExtractService { List partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); List heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId()); - - factOriginGroupMainDailyDao.updatePartyFlag(partyIds,param.getCustomerId()); - factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds,param.getCustomerId()); + if(!partyIds.isEmpty()) { + factOriginGroupMainDailyDao.updatePartyFlag(partyIds, param.getCustomerId()); + } + if(!heartedIds.isEmpty()) { + factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds, param.getCustomerId()); + } } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index d07e74fae7..da7cb183e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -71,8 +71,7 @@ DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND - + GROUP_OWNER_ID = #{ownerId} @@ -84,8 +83,7 @@ DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND - + (GROUP_OWNER_ID = #{item.userId} AND GRID_ID = #{item.gridId}) From f6e9f9862f1821ef5d12326381dd736da94ed559 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 21 Sep 2020 14:07:03 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3=20?= =?UTF-8?q?=E5=85=9A=E5=BB=BA=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexGovrnAblityGridMonthlyDao.java | 2 +- .../FactIndexPartyAblityGridMonthlyDao.java | 2 +- .../extract/impl/CalGridIndexServiceImpl.java | 52 ++++++++++++++++--- ...FactIndexGovrnAblityOrgMonthlyService.java | 2 +- ...FactIndexPartyAblityOrgMonthlyService.java | 2 +- ...IndexGovrnAblityOrgMonthlyServiceImpl.java | 4 +- ...IndexPartyAblityOrgMonthlyServiceImpl.java | 4 +- .../FactIndexGovrnAblityGridMonthlyDao.xml | 1 + .../FactIndexPartyAblityGridMonthlyDao.xml | 1 + 9 files changed, 54 insertions(+), 16 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 1d8b7eb7ba..927e157db0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -134,5 +134,5 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED); + partition.forEach(r -> { + insertPartyAbility(r); + }); return true; } @@ -364,7 +368,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } }); }); - delAndInsertGovernAbility(result,customerId,monthId); + delGovernAbility(customerId, monthId); + List> resultList = ListUtils.partition(result, NumConstant.ONE_HUNDRED); + resultList.forEach(r -> { + insertGovernAbility(r); + }); return true; } @@ -490,30 +498,58 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } /** - * @Description 删除并插入党建能力的记录 + * @Description 插入党建能力的记录 * @param result * @author zxc * @date 2020/9/19 4:06 下午 */ @Transactional(rollbackFor = Exception.class) - public void delAndInsertPartyAbility(List result,String customerId,String monthId){ + public void insertPartyAbility(List result){ if (!CollectionUtils.isEmpty(result)){ - partyAbilityOrgMonthlyService.deleteOldPartyAbility(customerId, monthId); partyAbilityOrgMonthlyService.insertPartyAbility(result); } } /** - * @Description 删除并插入治理能力的记录 + * @Description 删除党建能力的记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delPartyAbility(String customerId,String monthId){ + Integer delNum; + do { + delNum = partyAbilityOrgMonthlyService.deleteOldPartyAbility(customerId, monthId); + }while (delNum > NumConstant.ZERO); + } + + /** + * @Description 插入治理能力的记录 * @param result * @author zxc * @date 2020/9/19 4:06 下午 */ @Transactional(rollbackFor = Exception.class) - public void delAndInsertGovernAbility(List result,String customerId,String monthId){ + public void insertGovernAbility(List result){ if (!CollectionUtils.isEmpty(result)){ - governAbilityOrgMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId); governAbilityOrgMonthlyService.insertGovernAbilityRecord(result); } } + + /** + * @Description 删除治理能力的记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delGovernAbility(String customerId,String monthId){ + Integer delNum; + do { + delNum = governAbilityOrgMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId); + }while (delNum > NumConstant.ZERO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java index ade3c57f5b..272da9faef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java @@ -39,5 +39,5 @@ public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index 500f67dcc8..9208f9a533 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -265,5 +265,6 @@ WHERE CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + LIMIT 1000 From 46c5753537515a3b6d8b7199efe0ff487c414bad Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 21 Sep 2020 14:08:44 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E7=A4=BE=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IndexCollCommunityServiceImpl.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java index ad5ce2728f..71e16ac3a8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java @@ -27,6 +27,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.util.Date; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -127,6 +128,21 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService })); } + //办结数 + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month"); + Map responseMap = factOriginProjectLogDailyService.getAgencyResponseRatio(customerId,dimId.getMonthId(),"month"); + list.forEach(entity ->{ + entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId())); + BigDecimal element = entity.getClosedProjectRatio(); + //办结率 + entity.setClosedProjectRatio( + element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP) + ); + //响应度 + entity.setRespProjectRatio(responseMap.get(entity.getAgencyId())); + }); + + factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); factIndexGovrnAblityOrgMonthlyService.insertBatch(list); From 696be1898b573015ea649471c44f3331f9117c42 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 21 Sep 2020 14:18:55 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3-?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E8=83=BD=E5=8A=9BV0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/heart/ActInfoDao.java | 9 ++ .../epmet/dao/partymember/PartyMemberDao.java | 8 ++ .../main/java/com/epmet/dao/user/UserDao.java | 10 ++ .../extract/impl/CalCpcIndexServiceImpl.java | 2 +- .../extract/impl/CalGridIndexServiceImpl.java | 95 ++++++++++++++++++- .../resources/mapper/heart/ActInfoDao.xml | 14 +++ .../mapper/partymember/PartyMemberDao.xml | 15 +++ .../main/resources/mapper/user/UserDao.xml | 13 +++ 8 files changed, 160 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java index 5c3dfddd3d..1381898f01 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java @@ -41,4 +41,13 @@ public interface ActInfoDao{ * @Date 2020/9/21 10:41 **/ List> selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.util.List + * @param regUserIds + * @author yinzuomei + * @description 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 + * @Date 2020/9/21 13:55 + **/ + List selectGridRegUserVolunteer(@Param("list") List regUserIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java index 7927e8bee1..18b44ea8e0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java @@ -36,4 +36,12 @@ public interface PartyMemberDao{ */ List selectPartyMemberByCustomer(@Param("customerId") String customerId); + /** + * @return java.util.List + * @param volunteerUserIds + * @author yinzuomei + * @description 志愿者中,同时是党员的人数 + * @Date 2020/9/21 14:13 + **/ + List selectVolunteerPartyUserIds(@Param("list") List volunteerUserIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index 22372cbed4..28c0a2c389 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -111,4 +111,14 @@ public interface UserDao { List selectPartymembersByCustomerId(@Param("customerId")String customerId); List selectWarmHeartedByCustomerId(@Param("customerId")String customerId); + + /** + * @param customerId + * @param gridId + * @return java.util.List + * @author yinzuomei + * @description 查询当前网格下,首次注册的用户ids + * @Date 2020/9/21 13:46 + **/ + List selectGridRegUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java index 0b64d285fa..4296506ab8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java @@ -396,7 +396,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { continue; } NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(6); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); String topicToIssueRatioStr = numberFormat.format((float) projectTotal / issueTotal); BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr); map.put(partyMember.getUserId(), topicToIssueRatio); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java index 082fc28114..86eff5d1ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java @@ -11,6 +11,8 @@ import com.epmet.constant.ProjectEvaluateConstant; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; import com.epmet.dao.heart.ActInfoDao; +import com.epmet.dao.partymember.PartyMemberDao; +import com.epmet.dao.user.UserDao; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; @@ -27,6 +29,8 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -70,6 +74,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; @Autowired private ActInfoDao actInfoDao; + @Autowired + private UserDao userDao; + @Autowired + private PartyMemberDao partyMemberDao; + /** * @Description 计算网格指标党建能力 * @param customerId @@ -391,14 +400,52 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { entity.setMonthId(monthId); entity.setQuarterId(quarterId); entity.setYearId(yearId); - //网格活动组织次数 爱心活动 + //网格活动组织次数 爱心活动 : 活动状态已结束并且实际结束时间在评价周期内的 if(activityCountMap.containsKey(entity.getGridId())){ entity.setActivityCount(activityCountMap.get(entity.getGridId())); } - //网格志愿者占比 todo -// entity.setVolunteerRatio(); - //网格党员志愿者率 todo -// entity.setPartyVolunteerRatio(); + + List volunteerUserIds=new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + //网格志愿者占比 : 所有注册用户中,注册了志愿者的用户占比 + //(1)网格内的注册用户有哪些? + List regUserIds=this.getGridRegUserIds(customerId,entity.getGridId()); + if(CollectionUtils.isEmpty(regUserIds)){ + log.info(String.format("当前网格%s下没有注册用户,所以网格志愿者占比volunteerRatio赋值0",entity.getGridId())); + entity.setVolunteerRatio(BigDecimal.ZERO); + }else{ + //(2)网格内注册用户中,那些人注册了志愿者? + volunteerUserIds=this.getGridRegUserVolunteer(regUserIds); + if(CollectionUtils.isEmpty(volunteerUserIds)){ + log.info(String.format("当前网格%s下注册用户%s个,其中志愿者为0个,所以网格志愿者占比volunteerRatio赋值0",entity.getGridId(),regUserIds.size())); + entity.setVolunteerRatio(BigDecimal.ZERO); + }else{ + int volunteerTotal=volunteerUserIds.size(); + int regUserTotal=regUserIds.size(); + String volunteerRatioStr = numberFormat.format((float) volunteerTotal / regUserTotal); + BigDecimal volunteerRatio = new BigDecimal(volunteerRatioStr); + entity.setVolunteerRatio(volunteerRatio); + } + } + //网格党员志愿者率 : 所有志愿者中,同时是党员的占比 + if(CollectionUtils.isEmpty(volunteerUserIds)){ + log.info(String.format("当前网格%s下志愿者人数0个,所以网格党员志愿者率partyVolunteerRatio赋值为0",entity.getGridId())); + entity.setPartyVolunteerRatio(BigDecimal.ZERO); + }else{ + List paryUserIds=this.getVolunteerPartyUserIds(volunteerUserIds); + if(CollectionUtils.isEmpty(paryUserIds)){ + log.info(String.format("当前网格%s下志愿者%s个,同时是党员的0个,所以网格党员志愿者率partyVolunteerRatio赋值为0",entity.getGridId(),volunteerUserIds.size())); + entity.setPartyVolunteerRatio(BigDecimal.ZERO); + }else{ + int volunteerCount=volunteerUserIds.size(); + int partyUserCount=paryUserIds.size(); + String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount); + BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr); + entity.setPartyVolunteerRatio(partyVolunteerRatio); + } + } + } //3、批量删 deleteBatchIndexServiceAblityGridMonthly(customerId,monthId); @@ -410,6 +457,44 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return true; } + + /** + * @return java.util.List + * @param customerId + * @param gridId + * @author yinzuomei + * @description 查询当前网格下,首次注册的用户ids + * @Date 2020/9/21 13:44 + **/ + @DataSource(DataSourceConstant.EPMET_USER) + private List getGridRegUserIds(String customerId, String gridId) { + return userDao.selectGridRegUserIds(customerId,gridId); + } + + /** + * @return java.util.List + * @param regUserIds + * @author yinzuomei + * @description 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 + * @Date 2020/9/21 13:50 + **/ + @DataSource(DataSourceConstant.EPMET_HEART) + private List getGridRegUserVolunteer(List regUserIds) { + return actInfoDao.selectGridRegUserVolunteer(regUserIds); + } + + /** + * @return java.util.List + * @param volunteerUserIds + * @author yinzuomei + * @description 志愿者中,同时是党员的人数 + * @Date 2020/9/21 14:10 + **/ + @DataSource(DataSourceConstant.PARTY_MEMBER) + private List getVolunteerPartyUserIds(List volunteerUserIds) { + return partyMemberDao.selectVolunteerPartyUserIds(volunteerUserIds); + } + /** * @return java.util.Map * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml index fafa780590..ea26569ba8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml @@ -18,4 +18,18 @@ GROUP BY ai.SPONSOR_ID + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml index b5e77a8699..1a6a74ddd4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml @@ -29,4 +29,19 @@ CUSTOMER_ID = #{customerId} AND (FIRST_REGISTER = 1 OR REGISTER = 1) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 22061e3e70..03f525d12d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -457,4 +457,17 @@ AND rolename.ROLE_KEY = 'warmhearted' + + + From a3ed42fcc6fb00c349909c80c6c3a00854d5cb10 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 21 Sep 2020 14:56:16 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E8=BD=AC=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=8E=87=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginIssueMainDailyDao.java | 9 ++++++ .../extract/IssueExtractService.java | 9 ++++++ .../extract/impl/CalGridIndexServiceImpl.java | 30 +++++++++++++++++-- .../extract/impl/IssueExtractServiceImpl.java | 12 ++++++++ .../extract/FactOriginIssueMainDailyDao.xml | 14 +++++++++ 5 files changed, 72 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index c115125ba8..5ef3c02f02 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -64,6 +64,15 @@ public interface FactOriginIssueMainDailyDao extends BaseDao selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId); + /** + * @Description 查询俩月的网格议题总数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + List selectIssueTotalTwoMonthPlus(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("minusMonthId") String minusMonthId); + /** * @Description 网格总项目数 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java index 45f9c1ff0a..c0b0201750 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java @@ -42,6 +42,15 @@ public interface IssueExtractService { */ List selectIssueTotal(String customerId, String monthId); + /** + * @Description 查询俩月的网格议题总数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + List selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId); + /** * @Description 网格总项目数 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java index 04dcd9ab0b..b88f3e23da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java @@ -33,6 +33,11 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.NumberFormat; import java.util.ArrayList; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -106,7 +111,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { // 网格的发文数量 List publishCountList = articlePublishedGridDailyService.selectArticlePublishCount(customerId, monthId); // 网格议题转项目率 - List gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId); + List gridIssueTotalList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, minusMonthId(monthId)); List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); // 建群党员数 @@ -252,7 +257,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { //网格总项目数 List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); //网格议题转项目率 - List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); + List gridIssueCountList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, minusMonthId(monthId)); + List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueCountList, gridProjectTotalList); //网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格 List projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId); Map autoMap = new HashMap<>(16); @@ -637,4 +643,24 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { delNum = governAbilityOrgMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId); }while (delNum > NumConstant.ZERO); } + + /** + * @Description 根据monthId【yyyyMM】获取上一个月份ID + * @param monthId + * @author zxc + * @date 2020/9/21 2:43 下午 + */ + public String minusMonthId(String monthId){ + String minusMonthId = null; + SimpleDateFormat sft = new SimpleDateFormat("yyyyMM"); + try { + Date parse = sft.parse(monthId); + LocalDate birth = parse.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate localDate = birth.minusMonths(NumConstant.ONE); + minusMonthId = localDate.toString().substring(NumConstant.ZERO, NumConstant.FOUR).concat(localDate.toString().substring(NumConstant.FIVE, NumConstant.SEVEN)); + } catch (ParseException e) { + e.printStackTrace(); + } + return minusMonthId; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index 2c6414b910..7388910ddc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -238,6 +238,18 @@ public class IssueExtractServiceImpl implements IssueExtractService { return issueMainDailyDao.selectIssueTotal(customerId, monthId); } + /** + * @Description 查询俩月的网格议题总数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + @Override + public List selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId) { + return issueMainDailyDao.selectIssueTotalTwoMonthPlus(customerId, monthId, minusMonthId); + } + /** * @Description 网格总项目数 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index de03f24dc5..d016174b72 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -153,4 +153,18 @@ LIMIT 2 )t + + + \ No newline at end of file From f6e99853214ea6869a6055055ce5e759943dc11a Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 21 Sep 2020 16:05:07 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E7=94=9F=E6=88=90=E8=87=AA=E8=BA=AB?= =?UTF-8?q?=E5=92=8C=E4=B8=8B=E7=BA=A7=E5=88=86=E6=95=B0=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexAgencySelfSubScoreDao.java | 33 ++++++ .../FactIndexCommunitySelfSubScoreDao.java | 33 ++++++ .../FactIndexGridSelfSubScoreDao.java | 33 ++++++ .../FactIndexAgencySelfSubScoreEntity.java | 100 ++++++++++++++++++ .../FactIndexCommunitySelfSubScoreEntity.java | 95 +++++++++++++++++ .../FactIndexGridSelfSubScoreEntity.java | 100 ++++++++++++++++++ .../FactIndexAgencySelfSubScoreDao.xml | 29 +++++ .../FactIndexCommunitySelfSubScoreDao.xml | 28 +++++ .../indexcal/FactIndexGridSelfSubScoreDao.xml | 29 +++++ 9 files changed, 480 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.java new file mode 100644 index 0000000000..af290b9ca6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.FactIndexAgencySelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 区/街道相关 自身和下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface FactIndexAgencySelfSubScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.java new file mode 100644 index 0000000000..4be7ed8605 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.FactIndexCommunitySelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 社区相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface FactIndexCommunitySelfSubScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.java new file mode 100644 index 0000000000..af45b61b0e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.FactIndexGridSelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格相关自身/下级分值记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface FactIndexGridSelfSubScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.java new file mode 100644 index 0000000000..19c829e4e3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 区/街道相关 自身和下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_agency_self_sub_score") +public class FactIndexAgencySelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id(eg:社区或者街道id) + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 数据类型 district :全区;street:街道 + */ + private String dataType; + + /** + * 分数类型,self:自身得分;sub:下级得分 + */ + private String scoreType; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重 + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.java new file mode 100644 index 0000000000..4bc4d33dc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 社区相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_community_self_sub_score") +public class FactIndexCommunitySelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 社区上一级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 分数类型,self:自身得分;sub:下级得分 + */ + private String scoreType; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重 + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java new file mode 100644 index 0000000000..b7b73ee9ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 网格相关自身/下级分值记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_grid_self_sub_score") +public class FactIndexGridSelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 分数类型,self:自身得分;sub:下级得分 + */ + private String scoreType; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重 + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml new file mode 100644 index 0000000000..fa016f4fbc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.xml new file mode 100644 index 0000000000..6987c01df5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.xml new file mode 100644 index 0000000000..0585208907 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ffbe2e8c3d719868767f3af73ed506c963c67bc7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 21 Sep 2020 16:29:32 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=9B=B8=E5=85=B3-?= =?UTF-8?q?=E5=85=9A=E5=BB=BA=E8=83=BD=E5=8A=9B=E8=AE=A1=E7=AE=97V0.5=20?= =?UTF-8?q?=20=E4=B8=8D=E6=B5=8B=E4=B8=8D=E7=9F=A5=E9=81=93=E4=B8=80?= =?UTF-8?q?=E6=B5=8B=E5=90=93=E4=B8=80=E8=B7=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactOriginGroupMainDailyService.java | 52 ++++++++++++++ .../extract/impl/CalCpcIndexServiceImpl.java | 52 ++++---------- .../extract/impl/CalGridIndexServiceImpl.java | 17 +++-- .../FactOriginGroupMainDailyServiceImpl.java | 65 +++++++++++++++++ ...FactIndexPartyAblityCpcMonthlyService.java | 51 ++++++++++++++ ...IndexPartyAblityCpcMonthlyServiceImpl.java | 70 +++++++++++++++++++ .../extract/FactOriginIssueMainDailyDao.xml | 1 - .../extract/FactOriginTopicLogDailyDao.xml | 8 +-- .../extract/FactOriginTopicMainDailyDao.xml | 1 - .../stats/DimCustomerPartymemberDao.xml | 2 +- 10 files changed, 270 insertions(+), 49 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginGroupMainDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginGroupMainDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginGroupMainDailyService.java new file mode 100644 index 0000000000..d534871aeb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginGroupMainDailyService.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; + +import java.util.List; + + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +public interface FactOriginGroupMainDailyService extends BaseService { + + /** + * @return java.util.List + * @param customerId + * @param userId + * @author yinzuomei + * @description 查询当前用户建了多少个组 + * @Date 2020/9/21 16:12 + **/ + List selectGroupIds(String customerId, String userId); + + /** + * @return java.util.List + * @param groupIdList + * @author yinzuomei + * @description 根据组,查询组里面的成员(去重) + * @Date 2020/9/21 16:13 + **/ + List selectGroupMemberList(List groupIdList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java index 4296506ab8..595580f363 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java @@ -1,14 +1,11 @@ package com.epmet.service.evaluationindex.extract.impl; -import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; -import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; -import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.service.evaluationindex.extract.*; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -35,8 +32,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { @Autowired private DimCustomerPartymemberService dimCustomerPartymemberService; @Autowired - private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; - @Autowired private FactOriginTopicMainDailyService factOriginTopicMainDailyService; @Autowired private FactOriginTopicLogDailyService factOriginTopicLogDailyService; @@ -45,7 +40,9 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { @Autowired private FactOriginProjectMainDailyService factOriginProjectMainDailyService; @Autowired - private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao; + private FactIndexPartyAblityCpcMonthlyService factIndexPartyAblityCpcMonthlyService; + @Autowired + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; /** * @param customerId 客户id @@ -66,7 +63,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { String quarterId= DateUtils.getQuarterId(monthId); String yearId=DateUtils.getYearId(monthId); //2、删除之前统计过的 - deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); + factIndexPartyAblityCpcMonthlyService.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); //1、党员提出话题数 @@ -132,7 +129,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //4、分批插入批量插入 List> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE); partition.forEach(list -> { - this.saveFactIndexPartyAblityCpcMonthlyEntity(list); + factIndexPartyAblityCpcMonthlyService.saveFactIndexPartyAblityCpcMonthlyEntity(list); }); } @@ -150,7 +147,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { Map> map = new HashMap<>(); for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { //查询当前党员建了多少个组 - List groupIdList = factOriginGroupMainDailyDao.selectGroupIds(customerId, partyMember.getUserId()); + List groupIdList=factOriginGroupMainDailyService.selectGroupIds(customerId,partyMember.getUserId()); if (CollectionUtils.isEmpty(groupIdList)) { map.put(partyMember.getUserId(), new ArrayList<>()); continue; @@ -259,12 +256,14 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //查询当前党员建了多少个组 List groupIdList = userCreatedGroups.get(partyMember.getUserId()); if (CollectionUtils.isEmpty(groupIdList)) { + log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群群众人数】赋值0"); map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } //去重组里面的成员 - List memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList); + List memberIdList=factOriginGroupMainDailyService.selectGroupMemberList(groupIdList); if (CollectionUtils.isEmpty(memberIdList)) { + //memberIdList肯定不会为空,因为起码会有群主一个人 map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } else { @@ -303,11 +302,12 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //1、查询当前党员建了多少个组 List groupIdList = userCreatedGroups.get(partyMember.getUserId()); if (CollectionUtils.isEmpty(groupIdList)) { + log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0"); map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } //2、去重组里面的成员 - List memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList); + List memberIdList = factOriginGroupMainDailyService.selectGroupMemberList(groupIdList); if (CollectionUtils.isEmpty(memberIdList)) { map.put(partyMember.getUserId(), NumConstant.ZERO); continue; @@ -404,32 +404,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { return map; } - /** - * @param customerId - * @param monthId - * @return void - * @author yinzuomei - * @description 删除这个客户这个月 党员相关-党建能力的数据 - * @Date 2020/9/18 10:20 - **/ - @DataSource(value = DataSourceConstant.EVALUATION_INDEX) - public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) { - int deleteNum; - do { - deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); - } while (deleteNum > NumConstant.ZERO); - } - /** - * @param list - * @return void - * @author yinzuomei - * @description 批量插入党员相关党建能力表 - * @Date 2020/9/18 10:27 - **/ - @DataSource(value = DataSourceConstant.EVALUATION_INDEX) - private void saveFactIndexPartyAblityCpcMonthlyEntity(List list) { - factIndexPartyAblityCpcMonthlyDao.insertBatchEntity(list); - } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java index 04dcd9ab0b..0d89e8add8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java @@ -421,13 +421,13 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { //(1)网格内的注册用户有哪些? List regUserIds=this.getGridRegUserIds(customerId,entity.getGridId()); if(CollectionUtils.isEmpty(regUserIds)){ - log.info(String.format("当前网格%s下没有注册用户,所以网格志愿者占比volunteerRatio赋值0",entity.getGridId())); + log.info(String.format("当前网格%s下没有注册用户,所以【网格志愿者占比】volunteerRatio赋值0",entity.getGridId())); entity.setVolunteerRatio(BigDecimal.ZERO); }else{ //(2)网格内注册用户中,那些人注册了志愿者? volunteerUserIds=this.getGridRegUserVolunteer(regUserIds); if(CollectionUtils.isEmpty(volunteerUserIds)){ - log.info(String.format("当前网格%s下注册用户%s个,其中志愿者为0个,所以网格志愿者占比volunteerRatio赋值0",entity.getGridId(),regUserIds.size())); + log.info(String.format("当前网格%s下注册用户%s个,其中志愿者为0个,所以【网格志愿者占比】volunteerRatio赋值0",entity.getGridId(),regUserIds.size())); entity.setVolunteerRatio(BigDecimal.ZERO); }else{ int volunteerTotal=volunteerUserIds.size(); @@ -439,12 +439,12 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } //网格党员志愿者率 : 所有志愿者中,同时是党员的占比 if(CollectionUtils.isEmpty(volunteerUserIds)){ - log.info(String.format("当前网格%s下志愿者人数0个,所以网格党员志愿者率partyVolunteerRatio赋值为0",entity.getGridId())); + log.info(String.format("当前网格%s下志愿者人数0个,所以【网格党员志愿者率】partyVolunteerRatio赋值为0",entity.getGridId())); entity.setPartyVolunteerRatio(BigDecimal.ZERO); }else{ List paryUserIds=this.getVolunteerPartyUserIds(volunteerUserIds); if(CollectionUtils.isEmpty(paryUserIds)){ - log.info(String.format("当前网格%s下志愿者%s个,同时是党员的0个,所以网格党员志愿者率partyVolunteerRatio赋值为0",entity.getGridId(),volunteerUserIds.size())); + log.info(String.format("当前网格%s下志愿者%s个,同时是党员的0个,所以【网格党员志愿者率】partyVolunteerRatio赋值为0",entity.getGridId(),volunteerUserIds.size())); entity.setPartyVolunteerRatio(BigDecimal.ZERO); }else{ int volunteerCount=volunteerUserIds.size(); @@ -466,6 +466,15 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return true; } + /*public static void main(String[] args) { + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + int volunteerCount=7; + int partyUserCount=6; + String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount); + BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr); + System.out.println(partyVolunteerRatio); + }*/ /** * @return java.util.List diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginGroupMainDailyServiceImpl.java new file mode 100644 index 0000000000..de9d2d2a40 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginGroupMainDailyServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; +import com.epmet.service.evaluationindex.extract.FactOriginGroupMainDailyService; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Service +public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl implements FactOriginGroupMainDailyService { + + + /** + * @return java.util.List + * @param customerId + * @param userId + * @author yinzuomei + * @description 查询当前用户建了多少个组 + * @Date 2020/9/21 16:13 + **/ + @Override + public List selectGroupIds(String customerId, String userId) { + List groupIdList = baseDao.selectGroupIds(customerId,userId); + return groupIdList; + } + + /** + * @param groupIdList + * @return java.util.List + * @author yinzuomei + * @description 根据组,查询组里面的成员(去重) + * @Date 2020/9/21 16:13 + **/ + @Override + public List selectGroupMemberList(List groupIdList) { + List memberIdList = baseDao.selectGroupMemberList(groupIdList); + return memberIdList; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java new file mode 100644 index 0000000000..149ff64cab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; + +import java.util.List; + + +/** + * 党建能力-党员相关的事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +public interface FactIndexPartyAblityCpcMonthlyService extends BaseService { + /** + * @return void + * @param customerId + * @param monthId + * @author yinzuomei + * @description 删除这个客户这个月 党员相关-党建能力的数据 + * @Date 2020/9/21 16:01 + **/ + void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId); + + /** + * @return void + * @param list + * @author yinzuomei + * @description 批量插入党员相关党建能力表 + * @Date 2020/9/21 16:04 + **/ + void saveFactIndexPartyAblityCpcMonthlyEntity(List list); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java new file mode 100644 index 0000000000..78072b7bed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * 党建能力-党员相关的事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Service +public class FactIndexPartyAblityCpcMonthlyServiceImpl extends BaseServiceImpl implements FactIndexPartyAblityCpcMonthlyService { + /** + * @param customerId + * @param monthId + * @return void + * @author yinzuomei + * @description 删除这个客户这个月 党员相关-党建能力的数据 + * @Date 2020/9/18 10:20 + **/ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) { + int deleteNum; + do { + deleteNum = baseDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); + } while (deleteNum > NumConstant.ZERO); + } + + + /** + * @param list + * @return void + * @author yinzuomei + * @description 批量插入党员相关党建能力表 + * @Date 2020/9/18 10:27 + **/ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + public void saveFactIndexPartyAblityCpcMonthlyEntity(List list) { + baseDao.insertBatchEntity(list); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index de03f24dc5..85fe22a61a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -108,7 +108,6 @@ fact_origin_issue_main_daily t1 WHERE t1.DEL_FLAG = '0' --- AND t1.TOPIC_USER_IS_PARTY = '1' AND t1.CUSTOMER_ID = #{customerId} AND t1.MONTH_ID = #{monthId} AND ISNULL(T1.CREATE_TOPIC_USER_ID)=0 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml index bbb25ff3ae..5ef409a772 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml @@ -77,7 +77,6 @@ t1.DEL_FLAG = '0' AND t1.CUSTOMER_ID = #{customerId} AND t1.MONTH_ID = #{monthId} --- AND t1.OPERATE_USER_IS_PARTY = '1' AND t1.ACTION_CODE = 'comment' GROUP BY t1.OPERATE_USER_ID @@ -107,20 +106,21 @@ SELECT COUNT( 1 ) AS TOTAL FROM - fact_origin_topic_main_daily T1 + fact_origin_topic_log_daily T1 WHERE T1.DEL_FLAG = '0' AND T1.CUSTOMER_ID = #{customerId} AND T1.MONTH_ID = #{monthId} AND T1.OPERATE_USER_ID = #{userId} + AND t1.ACTION_CODE = 'comment'