|
|
|
|
@ -6,12 +6,14 @@ import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
import com.biutag.enums.RoleEnum; |
|
|
|
|
import com.biutag.lan.config.AdminThreadLocal; |
|
|
|
|
import com.biutag.lan.domain.Mail; |
|
|
|
|
import com.biutag.lan.domain.MailMark; |
|
|
|
|
import com.biutag.lan.domain.Work; |
|
|
|
|
import com.biutag.lan.flow.ActionEnum; |
|
|
|
|
import com.biutag.lan.flow.Flow; |
|
|
|
|
import com.biutag.lan.flow.FlowNameEnum; |
|
|
|
|
import com.biutag.lan.flow.FlowNodeEnum; |
|
|
|
|
import com.biutag.lan.service.IDeptService; |
|
|
|
|
import com.biutag.lan.service.MailMarkService; |
|
|
|
|
import com.biutag.lan.service.MailService; |
|
|
|
|
import com.biutag.lan.service.WorkService; |
|
|
|
|
import com.biutag.lan.vo.system.DeptVo; |
|
|
|
|
@ -31,6 +33,7 @@ public class SecondDistributeFlow extends Flow {
|
|
|
|
|
private final WorkService workService; |
|
|
|
|
private final IDeptService deptService; |
|
|
|
|
private final SecondSignFlow secondSignFlow; |
|
|
|
|
private final MailMarkService mailMarkService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
@ -77,7 +80,8 @@ public class SecondDistributeFlow extends Flow {
|
|
|
|
|
workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), secondDeptId1, now, false, |
|
|
|
|
FlowNameEnum.PENDING_SIGN_CO.getName(), |
|
|
|
|
FlowNodeEnum.SECONDARY_VERIFY.getKey()); |
|
|
|
|
secondDistributeInfo.put("secondDept1", JSONObject.of("id", secondDeptId1)); |
|
|
|
|
DeptVo secondDept = deptService.detail(secondDeptId1); |
|
|
|
|
secondDistributeInfo.put("secondDept1", JSONObject.of("id", secondDeptId1, "name", secondDept.getName())); |
|
|
|
|
} |
|
|
|
|
Integer secondDeptId2 = data.getInteger("secondDeptId2"); |
|
|
|
|
if (Objects.nonNull(secondDeptId2)) { |
|
|
|
|
@ -85,7 +89,8 @@ public class SecondDistributeFlow extends Flow {
|
|
|
|
|
workService.saveOrUpdate(mail, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), secondDeptId2, now, false, |
|
|
|
|
FlowNameEnum.PENDING_SIGN_CO.getName(), |
|
|
|
|
FlowNodeEnum.SECONDARY_VERIFY.getKey()); |
|
|
|
|
secondDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2)); |
|
|
|
|
DeptVo secondDept2 = deptService.detail(secondDeptId2); |
|
|
|
|
secondDistributeInfo.put("secondDept2", JSONObject.of("id", secondDeptId2, "name", secondDept2.getName())); |
|
|
|
|
} |
|
|
|
|
Flow nextNode = next.get(nextActionKey); |
|
|
|
|
mail.setSecondDistributeInfo(secondDistributeInfo.toJSONString()); |
|
|
|
|
@ -102,6 +107,9 @@ public class SecondDistributeFlow extends Flow {
|
|
|
|
|
if (Objects.nonNull(mainDeptLevel)) { |
|
|
|
|
mail.setMainDeptLevel(mainDeptLevel); |
|
|
|
|
} |
|
|
|
|
MailMark mailMark = mailMarkService.getById(mailId); |
|
|
|
|
mailMark.setThreeDeptId(mainDeptId).setThreeDeptName(deptVo.getName()); |
|
|
|
|
mailMarkService.updateById(mailMark); |
|
|
|
|
} |
|
|
|
|
mailService.updateById(mail); |
|
|
|
|
return null; |
|
|
|
|
|