|
|
|
|
@ -1,26 +1,32 @@
|
|
|
|
|
package com.biutag.supervision.controller.work; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.biutag.supervision.common.UserContextHolder; |
|
|
|
|
import com.biutag.supervision.common.validation.AddGroup; |
|
|
|
|
import com.biutag.supervision.common.validation.EditGroup; |
|
|
|
|
import com.biutag.supervision.constants.AppConstants; |
|
|
|
|
import com.biutag.supervision.constants.enums.FlowNodeEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.ProcessingStatusEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.RoleCodeEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.WorkStatusEnum; |
|
|
|
|
import com.biutag.supervision.flow.FlowService; |
|
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
|
import com.biutag.supervision.pojo.domain.NegativeDetail; |
|
|
|
|
import com.biutag.supervision.pojo.dto.ActionDto; |
|
|
|
|
import com.biutag.supervision.pojo.dto.NegativeDto; |
|
|
|
|
import com.biutag.supervision.pojo.entity.DepartNegativeRate; |
|
|
|
|
import com.biutag.supervision.pojo.entity.Negative; |
|
|
|
|
import com.biutag.supervision.pojo.entity.NegativeTask; |
|
|
|
|
import com.biutag.supervision.pojo.entity.*; |
|
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
|
import com.biutag.supervision.pojo.param.NegativeQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.vo.NegativeConfirmationCompletionVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.NegativeQueryVo; |
|
|
|
|
import com.biutag.supervision.service.*; |
|
|
|
|
import com.biutag.supervision.util.JSON; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
@ -42,6 +48,8 @@ public class NegativeController {
|
|
|
|
|
|
|
|
|
|
private final DepartNegativeRateService departNegativeRateService; |
|
|
|
|
|
|
|
|
|
private final NegativeWorkService negativeWorkService; |
|
|
|
|
|
|
|
|
|
@GetMapping |
|
|
|
|
public Result<Page<NegativeQueryVo>> list(NegativeQueryParam queryParam) { |
|
|
|
|
return Result.success(negativeQueryService.page(queryParam)); |
|
|
|
|
@ -108,6 +116,30 @@ public class NegativeController {
|
|
|
|
|
return Result.success(flowService.execute(action)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private final NegativeHistoryService historyService; |
|
|
|
|
|
|
|
|
|
@PostMapping("{id}/transferTodo") |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public Result<Boolean> transferTodo(@PathVariable String id) { |
|
|
|
|
negativeService.update(new LambdaUpdateWrapper<Negative>().eq(Negative::getId, id).set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name()) |
|
|
|
|
.set(Negative::getFlowKey, FlowNodeEnum.FIRST_APPROVE.getKey()).set(Negative::getUpdTime, LocalDateTime.now())); |
|
|
|
|
negativeWorkService.update(new LambdaUpdateWrapper<NegativeWork>().eq(NegativeWork::getNegativeId, id) |
|
|
|
|
.eq(NegativeWork::getRoleCode, RoleCodeEnum.FIRST_ADMIN.getCode()) |
|
|
|
|
.set(NegativeWork::getStatus, WorkStatusEnum.todo.name()) |
|
|
|
|
.set(NegativeWork::getUpdateTime, LocalDateTime.now())); |
|
|
|
|
UserAuth user = UserContextHolder.getCurrentUser(); |
|
|
|
|
NegativeHistory history = new NegativeHistory().setHistoryId(IdUtil.fastSimpleUUID()) |
|
|
|
|
.setNegativeId(id) |
|
|
|
|
.setActionName("转为待办") |
|
|
|
|
.setDepartName(AppConstants.ROOT_DEPART_NAME) |
|
|
|
|
.setCrtUser(user.getUserId()) |
|
|
|
|
.setCrtUserName(user.getUserName()) |
|
|
|
|
.setCrtName(user.getNickName()) |
|
|
|
|
.setCrtTime(LocalDateTime.now()); |
|
|
|
|
historyService.save(history); |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("export/excel") |
|
|
|
|
public Result<Void> export(NegativeQueryParam queryParam) { |
|
|
|
|
queryParam.setSize(10000); |
|
|
|
|
|