| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | 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.sales.mapper.PaymentShippingMapper; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @Log(title = "付款发货", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @Operation(summary = "添加支付与发货信息") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody PaymentShipping paymentShipping) { |
| | | String ord = OrderUtils.countTodayByCreateTime(paymentShippingMapper, "ORD","order_no"); |
| | | String ord = OrderUtils.countTodayByCreateTime(paymentShippingMapper, "ORD","order_no", paymentShipping.getCreateTime() != null ? paymentShipping.getCreateTime() : LocalDateTime.now()); |
| | | paymentShipping.setOrderNo(ord); |
| | | boolean save = paymentShippingService.save(paymentShipping); |
| | | return save ? success() : error(); |
| | | } |
| | | |
| | | @Log(title = "付款发货", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/update") |
| | | @Operation(summary = "修改支付与发货信息") |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | return update ? success() : error(); |
| | | } |
| | | |
| | | @Log(title = "付款发货", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除支付与发货信息") |
| | | @Transactional(rollbackFor = Exception.class) |