Browse Source

不满意信件流程完成

master
21819 2 years ago
parent
commit
fded5ff424
  1. 9
      mailbox-lan/src/main/java/com/biutag/lan/controller/MailAppealController.java
  2. 8
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/QueryMailVo.java
  3. 2
      mailbox-lan/src/main/java/com/biutag/lan/mapper/WorkMapper.java
  4. 8
      mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java
  5. 23
      mailbox-lan/src/main/java/com/biutag/lan/service/MailAppealService.java
  6. 7
      mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java
  7. 12
      mailbox-lan/src/main/resources/mapper/WorkMapper.xml

9
mailbox-lan/src/main/java/com/biutag/lan/controller/MailAppealController.java

@ -9,6 +9,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RequestMapping("api/appeal") @RequestMapping("api/appeal")
@ -26,8 +27,8 @@ public class MailAppealController {
@NotPower @NotPower
@RequestMapping("getAppeal") @RequestMapping("getAppeal")
public AjaxResult<MailAppeal> getAppeal(String appealId) { public AjaxResult<MailAppeal> getAppeal(String id) {
return mailAppealService.getAppeal(appealId); return mailAppealService.getAppeal(id);
} }
@ -40,8 +41,8 @@ public class MailAppealController {
@NotPower @NotPower
@RequestMapping("approved") @RequestMapping("approved")
public AjaxResult<Void> approved(String userId) { public AjaxResult<Void> approved(String id) {
return mailAppealService.approved(userId); return mailAppealService.approved(id);
} }
} }

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

@ -100,4 +100,12 @@ public class QueryMailVo {
*/ */
@ExcelProperty("信件标签") @ExcelProperty("信件标签")
private String mailLabels; private String mailLabels;
/**
* 申诉状态
*/
private String appealState;
/**
* 处理部门
*/
private Integer handlingDept;
} }

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

@ -19,6 +19,8 @@ public interface WorkMapper extends BaseMapper<Work> {
Page<QueryMailVo> selectQueryPage(@Param("page") Page<Mail> page, @Param(Constants.WRAPPER) QueryWrapper<Mail> queryWrapper); Page<QueryMailVo> selectQueryPage(@Param("page") Page<Mail> page, @Param(Constants.WRAPPER) QueryWrapper<Mail> queryWrapper);
Page<QueryMailVo> selectDissatisfiedPage(@Param("page") Page<Mail> page, @Param(Constants.WRAPPER) QueryWrapper<Mail> queryWrapper);
Integer selectCountByFlowKey(Collection<String> flowKeys, Integer deptId); Integer selectCountByFlowKey(Collection<String> flowKeys, Integer deptId);
@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}") @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}")

8
mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java

@ -124,8 +124,8 @@ public class DataScreenService extends ServiceImpl<DataScreenMapper, Mail> {
Map<String, Object> mapResolved = baseMapper.getAllResolvedRate(null);//获取长沙市局 解决率 Map<String, Object> mapResolved = baseMapper.getAllResolvedRate(null);//获取长沙市局 解决率
Map<String, Object> mapSatisfied = baseMapper.getAllSatisfiedRate(null);//获取长沙市局 满意率 Map<String, Object> mapSatisfied = baseMapper.getAllSatisfiedRate(null);//获取长沙市局 满意率
// Integer allSum = baseMapper.getAllMailCount(null); // Integer allSum = baseMapper.getAllMailCount(null);
Long allSum = mailMapper.selectCount(new LambdaQueryWrapper<Mail>().ne(Mail::getMailCategory, "无效类").ne(Mail::getMailCategory, "终止类") Long allSum = mailMapper.selectCount(new LambdaQueryWrapper<Mail>().ne(Mail::getMailFirstCategory, "无效类").ne(Mail::getMailFirstCategory, "终止类")
.ne(Mail::getMailCategory, "感谢信")); .ne(Mail::getMailFirstCategory, "感谢信"));
Integer toDayCount = baseMapper.getTodayMailCount(null); Integer toDayCount = baseMapper.getTodayMailCount(null);
mapCompleted.putAll(mapResolved); mapCompleted.putAll(mapResolved);
@ -139,8 +139,8 @@ public class DataScreenService extends ServiceImpl<DataScreenMapper, Mail> {
Map<String, Object> mapResolved = baseMapper.getAllResolvedRate(deptId);//获取长沙市局 解决率 Map<String, Object> mapResolved = baseMapper.getAllResolvedRate(deptId);//获取长沙市局 解决率
Map<String, Object> mapSatisfied = baseMapper.getAllSatisfiedRate(deptId);//获取长沙市局 满意率 Map<String, Object> mapSatisfied = baseMapper.getAllSatisfiedRate(deptId);//获取长沙市局 满意率
// Integer allSum = baseMapper.getAllMailCount(deptId); // Integer allSum = baseMapper.getAllMailCount(deptId);
Long allSum = mailMapper.selectCount(new LambdaQueryWrapper<Mail>().ne(Mail::getMailCategory, "无效类").ne(Mail::getMailCategory, "终止类") Long allSum = mailMapper.selectCount(new LambdaQueryWrapper<Mail>().ne(Mail::getMailFirstCategory, "无效类").ne(Mail::getMailFirstCategory, "终止类")
.ne(Mail::getMailCategory, "感谢信")); .ne(Mail::getMailFirstCategory, "感谢信"));
Integer toDayCount = baseMapper.getTodayMailCount(deptId); Integer toDayCount = baseMapper.getTodayMailCount(deptId);
mapCompleted.putAll(mapResolved); mapCompleted.putAll(mapResolved);

23
mailbox-lan/src/main/java/com/biutag/lan/service/MailAppealService.java

@ -1,15 +1,20 @@
package com.biutag.lan.service; package com.biutag.lan.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.biutag.core.AjaxResult; import com.biutag.core.AjaxResult;
import com.biutag.entity.system.Dept; import com.biutag.entity.system.Dept;
import com.biutag.lan.config.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailAppeal; import com.biutag.lan.domain.MailAppeal;
import com.biutag.lan.mapper.MailAppealMapper; import com.biutag.lan.mapper.MailAppealMapper;
import com.biutag.lan.mapper.MailMapper;
import com.biutag.mapper.system.DeptMapper; import com.biutag.mapper.system.DeptMapper;
import com.biutag.util.StringUtils;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
@ -20,6 +25,9 @@ public class MailAppealService {
@Resource @Resource
private final DeptMapper deptMapper; private final DeptMapper deptMapper;
@Resource
private final MailMapper mailMapper;
/** /**
* 发起申请 * 发起申请
* *
@ -28,9 +36,13 @@ public class MailAppealService {
*/ */
public AjaxResult<Void> launchAppeal(MailAppeal appeal) { public AjaxResult<Void> launchAppeal(MailAppeal appeal) {
long count = mailAppealMapper.selectCount(new LambdaQueryWrapper<MailAppeal>().eq(MailAppeal::getMailId, appeal.getMailId())); long count = mailAppealMapper.selectCount(new LambdaQueryWrapper<MailAppeal>().eq(MailAppeal::getMailId, appeal.getMailId()));
if (count > 0) { String appealState = mailAppealMapper.selectOne(new QueryWrapper<MailAppeal>().eq("mail_id", appeal.getMailId())).getAppealState();
if (count > 0 && !("3".equals(appealState))) {
return AjaxResult.failed("此邮件您已发起过申诉,请勿重复申诉"); return AjaxResult.failed("此邮件您已发起过申诉,请勿重复申诉");
} else { } else {
if (StringUtils.isNotEmpty(appealState)) {
mailAppealMapper.delete(new QueryWrapper<MailAppeal>().eq("mail_id", appeal.getMailId()));
}
appeal.setHandlingDept(AdminThreadLocal.getDeptId()) appeal.setHandlingDept(AdminThreadLocal.getDeptId())
.setAppealState("1") .setAppealState("1")
.setThreeDept(AdminThreadLocal.getDeptId()); .setThreeDept(AdminThreadLocal.getDeptId());
@ -47,7 +59,7 @@ public class MailAppealService {
* @return * @return
*/ */
public AjaxResult<MailAppeal> getAppeal(String id) { public AjaxResult<MailAppeal> getAppeal(String id) {
return AjaxResult.success(mailAppealMapper.selectById(id)); return AjaxResult.success(mailAppealMapper.selectOne(new QueryWrapper<MailAppeal>().eq("mail_id", id)));
} }
/** /**
@ -58,7 +70,7 @@ public class MailAppealService {
* @return * @return
*/ */
public AjaxResult<Void> overruleAppeal(String id, String overruleReason) { public AjaxResult<Void> overruleAppeal(String id, String overruleReason) {
MailAppeal appeal = mailAppealMapper.selectById(id); MailAppeal appeal = mailAppealMapper.selectOne(new QueryWrapper<MailAppeal>().eq("mail_id", id));
Integer deptId = AdminThreadLocal.getDeptId(); Integer deptId = AdminThreadLocal.getDeptId();
Dept dept = deptMapper.selectById(deptId); Dept dept = deptMapper.selectById(deptId);
switch (dept.getLevel()) { switch (dept.getLevel()) {
@ -84,13 +96,16 @@ public class MailAppealService {
* @return * @return
*/ */
public AjaxResult<Void> approved(String id) { public AjaxResult<Void> approved(String id) {
MailAppeal appeal = mailAppealMapper.selectById(id); MailAppeal appeal = mailAppealMapper.selectOne(new QueryWrapper<MailAppeal>().eq("mail_id", id));
Mail mail = mailMapper.selectById(appeal.getMailId());
Integer deptId = AdminThreadLocal.getDeptId(); Integer deptId = AdminThreadLocal.getDeptId();
Dept dept = deptMapper.selectById(deptId); Dept dept = deptMapper.selectById(deptId);
appeal.setHandlingDept(deptId); appeal.setHandlingDept(deptId);
switch (dept.getLevel()) { switch (dept.getLevel()) {
case 1: case 1:
appeal.setStep("3").setAppealState("2"); appeal.setStep("3").setAppealState("2");
mail.setVerifyFeedback("基本满意").setSatisfactionStatus("基本满意");
mailMapper.updateById(mail);
break; break;
case 2: case 2:
appeal.setSecondDept(deptId).setStep("2"); appeal.setSecondDept(deptId).setStep("2");

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

@ -420,8 +420,9 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
.le(StrUtil.isNotBlank(mailQuery.getMailTimeStartEnd()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", mailQuery.getMailTimeStartEnd()) .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.getSource()), "m.source", mailQuery.getSource())
.eq(StrUtil.isNotBlank(mailQuery.getMailLevel()), "m.mail_level", mailQuery.getMailLevel()) .eq(StrUtil.isNotBlank(mailQuery.getMailLevel()), "m.mail_level", mailQuery.getMailLevel())
// .eq(StrUtil.isNotBlank(todoQuery.getAppealState()), "m.appeal_state", todoQuery.getAppealState()) .nested(i -> i.eq("m.satisfaction_status", "不满意")
.and(qw -> qw.eq("m.satisfaction_status", "不满意").or().eq("m.verify_feedback", "不满意")); .or().eq("m.verify_feedback", "不满意"))
.or().apply("m.id = ma.mail_id");
mailCategorySearch(mailQuery, queryWrapper); mailCategorySearch(mailQuery, queryWrapper);
deptSearch(mailQuery, queryWrapper); deptSearch(mailQuery, queryWrapper);
roleCheck(queryWrapper); roleCheck(queryWrapper);
@ -441,7 +442,7 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
} }
// 排序 // 排序
queryWrapper.orderByDesc("m.mail_time"); queryWrapper.orderByDesc("m.mail_time");
return baseMapper.selectQueryPage(page, queryWrapper); return baseMapper.selectDissatisfiedPage(page, queryWrapper);
} }
/** /**

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

@ -54,4 +54,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${ew.getCustomSqlSegment} ${ew.getCustomSqlSegment}
</select> </select>
<select id="selectDissatisfiedPage" resultType="com.biutag.lan.domain.vo.QueryMailVo">
select distinct 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,m.flow_name,
ma.appeal_state,ma.handling_dept,
f.limited_time - ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - m.flow_limited_last_handler_time))) flow_limited_remaining_time
from mail m
left join mail_appeal ma on ma.mail_id = m.id
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> </mapper>

Loading…
Cancel
Save