|
@@ -93,8 +93,8 @@ public class DragTableServiceImpl implements IDragTableService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public int insertDragTable(DragTable dragTable) {
|
|
public int insertDragTable(DragTable dragTable) {
|
|
- dragTable.setCreateTime(DateUtils.getNowDate());
|
|
|
|
- dragTable.setCreateById(SecurityUtils.getUserId());
|
|
|
|
|
|
+ //dragTable.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ //dragTable.setCreateById(SecurityUtils.getUserId());
|
|
return dragTableMapper.insertDragTable(dragTable);
|
|
return dragTableMapper.insertDragTable(dragTable);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -217,14 +217,10 @@ public class DragTableServiceImpl implements IDragTableService {
|
|
dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
|
|
dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
|
|
dragTable.setPrimaryKey(dragTableVo.getPrimaryKey());
|
|
dragTable.setPrimaryKey(dragTableVo.getPrimaryKey());
|
|
dragTable.setMenuId(dragTableVo.getMenuId());
|
|
dragTable.setMenuId(dragTableVo.getMenuId());
|
|
- dragTable.setCreateTime(DateUtils.getNowDate());
|
|
|
|
- dragTable.setCreateById(SecurityUtils.getUserId());
|
|
|
|
- dragTable.setDtType("1");//表格类型
|
|
|
|
|
|
+ dragTable.setDtType("0");//表格类型
|
|
//add table_sql
|
|
//add table_sql
|
|
TableSql tableSql = new TableSql();
|
|
TableSql tableSql = new TableSql();
|
|
tableSql.setTableSql(dragTableVo.getTableSql());
|
|
tableSql.setTableSql(dragTableVo.getTableSql());
|
|
- tableSql.setCreateTime(DateUtils.getNowDate());
|
|
|
|
- tableSql.setCreateById(SecurityUtils.getUserId());
|
|
|
|
dragTableMapper.insertDragTable(dragTable);
|
|
dragTableMapper.insertDragTable(dragTable);
|
|
// 拼接sql查询条件
|
|
// 拼接sql查询条件
|
|
switch (SecurityUtils.getDatabaseType().toUpperCase()) {
|
|
switch (SecurityUtils.getDatabaseType().toUpperCase()) {
|
|
@@ -263,7 +259,6 @@ public class DragTableServiceImpl implements IDragTableService {
|
|
if (dragTableVo.getSearchFieldList().size() > 0) {
|
|
if (dragTableVo.getSearchFieldList().size() > 0) {
|
|
List<DragTableCondition> dragTableConditionList = new ArrayList<>();
|
|
List<DragTableCondition> dragTableConditionList = new ArrayList<>();
|
|
dragTableVo.getSearchFieldList().forEach(item -> {
|
|
dragTableVo.getSearchFieldList().forEach(item -> {
|
|
- //dragTableConditionList.add(new DragTableCondition(dragTable.gettId(), item,dragTableVo.getConditionDefaultValueMap().get(item).toString()));
|
|
|
|
dragTableConditionList.add(new DragTableCondition(dragTable.gettId(),item));
|
|
dragTableConditionList.add(new DragTableCondition(dragTable.gettId(),item));
|
|
});
|
|
});
|
|
dragTableConditionList.forEach(e->{
|
|
dragTableConditionList.forEach(e->{
|
|
@@ -276,7 +271,6 @@ public class DragTableServiceImpl implements IDragTableService {
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
public void addDragTable(DragTableGroupVo dragTableGroupVo) {
|
|
public void addDragTable(DragTableGroupVo dragTableGroupVo) {
|
|
-
|
|
|
|
for (DragTableVo dragTableVo : dragTableGroupVo.getDragTables()) {
|
|
for (DragTableVo dragTableVo : dragTableGroupVo.getDragTables()) {
|
|
String SQL="";
|
|
String SQL="";
|
|
//add drag_table
|
|
//add drag_table
|
|
@@ -285,19 +279,16 @@ public class DragTableServiceImpl implements IDragTableService {
|
|
dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
|
|
dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
|
|
dragTable.setPrimaryKey(dragTableVo.getPrimaryKey());
|
|
dragTable.setPrimaryKey(dragTableVo.getPrimaryKey());
|
|
dragTable.setMenuId(dragTableVo.getMenuId());
|
|
dragTable.setMenuId(dragTableVo.getMenuId());
|
|
- dragTable.setCreateTime(DateUtils.getNowDate());
|
|
|
|
- dragTable.setCreateById(SecurityUtils.getUserId());
|
|
|
|
|
|
+ dragTable.setDtType("1");
|
|
//add table_sql
|
|
//add table_sql
|
|
TableSql tableSql = new TableSql();
|
|
TableSql tableSql = new TableSql();
|
|
tableSql.setTableSql(dragTableVo.getTableSql());
|
|
tableSql.setTableSql(dragTableVo.getTableSql());
|
|
- tableSql.setCreateTime(DateUtils.getNowDate());
|
|
|
|
- tableSql.setCreateById(SecurityUtils.getUserId());
|
|
|
|
dragTableMapper.insertDragTable(dragTable);
|
|
dragTableMapper.insertDragTable(dragTable);
|
|
//拼接sql查询条件
|
|
//拼接sql查询条件
|
|
switch (SecurityUtils.getDatabaseType().toUpperCase()) {
|
|
switch (SecurityUtils.getDatabaseType().toUpperCase()) {
|
|
case "MYSQL":
|
|
case "MYSQL":
|
|
for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
|
|
for (int i = 0; dragTableVo.getSearchFieldList().size() > i; i++) {
|
|
- SQL += " AND "+dragTableVo.getSearchFieldList().get(i)+"="+dragTableVo.getConditionDefaultValueMap().get(dragTableVo.getSearchFieldList().get(i));
|
|
|
|
|
|
+ SQL += " AND "+dragTableVo.getSearchFieldList().get(i)+"="+dragTableVo.getConditionDefaultValueMap().get(dragTableVo.getSearchFieldList().get(i));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "DM":
|
|
case "DM":
|
|
@@ -330,10 +321,6 @@ public class DragTableServiceImpl implements IDragTableService {
|
|
dragTableVo.getSearchFieldList().forEach(item -> {
|
|
dragTableVo.getSearchFieldList().forEach(item -> {
|
|
dragTableConditionList.add(new DragTableCondition(dragTable.gettId(), item,dragTableVo.getConditionDefaultValueMap().get(item).toString()));
|
|
dragTableConditionList.add(new DragTableCondition(dragTable.gettId(), item,dragTableVo.getConditionDefaultValueMap().get(item).toString()));
|
|
});
|
|
});
|
|
- //赋值创建人
|
|
|
|
- dragTableConditionList.forEach(e->{
|
|
|
|
- e.setCreateById(SecurityUtils.getUserId());
|
|
|
|
- });
|
|
|
|
dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
|
|
dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -367,14 +354,10 @@ public class DragTableServiceImpl implements IDragTableService {
|
|
DragTable dragTable = new DragTable();
|
|
DragTable dragTable = new DragTable();
|
|
BeanUtils.copyProperties(dragTableVo, dragTable);
|
|
BeanUtils.copyProperties(dragTableVo, dragTable);
|
|
dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
|
|
dragTable.setDtColumnName(JSON.toJSONString(dragTableVo.getDtColumnName()));
|
|
- dragTable.setUpdateById(SecurityUtils.getUserId());
|
|
|
|
dragTableMapper.updateDragTable(dragTable);
|
|
dragTableMapper.updateDragTable(dragTable);
|
|
-
|
|
|
|
//update table_sql
|
|
//update table_sql
|
|
TableSql tableSql = new TableSql();
|
|
TableSql tableSql = new TableSql();
|
|
tableSql.setTableSql(dragTableVo.getTableSql());
|
|
tableSql.setTableSql(dragTableVo.getTableSql());
|
|
- //tableSql.setUpdateBy(dragTableVo.getTableSql());
|
|
|
|
- tableSql.setUpdateById(SecurityUtils.getUserId());
|
|
|
|
// 拼接sql查询条件
|
|
// 拼接sql查询条件
|
|
switch (SecurityUtils.getDatabaseType().toUpperCase()) {
|
|
switch (SecurityUtils.getDatabaseType().toUpperCase()) {
|
|
case "MYSQL":
|
|
case "MYSQL":
|
|
@@ -417,9 +400,6 @@ public class DragTableServiceImpl implements IDragTableService {
|
|
dragTableVo.getSearchFieldList().forEach(item -> {
|
|
dragTableVo.getSearchFieldList().forEach(item -> {
|
|
dragTableConditionList.add(new DragTableCondition(dragTable.gettId(),item));
|
|
dragTableConditionList.add(new DragTableCondition(dragTable.gettId(),item));
|
|
});
|
|
});
|
|
- dragTableConditionList.forEach(e->{
|
|
|
|
- e.setUpdateById(SecurityUtils.getUserId());
|
|
|
|
- });
|
|
|
|
dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
|
|
dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
|
|
}
|
|
}
|
|
}
|
|
}
|