22 changed files with 892 additions and 0 deletions
@ -0,0 +1,70 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.group; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 活动类别字典 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-04-16 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ActCategoryDictDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 类别编码 |
||||
|
*/ |
||||
|
private String categoryCode; |
||||
|
|
||||
|
/** |
||||
|
* 活动类别名称;eg:支部建设、联建共建 |
||||
|
*/ |
||||
|
private String categoryName; |
||||
|
|
||||
|
/** |
||||
|
* 等级1,2...... |
||||
|
*/ |
||||
|
private Integer level; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 上级类别编码 |
||||
|
*/ |
||||
|
private String parentCode; |
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao.evaluationindex.extract; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-13 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactGroupActDailyDao extends BaseDao<FactGroupActDailyEntity> { |
||||
|
|
||||
|
int deleteBatch(@Param("customerId") String customerId, |
||||
|
@Param("dateId") String dateId, |
||||
|
@Param("limit") Integer limit, |
||||
|
@Param("orgType")String orgType); |
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao.evaluationindex.extract; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-13 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactGroupActMonthlyDao extends BaseDao<FactGroupActMonthlyEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,100 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity.evaluationindex.extract; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-13 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("fact_group_act_daily") |
||||
|
public class FactGroupActDailyEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 数据更新至日期Id:yyyyMMdd |
||||
|
*/ |
||||
|
private String dateId; |
||||
|
|
||||
|
/** |
||||
|
* 网格id |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* 网格:grid;组织:agency |
||||
|
*/ |
||||
|
private String orgType; |
||||
|
|
||||
|
/** |
||||
|
* 1)orgType=grid: pid=网格所属组织id; |
||||
|
2)orgType=agency: pid=当前组织的上级组织 |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* 1)orgType=grid: pids=网格所有上级组织,包括pid; |
||||
|
2)orgType=agency: pids=当前组织的所有上级组织,包括pid. |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 活动分类编码 |
||||
|
*/ |
||||
|
private String categoryCode; |
||||
|
|
||||
|
/** |
||||
|
* 上级分类编码 |
||||
|
*/ |
||||
|
private String parentCode; |
||||
|
|
||||
|
/** |
||||
|
* 分类等级 |
||||
|
*/ |
||||
|
private Integer level; |
||||
|
|
||||
|
/** |
||||
|
* 截止到dateId: 组织次数;包含dateId这一天的数据 |
||||
|
*/ |
||||
|
private Integer organizeTotal; |
||||
|
|
||||
|
/** |
||||
|
* 截止到dateId: 参加人数;包含dateId这一天的数据 |
||||
|
*/ |
||||
|
private Integer participateUserTotal; |
||||
|
|
||||
|
/** |
||||
|
* 截止到dateId: 平均参加人数;包含dateId这一天的数据 |
||||
|
*/ |
||||
|
private Integer avgParticipateUserTotal; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,100 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity.evaluationindex.extract; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-13 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("fact_group_act_monthly") |
||||
|
public class FactGroupActMonthlyEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 数据维度:yyyyMM |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 网格id |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* 网格:grid;组织:agency |
||||
|
*/ |
||||
|
private String orgType; |
||||
|
|
||||
|
/** |
||||
|
* 1)orgType=grid: pid=网格所属组织id; |
||||
|
2)orgType=agency: pid=当前组织的上级组织 |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* 1)orgType=grid: pids=网格所有上级组织,包括pid; |
||||
|
2)orgType=agency: pids=当前组织的所有上级组织,包括pid. |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 活动分类编码 |
||||
|
*/ |
||||
|
private String categoryCode; |
||||
|
|
||||
|
/** |
||||
|
* 上级分类编码 |
||||
|
*/ |
||||
|
private String parentCode; |
||||
|
|
||||
|
/** |
||||
|
* 分类等级 |
||||
|
*/ |
||||
|
private Integer level; |
||||
|
|
||||
|
/** |
||||
|
* 本月内:活动组织次数 |
||||
|
*/ |
||||
|
private Integer organizeIncr; |
||||
|
|
||||
|
/** |
||||
|
* 本月内:活动签到人数参加人数 |
||||
|
*/ |
||||
|
private Integer participateUserIncr; |
||||
|
|
||||
|
/** |
||||
|
* 本月内:平均参加人数 |
||||
|
*/ |
||||
|
private Integer avgParticipateUserIncr; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.evaluationindex.extract.todata; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; |
||||
|
|
||||
|
/** |
||||
|
* 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-13 |
||||
|
*/ |
||||
|
public interface FactGroupActDailyService extends BaseService<FactGroupActDailyEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 当前客户截止到dateId,网格下 各个分类的 参加人数,组织次数,平均参加人数 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param dateId |
||||
|
* @return |
||||
|
*/ |
||||
|
void extractGridGroupActDaily(String customerId, String dateId); |
||||
|
|
||||
|
/** |
||||
|
* 当前客户截止到dateId,组织下 各个分类的 参加人数,组织次数,平均参加人数 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param dateId |
||||
|
* @return |
||||
|
*/ |
||||
|
void extractAgencyGroupActDaily(String customerId, String dateId); |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.evaluationindex.extract.todata; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; |
||||
|
|
||||
|
/** |
||||
|
* 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-13 |
||||
|
*/ |
||||
|
public interface FactGroupActMonthlyService extends BaseService<FactGroupActMonthlyEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,165 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.evaluationindex.extract.todata.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.dao.evaluationindex.extract.FactGroupActDailyDao; |
||||
|
import com.epmet.dto.group.ActCategoryDictDTO; |
||||
|
import com.epmet.dto.org.GridInfoDTO; |
||||
|
import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; |
||||
|
import com.epmet.entity.org.CustomerAgencyEntity; |
||||
|
import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService; |
||||
|
import com.epmet.service.group.GroupDataService; |
||||
|
import com.epmet.service.org.CustomerAgencyService; |
||||
|
import com.epmet.service.org.CustomerGridService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-13 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@DataSource(DataSourceConstant.STATS) |
||||
|
@Service |
||||
|
public class FactGroupActDailyServiceImpl extends BaseServiceImpl<FactGroupActDailyDao, FactGroupActDailyEntity> implements FactGroupActDailyService { |
||||
|
|
||||
|
@Autowired |
||||
|
private GroupDataService groupDataService; |
||||
|
@Autowired |
||||
|
private CustomerAgencyService customerAgencyService; |
||||
|
@Autowired |
||||
|
private CustomerGridService customerGridService; |
||||
|
|
||||
|
/** |
||||
|
* 当前客户截止到dateId,网格下 各个分类的 参加人数,组织次数,平均参加人数 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param dateId |
||||
|
* @return |
||||
|
*/ |
||||
|
@Override |
||||
|
public void extractGridGroupActDaily(String customerId, String dateId) { |
||||
|
if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){ |
||||
|
return; |
||||
|
} |
||||
|
// 1、查询出当前客户的组织分类;如果没有直接返回
|
||||
|
List<ActCategoryDictDTO> actCategoryDictDTOList = groupDataService.queryCustomerActCategoryDict(customerId); |
||||
|
if (CollectionUtils.isEmpty(actCategoryDictDTOList)) { |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
// 2、当前客户下所有的网格
|
||||
|
List<GridInfoDTO> gridInfoDTOList=customerGridService.queryGridInfoList(customerId); |
||||
|
// 2、遍历每个分类,查询组织次数、参与人数、平均参与人数
|
||||
|
List<FactGroupActDailyEntity> insertList = new ArrayList<>(); |
||||
|
for(GridInfoDTO gridInfoDTO:gridInfoDTOList){ |
||||
|
|
||||
|
for (ActCategoryDictDTO actCategoryDictDTO : actCategoryDictDTOList) { |
||||
|
List<FactGroupActDailyEntity> list = groupDataService.selectCountGridGroupActDaily(customerId, dateId, actCategoryDictDTO.getCategoryCode(),gridInfoDTO.getGridId()); |
||||
|
if (CollectionUtils.isNotEmpty(list)) { |
||||
|
list.forEach(dto->{ |
||||
|
dto.setCategoryCode(actCategoryDictDTO.getCategoryCode()); |
||||
|
dto.setParentCode(actCategoryDictDTO.getParentCode()); |
||||
|
dto.setLevel(actCategoryDictDTO.getLevel()); |
||||
|
dto.setOrgType("grid"); |
||||
|
dto.setDateId(dateId); |
||||
|
}); |
||||
|
insertList.addAll(list); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 3、批量删除
|
||||
|
int deleteNum; |
||||
|
do { |
||||
|
deleteNum = baseDao.deleteBatch(customerId, dateId, NumConstant.TWO_HUNDRED,"grid"); |
||||
|
} while (deleteNum > NumConstant.ZERO); |
||||
|
|
||||
|
// 4、插入数据
|
||||
|
insertList.forEach(insertEntity -> { |
||||
|
baseDao.insert(insertEntity); |
||||
|
}); |
||||
|
log.info("extractGridGroupActDaily completed"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 当前客户截止到dateId,组织下 各个分类的 参加人数,组织次数,平均参加人数 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param dateId |
||||
|
* @return |
||||
|
*/ |
||||
|
@Override |
||||
|
public void extractAgencyGroupActDaily(String customerId, String dateId) { |
||||
|
// 1、查询出当前客户的组织分类;如果没有直接返回
|
||||
|
List<ActCategoryDictDTO> actCategoryDictDTOList = groupDataService.queryCustomerActCategoryDict(customerId); |
||||
|
if (CollectionUtils.isEmpty(actCategoryDictDTOList)) { |
||||
|
return; |
||||
|
} |
||||
|
// 2、当前客户下所有的组织
|
||||
|
List<CustomerAgencyEntity> agencyEntityList=customerAgencyService.queryAgencyListByCustomerId(customerId); |
||||
|
List<FactGroupActDailyEntity> insertList = new ArrayList<>(); |
||||
|
for(CustomerAgencyEntity agencyEntity:agencyEntityList){ |
||||
|
for(ActCategoryDictDTO categoryDict:actCategoryDictDTOList){ |
||||
|
List<FactGroupActDailyEntity> list = groupDataService.selectCountAgencyGroupActDaily(customerId, |
||||
|
agencyEntity.getId(), |
||||
|
dateId, |
||||
|
categoryDict.getCategoryCode()); |
||||
|
if (CollectionUtils.isNotEmpty(list)) { |
||||
|
list.forEach(dto->{ |
||||
|
dto.setCategoryCode(categoryDict.getCategoryCode()); |
||||
|
dto.setParentCode(categoryDict.getParentCode()); |
||||
|
dto.setLevel(categoryDict.getLevel()); |
||||
|
dto.setOrgId(agencyEntity.getId()); |
||||
|
dto.setOrgType("agency"); |
||||
|
dto.setPid(agencyEntity.getPid()); |
||||
|
dto.setPids(agencyEntity.getPids()); |
||||
|
dto.setDateId(dateId); |
||||
|
}); |
||||
|
insertList.addAll(list); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 3、批量删除
|
||||
|
int deleteNum; |
||||
|
do { |
||||
|
deleteNum = baseDao.deleteBatch(customerId, dateId, NumConstant.TWO_HUNDRED,"agency"); |
||||
|
} while (deleteNum > NumConstant.ZERO); |
||||
|
|
||||
|
// 4、插入数据
|
||||
|
insertList.forEach(insertEntity->{ |
||||
|
baseDao.insert(insertEntity); |
||||
|
}); |
||||
|
log.info("extractAgencyGroupActDaily completed"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.evaluationindex.extract.todata.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.extract.FactGroupActMonthlyDao; |
||||
|
import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; |
||||
|
import com.epmet.service.evaluationindex.extract.todata.FactGroupActMonthlyService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-13 |
||||
|
*/ |
||||
|
@DataSource(DataSourceConstant.STATS) |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class FactGroupActMonthlyServiceImpl extends BaseServiceImpl<FactGroupActMonthlyDao, FactGroupActMonthlyEntity> implements FactGroupActMonthlyService { |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactGroupActDailyDao"> |
||||
|
|
||||
|
<delete id="deleteBatch" parameterType="map"> |
||||
|
delete from fact_group_act_daily |
||||
|
where CUSTOMER_ID = #{customerId} |
||||
|
AND DATE_ID = #{dateId} |
||||
|
and org_type=#{orgType} |
||||
|
limit #{limit} |
||||
|
</delete> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,8 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactGroupActMonthlyDao"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
Loading…
Reference in new issue