|
@@ -42,6 +42,7 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/base/personInfo")
|
|
@@ -434,17 +435,15 @@ public class PersonInfoController {
|
|
|
|
|
|
Page<PersonInfo> page = personInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
Page<PersonInfoDTO> pageDTO = PojoUtils.convertPage(page, PersonInfoDTO.class);
|
|
|
+
|
|
|
for(PersonInfoDTO dto : pageDTO.getResult()){
|
|
|
- String deviceName = "";
|
|
|
- List<PersonDeviceRelation> personDeviceRelationList = personDeviceRelationService.findByPersonId(dto.getId());
|
|
|
- for(PersonDeviceRelation personDeviceRelation : personDeviceRelationList){
|
|
|
- DeviceInfo deviceInfo = deviceInfoService.get(personDeviceRelation.getDeviceId());
|
|
|
- deviceName += deviceInfo.getAliasName() + ",";
|
|
|
- }
|
|
|
- if(StringUtils.isNotEmpty(deviceName)) {
|
|
|
- deviceName = deviceName.substring(0,deviceName.length()-1);
|
|
|
- dto.setDeviceName(deviceName);
|
|
|
- }
|
|
|
+ List<DeviceInfo> deviceNameList = personDeviceRelationService.findDeviceByPersonId(dto.getId());
|
|
|
+
|
|
|
+ String deviceName = deviceNameList.stream()
|
|
|
+ .map((device)->device.getAliasName())
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ dto.setDeviceName(deviceName);
|
|
|
}
|
|
|
|
|
|
msgResult.setResult(true);
|