Browse Source

BUG修复

master
wxc 2 years ago
parent
commit
66e75cfd5c
  1. 7
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java
  2. 16
      mailbox-lan/src/main/java/com/biutag/lan/service/MailFlowService.java
  3. 3
      mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java
  4. 22
      mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java

7
mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java

@ -4,10 +4,9 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.biutag.enums.RoleEnum;
import com.biutag.lan.domain.*;
import com.biutag.lan.enums.WorkType;
import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailCoHandling;
import com.biutag.lan.domain.MailCountersign;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

16
mailbox-lan/src/main/java/com/biutag/lan/service/MailFlowService.java

@ -7,36 +7,24 @@ import com.biutag.lan.mapper.MailFlowMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
@RequiredArgsConstructor
@Service
public class MailFlowService extends ServiceImpl<MailFlowMapper, MailFlow> {
private final MailSourceService mailSourceService;
public List<MailFlow> list(String mailId) {
LambdaQueryWrapper<MailFlow> queryWrapper = new LambdaQueryWrapper<MailFlow>().eq(MailFlow::getMailId, mailId).orderByAsc(MailFlow::getCreateTime);
return list(queryWrapper);
}
public List<MailFlow> list(String mailId, String flowKey) {
public List<MailFlow> list(String mailId, List<String> flowKeys) {
LambdaQueryWrapper<MailFlow> queryWrapper = new LambdaQueryWrapper<MailFlow>().eq(MailFlow::getMailId, mailId)
.eq(MailFlow::getFlowKey, flowKey)
.eq(MailFlow::getFlowKey, flowKeys)
.orderByAsc(MailFlow::getCreateTime);
return list(queryWrapper);
}
public LocalDateTime getMailLastHandlerTime(String mailId) {
List<MailFlow> list = list(mailId);
if (list.isEmpty()) {
return mailSourceService.getById(mailId).getCreateTime();
}
return list.get(list.size() - 1).getCreateTime();
}
public List<MailFlow> listOrderByCreateTimeDesc(String mailId) {
LambdaQueryWrapper<MailFlow> queryWrapper = new LambdaQueryWrapper<MailFlow>().eq(MailFlow::getMailId, mailId).orderByDesc(MailFlow::getCreateTime);
return list(queryWrapper);

3
mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java

@ -215,7 +215,8 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
//
flowConfig.getActions().stream().filter(item -> flowAction.getNextActionKey().equals(item.getKey())).findFirst().ifPresent(item -> {
LocalDateTime now = LocalDateTime.now();
LocalDateTime lastHandlerTime = mailFlowService.getMailLastHandlerTime(flowAction.getMailId());
List<MailFlow> list = mailFlowService.list(flowAction.getMailId());
LocalDateTime lastHandlerTime = list.isEmpty() ? mailSourceService.getById(flowAction.getMailId()).getCreateTime() : list.get(list.size() - 1).getCreateTime();
long consumingTime = DateUtil.between(Date.from(lastHandlerTime.atZone(ZoneId.systemDefault()).toInstant()), new Date(), DateUnit.SECOND);
// 保存当前流程数据
MailFlow mailFlow = new MailFlow()

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

@ -53,7 +53,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
private final MailLabelMapper mailLabelMapper;
private final MailAppealMapper mailAppealMapper;
@ -76,6 +75,8 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
private final NoticeService noticeService;
private final MailFlowService mailFlowService;
public boolean saveBatch(List<MailSource> mailSources) {
LocalDateTime now = LocalDateTime.now();
@ -710,6 +711,8 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
.collect(Collectors.toList()).get(0).getName()));
ledgerExcel.setMailTime(m.getMailTime());
ledgerExcel.setCreateTime(m.getCreateTime());
// 办结时间
ledgerExcel.setCompletionTime(q.getCompletionTime());
ledgerExcel.setContactName(nullToEmpty(q.getContactName()));
ledgerExcel.setContactPhone(nullToEmpty(q.getContactPhone()));
ledgerExcel.setSecondDeptName(nullToEmpty(m.getSecondDeptName()));
@ -720,12 +723,20 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
FlowNodeEnum flowNodeEnum = FlowNodeEnum.get(m.getFlowKey());
if (Objects.nonNull(flowNodeEnum)) {
if (flowNodeEnum.getIndex() > FlowNodeEnum.SECOND_DISTRIBUTE.getIndex()) {
// 是否5分钟内签收 (二级机构专班) TODO
//ledgerExcel.setSecondSignFlag();
// 是否5分钟内签收 (二级机构专班)
String secondSignFlag = mailFlowService.list(m.getId(), Arrays.asList(FlowNodeEnum.SECOND_SIGN.getKey(), FlowNodeEnum.SECOND_DISTRIBUTE.getKey()))
.stream()
.limit(2)
.mapToLong(MailFlow::getConsumingTime).sum() > 300 ? AppConstants.NO : AppConstants.YES;
ledgerExcel.setSecondSignFlag(secondSignFlag);
}
if (flowNodeEnum.getIndex() > FlowNodeEnum.SECOND_DISTRIBUTE.getIndex()) {
// 是否5分钟内签收(三级机构专班) TODO
//ledgerExcel.setThreeSignFlag();
String threeSignFlag = mailFlowService.list(m.getId(), Collections.singletonList(FlowNodeEnum.THREE_SIGN.getKey()))
.stream()
.limit(2)
.mapToLong(MailFlow::getConsumingTime).sum() > 300 ? AppConstants.NO : AppConstants.YES;
// 是否5分钟内签收(三级机构专班)
ledgerExcel.setThreeSignFlag(threeSignFlag);
}
}
@ -752,7 +763,6 @@ 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.setIsQualify(nullToEmpty(m.getQualifiedProcessingStatus()));
list.add(ledgerExcel);
}

Loading…
Cancel
Save