|
@@ -581,7 +581,7 @@ public class GoodsSellerModel {
|
|
|
return needAudit ? GoodsConst.GOODS_STATE_SELL_NOW_TO_AUDIT : GoodsConst.GOODS_STATE_UPPER;
|
|
|
} else {
|
|
|
//放入仓库
|
|
|
- return needAudit ? GoodsConst.GOODS_STATE_WAREHOUSE_TO_AUDIT : GoodsConst.GOODS_STATE_WAREHOUSE_NO_AUDIT;
|
|
|
+ return needAudit ? GoodsConst.GOODS_STATE_LOWER_BY_STORE : GoodsConst.GOODS_STATE_WAREHOUSE_NO_AUDIT;
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
@@ -619,7 +619,7 @@ public class GoodsSellerModel {
|
|
|
this.checkSku(productList, goodsDb.getWebSite());
|
|
|
|
|
|
//-更新商品信息
|
|
|
- Goods updateGoods = this.updateGoods(insertDTO, vendor);
|
|
|
+ Goods updateGoods = this.updateGoods(insertDTO, vendor,goodsDb.getState());
|
|
|
|
|
|
//-更新商品扩展信息
|
|
|
this.updateGoodsExtend(insertDTO, updateGoods);
|
|
@@ -741,7 +741,7 @@ public class GoodsSellerModel {
|
|
|
* @param vendor
|
|
|
* @return
|
|
|
*/
|
|
|
- private Goods updateGoods(GoodsPublishInsertDTO insertDTO, Vendor vendor) {
|
|
|
+ private Goods updateGoods(GoodsPublishInsertDTO insertDTO, Vendor vendor,int state) {
|
|
|
GoodsPublishInsertDTO.ProductInsertInfo defaultProduct = insertDTO.getDefaultProduct();
|
|
|
//构造默认货品id
|
|
|
long defaultProductId = StringUtil.isNullOrZero(defaultProduct.getProductId())
|
|
@@ -794,7 +794,11 @@ public class GoodsSellerModel {
|
|
|
goods.setIsSpec(CollectionUtils.isEmpty(insertDTO.getSpecInfoList()) ? GoodsConst.IS_SPEC_NO : GoodsConst.IS_SPEC_YES);
|
|
|
goods.setMainSpecId(insertDTO.getMainSpecId());
|
|
|
goods.setVirtualSales(insertDTO.getVirtualSales());
|
|
|
- goods.setState(this.dealGoodsState(insertDTO.getSellNow()));
|
|
|
+ if (state==GoodsConst.GOODS_STATE_LOWER_BY_SYSTEM) {
|
|
|
+ goods.setState(GoodsConst.GOODS_STATE_LOWER_BY_SYSTEM);
|
|
|
+ }else{
|
|
|
+ goods.setState(this.dealGoodsState(insertDTO.getSellNow()));
|
|
|
+ }
|
|
|
goods.setIsSelf(vendor.getStore().getIsOwnStore());
|
|
|
goods.setOnlineTime(goods.getState().equals(GoodsConst.GOODS_STATE_UPPER) ? new Date() : null);
|
|
|
goods.setStoreId(vendor.getStoreId());
|
|
@@ -1150,6 +1154,32 @@ public class GoodsSellerModel {
|
|
|
return num;
|
|
|
}
|
|
|
|
|
|
+ public Integer illegalUpperShelf(Long storeId, String goodsIds) {
|
|
|
+ //违规商品 重新上架
|
|
|
+ //11-放入仓库无需审核 12-放入仓库审核通过 的商品才能上架
|
|
|
+ GoodsExample example = new GoodsExample();
|
|
|
+ example.setGoodsIdIn(goodsIds);
|
|
|
+ example.setStateIn(String.valueOf(GoodsConst.GOODS_STATE_LOWER_BY_SYSTEM));
|
|
|
+ example.setStoreId(storeId);
|
|
|
+ List<Goods> goodsList = goodsModel.getGoodsList(example, null);
|
|
|
+
|
|
|
+ Goods goodsUpdate = new Goods();
|
|
|
+ goodsUpdate.setState(GoodsConst.GOODS_STATE_SELL_NOW_TO_AUDIT);
|
|
|
+ goodsUpdate.setOnlineTime(new Date());
|
|
|
+ goodsUpdate.setUpdateTime(new Date());
|
|
|
+ int num = goodsModel.updateGoodsByExample(goodsUpdate, example);
|
|
|
+ goodsList.forEach(goods -> {
|
|
|
+ VendorExample vendorExample = new VendorExample();
|
|
|
+ vendorExample.setStoreId(goods.getStoreId());
|
|
|
+ vendorExample.setIsStoreAdmin(VendorConst.IS_STORE_ADMIN_1);
|
|
|
+ List<Vendor> vendorList =vendorModel.getVendorList(vendorExample, null);
|
|
|
+ AssertUtil.isTrue(CollectionUtils.isEmpty(vendorList), "获取店铺信息失败");
|
|
|
+ goods.setState(GoodsConst.GOODS_STATE_SELL_NOW_TO_AUDIT);
|
|
|
+ productModel.upsertProduct(goods, vendorList.get(0));
|
|
|
+ });
|
|
|
+ return num;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 商品下架
|
|
|
*
|