基础信息添加模板下载

This commit is contained in:
王帅 2025-06-06 08:39:17 +08:00
parent 41bb747379
commit 10c5b5f22a
7 changed files with 78 additions and 0 deletions

View File

@ -70,11 +70,36 @@ public class JeecgController<T, S extends IService<T>> {
//update-begin--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置--------------------
ExportParams exportParams=new ExportParams(null, null, title);
exportParams.setImageBasePath(upLoadPath);
exportParams.setFixedTitle(false);
//update-end--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置----------------------
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
return mv;
}
/**
* 导出传递集合
* @param pageList
* @param clazz
* @param title
* @return
*/
protected ModelAndView exportXls(List<T> pageList, Class<T> clazz, String title) {
// AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(NormalExcelConstants.CLASS, clazz);
//update-begin--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置--------------------
// ExportParams exportParams = new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
ExportParams exportParams = new ExportParams(null, null, title);
exportParams.setImageBasePath(upLoadPath);
exportParams.setType(ExcelType.XSSF);
exportParams.setFixedTitle(false);
//update-end--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置----------------------
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 根据每页sheet数量导出多sheet
*

View File

@ -78,6 +78,7 @@ public class ShiroConfig {
// 配置不会被拦截的链接 顺序判断
filterChainDefinitionMap.put("/sys/dict/getDictItems/ship_type", "anon"); //发货类型字典
filterChainDefinitionMap.put("/vehicledemandcount/vehicleDemandCount/getVdCountById", "anon"); //获取用车计算数据
filterChainDefinitionMap.put("/deliveryplan/deliveryPlan/getVdCountById", "anon"); //获取送货信息
filterChainDefinitionMap.put("/vehicleinout/vehicleInOut/take", "anon"); //提货
filterChainDefinitionMap.put("/logisticsdriver/logisticsDriver/getDriverInfo", "anon"); //查询司机信息
filterChainDefinitionMap.put("/vehicleinout/vehicleInOut/getCarNum", "anon"); // 车辆出入厂明细

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.tms.basicdata.iogisticsprice.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -160,6 +161,15 @@ public class TmsIogisticsPriceController extends JeecgController<TmsIogisticsPri
public ModelAndView exportXls(HttpServletRequest request, TmsIogisticsPrice tmsIogisticsPrice) {
return super.exportXls(request, tmsIogisticsPrice, TmsIogisticsPrice.class, "物流价格基础信息管理");
}
/**
* 下载模板
* @return
*/
@RequestMapping(value = "/exportTemplate")
public ModelAndView exportTemplate() {
List<TmsIogisticsPrice> tmsIogisticsPrices= new ArrayList<>();
return super.exportXls(tmsIogisticsPrices, TmsIogisticsPrice.class, "物流价格基础信息管理");
}
/**
* 通过excel导入数据

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.tms.basicdata.logisticsroute.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -165,6 +166,16 @@ public class LogisticsRouteController extends JeecgController<LogisticsRoute, IL
return super.exportXls(request, logisticsRoute, LogisticsRoute.class, "物流路线信息维护");
}
/**
* 下载模板
* @return
*/
@RequestMapping(value = "/exportTemplate")
public ModelAndView exportTemplate() {
List<LogisticsRoute> logisticsRoutes = new ArrayList<>();
return super.exportXls(logisticsRoutes, LogisticsRoute.class, "物流路线信息维护");
}
/**
* 通过excel导入数据
*

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.tms.basicdata.vehicleoperator.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -162,6 +163,16 @@ public class TmsVehicleOperatorController extends JeecgController<TmsVehicleOper
return super.exportXls(request, tmsVehicleOperator, TmsVehicleOperator.class, "车辆运营商管理");
}
/**
* 下载模板
* @return
*/
@RequestMapping(value = "/exportTemplate")
public ModelAndView exportTemplate() {
List<TmsVehicleOperator> tmsVehicleOperators = new ArrayList<>();
return super.exportXls(tmsVehicleOperators, TmsVehicleOperator.class, "车辆运营商管理");
}
/**
* 通过excel导入数据
*

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.tms.basicdata.vehiclepallet.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -162,6 +163,15 @@ public class VehiclePalletController extends JeecgController<VehiclePallet, IVeh
return super.exportXls(request, vehiclePallet, VehiclePallet.class, "tms_vehicle_pallet");
}
/**
* 下载模板
* @return
*/
@RequestMapping(value = "/exportTemplate")
public ModelAndView exportTemplate() {
List<VehiclePallet> vehiclePallets = new ArrayList<>();
return super.exportXls(vehiclePallets, VehiclePallet.class, "tms_vehicle_pallet");
}
/**
* 通过excel导入数据
*

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.tms.basicdata.vehicleproduct.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -162,6 +163,15 @@ public class TmsVehicleProductController extends JeecgController<TmsVehicleProdu
return super.exportXls(request, tmsVehicleProduct, TmsVehicleProduct.class, "product");
}
/**
* 下载模板
* @return
*/
@RequestMapping(value = "/exportTemplate")
public ModelAndView exportTemplate() {
List<TmsVehicleProduct> tmsVehicleProducts = new ArrayList<>();
return super.exportXls(tmsVehicleProducts, TmsVehicleProduct.class, "product");
}
/**
* 通过excel导入数据
*