| | |
| | | } |
| | | List<CustomTemplateFieldColumnVO> columns = this.customTemplateFieldService.getColumns(templateId, configType); |
| | | List<CustomTemplateField> customTemplateFields = CustomTemplateFieldConvert.INSTANCE.convertToFields(columns); |
| | | List<CustomTemplateField> notSysField = (List) customTemplateFields.stream().filter(c -> { |
| | | List<CustomTemplateField> notSysField = customTemplateFields.stream().filter(c -> { |
| | | return c.getSystemField().equals(CommonConstant.ZERO); |
| | | }).collect(Collectors.toList()); |
| | | this.bladeRedis.setEx(getCacheKey(templateId, configType), notSysField, CACHE_TIMEOUT); |
| | |
| | | } |
| | | |
| | | private Map<String, CustomTemplateField> convertMap(List<CustomTemplateField> columns) { |
| | | return columns.parallelStream().collect(Collectors.toMap(CustomTemplateField::getFieldCode, o -> o, (o, n) -> o)); |
| | | /* |
| | | return (Map) columns.parallelStream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getFieldCode(); |
| | | }, o -> { |
| | | return o; |
| | | }, o2, n -> { |
| | | return o2; |
| | | })); |
| | | }));*/ |
| | | } |
| | | |
| | | public static String getCacheKey(Long templateId, Integer configType) { |
| | | return FIELDS_KEY + templateId + SystemPropertyUtils.VALUE_SEPARATOR + configType; |
| | | return FIELDS_KEY + templateId + ":" + configType; |
| | | } |
| | | |
| | | public void clear(Long templateId, Integer configType) { |
| | |
| | | } |
| | | |
| | | public void clear(Long templateId) { |
| | | for (ConfigTypeEnum value : ConfigTypeEnum.values()) { |
| | | this.bladeRedis.del(getCacheKey(templateId, value.getCode())); |
| | | }/* |
| | | ConfigTypeEnum[] values; |
| | | for (ConfigTypeEnum value : ConfigTypeEnum.values()) { |
| | | this.bladeRedis.del(getCacheKey(templateId, value.getCode())); |
| | | } |
| | | }*/ |
| | | } |
| | | } |