|
|
|
@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
|
|
|
import com.biutag.constants.AppConstants; |
|
|
|
import com.biutag.core.AjaxResult; |
|
|
|
import com.biutag.core.AjaxResult; |
|
|
|
import com.biutag.entity.setting.DictData; |
|
|
|
import com.biutag.entity.setting.DictData; |
|
|
|
import com.biutag.entity.system.Dept; |
|
|
|
import com.biutag.entity.system.Dept; |
|
|
|
@ -21,6 +22,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.MailState; |
|
|
|
import com.biutag.lan.enums.SatisfactionEnum; |
|
|
|
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; |
|
|
|
@ -240,6 +242,13 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
return update(updateWrapper); |
|
|
|
return update(updateWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 我的工作 |
|
|
|
|
|
|
|
* @param workState |
|
|
|
|
|
|
|
* @param page |
|
|
|
|
|
|
|
* @param todoQuery |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
public Page<WorkVo> page(String workState, Page<Work> page, MailQuery todoQuery) { |
|
|
|
public Page<WorkVo> page(String workState, Page<Work> page, MailQuery todoQuery) { |
|
|
|
QueryWrapper<Work> queryWrapper = new QueryWrapper<Work>() |
|
|
|
QueryWrapper<Work> queryWrapper = new QueryWrapper<Work>() |
|
|
|
.eq("w.work_state", workState) |
|
|
|
.eq("w.work_state", workState) |
|
|
|
@ -247,7 +256,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
.le(StrUtil.isNotBlank(todoQuery.getMailTimeEnd()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", todoQuery.getMailTimeEnd()) |
|
|
|
.le(StrUtil.isNotBlank(todoQuery.getMailTimeEnd()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", todoQuery.getMailTimeEnd()) |
|
|
|
.eq(StrUtil.isNotBlank(todoQuery.getSource()), "m.source", todoQuery.getSource()) |
|
|
|
.eq(StrUtil.isNotBlank(todoQuery.getSource()), "m.source", todoQuery.getSource()) |
|
|
|
.eq(StrUtil.isNotBlank(todoQuery.getMailLevel()), "m.mail_level", todoQuery.getMailLevel()) |
|
|
|
.eq(StrUtil.isNotBlank(todoQuery.getMailLevel()), "m.mail_level", todoQuery.getMailLevel()) |
|
|
|
// .eq(StrUtil.isNotBlank(todoQuery.getMailCategory()), "m.mail_category", todoQuery.getMailCategory())
|
|
|
|
|
|
|
|
.eq(StrUtil.isNotBlank(todoQuery.getMailState()), "m.mail_state", todoQuery.getMailState()) |
|
|
|
.eq(StrUtil.isNotBlank(todoQuery.getMailState()), "m.mail_state", todoQuery.getMailState()) |
|
|
|
.like(StrUtil.isNotBlank(todoQuery.getThreeDeptName()), "m.three_dept_name", todoQuery.getThreeDeptName()) |
|
|
|
.like(StrUtil.isNotBlank(todoQuery.getThreeDeptName()), "m.three_dept_name", todoQuery.getThreeDeptName()) |
|
|
|
.eq(StrUtil.isNotBlank(todoQuery.getFlowKey()), "m.flow_key", todoQuery.getFlowKey()) |
|
|
|
.eq(StrUtil.isNotBlank(todoQuery.getFlowKey()), "m.flow_key", todoQuery.getFlowKey()) |
|
|
|
@ -327,10 +335,10 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (Objects.nonNull(item.getLimitedTime())) { |
|
|
|
if (Objects.nonNull(item.getLimitedTime())) { |
|
|
|
item.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(item.getLimitedTime(), item.getFlowLimitedLastHandlerTime(), item.getExtensionFlag(), item.getExtensionDays())); |
|
|
|
item.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTimeByNow(item.getLimitedTime(), item.getFlowLimitedLastHandlerTime(), item.getExtensionFlag(), item.getExtensionDays())); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Flow flow = SpringUtil.getBean(FirstSignFlow.class); |
|
|
|
Flow flow = SpringUtil.getBean(FirstSignFlow.class); |
|
|
|
item.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(flow.getFlowNode().getLimitedTime(), item.getCreateTime(), item.getExtensionFlag(), item.getExtensionDays())); |
|
|
|
item.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTimeByNow(flow.getFlowNode().getLimitedTime(), item.getCreateTime(), item.getExtensionFlag(), item.getExtensionDays())); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
return workVoPage; |
|
|
|
return workVoPage; |
|
|
|
@ -457,6 +465,24 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(mailQuery.getTimeout())) { |
|
|
|
|
|
|
|
// 超时查询
|
|
|
|
|
|
|
|
switch (mailQuery.getTimeout()) { |
|
|
|
|
|
|
|
// 签收超时
|
|
|
|
|
|
|
|
case "1": |
|
|
|
|
|
|
|
queryWrapper.eq("mm.sign_timeout", true); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
// 联系群众超时
|
|
|
|
|
|
|
|
case "2": |
|
|
|
|
|
|
|
queryWrapper.eq("mm.contact_writer_timeout", true); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
// 办理超时
|
|
|
|
|
|
|
|
case "3": |
|
|
|
|
|
|
|
queryWrapper.eq("mm.process_timeout", true); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 排序
|
|
|
|
// 排序
|
|
|
|
queryWrapper.orderByDesc("m.mail_time"); |
|
|
|
queryWrapper.orderByDesc("m.mail_time"); |
|
|
|
Page<QueryMailVo> result = baseMapper.selectQueryPage(page, queryWrapper, mailQuery.getCountMails()); |
|
|
|
Page<QueryMailVo> result = baseMapper.selectQueryPage(page, queryWrapper, mailQuery.getCountMails()); |
|
|
|
@ -476,10 +502,10 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (Objects.nonNull(workVo.getLimitedTime())) { |
|
|
|
if (Objects.nonNull(workVo.getLimitedTime())) { |
|
|
|
workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(workVo.getLimitedTime(), workVo.getFlowLimitedLastHandlerTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); |
|
|
|
workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTimeByNow(workVo.getLimitedTime(), workVo.getFlowLimitedLastHandlerTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Flow flow = SpringUtil.getBean(FirstSignFlow.class); |
|
|
|
Flow flow = SpringUtil.getBean(FirstSignFlow.class); |
|
|
|
workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(flow.getFlowNode().getLimitedTime(), workVo.getCreateTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); |
|
|
|
workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTimeByNow(flow.getFlowNode().getLimitedTime(), workVo.getCreateTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
@ -619,10 +645,10 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (Objects.nonNull(workVo.getLimitedTime())) { |
|
|
|
if (Objects.nonNull(workVo.getLimitedTime())) { |
|
|
|
workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(workVo.getLimitedTime(), workVo.getFlowLimitedLastHandlerTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); |
|
|
|
workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTimeByNow(workVo.getLimitedTime(), workVo.getFlowLimitedLastHandlerTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Flow flow = SpringUtil.getBean(FirstSignFlow.class); |
|
|
|
Flow flow = SpringUtil.getBean(FirstSignFlow.class); |
|
|
|
workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTime(flow.getFlowNode().getLimitedTime(), workVo.getCreateTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); |
|
|
|
workVo.setFlowLimitedRemainingTime(holidayService.getFlowRemainingTimeByNow(flow.getFlowNode().getLimitedTime(), workVo.getCreateTime(), workVo.getExtensionFlag(), workVo.getExtensionDays())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
@ -684,9 +710,16 @@ 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(Optional.ofNullable(m.getContactDuration()).map(item -> item < 1800 ? AppConstants.YES : AppConstants.NO).orElse("")); |
|
|
|
ledgerExcel.setIsVisit(m.getInterviewIsLeader() != null && m.getInterviewIsLeader() ? "是" : "否"); |
|
|
|
ledgerExcel.setIsVisit(m.getInterviewIsLeader() != null && m.getInterviewIsLeader() ? AppConstants.YES : AppConstants.NO); |
|
|
|
|
|
|
|
// 是否四天内办结
|
|
|
|
|
|
|
|
if (MailState.completion.getValue().equals(m.getMailState())) { |
|
|
|
|
|
|
|
ledgerExcel.setIsFourDays(holidayService.getFlowRemainingTime(m.getMailTime(), m.getUpdateTime(), 345600) >= 0 ? AppConstants.YES : AppConstants.NO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 逾期办结
|
|
|
|
|
|
|
|
if (AppConstants.NO.equals(MailState.completion.getValue())) { |
|
|
|
|
|
|
|
ledgerExcel.setIsOverdue(AppConstants.YES); |
|
|
|
|
|
|
|
} |
|
|
|
ledgerExcel.setIsTrue(nullToEmpty(m.getVerifyIsTrue())); |
|
|
|
ledgerExcel.setIsTrue(nullToEmpty(m.getVerifyIsTrue())); |
|
|
|
ledgerExcel.setVerifyFeedback(m.getVerifyFeedback()); |
|
|
|
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("")); |
|
|
|
@ -697,7 +730,7 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
ledgerExcel.setSatisfied(Optional.ofNullable(m.getSatisfaction()).map(SatisfactionEnum::getLabel).orElse(m.getSatisfactionStatus())); |
|
|
|
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 ? AppConstants.YES : AppConstants.NO); |
|
|
|
if (isAppeal) { |
|
|
|
if (isAppeal) { |
|
|
|
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); |
|
|
|
@ -707,10 +740,7 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> { |
|
|
|
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可以防止中文乱码
|
|
|
|
|
|
|
|
String fileName = URLEncoder.encode("测试", "UTF-8").replaceAll("\\+", "%20"); |
|
|
|
|
|
|
|
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); |
|
|
|
|