From ae17fedf4c852aa0a0f87e635231d90a5b88f48e Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期四, 06 三月 2025 16:49:25 +0800 Subject: [PATCH] 权限 --- ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TBillController.java | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TBillController.java b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TBillController.java index 9212a3e..9681509 100644 --- a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TBillController.java +++ b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TBillController.java @@ -21,6 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.time.LocalDateTime; +import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; @@ -55,19 +57,24 @@ @ApiOperation(value = "缴费账单查询分页列表") @PostMapping("list") public R<PageInfo<TBillDto>> list(@RequestBody TBillQuery query){ - if (StringUtils.isEmpty(query.getUserId())){ - throw new ServiceException("用户ID不能为空"); - } + String userId = tokenService.getLoginUserApplet().getUserId(); + query.setUserId(userId); PageInfo<TBillDto> pageInfo = tBillService.queryPage(query); return R.ok(pageInfo); + } + + public static void main(String[] args) { + LocalDateTime localDateTime1 = LocalDateTime.now().withYear(2025).withMonth(11).withDayOfMonth(1); + LocalDateTime localDateTime2 = LocalDateTime.now().withYear(2025).withMonth(11).withDayOfMonth(28); + long allDays = ChronoUnit.DAYS.between(localDateTime1, localDateTime2); + System.err.println(allDays); } @ApiOperation(value = "缴费账单查询列表") @PostMapping("/getBillIds") public R<List<String>> getBillIds(@RequestBody TBillQuery query){ - if (StringUtils.isEmpty(query.getUserId())){ - throw new ServiceException("用户ID不能为空"); - } + String userId = tokenService.getLoginUserApplet().getUserId(); + query.setUserId(userId); List<String> billIds = tBillService.getBillIds(query); return R.ok(billIds); } @@ -97,7 +104,7 @@ billVO.setConcatEndTime(contract.getEndTime()); }); billVO.setBillType(DictUtils.getDictLabel(DictConstants.DICT_TYPE_BILL_TYPE,billVO.getBillType())); - billVO.setPayFeesStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_PAY_FEES_STATUS,billVO.getPayFeesStatus())); +// billVO.setPayFeesStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_PAY_FEES_STATUS,billVO.getPayFeesStatus())); return R.ok(billVO); } @@ -124,8 +131,7 @@ @PostMapping(value = "/invoiceList") public R<PageInfo<TBillDto>> invoiceList(@RequestBody TBillQuery query) { -// Long userId = tokenService.getLoginUser().getUserId(); - String userId = "1881967035070177281"; + String userId = tokenService.getLoginUserApplet().getUserId(); query.setUserId(userId); PageInfo<TBillDto> pageInfo = tBillService.invoiceList(query); return R.ok(pageInfo); -- Gitblit v1.7.1