Преглед на файлове

普通店铺商品审核通过后进入平台总库

Guos преди 4 седмици
родител
ревизия
2db0d64643

+ 3 - 0
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreProductScrmController.java

@@ -27,6 +27,7 @@ import com.fs.statis.dto.ProductAuditDTO;
 import com.mysql.cj.util.StringUtils;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.Assert;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -138,6 +139,8 @@ public class FsStoreProductScrmController extends BaseController {
                     + "(#p0.isAudit==1?new String[]{'商品','商品批量审核通过'}: new String[]{'商品','商品批量审核退回'}):" +
                     "(#p0.isAudit==1?new String[]{'商品','商品审核通过'}: new String[]{'商品','商品审核退回'})")
     public R batchAudit(@RequestBody ProductAuditDTO auditDTO) {
+        Assert.notNull(auditDTO.getProductIds(), "请选择商品!");
+        Assert.notNull(auditDTO.getIsAudit(), "通过或退回不能为空!");
         fsStoreProductService.batchAudit(auditDTO);
         return R.ok();
     }

+ 15 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -40,6 +40,7 @@ import com.fs.hisStore.dto.ForbiddenDrugItemDTO;
 import com.fs.hisStore.dto.FsStoreProductScrmInfoDTO;
 import com.fs.hisStore.mapper.*;
 import com.fs.hisStore.param.FsStoreCartCountParam;
+import com.fs.hisStore.service.IFsPlatformProductScrmService;
 import com.fs.hisStore.service.IFsStoreProductCategoryScrmService;
 import com.fs.hisStore.service.categoryVal.AbstractHandler;
 import com.fs.hisStore.service.categoryVal.ProductCategoryCheckFactory;
@@ -62,6 +63,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import com.fs.hisStore.service.IFsStoreProductScrmService;
 import org.springframework.transaction.annotation.Propagation;
@@ -128,6 +130,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Autowired
     private FsStoreScrmOcrMapper fsStoreScrmOcrMapper;
 
+    @Lazy
+    @Autowired
+    private IFsPlatformProductScrmService ifsPlatformProductService;
+
 
     private ForbiddenDrugListManager forbiddenListManager = new ForbiddenDrugListManager();
 
@@ -1307,10 +1313,19 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Override
     @Transactional
     public void batchAudit(ProductAuditDTO auditDTO) {
+        //isAudit = 1 通过,如果通过了就需要将商品同步到产品库去,做一个id绑定。
         //如果审核通过就是上架,如果审核不通过就是处于下架状态,为了清晰这里可以添加枚举(0未审核1审核通过2审核退回),
         // 正常情况是退回后可以申请重新上架的如果不通过2,那么show就变回0(直接在sql中去做的),按照原有逻辑去做
         fsStoreProductMapper.batchAudit(auditDTO);
         storeAuditLogUtil.addBatchAuditList(auditDTO.getProductIds(),auditDTO.getReason(),auditDTO.getAttachImage());
+        //TODO 平台商品库
+//        if(auditDTO.getIsAudit() == 1){
+//            //复制一份到平台商品库
+//            for(Long productId : auditDTO.getProductIds()){
+//                fsStoreProductMapper.selectFsStoreProductById(auditDTO.getProductIds());
+//                ifsPlatformProductService.addOrEdit(auditDTO);
+//            }
+//        }
     }
 
     @Override