/**
 * @ClassName JsonTest
 * @Description TODO
 * @Author wangruwei
 * @Date 2024/10/28 11:01
 * @Version 1.0
 */
public class JsonTest {
    public static void main(String[] args) {
        String a = "\"rzzt\":\"认证状态\",\n" +
                "\t\t\t\t\"rzssq\":\"认证所属期\",\n" +
                "\t\t\t\t\"dkTaxAmount\":\"认证金额\",\n" +
                "\t\t\t\t\"bdkyy\":\"不抵扣原因\",\n" +
                "\t\t\t\t\"bdkMessage\":\"不抵扣类型\",\n" +
                "\t\t\t\t\"hzsdbs\":\"红字锁定标识\",\n" +
                "\t\t\t\t\"inAccountStatus\":\"入账状态\",\n" +
                "\t\t\t\t\"inAccountType\":\"入账类型\",\n" +
                "\t\t\t\t\"inAccountSsq\":\"入账所属期\"";
        String[] split = a.split(",");
        for (int i = 0; i < split.length; i++) {
            String replace = split[i].replace("\"", "").replace("\n","");
            String[] split1 = replace.split(":");
            System.out.println("/**\n" +
                    "     * "+split1[1]+"\n" +
                    "     */\n" +
                    "    private String "+split1[0]+";");
        }

        System.out.println(isValidFileName("importRzInvoice.xlsx"));
    }

    public static boolean isValidFileName(String fileName) {
        // 文件名合法性校验：只允许字母、数字、下划线、短横线和扩展名
        String regex = "^[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9]+)?$";
        return fileName != null && fileName.matches(regex);
    }

}
