提交 a68f3803 authored 作者: huyufan's avatar huyufan

处理BUg

上级 7f0c236c
......@@ -9,6 +9,7 @@ import com.clx.order.enums.VehicleUsageEnum;
import com.clx.order.feign.OrderFeign;
import com.clx.order.param.feign.OrderCancelReasonParam;
import com.clx.order.param.feign.RollbackOrderWeightParam;
import com.clx.performance.extranal.user.DriverService;
import com.clx.performance.param.pc.OrderGoodsEditParams;
import com.clx.performance.param.pc.PageOrderGoodsListParam;
import com.clx.order.vo.feign.FeignOrderVO;
......@@ -34,6 +35,7 @@ import com.clx.performance.vo.app.OrderGoodsAPPVO;
import com.clx.performance.vo.feign.OrderGoodsFeignVO;
import com.clx.performance.vo.pc.OrderGoodsEditVO;
import com.clx.performance.vo.pc.OrderGoodsVO;
import com.clx.user.enums.driver.DriverInfoEnum;
import com.clx.user.feign.UserClxFeign;
import com.msl.common.base.Optional;
import com.msl.common.enums.ResultCodeEnum;
......@@ -91,6 +93,8 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
private OrderGoodsStatusLazyComponent orderGoodsStatusLazyComponent;
private DriverService driverService;
@Override
public OrderGoodsVO getOrderGoodsInfoByOrderGoodsNoForPC(String orderGoodsNo) {
OrderGoodsVO orderGoodsVO = orderGoodsDao.getOrderGoodsInfoByOrderGoodsNoForPC(orderGoodsNo).map(orderGoodsStruct::convert).get();
......@@ -476,11 +480,17 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
}
orderGoodsTruckBindDao.updateOrderGoodsBindStatus(orderGoodsNo, OrderGoodsTruckBindEnum.Status.CANCEL.getCode());
if (CollectionUtils.isNotEmpty(orderChildList)) {
orderChildDao.batchUpdateOrderChildStatus(OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), orderChildList.stream().map(OrderChild::getId).collect(Collectors.toList()));
List<Integer> ids = new LinkedList<>();
for (OrderChild orderChild : orderChildList) {
ids.add(orderChild.getId());
driverService.updateOrderStatus(orderChild.getDriverUserNo(), DriverInfoEnum.DriverStatus.NO.getCode(), orderChild.getTruckId(), 1);
}
orderChildDao.batchUpdateOrderChildStatus(OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), ids);
}
log.info("取消货单,参数:{}", JSONUtil.parse(param));
if (orderFeign.rollbackOrderWeight(param).succeed()) {
orderGoodsDao.updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus(BigDecimal.ZERO, sum, OrderGoodsStatusEnum.Status.CANCEL.getCode(), orderGoods.getId());
orderGoodsDao.updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus(residueWeight, sum, OrderGoodsStatusEnum.Status.CANCEL.getCode(), orderGoods.getId());
}
break;
default:
......
......@@ -247,7 +247,7 @@ public class OrderGoodsSqlProvider {
public String updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus(@Param(value ="residueWeight") BigDecimal residueWeight, @Param(value = "alreadyWeight") BigDecimal alreadyWeight,@Param(value ="status") Integer status,@Param(value ="id") Integer id){
String sql = new SQL() {{
UPDATE("order_goods")
.SET("residue_transport_weight = residue_transport_weight + #{residueWeight}")
.SET("residue_transport_weight = residue_transport_weight - #{residueWeight}")
.SET("already_transport_weight = already_transport_weight - #{alreadyWeight}")
.SET("status = #{status}")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论