| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.mapper.PaymentShippingMapper; |
| | | import com.ruoyi.sales.pojo.PaymentShipping; |
| | | import com.ruoyi.sales.service.PaymentShippingService; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "分页查询支付与发货信息") |
| | | public AjaxResult listPage(Page page, PaymentShipping paymentShipping) { |
| | | public R<?> listPage(Page page, PaymentShipping paymentShipping) { |
| | | IPage<PaymentShipping> listPage = paymentShippingService.listPage(page, paymentShipping); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "添加支付与发货信息") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody PaymentShipping paymentShipping) { |
| | | public R<?> add(@RequestBody PaymentShipping paymentShipping) { |
| | | String ord = OrderUtils.countTodayByCreateTime(paymentShippingMapper, "ORD","order_no"); |
| | | paymentShipping.setOrderNo(ord); |
| | | boolean save = paymentShippingService.save(paymentShipping); |
| | | return save ? success() : error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "修改支付与发货信息") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody PaymentShipping paymentShipping) { |
| | | public R<?> update(@RequestBody PaymentShipping paymentShipping) { |
| | | boolean update = paymentShippingService.updateById(paymentShipping); |
| | | return update ? success() : error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除支付与发货信息") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("请传入要删除的ID"); |
| | | return R.fail("请传入要删除的ID"); |
| | | } |
| | | return AjaxResult.success(paymentShippingService.removeByIds(ids)); |
| | | return R.ok(paymentShippingService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |