出库分配数量数值更新
This commit is contained in:
+13
-4
@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.utils.OrderSequence;
|
||||
@@ -64,6 +65,7 @@ import com.mhd.wms.domain.stockOutOrder.repository.facade.IStockOutOrderService;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.po.StockOutOrderPO;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.todo.StockOutOrderDO;
|
||||
import com.mhd.wms.domain.waveOrder.factorys.WaveOrderServiceFactory;
|
||||
import com.mhd.wms.interfaces.dto.outMaterialDetail.OutMaterialDetailDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -428,6 +430,10 @@ public class StockOutOrderDomainService {
|
||||
//取消分配:stockOutOrderPO.getAllocationQuantity() 和 stockOutOrderPO.getAlreadyAllocationQuantity() 都是要取消的数量
|
||||
//物料明细层面的验证已经在 batchCancelAssignUpdate 中完成,这里直接使用即可
|
||||
BigDecimal cancelQuantity = stockOutOrderPO.getAllocationQuantity();
|
||||
stockOutOrderService.update(null,new UpdateWrapper<StockOutOrder>().lambda()
|
||||
.setSql("allocation_quantity = allocation_quantity - " + cancelQuantity)//取消分配减数量
|
||||
.eq(StockOutOrder::getOutOrderId, stockOutOrderDb.getOutOrderId())
|
||||
);
|
||||
BigDecimal cancelAlreadyAllocationQuantity = stockOutOrderPO.getAlreadyAllocationQuantity() != null
|
||||
? stockOutOrderPO.getAlreadyAllocationQuantity()
|
||||
: BigDecimal.ZERO;
|
||||
@@ -448,19 +454,22 @@ public class StockOutOrderDomainService {
|
||||
status = judgeAllocationQuantityByManualAssign(stockOutOrderPO.getAllocationQuantity(), stockOutOrderPO.getAlreadyAllocationQuantity(),type);
|
||||
|
||||
}else {
|
||||
allocationQuantity = allocationQuantity.add(stockOutOrderPO.getAllocationQuantity());
|
||||
allocationQuantity = stockOutOrderPO.getAllocationQuantity();//直接使用返回的分配数量
|
||||
alreadyAllocationQuantity = alreadyAllocationQuantity.add(stockOutOrderPO.getAlreadyAllocationQuantity() != null
|
||||
? stockOutOrderPO.getAlreadyAllocationQuantity()
|
||||
: BigDecimal.ZERO);
|
||||
}
|
||||
return stockOutOrderService.update(null, new UpdateWrapper<StockOutOrder>().lambda()
|
||||
LambdaUpdateWrapper<StockOutOrder> wrapper = new UpdateWrapper<StockOutOrder>().lambda()
|
||||
.set(StockOutOrder::getStatus, status)
|
||||
.set(StockOutOrder::getAllocationQuantity, allocationQuantity)
|
||||
.set(StockOutOrder::getAlreadyAllocationQuantity, alreadyAllocationQuantity)
|
||||
.set(StockOutOrder::getUpdateBy, loginUser.getUserid())
|
||||
.set(StockOutOrder::getUpdateByName, loginUser.getUsername())
|
||||
.set(StockOutOrder::getUpdateTime, new Date())
|
||||
.eq(StockOutOrder::getOutOrderId, stockOutOrderDb.getOutOrderId()));
|
||||
.eq(StockOutOrder::getOutOrderId, stockOutOrderDb.getOutOrderId());
|
||||
if (type != 2){
|
||||
wrapper.set(StockOutOrder::getAllocationQuantity, allocationQuantity);
|
||||
}
|
||||
return stockOutOrderService.update(null, wrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ public class WaveOrderDomainService {
|
||||
if (allocationQuantity.compareTo(quantity) == 0){
|
||||
status = 4;
|
||||
}
|
||||
|
||||
waveOrderService.update(null, new UpdateWrapper<WaveOrder>().lambda()
|
||||
.set(WaveOrder::getStatus, status)
|
||||
.set(WaveOrder::getAllocationQuantity, allocationQuantity)
|
||||
|
||||
@@ -5,16 +5,22 @@ import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.wms.application.service.waveOrder.WaveOrderApplicationService;
|
||||
import com.mhd.wms.domain.stockOutOrder.entity.StockOutOrder;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.facade.IStockOutOrderService;
|
||||
import com.mhd.wms.domain.waveOrder.repository.po.WaveOrderPO;
|
||||
import com.mhd.wms.domain.waveOrder.repository.todo.WaveOrderDO;
|
||||
import com.mhd.wms.interfaces.assember.stockOutOrder.StockOutOrderAssembler;
|
||||
import com.mhd.wms.interfaces.assember.waveOrder.WaveOrderAssembler;
|
||||
import com.mhd.wms.interfaces.dto.outMaterialDetail.OutMaterialDetailDTO;
|
||||
import com.mhd.wms.interfaces.dto.waveOrder.WaveOrderDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 波次单Api
|
||||
@@ -31,6 +37,9 @@ public class WaveOrderApi extends BaseController {
|
||||
@Resource
|
||||
private WaveOrderAssembler waveOrderAssembler;
|
||||
|
||||
@Autowired
|
||||
private IStockOutOrderService stockOutOrderService;
|
||||
|
||||
/**
|
||||
* 分页查询波次单列表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user