Эх сурвалжийг харах

fix:新增、修改时间,操作人。逻辑删除等

韩帛霖 1 жил өмнө
parent
commit
84e5c68bf8

+ 9 - 9
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommonServiceImpl.java

@@ -43,13 +43,13 @@ public class CommonServiceImpl implements ICommonService {
 
     @Override
     public int batchInsert(CommonEntity commonEntity) {
-
-
         String tableName = (String) commonEntity.getBasicMap().get("tableName");
         List<Map<String, String>> list = commonEntity.getAddListMap();
+        list.get(0).put("create_time", DateUtils.getTime());
+        list.get(0).put("create_by", SecurityUtils.getUsername());
+        list.get(0).put("del_flag", "0");
         List<Map<String, Object>> mapList = new ArrayList<>();
         for (Object obj : list) {
-            System.out.println(obj);
             Map<String, Object> map1 = (Map<String, Object>) obj;
             mapList.add(map1);
         }
@@ -59,12 +59,12 @@ public class CommonServiceImpl implements ICommonService {
                 fieldNames.add(toUnderScoreCase(key));
             });
         });
-        fieldNames.add("create_by");
-        fieldNames.add("create_time");
-        Map<String, Object> objectMap = new HashMap<>();
-        objectMap.put("create_by", SecurityUtils.getUsername());
-        objectMap.put("create_time", DateUtils.getTime());
-        mapList.add(objectMap);
+//        fieldNames.add("create_by");
+//        fieldNames.add("create_time");
+//        Map<String, Object> objectMap = new HashMap<>();
+//        objectMap.put("create_by", SecurityUtils.getUsername());
+//        objectMap.put("create_time", DateUtils.getTime());
+//        mapList.add(objectMap);
         return commonMapper.batchInsert(fieldNames, tableName, mapList);
 
 //        String tableName = (String) commonEntity.getBasicMap().get("tableName");

+ 3 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableServiceImpl.java

@@ -203,7 +203,7 @@ public class DragTableServiceImpl implements IDragTableService {
                 }
                 break;
         }
-        String where = dragTableVo.getDtTableName() + ".del_flag = '2'";
+        String where = dragTableVo.getDtTableName() + ".del_flag = '2' AND ";
         tableSql.setTableCondition(where + SQL + SQL_END);
         tableSql.setTableAlias(dragTableVo.getDtTableName());
         tableSql.setTableExportField(JSON.toJSONString(dragTableVo.getTableExportField()));
@@ -267,7 +267,8 @@ public class DragTableServiceImpl implements IDragTableService {
                 }
                 break;
         }
-        tableSql.setTableCondition(SQL + SQL_END);
+        String where = dragTableVo.getDtTableName() + ".del_flag = '0' AND ";
+        tableSql.setTableCondition(where = SQL + SQL_END);
         tableSql.setTableAlias(dragTableVo.getDtTableName());
         tableSql.setSqlKey(dragTableVo.getSqlKey());
         tableSql.setTableExportField(JSON.toJSONString(dragTableVo.getTableExportField()));

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/test/ljj.java

@@ -21,6 +21,7 @@ public class ljj {
     static final String SQLSERVER_MIDDLE = "COALESCE( #{VAL}, '' )";
     static final String SQL_END = "LIKE '%#{val}%'";
 
+    //    private static final Joiner joiner = JOineron(".");
 
     public static void main(String[] args) {