Prechádzať zdrojové kódy

修改通道产品字段

杜魏 4 rokov pred
rodič
commit
58dac3448c

+ 2 - 1
modules/admin/src/main/java/com/fire/admin/service/impl/BankCardServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fire.admin.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fire.admin.mapper.BankCardMapper;
@@ -42,7 +43,7 @@ public class BankCardServiceImpl extends ServiceImpl<BankCardMapper, BankCard> i
                 bankCard.setUpdateTime(new Date());
             }
         }
-        if (bankCards != null) {
+        if (ObjectUtil.isNotEmpty(bankCards)) {
             boolean result = this.saveOrUpdateBatch(bankCards);
             if (result) {
                 // TODO: 2021/5/20 向MQ推送消息

+ 7 - 4
modules/admin/src/main/java/com/fire/admin/service/impl/ChannelProductServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fire.admin.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fire.admin.mapper.ChannelProductMapper;
@@ -22,7 +23,7 @@ public class ChannelProductServiceImpl extends ServiceImpl<ChannelProductMapper,
     @Override
     public List<ChannelProductInfo> getChannelProductList(Long channelId) {
         List<ChannelProductInfo> channelProductInfos = new LambdaQueryChainWrapper<>(baseMapper)
-                        .eq(channelId != null, ChannelProductInfo::getChannelId, channelId).list();
+                .eq(channelId != null, ChannelProductInfo::getChannelId, channelId).list();
         if (channelProductInfos != null) {
             return channelProductInfos;
         } else {
@@ -32,9 +33,11 @@ public class ChannelProductServiceImpl extends ServiceImpl<ChannelProductMapper,
 
     @Override
     public void saveChannelProducts(@RequestBody List<ChannelProductInfo> channelProductInfos) {
-        boolean result = this.saveOrUpdateBatch(channelProductInfos);
-        if (result) {
-            // TODO: 2021/5/25 向MQ推送消息
+        if (ObjectUtil.isNotEmpty(channelProductInfos)) {
+            boolean result = this.saveOrUpdateBatch(channelProductInfos);
+            if (result) {
+                // TODO: 2021/5/25 向MQ推送消息
+            }
         }
     }
 }