feat: 设备台账新增typeName字段冗余存储

main
zhongwenkai 9 hours ago
parent c84b8974d6
commit 341f1b9bd7

@ -41,6 +41,9 @@ public class DeviceLedgerSaveReqVO {
@Schema(description = "设备类型", example = "1")
private String deviceType;
@Schema(description = "设备类型名称", example = "测试ID13")
private String typeName;
@Schema(description = "设备产线", example = "1")
private Long deviceLine;

@ -145,7 +145,6 @@ public class DeviceLedgerDO extends BaseDO {
/**
*
*/
@TableField(exist = false)
private String typeName;
/**

@ -498,12 +498,11 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
.collect(Collectors.toMap(DeviceLineDO::getId, Function.identity(), (a, b) -> a));
PageResult<DeviceLedgerDO> deviceLedgerDOPageResult = deviceLedgerMapper.selectPage(pageReqVO);
for (DeviceLedgerDO deviceLedgerDO : deviceLedgerDOPageResult.getList()) {
if (deviceLedgerDO.getDeviceType()!=null){
DeviceTypeDO deviceTypeDO = deviceTypeMapper.selectById(deviceLedgerDO.getDeviceType());
deviceLedgerDO.setTypeName(deviceTypeDO.getName());
}
if(deviceLedgerDO.getDeviceLine()!=null&&CollUtil.isNotEmpty(collect.get(deviceLedgerDO.getDeviceLine().longValue()))){
deviceLedgerDO.setWorkshopName(collect.get(deviceLedgerDO.getDeviceLine().longValue()).get(0).getName());
if(deviceLedgerDO.getDeviceLine()!=null){
List<DeviceLineDO> deviceLines = collect.get(deviceLedgerDO.getDeviceLine());
if(CollUtil.isNotEmpty(deviceLines)){
deviceLedgerDO.setWorkshopName(deviceLines.get(0).getName());
}
}
fillTopCategoryInfo(deviceLedgerDO, deviceLineMap);
}

Loading…
Cancel
Save