Browse Source

供应链2。2 标签bug

zhaoxian 2 years ago
parent
commit
5b3e303d02

+ 3 - 3
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -294,11 +294,12 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
 
     @Override
     public Result updatePromoterLabel(JSONObject result) {
+        Long promoterId = result.getLong("promoterId");
+        Long userId = result.getLong("userId");
+        kuaishouPromoterMapper.deletePromoterLabel(promoterId, userId);
         JSONArray ids = result.getJSONArray("ids");
         if (Check.isNotNull(ids)) {
             List<JSONObject> list = new ArrayList<>();
-            Long promoterId = result.getLong("promoterId");
-            Long userId = result.getLong("userId");
             for (int i = 0; i < ids.size(); i++) {
                 JSONObject obj = new JSONObject();
                 Long labelId = ids.getLong(i);
@@ -307,7 +308,6 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
                 obj.put("userId", userId);
                 list.add(obj);
             }
-            kuaishouPromoterMapper.deletePromoterLabel(promoterId, userId);
             kuaishouPromoterMapper.insertPromoterLabels(list);
         }
         return Result.success();