|
@@ -54,6 +54,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -208,6 +209,13 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
//region 过滤出不够出库的每条明细数量 ------新建出库中数据
|
|
//region 过滤出不够出库的每条明细数量 ------新建出库中数据
|
|
|
List<OutboundItemVO> outboundIngList = outboundVO.getItemList().stream().filter(it -> it.getNotEnoughInventoryQty()!=null && it.getNotEnoughInventoryQty().compareTo(BigDecimal.ZERO)>0).collect(Collectors.toList());
|
|
List<OutboundItemVO> outboundIngList = outboundVO.getItemList().stream().filter(it -> it.getNotEnoughInventoryQty()!=null && it.getNotEnoughInventoryQty().compareTo(BigDecimal.ZERO)>0).collect(Collectors.toList());
|
|
|
if(outboundIngList != null && outboundIngList.size()>0){
|
|
if(outboundIngList != null && outboundIngList.size()>0){
|
|
|
|
|
+ //赋值箱片
|
|
|
|
|
+ for (OutboundItemVO outboundItemVO : outboundIngList) {
|
|
|
|
|
+ //箱
|
|
|
|
|
+ outboundItemVO.setOutingBox(Integer.valueOf(outboundItemVO.getOutingQty().divide(outboundItemVO.getPackBox(),RoundingMode.DOWN).toString()) );
|
|
|
|
|
+ //片
|
|
|
|
|
+ outboundItemVO.setOutingPiece(outboundItemVO.getOutingQty().remainder(outboundItemVO.getPackBox()));
|
|
|
|
|
+ }
|
|
|
outboundVO.setFlgAutoHandle(false);
|
|
outboundVO.setFlgAutoHandle(false);
|
|
|
outboundVO.setItemList(outboundIngList);
|
|
outboundVO.setItemList(outboundIngList);
|
|
|
//销售出库新建
|
|
//销售出库新建
|
|
@@ -218,6 +226,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
//region 库存够扣减的明细 -----------新建已出库数据并扣减库存
|
|
//region 库存够扣减的明细 -----------新建已出库数据并扣减库存
|
|
|
//销售出库新建
|
|
//销售出库新建
|
|
|
if (itemList!=null && itemList.size() > 0) {
|
|
if (itemList!=null && itemList.size() > 0) {
|
|
|
|
|
+ for (OutboundItemVO outboundItemVO : itemList) {
|
|
|
|
|
+ //箱
|
|
|
|
|
+ outboundItemVO.setOutBox(Integer.valueOf(outboundItemVO.getOutingQty().divide(outboundItemVO.getPackBox(),RoundingMode.DOWN).toString()) );
|
|
|
|
|
+ //片
|
|
|
|
|
+ outboundItemVO.setOutPiece(outboundItemVO.getOutingQty().remainder(outboundItemVO.getPackBox()));
|
|
|
|
|
+ }
|
|
|
outboundVO.setFlgAutoHandle(true);
|
|
outboundVO.setFlgAutoHandle(true);
|
|
|
outboundVO.setItemList(itemList);
|
|
outboundVO.setItemList(itemList);
|
|
|
this.saleOrderOutboundInsert(outboundVO, true);
|
|
this.saleOrderOutboundInsert(outboundVO, true);
|