Explorar o código

fix:修复前端修改穿参格式导致的导入导出接口失败

韩帛霖 hai 1 ano
pai
achega
324cf5a75b

+ 12 - 2
zkqy-admin/src/main/java/com/zkqy/web/controller/dragForm/CommonFileController.java

@@ -13,9 +13,11 @@ import com.zkqy.common.utils.file.FileUploadUtils;
 import com.zkqy.common.utils.file.FileUtils;
 import com.zkqy.framework.config.ServerConfig;
 import com.zkqy.system.entity.CommonEntity;
+import com.zkqy.system.entity.DragTable;
 import com.zkqy.system.entity.TableSql;
 import com.zkqy.system.service.ICommonService;
 import com.zkqy.system.service.IDataSourceService;
+import com.zkqy.system.service.IDragTableService;
 import com.zkqy.system.service.ITableSqlService;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
@@ -58,6 +60,9 @@ public class CommonFileController {
     @Resource
     private ITableSqlService iTableSqlService;
 
+    @Autowired
+    private IDragTableService iDragTableService;
+
     private static final String FILE_DELIMETER = ",";
 
     /**
@@ -200,14 +205,19 @@ public class CommonFileController {
                 return AjaxResult.warn("请检查表格中的数据!");
             }
             // 得到当前导出入数据的格式k/v
-            TableSql tableSql = iTableSqlService.selectTableSqlByTSqlKey(sqlKey);
+            DragTable dragTable = iDragTableService.selectSqlKeyByTableKey(sqlKey);
+            if (dragTable.getSqlKey().isEmpty()) {
+                return AjaxResult.error("网络出现问题,请等待网络恢复!");
+            }
+            TableSql tableSql = iTableSqlService.selectTableSqlByTSqlKey(dragTable.getSqlKey());
             // 存储 字段描述:字段列名
             Map<String, Object> fieldMap = (Map<String, Object>) JSON.parse(tableSql.getTableExportField());
             Map<String, Object> endFieldMap = new HashMap<>();
             // 处理导入title对应问题,双重校验
             fieldMap.forEach((mKey, mVal) -> {
                 if (!mKey.contains("@")) {
-                    endFieldMap.put(mVal.toString(), mKey);
+                    // 表示列名 删除掉表名称
+                    endFieldMap.put(mVal.toString(), mKey.replace(tableName + "_", ""));
                 } else {
                     // 定义新的title map集合
                     Map<String, String> map = listMap.get(0);

+ 0 - 14
zkqy-system/src/main/java/com/zkqy/system/service/ICommonService.java

@@ -71,17 +71,3 @@ public interface ICommonService {
     CommonEntity queryDropDownBoxData(List<CommonEntity> commonEntityList);
 
 }
-/*
-
-优化共同实体、流程结束接口、查询当前用户执行节点接口优化、流程执行节点的开发、执行节点接口、执行节点必要参数
-流程节点运行相关接口,bug修复等
-优化查询sql,修复流程节点无法执行
-下发工具类支持实体类型的参数传递
-定义节点执行表单模版接口
-按钮类型修复
-token反序列化数据丢失问题
-共通实体null异常
-
-
-
-* */