|
|
@@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.ElderlyFixedExpenseAppendReqVO;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.ExpenseRespVO;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.ExpenseSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.ExpenseItemDO;
|
|
|
import cn.iocoder.yudao.module.system.service.biz.ExpenseService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
@@ -18,6 +19,8 @@ import javax.validation.Valid;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
|
|
|
|
|
@@ -66,46 +69,26 @@ public class ExpenseController {
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/deleteExpenseItems")
|
|
|
+ @Operation(summary = "长者删除固定费用")
|
|
|
+ @TenantIgnore
|
|
|
+ public CommonResult<Boolean> deleteExpenseItems(@RequestBody List<Long> expenseItemIdList) {
|
|
|
+ expenseService.deleteExpenseItems(expenseItemIdList);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
|
|
|
-//
|
|
|
-// @PutMapping("/update")
|
|
|
-// @Operation(summary = "更新长者费用记录")
|
|
|
-// @PreAuthorize("@ss.hasPermission('elderly:expense:update')")
|
|
|
-// public CommonResult<Boolean> updateExpense(@Valid @RequestBody ExpenseSaveReqVO updateReqVO) {
|
|
|
-// expenseService.updateExpense(updateReqVO);
|
|
|
-// return success(true);
|
|
|
-// }
|
|
|
-//
|
|
|
-// @DeleteMapping("/delete")
|
|
|
-// @Operation(summary = "删除长者费用记录")
|
|
|
-// @Parameter(name = "id", description = "编号", required = true)
|
|
|
-// @PreAuthorize("@ss.hasPermission('elderly:expense:delete')")
|
|
|
-// public CommonResult<Boolean> deleteExpense(@RequestParam("id") Long id) {
|
|
|
-// expenseService.deleteExpense(id);
|
|
|
-// return success(true);
|
|
|
-// }
|
|
|
-//
|
|
|
-
|
|
|
-//
|
|
|
-// @GetMapping("/page")
|
|
|
-// @Operation(summary = "获得长者费用记录分页")
|
|
|
-// @PreAuthorize("@ss.hasPermission('elderly:expense:query')")
|
|
|
-// public CommonResult<PageResult<ExpenseRespVO>> getExpensePage(@Valid ExpensePageReqVO pageReqVO) {
|
|
|
-// PageResult<ExpenseDO> pageResult = expenseService.getExpensePage(pageReqVO);
|
|
|
-// return success(BeanUtils.toBean(pageResult, ExpenseRespVO.class));
|
|
|
-// }
|
|
|
-//
|
|
|
-// @GetMapping("/export-excel")
|
|
|
-// @Operation(summary = "导出长者费用记录 Excel")
|
|
|
-// @PreAuthorize("@ss.hasPermission('elderly:expense:export')")
|
|
|
-// @ApiAccessLog(operateType = EXPORT)
|
|
|
-// public void exportExpenseExcel(@Valid ExpensePageReqVO pageReqVO,
|
|
|
-// HttpServletResponse response) throws IOException {
|
|
|
-// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
-// List<ExpenseDO> list = expenseService.getExpensePage(pageReqVO).getList();
|
|
|
-// // 导出 Excel
|
|
|
-// ExcelUtils.write(response, "长者费用记录.xls", "数据", ExpenseRespVO.class,
|
|
|
-// BeanUtils.toBean(list, ExpenseRespVO.class));
|
|
|
-// }
|
|
|
+ @GetMapping("/getExpenseItemsByElderId")
|
|
|
+ @Operation(summary = "获取长者所有固定费用")
|
|
|
+ @TenantIgnore
|
|
|
+ public CommonResult<List<ExpenseItemDO>> getExpenseItemsByElderId(@RequestParam("elderId") Long elderId) {
|
|
|
+ return success(expenseService.getExpenseItemsByElderId(elderId));
|
|
|
+ }
|
|
|
|
|
|
+ @PostMapping("/updateExpenseItems")
|
|
|
+ @Operation(summary = "长者更新固定费用")
|
|
|
+ @TenantIgnore
|
|
|
+ public CommonResult<Boolean> updateExpenseItems(@RequestBody ExpenseItemDO updateItem){
|
|
|
+ expenseService.updateExpenseItems(updateItem);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
}
|