diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java new file mode 100644 index 0000000000..06b95d02d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java @@ -0,0 +1,97 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/25 9:07 上午 + */ +@Data +public class ScreenPartyBranchDataFormDTO implements Serializable { + + private static final long serialVersionUID = -5521810726686859779L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice + */ + private String type; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 会议分类Id + */ + private String meetCategoryId; + + /** + * 会议分类名称(三会党课、主题党日.....等等) + */ + private String meetCategoryName; + + /** + * 组织次数 + */ + private Integer organizeCount; + + /** + * 参加人数 + */ + private Integer joinUserCount; + + /** + * 平均参加人数 + */ + private Integer averageJoinUserCount; + + private String delFlag; + + private Integer revision; + + private String createdBy; + + private String updatedBy; + + public ScreenPartyBranchDataFormDTO() { + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + this.type = "voluntaryservice"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java new file mode 100644 index 0000000000..3ff541a16d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java @@ -0,0 +1,73 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 6:03 下午 + */ +@Data +public class ScreenPartyLinkMassesDataFormDTO implements Serializable { + + private static final long serialVersionUID = -7534140815638694052L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员建群总数 + */ + private Integer createGroupTotal; + + /** + * 群成员总数 + */ + private Integer groupUserTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + private String delFlag; + + private Integer revision; + + private String createdBy; + + private String updatedBy; + + public ScreenPartyLinkMassesDataFormDTO() { + this.createGroupTotal = NumConstant.ZERO; + this.groupUserTotal = NumConstant.ZERO; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java new file mode 100644 index 0000000000..7646ff9567 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.extract.result; + +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/25 10:10 上午 + */ +@Data +@AllArgsConstructor +public class GridPartyGuideDTO implements Serializable { + + private static final long serialVersionUID = 8986034496647129566L; + + private List orgIds; + + private List result; +} 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 4f136ffc56..010b6ed47c 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 @@ -37,6 +37,7 @@ import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDail import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService; +import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimCustomerPartymemberService; @@ -647,6 +648,15 @@ public class DemoController { return new Result(); } + @Autowired + private PartyGuideService partyGuideService; + + @PostMapping("zxczxc") + public Result getZxcZxc(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + partyGuideService.partyGuideExtract(formDTO.getCustomerId(),formDTO.getDateId()); + return new Result(); + } + @PostMapping("centralzonedatacleaning") public Result centralZoneDataCleaning(@RequestBody ScreenCentralZoneDataFormDTO param){ screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 5844aa19f8..66a156557d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.GridHeartedFormDTO; @@ -137,4 +138,13 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectGroupMemberList(@Param("list") List groupIdList); + + /** + * @Description 查询党员建组信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("gridIds") List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index bf64ec0495..62ba836b5c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; @@ -154,6 +155,15 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAllAgencyIdToParty(@Param("customerId")String customerId,@Param("dateId")String dateId); + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + List selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId); + /** * @Description 查询org名称【机关】 * @param agencyIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 658b7c4126..d917f62ffb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; @@ -143,6 +144,15 @@ public interface ScreenCustomerGridDao extends BaseDao */ List selectAllGridIdToParty(String customerId, String dateId); + /** + * @Description 查询客户下所有网格ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:43 上午 + */ + List selectAllGridIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId); + /** * @Description 查询org名称 * @param gridIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java index 385f27d2f9..8c5211cefc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.screencoll.form.PartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -56,4 +57,12 @@ public interface ScreenPartyBranchDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + void insertScreenPartyBranchData(@Param("lists") List lists); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index 857958ad1c..586ab1d0a8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.screencoll.form.PartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -55,4 +56,32 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + void insertScreenPartyLinkMassesData(@Param("lists")List lists); + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param monthId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + Integer deleteOldPartyLinkInfo(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("orgIds") List orgIds); + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + List selectPartyLinkMassesInfo(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("agencyId") String agencyId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index bf40ac8388..fdaac9d36e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; @@ -62,4 +63,13 @@ public interface FactOriginGroupMainDailyService extends BaseService originGroupData,List memberList); + + /** + * @Description 查询党员建组信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + List selectPartyCreateGroupInfo(String customerId,String monthId,List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index ed5aeca1a1..4cc0ebb248 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -21,13 +21,16 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -97,4 +100,19 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl selectPartyCreateGroupInfo(String customerId, String monthId,List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + } + return new ArrayList<>(); + } + } \ No newline at end of file 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 09dafb2a6a..8700a2b7e2 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 @@ -9,10 +9,10 @@ public interface PartyGuideService { /** * @Description 党建引领抽取 * @param customerId - * @param dateId + * @param monthId * @author zxc * @date 2020/9/24 5:10 下午 */ - Boolean partyGuideExtract(String customerId,String dateId); + Boolean partyGuideExtract(String customerId,String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java index 6dcfe74f8c..f30e987bb9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java @@ -141,8 +141,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { delAndInsert(result,customerId,dateId,orgIds); }else { // 级别为 street,district,city,province - List agencyIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); - List directGridIds = gridService.selectDirectGrid(agencyIds); + List directGridIds = gridService.selectDirectGrid(orgIds); List userCountList = userGridDailyService.selectUserCount(customerId, dateId); agencyIdList.forEach(agency -> { String agencyId = agency.getAgencyId(); 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 e820b39396..19b0eaa9d4 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 @@ -1,8 +1,29 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; +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.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.*; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService; +import com.epmet.service.evaluationindex.screen.ScreenPartyLinkMassesDataService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @Author zxc @@ -12,15 +33,221 @@ import org.springframework.stereotype.Service; @Slf4j public class PartyGuideServiceImpl implements PartyGuideService { + @Autowired + private ScreenPartyLinkMassesDataService linkMassesDataService; + @Autowired + private ScreenPartyBranchDataService partyBranchDataService; + @Autowired + private FactOriginGroupMainDailyService groupMainService; + @Autowired + private ScreenCustomerAgencyService agencyService; + @Autowired + private ScreenCustomerGridService gridService; + /** * @Description 党建引领抽取 * @param customerId - * @param dateId + * @param monthId * @author zxc * @date 2020/9/24 5:10 下午 */ @Override - public Boolean partyGuideExtract(String customerId, String dateId) { - return null; + public Boolean partyGuideExtract(String customerId, String monthId) { + //【党员建群数,群成员数】 + List agencyIdList = agencyService.selectAllAgencyId(customerId); + if (!CollectionUtils.isEmpty(agencyIdList)){ + // 根据组织级别分组 + Map> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); + if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ + // 社区级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY); + disPose(customerGridInfoList,true,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.STREET)){ + // 街道级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.STREET); + disPose(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ + // 区级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT); + disPose(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.CITY)){ + // 市级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.CITY); + disPose(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ + // 省级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE); + disPose(customerGridInfoList,false,customerId,monthId); + } + } + return true; + } + + /** + * @Description 处理 + * @Param agencyIdList + * @Param isGrid + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 2:57 下午 + */ + public void disPose(List agencyIdList, Boolean isGrid, String customerId, String monthId) { + List result = new ArrayList<>(); + if (!CollectionUtils.isEmpty(agencyIdList)){ + 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()); + }); + Map> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId)); + groupByAgency.forEach((agencyId,gridList) -> { + ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); + List orgNameAgencyList = agencyService.selectOrgNameAgency(result.stream().map(m -> m.getParentId()).distinct().collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(orgNameAgencyList)){ + orgNameAgencyList.forEach(name -> { + if (agencyId.equals(name.getAgencyId())){ + form.setOrgName(name.getAgencyName()); + form.setParentId(name.getParentId()); + } + }); + } + form.setOrgId(agencyId); + form.setCustomerId(customerId); + form.setDataEndTime(monthId); + form.setOrgType(ScreenConstant.AGENCY); + form.setCreateGroupTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); + form.setGroupUserTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); + result.add(form); + }); + delAndInsertLink(result,customerId,monthId,orgIds); + }else { + // 级别为 street,district,city,province + List directGridIds = gridService.selectDirectGrid(orgIds); + agencyIdList.forEach(agency -> { + String agencyId = agency.getAgencyId(); + List disGridIds = new ArrayList<>(); + directGridIds.forEach(grid -> { + if (agencyId.equals(grid.getAgencyId())){ + disGridIds.add(grid.getGridId()); + } + }); + // 不为空 存在直属网格 + 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)){ + partyLinkMassesDataList.forEach(party -> { + orgNameList.forEach(org -> { + if (party.getOrgId().equals(org.getGridId())){ + party.setOrgName(org.getGridName()); + } + }); + ScreenPartyLinkMassesDataFormDTO copyParty = ConvertUtils.sourceToTarget(party, ScreenPartyLinkMassesDataFormDTO.class); + gridResult.add(copyParty); + }); + } + delAndInsertLink(gridResult,customerId,monthId,disGridIds); + } + List screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); + List screenPartyLinkMassesDataList = linkMassesDataService.selectPartyLinkMassesInfo(customerId, monthId, agencyId); + screenPartyLinkMassesDataList.addAll(screenPartyLinkMassesDataGrid); + if (!CollectionUtils.isEmpty(screenPartyLinkMassesDataList)){ + ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); + form.setOrgId(agencyId); + form.setOrgType(ScreenConstant.AGENCY); + form.setOrgName(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getOrgName()); + form.setCustomerId(customerId); + form.setDataEndTime(monthId); + form.setParentId(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getParentId()); + form.setGroupUserTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); + form.setCreateGroupTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); + result.add(form); + } + }); + delAndInsertLink(result,customerId,monthId,orgIds); + } + } + } + + /** + * @Description 社区级别的处理 + * @Param customerId + * @Param monthId + * @Param agency + * @author zxc + * @date 2020/9/25 10:06 上午 + */ + public GridPartyGuideDTO communityLevelSubGrid(String customerId, String monthId, CustomerAgencyInfoResultDTO agency){ + String agencyId = agency.getAgencyId(); + // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) + Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); + List gridIds = (List) agencyMap.get(agencyId); + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + List orgIds = partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList()); + List orgNameList = agencyService.selectOrgNameGrid(orgIds); + partyLinkMassesDataList.forEach(party -> { + orgNameList.forEach(orgName -> { + if (party.getOrgId().equals(orgName.getGridId())){ + party.setOrgName(orgName.getGridName()); + } + }); + }); + return new GridPartyGuideDTO(gridIds,partyLinkMassesDataList); + } + + /** + * @Description 删除并插入党员联系群众【党员建群数,群成员数】 + * @Param result + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/25 2:57 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertLink(List result, String customerId, String monthId, List orgIds){ + List screenPartyLinkMassesAgencyList = agencyService.selectAllAgencyIdToPartyLinkMessage(customerId, monthId); + List resultList = gridService.selectAllGridIdToPartyLinkMessage(customerId, monthId); + resultList.addAll(screenPartyLinkMassesAgencyList); + List finalResult = new ArrayList<>(); + // 因为是根据级别来删除,插入,所以把需要操作的orgIds单独出来 + resultList.forEach(rl -> { + orgIds.forEach(orgId -> { + if (rl.getOrgId().equals(orgId)){ + finalResult.add(rl); + } + }); + }); + if (!CollectionUtils.isEmpty(result)){ + finalResult.forEach(fr -> { + result.forEach(r -> { + if (fr.getOrgId().equals(r.getOrgId())){ + BeanUtils.copyProperties(r,fr); + } + }); + }); + } + Integer delNum; + do { + delNum = linkMassesDataService.deleteOldPartyLinkInfo(customerId, monthId, orgIds); + }while (delNum > NumConstant.ZERO); + List> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + linkMassesDataService.insertScreenPartyLinkMassesData(p); + }); } + + + + + + // TODO 党员志愿服务【参与人数,组织次数】 } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java index 9d74cc81e7..0b2ee8e93e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java @@ -18,6 +18,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import java.util.List; @@ -78,6 +79,15 @@ public interface ScreenCustomerAgencyService{ */ List selectAllAgencyIdToParty(String customerId,String dateId); + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param dateId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + List selectAllAgencyIdToPartyLinkMessage(String customerId, String dateId); + /** * @Description 查询org名称【网格】 * @param gridIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index e8a39967e2..02e3b21f67 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -22,6 +22,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -50,6 +51,15 @@ public interface ScreenCustomerGridService extends BaseService selectAllGridIdToParty(String customerId, String dateId); + /** + * @Description 查询客户下所有网格ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:43 上午 + */ + List selectAllGridIdToPartyLinkMessage(String customerId, String monthId); + /** * @Description 查询机关的直属网格 * @param agencyIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java index 657faf457d..68197d665c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java @@ -18,8 +18,11 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; +import java.util.List; + /** * 基层党建-建设情况数据(支部,联建,志愿服务)按月 * @@ -28,4 +31,12 @@ import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; */ public interface ScreenPartyBranchDataService extends BaseService { + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + void insertScreenPartyBranchData(List lists); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java index 669e20f18d..f03255904a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java @@ -18,8 +18,11 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; +import java.util.List; + /** * 党建引领-党员联系群众数据 * @@ -28,4 +31,32 @@ import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; */ public interface ScreenPartyLinkMassesDataService extends BaseService { + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + void insertScreenPartyLinkMassesData(List lists); + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param monthId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + Integer deleteOldPartyLinkInfo(String customerId, String monthId, List orgIds); + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + List selectPartyLinkMassesInfo(String customerId, String monthId,String agencyId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java index 404ee7240c..9b7d925e05 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.constant.ScreenConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; @@ -159,6 +160,18 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ return screenCustomerAgencyDao.selectAllAgencyIdToParty(customerId,dateId); } + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + @Override + public List selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId) { + return screenCustomerAgencyDao.selectAllAgencyIdToPartyLinkMessage(customerId, monthId); + } + /** * @Description 查询org名称 * @param gridIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 344fe266e4..f1ac5f0d71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -27,6 +27,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -109,6 +110,18 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectAllGridIdToPartyLinkMessage(String customerId, String monthId) { + return screenCustomerGridDao.selectAllGridIdToPartyLinkMessage(customerId, monthId); + } + /** * @Description 查询机关的直属网格 * @param agencyIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java index 8c1f8e9182..271ac60c71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java @@ -20,9 +20,13 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.evaluationindex.screen.ScreenPartyBranchDataDao; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 基层党建-建设情况数据(支部,联建,志愿服务)按月 @@ -33,5 +37,16 @@ import org.springframework.stereotype.Service; @Service public class ScreenPartyBranchDataServiceImpl extends BaseServiceImpl implements ScreenPartyBranchDataService { - + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + @Override + public void insertScreenPartyBranchData(List lists) { + if (!CollectionUtils.isEmpty(lists)){ + baseDao.insertScreenPartyBranchData(lists); + } + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java index 256246ad11..2aec948249 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java @@ -18,11 +18,17 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenPartyLinkMassesDataDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPartyLinkMassesDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 党建引领-党员联系群众数据 @@ -31,7 +37,46 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-09-22 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenPartyLinkMassesDataServiceImpl extends BaseServiceImpl implements ScreenPartyLinkMassesDataService { + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + @Override + public void insertScreenPartyLinkMassesData(List lists) { + if (!CollectionUtils.isEmpty(lists)){ + baseDao.insertScreenPartyLinkMassesData(lists); + } + } + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param monthId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + @Override + public Integer deleteOldPartyLinkInfo(String customerId, String monthId, List orgIds) { + return baseDao.deleteOldPartyLinkInfo(customerId, monthId, orgIds); + } + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + @Override + public List selectPartyLinkMassesInfo(String customerId, String monthId, String agencyId) { + return baseDao.selectPartyLinkMassesInfo(customerId, monthId, agencyId); + } } \ No newline at end of file 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 134c359fd2..a6c9b62bee 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 @@ -238,4 +238,30 @@ m.GROUP_ID =#{groupId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml index 343deb4dd1..9de96650b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml @@ -194,6 +194,7 @@ org_id = #{orgId} ) + LIMIT 1000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index e5d5305639..df9a6fd514 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -304,4 +304,20 @@ ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index 19d1947e11..459e873378 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -296,4 +296,20 @@ DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml index a7058e4a08..92b2b888b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml @@ -58,4 +58,55 @@ ) + + + + INSERT INTO screen_party_branch_data ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + TYPE, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + MEET_CATEGORY_ID, + MEET_CATEGORY_NAME, + ORGANIZE_COUNT, + JOIN_USER_COUNT, + AVERAGE_JOIN_USER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.type}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.meetCategoryId}, + #{item.meetCategoryName}, + #{item.organizeCount}, + #{item.joinUserCount}, + #{item.averageJoinUserCount}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml index f6760538d1..20d7c3f7e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml @@ -9,6 +9,41 @@ limit 1000; + + + delete from screen_party_link_masses_data + where CUSTOMER_ID = #{customerId} + and DATA_END_TIME = #{monthId} + and + ( + + org_id = #{orgId} + + ) + LIMIT 1000 + + + + + insert into screen_party_link_masses_data ( @@ -49,4 +84,29 @@ + + + INSERT INTO screen_party_link_masses_data ( ID, CUSTOMER_ID, ORG_TYPE, ORG_ID, PARENT_ID, ORG_NAME, CREATE_GROUP_TOTAL, GROUP_USER_TOTAL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DATA_END_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.createGroupTotal}, + #{item.groupUserTotal}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW(), + #{item.dataEndTime} + ) + + +