|
@@ -15,7 +15,6 @@ import cn.iocoder.yudao.module.expense.service.expensetype.ExpenseTypeService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -39,14 +38,14 @@ public class ExpenseTypeController {
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建报销类型信息")
|
|
|
- @PreAuthorize("@ss.hasPermission('expense:type:create')")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('expense:type:create')")
|
|
|
public CommonResult<Long> createType(@Valid @RequestBody ExpenseTypeSaveReqVO createReqVO) {
|
|
|
return success(typeService.createType(createReqVO));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
@Operation(summary = "更新报销类型信息")
|
|
|
- @PreAuthorize("@ss.hasPermission('expense:type:update')")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('expense:type:update')")
|
|
|
public CommonResult<Boolean> updateType(@Valid @RequestBody ExpenseTypeSaveReqVO updateReqVO) {
|
|
|
typeService.updateType(updateReqVO);
|
|
|
return success(true);
|
|
@@ -55,7 +54,7 @@ public class ExpenseTypeController {
|
|
|
@DeleteMapping("/delete")
|
|
|
@Operation(summary = "删除报销类型信息")
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
- @PreAuthorize("@ss.hasPermission('expense:type:delete')")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('expense:type:delete')")
|
|
|
public CommonResult<Boolean> deleteType(@RequestParam("id") Long id) {
|
|
|
typeService.deleteType(id);
|
|
|
return success(true);
|
|
@@ -64,7 +63,7 @@ public class ExpenseTypeController {
|
|
|
@GetMapping("/get")
|
|
|
@Operation(summary = "获得报销类型信息")
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
- @PreAuthorize("@ss.hasPermission('expense:type:query')")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('expense:type:query')")
|
|
|
public CommonResult<ExpenseTypeRespVO> getType(@RequestParam("id") Long id) {
|
|
|
ExpenseTypeDO type = typeService.getType(id);
|
|
|
return success(BeanUtils.toBean(type, ExpenseTypeRespVO.class));
|
|
@@ -72,15 +71,23 @@ public class ExpenseTypeController {
|
|
|
|
|
|
@GetMapping("/page")
|
|
|
@Operation(summary = "获得报销类型信息分页")
|
|
|
- @PreAuthorize("@ss.hasPermission('expense:type:query')")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('expense:type:query')")
|
|
|
public CommonResult<PageResult<ExpenseTypeRespVO>> getTypePage(@Valid ExpenseTypePageReqVO pageReqVO) {
|
|
|
PageResult<ExpenseTypeDO> pageResult = typeService.getTypePage(pageReqVO);
|
|
|
return success(BeanUtils.toBean(pageResult, ExpenseTypeRespVO.class));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/list")
|
|
|
+ @Operation(summary = "获得报销类型信息列表")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('expense:type:query')")
|
|
|
+ public CommonResult<List<ExpenseTypeRespVO>> getTypeList() {
|
|
|
+ List<ExpenseTypeDO> expenseTypeDOList = typeService.getTypeList();
|
|
|
+ return success(BeanUtils.toBean(expenseTypeDOList, ExpenseTypeRespVO.class), "获取报销类型列表成功");
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/export-excel")
|
|
|
@Operation(summary = "导出报销类型信息 Excel")
|
|
|
- @PreAuthorize("@ss.hasPermission('expense:type:export')")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('expense:type:export')")
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
public void exportTypeExcel(@Valid ExpenseTypePageReqVO pageReqVO,
|
|
|
HttpServletResponse response) throws IOException {
|
|
@@ -96,7 +103,7 @@ public class ExpenseTypeController {
|
|
|
@GetMapping("/item/list-by-expense-type-id")
|
|
|
@Operation(summary = "获得报销费用项目信息列表")
|
|
|
@Parameter(name = "expenseTypeId", description = "报销类型主键id")
|
|
|
- @PreAuthorize("@ss.hasPermission('expense:type:query')")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('expense:type:query')")
|
|
|
public CommonResult<List<ExpenseItemDO>> getItemListByExpenseTypeId(@RequestParam("expenseTypeId") Long expenseTypeId) {
|
|
|
return success(typeService.getItemListByExpenseTypeId(expenseTypeId));
|
|
|
}
|