导出设置

    @RequestMapping("/open")
    public String open(ElecExportFields elecExportFields,HttpServletRequest request){
        //查出设置导出表的内容
        String belongTo = elecExportFields.getBelongTo();
        ElecExportFields fields=eef.findById(belongTo);
        //将查出的中英文字段放入map集合
        Map<String,String> expMap=new HashMap<String,String>();
        Map<String,String> noexpMap=new HashMap<String,String>();
        //导出的中英文文字段
        String expNameList = fields.getExpNameList();
        String expFieldName = fields.getExpFieldName();
        //将中文字段放入集合
        List<String> expListArrayList=new ArrayList<>();
        if(expNameList!=null&&expNameList.length()>0){
            String[] split = expNameList.split("#");
            for (String ss : split) {
                expListArrayList.add(ss);
            }
            
        }
        //将英文字段放入集合
        List<String> expListArrayName=new ArrayList<>();
        if(expFieldName!=null&&expFieldName.length()>0){
            String[] split2 = expFieldName.split("#");
            for (String ss : split2) {
                expListArrayName.add(ss);
            }
        }
        //将导出的中英文字段放入map集合
        for (int i = 0; i < expListArrayName.size(); i++) {
            expMap.put(expListArrayName.get(i), expListArrayList.get(i));
        }
        //=============================未导出的字段=========================================
        //导出的中英文文字段
                String noexpNameList = fields.getNoExpNameList();
                String noexpFieldName = fields.getNoExpFieldName();
                //将中文字段放入集合
                List<String> noexpListArrayList=new ArrayList<>();
                if(noexpNameList!=null&&noexpNameList.length()>0){
                    String[] split = noexpNameList.split("#");
                    for (String ss : split) {
                        noexpListArrayList.add(ss);
                    }
                    
                }
                //将英文字段放入集合
                List<String> noexpListArrayName=new ArrayList<>();
                if(noexpFieldName!=null&&noexpFieldName.length()>0){
                    String[] split2 = noexpFieldName.split("#");
                    for (String ss : split2) {
                        noexpListArrayName.add(ss);
                    }
                }
                //将导出的中英文字段放入map集合
                for (int i = 0; i < noexpListArrayName.size(); i++) {
                    noexpMap.put(noexpListArrayName.get(i), noexpListArrayList.get(i));
                }
                //===============将导出字段和未导出字段map放入request中===========================
                request.setAttribute("noexpMap", noexpMap);
                request.setAttribute("expMap", expMap);
                request.setAttribute("fidlds", elecExportFields);
        return "system/exportExcel";
    }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值