Browse Source

BUG修复

master
wxc 2 years ago
parent
commit
bb80ff63d6
  1. 7
      mailbox-lan/src/main/java/com/biutag/lan/controller/work/WorkController.java
  2. 11
      mailbox-lan/src/main/java/com/biutag/lan/service/FavoriteService.java
  3. 9
      mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java
  4. 2
      mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml

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

@ -1,5 +1,6 @@
package com.biutag.lan.controller.work;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.aop.NotLogin;
@ -81,6 +82,12 @@ public class WorkController {
return AjaxResult.success(mailService.getMailFlowDetailByWork(mailId, workId));
}
/**
* 转为待办
* @param mailId
* @return
*/
@SaCheckPermission("mail:change")
@GetMapping("change")
public AjaxResult<Void> change(@RequestParam String mailId) {
return mailService.change(mailId) ? AjaxResult.success() : AjaxResult.failed("操作失败");

11
mailbox-lan/src/main/java/com/biutag/lan/service/FavoriteService.java

@ -23,8 +23,15 @@ public class FavoriteService extends ServiceImpl<FavoriteMapper, Favorite> {
private final MailSourceService mailSourceService;
public Favorite get(String mailId, String policeEmpNo) {
return getOne(new LambdaQueryWrapper<Favorite>().eq(Favorite::getMailId, mailId).eq(Favorite::getPoliceEmpNo, policeEmpNo));
public Favorite getByCurrentUser(String mailId) {
LambdaQueryWrapper<Favorite> queryWrapper = new LambdaQueryWrapper<Favorite>().eq(Favorite::getMailId, mailId);
Integer roleId = AdminThreadLocal.getRoleId();
if (RoleEnum.isClasses(roleId)) {
queryWrapper.eq(Favorite::getRoleId, roleId).eq(Favorite::getDeptId, AdminThreadLocal.getDeptId());
} else {
queryWrapper.eq(Favorite::getPoliceEmpNo, AdminThreadLocal.getEmpNo());
}
return getOne(queryWrapper);
}
public Page<FavoriteVo> page(Page<Favorite> page, MailQuery mailQuery) {

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

@ -105,7 +105,7 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
.stream().sorted(Comparator.comparing(MailFlow::getCreateTime).reversed()).collect(Collectors.toList());
flowDetail.setMail(mailVo)
.setIsFav(Objects.nonNull(favoriteService.get(mailId, AdminThreadLocal.getEmpNo())))
.setIsFav(Objects.nonNull(favoriteService.getByCurrentUser(mailId)))
.setFlows(flows);
// 部门会签
mailVo.setCountersigns(mailCountersignService.list(mailId));
@ -398,9 +398,14 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
.setMailState(MailState.processing.getValue())
.setFlowName(FlowNodeEnum.FIRST_SIGN.getFullName())
.setMailCategory(null).setMailFirstCategory(null);
Work work = workMapper.selectOne(new LambdaQueryWrapper<Work>().eq(Work::getMailId, mailId));
LambdaQueryWrapper<Work> queryWrapper = new LambdaQueryWrapper<Work>().eq(Work::getMailId, mailId)
.eq(Work::getSignRoleId, RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId());
Work work = workMapper.selectOne(queryWrapper);
work.setWorkState(Work.State.todo.name());
workMapper.updateById(work);
MailSource mailSource = mailSourceService.getById(mailId);
mailSource.setSignFlag(false);
mailSourceService.updateById(mailSource);
LocalDateTime now = LocalDateTime.now();
MailFlow mailFlow = new MailFlow()
.setMailId(mailId)

2
mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml

@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select a.name,
ROUND(sum(COALESCE(b.completed, 0))*100/count(1),0) rateNumber,
CONCAT(rateNumber,'%') rate,
SUM(COALESCE(b.completed, 0)) completed,count(1) sum
SUM(COALESCE(b.completed, 0)) completed,count(b.mail_id) sum
-- from dept a left join mail_mark b on a.id=b.second_dept_id where a.category='2'
-- GROUP BY a.name order by rateNumber desc limit 10
from dept a left join mail_mark b on a.id = b.second_dept_id

Loading…
Cancel
Save