| | |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.system.dto.*; |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.model.TBillDetail; |
| | | import com.ruoyi.system.query.TBillQuery; |
| | | import com.ruoyi.system.service.TBillDetailService; |
| | | import com.ruoyi.system.service.TBillService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-01-17 |
| | | */ |
| | | @Api(tags = "账单管理") |
| | | @RestController |
| | | @RequestMapping("/t-bill") |
| | | public class TBillController { |
| | |
| | | @Autowired |
| | | TBillService tBillService; |
| | | |
| | | @Autowired |
| | | TBillDetailService tBillDetailService; |
| | | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:list')") |
| | | @PostMapping("list") |
| | | public R<PageInfo<TBill>> list(@RequestBody TBillQuery query){ |
| | | PageInfo<TBill> pageInfo = tBillService.queryPage(query); |
| | | @ApiOperation("分页查询账单列表") |
| | | public R<PageInfo<TBillDto>> list(@RequestBody TBillQuery query){ |
| | | PageInfo<TBillDto> pageInfo = tBillService.queryPage(query); |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:add')") |
| | | @PostMapping("add") |
| | | @ApiOperation("新增账单") |
| | | public R<PageInfo<TBillDto>> add(@Validated @RequestBody TbillSaveDto bill){ |
| | | tBillService.saveBill(bill); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("通过ID查找详情") |
| | | @GetMapping("getDetailById") |
| | | public R<TBillDto> getDetailById(@Validated @NotEmpty String id){ |
| | | TBillDto dto = tBillService.getDetailByBillId(id); |
| | | if (dto.getBillType().equals("3")){ |
| | | List<TBillDetail> details = tBillDetailService.getByBillId(id); |
| | | for (TBillDetail detail : details) { |
| | | if (detail.getLiveType()==1)dto.setWater(detail); //水费 |
| | | else dto.setElect(detail); //电费 |
| | | } |
| | | } |
| | | return R.ok(dto); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:checkOfflinePay')") |
| | | @ApiOperation("确认线下缴费") |
| | | @PostMapping("checkOfflinePay") |
| | | public R checkOfflinePay(@Validated @RequestBody OfflinePayCheckDto dto){ |
| | | tBillService.checkOfflinePay(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:sendSmsByBillIds')") |
| | | @ApiOperation("账单批量发送短信通知") |
| | | @PostMapping("sendSmsByBillIds") |
| | | public R sendSmsByBillIds(@Validated @RequestBody SmsByBillDto dto){ |
| | | Integer failNum = tBillService.sendSmsByBillIds(dto); |
| | | return R.ok(failNum); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:bill:sendMailBatchByBillIds')") |
| | | @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')") |
| | | @ApiOperation("收款") |
| | | @PostMapping("cashPay") |
| | | public R cashPay(@RequestBody OfflinePayDto offlinePayDto){ |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |