Commit b3d26685 by guojuxing

新建门店状态策略属性条件排序-代码优化

parent 02e8c11b
......@@ -67,14 +67,12 @@ public class StoreStrategyController {
.listStoreFieldByRegionId(regionId);
if (storeFieldDTOServiceResponse.isSuccess()) {
List<StoreFieldDTO> storeFieldDTOList = storeFieldDTOServiceResponse.getResult();
for (StoreFieldDTO storeFieldDTO : storeFieldDTOList) {
int storeFieldType = storeFieldDTO.getStoreFieldType();
boolean isRadioOrCheck = storeFieldType == StoreFieldTypeEnum.RADIO.getCode()
|| storeFieldType == StoreFieldTypeEnum.CHECK.getCode();
if (isRadioOrCheck) {
result.put(storeFieldDTO.getStoreFieldId().toString(), storeFieldDTO.getStoreFieldName());
}
}
storeFieldDTOList
.stream()
.filter(e -> e != null)
.filter(e -> e.getStoreFieldType().intValue() == StoreFieldTypeEnum.RADIO.getCode()
|| e.getStoreFieldType().intValue() == StoreFieldTypeEnum.CHECK.getCode())
.forEach(e -> result.put(e.getStoreFieldId().toString(), e.getStoreFieldName()));
}
return RestResponse.success(result);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment