|
@@ -10,6 +10,7 @@ import com.boman.common.redis.service.RedisService;
|
|
import com.boman.domain.GenTable;
|
|
import com.boman.domain.GenTable;
|
|
import com.boman.domain.GenTableColumn;
|
|
import com.boman.domain.GenTableColumn;
|
|
import com.boman.domain.constant.MaskConstant;
|
|
import com.boman.domain.constant.MaskConstant;
|
|
|
|
+import com.boman.domain.dto.ExportExcelDto;
|
|
import com.boman.domain.dto.FormDataDto;
|
|
import com.boman.domain.dto.FormDataDto;
|
|
import com.boman.domain.dto.ImportExcelDto;
|
|
import com.boman.domain.dto.ImportExcelDto;
|
|
import com.boman.file.utils.FileUploadUtils;
|
|
import com.boman.file.utils.FileUploadUtils;
|
|
@@ -118,15 +119,16 @@ public class LocalSysFileServiceImpl implements ISysFileService
|
|
/**
|
|
/**
|
|
* 功能描述: 通用的导出接口
|
|
* 功能描述: 通用的导出接口
|
|
*
|
|
*
|
|
- * @param response response
|
|
|
|
- * @param tableName tableName
|
|
|
|
- * @param empty true=>只带表头的excel,不含数据, false=>带数据的excel
|
|
|
|
- * @param condition condition
|
|
|
|
|
|
+ * @param response response
|
|
|
|
+ * @param dto tableName
|
|
|
|
+ * empty(true=>只带表头的excel,不含数据, false=>带数据的excel)
|
|
|
|
+ * condition 查询条件
|
|
* @return com.boman.common.core.web.domain.AjaxResult
|
|
* @return com.boman.common.core.web.domain.AjaxResult
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public AjaxResult exportExcelCommon(HttpServletResponse response, String tableName
|
|
|
|
- , Boolean empty/*, JSONObject condition*/) {
|
|
|
|
|
|
+ public AjaxResult exportExcelCommon(HttpServletResponse response, ExportExcelDto dto) {
|
|
|
|
+ String tableName = dto.getTableName();
|
|
|
|
+ Boolean empty = dto.getEmpty();
|
|
ObjectUtils.requireNonNull(tableName, "exportExcelCommon tableName is empty");
|
|
ObjectUtils.requireNonNull(tableName, "exportExcelCommon tableName is empty");
|
|
ObjectUtils.requireNonNull(empty, "exportExcelCommon empty is empty");
|
|
ObjectUtils.requireNonNull(empty, "exportExcelCommon empty is empty");
|
|
|
|
|
|
@@ -138,10 +140,10 @@ public class LocalSysFileServiceImpl implements ISysFileService
|
|
if (BooleanUtils.isTrue(empty)) {
|
|
if (BooleanUtils.isTrue(empty)) {
|
|
list = new ArrayList<>(0);
|
|
list = new ArrayList<>(0);
|
|
} else {
|
|
} else {
|
|
- FormDataDto dto = new FormDataDto();
|
|
|
|
- dto.setTable(tableName);
|
|
|
|
-// dto.setFixedData(condition);
|
|
|
|
- AjaxResult ajaxResult = remoteObjService.getByMap(dto);
|
|
|
|
|
|
+ FormDataDto condition = new FormDataDto();
|
|
|
|
+ condition.setTable(tableName);
|
|
|
|
+ condition.setFixedData(new JSONObject(dto.getCondition()));
|
|
|
|
+ AjaxResult ajaxResult = remoteObjService.getByMap(condition);
|
|
if (AjaxResult.checkSuccess(ajaxResult)) {
|
|
if (AjaxResult.checkSuccess(ajaxResult)) {
|
|
list = ((List<Map<String, Object>>) ajaxResult.get(AjaxResult.DATA_TAG));
|
|
list = ((List<Map<String, Object>>) ajaxResult.get(AjaxResult.DATA_TAG));
|
|
columns = ExcelUtil.filterData(columns, 4, MaskConstant.LIST_VISIBLE::equals);
|
|
columns = ExcelUtil.filterData(columns, 4, MaskConstant.LIST_VISIBLE::equals);
|