|
@@ -138,6 +138,9 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
@ApiOperation("设备列表-管理员")
|
|
|
public R<List<DeviceInfoDto.ListByAdminName>> listByAdminName(@RequestBody @Validated DeviceInfoDto.GroupByAdminNameDto dto) {
|
|
|
String noAdmin = "未分配管理员";
|
|
|
+ //是否质检商户
|
|
|
+ boolean isQa = BooleanUtil.isTrue(dto.getIsQaMode());
|
|
|
+
|
|
|
List<DeviceInfoDto.ListByAdminName> deviceInfoList = baseMapper.listByAdminName(dto);
|
|
|
deviceInfoList.forEach(i -> {
|
|
|
SysDictRedis dictDeviceType = SysDictUtils.get(DictConsts.DEVICE_TYPE, String.valueOf(i.getDeviceType()));
|
|
@@ -175,37 +178,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
@Override
|
|
|
@ApiOperation("设备分组-管理员")
|
|
|
public R<List<DeviceInfoDto.GroupByAdminNameVo>> groupByAdminName(@RequestBody @Validated DeviceInfoDto.GroupByAdminNameDto dto) {
|
|
|
- String noAdmin = "未分配管理员";
|
|
|
- List<DeviceInfoDto.ListByAdminName> deviceInfoList = listByAdminName(dto).getData();
|
|
|
- // 根据管理员名字分组
|
|
|
- Map<String, List<DeviceInfoDto.ListByAdminName>> deviceMap = deviceInfoList.stream().collect(Collectors.groupingBy(DeviceInfoDto.ListByAdminName::getAdminName));
|
|
|
- List<DeviceInfoDto.GroupByAdminNameVo> list = new ArrayList<>();
|
|
|
- // 不包含未分配管理员的
|
|
|
- deviceMap.forEach(
|
|
|
- (k, i) -> {
|
|
|
- DeviceInfoDto.GroupByAdminNameVo vo = new DeviceInfoDto.GroupByAdminNameVo();
|
|
|
- if (!noAdmin.equals(k)) {
|
|
|
- vo.setAdminName(k)
|
|
|
- .setDeviceNum(i.size())
|
|
|
- .setDeviceInfos(i);
|
|
|
- list.add(vo);
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
- // 包含分配管理员的
|
|
|
- List<DeviceInfoDto.ListByAdminName> noAdminNamesList = deviceMap.get(noAdmin);
|
|
|
- if (Emptys.check(noAdminNamesList)) {
|
|
|
- DeviceInfoDto.GroupByAdminNameVo vo = new DeviceInfoDto.GroupByAdminNameVo();
|
|
|
- vo.setAdminName(noAdmin)
|
|
|
- .setDeviceNum(noAdminNamesList.size())
|
|
|
- .setDeviceInfos(noAdminNamesList);
|
|
|
- list.add(vo);
|
|
|
- }
|
|
|
- return R.ok(list);
|
|
|
- }
|
|
|
|
|
|
|
|
|
- public R<List<DeviceInfoDto.GroupByAdminNameVo>> groupByAdminCount(@RequestBody @Validated DeviceInfoDto.GroupByAdminNameDto dto) {
|
|
|
String noAdmin = "未分配管理员";
|
|
|
List<DeviceInfoDto.ListByAdminName> deviceInfoList = listByAdminName(dto).getData();
|
|
|
// 根据管理员名字分组
|
|
@@ -236,6 +210,9 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@PostMapping("eventList")
|
|
|
@ApiOperation("根据事件编码查询设备")
|
|
|
public R<PageBean<DeviceInfoDto.EventListVo>> eventList(@RequestBody @Validated DeviceInfoDto.EventList eventList) {
|