|
|
|
@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.biutag.supervision.common.UserContextHolder; |
|
|
|
import com.biutag.supervision.common.UserContextHolder; |
|
|
|
import com.biutag.supervision.constants.enums.ProcessingStatusEnum; |
|
|
|
import com.biutag.supervision.constants.AppConstants; |
|
|
|
import com.biutag.supervision.constants.enums.RoleCodeEnum; |
|
|
|
import com.biutag.supervision.constants.enums.RoleCodeEnum; |
|
|
|
import com.biutag.supervision.constants.enums.WorkStatusEnum; |
|
|
|
import com.biutag.supervision.constants.enums.WorkStatusEnum; |
|
|
|
import com.biutag.supervision.pojo.dto.ActionDto; |
|
|
|
import com.biutag.supervision.pojo.dto.ActionDto; |
|
|
|
@ -43,7 +43,7 @@ public class ApplyExtensionAction implements Action { |
|
|
|
ExtensionApplyData extensionApplyData = BeanUtil.toBean(actionDto.getData(), ExtensionApplyData.class); |
|
|
|
ExtensionApplyData extensionApplyData = BeanUtil.toBean(actionDto.getData(), ExtensionApplyData.class); |
|
|
|
NegativeExtensionApply extensionApply = addExtensionApply(actionDto, extensionApplyData); |
|
|
|
NegativeExtensionApply extensionApply = addExtensionApply(actionDto, extensionApplyData); |
|
|
|
updateNegative(actionDto.getNegativeId(), extensionApply.getId()); |
|
|
|
updateNegative(actionDto.getNegativeId(), extensionApply.getId()); |
|
|
|
addWork(actionDto, RoleCodeEnum.SECOND_ADMIN.getCode()); |
|
|
|
addWork(actionDto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public NegativeExtensionApply addExtensionApply(ActionDto actionDto, ExtensionApplyData applyExtensionData) { |
|
|
|
public NegativeExtensionApply addExtensionApply(ActionDto actionDto, ExtensionApplyData applyExtensionData) { |
|
|
|
@ -70,20 +70,33 @@ public class ApplyExtensionAction implements Action { |
|
|
|
.eq(Negative::getId, negativeId)); |
|
|
|
.eq(Negative::getId, negativeId)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void addWork(ActionDto actionDto, String roleCode) { |
|
|
|
public void addWork(ActionDto actionDto) { |
|
|
|
NegativeWork currentWork = workService.getById(actionDto.getWorkId()); |
|
|
|
NegativeWork currentWork = workService.getById(actionDto.getWorkId()); |
|
|
|
SupDepart depart = departService.getById(currentWork.getDepartId()); |
|
|
|
Negative negative = negativeService.getById(actionDto.getNegativeId()); |
|
|
|
SupDepart parentDepart = departService.getById(depart.getPid()); |
|
|
|
String roleCode; |
|
|
|
|
|
|
|
String departId; |
|
|
|
|
|
|
|
String departName; |
|
|
|
|
|
|
|
// 是否是二级机构办理
|
|
|
|
|
|
|
|
if (negative.getIsSecondHandle()) { |
|
|
|
|
|
|
|
roleCode = RoleCodeEnum.FIRST_ADMIN.getCode(); |
|
|
|
|
|
|
|
departId = AppConstants.ROOT_DEPART_ID; |
|
|
|
|
|
|
|
departName = AppConstants.ROOT_DEPART_NAME; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
roleCode = RoleCodeEnum.SECOND_ADMIN.getCode(); |
|
|
|
|
|
|
|
SupDepart parentDepart = departService.getParentDepart(currentWork.getDepartId()); |
|
|
|
|
|
|
|
departId = parentDepart.getId(); |
|
|
|
|
|
|
|
departName = parentDepart.getShortName(); |
|
|
|
|
|
|
|
} |
|
|
|
workService.remove(new LambdaQueryWrapper<NegativeWork>() |
|
|
|
workService.remove(new LambdaQueryWrapper<NegativeWork>() |
|
|
|
.eq(NegativeWork::getNegativeId, actionDto.getNegativeId()) |
|
|
|
.eq(NegativeWork::getNegativeId, actionDto.getNegativeId()) |
|
|
|
.eq(NegativeWork::getRoleCode, roleCode) |
|
|
|
.eq(NegativeWork::getRoleCode, roleCode) |
|
|
|
.eq(NegativeWork::getDepartId, parentDepart.getId())); |
|
|
|
.eq(NegativeWork::getDepartId, departId)); |
|
|
|
Negative negative = negativeService.getById(actionDto.getNegativeId()); |
|
|
|
|
|
|
|
NegativeWork work = new NegativeWork() |
|
|
|
NegativeWork work = new NegativeWork() |
|
|
|
.setNegativeId(actionDto.getNegativeId()) |
|
|
|
.setNegativeId(actionDto.getNegativeId()) |
|
|
|
.setRoleCode(roleCode) |
|
|
|
.setRoleCode(roleCode) |
|
|
|
.setDepartId(parentDepart.getId()) |
|
|
|
.setDepartId(departId) |
|
|
|
.setDepartName(parentDepart.getName()) |
|
|
|
.setDepartName(departName) |
|
|
|
.setProblemSourcesCode(negative.getProblemSourcesCode()) |
|
|
|
.setProblemSourcesCode(negative.getProblemSourcesCode()) |
|
|
|
.setFlowKey(actionDto.getNextFlowKey()) |
|
|
|
.setFlowKey(actionDto.getNextFlowKey()) |
|
|
|
.setCreateTime(LocalDateTime.now()) |
|
|
|
.setCreateTime(LocalDateTime.now()) |
|
|
|
|