Browse Source

设备台账分页调整

lipenghui 2 weeks ago
parent
commit
8063a3ed18

+ 8 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/IotDeviceController.java

@@ -184,7 +184,14 @@ public class IotDeviceController {
         }
         }
         Map<Long, DeptDO> deptMap = deptService.getDeptMap(
         Map<Long, DeptDO> deptMap = deptService.getDeptMap(
                 convertList(pageResult.getList(), IotDeviceDO::getDeptId));
                 convertList(pageResult.getList(), IotDeviceDO::getDeptId));
-        return success(new PageResult<>(IotDeviceConvert.INSTANCE.convertList(pageResult.getList(), deptMap),
+        List<IotDeviceRespVO> iotDeviceRespVOS = IotDeviceConvert.INSTANCE.convertList(pageResult.getList(), deptMap);
+        iotDeviceRespVOS.forEach(e ->{
+            SupplierDO supplierDO = supplierService.get(e.getManufacturerId());
+            if (Objects.nonNull(supplierDO)) {
+                e.setManufacturer(supplierDO.getName());
+            }
+        });
+        return success(new PageResult<>(iotDeviceRespVOS,
                 pageResult.getTotal()));
                 pageResult.getTotal()));
     }
     }
 
 

+ 1 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotDeviceRespVO.java

@@ -212,4 +212,5 @@ public class IotDeviceRespVO {
     @Schema(description = "设备对应的 BOM分组 最短保养距离集合")
     @Schema(description = "设备对应的 BOM分组 最短保养距离集合")
     private List<IotMaintenanceBomRespVO> groupBomDistances;
     private List<IotMaintenanceBomRespVO> groupBomDistances;
 
 
+    private String manufacturer;
 }
 }

+ 2 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/IotDeviceServiceImpl.java

@@ -305,8 +305,8 @@ public class IotDeviceServiceImpl implements IotDeviceService {
         List<IotDeviceDO> deviceDOS = iotDeviceMapper.selectList();
         List<IotDeviceDO> deviceDOS = iotDeviceMapper.selectList();
         deviceDOS.forEach(deviceDO -> {
         deviceDOS.forEach(deviceDO -> {
             deviceDO.setSortColumn(NumberUtils.extractNumber(deviceDO.getDeviceCode()));
             deviceDO.setSortColumn(NumberUtils.extractNumber(deviceDO.getDeviceCode()));
+            iotDeviceMapper.updateById(deviceDO);
         });
         });
-        iotDeviceMapper.updateBatch(deviceDOS);
     }
     }
 
 
     @Override
     @Override
@@ -317,8 +317,8 @@ public class IotDeviceServiceImpl implements IotDeviceService {
             if (Objects.nonNull(dictData)) {
             if (Objects.nonNull(dictData)) {
                 deviceDO.setBrandName(dictData.getLabel());
                 deviceDO.setBrandName(dictData.getLabel());
             }
             }
+            iotDeviceMapper.updateById(deviceDO);
         });
         });
-        iotDeviceMapper.updateBatch(deviceDOS);
     }
     }
 
 
     @Override
     @Override