Browse Source

BUG修复

master
wxc 2 years ago
parent
commit
ca53ebe0b8
  1. 14
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java
  2. 25
      mailbox-lan/src/main/java/com/biutag/lan/enums/SatisfactionEnum.java
  3. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeContactWriterFlow.java
  4. 39
      mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java
  5. 2
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java

14
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;

25
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;
}
}

2
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())

39
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<WorkMapper, Work> {
@Resource
private MailAppealMapper mailAppealMapper;
@Resource
private MailCategoryMapper mailCategoryMapper;
@ -70,8 +70,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
@Resource
private DeptMapper deptMapper;
@Resource
private PoliceUserMapper policeUserMapper;
private final IHolidayService holidayService;
@ -431,7 +429,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
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<WorkMapper, Work> {
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<QueryMailVo> data = queryPage(new Page<>(1, 10000), mailQuery).getRecords();
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.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<WorkMapper, Work> {
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<WorkMapper, Work> {
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<WorkMapper, Work> {
}
}
}
}

2
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();
}

Loading…
Cancel
Save