# Conflicts: # dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/TaskNodeConverter.javamaster
commit
824f7d1653
1 changed files with 87 additions and 0 deletions
@ -0,0 +1,87 @@ |
|||||||
|
package com.daqing.framework.utils.excel; |
||||||
|
|
||||||
|
import com.alibaba.excel.converters.Converter; |
||||||
|
import com.alibaba.excel.enums.CellDataTypeEnum; |
||||||
|
import com.alibaba.excel.metadata.CellData; |
||||||
|
import com.alibaba.excel.metadata.GlobalConfiguration; |
||||||
|
import com.alibaba.excel.metadata.property.ExcelContentProperty; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author chen |
||||||
|
* @DATE 2020/12/30 15:26 |
||||||
|
* @Version 1.0 |
||||||
|
* 任务节点转换器 |
||||||
|
*/ |
||||||
|
public class TaskNodeConverter implements Converter<Integer> { |
||||||
|
|
||||||
|
@Override |
||||||
|
public Class supportJavaTypeKey() { |
||||||
|
return Integer.class; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public CellDataTypeEnum supportExcelTypeKey() { |
||||||
|
return CellDataTypeEnum.STRING; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 这里读的时候会调用 |
||||||
|
* |
||||||
|
* @param cellData |
||||||
|
* NotNull |
||||||
|
* @param contentProperty |
||||||
|
* Nullable |
||||||
|
* @param globalConfiguration |
||||||
|
* NotNull |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, |
||||||
|
GlobalConfiguration globalConfiguration) { |
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 这里是写的时候会调用 |
||||||
|
* |
||||||
|
* @param value |
||||||
|
* NotNull |
||||||
|
* @param contentProperty |
||||||
|
* Nullable |
||||||
|
* @param globalConfiguration |
||||||
|
* NotNull |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, |
||||||
|
GlobalConfiguration globalConfiguration) { |
||||||
|
|
||||||
|
switch (value){ |
||||||
|
case 1: |
||||||
|
return new CellData("业务申请"); |
||||||
|
case 2: |
||||||
|
return new CellData("担保部调查"); |
||||||
|
case 3: |
||||||
|
return new CellData("资产部调查"); |
||||||
|
case 4: |
||||||
|
return new CellData("信息部调查"); |
||||||
|
case 5: |
||||||
|
return new CellData("合规调查"); |
||||||
|
case 6: |
||||||
|
return new CellData("工作会"); |
||||||
|
case 7: |
||||||
|
return new CellData("贷审会"); |
||||||
|
case 8: |
||||||
|
return new CellData("担保函"); |
||||||
|
case 9: |
||||||
|
return new CellData("回款确认"); |
||||||
|
case 10: |
||||||
|
return new CellData("放款通知"); |
||||||
|
default: |
||||||
|
return new CellData(String.valueOf(value)); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
Loading…
Reference in new issue