2022-09-29 19:43:14 +08:00
|
|
|
/*
|
2022-06-21 20:47:46 +08:00
|
|
|
package com.njcn;
|
|
|
|
|
|
2022-09-29 19:43:14 +08:00
|
|
|
import com.njcn.device.pq.pojo.po.DeptLine;
|
|
|
|
|
import com.njcn.device.pq.service.DeptLineService;
|
2022-06-21 20:47:46 +08:00
|
|
|
import com.njcn.web.pojo.param.DeptLineParam;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
2022-09-29 19:43:14 +08:00
|
|
|
*/
|
2022-06-21 20:47:46 +08:00
|
|
|
/**
|
|
|
|
|
* @author hongawen
|
|
|
|
|
* @version 1.0.0
|
|
|
|
|
* @date 2021年12月14日 12:55
|
2022-09-29 19:43:14 +08:00
|
|
|
*//*
|
|
|
|
|
|
2022-07-28 20:38:17 +08:00
|
|
|
public class DeviceTest extends BaseJunitTest {
|
2022-06-21 20:47:46 +08:00
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private DeptLineService deptLineService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void test() {
|
|
|
|
|
DeptLineParam deptLineParam = new DeptLineParam();
|
|
|
|
|
deptLineParam.setId("1");
|
|
|
|
|
List<String> ids = Stream.of("999", "888", "777").collect(Collectors.toList());
|
|
|
|
|
//先解绑,再进行绑定
|
|
|
|
|
List<DeptLine> deptLines = new ArrayList<>();
|
|
|
|
|
deptLineParam.setIds(ids);
|
|
|
|
|
deptLineParam.getIds().stream().map(id -> {
|
|
|
|
|
System.out.println("==================");
|
|
|
|
|
DeptLine deptLine = new DeptLine();
|
|
|
|
|
deptLine.setId(deptLineParam.getId());
|
|
|
|
|
deptLine.setLineId(id);
|
|
|
|
|
deptLines.add(deptLine);
|
|
|
|
|
return deptLine;
|
|
|
|
|
});
|
|
|
|
|
deptLineService.saveBatch(deptLines);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2022-09-29 19:43:14 +08:00
|
|
|
*/
|