Browse Source

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

master
wxz 4 years ago
parent
commit
9fe9e3f89a
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java
  2. 27
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java
  3. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java
  4. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  5. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java
  6. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  7. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
  8. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java
  9. 77
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java
  10. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java
  11. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.16__add_shiftIssue.sql
  12. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml
  13. 14
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml
  14. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java

@ -82,5 +82,8 @@ public interface StrConstant {
String MAX="MAX";
//青岛体悟实训客户
String SPECIAL_CUSTOMER = "150282ed25c14ff0785e7e06283b6283";
//平音客户
String PY_CUSTOMER = "6f203e30de1a65aab7e69c058826cd80";
}

27
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java

@ -199,6 +199,15 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
for(UserSubAgencyResultDTO m:dimList){
logger.info("机关名:"+m.getName()+",总数="+m.getTotal());
}
//2021.5.25 平音客户热心居民改网格员 sun start
if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) {
dimList.forEach(d->{
if("热心居民".equals(d.getType())){
d.setType("网格员");
}
});
}
//2021.5.25 平音客户热心居民改网格员 sun end
return dimList;
}
@ -323,6 +332,15 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
for(UserSubGridResultDTO m:dimList){
logger.info("网格名:"+m.getName()+",总数="+m.getTotal());
}
//2021.5.25 平音客户热心居民改网格员 sun start
if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) {
dimList.forEach(d->{
if("热心居民".equals(d.getType())){
d.setType("网格员");
}
});
}
//2021.5.25 平音客户热心居民改网格员 sun end
return dimList;
}
@ -488,6 +506,15 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
party.setValue(userIncrTrendResDTO.getPartymemberIncr());
resultList.add(party);
}
//2021.5.25 平音客户热心居民改网格员 sun start
if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) {
resultList.forEach(d->{
if("热心居民".equals(d.getType())){
d.setType("网格员");
}
});
}
//2021.5.25 平音客户热心居民改网格员 sun end
return resultList;
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java

@ -106,6 +106,14 @@ public interface FactOriginTopicMainDailyDao extends BaseDao<FactOriginTopicMain
**/
void updateFactOriginTopicMain(@Param("topicId")String topicId,@Param("topicStatus")String topicStatus,@Param("closedStatus")String closedStatus);
/**
* @Description 修改话题主标的 SHIFT_ISSUE 字段 = 1
* @Param topicIds
* @author zxc
* @date 2021/5/25 3:20 下午
*/
void updateTopicMainStatus(@Param("topicIds") List<String> topicIds);
/**
* @return java.lang.Integer
* @param customerId

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -213,4 +213,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
* @date 2021/5/8 9:03 上午
*/
List<AgencyMonthCountResultDTO> selectAllOrgByCustomerId(@Param("customerId")String customerId);
/**
* @Description 查询顶级组织ID
* @Param customerId
* @author zxc
* @date 2021/5/24 9:42 上午
*/
ScreenCustomerAgencyEntity selectTopAgency(@Param("customerId")String customerId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java

@ -65,4 +65,14 @@ public interface ScreenProjectCategoryOrgDailyDao extends BaseDao<ScreenProjectC
*/
List<CategoryProjectResultDTO> selectOrgCategoryMoreCustomerInfo(@Param("customerIds")List<String> customerIds, @Param("dateId") String dateId,
@Param("level")String level, @Param("customerId")String customerId, @Param("existsStatus")Boolean existsStatus);
/**
* @Description 根据客户ID天ID组织ID删除旧数据
* @Param customerId
* @Param dateId
* @Param orgIds
* @author zxc
* @date 2021/5/21 3:26 下午
*/
int deleteAppointData(@Param("customerId") String customerId, @Param("dateId") String dateId,@Param("orgIds")List<String> orgIds);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java

@ -40,6 +40,7 @@ import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDaily
import com.epmet.service.org.CustomerGridService;
import com.epmet.service.topic.TopicService;
import com.epmet.service.user.UserService;
import com.epmet.util.ModuleConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -91,6 +92,7 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
Map<String, Object> map = this.constructFactOriginData(topicOriginInfoList, gridMap);
List<FactOriginTopicMainDailyEntity> mainDailyEntityList = (List<FactOriginTopicMainDailyEntity>) map.get("main");
List<FactOriginTopicLogDailyEntity> logDailyEntityList = (List<FactOriginTopicLogDailyEntity>) map.get("log");
List<String> topicIds = (List<String>) map.get(ModuleConstant.NEED_UPDATE_STATUS_TOPIC);
//删除之前统计的数据
deleteFactOriginData(customerId,dateId);
//批量保存主表
@ -99,6 +101,8 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
saveFactOriginTopicLogDailyEntity(logDailyEntityList);
//更新主表的状态状态、关闭状态
updateFactOriginTopicMain(topicService.queryUpdateTopicOriginInfoList(customerId, dateId));
// 更新主表的转议题状态
updateTopicMainStatus(topicIds);
return true;
}
@ -117,6 +121,18 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
});
}
/**
* @Description 修改话题主标的 SHIFT_ISSUE 字段 = 1
* @Param topicIds
* @author zxc
* @date 2021/5/25 3:18 下午
*/
private void updateTopicMainStatus(List<String> topicIds){
if (!CollectionUtils.isEmpty(topicIds)){
baseDao.updateTopicMainStatus(topicIds);
}
}
private Map<String, GridInfoDTO> getGridInfoMap(String customerId) {
Map<String ,GridInfoDTO> map=new HashMap<>();
@ -172,12 +188,13 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
List<String> userIds = topicOriginInfoList.stream().map(topic -> topic.getOperateUserId()).distinct().collect(Collectors.toList());
Map<String,Integer> userIsPartyMap = userService.selectUserIsParty(userIds);
List<String> topicIds = new ArrayList<>();
for(TopicOriginInfoDTO topicOriginInfoDTO:topicOriginInfoList){
GridInfoDTO gridInfoDTO=gridMap.get(topicOriginInfoDTO.getGridId());
if(null==gridInfoDTO){
log.error("没有找到 gridId="+topicOriginInfoDTO.getGridId()+" 的基本信息");
log.warn("没有找到 gridId="+topicOriginInfoDTO.getGridId()+" 的基本信息");
// continue;
throw new RenException("xxxxxx");
throw new RenException("gridInfoDTO is null gridId="+topicOriginInfoDTO.getGridId());
}
// 一年的第几周
String weekId = DateUtils.format(topicOriginInfoDTO.getOriginalBusinessTime(), DateUtils.DATE_PATTERN_YYYY).concat("W").concat(String.valueOf(DateUtils.getWeekOfYear(topicOriginInfoDTO.getOriginalBusinessTime())));
@ -219,9 +236,13 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
logDailyEntity.setOperateUserIsParty(false);
}
logDailyEntityList.add(logDailyEntity);
if (topicOriginInfoDTO.getActionCode().equals(ModuleConstant.TOPIC_STATUS_SHIFT_ISSUE)){
topicIds.add(topicOriginInfoDTO.getTopicId());
}
}
map.put("main",mainDailyEntityList);
map.put("log",logDailyEntityList);
map.put(ModuleConstant.NEED_UPDATE_STATUS_TOPIC,topicIds);
return map;
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java

@ -106,4 +106,12 @@ public interface ScreenCustomerAgencyService{
* @date 2020/9/24 1:27 下午
*/
List<OrgNameResultDTO> selectOrgNameAgency(List<String> agencyIds);
/**
* @Description 查询顶级组织ID
* @Param customerId
* @author zxc
* @date 2021/5/24 9:42 上午
*/
ScreenCustomerAgencyEntity selectTopAgency(String customerId);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java

@ -256,5 +256,16 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
return screenCustomerAgencyDao.selectAllAgencyId(customerId);
}
/**
* @Description 查询顶级组织ID
* @Param customerId
* @author zxc
* @date 2021/5/24 9:42 上午
*/
@Override
public ScreenCustomerAgencyEntity selectTopAgency(String customerId) {
return screenCustomerAgencyDao.selectTopAgency(customerId);
}
}

77
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java

@ -36,6 +36,7 @@ import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO;
import com.epmet.dto.screen.result.CategoryProjectResultDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.crm.CustomerRelationEntity;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity;
import com.epmet.service.crm.CustomerRelationService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService;
@ -179,6 +180,12 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
* 1.查自己客户分类标签统计
* 2.查询子级客户分类标签分为 epmet_category_code is null is not nullpid = '0'跟父客户对比同类标签项目数累加不同直接添加到父客户
* 加入直属网格
*
* 2021-05-21新注释
* 1.查询客户自己的分类标签
* 2.查询子客户的分类标签把子客户分类标签一样的累加
* 3.子客户累加后的跟父客户对比 categoryCode一样累加到父客户不一样直接添加到父客户agencyId一并改为父客户的
* 4.父客户数据处理好在存储一套子客户数据
*/
disposeMoreCustomer(customerId,dateId,relationInfo);
}
@ -254,16 +261,19 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
});
Map<Boolean, List<CategoryProjectResultDTO>> groupByStatus = categoryProjectGrid.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus));
List<CategoryProjectResultDTO> categoryProjectResultDTOS1 = groupByStatus.get(false);
if (!CollectionUtils.isEmpty(categoryProjectResultDTOS1)) categoryProjectResultDTOS.addAll(categoryProjectResultDTOS1);
if (!CollectionUtils.isEmpty(categoryProjectResultDTOS1)) {
categoryProjectResultDTOS.addAll(categoryProjectResultDTOS1);
}
}
}
result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class);
}
// 组织项目分类 项目数
List<String> orgIds = new ArrayList<>();
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel));
List<CustomerAgencyInfoResultDTO> levelAgencyInfo = groupByLevel.get(level);
if (!CollectionUtils.isEmpty(levelAgencyInfo)){
List<String> orgIds = levelAgencyInfo.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
orgIds = levelAgencyInfo.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
List<ScreenProjectCategoryGridDailyDTO> screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds,customerId);
if (!CollectionUtils.isEmpty(result)){
if (!CollectionUtils.isEmpty(screenProjectCategory)){
@ -291,7 +301,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
result.forEach(r -> {r.setOrgType(level);r.setDateId(dateId);});
}
}
deleteAndInsert(customerId,dateId,result);
deleteAndInsert(customerId,dateId,result,orgIds);
}
/**
@ -349,15 +359,18 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
result = ConvertUtils.sourceToTarget(categoryInfos, ScreenProjectCategoryOrgDailyEntity.class);
}
}else {
// 根据客户ID,时间,组织级别查询 分类标签
List<CategoryProjectResultDTO> categoryProjectResultDTOS = baseDao.selectOrgCategoryInfo(customerId, dateId, level);
List<ScreenCustomerGridDTO> belongGridInfos = gridService.selectBelongGridInfo(customerId, level);
if (!CollectionUtils.isEmpty(belongGridInfos)){
// 存在直属网格
List<String> gridIds = belongGridInfos.stream().map(m -> m.getGridId()).collect(Collectors.toList());
// 根据网格ID查询分类标签
List<CategoryProjectResultDTO> categoryProjectGrid = gridDailyDao.selectCategoryInfo(customerId, dateId, level, gridIds);
if (!CollectionUtils.isEmpty(categoryProjectGrid)){
categoryProjectResultDTOS.forEach(agency -> {
categoryProjectGrid.forEach(grid -> {
// 组织ID 和 分类标签code一样时,项目数累加
if (agency.getOrgId().equals(grid.getOrgId()) && agency.getCategoryCode().equals(grid.getCategoryCode())){
agency.setProjectTotal(agency.getProjectTotal() + grid.getProjectTotal());
grid.setStatus(true);
@ -365,17 +378,57 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
});
});
Map<Boolean, List<CategoryProjectResultDTO>> groupByStatus = categoryProjectGrid.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus));
// 取出分类标签code同agency级别不一样的数据
List<CategoryProjectResultDTO> categoryProjectResultDTOS1 = groupByStatus.get(false);
categoryProjectResultDTOS.addAll(categoryProjectResultDTOS1);
}
}
result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class);
/**
* 查询父子客户所有的分类根据分类分组然后把agencyId统一换成父客户的
* 在保存一份子客户自己agencyId的
*/
if (ScreenConstant.DISTRICT.equals(level)){
// 查询 平阴的agencyId
ScreenCustomerAgencyEntity entity = agencyService.selectTopAgency(customerId);
// 子级客户ID
List<String> customerIds = relationInfo.stream().map(m -> m.getCustomerId()).collect(Collectors.toList());
// 父客户存在的分类
List<CategoryProjectResultDTO> categoryProjectExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, true);
// 父客户不存在的分类
List<CategoryProjectResultDTO> categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, false);
// 子级客户的分类标签数据
List<CategoryProjectResultDTO> sonResult = new ArrayList<>();
if (!CollectionUtils.isEmpty(categoryProjectExists)){
categoryProjectResultDTOS.addAll(categoryProjectExists);
sonResult.addAll(categoryProjectExists);
}
if (!CollectionUtils.isEmpty(categoryProjectNotExists)){
categoryProjectResultDTOS.addAll(categoryProjectNotExists);
sonResult.addAll(categoryProjectNotExists);
}
// 此时的 'categoryProjectResultDTOS' 等于 父子客户所有的分类标签
Map<String, List<CategoryProjectResultDTO>> groupByCategoryCode = categoryProjectResultDTOS.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getCategoryCode));
// 这时的result集合要清空,因为被上边使用 【result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class);】
result.clear();
List<ScreenProjectCategoryOrgDailyEntity> finalResult = result;
groupByCategoryCode.forEach((code, list) -> {
ScreenProjectCategoryOrgDailyEntity e = new ScreenProjectCategoryOrgDailyEntity();
e.setCustomerId(customerId);
e.setCategoryCode(code);
e.setOrgId(entity.getAgencyId());
e.setProjectTotal(CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.stream().collect(Collectors.summingInt(CategoryProjectResultDTO::getProjectTotal)));
e.setPid(entity.getPid());
e.setPids(StringUtils.isEmpty(entity.getPids()) ? NumConstant.ZERO_STR : entity.getPids());
// 因为根据categoryCode分组,所以level都一样,取第一条的
e.setLevel(list.get(NumConstant.ZERO).getLevel());
finalResult.add(e);
});
if (!CollectionUtils.isEmpty(sonResult)){
List<ScreenProjectCategoryOrgDailyEntity> entities = ConvertUtils.sourceToTarget(sonResult, ScreenProjectCategoryOrgDailyEntity.class);
result.addAll(entities);
}
/*if (!CollectionUtils.isEmpty(categoryProjectExists)){
result.forEach(r -> {
categoryProjectExists.forEach(c -> {
if (r.getCategoryCode().equals(c.getCategoryCode())){
@ -391,19 +444,19 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
result.addAll(f);
}
}
// 父客户不存在的分类
List<CategoryProjectResultDTO> categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, false);
if (!CollectionUtils.isEmpty(categoryProjectNotExists)){
List<ScreenProjectCategoryOrgDailyEntity> notExists = ConvertUtils.sourceToTarget(categoryProjectNotExists, ScreenProjectCategoryOrgDailyEntity.class);
result.addAll(notExists);
}
}*/
}
}
// 目前不考虑计算子客户组织直接创建的项目,只算内部客户
List<String> orgIds = new ArrayList<>();
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel));
List<CustomerAgencyInfoResultDTO> levelAgencyInfo = groupByLevel.get(level);
if (!CollectionUtils.isEmpty(levelAgencyInfo)) {
List<String> orgIds = levelAgencyInfo.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
orgIds = levelAgencyInfo.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
// 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】
List<ScreenProjectCategoryGridDailyDTO> screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds, customerId);
if (!CollectionUtils.isEmpty(result)) {
if (!CollectionUtils.isEmpty(screenProjectCategory)) {
@ -416,6 +469,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
});
});
Map<Boolean, List<ScreenProjectCategoryGridDailyDTO>> groupByStatus = screenProjectCategory.stream().collect(Collectors.groupingBy(ScreenProjectCategoryGridDailyDTO::getStatus));
// 取出没有累加过的数据
List<ScreenProjectCategoryGridDailyDTO> screenProjectCategoryNoCal = groupByStatus.get(false);
if (!CollectionUtils.isEmpty(screenProjectCategoryNoCal)) {
List<ScreenProjectCategoryOrgDailyEntity> noCalCategory = ConvertUtils.sourceToTarget(screenProjectCategoryNoCal, ScreenProjectCategoryOrgDailyEntity.class);
@ -434,7 +488,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
});
}
}
deleteAndInsert(customerId,dateId,result);
deleteAndInsert(customerId,dateId,result,orgIds);
}
/**
@ -445,13 +499,16 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
* @date 2021/3/23 上午10:52
*/
@Transactional(rollbackFor = Exception.class)
public void deleteAndInsert(String customerId, String dateId, List<ScreenProjectCategoryOrgDailyEntity> needInsert){
public void deleteAndInsert(String customerId, String dateId, List<ScreenProjectCategoryOrgDailyEntity> needInsert,List<String> orgIds){
if (CollectionUtils.isEmpty(needInsert)){
return;
}
if (CollectionUtils.isEmpty(orgIds)){
return;
}
Integer row = NumConstant.ZERO;
do {
row = baseDao.deleteByDateIdAndCustomerId(customerId, dateId);
row = baseDao.deleteAppointData(customerId, dateId,orgIds);
}while (row > NumConstant.ZERO && row == NumConstant.ONE_THOUSAND);
List<List<ScreenProjectCategoryOrgDailyEntity>> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java

@ -39,4 +39,8 @@ public interface ModuleConstant {
String EXCEPTION_DING_INTERCEPTOR_PREFIX_TOPIC_STATISTICAL = "topicStats";
String LOG_WARN_NO_AGENCY_MESSAGE = "没有相应的机关集合";
String TOPIC_STATUS_SHIFT_ISSUE = "shift_issue";
String NEED_UPDATE_STATUS_TOPIC = "needUpdateStatusTopic";
}

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.16__add_shiftIssue.sql

@ -0,0 +1 @@
ALTER TABLE `fact_origin_topic_main_daily` ADD `SHIFT_ISSUE` tinyint(1) NOT NULL default '0' COMMENT '是否转为议题,0:false,1:true' AFTER `CREATE_TOPIC_USER_IS_PARTY`;

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -139,6 +139,19 @@
where id = #{topicId}
</update>
<!-- 修改话题主标的 SHIFT_ISSUE 字段 = 1 -->
<update id="updateTopicMainStatus">
UPDATE fact_origin_topic_main_daily
SET SHIFT_ISSUE = 1,
UPDATED_TIME = NOW()
WHERE 1=1
AND (
<foreach collection="topicIds" item="topicId" separator=" OR ">
ID = #{topicId}
</foreach>
)
</update>
<!-- 在当前组织下,发布的话题总数,也可以单独筛选党员 -->
<select id="getAgencyPartyTopicTotal" parameterType="map" resultType="java.lang.Integer">
SELECT

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

@ -426,4 +426,18 @@
(SELECT GRID_ID AS orgId FROM screen_customer_grid WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId}) UNION ALL
(SELECT DEPT_ID AS orgId FROM screen_customer_dept WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId})
</select>
<!-- 查询顶级组织ID -->
<select id="selectTopAgency" resultType="com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity">
SELECT
AGENCY_ID,
PID,
PIDS
FROM
screen_customer_agency
WHERE
DEL_FLAG = '0'
AND PID = '0'
AND CUSTOMER_ID = #{customerId}
</select>
</mapper>

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml

@ -9,6 +9,19 @@
limit 1000
</delete>
<!-- 根据客户ID,天ID,组织ID删除旧数据 -->
<delete id="deleteAppointData">
delete from screen_project_category_org_daily
where customer_id = #{customerId}
and date_id = #{dateId}
and (
<foreach collection="orgIds" item="orgId" separator=" OR ">
ORG_ID = #{orgId}
</foreach>
)
limit 1000
</delete>
<!-- 查询组织分类信息 -->
<select id="selectOrgCategoryInfo" resultType="com.epmet.dto.screen.result.CategoryProjectResultDTO">
SELECT

Loading…
Cancel
Save