|
|
|
@ -1,6 +1,5 @@ |
|
|
|
package com.biutag.lan.service; |
|
|
|
package com.biutag.lan.service; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.extra.spring.SpringUtil; |
|
|
|
import cn.hutool.extra.spring.SpringUtil; |
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
@ -22,6 +21,7 @@ import com.biutag.lan.domain.vo.LedgerExcel; |
|
|
|
import com.biutag.lan.domain.vo.MailExcel; |
|
|
|
import com.biutag.lan.domain.vo.MailExcel; |
|
|
|
import com.biutag.lan.domain.vo.QueryMailVo; |
|
|
|
import com.biutag.lan.domain.vo.QueryMailVo; |
|
|
|
import com.biutag.lan.domain.vo.WorkVo; |
|
|
|
import com.biutag.lan.domain.vo.WorkVo; |
|
|
|
|
|
|
|
import com.biutag.lan.enums.SatisfactionEnum; |
|
|
|
import com.biutag.lan.enums.WorkType; |
|
|
|
import com.biutag.lan.enums.WorkType; |
|
|
|
import com.biutag.lan.flow.Flow; |
|
|
|
import com.biutag.lan.flow.Flow; |
|
|
|
import com.biutag.lan.flow.FlowNameEnum; |
|
|
|
import com.biutag.lan.flow.FlowNameEnum; |
|
|
|
@ -42,7 +42,6 @@ import java.io.IOException; |
|
|
|
import java.io.OutputStream; |
|
|
|
import java.io.OutputStream; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
@ -55,6 +54,7 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private MailAppealMapper mailAppealMapper; |
|
|
|
private MailAppealMapper mailAppealMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private MailCategoryMapper mailCategoryMapper; |
|
|
|
private MailCategoryMapper mailCategoryMapper; |
|
|
|
|
|
|
|
|
|
|
|
@ -70,8 +70,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private DeptMapper deptMapper; |
|
|
|
private DeptMapper deptMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private PoliceUserMapper policeUserMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IHolidayService holidayService; |
|
|
|
private final IHolidayService holidayService; |
|
|
|
|
|
|
|
|
|
|
|
@ -431,7 +429,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
if (flowKey.equals("first_sign")) { |
|
|
|
if (flowKey.equals("first_sign")) { |
|
|
|
nullFlag = true; |
|
|
|
nullFlag = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (nullFlag) |
|
|
|
if (nullFlag) |
|
|
|
queryWrapper.nested(i -> i.isNull("m.flow_key").or().in("m.flow_key", flowKeyList)); |
|
|
|
queryWrapper.nested(i -> i.isNull("m.flow_key").or().in("m.flow_key", flowKeyList)); |
|
|
|
@ -664,23 +661,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
return value == null ? "" : value.toString(); |
|
|
|
return value == null ? "" : value.toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String turnSatisfaction(String en) { |
|
|
|
|
|
|
|
if (en == null) |
|
|
|
|
|
|
|
return ""; |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
switch (en) { |
|
|
|
|
|
|
|
case "satisfied": |
|
|
|
|
|
|
|
return "非常满意"; |
|
|
|
|
|
|
|
case "basically_satisfied": |
|
|
|
|
|
|
|
return "基本满意"; |
|
|
|
|
|
|
|
case "not_satisfied": |
|
|
|
|
|
|
|
return "不满意"; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void exportLedger(HttpServletResponse response, MailQuery mailQuery) throws IOException { |
|
|
|
public void exportLedger(HttpServletResponse response, MailQuery mailQuery) throws IOException { |
|
|
|
List<QueryMailVo> data = queryPage(new Page<>(1, 10000), mailQuery).getRecords(); |
|
|
|
List<QueryMailVo> data = queryPage(new Page<>(1, 10000), mailQuery).getRecords(); |
|
|
|
List<String> mailIds = data.stream().map(QueryMailVo::getId).collect(Collectors.toList()); |
|
|
|
List<String> mailIds = data.stream().map(QueryMailVo::getId).collect(Collectors.toList()); |
|
|
|
@ -704,15 +684,17 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
ledgerExcel.setSecondDeptName(nullToEmpty(m.getSecondDeptName())); |
|
|
|
ledgerExcel.setSecondDeptName(nullToEmpty(m.getSecondDeptName())); |
|
|
|
ledgerExcel.setThreeDeptName(m.getThreeDeptName()); |
|
|
|
ledgerExcel.setThreeDeptName(m.getThreeDeptName()); |
|
|
|
ledgerExcel.setContent(nullToEmpty(q.getContent())); |
|
|
|
ledgerExcel.setContent(nullToEmpty(q.getContent())); |
|
|
|
|
|
|
|
ledgerExcel.setIsThirtyMinutes(Optional.ofNullable(m.getContactDuration()).map(item -> item < 1800 ? "是" : "否").orElse("")); |
|
|
|
ledgerExcel.setIsThirtyMinutes(m.getContactDuration() < 1800 ? "是" : "否"); |
|
|
|
|
|
|
|
ledgerExcel.setIsVisit(m.getInterviewIsLeader() != null && m.getInterviewIsLeader() ? "是" : "否"); |
|
|
|
ledgerExcel.setIsVisit(m.getInterviewIsLeader() != null && m.getInterviewIsLeader() ? "是" : "否"); |
|
|
|
ledgerExcel.setResolveResult(turnSatisfaction((m.getSatisfaction()))); |
|
|
|
|
|
|
|
|
|
|
|
ledgerExcel.setIsTrue(nullToEmpty(m.getVerifyIsTrue())); |
|
|
|
|
|
|
|
ledgerExcel.setVerifyFeedback(m.getVerifyFeedback()); |
|
|
|
ledgerExcel.setCategory(nullToEmpty(m.getMailFirstCategory()) + Optional.ofNullable(m.getMailSecondCategory()).map(item -> " -> " + item).orElse("") + Optional.ofNullable(m.getMailThreeCategory()).map(item -> " -> " + item).orElse("")); |
|
|
|
ledgerExcel.setCategory(nullToEmpty(m.getMailFirstCategory()) + Optional.ofNullable(m.getMailSecondCategory()).map(item -> " -> " + item).orElse("") + Optional.ofNullable(m.getMailThreeCategory()).map(item -> " -> " + item).orElse("")); |
|
|
|
ledgerExcel.setTellDate(m.getContactTime()); |
|
|
|
ledgerExcel.setTellDate(m.getContactTime()); |
|
|
|
ledgerExcel.setTellTime(m.getContactTime()); |
|
|
|
ledgerExcel.setTellTime(m.getContactTime()); |
|
|
|
ledgerExcel.setIsSatisfaction(nullToEmpty(m.getSatisfactionStatus())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ledgerExcel.setResolved(Optional.ofNullable(m.getProblemSolvingStatus()).map(item -> item ? "已解决": "未解决").orElse("")); |
|
|
|
|
|
|
|
ledgerExcel.setSatisfied(Optional.ofNullable(m.getSatisfaction()).map(SatisfactionEnum::getLabel).orElse(m.getSatisfactionStatus())); |
|
|
|
ledgerExcel.setCompletionComment(m.getCompletionComment()); |
|
|
|
ledgerExcel.setCompletionComment(m.getCompletionComment()); |
|
|
|
boolean isAppeal = appealList.stream().anyMatch(item -> item.getMailId().equals(q.getId())); |
|
|
|
boolean isAppeal = appealList.stream().anyMatch(item -> item.getMailId().equals(q.getId())); |
|
|
|
ledgerExcel.setIsAppeal(isAppeal ? "是" : "否"); |
|
|
|
ledgerExcel.setIsAppeal(isAppeal ? "是" : "否"); |
|
|
|
@ -720,7 +702,7 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
String appealResult = appealList.stream().anyMatch(item -> item.getMailId().equals(q.getId()) && item.getAppealState().equals("2")) ? "成功" : "失败"; |
|
|
|
String appealResult = appealList.stream().anyMatch(item -> item.getMailId().equals(q.getId()) && item.getAppealState().equals("2")) ? "成功" : "失败"; |
|
|
|
ledgerExcel.setAppealResult(appealResult); |
|
|
|
ledgerExcel.setAppealResult(appealResult); |
|
|
|
} |
|
|
|
} |
|
|
|
ledgerExcel.setIsTrue(nullToEmpty(m.getVerifyIsTrue())); |
|
|
|
|
|
|
|
ledgerExcel.setIsQualify(nullToEmpty(m.getQualifiedProcessingStatus())); |
|
|
|
ledgerExcel.setIsQualify(nullToEmpty(m.getQualifiedProcessingStatus())); |
|
|
|
list.add(ledgerExcel); |
|
|
|
list.add(ledgerExcel); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -731,7 +713,7 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
|
|
|
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
|
|
|
try (OutputStream out = response.getOutputStream()) { |
|
|
|
try (OutputStream out = response.getOutputStream()) { |
|
|
|
// 使用EasyExcel写入数据到输出流
|
|
|
|
// 使用EasyExcel写入数据到输出流
|
|
|
|
EasyExcel.write(out, LedgerExcel.class).inMemory(Boolean.TRUE).sheet("模板").doWrite(list); |
|
|
|
EasyExcel.write(out, LedgerExcel.class).inMemory(Boolean.TRUE).sheet("局长信箱即接即办工作汇总台账").doWrite(list); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("Exception occurred while exporting mail data" + e.getMessage(), e); |
|
|
|
log.error("Exception occurred while exporting mail data" + e.getMessage(), e); |
|
|
|
|
|
|
|
|
|
|
|
@ -743,4 +725,5 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |