Browse Source

BUG修复

master
wxc 2 years ago
parent
commit
6a91fdf34d
  1. 17
      mailbox-common/src/main/java/com/biutag/constants/AppConstants.java
  2. 6
      mailbox-lan/src/main/java/com/biutag/lan/controller/ApiV1Controller.java
  3. 2
      mailbox-lan/src/main/java/com/biutag/lan/controller/HomeController.java
  4. 51
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java
  5. 12
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java
  6. 46
      mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java
  7. 16
      mailbox-lan/src/test/java/com/biutag/lan/DateTest.java
  8. 40
      mailbox-outer/src/main/java/com/biutag/outer/controller/ApiController.java

17
mailbox-common/src/main/java/com/biutag/constants/AppConstants.java

@ -1,19 +1,10 @@
package com.biutag.constants; package com.biutag.constants;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* Created by oumyye on 2019/1/18. * Created by oumyye on 2019/1/18.
*/ */
public class AppConstants { public class AppConstants {
public static final String DELETED = "1";
public static final String UNDELETED = "0";
public static final String DEPT_TYPE_CATEGORY="6"; //是机构类型 数据字段 类型为6 public static final String DEPT_TYPE_CATEGORY="6"; //是机构类型 数据字段 类型为6
public static final String YES = "Y"; public static final String YES = "Y";
@ -29,4 +20,12 @@ public class AppConstants {
public static final String MAIL_SOURCE = "mail_source"; public static final String MAIL_SOURCE = "mail_source";
// 非常满意
public static final String SATISFIED = "satisfied";
// 基本满意
public static final String BASICALLY_SATISFIED = "basically_satisfied";
// 不满意
public static final String NOT_SATISFIED = "not_satisfied";
} }

6
mailbox-lan/src/main/java/com/biutag/lan/controller/ApiV1Controller.java

@ -19,6 +19,7 @@ import com.biutag.lan.domain.bo.HolidayV1Req;
import com.biutag.lan.domain.bo.MailApiV1Req; import com.biutag.lan.domain.bo.MailApiV1Req;
import com.biutag.lan.domain.bo.MailEvaluateApiV1Req; import com.biutag.lan.domain.bo.MailEvaluateApiV1Req;
import com.biutag.lan.enums.MailCategory; import com.biutag.lan.enums.MailCategory;
import com.biutag.lan.enums.MailState;
import com.biutag.lan.service.HolidayService; import com.biutag.lan.service.HolidayService;
import com.biutag.lan.service.MailMarkService; import com.biutag.lan.service.MailMarkService;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
@ -90,6 +91,11 @@ public class ApiV1Controller {
} }
mail.setSatisfaction(req.getSatisfaction()); mail.setSatisfaction(req.getSatisfaction());
mailService.updateById(mail); mailService.updateById(mail);
if (MailState.completion.getValue().equals(mail.getMailState())) {
MailMark mailMark = mailMarkService.getById(req.getId());
mailMark.setSatisfied(AppConstants.NOT_SATISFIED.equals(req.getSatisfaction()) ? AppConstants.FALSE : AppConstants.TRUE);
mailMarkService.updateById(mailMark);
}
return AjaxResult.success(); return AjaxResult.success();
} }

2
mailbox-lan/src/main/java/com/biutag/lan/controller/HomeController.java

@ -77,7 +77,7 @@ public class HomeController {
Integer interviewWriterTotal = workService.count(FlowNodeEnum.INTERVIEW_WRITER.getKey(), deptId); Integer interviewWriterTotal = workService.count(FlowNodeEnum.INTERVIEW_WRITER.getKey(), deptId);
Integer verifyTotal = workService.count(FlowNodeEnum.VERIFY.getKey(), deptId); Integer verifyTotal = workService.count(FlowNodeEnum.VERIFY.getKey(), deptId);
// 申请延期中 // 申请延期中
int extensionTotal = Long.valueOf(mailService.count(new LambdaQueryWrapper<Mail>().eq(Mail::getMailState, MailState.delayed.getName()))).intValue(); int extensionTotal = Long.valueOf(mailService.count(new LambdaQueryWrapper<Mail>().eq(Mail::getMailState, MailState.delayed.getValue()))).intValue();
Integer approvalTotal = workService.count(Arrays.asList( Integer approvalTotal = workService.count(Arrays.asList(
FlowNodeEnum.THREE_LEADER_APPROVAL.getKey(), FlowNodeEnum.THREE_LEADER_APPROVAL.getKey(),
FlowNodeEnum.SECOND_APPROVAL.getKey(), FlowNodeEnum.SECOND_APPROVAL.getKey(),

51
mailbox-lan/src/main/java/com/biutag/lan/domain/vo/LedgerExcel.java

@ -1,6 +1,7 @@
package com.biutag.lan.domain.vo; package com.biutag.lan.domain.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -12,7 +13,7 @@ import java.time.LocalDateTime;
@ApiOperation("台账导出模板") @ApiOperation("台账导出模板")
public class LedgerExcel { public class LedgerExcel {
@ExcelProperty({"局长信箱即接即办工作汇总台账", "序号"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "序号"})
private String serialNumber; private Integer serialNumber;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "台账编号"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "台账编号"})
private String ledgerNumber; private String ledgerNumber;
@ -23,8 +24,9 @@ public class LedgerExcel {
@ExcelProperty({"局长信箱即接即办工作汇总台账", "线索来源"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "线索来源"})
private String source; private String source;
@DateTimeFormat("yyyy/MM/dd HH:mm")
@ExcelProperty({"局长信箱即接即办工作汇总台账", "受理时间"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "受理时间"})
private String createTime; private LocalDateTime createTime;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "信访人姓名"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "信访人姓名"})
private String contactName; private String contactName;
@ -33,16 +35,19 @@ public class LedgerExcel {
private String contactPhone; private String contactPhone;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "被投诉单位"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "被投诉单位"})
private String involvedDeptName; private String secondDeptName;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "被投诉所队"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "被投诉所队"})
private String involvedTeamName; private String threeDeptName;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "举报投诉事项"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "举报投诉事项"})
private String content; private String content;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "是否十分钟内签收"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "是否5分钟内签收\n(二级机构专班)"})
private String isTenMinutes; private String secondSignFlag;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "是否5分钟内签收\n(三级机构专班)"})
private String threeSignFlag;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "是否三十分钟内回访"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "是否三十分钟内回访"})
private String isThirtyMinutes; private String isThirtyMinutes;
@ -65,30 +70,36 @@ public class LedgerExcel {
@ExcelProperty({"局长信箱即接即办工作汇总台账", "问题分类(可多选)"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "问题分类(可多选)"})
private String category; private String category;
@DateTimeFormat("yyyy/MM/dd")
@ExcelProperty({"局长信箱即接即办工作汇总台账", "电访日期"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "电访日期"})
private String tellDate; private LocalDateTime tellDate;
@DateTimeFormat("HH:mm:ss")
@ExcelProperty({"局长信箱即接即办工作汇总台账", "电访时间"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "电访时间"})
private String tellTime; private LocalDateTime tellTime;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "满意与否"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "满意与否"})
private String isSatisfaction; private String isSatisfaction;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "不满意原因"})
private String unsatisfactoryReason;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "申诉结果"})
private String appealResult;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "典型件"})
private String typicalMail;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "是否属实"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "是否属实"})
private String isTrue; private String isTrue;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "是否合格"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "办理合格情况"})
private String isQualify; private String isQualify;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "扣分项"}) @ExcelProperty({"局长信箱即接即办工作汇总台账", "问题解决情况"})
private String demeritPoints; private String resolved;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "群众回复情况"})
private String satisfied;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "认定办结意见"})
private String completionComment;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "是否申诉"})
private String isAppeal;
@ExcelProperty({"局长信箱即接即办工作汇总台账", "申诉结果"})
private String appealResult;
} }

12
mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java

@ -55,4 +55,16 @@ public enum FlowNodeEnum {
return false; return false;
} }
public static boolean lessInterviewWriter(String key) {
if (StrUtil.isBlank(key)) {
return false;
}
for (FlowNodeEnum value : values()) {
if (value.getKey().equals(key)) {
return value.getIndex() < INTERVIEW_WRITER.index;
}
}
return false;
}
} }

46
mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java

@ -1,5 +1,6 @@
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;
@ -688,48 +689,41 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
List<DictData> dictData = dictDataMapper.selectList(null); List<DictData> dictData = dictDataMapper.selectList(null);
List<LedgerExcel> list = new ArrayList<>(); List<LedgerExcel> list = new ArrayList<>();
for (int i = 0; i < data.size(); i++) { int i = 1;
QueryMailVo q = data.get(i); for (QueryMailVo q : data) {
Mail m = new Mail(); Mail m = mailList.stream().filter(item -> item.getId().equals(q.getId())).findFirst().orElse(new Mail());
if (i < mailList.size())
m = mailList.get(i);
LedgerExcel ledgerExcel = new LedgerExcel(); LedgerExcel ledgerExcel = new LedgerExcel();
ledgerExcel.setSerialNumber(i++);
ledgerExcel.setId(nullToEmpty(q.getId())); ledgerExcel.setId(nullToEmpty(q.getId()));
ledgerExcel.setSource((dictData.stream() ledgerExcel.setSource((dictData.stream()
.filter(r -> r.getValue().equals(nullToEmpty(q.getSource()))) .filter(r -> r.getValue().equals(nullToEmpty(q.getSource())))
.collect(Collectors.toList()).get(0).getName())); .collect(Collectors.toList()).get(0).getName()));
ledgerExcel.setCreateTime(m.getCreateTime() == null ? "" : m.getCreateTime().toString()); ledgerExcel.setCreateTime(m.getCreateTime());
ledgerExcel.setContactName(nullToEmpty(q.getContactName())); ledgerExcel.setContactName(nullToEmpty(q.getContactName()));
ledgerExcel.setContactPhone(nullToEmpty(q.getContactPhone())); ledgerExcel.setContactPhone(nullToEmpty(q.getContactPhone()));
ledgerExcel.setInvolvedDeptName(StrUtil.isNotBlank(m.getInvolvedDeptName()) ? m.getInvolvedDeptName() : ""); ledgerExcel.setSecondDeptName(nullToEmpty(m.getSecondDeptName()));
ledgerExcel.setThreeDeptName(m.getThreeDeptName());
ledgerExcel.setContent(nullToEmpty(q.getContent())); ledgerExcel.setContent(nullToEmpty(q.getContent()));
ledgerExcel.setIsThirtyMinutes(m.getContactDuration() != null && m.getContactDuration() > 30 * 60 ? "是" : "否");
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.setResolveResult(turnSatisfaction((m.getSatisfaction())));
ledgerExcel.setCategory(nullToEmpty(m.getMailFirstCategory()) + "->" + nullToEmpty(m.getMailSecondCategory()) + "->" + nullToEmpty(m.getMailThreeCategory())); ledgerExcel.setCategory(nullToEmpty(m.getMailFirstCategory()) + Optional.ofNullable(m.getMailSecondCategory()).map(item -> " -> " + item).orElse("") + Optional.ofNullable(m.getMailThreeCategory()).map(item -> " -> " + item).orElse(""));
if (m.getContactTime() != null) { ledgerExcel.setTellDate(m.getContactTime());
ledgerExcel.setTellDate(m.getContactTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); ledgerExcel.setTellTime(m.getContactTime());
ledgerExcel.setTellTime(m.getContactTime().format(DateTimeFormatter.ofPattern("HH:mm:ss")));
} else {
ledgerExcel.setTellDate("");
ledgerExcel.setTellTime("");
}
ledgerExcel.setIsSatisfaction(nullToEmpty(m.getSatisfactionStatus())); ledgerExcel.setIsSatisfaction(nullToEmpty(m.getSatisfactionStatus()));
String appealResult = "";
for (MailAppeal map : appealList) { ledgerExcel.setCompletionComment(m.getCompletionComment());
if (map.getMailId().equals(q.getId())) { boolean isAppeal = appealList.stream().anyMatch(item -> item.getMailId().equals(q.getId()));
appealResult = map.getAppealState().equals("2") ? "成功" : "失败"; ledgerExcel.setIsAppeal(isAppeal ? "是" : "否");
break; if (isAppeal) {
} 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.setIsTrue(nullToEmpty(m.getVerifyIsTrue()));
ledgerExcel.setIsQualify(nullToEmpty(m.getQualifiedProcessingStatus())); ledgerExcel.setIsQualify(nullToEmpty(m.getQualifiedProcessingStatus()));
list.add(ledgerExcel); list.add(ledgerExcel);
} }
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码 // 这里URLEncoder.encode可以防止中文乱码

16
mailbox-lan/src/test/java/com/biutag/lan/DateTest.java

@ -0,0 +1,16 @@
package com.biutag.lan;
import org.junit.jupiter.api.Test;
import java.time.Duration;
import java.time.LocalDateTime;
public class DateTest {
@Test
public void test() {
long l = 345600 - Duration.between(LocalDateTime.of(2024, 3, 19, 13, 0, 0), LocalDateTime.now()).getSeconds();
System.out.println(l / 60 / 60);
}
}

40
mailbox-outer/src/main/java/com/biutag/outer/controller/ApiController.java

@ -1,40 +0,0 @@
package com.biutag.outer.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.exception.AuthException;
import com.biutag.outer.domain.Mail;
import com.biutag.outer.service.MailService;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
@Slf4j
@RequiredArgsConstructor
@RequestMapping("api")
@RestController
public class ApiController {
private final MailService mailService;
@GetMapping("mail")
public Page<Mail> list(Page<Mail> page,
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @RequestParam LocalDateTime beginTime,
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @RequestParam LocalDateTime endTime,
HttpServletRequest request) {
log.info("开始时间:{} 结束时间:{}", beginTime, endTime);
// 校验token
String authorization = request.getHeader("Authorization");
if (!"chuangke".equals(authorization)) {
throw new AuthException();
}
return mailService.pageByCreateTime(page, beginTime, endTime);
}
}
Loading…
Cancel
Save