فهرست منبع

商家认证优化

liude 1 سال پیش
والد
کامیت
f903439ae6

+ 1 - 1
vehicle-client/src/main/java/com/chelvc/cloud/vehicle/client/MerchantAuthClient.java

@@ -27,7 +27,7 @@ public interface MerchantAuthClient {
      * @param param 新增参数
      * @return 主键
      */
-    @PostMapping("/merchantAuth/changeSystemInformFlag")
+    @PostMapping("/merchantAuth/addMerchantAuth")
     Long addMerchantAuth(@RequestBody MerchantAuthModifyParam param);
 
     /**

+ 1 - 1
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/controller/MerchantAuthController.java

@@ -32,7 +32,7 @@ public class MerchantAuthController {
      * @param param 新增参数
      * @return 主键
      */
-    @PostMapping("/merchantAuth/changeSystemInformFlag")
+    @PostMapping("/merchantAuth/addMerchantAuth")
     public Long addMerchantAuth(@RequestBody MerchantAuthModifyParam param) {
         return merchantAuthService.addMerchantAuth(param);
     }

+ 27 - 23
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantServiceImpl.java

@@ -176,18 +176,21 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
             business.add(param.getMainBusiness());
         }
 //        this.categoryService.removeByIds(business);
-        List<Category> categories = this.categoryService.getCategories(business);
-        if (!CollectionUtils.isEmpty(categories)){
-            categories.forEach(item ->{
-                item.setSourceId(item.getId());
-                item.setId(null);
-                item.setMerchantId(merchant.getId());
-                item.setType("1");
-                item.setParentId(0L);
-                this.categoryService.save(item);
-            });
-           // this.categoryService.saveBatchCategories(categories);
+        if (!CollectionUtils.isEmpty(business)){
+            List<Category> categories = this.categoryService.getCategories(business);
+            if (!CollectionUtils.isEmpty(categories)){
+                categories.forEach(item ->{
+                    item.setSourceId(item.getId());
+                    item.setId(null);
+                    item.setMerchantId(merchant.getId());
+                    item.setType("1");
+                    item.setParentId(0L);
+                    this.categoryService.save(item);
+                });
+                // this.categoryService.saveBatchCategories(categories);
+            }
         }
+
         return merchant.getId();
     }
 
@@ -201,20 +204,21 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
             business.add(param.getMainBusiness());
         }
 //        this.categoryService.removeByIds(business);
-        this.categoryService.deleteByMerchantId(merchant.getId());
-        List<Category> categories = this.categoryService.getCategories(business);
-        if (!CollectionUtils.isEmpty(categories)){
-            categories.forEach(item ->{
-                item.setSourceId(item.getId());
-                item.setId(null);
-                item.setMerchantId(merchant.getId());
-                item.setType("1");
-                item.setParentId(0L);
+        if (!CollectionUtils.isEmpty(business)){
+            this.categoryService.deleteByMerchantId(merchant.getId());
+            List<Category> categories = this.categoryService.getCategories(business);
+            if (!CollectionUtils.isEmpty(categories)){
+                categories.forEach(item ->{
+                    item.setSourceId(item.getId());
+                    item.setId(null);
+                    item.setMerchantId(merchant.getId());
+                    item.setType("1");
+                    item.setParentId(0L);
 //                this.categoryService.save(item);
-            });
-            this.categoryService.saveBatchCategories(categories);
+                });
+                this.categoryService.saveBatchCategories(categories);
+            }
         }
-
     }
 
     @Override