Browse Source

Merge branch 'dev_ycq'

# Conflicts:
#	mailbox-lan/src/main/java/com/biutag/lan/mapper/WorkMapper.java
#	mailbox-lan/src/main/resources/mapper/WorkMapper.xml
dev_ycq
21819 2 years ago
parent
commit
fb08e25e3f
  1. 5
      mailbox-common/src/main/java/com/biutag/enums/RoleEnum.java
  2. 2
      mailbox-lan/src/main/java/com/biutag/lan/controller/system/MailLabelController.java
  3. 23
      mailbox-lan/src/main/java/com/biutag/lan/controller/work/WorkController.java
  4. 1
      mailbox-lan/src/main/java/com/biutag/lan/domain/Mail.java
  5. 422
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailExcel.java
  6. 103
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/QueryMailVo.java
  7. 8
      mailbox-lan/src/main/java/com/biutag/lan/mapper/WorkMapper.java
  8. 43
      mailbox-lan/src/main/java/com/biutag/lan/service/ExcelService.java
  9. 140
      mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java
  10. 14
      mailbox-lan/src/main/resources/mapper/WorkMapper.xml

5
mailbox-common/src/main/java/com/biutag/enums/RoleEnum.java

@ -20,7 +20,10 @@ public enum RoleEnum {
SECOND_DEPT_LEADER(4, "二级机构领导"),
// 三级机构领导
THREE_DEPT_LEADER(5, "三级机构领导");
THREE_DEPT_LEADER(5, "三级机构领导"),
// 市局领导
MUNICIPAL_DEPT_LEADER(6, "市局领导");
private Integer roleId;

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

@ -1,5 +1,6 @@
package com.biutag.lan.controller.system;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult;
import com.biutag.lan.service.IMailLabelService;
@ -37,6 +38,7 @@ public class MailLabelController {
}
@PostMapping("/insert")
@SaCheckPermission("system:label:insert")
@ApiOperation(value="更新插入信件标签")
public AjaxResult<Void> insertLabels(@Validated @RequestBody MailLabelInsertValidate createValidate) {
iMailLabelService.insertLabel(createValidate);

23
mailbox-lan/src/main/java/com/biutag/lan/controller/work/WorkController.java

@ -4,10 +4,13 @@ import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult;
import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.Work;
import com.biutag.lan.domain.bo.MailQuery;
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.service.MailSourceService;
import com.biutag.lan.service.MailService;
import com.biutag.lan.service.WorkService;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
@ -23,7 +26,7 @@ import java.util.List;
public class WorkController {
private final WorkService workService;
private final MailSourceService mailSourceService;
private final MailService mailService;
@NotPower
@GetMapping("{workState}")
@ -33,32 +36,32 @@ public class WorkController {
@NotPower
@GetMapping("query")
public AjaxResult<Page<WorkVo>> list(Page<Work> page, MailQuery todoQuery) {
public AjaxResult<Page<QueryMailVo>> list(Page<Mail> page, MailQuery todoQuery) {
return AjaxResult.success(workService.queryPage(page, todoQuery));
}
@NotPower
@PostMapping("export")
public void detail(HttpServletResponse response, @RequestBody String dataWorkVo) throws IOException {
workService.export(response, dataWorkVo);
public void detail(HttpServletResponse response, @RequestBody String data) throws IOException {
workService.export(response, data);
}
@NotPower
@PostMapping("import")
public AjaxResult<Void> importExcel(@RequestBody String workVoList) {
List<WorkVo> data = JSON.parseArray(workVoList, WorkVo.class);
return workService.saveExcelBatch(data) && mailSourceService.saveExcelBatch(data) ? AjaxResult.success() : AjaxResult.failed("导入失败");
public AjaxResult<Void> importExcel(@RequestBody String mailList) {
List<Mail> data = JSON.parseArray(mailList, Mail.class);
return mailService.saveBatch(data) ? AjaxResult.success() : AjaxResult.failed("导入失败");
}
@NotPower
@PostMapping("check")
public AjaxResult<List<WorkVo>> check(MultipartFile file, MailQuery mailQuery) throws IOException {
public AjaxResult<List<MailExcel>> check(MultipartFile file, MailQuery mailQuery) throws IOException {
return workService.checkExcel(file, mailQuery);
}
@NotPower
@GetMapping("dissatisfied")
public AjaxResult<Page<WorkVo>> dissatisfied(Page<Work> page, MailQuery todoQuery) {
public AjaxResult<Page<QueryMailVo>> dissatisfied(Page<Mail> page, MailQuery todoQuery) {
return AjaxResult.success(workService.dissatisfied(page, todoQuery));
}
}

1
mailbox-lan/src/main/java/com/biutag/lan/domain/Mail.java

@ -5,7 +5,6 @@ import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Accessors(chain = true)

422
mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailExcel.java

@ -0,0 +1,422 @@
package com.biutag.lan.domain.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Setter
@Getter
public class MailExcel {
@TableId
@ExcelProperty("信件id")
private String id;
/**
* 联系人姓名
*/
@ExcelProperty("联系人姓名")
private String contactName;
/**
* 联系人性别 M / F
*/
@ExcelProperty("联系人性别")
private String contactSex;
/**
* 联系人身份证号码
*/
@ExcelProperty("联系人身份证号码")
private String contactIdCard;
/**
* 联系人手机号
*/
@ExcelProperty("联系人手机号")
private String contactPhone;
/**
* 案件编号
*/
@ExcelProperty("案件编号")
private String caseNumber;
/**
* 内容
*/
@ExcelProperty("内容")
private String content;
/**
* 附件
*/
@ExcelProperty("附件")
private String attachments;
/**
* 创建时间
*/
@ExcelProperty("创建时间")
private LocalDateTime createTime;
/**
* 更新时间
*/
@ExcelProperty("更新时间")
private LocalDateTime updateTime;
/**
* 来信时间
*/
@ExcelProperty("来信时间")
private LocalDateTime mailTime;
/**
* 来源
*/
@ExcelProperty("来源")
private String source;
/**
* 满意读(群众)
*/
@ExcelProperty("满意度(群众)")
private String satisfaction;
/*-------------------------------*/
/**
* 信件状态
*/
@ExcelProperty("信件状态")
private String mailState;
/**
* 信件当前流程
*/
@ExcelProperty("信件当前流程")
private String flowKey;
/**
* 信件当前流程节点
*/
@ExcelProperty("信件当前流程节点")
private String flowBeforeName;
/**
* 流程限时最后操作时间
*/
@ExcelProperty("流程限时最后操作时间")
private LocalDateTime flowLimitedLastHandlerTime;
/**
* 信件源数据ID 多个
*/
@ExcelProperty("信件源数据ID")
private String mailSourceId;
/**
* 信件类名
*/
@ExcelProperty("信件类名")
private String mailCategory;
/**
* 信件一级类目
*/
@ExcelProperty("信件一级类目")
private String mailFirstCategory;
/**
* 信件二级类目
*/
@ExcelProperty("信件二级类目")
private String mailSecondCategory;
/**
* 信件三级类目
*/
@ExcelProperty("信件三级类目")
private String mailThreeCategory;
/**
* 信件等级
*/
@ExcelProperty("信件等级")
private String mailLevel;
/**
* 二级单位ID(主责)
*/
@ExcelProperty("二级单位ID(主责)")
private Integer secondDeptId;
@ExcelProperty("二级单位名称(主责)")
private String secondDeptName;
/**
* 三级单位ID(主责)
*/
@ExcelProperty("三级单位ID(主责)")
private Integer threeDeptId;
@ExcelProperty("三级单位名称(主责)")
private String threeDeptName;
/**
* 协办核查民警String
*/
@ExcelProperty("协办核查民警")
private String coHandlingPolices;
/**
* 联系民警名称
*/
@ExcelProperty("联系民警姓名")
private String contactPoliceName;
/**
* 联系民警
*/
@ExcelProperty("联系民警")
private String contactPoliceEmpNo;
/**
* 联系民警职位
*/
@ExcelProperty("联系民警职位")
private String contactPolicePost;
/**
* 联系群众时间
*/
@ExcelProperty("联系群众时间")
private LocalDateTime contactTime;
/**
* 联系时长
*/
@ExcelProperty("联系时长")
private Long contactDuration;
/**
* 是否联系群众
*/
@ExcelProperty("是否联系群众")
private Boolean contactFlag;
/**
* 接访形式
*/
@ExcelProperty("接访形式")
private String interviewType;
/**
* 是否领导接访
*/
@ExcelProperty("是否领导接访")
private Boolean interviewIsLeader;
/**
* 接访人员警号
*/
@ExcelProperty("接访人员警号")
private String interviewPoliceEmpNo;
/**
* 接访人员姓名
*/
@ExcelProperty("接访人员姓名")
private String interviewPoliceName;
/**
* 接访情况
*/
@ExcelProperty("接访情况")
private String interviewDetails;
/**
* 接访附件佐证材料
*/
@ExcelProperty("接访附件")
private String interviewAttachments;
/**
* 核办情况
*/
@ExcelProperty("核办情况")
private String verifyDetails;
/**
* 核办-是否属实
*/
@ExcelProperty("核办-是否属实")
private String verifyIsTrue;
/**
* 核办-被举报对象json
*/
@ExcelProperty("核办-被举报对象")
private String verifyReportedPolices;
/**
* 核办-查证属实问题json
*/
@ExcelProperty("核办-查证属实问题")
private String verifyProblem;
/**
* 核办-是否需要问责
*/
@ExcelProperty("核办-是否需要问责")
private Boolean verifyNeedAccountability;
/**
* 核办-责任追究json
*/
@ExcelProperty("核办-责任追究")
private String verifyPunish;
/**
* 核办-群众反映事项解决情况(是否已解决)
*/
@ExcelProperty("核办-群众反映事项解决情况")
private Boolean verifyIsResolved;
/**
* 核办-办理反馈情况
*/
@ExcelProperty("核办-办理反馈情况")
private String verifyFeedback;
/**
* 核办-回访人信息(String)
*/
@ExcelProperty("核办-回访人信息")
private String verifyFollowupPolice;
/**
* 核办-附件上传佐证
*/
@ExcelProperty("核办-附件")
private String verifyAttachments;
/**
* 办结方式
*/
@ExcelProperty("办结方式")
private String completeMethod;
/**
* 办理合格情况
*/
@ExcelProperty("办理合格情况")
private String qualifiedProcessingStatus;
/**
* 问题解决情况
*/
@ExcelProperty("问题解决情况")
private Boolean problemSolvingStatus;
/**
* 群众回复情况
*/
@ExcelProperty("群众回复情况")
private String satisfactionStatus;
/**
* 认定办结意见
*/
@ExcelProperty("认定办结意见")
private String completionComment;
/**
* 是否是简易流程
*/
@ExcelProperty("是否是简易流程")
private Boolean simpleFlowFlag;
/**
* 涉及单位ID
*/
@ExcelProperty("涉及单位ID")
private Integer involvedDeptId;
/**
* 涉及单位名称
*/
@ExcelProperty("涉及单位名称")
private String involvedDeptName;
/**
* 会签部门总数
*/
@ExcelProperty("会签部门总数")
private Integer countersignTotal;
/**
* 会签完成部门数量
*/
@ExcelProperty("会签完成部门数量")
private Integer countersignCompleted;
/**
* 会签发起人
*/
@ExcelProperty("会签发起人")
private String countersignPromoterEmpNo;
/**
* 会签发起姓名
*/
@ExcelProperty("会签发起姓名")
private String countersignPromoterName;
/**
* 会签发起部门ID
*/
@ExcelProperty("会签发起部门ID")
private Integer countersignPromoterDeptId;
/**
* 会签发起部门名称
*/
@ExcelProperty("会签发起部门名称")
private String countersignPromoterDeptName;
/**
* 会签具体要求
*/
@ExcelProperty("会签具体要求")
private String countersignRequirement;
/**
* 信件标签
*/
@ExcelProperty("信件标签")
private String mailLabels;
/**
* 当前操作人
*/
@ExcelProperty("当前操作人")
private String currentOperator;
/**
* 是否申请延期
*/
@ExcelProperty("是否申请延期")
private Boolean extensionFlag;
/**
* 延期天数
*/
@ExcelProperty("延期天数")
private Integer extensionDays;
/**
* 延期理由
*/
@ExcelProperty("延期理由")
private String extensionReason;
/**
* 延期状态
*/
@ExcelProperty("延期状态")
private String extensionState;
/**
* 无效判定理由
*/
@ExcelProperty("无效判定理由")
private String invalidationReason;
/**
* 市局下发信息
*/
@ExcelProperty("市局下发信息")
private String firstDistributeInfo;
/**
* 二级单位下发信息
*/
@ExcelProperty("二级单位下发信息")
private String secondDistributeInfo;
}

103
mailbox-lan/src/main/java/com/biutag/lan/domain/vo/QueryMailVo.java

@ -0,0 +1,103 @@
package com.biutag.lan.domain.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
@Accessors(chain = true)
@Setter
@Getter
public class QueryMailVo {
@ExcelProperty("信件ID")
private String id;
/**
* 联系人姓名
*/
@ExcelProperty("姓名")
private String contactName;
/**
* 联系人手机号
*/
@ExcelProperty("联系电话")
private String contactPhone;
@ExcelProperty("联系人身份证号")
private String contactIdCard;
/**
* 内容
*/
@ExcelProperty("信件内容")
private String content;
/**
* 信件来源
*/
@ExcelProperty("信件来源")
private String source;
/**
* 信件时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ExcelProperty("来信时间")
private LocalDateTime mailTime;
/**
* 信件等级
*/
@ExcelProperty("信件等级")
private String mailLevel;
/**
* 信件一级类目
*/
@ExcelProperty("信件分类")
private String mailCategory = "未分类";
/**
* 信件状态
*/
@ExcelProperty("信件状态")
private String mailState;
/**
* 信件流程节点
*/
@ExcelProperty("流程节点ID")
private String flowKey;
/**
* 信件当前流程节点
*/
@ExcelProperty("流程节点")
private String flowBeforeName;
/**
* 当前流程剩余多少时间
*/
@ExcelProperty("流程限时")
private Long flowLimitedRemainingTime;
/**
* 办理单位ID三级单位
*/
@ExcelProperty("办理单位ID-三级")
private Integer threeDeptId;
@ExcelProperty("办理单位")
private String threeDeptName;
/**
* 信件标签
*/
@ExcelProperty("信件标签")
private String mailLabels;
}

8
mailbox-lan/src/main/java/com/biutag/lan/mapper/WorkMapper.java

@ -9,21 +9,15 @@ import com.biutag.lan.domain.vo.WorkVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Collection;
import java.util.List;
public interface WorkMapper extends BaseMapper<Work> {
Page<WorkVo> selectPageTodo(@Param("page") Page<Work> page, @Param(Constants.WRAPPER) QueryWrapper<Work> queryWrapper);
Integer selectCountByFlowKey(Collection<String> flowKeys, Integer deptId);
Page<QueryMailVo> selectQueryPage(@Param("page") Page<Mail> page, @Param(Constants.WRAPPER) QueryWrapper<Mail> queryWrapper);
@Select("select count(w.id) from work w left join mail m on w.mail_id = m.id where m.flow_key = #{flowKey} and w.sign_dept_id = #{deptId}")
Integer selectCount(String flowKey, Integer deptId);
@Select("select count(w.id) from work w left join mail m on w.mail_id = m.id where m.extension_flag = #{extensionFlag} and w.sign_dept_id = #{deptId}")
Integer selectCountByExtensionFlag(Boolean extensionFlag, Integer deptId);
@Select("select count(w.mail_id) from work w where w.mail_id = #{mailId}")
Integer countByFilter(String mailId);
}

43
mailbox-lan/src/main/java/com/biutag/lan/service/ExcelService.java

@ -4,47 +4,50 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.biutag.lan.domain.Work;
import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.bo.MailQuery;
import com.biutag.lan.domain.vo.WorkVo;
import com.biutag.lan.mapper.WorkMapper;
import com.biutag.lan.domain.vo.MailExcel;
import com.biutag.lan.mapper.MailMapper;
import lombok.Getter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@Getter
public class ExcelService implements ReadListener<WorkVo> {
private List<Work> dbDatalist;
private List<WorkVo> excelDatalist = new ArrayList<>();
public class ExcelService implements ReadListener<MailExcel> {
private List<Mail> dbDatalist;
private List<MailExcel> excelDatalist = new ArrayList<>();
private List<WorkVo> result;
private List<MailExcel> result;
private final MailMapper mailMapper;
private final WorkMapper workMapper;
private final MailQuery mailQuery;
public ExcelService(WorkMapper workMapper, MailQuery mailQuery) {
this.workMapper = workMapper;
public ExcelService(MailMapper mailMapper, MailQuery mailQuery) {
this.mailMapper = mailMapper;
this.mailQuery = mailQuery;
}
@Override
public void invoke(WorkVo workVo, AnalysisContext analysisContext) {
excelDatalist.add(workVo);
public void invoke(MailExcel mail, AnalysisContext analysisContext) {
excelDatalist.add(mail);//Accessors注解报错
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
QueryWrapper<Work> queryWrapper = new QueryWrapper<Work>()
QueryWrapper<Mail> queryWrapper = new QueryWrapper<Mail>()
.ge(StrUtil.isNotBlank(mailQuery.getMailTimeStart()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", mailQuery.getMailTimeStart())
.le(StrUtil.isNotBlank(mailQuery.getMailTimeStartEnd()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", mailQuery.getMailTimeStartEnd());
dbDatalist = workMapper.selectList(queryWrapper);
for (int i = 0; i < excelDatalist.size(); i++) {
WorkVo workVo = excelDatalist.get(i);
for (Work work : dbDatalist) {
if (work.getMailId().equals(workVo.getMailId())) {
excelDatalist.remove(workVo);
i--; // 减去索引以补偿移除的元素
dbDatalist = mailMapper.selectList(queryWrapper);
Iterator<MailExcel> iterator = excelDatalist.iterator();
while (iterator.hasNext()) {
MailExcel excelMail = iterator.next();
for (Mail mail : dbDatalist) {
if (excelMail.getId().equals(mail.getId())) {
iterator.remove(); // 使用迭代器的remove方法安全删除元素
break; // 一旦找到匹配并移除,跳出内循环
}
}

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

@ -15,11 +15,14 @@ import com.biutag.lan.domain.MailLabel;
import com.biutag.lan.domain.MailSource;
import com.biutag.lan.domain.Work;
import com.biutag.lan.domain.bo.MailQuery;
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.WorkType;
import com.biutag.lan.flow.FlowNameEnum;
import com.biutag.lan.flow.FlowNodeEnum;
import com.biutag.lan.mapper.MailLabelMapper;
import com.biutag.lan.mapper.MailMapper;
import com.biutag.lan.mapper.WorkMapper;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
@ -47,6 +50,9 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
@Resource
private WorkMapper workMapper;
@Resource
private MailMapper mailMapper;
public boolean saveBatch(List<MailSource> mailSources) {
LocalDateTime now = LocalDateTime.now();
List<Work> list = mailSources.stream().map(mail -> {
@ -296,52 +302,40 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
return list(new LambdaQueryWrapper<Work>().eq(Work::getMailId, mailId).eq(Work::getSignRoleId, roleId).eq(Work::getWorkType, workType));
}
public Page<WorkVo> queryPage(Page<Work> page, MailQuery todoQuery) {
QueryWrapper<Work> queryWrapper = new QueryWrapper<Work>()
.ge(StrUtil.isNotBlank(todoQuery.getMailTimeStart()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", todoQuery.getMailTimeStart())
.le(StrUtil.isNotBlank(todoQuery.getMailTimeStartEnd()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", todoQuery.getMailTimeStartEnd())
.eq(StrUtil.isNotBlank(todoQuery.getSource()), "m.source", todoQuery.getSource())
.eq(StrUtil.isNotBlank(todoQuery.getMailLevel()), "m.mail_level", todoQuery.getMailLevel())
.eq(StrUtil.isNotBlank(todoQuery.getMailCategory()), "m.mail_category", todoQuery.getMailCategory())
.like(StrUtil.isNotBlank(todoQuery.getThreeDeptName()), "m.three_dept_name", todoQuery.getThreeDeptName())
.eq(StrUtil.isNotBlank(todoQuery.getFlowKey()), "m.flow_key", todoQuery.getFlowKey());
if (StrUtil.isNotBlank(todoQuery.getMailLabels())) {
List<String> labelIds = todoQuery.handleMailLabels();
public Page<QueryMailVo> queryPage(Page<Mail> page, MailQuery mailQuery) {
QueryWrapper<Mail> queryWrapper = new QueryWrapper<Mail>()
.ge(StrUtil.isNotBlank(mailQuery.getMailTimeStart()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", mailQuery.getMailTimeStart())
.le(StrUtil.isNotBlank(mailQuery.getMailTimeStartEnd()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", mailQuery.getMailTimeStartEnd())
.eq(StrUtil.isNotBlank(mailQuery.getSource()), "m.source", mailQuery.getSource())
.eq(StrUtil.isNotBlank(mailQuery.getMailLevel()), "m.mail_level", mailQuery.getMailLevel())
.eq(StrUtil.isNotBlank(mailQuery.getMailCategory()), "m.mail_category", mailQuery.getMailCategory())
.like(StrUtil.isNotBlank(mailQuery.getThreeDeptName()), "m.three_dept_name", mailQuery.getThreeDeptName())
.eq(StrUtil.isNotBlank(mailQuery.getFlowKey()), "m.flow_key", mailQuery.getFlowKey());
if (StrUtil.isNotBlank(mailQuery.getMailLabels())) {
List<String> labelIds = mailQuery.handleMailLabels();
for (String labelId : labelIds) {
queryWrapper.like("m.mail_labels", labelId);
}
}
Integer roleId = AdminThreadLocal.getRoleId();
// 与角色相关的件
if (roleId.equals(RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId()) ||
roleId.equals(RoleEnum.SECOND_DEPT_CLASSES.getRoleId()) ||
roleId.equals(RoleEnum.THREE_DEPT_CLASSES.getRoleId())) {
Integer deptId = AdminThreadLocal.getDeptId();
queryWrapper.eq("w.sign_role_id", roleId)
// 如果不是市局专班,则需要查询签收部门ID
.eq(!RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId), "w.sign_dept_id", deptId);
} else {
String empNo = AdminThreadLocal.getEmpNo();
queryWrapper.eq("w.police_emp_no", empNo);
}
if (StrUtil.isNotBlank(todoQuery.getContactField()) && StrUtil.isNotBlank(todoQuery.getContactFieldValue())) {
switch (todoQuery.getContactField()) {
roleCheck(queryWrapper);
if (StrUtil.isNotBlank(mailQuery.getContactField()) && StrUtil.isNotBlank(mailQuery.getContactFieldValue())) {
switch (mailQuery.getContactField()) {
case "name":
queryWrapper.like("w.contact_name", todoQuery.getContactFieldValue());
queryWrapper.like("w.contact_name", mailQuery.getContactFieldValue());
break;
case "idCard":
queryWrapper.like("w.contactIdCard", todoQuery.getContactFieldValue());
queryWrapper.like("w.contact_idCard", mailQuery.getContactFieldValue());
break;
case "phone":
queryWrapper.like("w.contactPhone", todoQuery.getContactFieldValue());
queryWrapper.like("w.contactPhone", mailQuery.getContactFieldValue());
break;
}
}
// 排序
queryWrapper.orderByDesc("w.update_time");
Page<WorkVo> result = baseMapper.selectPageTodo(page, queryWrapper);
for (WorkVo workVo : result.getRecords()) {
Page<QueryMailVo> result = baseMapper.selectQueryPage(page, queryWrapper);
for (QueryMailVo workVo : result.getRecords()) {
List<MailLabel> labelNames = mailLabelMapper.selectList(null);
if (StrUtil.isNotBlank(workVo.getMailLabels())) {
String[] labelIds = workVo.getMailLabels().split(",");
@ -359,28 +353,56 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
return result;
}
public void export(HttpServletResponse response, String dataWorkVo) throws IOException {
List<WorkVo> data = JSON.parseArray(dataWorkVo, WorkVo.class);
public void export(HttpServletResponse response, String ids) throws IOException {
List<String> data = JSON.parseArray(ids, String.class);
List<Mail> mailList = mailMapper.selectBatchIds(data);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码
String fileName = URLEncoder.encode("测试", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), WorkVo.class).sheet("模板").doWrite(data);
EasyExcel.write(response.getOutputStream(), MailExcel.class).sheet("模板").doWrite(mailList);
}
public Page<WorkVo> dissatisfied(Page<Work> page, MailQuery todoQuery) {
QueryWrapper<Work> queryWrapper = new QueryWrapper<Work>()
.ge(StrUtil.isNotBlank(todoQuery.getMailTimeStart()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", todoQuery.getMailTimeStart())
.le(StrUtil.isNotBlank(todoQuery.getMailTimeStartEnd()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", todoQuery.getMailTimeStartEnd())
.eq(StrUtil.isNotBlank(todoQuery.getSource()), "m.source", todoQuery.getSource())
.eq(StrUtil.isNotBlank(todoQuery.getMailLevel()), "m.mail_level", todoQuery.getMailLevel())
.eq(StrUtil.isNotBlank(todoQuery.getMailCategory()), "m.mail_category", todoQuery.getMailCategory())
.like(StrUtil.isNotBlank(todoQuery.getThreeDeptName()), "m.three_dept_name", todoQuery.getThreeDeptName())
public Page<QueryMailVo> dissatisfied(Page<Mail> page, MailQuery mailQuery) {
QueryWrapper<Mail> queryWrapper = new QueryWrapper<Mail>()
.ge(StrUtil.isNotBlank(mailQuery.getMailTimeStart()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", mailQuery.getMailTimeStart())
.le(StrUtil.isNotBlank(mailQuery.getMailTimeStartEnd()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", mailQuery.getMailTimeStartEnd())
.eq(StrUtil.isNotBlank(mailQuery.getSource()), "m.source", mailQuery.getSource())
.eq(StrUtil.isNotBlank(mailQuery.getMailLevel()), "m.mail_level", mailQuery.getMailLevel())
.eq(StrUtil.isNotBlank(mailQuery.getMailCategory()), "m.mail_category", mailQuery.getMailCategory())
.like(StrUtil.isNotBlank(mailQuery.getThreeDeptName()), "m.three_dept_name", mailQuery.getThreeDeptName())
// .eq(StrUtil.isNotBlank(todoQuery.getAppealState()), "m.appeal_state", todoQuery.getAppealState())
.eq("m.satisfaction_status", "不满意")
.or()
.eq("m.verify_feedback", "不满意");
roleCheck(queryWrapper);
if (StrUtil.isNotBlank(mailQuery.getContactField()) && StrUtil.isNotBlank(mailQuery.getContactFieldValue())) {
switch (mailQuery.getContactField()) {
case "name":
queryWrapper.like("w.contact_name", mailQuery.getContactFieldValue());
break;
case "idCard":
queryWrapper.like("w.contactIdCard", mailQuery.getContactFieldValue());
break;
case "phone":
queryWrapper.like("w.contactPhone", mailQuery.getContactFieldValue());
break;
}
}
// 排序
queryWrapper.orderByDesc("w.update_time");
return baseMapper.selectQueryPage(page, queryWrapper);
}
/**
* 信件查询检查权限并显示
*
* @param queryWrapper
*/
private void roleCheck(QueryWrapper<Mail> queryWrapper) {
Integer roleId = AdminThreadLocal.getRoleId();
// 与角色相关的件
if (roleId.equals(RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId()) ||
@ -390,32 +412,24 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
queryWrapper.eq("w.sign_role_id", roleId)
// 如果不是市局专班,则需要查询签收部门ID
.eq(!RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId), "w.sign_dept_id", deptId);
} else if (roleId.equals(RoleEnum.MUNICIPAL_DEPT_LEADER.getRoleId())) {
//空操作
} else if (roleId.equals(RoleEnum.SECOND_DEPT_LEADER.getRoleId())) {
//数据,领导只能看到自己管辖的部门
Integer deptId = AdminThreadLocal.getDeptId();
queryWrapper.eq("m.second_dept_id", deptId);
} else if (roleId.equals(RoleEnum.THREE_DEPT_LEADER.getRoleId())) {
Integer deptId = AdminThreadLocal.getDeptId();
queryWrapper.eq("m.three_dept_id", deptId);
} else {
String empNo = AdminThreadLocal.getEmpNo();
queryWrapper.eq("w.police_emp_no", empNo);
}
if (StrUtil.isNotBlank(todoQuery.getContactField()) && StrUtil.isNotBlank(todoQuery.getContactFieldValue())) {
switch (todoQuery.getContactField()) {
case "name":
queryWrapper.like("w.contact_name", todoQuery.getContactFieldValue());
break;
case "idCard":
queryWrapper.like("w.contactIdCard", todoQuery.getContactFieldValue());
break;
case "phone":
queryWrapper.like("w.contactPhone", todoQuery.getContactFieldValue());
break;
}
}
// 排序
queryWrapper.orderByDesc("w.update_time");
return baseMapper.selectPageTodo(page, queryWrapper);
}
public AjaxResult<List<WorkVo>> checkExcel(MultipartFile file, MailQuery mailQuery) throws IOException {
ExcelService excelService = new ExcelService(workMapper, mailQuery);
EasyExcel.read(file.getInputStream(), WorkVo.class, excelService).sheet().doRead();
public AjaxResult<List<MailExcel>> checkExcel(MultipartFile file, MailQuery mailQuery) throws IOException {
ExcelService excelService = new ExcelService(mailMapper, mailQuery);
EasyExcel.read(file.getInputStream(), MailExcel.class, excelService).sheet().doRead();
return AjaxResult.success(excelService.getResult());
}
}
}

14
mailbox-lan/src/main/resources/mapper/WorkMapper.xml

@ -5,8 +5,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.biutag.lan.mapper.WorkMapper">
<select id="selectPageTodo" resultType="com.biutag.lan.domain.vo.WorkVo">
select w.id, w.contact_name, w.contact_phone, w.contact_id_card, w.content, w.source, w.mail_time, w.mail_id, w.work_type, w.flow_name,
m.mail_state, m.mail_category, m.mail_level, m.three_dept_id, m.three_dept_name, m.flow_key, m.mail_labels, m.countersign_total, m.countersign_completed,
select w.id, w.contact_name, w.contact_phone, w.contact_id_card, w.content, w.source, w.mail_time, w.mail_id, w.work_type,
m.mail_state, m.mail_category, m.mail_level, m.three_dept_id, m.three_dept_name, m.flow_key, m.flow_before_name,m.mail_labels,
<!-- 当前流程剩余多少时间(秒) -->
f.limited_time - ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - m.flow_limited_last_handler_time))) flow_limited_remaining_time
from work w
@ -24,4 +24,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and w.sign_dept_id = #{deptId}
</select>
<select id="selectQueryPage" resultType="com.biutag.lan.domain.vo.QueryMailVo">
select m.contact_name,m.contact_phone,m.contact_id_card,m.contact_sex,m.content,m.source,m.mail_time,m.id,m.mail_state,
m.mail_category ,m.mail_level,m.three_dept_id,m.three_dept_name,m.flow_key,m.flow_before_name,m.mail_labels,
f.limited_time - ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - m.flow_limited_last_handler_time))) flow_limited_remaining_time
from mail m
left join work w on m.id = w.mail_id
left join flow_node f on m.flow_key = f.key
${ew.getCustomSqlSegment}
</select>
</mapper>

Loading…
Cancel
Save