Browse Source

信件转代办实现

master
21819 2 years ago
parent
commit
3ae5648248
  1. 5
      mailbox-lan/src/main/java/com/biutag/lan/controller/work/WorkController.java
  2. 20
      mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java

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

@ -74,6 +74,11 @@ public class WorkController {
return AjaxResult.success(mailService.getMailFlowDetailByWork(mailId, workId));
}
@GetMapping("change")
public AjaxResult<Void> change(@RequestParam String mailId) {
return mailService.change(mailId) ? AjaxResult.success() : AjaxResult.failed("操作失败");
}
@NotPower
@NotLogin
@GetMapping("send")

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

@ -26,6 +26,7 @@ import com.biutag.lan.enums.WorkType;
import com.biutag.lan.flow.*;
import com.biutag.lan.flow.node.FirstSignFlow;
import com.biutag.lan.mapper.MailMapper;
import com.biutag.lan.mapper.WorkMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -53,6 +54,8 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
private final WorkService workService;
private final WorkMapper workMapper;
private final MailCountersignService mailCountersignService;
private final IDeptService deptService;
@ -365,4 +368,21 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
return exists(new LambdaQueryWrapper<Mail>().eq(Mail::getId, mailId));
}
/**
* 信件转为待办
*
* @param mailId
* @return
*/
public boolean change(String mailId) {
Mail mail = getById(mailId);
mail.setFlowKey(FlowNodeEnum.FIRST_SIGN.getKey())
.setMailState(MailState.processing.getValue())
.setFlowName(FlowNodeEnum.FIRST_SIGN.getFullName())
.setMailCategory("").setMailFirstCategory("");
Work work = workMapper.selectOne(new LambdaQueryWrapper<Work>().eq(Work::getMailId, mailId));
work.setWorkState(Work.State.todo.name());
workMapper.updateById(work);
return updateById(mail);
}
}

Loading…
Cancel
Save