diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 73fa6bba51..8f7f5d2b4d 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -1947,6 +1947,9 @@ public class ApiDefinitionService { api.setModulePath(request.getModulePath()); api.setOrder(nextOrder += ServiceUtils.ORDER_STEP); api.setNum(nextNum++); + api.setCreateTime(System.currentTimeMillis()); + api.setUpdateTime(System.currentTimeMillis()); + api.setRefId(api.getId()); mapper.insert(api); if (i % 50 == 0) sqlSession.flushStatements(); diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 1d50d895ae..4e5ca6d6eb 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -2386,6 +2386,8 @@ public class TestCaseService { testCase.setCustomNum(String.valueOf(nextNum)); testCase.setNum(nextNum++); testCase.setCasePublic(false); + testCase.setCreateTime(System.currentTimeMillis()); + testCase.setUpdateTime(System.currentTimeMillis()); testCase.setRefId(id); mapper.insert(testCase);