|
|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
package com.biutag.supervision.flow.action; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.biutag.supervision.constants.enums.HostLevelEnums; |
|
|
|
|
import com.biutag.supervision.constants.enums.RoleCodeEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.WorkStatusEnum; |
|
|
|
|
import com.biutag.supervision.pojo.dto.ActionDto; |
|
|
|
|
@ -34,13 +36,14 @@ public class SecondDistributeAction implements Action {
|
|
|
|
|
@Override |
|
|
|
|
public void next(ActionDto actionDto) { |
|
|
|
|
SecondDistributeData secondDistributeData = BeanUtil.toBean(actionDto.getData(), SecondDistributeData.class); |
|
|
|
|
updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), secondDistributeData); |
|
|
|
|
Negative negative = negativeService.getById(actionDto.getNegativeId()); |
|
|
|
|
updateNegative(negative, actionDto.getNextFlowKey(), secondDistributeData); |
|
|
|
|
doneWork(actionDto.getWorkId()); |
|
|
|
|
addWork(actionDto.getNegativeId(), RoleCodeEnum.THREE_ADMIN.getCode(), secondDistributeData.getDepartId()); |
|
|
|
|
addWork(negative, RoleCodeEnum.THREE_ADMIN.getCode(), secondDistributeData.getDepartId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void updateNegative(String negativeId, String nextFlowKey, SecondDistributeData secondDistributeData) { |
|
|
|
|
negativeService.update(new LambdaUpdateWrapper<Negative>() |
|
|
|
|
public void updateNegative(Negative negative, String nextFlowKey, SecondDistributeData secondDistributeData) { |
|
|
|
|
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>() |
|
|
|
|
.set(Negative::getFlowKey, nextFlowKey) |
|
|
|
|
.set(Negative::getHandleThreeDepartId, secondDistributeData.getDepartId()) |
|
|
|
|
.set(Negative::getHandleThreeDepartName, secondDistributeData.getDepartName()) |
|
|
|
|
@ -48,7 +51,13 @@ public class SecondDistributeAction implements Action {
|
|
|
|
|
.set(Negative::getUpdTime, LocalDateTime.now()) |
|
|
|
|
// 当前处理对象
|
|
|
|
|
.set(Negative::getCurrentProcessingObject, String.format("%s专班", secondDistributeData.getDepartName())) |
|
|
|
|
.eq(Negative::getId, negativeId)); |
|
|
|
|
.eq(Negative::getId, negative.getId()); |
|
|
|
|
if (HostLevelEnums.THREE.getValue().equals(negative.getHostLevel()) && StrUtil.isBlank(negative.getThreeInvolveDepartId())) { |
|
|
|
|
updateWrapper |
|
|
|
|
.set(Negative::getInvolveDepartId, secondDistributeData.getDepartId()) |
|
|
|
|
.set(Negative::getThreeInvolveDepartId, secondDistributeData.getDepartId()); |
|
|
|
|
} |
|
|
|
|
negativeService.update(updateWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void doneWork(Integer workId) { |
|
|
|
|
@ -58,15 +67,15 @@ public class SecondDistributeAction implements Action {
|
|
|
|
|
.eq(NegativeWork::getId, workId)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void addWork(String negativeId, String roleCode, String departId) { |
|
|
|
|
public void addWork(Negative negative, String roleCode, String departId) { |
|
|
|
|
SupDepart depart = departService.getById(departId); |
|
|
|
|
workService.remove(new LambdaQueryWrapper<NegativeWork>() |
|
|
|
|
.eq(NegativeWork::getNegativeId, negativeId) |
|
|
|
|
.eq(NegativeWork::getNegativeId, negative.getId()) |
|
|
|
|
.eq(NegativeWork::getRoleCode, roleCode) |
|
|
|
|
.eq(NegativeWork::getDepartId, departId)); |
|
|
|
|
Negative negative = negativeService.getById(negativeId); |
|
|
|
|
|
|
|
|
|
NegativeWork work = new NegativeWork() |
|
|
|
|
.setNegativeId(negativeId) |
|
|
|
|
.setNegativeId(negative.getId()) |
|
|
|
|
.setRoleCode(roleCode) |
|
|
|
|
.setDepartId(departId) |
|
|
|
|
.setDepartName(depart.getShortName()) |
|
|
|
|
|