|
|
@@ -476,7 +476,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
Object sellObj = readWorkBookCell(row.getCell(ModifyConstant.SALE_METHOD), Cell.CELL_TYPE_STRING,
|
|
|
r, ModifyConstant.SALE_METHOD);
|
|
|
aBatch.setSaleMethod(StringUtilB2C.getStr(sellObj).trim());
|
|
|
- StoreIn storeIn = getModifyStoreInfo(sellObj, self, consignment);
|
|
|
+ StoreIn storeIn = getModifyStoreInfo(sellObj, self, consignment, skuObj);
|
|
|
if (storeIn == null) {
|
|
|
aBatch.addErrmsg(ErrorInfoConstant.STORE_ERROR.getInfo());
|
|
|
aBatch.setErrmsg(aBatch.getErrmsg().substring(1));
|
|
|
@@ -497,12 +497,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
aBatch.setReleaseCode(ReleaseStatus.lack_info.value());
|
|
|
aBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
|
|
|
} else {
|
|
|
- // 导入成功的需要判断自定义标签是否重复
|
|
|
-// if (CollectionUtils.isNotEmpty(batchList) && aBatch.getTag() != null) {
|
|
|
-// if (validateTagInfo(aBatch, batchList)) {
|
|
|
-// aBatch.setTag(null);
|
|
|
-// }
|
|
|
-// }
|
|
|
validateRepeatInExcel(batchList, aBatch, true);
|
|
|
}
|
|
|
batchList.add(aBatch);
|
|
|
@@ -554,7 +548,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
Goods newGoods = null;
|
|
|
List<GoodsHistory> goodsHistoryList = new ArrayList<>();
|
|
|
- for (ReleaseProductByBatch aBatch : batchList) {
|
|
|
+ for (ReleaseProductByBatch aBatch : batchList) {
|
|
|
newGoods = null;
|
|
|
if (!RegexConstant.isNumber(aBatch.getBatchCode())) {
|
|
|
for (Goods goods : goodses) {
|
|
|
@@ -583,7 +577,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
ResultMap resultMap = goodsService.updateGoods(newGoods);
|
|
|
if (resultMap.isSuccess()) {
|
|
|
Goods goods1 = (Goods) resultMap.getData();
|
|
|
- if (Status.REMOVED.value() == aBatch.getStatus() && Status.REMOVED.value() != goods1.getStatus()) {
|
|
|
+ if (aBatch.getStatus() != null && goods1.getStatus() != null
|
|
|
+ && Status.REMOVED.value() == aBatch.getStatus() && Status.REMOVED.value() != goods1.getStatus()) {
|
|
|
ResultMap offMap = goodsService.offShelfGoodsByProvider(newGoods.getBatchCode(), null, false);
|
|
|
if (offMap.isSuccess()) {
|
|
|
result++;
|
|
|
@@ -609,9 +604,9 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
aBatch.setKindName(product.getProdName());
|
|
|
aBatch.setCurrency(product.getCurrency());
|
|
|
aBatch.setProductNum(product.getProdNum());
|
|
|
- InOutboundDetail inOutboundDetail = new InOutboundDetail(newProduct);
|
|
|
- fillInProduct(product, aBatch, inOutboundDetail);
|
|
|
newProduct = product;
|
|
|
+ InOutboundDetail inOutboundDetail = new InOutboundDetail(newProduct);
|
|
|
+ fillInProduct(newProduct, aBatch, inOutboundDetail);
|
|
|
Set<InOutboundDetail> set = new HashSet<>();
|
|
|
set.add(inOutboundDetail);
|
|
|
if (CollectionUtils.isNotEmpty(set)) {
|
|
|
@@ -635,8 +630,17 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
} else {
|
|
|
Goods needGoods = new Goods();
|
|
|
needGoods.setProductInfo(newProduct);
|
|
|
+ needGoods.setMinBuyQty(aBatch.getMinBuyQty() == null ? needGoods.getMinPackQty() : aBatch.getMinBuyQty());
|
|
|
+ if (StringUtils.isEmpty(needGoods.getSelfSale())) {
|
|
|
+ needGoods.setSelfSale("2");
|
|
|
+ }
|
|
|
goodsService.setGoodsDefault(needGoods);
|
|
|
+ needGoods.setStatus();
|
|
|
goodsDao.save(needGoods);
|
|
|
+ GoodsHistory history = goodsHistoryService.converTGoodsHist(needGoods,
|
|
|
+ GoodsHistory.OperateType.Update.getPhrase(), false);
|
|
|
+ // 修改上下架状态并产生上下架历史
|
|
|
+ goodsHistoryService.save(history);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -798,7 +802,12 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private StoreIn getModifyStoreInfo(Object value, StoreIn self, StoreIn consignment) {
|
|
|
+ private StoreIn getModifyStoreInfo(Object value, StoreIn self, StoreIn consignment, Object bachCode) {
|
|
|
+ if (!StringUtils.isEmpty(bachCode)) {
|
|
|
+ if (RegexConstant.isNumber(bachCode.toString().trim())) {
|
|
|
+ return consignment;
|
|
|
+ }
|
|
|
+ }
|
|
|
List<String> sellList = Arrays.asList("自营", "寄售");
|
|
|
if (StringUtils.isEmpty(value) || !sellList.contains(StringUtilB2C.getStr(value))) {
|
|
|
return null;
|