|
@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
import com.boman.domain.GenTableColumn;
|
|
|
import com.boman.gen.api.RemoteGenTableColumnService;
|
|
|
+import com.boman.report.service.MysqlTableService;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.jeecg.modules.jmreport.common.expetion.JimuReportException;
|
|
@@ -91,6 +92,8 @@ public class JmReportDbService implements IJmReportDbService {
|
|
|
private String apiBasePath;
|
|
|
@Autowired
|
|
|
private RemoteGenTableColumnService remoteGenTableColumnService;
|
|
|
+ @Autowired
|
|
|
+ private MysqlTableService mysqlTableService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -682,20 +685,19 @@ public class JmReportDbService implements IJmReportDbService {
|
|
|
if (CollectionUtils.isEmpty(columns)) {
|
|
|
return var5;
|
|
|
}
|
|
|
-
|
|
|
+ List<JSONObject> jiaoyuju = mysqlTableService.getColumnNames(tableName, "jiaoyuju");
|
|
|
List<LinkedHashMap<String, Object>> var19 = new ArrayList<>();
|
|
|
- Map<String, Object> limitOne = var6.get(0);
|
|
|
|
|
|
int cnt = 1;
|
|
|
- for (Entry<String, Object> entry : limitOne.entrySet()) {
|
|
|
- String limitOneColumnName = entry.getKey().toLowerCase();
|
|
|
+ for (JSONObject jsonObject : jiaoyuju) {
|
|
|
+ String columnName = jsonObject.getString("column_name");
|
|
|
for (GenTableColumn column : columns) {
|
|
|
- if (!column.getColumnName().equals(limitOneColumnName)) {
|
|
|
+ if (!column.getColumnName().equals(columnName)) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
LinkedHashMap<String, Object> temp = new LinkedHashMap<>();
|
|
|
- temp.put("fieldName", limitOneColumnName);
|
|
|
+ temp.put("fieldName", columnName);
|
|
|
temp.put("fieldText", column.getColumnComment());
|
|
|
temp.put("widgetType", "String");
|
|
|
temp.put("orderNum", cnt++);
|