订单管理完成

This commit is contained in:
hans 2025-08-31 17:32:56 +08:00
parent 89af464010
commit 5f73bba6ca
6 changed files with 53 additions and 1 deletions

View File

@ -118,6 +118,15 @@ public class OrderController extends BaseController {
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OrderBo bo) {
return toAjax(orderService.updateByBo(bo));
} /**
* 修改订单明细
*/
@SaCheckPermission("system:order:edit")
@Log(title = "订单明细", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping("/updateOrderStatus")
public R<Void> updateOrderStatus(@Validated(EditGroup.class) @RequestBody OrderBo bo) {
return toAjax(orderService.updateOrderStatus(bo));
}
/**

View File

@ -121,6 +121,10 @@ public class Order extends TenantEntity {
* 支付时间
*/
private Date payTime;
/**
* 取消时间
*/
private Date cancelTime;
/**
* 发货时间

View File

@ -1,5 +1,6 @@
package org.dromara.system.domain.bo;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.system.domain.Order;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
@ -150,6 +151,9 @@ public class OrderBo extends BaseEntity {
* 备注
*/
private String remark;
/**
* 取消时间
*/
private Date cancelTime;
}

View File

@ -167,13 +167,21 @@ public class OrderVo implements Serializable {
* 支付时间
*/
@ExcelProperty(value = "支付时间")
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
private Date payTime;
/**
* 发货时间
*/
@ExcelProperty(value = "发货时间")
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
private Date shipmentTime;
/**
* 取消时间
*/
@ExcelProperty(value = "取消时间")
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
private Date cancelTime;
/**
* 发货图片

View File

@ -64,6 +64,13 @@ public interface IOrderService {
* @return 是否修改成功
*/
Boolean updateByBo(OrderBo bo);
/**
* 修改订单明细
*
* @param bo 订单明细
* @return 是否修改成功
*/
Boolean updateOrderStatus(OrderBo bo);
/**
* 校验并批量删除订单明细信息

View File

@ -1,5 +1,6 @@
package org.dromara.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.dromara.common.core.utils.DateUtils;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
@ -169,6 +170,25 @@ public class OrderServiceImpl implements IOrderService {
return baseMapper.updateById(update) > 0;
}
@Override
public Boolean updateOrderStatus(OrderBo bo) {
UpdateWrapper<Order> orderUpdateWrapper = new UpdateWrapper<Order>();
orderUpdateWrapper.eq("id", bo.getId());
orderUpdateWrapper.set("order_status",bo.getOrderStatus());
if(bo.getOrderStatus().equals("1")){
orderUpdateWrapper.set("pay_time",DateUtils.getNowDate());
}
if(bo.getOrderStatus().equals("0")){
orderUpdateWrapper.set("pay_time",null);
}
if(bo.getOrderStatus().equals("6")){
orderUpdateWrapper.set("cancel_time",DateUtils.getNowDate());
}else{
orderUpdateWrapper.set("cancel_time",null);
}
return baseMapper.update(orderUpdateWrapper) > 0;
}
/**
* 保存前的数据校验
*/