|
|
@ -2,50 +2,53 @@ |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.enums.OrgLevelEnum; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.commons.tools.utils.ExcelUtils; |
|
|
|
import com.epmet.dataaggre.constant.DataSourceConstant; |
|
|
|
import com.epmet.dataaggre.constant.OrgConstant; |
|
|
|
import com.epmet.dataaggre.dao.datastats.DataStatsDao; |
|
|
|
import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao; |
|
|
|
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; |
|
|
|
import com.epmet.dataaggre.dto.datastats.form.*; |
|
|
|
import com.epmet.dataaggre.dto.datastats.result.*; |
|
|
|
import com.epmet.dataaggre.constant.OrgConstant; |
|
|
|
import com.epmet.dataaggre.dao.datastats.DataStatsDao; |
|
|
|
import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao; |
|
|
|
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; |
|
|
|
import com.epmet.dataaggre.dto.datastats.form.*; |
|
|
|
import com.epmet.dataaggre.dto.datastats.result.*; |
|
|
|
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; |
|
|
|
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; |
|
|
|
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; |
|
|
|
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; |
|
|
|
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; |
|
|
|
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; |
|
|
|
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; |
|
|
|
import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity; |
|
|
|
import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; |
|
|
|
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; |
|
|
|
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; |
|
|
|
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; |
|
|
|
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; |
|
|
|
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; |
|
|
|
import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity; |
|
|
|
import com.epmet.dataaggre.excel.CustomerDataManageExcel; |
|
|
|
import com.epmet.dataaggre.service.datastats.DataStatsService; |
|
|
|
import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; |
|
|
|
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; |
|
|
|
import com.epmet.dataaggre.service.opercrm.CustomerRelation; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
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 com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; |
|
|
|
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; |
|
|
|
import com.epmet.dataaggre.service.opercrm.CustomerRelation; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
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 javax.servlet.http.HttpServletResponse; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.text.NumberFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.text.NumberFormat; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author sun |
|
|
@ -1899,4 +1902,41 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
return s.toString(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Param formDTO |
|
|
|
* @Description 运营情况数据查询 |
|
|
|
* @author sun |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<CustomerDataManageResultDTO> operateExport(CustomerDataManageFormDTO formDTO) throws ParseException { |
|
|
|
//1.必要参数校验及处理
|
|
|
|
if (!"Interval".equals(formDTO.getType()) && StringUtils.isEmpty(formDTO.getStartTime())) { |
|
|
|
throw new RenException("请选择开始时间或查询累计值"); |
|
|
|
} |
|
|
|
//入参有开始时间的则需要减去一天
|
|
|
|
if (StringUtils.isNotBlank(formDTO.getStartTime())) { |
|
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
|
Date date = format.parse(formDTO.getStartTime()); |
|
|
|
Date yesterday = DateUtils.addDateDays(date, -1); |
|
|
|
formDTO.setStartTime(format.format(yesterday)); |
|
|
|
} |
|
|
|
|
|
|
|
//2.查询组织现在,判断查询下级组织还是网格数据
|
|
|
|
ScreenAgencyOrGridListDTO agencyGrid = indexService.getSubAgencyOrGridList(formDTO.getAgencyId()); |
|
|
|
if (null == agencyGrid) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
List<String> idList; |
|
|
|
if (!"community".equals(agencyGrid.getLevel())) { |
|
|
|
//组织层级用户、群组、话题、议题、项目、巡查数据查询
|
|
|
|
idList = agencyGrid.getAgencyGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getAgencyId).collect(Collectors.toList()); |
|
|
|
} else { |
|
|
|
//网格层级用户、群组、话题、议题、项目、巡查数据查询
|
|
|
|
idList = agencyGrid.getAgencyGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getGridId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
} |
|
|
|
//3.封装数据并返回
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|