|
|
|
@ -4,11 +4,13 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.bean.copier.CopyOptions; |
|
|
|
import cn.hutool.core.bean.copier.CopyOptions; |
|
|
|
import cn.hutool.core.date.DatePattern; |
|
|
|
import cn.hutool.core.date.DatePattern; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONArray; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.biutag.enums.RoleEnum; |
|
|
|
import com.biutag.enums.RoleEnum; |
|
|
|
import com.biutag.exception.BusinessException; |
|
|
|
import com.biutag.exception.BusinessException; |
|
|
|
import com.biutag.lan.config.AdminThreadLocal; |
|
|
|
import com.biutag.lan.config.AdminThreadLocal; |
|
|
|
import com.biutag.lan.domain.Mail; |
|
|
|
import com.biutag.lan.domain.Mail; |
|
|
|
|
|
|
|
import com.biutag.lan.domain.Work; |
|
|
|
import com.biutag.lan.enums.ExtensionState; |
|
|
|
import com.biutag.lan.enums.ExtensionState; |
|
|
|
import com.biutag.lan.enums.WorkType; |
|
|
|
import com.biutag.lan.enums.WorkType; |
|
|
|
import com.biutag.lan.flow.ActionEnum; |
|
|
|
import com.biutag.lan.flow.ActionEnum; |
|
|
|
@ -21,6 +23,7 @@ import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
|
|
|
|
@RequiredArgsConstructor |
|
|
|
@RequiredArgsConstructor |
|
|
|
@ -56,12 +59,14 @@ public class ThreeVerifyFlow extends Flow { |
|
|
|
Assert.notNull(extensionDays, "延期时长不能为空"); |
|
|
|
Assert.notNull(extensionDays, "延期时长不能为空"); |
|
|
|
String reason = data.getString("extensionReason"); |
|
|
|
String reason = data.getString("extensionReason"); |
|
|
|
Assert.hasText(reason, "延期理由不能为空"); |
|
|
|
Assert.hasText(reason, "延期理由不能为空"); |
|
|
|
|
|
|
|
Mail mail = mailService.getById(mailId); |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
|
|
|
|
|
|
|
// 给二级机构增加待办
|
|
|
|
// 给二级机构增加待办
|
|
|
|
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), WorkType.extension_approval.name(), now, FlowNameEnum.PENDING_APPROVAL.getName()); |
|
|
|
Work work = workService.getOne(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mail.getSecondDeptId()); |
|
|
|
|
|
|
|
work.setWorkType(WorkType.extension_approval.name()).setFlowName(FlowNameEnum.PENDING_APPROVAL.getName()).setUpdateTime(now); |
|
|
|
|
|
|
|
workService.updateById(work); |
|
|
|
|
|
|
|
|
|
|
|
Mail mail = mailService.getById(mailId); |
|
|
|
|
|
|
|
mail.setUpdateTime(now) |
|
|
|
mail.setUpdateTime(now) |
|
|
|
.setExtensionDays(extensionDays) |
|
|
|
.setExtensionDays(extensionDays) |
|
|
|
.setExtensionReason(reason) |
|
|
|
.setExtensionReason(reason) |
|
|
|
@ -157,11 +162,17 @@ public class ThreeVerifyFlow extends Flow { |
|
|
|
.setCompleteMethod(data.getString("completeMethod")) |
|
|
|
.setCompleteMethod(data.getString("completeMethod")) |
|
|
|
.setFlowKey(nextNode.getFlowNode().getKey()) |
|
|
|
.setFlowKey(nextNode.getFlowNode().getKey()) |
|
|
|
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName()); |
|
|
|
.setFlowBeforeName(nextNode.getFlowNode().getBeforeName()); |
|
|
|
mailService.updateById(mail); |
|
|
|
|
|
|
|
// 将本人下的件改为已办
|
|
|
|
// 将本人下的件改为已办
|
|
|
|
workService.updateDone(mail.getId(), AdminThreadLocal.getRoleId(), now); |
|
|
|
workService.updateDone(mail.getId(), AdminThreadLocal.getRoleId(), AdminThreadLocal.getDeptId(), FlowNameEnum.VERIFY.getDoneName()); |
|
|
|
// 处理协办民警
|
|
|
|
// 处理协办民警
|
|
|
|
threeSignFlow.saveCoHandling(mail, data); |
|
|
|
threeSignFlow.saveCoHandling(mail, data); |
|
|
|
|
|
|
|
JSONArray coHandingPolices = data.getJSONArray("coHandingPolices"); |
|
|
|
|
|
|
|
if (Objects.nonNull(coHandingPolices) && !coHandingPolices.isEmpty()) { |
|
|
|
|
|
|
|
mail.setCoHandlingPolices(coHandingPolices.toJSONString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 更新信件
|
|
|
|
|
|
|
|
mailService.updateById(mail); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Flow offline(String nextActionKey, String mailId, JSONObject data) { |
|
|
|
public Flow offline(String nextActionKey, String mailId, JSONObject data) { |
|
|
|
@ -170,7 +181,7 @@ public class ThreeVerifyFlow extends Flow { |
|
|
|
Mail mail = mailService.getById(mailId); |
|
|
|
Mail mail = mailService.getById(mailId); |
|
|
|
applicationCompleted(nextActionKey, mail, data, now); |
|
|
|
applicationCompleted(nextActionKey, mail, data, now); |
|
|
|
// 给二级机构专班增加待办
|
|
|
|
// 给二级机构专班增加待办
|
|
|
|
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), now, FlowNameEnum.PENDING_APPROVAL.getName()); |
|
|
|
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mail.getSecondDeptId(), FlowNameEnum.PENDING_APPROVAL.getName()); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|