|
|
@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
|
|
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
|
|
|
import cn.iocoder.yudao.module.bpm.service.expenseapplytrip.ExpenseApplyTripService;
|
|
|
|
import cn.iocoder.yudao.module.bpm.service.expenseapplytrip.ExpenseApplyTripService;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
|
|
|
|
import cn.iocoder.yudao.module.bs.controller.admin.expenseapply.vo.*;
|
|
|
|
import cn.iocoder.yudao.module.bs.controller.admin.expenseapply.vo.*;
|
|
|
|
import cn.iocoder.yudao.module.bs.convert.expenseapply.ExpenseApplyConvert;
|
|
|
|
import cn.iocoder.yudao.module.bs.convert.expenseapply.ExpenseApplyConvert;
|
|
|
|
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapply.ExpenseApplyDO;
|
|
|
|
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapply.ExpenseApplyDO;
|
|
|
@ -16,6 +17,7 @@ import cn.iocoder.yudao.module.bs.enums.BillTypeEnum;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@ -43,6 +45,9 @@ public class ExpenseApplyController {
|
|
|
|
private ExpenseApplyService expenseApplyService;
|
|
|
|
private ExpenseApplyService expenseApplyService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private ExpenseApplyTripService expenseApplyTripService;
|
|
|
|
private ExpenseApplyTripService expenseApplyTripService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
@Lazy // 解决循环依赖
|
|
|
|
|
|
|
|
private BpmTaskService taskService;
|
|
|
|
@PostMapping("/create")
|
|
|
|
@PostMapping("/create")
|
|
|
|
@Operation(summary = "创建申请单")
|
|
|
|
@Operation(summary = "创建申请单")
|
|
|
|
@PreAuthorize("@ss.hasPermission('bs:expense-apply:create')")
|
|
|
|
@PreAuthorize("@ss.hasPermission('bs:expense-apply:create')")
|
|
|
@ -74,6 +79,7 @@ public class ExpenseApplyController {
|
|
|
|
expenseApplyService.setNickNameField(CollUtil.toList(expenseApply));
|
|
|
|
expenseApplyService.setNickNameField(CollUtil.toList(expenseApply));
|
|
|
|
expenseApplyService.setDeptNameField(CollUtil.toList(expenseApply));
|
|
|
|
expenseApplyService.setDeptNameField(CollUtil.toList(expenseApply));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
taskService.handleApprovalAuthority(CollUtil.toList(expenseApply));
|
|
|
|
return success(expenseApply);
|
|
|
|
return success(expenseApply);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -93,7 +99,6 @@ public class ExpenseApplyController {
|
|
|
|
PageResult<ExpenseApplyDO> pageResult = expenseApplyService.getExpenseApplyPage(pageVO);
|
|
|
|
PageResult<ExpenseApplyDO> pageResult = expenseApplyService.getExpenseApplyPage(pageVO);
|
|
|
|
List<ExpenseApplyDO> list = pageResult.getList();
|
|
|
|
List<ExpenseApplyDO> list = pageResult.getList();
|
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
|
//cqptodo 待设置用户名称
|
|
|
|
|
|
|
|
expenseApplyService.setNickNameField(list);
|
|
|
|
expenseApplyService.setNickNameField(list);
|
|
|
|
List<Long> applids = list.stream().map(ExpenseApplyDO::getId).collect(Collectors.toList());
|
|
|
|
List<Long> applids = list.stream().map(ExpenseApplyDO::getId).collect(Collectors.toList());
|
|
|
|
LambdaQueryWrapperX<ExpenseApplyTripDO> queryWrapper = new LambdaQueryWrapperX<>();
|
|
|
|
LambdaQueryWrapperX<ExpenseApplyTripDO> queryWrapper = new LambdaQueryWrapperX<>();
|
|
|
@ -107,6 +112,8 @@ public class ExpenseApplyController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
apply.getExpenseApplyTrips().add(tripDO);
|
|
|
|
apply.getExpenseApplyTrips().add(tripDO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
taskService.handleApprovalAuthority(list);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return success(pageResult);
|
|
|
|
return success(pageResult);
|
|
|
|
}
|
|
|
|
}
|
|
|
|