修改导出功能

master
bynt 3 years ago
parent d2135f5b78
commit 5429e953a9

@ -10,4 +10,6 @@ public class ResSourceLabel {
private String name;
private Long clueId;
private String remark;
}

@ -135,14 +135,16 @@ public class ReportServiceImpl implements ReportService {
//获取线索名
String clueName = null;
List<String> label = new ArrayList<>();
String remark =null;
if (clueMap.containsKey(key)) {
ResSourceLabel resSourceLabel = clueMap.get(key);
clueName = resSourceLabel.getName();
remark =resSourceLabel.getRemark();
label = JSONUtil.toList(JSONUtil.parseArray(resSourceLabel.getSourceLabel()), String.class);
}
LinkedList<Object> linkedList = getDownLoadTaskInfo(clueName, list);
linkedList.add(remark);
for (String l : baseLabel) {
if (label.size() > 0 && label.contains(l)) {
linkedList.add("√");
@ -416,10 +418,11 @@ public class ReportServiceImpl implements ReportService {
*/
private StatisticalReportDTO getStatisticalReportDTO(StatisticalReportDTO s) {
List<Long> ids = s.getIds();
Long userId = companyService.findById(s.getCompanyId()).getUserId();
s.setUserId(userId);
if (CollUtil.isEmpty(ids)) {
ids = new ArrayList<>();
Long userId = companyService.findById(s.getCompanyId()).getUserId();
s.setUserId(userId);
log.debug("==================== the userId as {} ====================", userId);
getTaskId(ids, userId);
s.setIds(ids);
}
@ -503,7 +506,7 @@ public class ReportServiceImpl implements ReportService {
switch (type) {
case 2:
int betweenDay = (int) DateUtil.between(begin, end, DateUnit.DAY);
for (int i = 1; i <= betweenDay; i++) {
for (int i = 0; i <= betweenDay; i++) {
Date dateTime = DateUtil.offsetDay(begin, i);
List<CallClueInfo> collect = callClueInfos.stream().filter(c -> DateTimeUtil.betweenByDay(dateTime, c.getCreateTime())).collect(Collectors.toList());
map.put(DateTimeUtil.getTimeType(dateTime, type), collect);
@ -517,7 +520,7 @@ public class ReportServiceImpl implements ReportService {
break;
case 1:
int betweenHour = (int) DateUtil.between(begin, end, DateUnit.HOUR);
for (int i = 1; i <= betweenHour; i++) {
for (int i = 0; i <= betweenHour; i++) {
Date dateTime = DateUtil.offsetHour(begin, i);
List<CallClueInfo> collectByHour = callClueInfos.stream().filter(c ->
DateTimeUtil.betweenByHour(dateTime, c.getCreateTime())
@ -559,10 +562,12 @@ public class ReportServiceImpl implements ReportService {
for (Task info : tasks) {
taskInfos.put(info.getId(), info);
}
log.debug("================== the map size as {} ==================", mapByTask.size());
for (Long key : mapByTask.keySet()) {
HashMap<String, Object> mapVo = new HashMap<String, Object>(16);
//按时间分
HashMap<String, List<CallClueInfo>> mapByTime = getGroupByTime(s.getBeginTime(), s.getEndTime(), mapByTask.get(key), s.getType());
log.debug("================== the task json as {} ==================", JSONUtil.toJsonStr(taskInfos.get(key)));
int total = taskInfos.get(key).getTotalNumber();
String taskName = taskInfos.get(key).getTaskName();

@ -18,15 +18,12 @@ package com.baiye.modules.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.text.StrPool;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcelFactory;
import com.baiye.config.properties.FileProperties;
import com.baiye.constant.DefaultNumberConstants;
import com.baiye.exception.BadRequestException;
import com.baiye.exception.EntityExistException;
import com.baiye.exception.EntityNotFoundException;
import com.baiye.model.dto.TreeUserDTO;
import com.baiye.model.dto.UserDto;
import com.baiye.model.dto.UserFavorOfExcel;
@ -34,8 +31,6 @@ import com.baiye.modules.security.service.OnlineUserService;
import com.baiye.modules.system.domain.*;
import com.baiye.modules.system.repository.OrganizeRepository;
import com.baiye.modules.system.repository.OrganizeUserRepository;
import com.baiye.modules.system.service.CompanyService;
import com.baiye.service.UserCacheClean;
import com.baiye.modules.system.repository.RoleRepository;
import com.baiye.modules.system.repository.UserRepository;
import com.baiye.modules.system.service.CompanyService;

@ -111,12 +111,15 @@ public class ExportExcelUtil {
head4.add("外呼总时长(秒)");
List<String> head5 = new ArrayList<>();
head5.add("平均通话时长(秒)");
List<String> head6 = new ArrayList<>();
head6.add("备注");
headList.add(head0);
headList.add(head1);
headList.add(head2);
headList.add(head3);
headList.add(head4);
headList.add(head5);
headList.add(head6);
for (String s : list) {
List<String> head = new ArrayList<>();
head.add(s);

@ -9,7 +9,7 @@ spring:
freemarker:
check-template-location: false
profiles:
active: dev
active: prod
jackson:
time-zone: GMT+8
data:

@ -159,7 +159,7 @@ public class ClueJpa {
public List<ResSourceLabel> findSourceLabel(List<Long> clueIds){
StringBuilder sql = new StringBuilder();
sql.append("select tcm.source_label sourceLabel, clue_id as clueId,tc.name as name from tb_clue_middle tcm LEFT JOIN tb_clue tc on tcm.clue_id = tc.id where 1=1 ");
sql.append("select tcm.source_label sourceLabel, clue_id as clueId,tc.name as name,tcm.remark as remark from tb_clue_middle tcm LEFT JOIN tb_clue tc on tcm.clue_id = tc.id where 1=1 ");
if (clueIds != null && clueIds.size() >0) {
sql.append("AND tcm.clue_id IN (:clueIds) ");
}
@ -177,6 +177,7 @@ public class ClueJpa {
resSourceLabel.setName((String) row.get("name"));
BigInteger clueId = (BigInteger) row.get("clueId");
resSourceLabel.setClueId(clueId.longValue());
resSourceLabel.setSourceLabel((String) row.get("remark"));
list.add(resSourceLabel);
}
return list;

@ -6,7 +6,7 @@ spring:
freemarker:
check-template-location: false
profiles:
active: dev
active: prod
application:
name: @artifactId@
jackson:

Loading…
Cancel
Save