Browse Source

Merge branch 'dev_screen_data_2.0' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_screen_data_2.0

master
wxz 5 years ago
parent
commit
b9bdbfae7d
  1. 97
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java
  2. 73
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java
  3. 23
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java
  4. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  5. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  6. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  7. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  8. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java
  9. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java
  10. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java
  11. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java
  12. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java
  13. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java
  14. 233
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java
  15. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
  16. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  17. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java
  18. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java
  19. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java
  20. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  21. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java
  22. 45
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java
  23. 26
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  24. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml
  25. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml
  26. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml
  27. 51
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml
  28. 60
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml

97
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";
}
}

73
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";
}
}

23
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<String> orgIds;
private List<ScreenPartyLinkMassesDataFormDTO> result;
}

10
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);

10
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<FactOriginGroupMain
* @Date 2020/9/20 21:29
**/
List<String> selectGroupMemberList(@Param("list") List<String> groupIdList);
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/25 9:46 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("gridIds") List<String> gridIds);
}

10
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<ScreenCustomerAgencyEnt
*/
List<PartyBaseInfoFormDTO> selectAllAgencyIdToParty(@Param("customerId")String customerId,@Param("dateId")String dateId);
/**
* @Description 查询客户下所有机关ID
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 10:39 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId);
/**
* @Description 查询org名称机关
* @param agencyIds

10
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<ScreenCustomerGridEntity>
*/
List<PartyBaseInfoFormDTO> selectAllGridIdToParty(String customerId, String dateId);
/**
* @Description 查询客户下所有网格ID
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 10:43 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectAllGridIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询org名称
* @param gridIds

9
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<ScreenPartyBranchDataE
* @Date 10:52 2020-08-18
**/
void batchInsertPartyBranchData(@Param("list") List<PartyBranchDataFormDTO> list, @Param("customerId")String customerId);
/**
* @Description 插入建设情况数据
* @param lists
* @author zxc
* @date 2020/9/25 9:16 上午
*/
void insertScreenPartyBranchData(@Param("lists") List<ScreenPartyBranchDataFormDTO> lists);
}

29
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<ScreenPartyLinkMas
* @Date 10:52 2020-08-18
**/
void batchInsertPartyLinkMassesData(@Param("list") List<PartyLinkMassesDataFormDTO> list, @Param("customerId")String customerId);
/**
* @Description 批量插入党员联系群众数据
* @param lists
* @author zxc
* @date 2020/9/24 6:06 下午
*/
void insertScreenPartyLinkMassesData(@Param("lists")List<ScreenPartyLinkMassesDataFormDTO> 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<String> orgIds);
/**
* @Description 查询党员联系群众信息
* @Param customerId
* @Param monthId
* @Param agencyId
* @author zxc
* @date 2020/9/25 1:19 下午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyLinkMassesInfo(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("agencyId") String agencyId);
}

10
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<FactOriginG
* @date 2020.09.23 16:30
**/
boolean insertExtractedData(boolean isFirst,String customerId,String dateId,List<FactOriginGroupMainDailyDTO> originGroupData,List<ExtractGroupMemberActionRecordResultDTO> memberList);
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/25 9:46 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId,String monthId,List<String> gridIds);
}

18
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<FactOri
return true;
}
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/25 9:46 上午
*/
@Override
public List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, String monthId,List<String> gridIds) {
if (!CollectionUtils.isEmpty(gridIds)){
return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds);
}
return new ArrayList<>();
}
}

4
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);
}

3
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<String> agencyIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
List<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(agencyIds);
List<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(orgIds);
List<UserCountResultDTO> userCountList = userGridDailyService.selectUserCount(customerId, dateId);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();

233
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<CustomerAgencyInfoResultDTO> agencyIdList = agencyService.selectAllAgencyId(customerId);
if (!CollectionUtils.isEmpty(agencyIdList)){
// 根据组织级别分组
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel));
if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){
// 社区级别
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY);
disPose(customerGridInfoList,true,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.STREET)){
// 街道级别
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.STREET);
disPose(customerGridInfoList,false,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){
// 区级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT);
disPose(customerGridInfoList,false,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.CITY)){
// 市级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.CITY);
disPose(customerGridInfoList,false,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){
// 省级
List<CustomerAgencyInfoResultDTO> 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<CustomerAgencyInfoResultDTO> agencyIdList, Boolean isGrid, String customerId, String monthId) {
List<ScreenPartyLinkMassesDataFormDTO> result = new ArrayList<>();
if (!CollectionUtils.isEmpty(agencyIdList)){
List<String> 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<String, List<ScreenPartyLinkMassesDataFormDTO>> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId));
groupByAgency.forEach((agencyId,gridList) -> {
ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO();
List<OrgNameResultDTO> 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<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(orgIds);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
List<String> disGridIds = new ArrayList<>();
directGridIds.forEach(grid -> {
if (agencyId.equals(grid.getAgencyId())){
disGridIds.add(grid.getGridId());
}
});
// 不为空 存在直属网格
if (!CollectionUtils.isEmpty(disGridIds)){
List<ScreenPartyLinkMassesDataFormDTO> gridResult = new ArrayList<>();
List<ScreenPartyLinkMassesDataFormDTO> partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds);
List<OrgNameResultDTO> 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<ScreenPartyLinkMassesDataFormDTO> screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds);
List<ScreenPartyLinkMassesDataFormDTO> 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<String, Object> agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId);
List<String> gridIds = (List<String>) agencyMap.get(agencyId);
List<ScreenPartyLinkMassesDataFormDTO> partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, gridIds);
List<String> orgIds = partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList());
List<OrgNameResultDTO> 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<ScreenPartyLinkMassesDataFormDTO> result, String customerId, String monthId, List<String> orgIds){
List<ScreenPartyLinkMassesDataFormDTO> screenPartyLinkMassesAgencyList = agencyService.selectAllAgencyIdToPartyLinkMessage(customerId, monthId);
List<ScreenPartyLinkMassesDataFormDTO> resultList = gridService.selectAllGridIdToPartyLinkMessage(customerId, monthId);
resultList.addAll(screenPartyLinkMassesAgencyList);
List<ScreenPartyLinkMassesDataFormDTO> 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<List<ScreenPartyLinkMassesDataFormDTO>> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
linkMassesDataService.insertScreenPartyLinkMassesData(p);
});
}
// TODO 党员志愿服务【参与人数,组织次数】
}

10
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<PartyBaseInfoFormDTO> selectAllAgencyIdToParty(String customerId,String dateId);
/**
* @Description 查询客户下所有机关ID
* @Param customerId
* @Param dateId
* @author zxc
* @date 2020/9/25 10:39 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectAllAgencyIdToPartyLinkMessage(String customerId, String dateId);
/**
* @Description 查询org名称网格
* @param gridIds

10
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<ScreenCustomerGri
*/
List<PartyBaseInfoFormDTO> selectAllGridIdToParty(String customerId, String dateId);
/**
* @Description 查询客户下所有网格ID
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 10:43 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectAllGridIdToPartyLinkMessage(String customerId, String monthId);
/**
* @Description 查询机关的直属网格
* @param agencyIds

11
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<ScreenPartyBranchDataEntity> {
/**
* @Description 插入建设情况数据
* @param lists
* @author zxc
* @date 2020/9/25 9:16 上午
*/
void insertScreenPartyBranchData(List<ScreenPartyBranchDataFormDTO> lists);
}

31
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<ScreenPartyLinkMassesDataEntity> {
/**
* @Description 批量插入党员联系群众数据
* @param lists
* @author zxc
* @date 2020/9/24 6:06 下午
*/
void insertScreenPartyLinkMassesData(List<ScreenPartyLinkMassesDataFormDTO> lists);
/**
* @Description 删除旧的党员联系群众
* @param customerId
* @param monthId
* @param orgIds
* @author zxc
* @date 2020/9/22 3:28 下午
*/
Integer deleteOldPartyLinkInfo(String customerId, String monthId, List<String> orgIds);
/**
* @Description 查询党员联系群众信息
* @Param customerId
* @Param monthId
* @Param agencyId
* @author zxc
* @date 2020/9/25 1:19 下午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyLinkMassesInfo(String customerId, String monthId,String agencyId);
}

13
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<ScreenPartyLinkMassesDataFormDTO> selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId) {
return screenCustomerAgencyDao.selectAllAgencyIdToPartyLinkMessage(customerId, monthId);
}
/**
* @Description 查询org名称
* @param gridIds

13
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<ScreenCustome
return screenCustomerGridDao.selectAllGridIdToParty(customerId, dateId);
}
/**
* @Description 查询客户下所有网格ID
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 10:43 上午
*/
@Override
public List<ScreenPartyLinkMassesDataFormDTO> selectAllGridIdToPartyLinkMessage(String customerId, String monthId) {
return screenCustomerGridDao.selectAllGridIdToPartyLinkMessage(customerId, monthId);
}
/**
* @Description 查询机关的直属网格
* @param agencyIds

17
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<ScreenPartyBranchDataDao, ScreenPartyBranchDataEntity> implements ScreenPartyBranchDataService {
/**
* @Description 插入建设情况数据
* @param lists
* @author zxc
* @date 2020/9/25 9:16 上午
*/
@Override
public void insertScreenPartyBranchData(List<ScreenPartyBranchDataFormDTO> lists) {
if (!CollectionUtils.isEmpty(lists)){
baseDao.insertScreenPartyBranchData(lists);
}
}
}

45
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<ScreenPartyLinkMassesDataDao, ScreenPartyLinkMassesDataEntity> implements ScreenPartyLinkMassesDataService {
/**
* @Description 批量插入党员联系群众数据
* @param lists
* @author zxc
* @date 2020/9/24 6:06 下午
*/
@Override
public void insertScreenPartyLinkMassesData(List<ScreenPartyLinkMassesDataFormDTO> 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<String> 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<ScreenPartyLinkMassesDataFormDTO> selectPartyLinkMassesInfo(String customerId, String monthId, String agencyId) {
return baseDao.selectPartyLinkMassesInfo(customerId, monthId, agencyId);
}
}

26
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml

@ -238,4 +238,30 @@
m.GROUP_ID =#{groupId}
</foreach>
</select>
<!-- 查询党员建组信息 -->
<select id="selectPartyCreateGroupInfo" resultType="com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO">
SELECT
COUNT( ID ) AS createGroupTotal,
SUM( MEMBER_TOTAL ) AS groupUserTotal,
GRID_ID AS orgId,
'grid' AS orgType,
CUSTOMER_ID,
AGENCY_ID AS parentId,
MONTH_ID AS dataEndTime
FROM
fact_origin_group_main_daily
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND GROUP_STATE = 'approved'
AND
(
<foreach collection="gridIds" item="gridId" separator=" OR ">
grid_id = #{gridId}
</foreach>
)
GROUP BY GRID_ID
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml

@ -194,6 +194,7 @@
org_id = #{orgId}
</foreach>
)
LIMIT 1000
</delete>
</mapper>

16
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml

@ -304,4 +304,20 @@
</foreach>
)
</select>
<!-- 查询客户下所有机关ID -->
<select id="selectAllAgencyIdToPartyLinkMessage" resultType="com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO">
SELECT
agency_id as orgId,
'agency' AS orgType,
AGENCY_NAME AS orgName,
CUSTOMER_ID AS customerId,
PID AS parentId,
#{monthId} AS dataEndTime
FROM
screen_customer_agency
WHERE
del_flag = '0'
AND CUSTOMER_ID = #{customerId}
</select>
</mapper>

16
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}
</select>
<!-- 查询客户下所有网格ID -->
<select id="selectAllGridIdToPartyLinkMessage" resultType="com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO">
SELECT
grid_id as orgId,
'grid' AS orgType,
grid_name AS orgName,
CUSTOMER_ID AS customerId,
PARENT_AGENCY_ID AS parentId,
#{monthId} AS dataEndTime
FROM
screen_customer_grid
WHERE
del_flag = '0'
AND CUSTOMER_ID = #{customerId}
</select>
</mapper>

51
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml

@ -58,4 +58,55 @@
)
</foreach>
</insert>
<!-- 插入建设情况数据 -->
<insert id="insertScreenPartyBranchData">
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
<foreach collection="lists" item="item" separator=",">
(
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()
)
</foreach>
</insert>
</mapper>

60
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml

@ -9,6 +9,41 @@
limit 1000;
</delete>
<!-- 删除旧的党员联系群众 -->
<delete id="deleteOldPartyLinkInfo">
delete from screen_party_link_masses_data
where CUSTOMER_ID = #{customerId}
and DATA_END_TIME = #{monthId}
and
(
<foreach collection="orgIds" item="orgId" separator=" OR ">
org_id = #{orgId}
</foreach>
)
LIMIT 1000
</delete>
<!-- 查询党员联系群众信息 -->
<select id="selectPartyLinkMassesInfo" resultType="com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO">
SELECT
splmd.CUSTOMER_ID,
splmd.ORG_TYPE,
splmd.CREATE_GROUP_TOTAL AS createGroupTotal,
splmd.GROUP_USER_TOTAL AS groupUserTotal,
sca.PID AS parentId,
sca.AGENCY_NAME AS orgName
FROM
screen_party_link_masses_data splmd
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = splmd.PARENT_ID
WHERE
splmd.del_flag = '0'
AND sca.DEL_FLAG = 0
AND splmd.ORG_TYPE = 'agency'
AND splmd.DATA_END_TIME = #{monthId}
AND splmd.CUSTOMER_ID = #{customerId}
AND PARENT_ID = #{agencyId}
</select>
<insert id="batchInsertPartyLinkMassesData" parameterType="map">
insert into screen_party_link_masses_data
(
@ -49,4 +84,29 @@
</foreach>
</insert>
<!-- 批量插入党员联系群众数据 -->
<insert id="insertScreenPartyLinkMassesData">
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
<foreach collection="lists" item="item" separator=",">
(
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}
)
</foreach>
</insert>
</mapper>

Loading…
Cancel
Save