|
@@ -1873,17 +1873,29 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
}
|
|
|
Set<String> uuids = new HashSet<>();
|
|
Set<String> uuids = new HashSet<>();
|
|
|
List<String> batchCodeList = new ArrayList<>();
|
|
List<String> batchCodeList = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ String storeUuid = "";
|
|
|
|
|
+
|
|
|
for (String batchCode : batchCodeArr) {
|
|
for (String batchCode : batchCodeArr) {
|
|
|
ResultMap resultMap = offShelfOneGoodsByProvider(batchCode);
|
|
ResultMap resultMap = offShelfOneGoodsByProvider(batchCode);
|
|
|
if (resultMap.isSuccess()) {
|
|
if (resultMap.isSuccess()) {
|
|
|
Goods goods = (Goods) resultMap.getData();
|
|
Goods goods = (Goods) resultMap.getData();
|
|
|
uuids.add(goods.getUuid());
|
|
uuids.add(goods.getUuid());
|
|
|
batchCodeList.add(goods.getBatchCode());
|
|
batchCodeList.add(goods.getBatchCode());
|
|
|
|
|
+
|
|
|
|
|
+ storeUuid = goods.getStoreid();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
for (String uuid : uuids) {
|
|
for (String uuid : uuids) {
|
|
|
updateComponentTradeInfos(uuid);
|
|
updateComponentTradeInfos(uuid);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (!StringUtils.isEmpty(storeUuid)) {
|
|
|
|
|
+ List<String> list = Arrays.asList(batchCodeArr);
|
|
|
|
|
+ Set<String> batchCodeSet = new HashSet<>(list);
|
|
|
|
|
+ recommendProductService.deleteProductsWhenSellerUpdateReserve(storeUuid, batchCodeSet);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (batchCodeList.size() == 0) {
|
|
if (batchCodeList.size() == 0) {
|
|
|
return new ResultMap(CodeType.ERROR_STATE.code(), "下架商品失败");
|
|
return new ResultMap(CodeType.ERROR_STATE.code(), "下架商品失败");
|
|
|
} else {
|
|
} else {
|
|
@@ -1897,7 +1909,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
* @param batchCode 商品批次号
|
|
* @param batchCode 商品批次号
|
|
|
*/
|
|
*/
|
|
|
@Transactional
|
|
@Transactional
|
|
|
- private ResultMap offShelfOneGoodsByProvider(String batchCode) {
|
|
|
|
|
|
|
+ public ResultMap offShelfOneGoodsByProvider(String batchCode) {
|
|
|
if (StringUtils.isEmpty(batchCode)) {
|
|
if (StringUtils.isEmpty(batchCode)) {
|
|
|
return new ResultMap(CodeType.NO_INFO.code(), "待下架批次号不能为空");
|
|
return new ResultMap(CodeType.NO_INFO.code(), "待下架批次号不能为空");
|
|
|
}
|
|
}
|