| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.PaymentRegistrationDto; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | |
| | | |
| | | @Operation(summary = "根据id查询付款流水") |
| | | @GetMapping("/getPaymentRegistrationById") |
| | | public AjaxResult getPaymentRegistrationById(Long id) { |
| | | public R<?> getPaymentRegistrationById(Long id) { |
| | | PaymentRegistration byId = paymentRegistrationService.getById(id); |
| | | return AjaxResult.success(byId); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | @Operation(summary = "修改付款流水") |
| | | @PutMapping("/updatePaymentRegistration") |
| | | @Log(title = "修改付款流水", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updatePaymentRegistration(@RequestBody PaymentRegistration paymentRegistratio) { |
| | | return AjaxResult.success(paymentRegistrationService.updatePaymentRegistration(paymentRegistratio)); |
| | | public R<?> updatePaymentRegistration(@RequestBody PaymentRegistration paymentRegistratio) { |
| | | return R.ok(paymentRegistrationService.updatePaymentRegistration(paymentRegistratio)); |
| | | } |
| | | |
| | | @Operation(summary = "删除付款流水") |
| | | @DeleteMapping("/delPaymentRegistration") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delPaymentRegistration(@RequestBody List<Long> id) { |
| | | return toAjax(paymentRegistrationService.delPaymentRegistration(id)); |
| | | public R<?> delPaymentRegistration(@RequestBody List<Long> id) { |
| | | paymentRegistrationService.delPaymentRegistration(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "来票登记", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrUpdateRegistration") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult addOrUpdateRegistration(@RequestBody List<TicketRegistrationDto> ticketRegistrationDto) throws IOException { |
| | | if(CollectionUtils.isEmpty(ticketRegistrationDto)) return AjaxResult.error("请选择要保存的记录"); |
| | | public R<?> addOrUpdateRegistration(@RequestBody List<TicketRegistrationDto> ticketRegistrationDto) throws IOException { |
| | | if(CollectionUtils.isEmpty(ticketRegistrationDto)) return R.fail("请选择要保存的记录"); |
| | | for (TicketRegistrationDto ticketRegistrationDto1 : ticketRegistrationDto) { |
| | | ticketRegistrationService.addOrUpdateRegistration(ticketRegistrationDto1); |
| | | } |
| | | return toAjax(1); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/getProductRecordById") |
| | | public AjaxResult getProductRecordById(@RequestBody ProductRecordDto productRecordDto) { |
| | | public R<?> getProductRecordById(@RequestBody ProductRecordDto productRecordDto) { |
| | | if (productRecordDto.getId() == null) { |
| | | return AjaxResult.error("参数错误"); |
| | | return R.fail("参数错误"); |
| | | } |
| | | return AjaxResult.success(productRecordService.getProductRecordById(productRecordDto)); |
| | | return R.ok(productRecordService.getProductRecordById(productRecordDto)); |
| | | } |
| | | |
| | | @Schema(description = "修改来票登记") |
| | | @PostMapping("/updateRegistration") |
| | | public AjaxResult updateRegistration(@RequestBody ProductRecordDto productRecordDto) { |
| | | public R<?> updateRegistration(@RequestBody ProductRecordDto productRecordDto) { |
| | | |
| | | return productRecordService.updateRecord(productRecordDto); |
| | | } |
| | |
| | | @Log(title = "删除来票登记(来票台账)", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delRegistration") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delRegistration(@RequestBody Long[] ids) { |
| | | return toAjax(ticketRegistrationService.delRegistration(ids)); |
| | | public R<?> delRegistration(@RequestBody Long[] ids) { |
| | | ticketRegistrationService.delRegistration(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 分页查询产品信息开票记录列表 |
| | | */ |
| | | @GetMapping("/productRecordPage") |
| | | public AjaxResult productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | public R<?> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | |
| | | IPage<ProductRecordDto> list = productRecordService.productRecordPage(page,ticketRegistrationDto); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询发票号 |
| | | */ |
| | | @GetMapping("/getTicketNo") |
| | | public AjaxResult getTicketNo(TicketRegistrationDto ticketRegistrationDto) { |
| | | return AjaxResult.success(ticketRegistrationService.getTicketNo(ticketRegistrationDto)); |
| | | public R<?> getTicketNo(TicketRegistrationDto ticketRegistrationDto) { |
| | | return R.ok(ticketRegistrationService.getTicketNo(ticketRegistrationDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @Schema(description = "根据id查询来漂登记") |
| | | @GetMapping("/getPuargeById") |
| | | public AjaxResult getPuargeById(Long id) { |
| | | return AjaxResult.success(ticketRegistrationService.getPuargeById( id)); |
| | | public R<?> getPuargeById(Long id) { |
| | | return R.ok(ticketRegistrationService.getPuargeById( id)); |
| | | } |
| | | |
| | | |