package com.flossom.common.core.utils.poi;

import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Workbook;

/**
 * {@link com.flossom.common.core.domain.req.WxInstrumentSerialImportVm#validStatus}
 */
public class InstrumentSerialValidStatusAdapter implements ExcelHandlerAdapter {


    @Override
    public Object format(Object value, String[] args, Cell cell, Workbook wb) {
        String v = (String) value;
        if (StringUtils.equals(v, "有效")) {
            return 1;
        }
        if (StringUtils.equals(v, "无效")) {
            return 0;
        }
        return null;
    }

}
