|
@@ -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推送消息
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|