|
@@ -1,16 +1,25 @@
|
|
|
package com.fire.admin.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fire.admin.dto.FlowAppInfoDto;
|
|
|
import com.fire.admin.mapper.FlowAppMapper;
|
|
|
+import com.fire.admin.service.ChannelGroupService;
|
|
|
import com.fire.admin.service.FlowAppInfoService;
|
|
|
import com.fire.admin.vo.FlowAppInfoVo;
|
|
|
+import com.fire.dto.ChannelGroup;
|
|
|
import com.fire.dto.FlowAppInfo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
/**
|
|
|
* @author: liuliu
|
|
|
* @ClassName: FlowAppInfoServiceImpl
|
|
@@ -22,6 +31,14 @@ import org.springframework.stereotype.Service;
|
|
|
public class FlowAppInfoServiceImpl extends ServiceImpl<FlowAppMapper, FlowAppInfo> implements FlowAppInfoService {
|
|
|
|
|
|
|
|
|
+
|
|
|
+ private ChannelGroupService channelGroupService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public FlowAppInfoServiceImpl(ChannelGroupService channelGroupService){
|
|
|
+ this.channelGroupService=channelGroupService;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @Description: TODO 分页获取客户接入对象
|
|
|
* @Param: 客户名称
|
|
@@ -31,16 +48,37 @@ public class FlowAppInfoServiceImpl extends ServiceImpl<FlowAppMapper, FlowAppIn
|
|
|
*/
|
|
|
@Override
|
|
|
public IPage<FlowAppInfoVo> getFlowAppInfoPage(Page page, String customerName) {
|
|
|
- return baseMapper.queryFlowAppInfoPage(page, customerName);
|
|
|
+
|
|
|
+
|
|
|
+ IPage<FlowAppInfoVo> flowAppInfoVoIPage = baseMapper.queryFlowAppInfoPage(page, customerName);
|
|
|
+
|
|
|
+ // TODO 元数据
|
|
|
+ List<FlowAppInfoVo> flowAppInfoVoList= flowAppInfoVoIPage.getRecords();
|
|
|
+
|
|
|
+ List<Long> channelGroupIds = JSONArray.parseArray(flowAppInfoVoList.stream().map(FlowAppInfoVo::getChannelId).collect(Collectors.toList()).toString(), Long.class);
|
|
|
+
|
|
|
+ List<ChannelGroup> channelGroups = channelGroupService.queryChannelGroup(channelGroupIds);
|
|
|
+
|
|
|
+ flowAppInfoVoList.forEach(app->{
|
|
|
+ channelGroups.forEach(channel->{
|
|
|
+ if(ObjectUtil.isNotEmpty(app.getChannelId()) && ObjectUtil.isNotEmpty(channel.getChannelGroupId())){
|
|
|
+ if(app.getChannelId().longValue() == channel.getChannelGroupId().longValue()){
|
|
|
+ app.setGroupName(channel.getGroupName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ return flowAppInfoVoIPage;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @Description: TODO 修改客户接入信息
|
|
|
- * @Param: 客户接入网络传输对象
|
|
|
- * @return: void
|
|
|
- * @Author: liuliu
|
|
|
- * @Date: 2021/5/26 10:16
|
|
|
- */
|
|
|
+ * @Description: TODO 修改客户接入信息
|
|
|
+ * @Param: 客户接入网络传输对象
|
|
|
+ * @return: void
|
|
|
+ * @Author: liuliu
|
|
|
+ * @Date: 2021/5/26 10:16
|
|
|
+ */
|
|
|
@Override
|
|
|
public void updateFlowAppInfo(FlowAppInfoDto flowAppInfoDto) {
|
|
|
FlowAppInfo appInfo = FlowAppInfo.builder()
|
|
@@ -56,8 +94,8 @@ public class FlowAppInfoServiceImpl extends ServiceImpl<FlowAppMapper, FlowAppIn
|
|
|
.time(flowAppInfoDto.getTime())
|
|
|
.channelId(flowAppInfoDto.getChannelId()).build();
|
|
|
int count = baseMapper.updateById(appInfo);
|
|
|
- if(count>0){
|
|
|
- log.info("客户接入信息修改,修改信息为:【{}】",appInfo.toString());
|
|
|
+ if (count > 0) {
|
|
|
+ log.info("客户接入信息修改,修改信息为:【{}】", appInfo.toString());
|
|
|
// TODO 发送消息到 客户接入 topic
|
|
|
|
|
|
}
|