开始清运
parent
776e85d45c
commit
43e80f9626
|
|
@ -4,10 +4,7 @@ import com.njzscloud.common.core.utils.R;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderEntity;
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderEntity;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.param.AssignmentDriverParam;
|
import com.njzscloud.dispose.cst.order.pojo.param.*;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.param.AssignmentOrgParam;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.param.CreateOrderParam;
|
|
||||||
import com.njzscloud.dispose.cst.order.pojo.param.DriverAcceptOrderParam;
|
|
||||||
import com.njzscloud.dispose.cst.order.service.OrderService;
|
import com.njzscloud.dispose.cst.order.service.OrderService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -98,6 +95,14 @@ public class OrderController {
|
||||||
return R.success();
|
return R.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始清运
|
||||||
|
*/
|
||||||
|
@PostMapping("/start_trans")
|
||||||
|
public R<?> startTrans(@RequestBody StartTransParam transParam) {
|
||||||
|
orderService.startTrans(transParam);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.njzscloud.dispose.cst.order.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class StartTransParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单运输ID
|
||||||
|
*/
|
||||||
|
private Long orderTransId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -224,6 +224,24 @@ public class OrderService extends ServiceImpl<OrderMapper, OrderEntity> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void startTrans(StartTransParam transParam) {
|
||||||
|
Assert.notNull(transParam, () -> Exceptions.clierr("请填写参数"));
|
||||||
|
Assert.notNull(transParam.getOrderTransId(), () -> Exceptions.clierr("订单运输ID不可为空"));
|
||||||
|
|
||||||
|
OrderTransResult result = orderTransMapper.getById(transParam.getOrderTransId());
|
||||||
|
Assert.notNull(result, () -> Exceptions.clierr("订单不存在"));
|
||||||
|
Assert.isTrue(TransStatus.YiJieDan.getVal().equals(result.getTransStatus()), () -> Exceptions.clierr("当前订单状态,无法开始运输"));
|
||||||
|
|
||||||
|
// 更新运输信息
|
||||||
|
OrderTransEntity transEntity = new OrderTransEntity();
|
||||||
|
transEntity.setId(transParam.getOrderTransId());
|
||||||
|
transEntity.setTransStatus(TransStatus.YunShuZhong.getVal());
|
||||||
|
transEntity.setTransTime(LocalDateTime.now());
|
||||||
|
orderTransMapper.updateById(transEntity);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成订单号
|
* 生成订单号
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue