fix: 修复创建定时任务保存workspaceId和projectId的问题
This commit is contained in:
parent
cd6e53f96d
commit
e26a60cc0c
|
@ -54,7 +54,6 @@ public class ScheduleService {
|
|||
|
||||
public void addSchedule(Schedule schedule) {
|
||||
schedule.setId(UUID.randomUUID().toString());
|
||||
schedule.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||
schedule.setCreateTime(System.currentTimeMillis());
|
||||
schedule.setUpdateTime(System.currentTimeMillis());
|
||||
scheduleMapper.insert(schedule);
|
||||
|
@ -149,6 +148,8 @@ public class ScheduleService {
|
|||
schedule.setValue(request.getValue().trim());
|
||||
schedule.setKey(request.getResourceId());
|
||||
schedule.setUserId(SessionUtils.getUser().getId());
|
||||
schedule.setProjectId(request.getProjectId());
|
||||
schedule.setWorkspaceId(request.getWorkspaceId());
|
||||
return schedule;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,13 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {getCurrentOrganizationId, getCurrentUser, listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||
import {
|
||||
getCurrentOrganizationId,
|
||||
getCurrentProjectID,
|
||||
getCurrentUser, getCurrentWorkspaceId,
|
||||
listenGoBack,
|
||||
removeGoBackListener
|
||||
} from "@/common/js/utils";
|
||||
import Crontab from "@/business/components/common/cron/Crontab";
|
||||
import CrontabResult from "@/business/components/common/cron/CrontabResult";
|
||||
import {cronValidate} from "@/common/js/cron";
|
||||
|
@ -243,6 +249,13 @@ export default {
|
|||
let param = {};
|
||||
param = this.schedule;
|
||||
param.resourceId = this.testId;
|
||||
// 兼容问题,数据库里有的projectId为空
|
||||
if (!param.projectId) {
|
||||
param.projectId = getCurrentProjectID();
|
||||
}
|
||||
if (!param.workspaceId) {
|
||||
param.workspaceId = getCurrentWorkspaceId();
|
||||
}
|
||||
let url = '/api/automation/schedule/create';
|
||||
if (this.scheduleTaskType === "TEST_PLAN_TEST") {
|
||||
param.scheduleFrom = "testPlan";
|
||||
|
|
|
@ -73,7 +73,7 @@ import PerformancePressureConfig from "./components/PerformancePressureConfig";
|
|||
import PerformanceAdvancedConfig from "./components/PerformanceAdvancedConfig";
|
||||
import MsContainer from "../../common/components/MsContainer";
|
||||
import MsMainContainer from "../../common/components/MsMainContainer";
|
||||
import {getCurrentProjectID, hasPermission} from "@/common/js/utils";
|
||||
import {getCurrentProjectID, getCurrentWorkspaceId, hasPermission} from "@/common/js/utils";
|
||||
import MsScheduleConfig from "../../common/components/MsScheduleConfig";
|
||||
import MsChangeHistory from "../../history/ChangeHistory";
|
||||
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton";
|
||||
|
@ -343,6 +343,9 @@ export default {
|
|||
if (!param.projectId) {
|
||||
param.projectId = getCurrentProjectID();
|
||||
}
|
||||
if (!param.workspaceId) {
|
||||
param.workspaceId = getCurrentWorkspaceId();
|
||||
}
|
||||
let url = '/performance/schedule/create';
|
||||
if (param.id) {
|
||||
url = '/performance/schedule/update';
|
||||
|
|
|
@ -95,7 +95,13 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {getCurrentOrganizationId, getCurrentUser, listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||
import {
|
||||
getCurrentOrganizationId,
|
||||
getCurrentProjectID,
|
||||
getCurrentUser, getCurrentWorkspaceId,
|
||||
listenGoBack,
|
||||
removeGoBackListener
|
||||
} from "@/common/js/utils";
|
||||
import Crontab from "@/business/components/common/cron/Crontab";
|
||||
import CrontabResult from "@/business/components/common/cron/CrontabResult";
|
||||
import {cronValidate} from "@/common/js/cron";
|
||||
|
@ -301,6 +307,13 @@ export default {
|
|||
let param = {};
|
||||
param = this.schedule;
|
||||
param.resourceId = this.testId;
|
||||
// 兼容问题,数据库里有的projectId为空
|
||||
if (!param.projectId) {
|
||||
param.projectId = getCurrentProjectID();
|
||||
}
|
||||
if (!param.workspaceId) {
|
||||
param.workspaceId = getCurrentWorkspaceId();
|
||||
}
|
||||
param.config = JSON.stringify(this.runConfig);
|
||||
let url = '/api/automation/schedule/create';
|
||||
if (this.scheduleTaskType === "TEST_PLAN_TEST") {
|
||||
|
|
Loading…
Reference in New Issue