|
@@ -5,6 +5,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import com.ruoyi.common.exception.tenantdatassource.TenantDataSource;
|
|
|
import com.ruoyi.system.entity.CommonEntity;
|
|
|
+import com.ruoyi.system.entity.DragTable;
|
|
|
import com.ruoyi.system.entity.TableSql;
|
|
|
import com.ruoyi.system.service.ICommonService;
|
|
|
import com.ruoyi.system.service.IDragTableService;
|
|
@@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/dragform/common")
|
|
@@ -21,10 +24,10 @@ public class CommonController extends BaseController {
|
|
|
@Resource
|
|
|
private ICommonService commonService;
|
|
|
|
|
|
- @Resource
|
|
|
+ @Resource // 动态sql
|
|
|
private ITableSqlService iTableSqlService;
|
|
|
|
|
|
- @Resource
|
|
|
+ @Resource // 动态表格
|
|
|
private IDragTableService dragTableService;
|
|
|
|
|
|
/**
|
|
@@ -68,15 +71,19 @@ public class CommonController extends BaseController {
|
|
|
*/
|
|
|
@GetMapping("/getTableList")
|
|
|
public TableDataInfo queryTableList(CommonEntity commonEntity) throws TenantDataSource {
|
|
|
-
|
|
|
- TableSql tableSql = iTableSqlService.selectTableSqlByTSqlKey(commonEntity.getQueryMap().get("sqlkey").toString());
|
|
|
+ DragTable dragTable = new DragTable();
|
|
|
+ dragTable.setTableKey(commonEntity.getQueryMap().get("tableKey").toString());
|
|
|
+ String sqlKey = dragTableService.selectDragTableList(dragTable).get(0).getSqlKey();
|
|
|
+ TableSql tableSql = iTableSqlService.selectTableSqlByTSqlKey(sqlKey);
|
|
|
startPage(); // 校验是否sqlserver 否执行 是执行另一种方式的分页
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("sqlkey", sqlKey);
|
|
|
+ commonEntity.setQueryMap(map);
|
|
|
return getDataTable(commonService.queryTableList(commonEntity, tableSql));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 通用动态表单详情
|
|
|
*/
|