Browse Source

调整上下架历史记录的逻辑。

yuj 7 years ago
parent
commit
8be0305853

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -3852,7 +3852,7 @@ public class GoodsServiceImpl implements GoodsService {
                 goods.adjustFragmentPrice();
                 Integer status = goods.getStatus();
                 goods.setStatus();
-                if ((Status.AVAILABLE.value() == goods.getStatus()) || (Status.UNAVAILABLE.value() == goods.getStatus()) && (Status.NO_SHELVE.value() == status) || (Status.REMOVED.value() == status)) {
+                if ((Status.AVAILABLE.value() == goods.getStatus()) || (Status.UNAVAILABLE.value() == goods.getStatus() || Status.NO_SHELVE.value() == goods.getStatus()) && (Status.REMOVED.value() == status)) {
                     //如果现在是已上架,原先是未上架或者已下架,则做上架处理。否则做更新处理
                     list.add(goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase(), false));
                 } else {

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -2931,7 +2931,7 @@ public class ProductServiceImpl implements ProductService {
         goodsService.setGoodsDefault(goods);
         String type;
         if (null != goods.getId()) {
-            if ((Status.AVAILABLE.value() == goods.getStatus() || Status.UNAVAILABLE.value() == goods.getStatus()) && (Status.NO_SHELVE.value() == status) || (Status.REMOVED.value() == status)) {
+            if ((Status.AVAILABLE.value() == goods.getStatus() || Status.UNAVAILABLE.value() == goods.getStatus() || Status.NO_SHELVE.value() == goods.getStatus()) && (Status.REMOVED.value() == status)) {
                 //如果现在是已上架,原先是未上架或者已下架,则做上架处理。否则做更新处理
                 type = GoodsHistory.OperateType.Publish.getPhrase();
             } else {

+ 2 - 8
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -640,13 +640,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 					goodsService.setGoodsDefault(needGoods);
 					needGoods.setStatus();
 					goodsDao.save(needGoods);
-					GoodsHistory history = null;
-					if ((Status.AVAILABLE.value() == needGoods.getStatus()) || (Status.UNAVAILABLE.value() == needGoods.getStatus())) {
-						//如果现在是已上架,原先是未上架或者已下架,则做上架处理。否则做更新处理
-						history = goodsHistoryService.converTGoodsHist(needGoods, GoodsHistory.OperateType.Publish.getPhrase(), false);
-					} else {
-						history = goodsHistoryService.converTGoodsHist(needGoods, GoodsHistory.OperateType.INIT.getPhrase(), false);
-					}
+					GoodsHistory history = goodsHistoryService.converTGoodsHist(needGoods, GoodsHistory.OperateType.Publish.getPhrase(), false);
 					// 修改上下架状态并产生上下架历史
 					goodsHistoryService.save(history);
 				}
@@ -1914,7 +1908,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 								prids.add(releaseProductByBatch.getProductid());
 								Integer status = g.getStatus();
 								g.updateGoodsByReleaseProductByBatch(releaseProductByBatch, delayTime, ignoreImport);
-								if ((Status.AVAILABLE.value() == g.getStatus()) || (Status.UNAVAILABLE.value() == g.getStatus()) && (Status.NO_SHELVE.value() == status) || (Status.REMOVED.value() == status)) {
+								if ((Status.AVAILABLE.value() == g.getStatus() || Status.UNAVAILABLE.value() == g.getStatus() || Status.NO_SHELVE.value() == g.getStatus()) &&  Status.REMOVED.value() == status) {
 									//如果现在是已上架,原先是未上架或者已下架,则做上架处理。否则做更新处理
 									goodsHistoryList.add(goodsHistoryService.converTGoodsHist(g, GoodsHistory.OperateType.Publish.getPhrase(), false));
 								} else {