From c68c1829c8f345f5b745f37196bc920994107acd Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 27 二月 2025 17:00:41 +0800
Subject: [PATCH] 小程序管理员接口
---
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TBillController.java | 50 ++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 42 insertions(+), 8 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 bee1f33..c90ea72 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
@@ -8,14 +8,12 @@
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.dto.TBillDto;
import com.ruoyi.system.dto.TInvoiceDTO;
import com.ruoyi.system.model.*;
import com.ruoyi.system.query.TBillQuery;
-import com.ruoyi.system.service.TBillDetailService;
-import com.ruoyi.system.service.TBillService;
-import com.ruoyi.system.service.TInvoiceService;
-import com.ruoyi.system.service.TInvoiceToBillService;
+import com.ruoyi.system.service.*;
import com.ruoyi.system.vo.TBillVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -44,18 +42,32 @@
@Autowired
TBillDetailService billDetailService;
@Autowired
+ TContractService contractService;
+ @Autowired
+ THouseService houseService;
+ @Autowired
TInvoiceService invoiceService;
@Autowired
TInvoiceToBillService invoiceToBillService;
+ @Autowired
+ TokenService tokenService;
@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);
+ }
+
+ @ApiOperation(value = "缴费账单查询列表")
+ @PostMapping("/getBillIds")
+ public R<List<String>> getBillIds(@RequestBody TBillQuery query){
+ String userId = tokenService.getLoginUserApplet().getUserId();
+ query.setUserId(userId);
+ List<String> billIds = tBillService.getBillIds(query);
+ return R.ok(billIds);
}
@ApiOperation(value = "查看缴费账单详情")
@@ -70,8 +82,20 @@
.eq(TBillDetail::getBillId, id));
billVO.setBillDetailList(list);
}
+ // 查询合同信息
+ contractService.lambdaQuery().eq(TContract::getId, bill.getContractId()).oneOpt().ifPresent(contract -> {
+ // 查询房屋信息
+ billVO.setHouse(houseService.getById(contract.getHouseId()));
+ billVO.setMonthRent(contract.getMonthRent());
+ billVO.setPayType(contract.getPayType());
+ billVO.setDeposit(contract.getDeposit());
+ billVO.setPartyOnePerson(contract.getPartyOnePerson());
+ billVO.setPartyOnePhone(contract.getPartyOnePhone());
+ billVO.setConcatStartTime(contract.getStartTime());
+ 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);
}
@@ -94,5 +118,15 @@
return R.ok();
}
+ @ApiOperation(value = "缴费账单开票列表")
+ @PostMapping(value = "/invoiceList")
+ public R<PageInfo<TBillDto>> invoiceList(@RequestBody TBillQuery query) {
+
+ String userId = tokenService.getLoginUserApplet().getUserId();
+ query.setUserId(userId);
+ PageInfo<TBillDto> pageInfo = tBillService.invoiceList(query);
+ return R.ok(pageInfo);
+ }
+
}
--
Gitblit v1.7.1