fix (farm): 模型管理-农事记录-投入品
- 单位名称字段为null
This commit is contained in:
@@ -36,10 +36,14 @@ public class InputLibraryRespVO {
|
||||
@Schema(description = "单位")
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
private String unitName;
|
||||
|
||||
|
||||
@Schema(description = "单件")
|
||||
@ExcelProperty("单件")
|
||||
private String packageUnit;
|
||||
private String packageUnitName;
|
||||
|
||||
|
||||
@Schema(description = "单价", example = "23806")
|
||||
@ExcelProperty("单价")
|
||||
|
||||
@@ -100,10 +100,10 @@ public class ModelFarmingOperationServiceImpl implements ModelFarmingOperationSe
|
||||
Map<String, String> dictMap = dictDOList.stream().filter(e -> e.getField2Code() != null).collect(Collectors.toMap(SysDictDO::getField2Code, SysDictDO::getField2Name, (v1, v2) -> v1));
|
||||
|
||||
List<SysDictDO> unit1List= sysDictService.getByTypeCode(CommonConstants.DICT_TYPE_CODE_4_1); // 吨
|
||||
Map<String, String> unit1Map = unit1List.stream().filter(e -> e.getField2Code() != null).collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||
Map<String, String> unit1Map = unit1List.stream().collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||
|
||||
List<SysDictDO> unit2List= sysDictService.getByTypeCode(CommonConstants.DICT_TYPE_CODE_4_2); // 包
|
||||
Map<String, String> unit2Map = unit2List.stream().filter(e -> e.getField2Code() != null).collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||
Map<String, String> unit2Map = unit2List.stream().collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||
|
||||
|
||||
ModelFarmingOperationRespVO bean = BeanUtils.toBean(modelFarmingOperationMapper.selectById(id), ModelFarmingOperationRespVO.class);
|
||||
|
||||
@@ -256,10 +256,10 @@ public class ModelManagementServiceImpl implements ModelManagementService {
|
||||
Map<String, DisasterDataDO> commonDisasterDataMap = commonDisasterDataList.stream().collect(Collectors.toMap(DisasterDataDO::getName, e -> e, (v1, v2) -> v1));
|
||||
|
||||
List<SysDictDO> unit1List= sysDictService.getByTypeCode(CommonConstants.DICT_TYPE_CODE_4_1); // 吨
|
||||
Map<String, String> unit1Map = unit1List.stream().filter(e -> e.getField2Code() != null).collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||
Map<String, String> unit1Map = unit1List.stream().collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||
|
||||
List<SysDictDO> unit2List= sysDictService.getByTypeCode(CommonConstants.DICT_TYPE_CODE_4_2); // 包
|
||||
Map<String, String> unit2Map = unit2List.stream().filter(e -> e.getField2Code() != null).collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||
Map<String, String> unit2Map = unit2List.stream().collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||
|
||||
|
||||
ModelManagementDO modelManagementDO = modelManagementMapper.selectById(id);
|
||||
|
||||
@@ -227,10 +227,19 @@ public class SysDictServiceImpl implements SysDictService {
|
||||
List<SysDictDO> dictDOList= sysDictMapper.getByTypeCode(CommonConstants.DICT_TYPE_CODE_4);
|
||||
Map<String, String> dictMap = dictDOList.stream().filter(e -> e.getField2Code() != null).collect(Collectors.toMap(SysDictDO::getField2Name, SysDictDO::getField2Code, (v1, v2) -> v1));
|
||||
|
||||
List<SysDictDO> unit1List= this.getByTypeCode(CommonConstants.DICT_TYPE_CODE_4_1); // 吨
|
||||
Map<String, String> unit1Map = unit1List.stream().collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||
|
||||
List<SysDictDO> unit2List= this.getByTypeCode(CommonConstants.DICT_TYPE_CODE_4_2); // 包
|
||||
Map<String, String> unit2Map = unit2List.stream().collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1));
|
||||
|
||||
|
||||
List<InputLibraryDO> inputLibraryDOS = inputLibraryMapper.selectList();
|
||||
List<InputLibraryRespVO> res = BeanUtils.toBean(inputLibraryDOS, InputLibraryRespVO.class);
|
||||
for (InputLibraryRespVO e : res) {
|
||||
e.setAssetCode(dictMap.get(e.getAssetName()));
|
||||
e.setUnitName(unit1Map.get(e.getUnit()));
|
||||
e.setPackageUnitName(unit2Map.get(e.getPackageUnit()));
|
||||
}
|
||||
return res;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user