Bläddra i källkod

Merge branch 'release-201840-wangcz' of ssh://10.10.101.21/source/platform-b2c into feature-201840-wangcz

hejq 7 år sedan
förälder
incheckning
451116aa78

+ 14 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java

@@ -301,6 +301,12 @@ public class Goods implements Serializable {
 	@Column(name = "go_returninweek")
 	private Short returnInWeek = (short)0;
 
+	/**
+	 * 上架时间
+	 */
+	@Column(name = "go_publish_time")
+	private Date publishTime;
+
 	/**
 	 * 当前登录企业是否对此批次已送样(默认False)
 	 */
@@ -2126,4 +2132,12 @@ public class Goods implements Serializable {
 		this.costPrice = costPrice;
 		return this;
 	}
+
+	public Date getPublishTime() {
+		return publishTime;
+	}
+
+	public void setPublishTime(Date publishTime) {
+		this.publishTime = publishTime;
+	}
 }

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

@@ -1576,6 +1576,7 @@ public class GoodsServiceImpl implements GoodsService {
             //做上下架判断
             if ((oldStatus.equals(Status.NO_SHELVE.value()) || oldStatus.equals(Status.REMOVED.value())) && (nowGoods.getStatus().equals(Status.AVAILABLE.value()) || nowGoods.getStatus().equals(Status.UNAVAILABLE.value()))) {
                 goodsHistory = goodsHistoryService.converTGoodsHist(nowGoods, OperateType.Publish.getPhrase(), false);
+                nowGoods.setPublishTime(new Date());
             } else if ((nowGoods.getStatus().equals(Status.NO_SHELVE) || nowGoods.getStatus().equals(Status.REMOVED.value())) && (oldStatus.equals(Status.UNAVAILABLE.value()) || oldStatus.equals(Status.AVAILABLE.value()))) {
                 goodsHistory = goodsHistoryService.converTGoodsHist(nowGoods, OperateType.Down.getPhrase(), false);
             }
@@ -3699,12 +3700,12 @@ public class GoodsServiceImpl implements GoodsService {
     private void convertPageInfo(PageInfo info, GoodsFilter goodsFilter) {
         if (!StringUtils.isEmpty(goodsFilter.getStartTime())) {
             java.sql.Date startDate = new java.sql.Date(goodsFilter.getStartTime());
-            info.expression(PredicateUtils.gte("updateDate", startDate, true));
+            info.expression(PredicateUtils.gte("publishTime", startDate, true));
         }
         if (!StringUtils.isEmpty(goodsFilter.getEndTime())) {
             // 截止日期是到当天23:59:59,java.sql.Date精确到天,这里采用加一天小于的方法设置截止日期判断
             java.sql.Date endDate = new java.sql.Date(goodsFilter.getEndTime() + IntegerConstant.ONE_DAY_MILLISECONDS);
-            info.expression(PredicateUtils.lt("updateDate", endDate, true));
+            info.expression(PredicateUtils.lt("publishTime", endDate, true));
         }
         if (!StringUtils.isEmpty(goodsFilter.getCode())) {
             info.filter("code", goodsFilter.getCode());

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

@@ -2954,19 +2954,20 @@ public class ProductServiceImpl implements ProductService {
                     || Status.NO_SHELVE.value() == goods.getStatus()) && (null == goods.getOldStatus() || Status.REMOVED.value() == goods.getOldStatus());
             if (publish) {
                 type = GoodsHistory.OperateType.Publish.getPhrase();
+                goods.setPublishTime(new Date());
             } else {
                 type = GoodsHistory.OperateType.Update.getPhrase();
             }
-            goodsHistory = goodsHistoryService.converTGoodsHist(goods, type, false);
         } else  {
             if (Status.AVAILABLE.value() == goods.getStatus() || Status.UNAVAILABLE.value() == goods.getStatus() || Status.NO_SHELVE.value() == goods.getStatus()) {
                 //如果现在是已上架,原先是未上架或者已下架,则做上架处理。否则做更新处理
                 type = GoodsHistory.OperateType.Publish.getPhrase();
+                goods.setPublishTime(new Date());
             } else {
                 type = GoodsHistory.OperateType.INIT.getPhrase();
             }
-            goodsHistory = goodsHistoryService.converTGoodsHist(goods, type, false);
         }
+        goodsHistory = goodsHistoryService.converTGoodsHist(goods, type, false);
         return goodsHistory;
     }
 

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

@@ -1924,6 +1924,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 								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));
+									g.setPublishTime(new Date());
 								} else {
 									goodsHistoryList.add(goodsHistoryService.converTGoodsHist(g, GoodsHistory.OperateType.Update.getPhrase(), false));
 								}
@@ -1941,11 +1942,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				for (ReleaseProductByBatch releaseProductByBatch : insertGoods) {
 					goods = new Goods();
 					goods.setGoodsByReleaseProductByBatch(releaseProductByBatch, delayTime);
-					if ((Status.AVAILABLE.value() == goods.getStatus()) || (Status.UNAVAILABLE.value() == goods.getStatus()) || (Status.NO_SHELVE.value() == goods.getStatus())) {
-						goodsHistoryList.add(goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase(), false));
-					} else {
-						goodsHistoryList.add(goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.INIT.getPhrase(), false));
-					}
+					goods.setPublishTime(new Date());
+					goodsHistoryList.add(goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase(), false));
 					updateGoods.add(goods);
 				}
 			}