|
|
|
|
@ -7,6 +7,7 @@ import com.biutag.lan.domain.Mail;
|
|
|
|
|
import com.biutag.lan.domain.MailMark; |
|
|
|
|
import com.biutag.lan.domain.MailSource; |
|
|
|
|
import com.biutag.lan.domain.Work; |
|
|
|
|
import com.biutag.lan.enums.MailCategory; |
|
|
|
|
import com.biutag.lan.enums.MailState; |
|
|
|
|
import com.biutag.lan.flow.Flow; |
|
|
|
|
import com.biutag.lan.service.MailMarkService; |
|
|
|
|
@ -16,6 +17,7 @@ import com.biutag.lan.service.WorkService;
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.util.Assert; |
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
@ -37,13 +39,23 @@ public class FirstSignFlow extends Flow {
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public Flow next(String nextActionKey, String mailId, JSONObject data) { |
|
|
|
|
String empNo = AdminThreadLocal.getEmpNo(); |
|
|
|
|
String mailFirstCategory = data.getString("mailFirstCategory"); |
|
|
|
|
Assert.hasText(mailFirstCategory, "参数错误"); |
|
|
|
|
if (mailFirstCategory.equals(MailCategory.INVALID.getName()) || |
|
|
|
|
mailFirstCategory.equals(MailCategory.TERMINATION.getName())) { |
|
|
|
|
throw new BusinessException("参数错误"); |
|
|
|
|
} |
|
|
|
|
if (mailFirstCategory.equals(MailCategory.CONSULTATION_AND_ASSISTANCE.getName()) || |
|
|
|
|
mailFirstCategory.equals(MailCategory.WORK_SUGGESTIONS.getName())) { |
|
|
|
|
Assert.notNull(data.getBoolean("simpleFlowFlag"), "参数错误"); |
|
|
|
|
} |
|
|
|
|
Integer roleId = AdminThreadLocal.getRoleIds().get(0); |
|
|
|
|
Integer deptId = AdminThreadLocal.getDeptId(); |
|
|
|
|
Work work = workService.getxByUnSign(mailId, roleId ,deptId); |
|
|
|
|
if (work == null) { |
|
|
|
|
throw new BusinessException("该信件已被其他人签收"); |
|
|
|
|
} |
|
|
|
|
String empNo = AdminThreadLocal.getEmpNo(); |
|
|
|
|
// 更新我的工作
|
|
|
|
|
work.setPoliceEmpNo(empNo) |
|
|
|
|
.setUpdateTime(LocalDateTime.now()); |
|
|
|
|
@ -53,7 +65,7 @@ public class FirstSignFlow extends Flow {
|
|
|
|
|
.setSignFlag(true); |
|
|
|
|
mailSourceService.updateById(mailSource); |
|
|
|
|
Flow nextNode = next.get(nextActionKey); |
|
|
|
|
String mailFirstCategory = data.getString("mailFirstCategory"); |
|
|
|
|
|
|
|
|
|
String mailSecondCategory = data.getString("mailSecondCategory"); |
|
|
|
|
String mailThreeCategory = data.getString("mailThreeCategory"); |
|
|
|
|
String mailCategory = data.getString("mailCategory"); |
|
|
|
|
@ -65,6 +77,7 @@ public class FirstSignFlow extends Flow {
|
|
|
|
|
.setMailThreeCategory(mailThreeCategory) |
|
|
|
|
.setMailCategory(mailCategory) |
|
|
|
|
.setMailLevel(data.getString("mailLevel")) |
|
|
|
|
.setSimpleFlowFlag(data.getBoolean("simpleFlowFlag")) |
|
|
|
|
.setFlowKey(nextNode.getFlowNode().getKey()) |
|
|
|
|
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName()) |
|
|
|
|
.setFlowLimitedLastHandlerTime(mailSource.getCreateTime()); |
|
|
|
|
|