| | |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | import com.alibaba.excel.metadata.property.ExcelContentProperty; |
| | | import enumeration.general.RuleDeductCategoryEnum; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * 扣分类型枚举装换器 |
| | | * |
| | | * @author gonghl |
| | | */ |
| | | @Slf4j |
| | | public class RuleDeductCategoryConverter implements Converter<RuleDeductCategoryEnum> { |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public RuleDeductCategoryEnum convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | public RuleDeductCategoryEnum convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { |
| | | if (cellData.getStringValue().equals(RuleDeductCategoryEnum.DEDUCT_POINTS.getDesc())) { |
| | | return RuleDeductCategoryEnum.DEDUCT_POINTS; |
| | | } else if (cellData.getStringValue().equals(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY.getDesc())) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public WriteCellData convertToExcelData(RuleDeductCategoryEnum value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | return new WriteCellData(value.getDesc()); |
| | | public WriteCellData<RuleDeductCategoryEnum> convertToExcelData(RuleDeductCategoryEnum value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { |
| | | return new WriteCellData<>(value.getDesc()); |
| | | } |
| | | } |