fix:修改设备详情负责人显示问题

plp
HuangHuiKang 2 weeks ago
parent 9fbfb95489
commit ead838a214

@ -86,7 +86,24 @@ public class DeviceLedgerController {
@PreAuthorize("@ss.hasPermission('mes:device-ledger:query')")
public CommonResult<DeviceLedgerRespVO> getDeviceLedger(@RequestParam("id") Long id) {
DeviceLedgerDO deviceLedger = deviceLedgerService.getDeviceLedger(id);
return success(BeanUtils.toBean(deviceLedger, DeviceLedgerRespVO.class));
DeviceLedgerRespVO respVO = BeanUtils.toBean(deviceLedger, DeviceLedgerRespVO.class);
if (StringUtils.isNotBlank(respVO.getDeviceManager())) {
String[] userIds = respVO.getDeviceManager().split(",");
StringBuilder names = new StringBuilder();
for (int i = 0; i < userIds.length; i++) {
AdminUserRespDTO user = adminUserApi.getUser(Long.valueOf(userIds[i].trim()));
if (user != null) {
if (i > 0) names.append(", ");
names.append("(").append(user.getUsername()).append(")").append(user.getNickname());
}
}
respVO.setDeviceManagerName(names.toString());
}
return success(respVO);
}

@ -140,6 +140,8 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
public DeviceLedgerDO getDeviceLedger(Long id) {
DeviceLedgerDO deviceLedgerDO = deviceLedgerMapper.selectById(id);
Map<String,List<DvRepairLineDO>> dvRepairDOMap=new HashMap<>();
//TODO 待修改迁移

Loading…
Cancel
Save