|
@@ -1,6 +1,5 @@
|
|
|
package com.gree.mall.manager.logic.material.stock;
|
|
|
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -26,10 +25,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -141,6 +137,17 @@ public class WebsitStockLogic {
|
|
|
if(new BigDecimal(stock).doubleValue() < 0){
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
+ final Storage storage = storageService.lambdaQuery()
|
|
|
+ .eq(Storage::getCompanyWechatId, adminUser.getCompanyWechatId())
|
|
|
+ .eq(Storage::getWebsitId, adminWebsit.getWebsitId())
|
|
|
+ .eq(Storage::getIsDefault, true)
|
|
|
+ .one();
|
|
|
+
|
|
|
+ if (Objects.isNull(storage)) {
|
|
|
+ throw new RemoteServiceException("网点没有默认仓库");
|
|
|
+ }
|
|
|
+
|
|
|
WebsitStock websitStock = new WebsitStock();
|
|
|
websitStock.setCompanyWechatId(adminUser.getCompanyWechatId());
|
|
|
websitStock.setCompanyWechatName(adminUser.getCompanyName());
|
|
@@ -153,6 +160,7 @@ public class WebsitStockLogic {
|
|
|
websitStock.setQty(new BigDecimal(stock));
|
|
|
websitStock.setOldQty(new BigDecimal(oldQty));
|
|
|
websitStock.setLastCost(new BigDecimal(lastCost));
|
|
|
+ websitStock.setStorageId(storage.getStorageId());
|
|
|
websitStock.setCreateBy(adminUser.getNickName());
|
|
|
websitStock.setUpdateBy(adminUser.getNickName());
|
|
|
websitStocks.add(websitStock);
|
|
@@ -176,6 +184,7 @@ public class WebsitStockLogic {
|
|
|
websitStockAcc.setOperateBy(adminUser.getNickName());
|
|
|
websitStockAcc.setOperateTime(new Date());
|
|
|
websitStockAcc.setRemark("期初导入");
|
|
|
+ websitStockAcc.setStorageId(storage.getStorageId());
|
|
|
//websitStockAcc.setQty(websitStock.getQty());
|
|
|
//websitStockAcc.setCloseQty(0);
|
|
|
websitStockAccs.add(websitStockAcc);
|