MainTest.java
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.viontech.fanxing.ops;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.viontech.fanxing.commons.model.DictCode;
import com.viontech.fanxing.commons.vo.ChannelVo;
import com.viontech.fanxing.ops.service.adapter.ChannelService;
import com.viontech.fanxing.ops.service.adapter.DictCodeService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* .
*
* @author 谢明辉
* @date 2021/9/2
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class MainTest {
@Resource
private ChannelService channelService;
@Test
public void nvs3000CodeTest() {
ChannelVo channelVo = new ChannelVo();
channelVo.setChannelUnid("123");
ArrayList<ChannelVo> objects = new ArrayList<>();
objects.add(channelVo);
Map<String, List<ChannelVo>> addressUnid_channel_map = objects.stream().map(ChannelVo::new).collect(Collectors.groupingBy(ChannelVo::getAddressUnid, Collectors.toList()));
System.out.println(addressUnid_channel_map);
}
}