|
|
@@ -257,7 +257,8 @@ public class ProjectService {
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return PageRes.build(info, list);
|
|
|
}
|
|
|
-// 后期要数据翻译产品类型
|
|
|
+ Map<String, SystemDict> deviceType = commonService.getDictByDictCode(DictEnum.DEVICE_TYPE);
|
|
|
+ Map<String, SystemDict> company = commonService.getDictByDictCode(DictEnum.COMPANY);
|
|
|
for (ProjectDeviceVO projectDeviceDTO : list) {
|
|
|
Long id = projectDeviceDTO.getDeviceRelationId();
|
|
|
KwsDeviceRelation deviceRelation = deviceRelationMapper.selectOne(new LambdaQueryWrapper<KwsDeviceRelation>()
|
|
|
@@ -265,6 +266,13 @@ public class ProjectService {
|
|
|
.eq(KwsDeviceRelation::getMountainId, headerData.getMountainId())
|
|
|
.eq(KwsDeviceRelation::getDelFlag, 0)
|
|
|
);
|
|
|
+ projectDeviceDTO.setDeviceModelName(projectDeviceDTO.getDeviceModelName() == null ? null :
|
|
|
+ (deviceType == null ? projectDeviceDTO.getDeviceModelName() : (
|
|
|
+ deviceType.get(projectDeviceDTO.getDeviceType()) == null ? projectDeviceDTO.getDeviceModelName() : deviceType.get(projectDeviceDTO.getDeviceType()).getLabel()
|
|
|
+ )));
|
|
|
+ projectDeviceDTO.setManufacturer(projectDeviceDTO.getManufacturer() == null ? null :
|
|
|
+ (company == null ? projectDeviceDTO.getManufacturer() :
|
|
|
+ (company.get(projectDeviceDTO.getManufacturer()) == null ? projectDeviceDTO.getManufacturer() : company.get(projectDeviceDTO.getManufacturer()).getLabel())));
|
|
|
if (deviceRelation != null) {
|
|
|
projectDeviceDTO.setParentId(deviceRelation.getDeviceId().toString());
|
|
|
KwsDevice kwsDevice = deviceMapper.selectByPrimaryKey(deviceRelation.getDeviceId());
|
|
|
@@ -382,10 +390,13 @@ public class ProjectService {
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return PageRes.build(info, list);
|
|
|
}
|
|
|
-// 后期要数据翻译产品类型
|
|
|
-// for (ProjectDeviceDTO projectDeviceDTO : list) {
|
|
|
-//
|
|
|
-// }
|
|
|
+ Map<String, SystemDict> dictByDictCode = commonService.getDictByDictCode(DictEnum.DEVICE_TYPE);
|
|
|
+ for (ProjectDeviceVO projectDeviceVO : list) {
|
|
|
+ projectDeviceVO.setDeviceType(projectDeviceVO.getDeviceType() == null ? null :
|
|
|
+ (dictByDictCode == null ? projectDeviceVO.getDeviceType() :
|
|
|
+ (dictByDictCode.get(projectDeviceVO.getDeviceType()) == null ? projectDeviceVO.getDeviceType() :
|
|
|
+ dictByDictCode.get(projectDeviceVO.getDeviceType()).getLabel())));
|
|
|
+ }
|
|
|
return PageRes.build(info, list);
|
|
|
}
|
|
|
|