| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.dto.*; |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.model.TBillConfirm; |
| | | import com.ruoyi.system.model.TBillDetail; |
| | | import com.ruoyi.system.query.TBillQuery; |
| | | import com.ruoyi.system.service.TBillConfirmService; |
| | | import com.ruoyi.system.service.TBillDetailService; |
| | | import com.ruoyi.system.service.TBillService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @Autowired |
| | | TBillDetailService tBillDetailService; |
| | | |
| | | @Autowired |
| | | TBillConfirmService tBillConfirmService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:list')") |
| | | @PreAuthorize("@ss.hasPermi('bill:list')") |
| | | @PostMapping("list") |
| | | @ApiOperation("分页查询账单列表") |
| | | public R<PageInfo<TBillDto>> list(@RequestBody TBillQuery query){ |
| | |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:add')") |
| | | @PreAuthorize("@ss.hasPermi('bill:list:addRent')") |
| | | @PostMapping("add") |
| | | @ApiOperation("新增账单") |
| | | public R<PageInfo<TBillDto>> add(@Validated @RequestBody TbillSaveDto bill){ |
| | |
| | | |
| | | @ApiOperation("通过ID查找详情") |
| | | @GetMapping("getDetailById") |
| | | public R<TBillDto> getDetailById(@Validated @NotEmpty String id){ |
| | | public R<TBillDto> getDetailById(@RequestParam String id){ |
| | | if (StringUtils.isEmpty(id)){ |
| | | return R.fail(); |
| | | } |
| | | TBillDto dto = tBillService.getDetailByBillId(id); |
| | | if (dto.getBillType().equals("3")){ |
| | | List<TBillDetail> details = tBillDetailService.getByBillId(id); |
| | |
| | | else dto.setElect(detail); //电费 |
| | | } |
| | | } |
| | | if (StringUtils.isNotEmpty(dto.getConfirmId())){ |
| | | TBillConfirm confirm = tBillConfirmService.getById(dto.getConfirmId()); |
| | | dto.setConfirm(confirm); |
| | | } |
| | | return R.ok(dto); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:checkOfflinePay')") |
| | | @PreAuthorize("@ss.hasPermi('bill:list:paid')") |
| | | @ApiOperation("确认线下缴费") |
| | | @PostMapping("checkOfflinePay") |
| | | public R checkOfflinePay(@Validated @RequestBody OfflinePayCheckDto dto){ |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:sendSmsByBillIds')") |
| | | @PreAuthorize("@ss.hasPermi('bill:list:sendMsg')") |
| | | @ApiOperation("账单批量发送短信通知") |
| | | @PostMapping("sendSmsByBillIds") |
| | | public R sendSmsByBillIds(@Validated @RequestBody SmsByBillDto dto){ |
| | |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:sendMailBatchByBillIds')") |
| | | @ApiOperation("账单批量发送邮件通知") |
| | | @PreAuthorize("@ss.hasPermi('bill:list:sendMail')") |
| | | @ApiOperation("账单批量发送邮箱通知") |
| | | @PostMapping("sendMailBatchByBillIds") |
| | | public R sendMailBatchByBillIds(@Validated @RequestBody SmsByBillDto dto){ |
| | | Integer failNum = tBillService.sendMailBatchByBillIds(dto); |
| | | return R.ok(failNum); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:cashPay')") |
| | | |
| | | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('bill:list:receipt')") |
| | | @ApiOperation("收款") |
| | | @PostMapping("cashPay") |
| | | public R cashPay(@RequestBody OfflinePayDto offlinePayDto){ |
| | | |
| | | return null; |
| | | public R cashPay(@RequestBody CachPayDto cachPayDto){ |
| | | tBillService.cashPay(cachPayDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("统计") |
| | | @GetMapping("statistics") |
| | | public R<BillStatisticsDto> statistics(){ |
| | | BillStatisticsDto dto = tBillService.statistics(); |
| | | return R.ok(dto); |
| | | } |
| | | |
| | | |
| | | |