|
|
@@ -57,6 +57,7 @@ import com.uas.platform.core.persistence.criteria.SimpleExpression;
|
|
|
import com.uas.platform.core.util.StringUtil;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
+import org.apache.log4j.Logger;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
@@ -179,6 +180,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
@Autowired
|
|
|
private OrderDetailService detailService;
|
|
|
|
|
|
+ private final Logger logger = Logger.getLogger(getClass());
|
|
|
+
|
|
|
@Autowired
|
|
|
public GoodsServiceImpl(KindService kindService, StoreInDao storeInDao, StoreInService storeInService, ProductStandardPutOnInfoDao productStandardPutOnInfoDao, ProductDao productDao, BrowsingHistoryService browsingHistoryService, RecommendProductService recommendProductService) {
|
|
|
this.kindService = kindService;
|
|
|
@@ -1846,6 +1849,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
@Override
|
|
|
public ResultMap offShelfGoodsByProvider(String batchCodes) {
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录1", dateFormat.format(new Date())));
|
|
|
if (StringUtils.isEmpty(batchCodes)) {
|
|
|
return new ResultMap(CodeType.NO_INFO.code(), "待下架批次号字符串不能为空");
|
|
|
}
|
|
|
@@ -1857,9 +1862,11 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
List<String> batchCodeList = new ArrayList<>();
|
|
|
|
|
|
String storeUuid = "";
|
|
|
-
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录2", dateFormat.format(new Date())));
|
|
|
for (String batchCode : batchCodeArr) {
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录 调用下架方法开始", dateFormat.format(new Date())));
|
|
|
ResultMap resultMap = offShelfOneGoodsByProvider(batchCode);
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录 调用下架方法结束", dateFormat.format(new Date())));
|
|
|
if (resultMap.isSuccess()) {
|
|
|
Goods goods = (Goods) resultMap.getData();
|
|
|
uuids.add(goods.getUuid());
|
|
|
@@ -1869,13 +1876,17 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
}
|
|
|
for (String uuid : uuids) {
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录 更新器件库存信息 开始", dateFormat.format(new Date())));
|
|
|
updateComponentTradeInfos(uuid);
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录 更新器件库存信息 结束", dateFormat.format(new Date())));
|
|
|
}
|
|
|
|
|
|
if (!StringUtils.isEmpty(storeUuid)) {
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录 更新推荐库存信息开始", dateFormat.format(new Date())));
|
|
|
List<String> list = Arrays.asList(batchCodeArr);
|
|
|
Set<String> batchCodeSet = new HashSet<>(list);
|
|
|
recommendProductService.deleteProductsWhenSellerUpdateReserve(storeUuid, batchCodeSet);
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录 更新推荐库存信息结束", dateFormat.format(new Date())));
|
|
|
}
|
|
|
|
|
|
if (batchCodeList.size() == 0) {
|
|
|
@@ -1892,6 +1903,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
*/
|
|
|
@Transactional
|
|
|
public ResultMap offShelfOneGoodsByProvider(String batchCode) {
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录 进入下架方法", dateFormat.format(new Date())));
|
|
|
if (StringUtils.isEmpty(batchCode)) {
|
|
|
return new ResultMap(CodeType.NO_INFO.code(), "待下架批次号不能为空");
|
|
|
}
|
|
|
@@ -1910,8 +1923,10 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
goods.setStatus(Status.REMOVED.value());
|
|
|
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录 转历史库存 开始", dateFormat.format(new Date())));
|
|
|
GoodsHistory goodsHist = goodsHistoryService.converTGoodsHist(goods,
|
|
|
GoodsHistory.OperateType.Down.getPhrase());
|
|
|
+ logger.info(String.format("%s 商城测试下架时间记录 转历史库存 结束", dateFormat.format(new Date())));
|
|
|
goodsHist.setMessage(goodsHist.getMessage() + "该批次下架");
|
|
|
goodsHistoryService.save(goodsHist);
|
|
|
|