fix(接口测试): 用例导入报错

--user=郭雨琦
--bug=1014790
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014790
This commit is contained in:
guoyuqi 2022-07-13 12:10:41 +08:00 committed by xiaomeinvG
parent 3eea5fbd4c
commit e25545f8ed
1 changed files with 6 additions and 6 deletions

View File

@ -852,18 +852,18 @@ public class ApiDefinitionService {
apiTestCaseWithBLOBs.setCreateTime(System.currentTimeMillis());
}
apiTestCaseWithBLOBs.setUpdateTime(System.currentTimeMillis());
if (StringUtils.isNotBlank(apiTestCaseWithBLOBs.getId())) {
apiTestCaseMapper.updateByPrimaryKeyWithBLOBs(apiTestCaseWithBLOBs);
} else {
apiTestCaseWithBLOBs.setId(UUID.randomUUID().toString());
apiTestCaseMapper.insert(apiTestCaseWithBLOBs);
}
if (StringUtils.isBlank(apiTestCaseWithBLOBs.getStatus())) {
apiTestCaseWithBLOBs.setStatus(APITestStatus.Underway.name());
}
if (apiTestCaseWithBLOBs.getOrder() == null) {
apiTestCaseWithBLOBs.setOrder(getImportNextCaseOrder(apiDefinition.getProjectId()));
}
if (StringUtils.isNotBlank(apiTestCaseWithBLOBs.getId())) {
apiTestCaseMapper.updateByPrimaryKeyWithBLOBs(apiTestCaseWithBLOBs);
} else {
apiTestCaseWithBLOBs.setId(UUID.randomUUID().toString());
apiTestCaseMapper.insert(apiTestCaseWithBLOBs);
}
}
}