提交 08a9adbb authored 作者: huyufan's avatar huyufan

开发:运单拉运扣减货单相关重量,状态

上级 f8b3ac21
......@@ -54,5 +54,5 @@ public class OrderGoodsChildParams {
private String userName;
@ApiModelProperty("车辆列表")
private List<String> trackList;
private List<String> truckList;
}
......@@ -157,8 +157,8 @@ public class GoodsOrderController {
orderGoods.setModifiedTime(now);
orderGoods.setUserName("loginUserInfo.getUserName()");
orderGoods.setUserNo(123L);
if (CollectionUtil.isNotEmpty(child.getTrackList())) {
orderGoodsTruckBindDao.saveBatchEntity(orderNo, OrderGoodsTypeEnum.Status.PLATFORM.getCode() + beginOrderGoodsId, child.getTrackList(), now);
if (CollectionUtil.isNotEmpty(child.getTruckList())) {
orderGoodsTruckBindDao.saveBatchEntity(orderNo, OrderGoodsTypeEnum.Status.PLATFORM.getCode() + beginOrderGoodsId, child.getTruckList(), now);
}
beginOrderGoodsId = beginOrderGoodsId + 1;
orderGoodsMapper.insert(orderGoods);
......@@ -223,8 +223,8 @@ public class GoodsOrderController {
orderGoods.setModifiedTime(now);
orderGoods.setUserName("loginUserInfo.getUserName()");
orderGoods.setUserNo(123L);
if (CollectionUtil.isNotEmpty(child.getTrackList())) {
orderGoodsTruckBindDao.saveBatchEntity(orderNo, OrderGoodsTypeEnum.Status.PLATFORM.getCode() + beginOrderGoodsId, child.getTrackList(), now);
if (CollectionUtil.isNotEmpty(child.getTruckList())) {
orderGoodsTruckBindDao.saveBatchEntity(orderNo, OrderGoodsTypeEnum.Status.PLATFORM.getCode() + beginOrderGoodsId, child.getTruckList(), now);
}
beginOrderGoodsId = beginOrderGoodsId + 1;
......
......@@ -29,4 +29,7 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int
IPage<OrderGoodsVO> pageOrderGoodsList(PageOrderGoodsListParam param);
void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight);
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.order.params.PageOrderGoodsListParam;
import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.enums.OrderGoodsStatusEnum;
import com.clx.performance.mapper.OrderGoodsMapper;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.vo.pc.OrderGoodsVO;
......@@ -23,8 +24,8 @@ import java.math.BigDecimal;
public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, Integer> implements OrderGoodsDao {
@Override
public boolean updateWeight(@Param("orderId")Integer orderId, @Param("weight") BigDecimal weight) {
return baseMapper.updateWeight(orderId, weight)>0;
public boolean updateWeight(@Param("orderId") Integer orderId, @Param("weight") BigDecimal weight) {
return baseMapper.updateWeight(orderId, weight) > 0;
}
@Override
......@@ -65,4 +66,11 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods,
return baseMapper.pageOrderGoodsList(page, param);
}
@Override
public void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight) {
baseMapper.updateOrderGoodsWeightAndStatus(id, orderChildWeight, OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode());
}
}
......@@ -23,11 +23,18 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
@Update(" update order_goods set " +
" residue_transport_weight = residue_transport_weight-#{weight} " +
" where id = #{orderId}")
int updateWeight(@Param("orderId")Integer orderId, @Param("weight")BigDecimal weight);
int updateWeight(@Param("orderId") Integer orderId, @Param("weight") BigDecimal weight);
@SelectProvider(type = OrderGoodsSqlProvider.class, method = "getMaxOrderGoodsId")
Long getMaxOrderGoodsId(String type);
@SelectProvider(type = OrderGoodsSqlProvider.class, method = "pageOrderGoodsList")
IPage<OrderGoodsVO> pageOrderGoodsList(Page<OrderGoodsVO> page, PageOrderGoodsListParam param);
@Update(" update order_goods set " +
" residue_transport_weight = residue_transport_weight-#{weight} " +
" already_transport_weight = already_transport_weight+#{weight} " +
"order_goods_status = #{orderGoodsStatus}" +
" where id = #{id}")
void updateOrderGoodsWeightAndStatus(@Param("id") Integer id, @Param("weight") BigDecimal orderChildWeight, @Param("orderGoodsStatus") Integer orderGoodsStatus);
}
......@@ -4,8 +4,8 @@ package com.clx.performance.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.order.params.PageOrderGoodsListParam;
import com.clx.performance.vo.pc.OrderGoodsVO;
import com.msl.common.base.PageData;
import com.msl.common.result.Result;
import java.math.BigDecimal;
/**
* @author kavin
......@@ -18,4 +18,7 @@ public interface OrderGoodsService {
OrderGoodsVO getOrderGoodsInfoByOrderGoodsNoForAPP(String orderGoodsNo);
IPage<OrderGoodsVO> pageOrderGoodsList(PageOrderGoodsListParam param);
void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight);
}
......@@ -16,6 +16,7 @@ import com.clx.performance.param.pc.PagePoundAuditParam;
import com.clx.performance.service.OrderChildLogService;
import com.clx.performance.service.OrderChildPoundLogService;
import com.clx.performance.service.OrderChildService;
import com.clx.performance.service.OrderGoodsService;
import com.clx.performance.struct.OrderChildPoundImageStruct;
import com.clx.performance.struct.OrderChildStruct;
import com.clx.performance.vo.app.OrderChildVO;
......@@ -69,6 +70,7 @@ public class OrderChildServiceImpl implements OrderChildService {
private final DriverService driverService;
private final OrderChildStruct orderChildStruct;
private final OrderChildPoundImageStruct orderChildPoundImageStruct;
private final OrderGoodsService orderGoodsService;
@Autowired
......@@ -648,7 +650,7 @@ public class OrderChildServiceImpl implements OrderChildService {
private void updateOrderGoodsAmount(OrderGoods orderGoods, BigDecimal weight){
if (orderGoods.getResidueTransportWeight().compareTo(weight) <= 0) {orderGoods.setOrderGoodsStatus(0);}
orderGoodsDao.updateWeight(orderGoods.getId(), weight);
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), weight);
}
/**
......@@ -667,7 +669,6 @@ public class OrderChildServiceImpl implements OrderChildService {
* 取消返吨数
*/
private void cancelReturnWeight(OrderChild orderChild, OrderGoods orderGoods){
}
/**
......
......@@ -13,6 +13,8 @@ import com.msl.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
/**
* @author kavin
* Date 2023-09-17
......@@ -54,4 +56,10 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
public IPage<OrderGoodsVO> pageOrderGoodsList(PageOrderGoodsListParam param) {
return orderGoodsDao.pageOrderGoodsList(param);
}
@Override
public void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight) {
orderGoodsDao.updateOrderGoodsReduceWeightAndStatus(id, orderChildWeight);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论