From ca53ebe0b89c39090832bf09e59c5e4b32cdc448 Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Mon, 25 Mar 2024 12:57:24 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/biutag/lan/domain/vo/LedgerExcel.java | 14 ++----- .../biutag/lan/enums/SatisfactionEnum.java | 25 ++++++++++++ .../lan/flow/node/ThreeContactWriterFlow.java | 2 +- .../com/biutag/lan/service/WorkService.java | 39 ++++++------------- .../lan/service/impl/HolidayServiceImpl.java | 2 +- 5 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 mailbox-lan/src/main/java/com/biutag/lan/enums/SatisfactionEnum.java diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java index a988b90..5f9638e 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java @@ -61,11 +61,11 @@ public class LedgerExcel { @ExcelProperty({"局长信箱即接即办工作汇总台账", "逾期办结"}) private String isOverdue; - @ExcelProperty({"局长信箱即接即办工作汇总台账", "处理结果"}) - private String resolveResult; + @ExcelProperty({"局长信箱即接即办工作汇总台账", "是否属实"}) + private String isTrue; - @ExcelProperty({"局长信箱即接即办工作汇总台账", "备注分析"}) - private String remark; + @ExcelProperty({"局长信箱即接即办工作汇总台账", "办理反馈情况"}) + private String verifyFeedback; @ExcelProperty({"局长信箱即接即办工作汇总台账", "问题分类(可多选)"}) private String category; @@ -78,12 +78,6 @@ public class LedgerExcel { @ExcelProperty({"局长信箱即接即办工作汇总台账", "电访时间"}) private LocalDateTime tellTime; - @ExcelProperty({"局长信箱即接即办工作汇总台账", "满意与否"}) - private String isSatisfaction; - - @ExcelProperty({"局长信箱即接即办工作汇总台账", "是否属实"}) - private String isTrue; - @ExcelProperty({"局长信箱即接即办工作汇总台账", "办理合格情况"}) private String isQualify; diff --git a/mailbox-lan/src/main/java/com/biutag/lan/enums/SatisfactionEnum.java b/mailbox-lan/src/main/java/com/biutag/lan/enums/SatisfactionEnum.java new file mode 100644 index 0000000..5599b46 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/enums/SatisfactionEnum.java @@ -0,0 +1,25 @@ +package com.biutag.lan.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public enum SatisfactionEnum { + + not_satisfied("不满意"), + basically_satisfied("基本满意"), + satisfied("非常满意"); + + @Getter + private String label; + + public static String getLabel(String key) { + for (SatisfactionEnum value : values()) { + if (value.name().equals(key)) { + return value.getLabel(); + } + } + return null; + } + +} diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java index 4d9e81a..5f5e8a2 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java @@ -66,7 +66,7 @@ public class ThreeContactWriterFlow extends Flow { .setContactFlag(data.getBoolean("contactFlag")) .setFlowKey(nextNode.getFlowNode().getKey()) .setFlowName(nextNode.getFlowNode().getBeforeName()) - .setFlowLimitedLastHandlerTime(now); + .setFlowLimitedLastHandlerTime(mail.getMailTime()); // 如果是简易流程 if (mail.getSimpleFlowFlag()) { mail.setFlowKey(FlowNodeEnum.VERIFY.getKey()) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java index 5309af7..2cd3a38 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java @@ -1,6 +1,5 @@ package com.biutag.lan.service; -import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.spring.SpringUtil; 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.QueryMailVo; import com.biutag.lan.domain.vo.WorkVo; +import com.biutag.lan.enums.SatisfactionEnum; import com.biutag.lan.enums.WorkType; import com.biutag.lan.flow.Flow; import com.biutag.lan.flow.FlowNameEnum; @@ -42,7 +42,6 @@ import java.io.IOException; import java.io.OutputStream; import java.net.URLEncoder; import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -55,6 +54,7 @@ public class WorkService extends ServiceImpl { @Resource private MailAppealMapper mailAppealMapper; + @Resource private MailCategoryMapper mailCategoryMapper; @@ -70,8 +70,6 @@ public class WorkService extends ServiceImpl { @Resource private DeptMapper deptMapper; - @Resource - private PoliceUserMapper policeUserMapper; private final IHolidayService holidayService; @@ -431,7 +429,6 @@ public class WorkService extends ServiceImpl { if (flowKey.equals("first_sign")) { nullFlag = true; } - } if (nullFlag) queryWrapper.nested(i -> i.isNull("m.flow_key").or().in("m.flow_key", flowKeyList)); @@ -664,23 +661,6 @@ public class WorkService extends ServiceImpl { 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 { List data = queryPage(new Page<>(1, 10000), mailQuery).getRecords(); List mailIds = data.stream().map(QueryMailVo::getId).collect(Collectors.toList()); @@ -704,15 +684,17 @@ public class WorkService extends ServiceImpl { ledgerExcel.setSecondDeptName(nullToEmpty(m.getSecondDeptName())); ledgerExcel.setThreeDeptName(m.getThreeDeptName()); ledgerExcel.setContent(nullToEmpty(q.getContent())); - - ledgerExcel.setIsThirtyMinutes(m.getContactDuration() < 1800 ? "是" : "否"); + ledgerExcel.setIsThirtyMinutes(Optional.ofNullable(m.getContactDuration()).map(item -> item < 1800 ? "是" : "否").orElse("")); 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.setTellDate(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()); boolean isAppeal = appealList.stream().anyMatch(item -> item.getMailId().equals(q.getId())); ledgerExcel.setIsAppeal(isAppeal ? "是" : "否"); @@ -720,7 +702,7 @@ public class WorkService extends ServiceImpl { String appealResult = appealList.stream().anyMatch(item -> item.getMailId().equals(q.getId()) && item.getAppealState().equals("2")) ? "成功" : "失败"; ledgerExcel.setAppealResult(appealResult); } - ledgerExcel.setIsTrue(nullToEmpty(m.getVerifyIsTrue())); + ledgerExcel.setIsQualify(nullToEmpty(m.getQualifiedProcessingStatus())); list.add(ledgerExcel); } @@ -731,7 +713,7 @@ public class WorkService extends ServiceImpl { response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); try (OutputStream out = response.getOutputStream()) { // 使用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) { log.error("Exception occurred while exporting mail data" + e.getMessage(), e); @@ -743,4 +725,5 @@ public class WorkService extends ServiceImpl { } } } + } \ No newline at end of file diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java index 378a71e..a9ce964 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java @@ -179,7 +179,7 @@ public class HolidayServiceImpl implements IHolidayService { long holidays = list.stream().filter(item -> item.getHolidayFlag().equals(AppConstants.YES) && !item.getDate().equals(nowDate)).count(); long todaySeconds = list.stream().anyMatch(item -> item.getHolidayFlag().equals(AppConstants.YES) && item.getDate().equals(nowDate)) ? // 当天的时间差 - Duration.between(now, now.toLocalDate().atStartOfDay()).getSeconds() : 0; + Duration.between(now.toLocalDate().atStartOfDay(), now).getSeconds() : 0; limitedTime += 86400 * holidays + todaySeconds; return limitedTime - Duration.between(flowLimitedLastHandlerTime, LocalDateTime.now()).getSeconds(); }