Procházet zdrojové kódy

处理删除物料是在售产品先做下架再做删除动作

yujia před 7 roky
rodič
revize
586a824c74

+ 13 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsHistory.java

@@ -434,6 +434,9 @@ public class GoodsHistory {
 	@JoinColumn(name = "log_operateuu", insertable = false, updatable = false)
 	private UserBaseInfo operater;
 
+	@Column(name = "go_id")
+	private Long goid;
+
 	@Transient
 	private String enterpriseName;
 
@@ -1068,6 +1071,7 @@ public class GoodsHistory {
 		this.tag = goods.getTag();
 		this.prodNum = goods.getProdNum();
 		this.spec = goods.getSpec();
+		this.goid  = goods.getId();
     }
 
 	public Short getSelfDeliveryDemMinTime() {
@@ -1201,4 +1205,13 @@ public class GoodsHistory {
 		this.attach = attach;
 		return this;
 	}
+
+	public Long getGoid() {
+		return goid;
+	}
+
+	public GoodsHistory setGoid(Long goid) {
+		this.goid = goid;
+		return this;
+	}
 }

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

@@ -3630,7 +3630,11 @@ public class GoodsServiceImpl implements GoodsService {
                 histories.add(goodsHistoryRemoved);
             }
             //删除库存信息
-            goods.setStatus(Status.GOODS_DELETE.value());
+            goods.setStatus(Status.REMOVED.value());
+            GoodsHistory goodsHistoryDown = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase(),false);
+            histories.add(goodsHistoryDown);
+            //删除库存信息
+            goods.setStatus(Status.DELETED.value());
             GoodsHistory goodsHistoryDelete = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase(),false);
             histories.add(goodsHistoryDelete);
             goodses1.add(goods);