提交 2eefe6a1 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码

上级 223b19fd
import jobinfo_en_US from '@locale/lanres/entities/jobinfo/jobinfo_en_US';
import joblog_en_US from '@locale/lanres/entities/joblog/joblog_en_US';
import joblock_en_US from '@locale/lanres/entities/joblock/joblock_en_US';
import jobregistry_en_US from '@locale/lanres/entities/jobregistry/jobregistry_en_US';
import jobsinfo_en_US from '@locale/lanres/entities/jobs-info/jobs-info_en_US';
import jobslog_en_US from '@locale/lanres/entities/jobs-log/jobs-log_en_US';
import jobslock_en_US from '@locale/lanres/entities/jobs-lock/jobs-lock_en_US';
import jobsregistry_en_US from '@locale/lanres/entities/jobs-registry/jobs-registry_en_US';
import components_en_US from '@locale/lanres/components/components_en_US';
import codelist_en_US from '@locale/lanres/codelist/codelist_en_US';
import userCustom_en_US from '@locale/lanres/userCustom/userCustom_en_US';
......@@ -60,10 +60,10 @@ export default {
},
},
entities: {
jobinfo: jobinfo_en_US,
joblog: joblog_en_US,
joblock: joblock_en_US,
jobregistry: jobregistry_en_US,
jobsinfo: jobsinfo_en_US,
jobslog: jobslog_en_US,
jobslock: jobslock_en_US,
jobsregistry: jobsregistry_en_US,
},
components: components_en_US,
codelist: codelist_en_US,
......
import jobinfo_zh_CN from '@locale/lanres/entities/jobinfo/jobinfo_zh_CN';
import joblog_zh_CN from '@locale/lanres/entities/joblog/joblog_zh_CN';
import joblock_zh_CN from '@locale/lanres/entities/joblock/joblock_zh_CN';
import jobregistry_zh_CN from '@locale/lanres/entities/jobregistry/jobregistry_zh_CN';
import jobsinfo_zh_CN from '@locale/lanres/entities/jobs-info/jobs-info_zh_CN';
import jobslog_zh_CN from '@locale/lanres/entities/jobs-log/jobs-log_zh_CN';
import jobslock_zh_CN from '@locale/lanres/entities/jobs-lock/jobs-lock_zh_CN';
import jobsregistry_zh_CN from '@locale/lanres/entities/jobs-registry/jobs-registry_zh_CN';
import components_zh_CN from '@locale/lanres/components/components_zh_CN';
import codelist_zh_CN from '@locale/lanres/codelist/codelist_zh_CN';
import userCustom_zh_CN from '@locale/lanres/userCustom/userCustom_zh_CN';
......@@ -60,10 +60,10 @@ export default {
},
},
entities: {
jobinfo: jobinfo_zh_CN,
joblog: joblog_zh_CN,
joblock: joblock_zh_CN,
jobregistry: jobregistry_zh_CN,
jobsinfo: jobsinfo_zh_CN,
jobslog: jobslog_zh_CN,
jobslock: jobslock_zh_CN,
jobsregistry: jobsregistry_zh_CN,
},
components: components_zh_CN,
codelist: codelist_zh_CN,
......
export default {
fields: {
id: '主键ID',
tenant_id: '租户ID',
app: '服务名',
cron: '任务执行CRON',
handler: '执行器任务HANDLER',
param: '执行器任务参数',
timeout: '任务执行超时时间(秒)',
fail_retry_count: '失败重试次数',
last_time: '上次调度时间',
next_time: '下次调度时间',
author: '所有者',
remark: '备注',
status: '状态(0、启用 1、已禁用)',
update_time: '更新时间',
create_time: '创建时间',
},
};
\ No newline at end of file
export default {
fields: {
id: '主键ID',
tenant_id: '租户ID',
app: '服务名',
cron: '任务执行CRON',
handler: '执行器任务HANDLER',
param: '执行器任务参数',
timeout: '任务执行超时时间(秒)',
fail_retry_count: '失败重试次数',
last_time: '上次调度时间',
next_time: '下次调度时间',
author: '所有者',
remark: '备注',
status: '状态(0、启用 1、已禁用)',
update_time: '更新时间',
create_time: '创建时间',
},
};
\ No newline at end of file
export default {
fields: {
id: '主键ID',
create_time: '创建时间',
},
};
\ No newline at end of file
export default {
fields: {
id: '主键ID',
create_time: '创建时间',
},
};
\ No newline at end of file
export default {
fields: {
id: '主键ID',
job_id: '任务ID',
address: '执行地址',
handler: '执行器任务HANDLER',
param: '执行器任务参数',
fail_retry_count: '失败重试次数',
trigger_code: '触发器调度返回码',
trigger_type: '触发器调度类型',
trigger_msg: '触发器调度类型',
create_time: '创建时间',
},
};
\ No newline at end of file
export default {
fields: {
id: '主键ID',
job_id: '任务ID',
address: '执行地址',
handler: '执行器任务HANDLER',
param: '执行器任务参数',
fail_retry_count: '失败重试次数',
trigger_code: '触发器调度返回码',
trigger_type: '触发器调度类型',
trigger_msg: '触发器调度类型',
create_time: '创建时间',
},
};
\ No newline at end of file
export default {
fields: {
id: '主键ID',
app: '服务名',
address: '执行地址',
status: '状态(0、启用 1、已禁用)',
update_time: '更新时间',
},
};
\ No newline at end of file
export default {
fields: {
id: '主键ID',
app: '服务名',
address: '执行地址',
status: '状态(0、启用 1、已禁用)',
update_time: '更新时间',
},
};
\ No newline at end of file
import qs from 'qs';
import { MockAdapter } from '@/mock/mock-adapter';
const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/ibztask-app-web\/jobsinfos\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/ibztask-app-web\/jobsinfos\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/jobsinfos\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/jobsinfos\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/jobsinfos\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/jobsinfos\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsinfos\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Update
mock.onPut(new RegExp(/^\/jobsinfos\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsinfos\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/jobsinfos\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsinfos\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/jobsinfos\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsinfos\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/jobsinfos\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Create
mock.onPost(new RegExp(/^\/jobsinfos\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsinfos\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// FetchDefault
mock.onGet(new RegExp(/^\/jobsinfos\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/jobsinfos\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock.onDelete(new RegExp(/^\/jobsinfos\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsinfos\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/jobsinfos\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsinfo 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsinfos\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
import qs from 'qs';
import { MockAdapter } from '@/mock/mock-adapter';
const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/ibztask-app-web\/jobslocks\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/ibztask-app-web\/jobslocks\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/jobslocks\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/jobslocks\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/jobslocks\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/jobslocks\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslocks\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/jobslocks\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslocks\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// Save
mock.onPost(new RegExp(/^\/jobslocks\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslocks\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Update
mock.onPut(new RegExp(/^\/jobslocks\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslocks\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/jobslocks\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslocks\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/jobslocks\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// FetchDefault
mock.onGet(new RegExp(/^\/jobslocks\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/jobslocks\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/jobslocks\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslocks\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/jobslocks\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslock 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslocks\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
import qs from 'qs';
import { MockAdapter } from '@/mock/mock-adapter';
const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/ibztask-app-web\/jobslogs\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/ibztask-app-web\/jobslogs\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/jobslogs\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/jobslogs\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/jobslogs\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// GetDraft
mock.onGet(new RegExp(/^\/jobslogs\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// CheckKey
mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// FetchDefault
mock.onGet(new RegExp(/^\/jobslogs\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/jobslogs\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock.onDelete(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
import qs from 'qs';
import { MockAdapter } from '@/mock/mock-adapter';
const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/ibztask-app-web\/jobsregistries\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/ibztask-app-web\/jobsregistries\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/jobsregistries\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/jobsregistries\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/jobsregistries\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Update
mock.onPut(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// CheckKey
mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/jobsregistries\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// FetchDefault
mock.onGet(new RegExp(/^\/jobsregistries\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/jobsregistries\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
......@@ -7,7 +7,7 @@ import './login/login';
import './upload/upload';
// 实体级接口对象
import './entity/jobinfos/jobinfos';
import './entity/joblogs/joblogs';
import './entity/joblocks/joblocks';
import './entity/jobregistrys/jobregistrys';
import './entity/jobs-infos/jobs-infos';
import './entity/jobs-logs/jobs-logs';
import './entity/jobs-locks/jobs-locks';
import './entity/jobs-registrys/jobs-registrys';
......@@ -39,10 +39,10 @@ export class EntityServiceRegister {
* @memberof EntityServiceRegister
*/
protected init(): void {
this.allEntityService.set('jobinfo', () => import('@/service/jobinfo/jobinfo-service'));
this.allEntityService.set('joblog', () => import('@/service/joblog/joblog-service'));
this.allEntityService.set('joblock', () => import('@/service/joblock/joblock-service'));
this.allEntityService.set('jobregistry', () => import('@/service/jobregistry/jobregistry-service'));
this.allEntityService.set('jobsinfo', () => import('@/service/jobs-info/jobs-info-service'));
this.allEntityService.set('jobslog', () => import('@/service/jobs-log/jobs-log-service'));
this.allEntityService.set('jobslock', () => import('@/service/jobs-lock/jobs-lock-service'));
this.allEntityService.set('jobsregistry', () => import('@/service/jobs-registry/jobs-registry-service'));
}
/**
......
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 任务信息服务对象基类
*
* @export
* @class JobsInfoServiceBase
* @extends {EntityServie}
*/
export default class JobsInfoServiceBase extends EntityService {
/**
* Creates an instance of JobsInfoServiceBase.
*
* @param {*} [opts={}]
* @memberof JobsInfoServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof JobsInfoServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='jobsinfo';
this.APPDEKEY = 'id';
this.APPDENAME = 'jobsinfos';
this.APPDETEXT = 'app';
this.APPNAME = 'web';
this.SYSTEMNAME = 'ibztask';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsInfoServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/jobsinfos/${context.jobsinfo}/select`,isloading);
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsInfoServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/jobsinfos/${context.jobsinfo}`,data,isloading);
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsInfoServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/jobsinfos/${context.jobsinfo}/checkkey`,data,isloading);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsInfoServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/jobsinfos/${context.jobsinfo}/save`,data,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsInfoServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/jobsinfos/getdraft`,isloading);
res.data.jobsinfo = data.jobsinfo;
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsInfoServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/jobsinfos/${context.jobsinfo}`,isloading);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsInfoServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/jobsinfos/${context.jobsinfo}`,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsInfoServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/jobsinfos`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsInfoServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/jobsinfos/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import JobsInfoServiceBase from './jobs-info-service-base';
/**
* 任务信息服务对象
*
* @export
* @class JobsInfoService
* @extends {JobsInfoServiceBase}
*/
export default class JobsInfoService extends JobsInfoServiceBase {
/**
* Creates an instance of JobsInfoService.
*
* @param {*} [opts={}]
* @memberof JobsInfoService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 任务锁服务对象基类
*
* @export
* @class JobsLockServiceBase
* @extends {EntityServie}
*/
export default class JobsLockServiceBase extends EntityService {
/**
* Creates an instance of JobsLockServiceBase.
*
* @param {*} [opts={}]
* @memberof JobsLockServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof JobsLockServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='jobslock';
this.APPDEKEY = 'id';
this.APPDENAME = 'jobslocks';
this.APPDETEXT = '';
this.APPNAME = 'web';
this.SYSTEMNAME = 'ibztask';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLockServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/jobslocks/${context.jobslock}/select`,isloading);
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLockServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/jobslocks`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLockServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/jobslocks/${context.jobslock}/save`,data,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLockServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/jobslocks/${context.jobslock}`,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLockServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/jobslocks/${context.jobslock}`,data,isloading);
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLockServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/jobslocks/${context.jobslock}/checkkey`,data,isloading);
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLockServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/jobslocks/${context.jobslock}`,isloading);
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLockServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/jobslocks/getdraft`,isloading);
res.data.jobslock = data.jobslock;
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLockServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/jobslocks/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import JobsLockServiceBase from './jobs-lock-service-base';
/**
* 任务锁服务对象
*
* @export
* @class JobsLockService
* @extends {JobsLockServiceBase}
*/
export default class JobsLockService extends JobsLockServiceBase {
/**
* Creates an instance of JobsLockService.
*
* @param {*} [opts={}]
* @memberof JobsLockService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 任务调度日志服务对象基类
*
* @export
* @class JobsLogServiceBase
* @extends {EntityServie}
*/
export default class JobsLogServiceBase extends EntityService {
/**
* Creates an instance of JobsLogServiceBase.
*
* @param {*} [opts={}]
* @memberof JobsLogServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof JobsLogServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='jobslog';
this.APPDEKEY = 'id';
this.APPDENAME = 'jobslogs';
this.APPDETEXT = '';
this.APPNAME = 'web';
this.SYSTEMNAME = 'ibztask';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLogServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/jobslogs/${context.jobslog}/select`,isloading);
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLogServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/jobslogs/getdraft`,isloading);
res.data.jobslog = data.jobslog;
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLogServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/jobslogs/${context.jobslog}`,data,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLogServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/jobslogs`,data,isloading);
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLogServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/jobslogs/${context.jobslog}/checkkey`,data,isloading);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLogServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/jobslogs/${context.jobslog}/save`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLogServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/jobslogs/${context.jobslog}`,isloading);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLogServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/jobslogs/${context.jobslog}`,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsLogServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/jobslogs/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import JobsLogServiceBase from './jobs-log-service-base';
/**
* 任务调度日志服务对象
*
* @export
* @class JobsLogService
* @extends {JobsLogServiceBase}
*/
export default class JobsLogService extends JobsLogServiceBase {
/**
* Creates an instance of JobsLogService.
*
* @param {*} [opts={}]
* @memberof JobsLogService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 任务注册信息服务对象基类
*
* @export
* @class JobsRegistryServiceBase
* @extends {EntityServie}
*/
export default class JobsRegistryServiceBase extends EntityService {
/**
* Creates an instance of JobsRegistryServiceBase.
*
* @param {*} [opts={}]
* @memberof JobsRegistryServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof JobsRegistryServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='jobsregistry';
this.APPDEKEY = 'id';
this.APPDENAME = 'jobsregistries';
this.APPDETEXT = 'app';
this.APPNAME = 'web';
this.SYSTEMNAME = 'ibztask';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsRegistryServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/jobsregistries/${context.jobsregistry}/select`,isloading);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsRegistryServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/jobsregistries/${context.jobsregistry}`,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsRegistryServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/jobsregistries/${context.jobsregistry}`,isloading);
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsRegistryServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/jobsregistries/${context.jobsregistry}`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsRegistryServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/jobsregistries/${context.jobsregistry}/save`,data,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsRegistryServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/jobsregistries`,data,isloading);
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsRegistryServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/jobsregistries/${context.jobsregistry}/checkkey`,data,isloading);
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsRegistryServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/jobsregistries/getdraft`,isloading);
res.data.jobsregistry = data.jobsregistry;
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof JobsRegistryServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/jobsregistries/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import JobsRegistryServiceBase from './jobs-registry-service-base';
/**
* 任务注册信息服务对象
*
* @export
* @class JobsRegistryService
* @extends {JobsRegistryServiceBase}
*/
export default class JobsRegistryService extends JobsRegistryServiceBase {
/**
* Creates an instance of JobsRegistryService.
*
* @param {*} [opts={}]
* @memberof JobsRegistryService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Environment } from '@/environments/environment';
import { UIActionTool,Util } from '@/utils';
import UIService from '../ui-service';
import { Subject } from 'rxjs';
import JobsInfoService from '@/service/jobs-info/jobs-info-service';
/**
* 任务信息UI服务对象基类
*
* @export
* @class JobsInfoUIServiceBase
*/
export default class JobsInfoUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof JobsInfoUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof JobsInfoUIServiceBase
*/
public dataService:JobsInfoService = new JobsInfoService();
/**
* 所有关联视图
*
* @memberof JobsInfoUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof JobsInfoUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof JobsInfoUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof JobsInfoUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof JobsInfoUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* Creates an instance of JobsInfoUIServiceBase.
*
* @param {*} [opts={}]
* @memberof JobsInfoUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.initViewMap();
this.initDeMainStateMap();
}
/**
* 初始化视图Map
*
* @memberof JobsInfoUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof JobsInfoUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof JobsInfoUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({jobsinfo:srfkey});
const curData:any = result.data;
//判断当前数据模式,默认为true,todo
const iRealDEModel:boolean = true;
let bDataInWF:boolean = false;
let bWFMode:any = false;
// 计算数据模式
if (this.isEnableWorkflow) {
bDataInWF = await this.dataService.testDataInWF({stateValue:this.stateValue,stateField:this.stateField},curData);
if (bDataInWF) {
bDataInWF = true;
bWFMode = await this.dataService.testUserExistWorklist(null,curData);
}
}
let strPDTViewParam:string = await this.getDESDDEViewPDTParam(curData, bDataInWF, bWFMode);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return this.allViewMap.get(strPDTViewParam);
}
/**
* 获取实际的数据类型
*
* @memberof JobsInfoUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof JobsInfoUIServiceBase
*/
public async getDESDDEViewPDTParam(curData:any, bDataInWF:boolean, bWFMode:boolean){
let strPDTParam:string = '';
if (bDataInWF) {
// 判断数据是否在流程中
}
//多表单,todo
const isEnableMultiForm:boolean = false;
const multiFormDEField:string|null =null;
if (isEnableMultiForm && multiFormDEField) {
const objFormValue:string = curData[multiFormDEField];
if(!Environment.isAppMode){
return 'MOBEDITVIEW'+objFormValue;
}
return 'EDITVIEW'+objFormValue;
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
return `MOBEDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof JobsInfoUIServiceBase
*/
public async getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.error(`当前数据对象不包含属性singleMainField,可能会发生错误`);
}
})
let strTag:String = "";
for (let i = 0; i <= 1; i++) {
let strTag:string = (curData[this.mainStateFields[0]])?(i == 0) ? curData[this.mainStateFields[0]] : "":"";
if (this.mainStateFields.length >= 2) {
for (let j = 0; j <= 1; j++) {
let strTag2:string = (curData[this.mainStateFields[1]])?`${strTag}__${(j == 0) ? curData[this.mainStateFields[1]] : ""}`:strTag;
if (this.mainStateFields.length >= 3) {
for (let k = 0; k <= 1; k++) {
let strTag3:string = (curData[this.mainStateFields[2]])?`${strTag2}__${(k == 0) ? curData[this.mainStateFields[2]] : ""}`:strTag2;
// 判断是否存在
return this.allDeMainStateMap.get(strTag3);
}
}else{
return this.allDeMainStateMap.get(strTag2);
}
}
}else{
return this.allDeMainStateMap.get(strTag);
}
}
return null;
}
}
\ No newline at end of file
import JobsInfoUIServiceBase from './jobs-info-ui-service-base';
/**
* 任务信息UI服务对象
*
* @export
* @class JobsInfoUIService
*/
export default class JobsInfoUIService extends JobsInfoUIServiceBase {
/**
* Creates an instance of JobsInfoUIService.
*
* @param {*} [opts={}]
* @memberof JobsInfoUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Environment } from '@/environments/environment';
import { UIActionTool,Util } from '@/utils';
import UIService from '../ui-service';
import { Subject } from 'rxjs';
import JobsLockService from '@/service/jobs-lock/jobs-lock-service';
/**
* 任务锁UI服务对象基类
*
* @export
* @class JobsLockUIServiceBase
*/
export default class JobsLockUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof JobsLockUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof JobsLockUIServiceBase
*/
public dataService:JobsLockService = new JobsLockService();
/**
* 所有关联视图
*
* @memberof JobsLockUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof JobsLockUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof JobsLockUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof JobsLockUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof JobsLockUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* Creates an instance of JobsLockUIServiceBase.
*
* @param {*} [opts={}]
* @memberof JobsLockUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.initViewMap();
this.initDeMainStateMap();
}
/**
* 初始化视图Map
*
* @memberof JobsLockUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof JobsLockUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof JobsLockUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({jobslock:srfkey});
const curData:any = result.data;
//判断当前数据模式,默认为true,todo
const iRealDEModel:boolean = true;
let bDataInWF:boolean = false;
let bWFMode:any = false;
// 计算数据模式
if (this.isEnableWorkflow) {
bDataInWF = await this.dataService.testDataInWF({stateValue:this.stateValue,stateField:this.stateField},curData);
if (bDataInWF) {
bDataInWF = true;
bWFMode = await this.dataService.testUserExistWorklist(null,curData);
}
}
let strPDTViewParam:string = await this.getDESDDEViewPDTParam(curData, bDataInWF, bWFMode);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return this.allViewMap.get(strPDTViewParam);
}
/**
* 获取实际的数据类型
*
* @memberof JobsLockUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof JobsLockUIServiceBase
*/
public async getDESDDEViewPDTParam(curData:any, bDataInWF:boolean, bWFMode:boolean){
let strPDTParam:string = '';
if (bDataInWF) {
// 判断数据是否在流程中
}
//多表单,todo
const isEnableMultiForm:boolean = false;
const multiFormDEField:string|null =null;
if (isEnableMultiForm && multiFormDEField) {
const objFormValue:string = curData[multiFormDEField];
if(!Environment.isAppMode){
return 'MOBEDITVIEW'+objFormValue;
}
return 'EDITVIEW'+objFormValue;
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
return `MOBEDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof JobsLockUIServiceBase
*/
public async getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.error(`当前数据对象不包含属性singleMainField,可能会发生错误`);
}
})
let strTag:String = "";
for (let i = 0; i <= 1; i++) {
let strTag:string = (curData[this.mainStateFields[0]])?(i == 0) ? curData[this.mainStateFields[0]] : "":"";
if (this.mainStateFields.length >= 2) {
for (let j = 0; j <= 1; j++) {
let strTag2:string = (curData[this.mainStateFields[1]])?`${strTag}__${(j == 0) ? curData[this.mainStateFields[1]] : ""}`:strTag;
if (this.mainStateFields.length >= 3) {
for (let k = 0; k <= 1; k++) {
let strTag3:string = (curData[this.mainStateFields[2]])?`${strTag2}__${(k == 0) ? curData[this.mainStateFields[2]] : ""}`:strTag2;
// 判断是否存在
return this.allDeMainStateMap.get(strTag3);
}
}else{
return this.allDeMainStateMap.get(strTag2);
}
}
}else{
return this.allDeMainStateMap.get(strTag);
}
}
return null;
}
}
\ No newline at end of file
import JobsLockUIServiceBase from './jobs-lock-ui-service-base';
/**
* 任务锁UI服务对象
*
* @export
* @class JobsLockUIService
*/
export default class JobsLockUIService extends JobsLockUIServiceBase {
/**
* Creates an instance of JobsLockUIService.
*
* @param {*} [opts={}]
* @memberof JobsLockUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Environment } from '@/environments/environment';
import { UIActionTool,Util } from '@/utils';
import UIService from '../ui-service';
import { Subject } from 'rxjs';
import JobsLogService from '@/service/jobs-log/jobs-log-service';
/**
* 任务调度日志UI服务对象基类
*
* @export
* @class JobsLogUIServiceBase
*/
export default class JobsLogUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof JobsLogUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof JobsLogUIServiceBase
*/
public dataService:JobsLogService = new JobsLogService();
/**
* 所有关联视图
*
* @memberof JobsLogUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof JobsLogUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof JobsLogUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof JobsLogUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof JobsLogUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* Creates an instance of JobsLogUIServiceBase.
*
* @param {*} [opts={}]
* @memberof JobsLogUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.initViewMap();
this.initDeMainStateMap();
}
/**
* 初始化视图Map
*
* @memberof JobsLogUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof JobsLogUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof JobsLogUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({jobslog:srfkey});
const curData:any = result.data;
//判断当前数据模式,默认为true,todo
const iRealDEModel:boolean = true;
let bDataInWF:boolean = false;
let bWFMode:any = false;
// 计算数据模式
if (this.isEnableWorkflow) {
bDataInWF = await this.dataService.testDataInWF({stateValue:this.stateValue,stateField:this.stateField},curData);
if (bDataInWF) {
bDataInWF = true;
bWFMode = await this.dataService.testUserExistWorklist(null,curData);
}
}
let strPDTViewParam:string = await this.getDESDDEViewPDTParam(curData, bDataInWF, bWFMode);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return this.allViewMap.get(strPDTViewParam);
}
/**
* 获取实际的数据类型
*
* @memberof JobsLogUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof JobsLogUIServiceBase
*/
public async getDESDDEViewPDTParam(curData:any, bDataInWF:boolean, bWFMode:boolean){
let strPDTParam:string = '';
if (bDataInWF) {
// 判断数据是否在流程中
}
//多表单,todo
const isEnableMultiForm:boolean = false;
const multiFormDEField:string|null =null;
if (isEnableMultiForm && multiFormDEField) {
const objFormValue:string = curData[multiFormDEField];
if(!Environment.isAppMode){
return 'MOBEDITVIEW'+objFormValue;
}
return 'EDITVIEW'+objFormValue;
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
return `MOBEDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof JobsLogUIServiceBase
*/
public async getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.error(`当前数据对象不包含属性singleMainField,可能会发生错误`);
}
})
let strTag:String = "";
for (let i = 0; i <= 1; i++) {
let strTag:string = (curData[this.mainStateFields[0]])?(i == 0) ? curData[this.mainStateFields[0]] : "":"";
if (this.mainStateFields.length >= 2) {
for (let j = 0; j <= 1; j++) {
let strTag2:string = (curData[this.mainStateFields[1]])?`${strTag}__${(j == 0) ? curData[this.mainStateFields[1]] : ""}`:strTag;
if (this.mainStateFields.length >= 3) {
for (let k = 0; k <= 1; k++) {
let strTag3:string = (curData[this.mainStateFields[2]])?`${strTag2}__${(k == 0) ? curData[this.mainStateFields[2]] : ""}`:strTag2;
// 判断是否存在
return this.allDeMainStateMap.get(strTag3);
}
}else{
return this.allDeMainStateMap.get(strTag2);
}
}
}else{
return this.allDeMainStateMap.get(strTag);
}
}
return null;
}
}
\ No newline at end of file
import JobsLogUIServiceBase from './jobs-log-ui-service-base';
/**
* 任务调度日志UI服务对象
*
* @export
* @class JobsLogUIService
*/
export default class JobsLogUIService extends JobsLogUIServiceBase {
/**
* Creates an instance of JobsLogUIService.
*
* @param {*} [opts={}]
* @memberof JobsLogUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Environment } from '@/environments/environment';
import { UIActionTool,Util } from '@/utils';
import UIService from '../ui-service';
import { Subject } from 'rxjs';
import JobsRegistryService from '@/service/jobs-registry/jobs-registry-service';
/**
* 任务注册信息UI服务对象基类
*
* @export
* @class JobsRegistryUIServiceBase
*/
export default class JobsRegistryUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof JobsRegistryUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof JobsRegistryUIServiceBase
*/
public dataService:JobsRegistryService = new JobsRegistryService();
/**
* 所有关联视图
*
* @memberof JobsRegistryUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof JobsRegistryUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof JobsRegistryUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof JobsRegistryUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof JobsRegistryUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* Creates an instance of JobsRegistryUIServiceBase.
*
* @param {*} [opts={}]
* @memberof JobsRegistryUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.initViewMap();
this.initDeMainStateMap();
}
/**
* 初始化视图Map
*
* @memberof JobsRegistryUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof JobsRegistryUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof JobsRegistryUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({jobsregistry:srfkey});
const curData:any = result.data;
//判断当前数据模式,默认为true,todo
const iRealDEModel:boolean = true;
let bDataInWF:boolean = false;
let bWFMode:any = false;
// 计算数据模式
if (this.isEnableWorkflow) {
bDataInWF = await this.dataService.testDataInWF({stateValue:this.stateValue,stateField:this.stateField},curData);
if (bDataInWF) {
bDataInWF = true;
bWFMode = await this.dataService.testUserExistWorklist(null,curData);
}
}
let strPDTViewParam:string = await this.getDESDDEViewPDTParam(curData, bDataInWF, bWFMode);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return this.allViewMap.get(strPDTViewParam);
}
/**
* 获取实际的数据类型
*
* @memberof JobsRegistryUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof JobsRegistryUIServiceBase
*/
public async getDESDDEViewPDTParam(curData:any, bDataInWF:boolean, bWFMode:boolean){
let strPDTParam:string = '';
if (bDataInWF) {
// 判断数据是否在流程中
}
//多表单,todo
const isEnableMultiForm:boolean = false;
const multiFormDEField:string|null =null;
if (isEnableMultiForm && multiFormDEField) {
const objFormValue:string = curData[multiFormDEField];
if(!Environment.isAppMode){
return 'MOBEDITVIEW'+objFormValue;
}
return 'EDITVIEW'+objFormValue;
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
return `MOBEDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof JobsRegistryUIServiceBase
*/
public async getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.error(`当前数据对象不包含属性singleMainField,可能会发生错误`);
}
})
let strTag:String = "";
for (let i = 0; i <= 1; i++) {
let strTag:string = (curData[this.mainStateFields[0]])?(i == 0) ? curData[this.mainStateFields[0]] : "":"";
if (this.mainStateFields.length >= 2) {
for (let j = 0; j <= 1; j++) {
let strTag2:string = (curData[this.mainStateFields[1]])?`${strTag}__${(j == 0) ? curData[this.mainStateFields[1]] : ""}`:strTag;
if (this.mainStateFields.length >= 3) {
for (let k = 0; k <= 1; k++) {
let strTag3:string = (curData[this.mainStateFields[2]])?`${strTag2}__${(k == 0) ? curData[this.mainStateFields[2]] : ""}`:strTag2;
// 判断是否存在
return this.allDeMainStateMap.get(strTag3);
}
}else{
return this.allDeMainStateMap.get(strTag2);
}
}
}else{
return this.allDeMainStateMap.get(strTag);
}
}
return null;
}
}
\ No newline at end of file
import JobsRegistryUIServiceBase from './jobs-registry-ui-service-base';
/**
* 任务注册信息UI服务对象
*
* @export
* @class JobsRegistryUIService
*/
export default class JobsRegistryUIService extends JobsRegistryUIServiceBase {
/**
* Creates an instance of JobsRegistryUIService.
*
* @param {*} [opts={}]
* @memberof JobsRegistryUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
......@@ -39,10 +39,10 @@ export class UIServiceRegister {
* @memberof UIServiceRegister
*/
protected init(): void {
this.allUIService.set('jobinfo', () => import('@/uiservice/jobinfo/jobinfo-ui-service'));
this.allUIService.set('joblog', () => import('@/uiservice/joblog/joblog-ui-service'));
this.allUIService.set('joblock', () => import('@/uiservice/joblock/joblock-ui-service'));
this.allUIService.set('jobregistry', () => import('@/uiservice/jobregistry/jobregistry-ui-service'));
this.allUIService.set('jobsinfo', () => import('@/uiservice/jobs-info/jobs-info-ui-service'));
this.allUIService.set('jobslog', () => import('@/uiservice/jobs-log/jobs-log-ui-service'));
this.allUIService.set('jobslock', () => import('@/uiservice/jobs-lock/jobs-lock-ui-service'));
this.allUIService.set('jobsregistry', () => import('@/uiservice/jobs-registry/jobs-registry-ui-service'));
}
/**
......
......@@ -4,19 +4,19 @@ server:
zuul:
routes:
jobs_info:
path: /jobinfos/**
path: /jobsinfos/**
serviceId: ibztask-api
stripPrefix: false
jobs_log:
path: /joblogs/**
path: /jobslogs/**
serviceId: ibztask-api
stripPrefix: false
jobs_lock:
path: /joblocks/**
path: /jobslocks/**
serviceId: ibztask-api
stripPrefix: false
jobs_registry:
path: /jobregistries/**
path: /jobsregistries/**
serviceId: ibztask-api
stripPrefix: false
loginv7:
......
package cn.ibizlab.core.task.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* 实体[任务信息]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "JOBS_INFO",resultMap = "JobsInfoResultMap")
public class JobsInfo extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@DEField(isKeyField=true)
@TableId(value= "id",type=IdType.UUID)
@JSONField(name = "id")
@JsonProperty("id")
private BigInteger id;
/**
* 租户ID
*/
@DEField(name = "tenant_id")
@TableField(value = "tenant_id")
@JSONField(name = "tenant_id")
@JsonProperty("tenant_id")
private String tenantId;
/**
* 服务名
*/
@TableField(value = "app")
@JSONField(name = "app")
@JsonProperty("app")
private String app;
/**
* 任务执行CRON
*/
@TableField(value = "cron")
@JSONField(name = "cron")
@JsonProperty("cron")
private String cron;
/**
* 执行器任务HANDLER
*/
@TableField(value = "handler")
@JSONField(name = "handler")
@JsonProperty("handler")
private String handler;
/**
* 执行器任务参数
*/
@TableField(value = "param")
@JSONField(name = "param")
@JsonProperty("param")
private String param;
/**
* 任务执行超时时间(秒)
*/
@DEField(defaultValue = "0")
@TableField(value = "timeout")
@JSONField(name = "timeout")
@JsonProperty("timeout")
private Integer timeout;
/**
* 失败重试次数
*/
@DEField(defaultValue = "0")
@TableField(value = "fail_retry_count")
@JSONField(name = "fail_retry_count")
@JsonProperty("fail_retry_count")
private Integer failRetryCount;
/**
* 上次调度时间
*/
@DEField(name = "last_time")
@TableField(value = "last_time")
@JSONField(name = "last_time")
@JsonProperty("last_time")
private BigInteger lastTime;
/**
* 下次调度时间
*/
@DEField(name = "next_time")
@TableField(value = "next_time")
@JSONField(name = "next_time")
@JsonProperty("next_time")
private BigInteger nextTime;
/**
* 所有者
*/
@TableField(value = "author")
@JSONField(name = "author")
@JsonProperty("author")
private String author;
/**
* 备注
*/
@TableField(value = "remark")
@JSONField(name = "remark")
@JsonProperty("remark")
private String remark;
/**
* 状态(0、启用 1、已禁用)
*/
@TableField(value = "status")
@JSONField(name = "status")
@JsonProperty("status")
private Integer status;
/**
* 更新时间
*/
@DEField(name = "update_time")
@TableField(value = "update_time")
@JSONField(name = "update_time")
@JsonProperty("update_time")
private BigInteger updateTime;
/**
* 创建时间
*/
@DEField(name = "create_time")
@TableField(value = "create_time")
@JSONField(name = "create_time")
@JsonProperty("create_time")
private BigInteger createTime;
/**
* 设置 [租户ID]
*/
public void setTenantId(String tenantId){
this.tenantId = tenantId ;
this.modify("tenant_id",tenantId);
}
/**
* 设置 [服务名]
*/
public void setApp(String app){
this.app = app ;
this.modify("app",app);
}
/**
* 设置 [任务执行CRON]
*/
public void setCron(String cron){
this.cron = cron ;
this.modify("cron",cron);
}
/**
* 设置 [执行器任务HANDLER]
*/
public void setHandler(String handler){
this.handler = handler ;
this.modify("handler",handler);
}
/**
* 设置 [执行器任务参数]
*/
public void setParam(String param){
this.param = param ;
this.modify("param",param);
}
/**
* 设置 [任务执行超时时间(秒)]
*/
public void setTimeout(Integer timeout){
this.timeout = timeout ;
this.modify("timeout",timeout);
}
/**
* 设置 [失败重试次数]
*/
public void setFailRetryCount(Integer failRetryCount){
this.failRetryCount = failRetryCount ;
this.modify("fail_retry_count",failRetryCount);
}
/**
* 设置 [上次调度时间]
*/
public void setLastTime(BigInteger lastTime){
this.lastTime = lastTime ;
this.modify("last_time",lastTime);
}
/**
* 设置 [下次调度时间]
*/
public void setNextTime(BigInteger nextTime){
this.nextTime = nextTime ;
this.modify("next_time",nextTime);
}
/**
* 设置 [所有者]
*/
public void setAuthor(String author){
this.author = author ;
this.modify("author",author);
}
/**
* 设置 [备注]
*/
public void setRemark(String remark){
this.remark = remark ;
this.modify("remark",remark);
}
/**
* 设置 [状态(0、启用 1、已禁用)]
*/
public void setStatus(Integer status){
this.status = status ;
this.modify("status",status);
}
/**
* 设置 [更新时间]
*/
public void setUpdateTime(BigInteger updateTime){
this.updateTime = updateTime ;
this.modify("update_time",updateTime);
}
/**
* 设置 [创建时间]
*/
public void setCreateTime(BigInteger createTime){
this.createTime = createTime ;
this.modify("create_time",createTime);
}
}
package cn.ibizlab.core.task.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* 实体[任务锁]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "JOBS_LOCK",resultMap = "JobsLockResultMap")
public class JobsLock extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@DEField(isKeyField=true)
@TableId(value= "id",type=IdType.UUID)
@JSONField(name = "id")
@JsonProperty("id")
private BigInteger id;
/**
* 创建时间
*/
@DEField(name = "create_time")
@TableField(value = "create_time")
@JSONField(name = "create_time")
@JsonProperty("create_time")
private BigInteger createTime;
/**
* 设置 [创建时间]
*/
public void setCreateTime(BigInteger createTime){
this.createTime = createTime ;
this.modify("create_time",createTime);
}
}
package cn.ibizlab.core.task.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* 实体[任务调度日志]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "JOBS_LOG",resultMap = "JobsLogResultMap")
public class JobsLog extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@DEField(isKeyField=true)
@TableId(value= "id",type=IdType.UUID)
@JSONField(name = "id")
@JsonProperty("id")
private BigInteger id;
/**
* 任务ID
*/
@DEField(name = "job_id")
@TableField(value = "job_id")
@JSONField(name = "job_id")
@JsonProperty("job_id")
private BigInteger jobId;
/**
* 执行地址
*/
@TableField(value = "address")
@JSONField(name = "address")
@JsonProperty("address")
private String address;
/**
* 执行器任务HANDLER
*/
@TableField(value = "handler")
@JSONField(name = "handler")
@JsonProperty("handler")
private String handler;
/**
* 执行器任务参数
*/
@TableField(value = "param")
@JSONField(name = "param")
@JsonProperty("param")
private String param;
/**
* 失败重试次数
*/
@DEField(defaultValue = "0")
@TableField(value = "fail_retry_count")
@JSONField(name = "fail_retry_count")
@JsonProperty("fail_retry_count")
private Integer failRetryCount;
/**
* 触发器调度返回码
*/
@DEField(defaultValue = "0")
@TableField(value = "trigger_code")
@JSONField(name = "trigger_code")
@JsonProperty("trigger_code")
private Integer triggerCode;
/**
* 触发器调度类型
*/
@DEField(name = "trigger_type")
@TableField(value = "trigger_type")
@JSONField(name = "trigger_type")
@JsonProperty("trigger_type")
private String triggerType;
/**
* 触发器调度类型
*/
@DEField(name = "trigger_msg")
@TableField(value = "trigger_msg")
@JSONField(name = "trigger_msg")
@JsonProperty("trigger_msg")
private String triggerMsg;
/**
* 创建时间
*/
@DEField(name = "create_time")
@TableField(value = "create_time")
@JSONField(name = "create_time")
@JsonProperty("create_time")
private BigInteger createTime;
/**
* 设置 [任务ID]
*/
public void setJobId(BigInteger jobId){
this.jobId = jobId ;
this.modify("job_id",jobId);
}
/**
* 设置 [执行地址]
*/
public void setAddress(String address){
this.address = address ;
this.modify("address",address);
}
/**
* 设置 [执行器任务HANDLER]
*/
public void setHandler(String handler){
this.handler = handler ;
this.modify("handler",handler);
}
/**
* 设置 [执行器任务参数]
*/
public void setParam(String param){
this.param = param ;
this.modify("param",param);
}
/**
* 设置 [失败重试次数]
*/
public void setFailRetryCount(Integer failRetryCount){
this.failRetryCount = failRetryCount ;
this.modify("fail_retry_count",failRetryCount);
}
/**
* 设置 [触发器调度返回码]
*/
public void setTriggerCode(Integer triggerCode){
this.triggerCode = triggerCode ;
this.modify("trigger_code",triggerCode);
}
/**
* 设置 [触发器调度类型]
*/
public void setTriggerType(String triggerType){
this.triggerType = triggerType ;
this.modify("trigger_type",triggerType);
}
/**
* 设置 [触发器调度类型]
*/
public void setTriggerMsg(String triggerMsg){
this.triggerMsg = triggerMsg ;
this.modify("trigger_msg",triggerMsg);
}
/**
* 设置 [创建时间]
*/
public void setCreateTime(BigInteger createTime){
this.createTime = createTime ;
this.modify("create_time",createTime);
}
}
package cn.ibizlab.core.task.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* 实体[任务注册信息]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "JOBS_REGISTRY",resultMap = "JobsRegistryResultMap")
public class JobsRegistry extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@DEField(isKeyField=true)
@TableId(value= "id",type=IdType.UUID)
@JSONField(name = "id")
@JsonProperty("id")
private BigInteger id;
/**
* 服务名
*/
@TableField(value = "app")
@JSONField(name = "app")
@JsonProperty("app")
private String app;
/**
* 执行地址
*/
@TableField(value = "address")
@JSONField(name = "address")
@JsonProperty("address")
private String address;
/**
* 状态(0、启用 1、已禁用)
*/
@TableField(value = "status")
@JSONField(name = "status")
@JsonProperty("status")
private Integer status;
/**
* 更新时间
*/
@DEField(name = "update_time")
@TableField(value = "update_time")
@JSONField(name = "update_time")
@JsonProperty("update_time")
private BigInteger updateTime;
/**
* 设置 [服务名]
*/
public void setApp(String app){
this.app = app ;
this.modify("app",app);
}
/**
* 设置 [执行地址]
*/
public void setAddress(String address){
this.address = address ;
this.modify("address",address);
}
/**
* 设置 [状态(0、启用 1、已禁用)]
*/
public void setStatus(Integer status){
this.status = status ;
this.modify("status",status);
}
/**
* 设置 [更新时间]
*/
public void setUpdateTime(BigInteger updateTime){
this.updateTime = updateTime ;
this.modify("update_time",updateTime);
}
}
package cn.ibizlab.core.task.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.task.domain.JobsInfo;
/**
* 关系型数据实体[JobsInfo] 查询条件对象
*/
@Slf4j
@Data
public class JobsInfoSearchContext extends QueryWrapperContext<JobsInfo> {
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("app", query)
);
}
}
}
package cn.ibizlab.core.task.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.task.domain.JobsLock;
/**
* 关系型数据实体[JobsLock] 查询条件对象
*/
@Slf4j
@Data
public class JobsLockSearchContext extends QueryWrapperContext<JobsLock> {
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
}
}
}
package cn.ibizlab.core.task.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.task.domain.JobsLog;
/**
* 关系型数据实体[JobsLog] 查询条件对象
*/
@Slf4j
@Data
public class JobsLogSearchContext extends QueryWrapperContext<JobsLog> {
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
}
}
}
package cn.ibizlab.core.task.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.task.domain.JobsRegistry;
/**
* 关系型数据实体[JobsRegistry] 查询条件对象
*/
@Slf4j
@Data
public class JobsRegistrySearchContext extends QueryWrapperContext<JobsRegistry> {
private String n_app_like;//[服务名]
public void setN_app_like(String n_app_like) {
this.n_app_like = n_app_like;
if(!ObjectUtils.isEmpty(this.n_app_like)){
this.getSearchCond().like("app", n_app_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("app", query)
);
}
}
}
package cn.ibizlab.core.task.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.core.task.domain.JobsInfo;
import cn.ibizlab.core.task.filter.JobsInfoSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface JobsInfoMapper extends BaseMapper<JobsInfo>{
Page<JobsInfo> searchDefault(IPage page, @Param("srf") JobsInfoSearchContext context, @Param("ew") Wrapper<JobsInfo> wrapper) ;
@Override
JobsInfo selectById(Serializable id);
@Override
int insert(JobsInfo entity);
@Override
int updateById(@Param(Constants.ENTITY) JobsInfo entity);
@Override
int update(@Param(Constants.ENTITY) JobsInfo entity, @Param("ew") Wrapper<JobsInfo> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.core.task.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.core.task.domain.JobsLock;
import cn.ibizlab.core.task.filter.JobsLockSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface JobsLockMapper extends BaseMapper<JobsLock>{
Page<JobsLock> searchDefault(IPage page, @Param("srf") JobsLockSearchContext context, @Param("ew") Wrapper<JobsLock> wrapper) ;
@Override
JobsLock selectById(Serializable id);
@Override
int insert(JobsLock entity);
@Override
int updateById(@Param(Constants.ENTITY) JobsLock entity);
@Override
int update(@Param(Constants.ENTITY) JobsLock entity, @Param("ew") Wrapper<JobsLock> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.core.task.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.core.task.domain.JobsLog;
import cn.ibizlab.core.task.filter.JobsLogSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface JobsLogMapper extends BaseMapper<JobsLog>{
Page<JobsLog> searchDefault(IPage page, @Param("srf") JobsLogSearchContext context, @Param("ew") Wrapper<JobsLog> wrapper) ;
@Override
JobsLog selectById(Serializable id);
@Override
int insert(JobsLog entity);
@Override
int updateById(@Param(Constants.ENTITY) JobsLog entity);
@Override
int update(@Param(Constants.ENTITY) JobsLog entity, @Param("ew") Wrapper<JobsLog> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.core.task.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.core.task.domain.JobsRegistry;
import cn.ibizlab.core.task.filter.JobsRegistrySearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface JobsRegistryMapper extends BaseMapper<JobsRegistry>{
Page<JobsRegistry> searchDefault(IPage page, @Param("srf") JobsRegistrySearchContext context, @Param("ew") Wrapper<JobsRegistry> wrapper) ;
@Override
JobsRegistry selectById(Serializable id);
@Override
int insert(JobsRegistry entity);
@Override
int updateById(@Param(Constants.ENTITY) JobsRegistry entity);
@Override
int update(@Param(Constants.ENTITY) JobsRegistry entity, @Param("ew") Wrapper<JobsRegistry> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.core.task.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.core.task.domain.JobsInfo;
import cn.ibizlab.core.task.filter.JobsInfoSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[JobsInfo] 服务对象接口
*/
public interface IJobsInfoService extends IService<JobsInfo>{
boolean update(JobsInfo et) ;
void updateBatch(List<JobsInfo> list) ;
boolean checkKey(JobsInfo et) ;
boolean save(JobsInfo et) ;
void saveBatch(List<JobsInfo> list) ;
JobsInfo getDraft(JobsInfo et) ;
boolean remove(BigInteger key) ;
void removeBatch(Collection<BigInteger> idList) ;
JobsInfo get(BigInteger key) ;
boolean create(JobsInfo et) ;
void createBatch(List<JobsInfo> list) ;
Page<JobsInfo> searchDefault(JobsInfoSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
}
package cn.ibizlab.core.task.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.core.task.domain.JobsLock;
import cn.ibizlab.core.task.filter.JobsLockSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[JobsLock] 服务对象接口
*/
public interface IJobsLockService extends IService<JobsLock>{
boolean create(JobsLock et) ;
void createBatch(List<JobsLock> list) ;
boolean save(JobsLock et) ;
void saveBatch(List<JobsLock> list) ;
JobsLock get(BigInteger key) ;
boolean update(JobsLock et) ;
void updateBatch(List<JobsLock> list) ;
boolean checkKey(JobsLock et) ;
boolean remove(BigInteger key) ;
void removeBatch(Collection<BigInteger> idList) ;
JobsLock getDraft(JobsLock et) ;
Page<JobsLock> searchDefault(JobsLockSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
}
package cn.ibizlab.core.task.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.core.task.domain.JobsLog;
import cn.ibizlab.core.task.filter.JobsLogSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[JobsLog] 服务对象接口
*/
public interface IJobsLogService extends IService<JobsLog>{
JobsLog getDraft(JobsLog et) ;
boolean update(JobsLog et) ;
void updateBatch(List<JobsLog> list) ;
boolean create(JobsLog et) ;
void createBatch(List<JobsLog> list) ;
boolean checkKey(JobsLog et) ;
boolean save(JobsLog et) ;
void saveBatch(List<JobsLog> list) ;
boolean remove(BigInteger key) ;
void removeBatch(Collection<BigInteger> idList) ;
JobsLog get(BigInteger key) ;
Page<JobsLog> searchDefault(JobsLogSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
}
package cn.ibizlab.core.task.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.core.task.domain.JobsRegistry;
import cn.ibizlab.core.task.filter.JobsRegistrySearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[JobsRegistry] 服务对象接口
*/
public interface IJobsRegistryService extends IService<JobsRegistry>{
JobsRegistry get(BigInteger key) ;
boolean remove(BigInteger key) ;
void removeBatch(Collection<BigInteger> idList) ;
boolean update(JobsRegistry et) ;
void updateBatch(List<JobsRegistry> list) ;
boolean save(JobsRegistry et) ;
void saveBatch(List<JobsRegistry> list) ;
boolean create(JobsRegistry et) ;
void createBatch(List<JobsRegistry> list) ;
boolean checkKey(JobsRegistry et) ;
JobsRegistry getDraft(JobsRegistry et) ;
Page<JobsRegistry> searchDefault(JobsRegistrySearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
}
package cn.ibizlab.core.task.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.task.domain.JobsInfo;
import cn.ibizlab.core.task.filter.JobsInfoSearchContext;
import cn.ibizlab.core.task.service.IJobsInfoService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.task.mapper.JobsInfoMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[任务信息] 服务对象接口实现
*/
@Slf4j
@Service("JobsInfoServiceImpl")
public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> implements IJobsInfoService {
private int batchSize = 500;
@Override
@Transactional
public boolean update(JobsInfo et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("id",et.getId())))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void updateBatch(List<JobsInfo> list) {
updateBatchById(list,batchSize);
}
@Override
public boolean checkKey(JobsInfo et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(JobsInfo et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(JobsInfo et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<JobsInfo> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<JobsInfo> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public JobsInfo getDraft(JobsInfo et) {
return et;
}
@Override
@Transactional
public boolean remove(BigInteger key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<BigInteger> idList) {
removeByIds(idList);
}
@Override
@Transactional
public JobsInfo get(BigInteger key) {
JobsInfo et = getById(key);
if(et==null){
et=new JobsInfo();
et.setId(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean create(JobsInfo et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void createBatch(List<JobsInfo> list) {
this.saveBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<JobsInfo> searchDefault(JobsInfoSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<JobsInfo> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<JobsInfo>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
package cn.ibizlab.core.task.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.task.domain.JobsLock;
import cn.ibizlab.core.task.filter.JobsLockSearchContext;
import cn.ibizlab.core.task.service.IJobsLockService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.task.mapper.JobsLockMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[任务锁] 服务对象接口实现
*/
@Slf4j
@Service("JobsLockServiceImpl")
public class JobsLockServiceImpl extends ServiceImpl<JobsLockMapper, JobsLock> implements IJobsLockService {
private int batchSize = 500;
@Override
@Transactional
public boolean create(JobsLock et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void createBatch(List<JobsLock> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean save(JobsLock et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(JobsLock et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<JobsLock> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<JobsLock> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public JobsLock get(BigInteger key) {
JobsLock et = getById(key);
if(et==null){
et=new JobsLock();
et.setId(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean update(JobsLock et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("id",et.getId())))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void updateBatch(List<JobsLock> list) {
updateBatchById(list,batchSize);
}
@Override
public boolean checkKey(JobsLock et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean remove(BigInteger key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<BigInteger> idList) {
removeByIds(idList);
}
@Override
public JobsLock getDraft(JobsLock et) {
return et;
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<JobsLock> searchDefault(JobsLockSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<JobsLock> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<JobsLock>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
package cn.ibizlab.core.task.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.task.domain.JobsLog;
import cn.ibizlab.core.task.filter.JobsLogSearchContext;
import cn.ibizlab.core.task.service.IJobsLogService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.task.mapper.JobsLogMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[任务调度日志] 服务对象接口实现
*/
@Slf4j
@Service("JobsLogServiceImpl")
public class JobsLogServiceImpl extends ServiceImpl<JobsLogMapper, JobsLog> implements IJobsLogService {
private int batchSize = 500;
@Override
public JobsLog getDraft(JobsLog et) {
return et;
}
@Override
@Transactional
public boolean update(JobsLog et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("id",et.getId())))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void updateBatch(List<JobsLog> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean create(JobsLog et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void createBatch(List<JobsLog> list) {
this.saveBatch(list,batchSize);
}
@Override
public boolean checkKey(JobsLog et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(JobsLog et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(JobsLog et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<JobsLog> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<JobsLog> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean remove(BigInteger key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<BigInteger> idList) {
removeByIds(idList);
}
@Override
@Transactional
public JobsLog get(BigInteger key) {
JobsLog et = getById(key);
if(et==null){
et=new JobsLog();
et.setId(key);
}
else{
}
return et;
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<JobsLog> searchDefault(JobsLogSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<JobsLog> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<JobsLog>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
package cn.ibizlab.core.task.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.task.domain.JobsRegistry;
import cn.ibizlab.core.task.filter.JobsRegistrySearchContext;
import cn.ibizlab.core.task.service.IJobsRegistryService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.task.mapper.JobsRegistryMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[任务注册信息] 服务对象接口实现
*/
@Slf4j
@Service("JobsRegistryServiceImpl")
public class JobsRegistryServiceImpl extends ServiceImpl<JobsRegistryMapper, JobsRegistry> implements IJobsRegistryService {
private int batchSize = 500;
@Override
@Transactional
public JobsRegistry get(BigInteger key) {
JobsRegistry et = getById(key);
if(et==null){
et=new JobsRegistry();
et.setId(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean remove(BigInteger key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<BigInteger> idList) {
removeByIds(idList);
}
@Override
@Transactional
public boolean update(JobsRegistry et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("id",et.getId())))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void updateBatch(List<JobsRegistry> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean save(JobsRegistry et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(JobsRegistry et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<JobsRegistry> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<JobsRegistry> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean create(JobsRegistry et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void createBatch(List<JobsRegistry> list) {
this.saveBatch(list,batchSize);
}
@Override
public boolean checkKey(JobsRegistry et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
public JobsRegistry getDraft(JobsRegistry et) {
return et;
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<JobsRegistry> searchDefault(JobsRegistrySearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<JobsRegistry> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<JobsRegistry>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
......@@ -4,7 +4,7 @@
<!--输出实体[JOBS_INFO]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-jobs_info-41-1">
<changeSet author="a_A_5d9d78509" id="tab-jobs_info-43-1">
<createTable tableName="JOBS_INFO">
<column name="ID" remarks="" type="BIGINT">
<constraints primaryKey="true" primaryKeyName="PK_JOBS_INFO_ID"/>
......@@ -42,7 +42,7 @@
<!--输出实体[JOBS_REGISTRY]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-jobs_registry-13-2">
<changeSet author="a_A_5d9d78509" id="tab-jobs_registry-15-2">
<createTable tableName="JOBS_REGISTRY">
<column name="ID" remarks="" type="BIGINT">
<constraints primaryKey="true" primaryKeyName="PK_JOBS_REGISTRY_ID"/>
......@@ -60,7 +60,7 @@
<!--输出实体[JOBS_LOCK]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-jobs_lock-8-3">
<changeSet author="a_A_5d9d78509" id="tab-jobs_lock-10-3">
<createTable tableName="JOBS_LOCK">
<column name="ID" remarks="" type="BIGINT">
<constraints primaryKey="true" primaryKeyName="PK_JOBS_LOCK_ID"/>
......@@ -72,7 +72,7 @@
<!--输出实体[JOBS_LOG]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-jobs_log-25-4">
<changeSet author="a_A_5d9d78509" id="tab-jobs_log-28-4">
<createTable tableName="JOBS_LOG">
<column name="ID" remarks="" type="BIGINT">
<constraints primaryKey="true" primaryKeyName="PK_JOBS_LOG_ID"/>
......@@ -91,7 +91,7 @@
</column>
<column name="TRIGGER_TYPE" remarks="" type="VARCHAR(30)">
</column>
<column name="TRIGGER_MSG" remarks="" type="TEXT(9999999)">
<column name="TRIGGER_MSG" remarks="" type="TEXT(1048576)">
</column>
<column name="CREATE_TIME" remarks="" type="BIGINT">
</column>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.task.mapper.JobsInfoMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="JobsInfoResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`APP`, t1.`AUTHOR`, t1.`CREATE_TIME`, t1.`CRON`, t1.`FAIL_RETRY_COUNT`, t1.`HANDLER`, t1.`ID`, t1.`LAST_TIME`, t1.`NEXT_TIME`, t1.`PARAM`, t1.`REMARK`, t1.`STATUS`, t1.`TENANT_ID`, t1.`TIMEOUT`, t1.`UPDATE_TIME` FROM `JOBS_INFO` t1 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="JobsInfoResultMap" type="cn.ibizlab.core.task.domain.JobsInfo" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
<result property="tenantId" column="tenant_id" />
<result property="failRetryCount" column="fail_retry_count" />
<result property="lastTime" column="last_time" />
<result property="nextTime" column="next_time" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" />
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.task.filter.JobsInfoSearchContext" resultMap="JobsInfoResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`APP`, t1.`AUTHOR`, t1.`CREATE_TIME`, t1.`CRON`, t1.`FAIL_RETRY_COUNT`, t1.`HANDLER`, t1.`ID`, t1.`LAST_TIME`, t1.`NEXT_TIME`, t1.`PARAM`, t1.`REMARK`, t1.`STATUS`, t1.`TENANT_ID`, t1.`TIMEOUT`, t1.`UPDATE_TIME` FROM `JOBS_INFO` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`APP`, t1.`AUTHOR`, t1.`CREATE_TIME`, t1.`CRON`, t1.`FAIL_RETRY_COUNT`, t1.`HANDLER`, t1.`ID`, t1.`LAST_TIME`, t1.`NEXT_TIME`, t1.`PARAM`, t1.`REMARK`, t1.`STATUS`, t1.`TENANT_ID`, t1.`TIMEOUT`, t1.`UPDATE_TIME` FROM `JOBS_INFO` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.task.mapper.JobsLockMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="JobsLockResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATE_TIME`, t1.`ID` FROM `JOBS_LOCK` t1 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="JobsLockResultMap" type="cn.ibizlab.core.task.domain.JobsLock" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
<result property="createTime" column="create_time" />
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.task.filter.JobsLockSearchContext" resultMap="JobsLockResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATE_TIME`, t1.`ID` FROM `JOBS_LOCK` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATE_TIME`, t1.`ID` FROM `JOBS_LOCK` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.task.mapper.JobsLogMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="JobsLogResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ADDRESS`, t1.`CREATE_TIME`, t1.`FAIL_RETRY_COUNT`, t1.`HANDLER`, t1.`ID`, t1.`JOB_ID`, t1.`PARAM`, t1.`TRIGGER_CODE`, t1.`TRIGGER_MSG`, t1.`TRIGGER_TYPE` FROM `JOBS_LOG` t1 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="JobsLogResultMap" type="cn.ibizlab.core.task.domain.JobsLog" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
<result property="jobId" column="job_id" />
<result property="failRetryCount" column="fail_retry_count" />
<result property="triggerCode" column="trigger_code" />
<result property="triggerType" column="trigger_type" />
<result property="triggerMsg" column="trigger_msg" />
<result property="createTime" column="create_time" />
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.task.filter.JobsLogSearchContext" resultMap="JobsLogResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ADDRESS`, t1.`CREATE_TIME`, t1.`FAIL_RETRY_COUNT`, t1.`HANDLER`, t1.`ID`, t1.`JOB_ID`, t1.`PARAM`, t1.`TRIGGER_CODE`, t1.`TRIGGER_TYPE` FROM `JOBS_LOG` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ADDRESS`, t1.`CREATE_TIME`, t1.`FAIL_RETRY_COUNT`, t1.`HANDLER`, t1.`ID`, t1.`JOB_ID`, t1.`PARAM`, t1.`TRIGGER_CODE`, t1.`TRIGGER_MSG`, t1.`TRIGGER_TYPE` FROM `JOBS_LOG` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.task.mapper.JobsRegistryMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="JobsRegistryResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ADDRESS`, t1.`APP`, t1.`ID`, t1.`STATUS`, t1.`UPDATE_TIME` FROM `JOBS_REGISTRY` t1 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="JobsRegistryResultMap" type="cn.ibizlab.core.task.domain.JobsRegistry" autoMapping="true">
<id property="id" column="id" /><!--主键字段映射-->
<result property="updateTime" column="update_time" />
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.task.filter.JobsRegistrySearchContext" resultMap="JobsRegistryResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ADDRESS`, t1.`APP`, t1.`ID`, t1.`STATUS`, t1.`UPDATE_TIME` FROM `JOBS_REGISTRY` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ADDRESS`, t1.`APP`, t1.`ID`, t1.`STATUS`, t1.`UPDATE_TIME` FROM `JOBS_REGISTRY` t1
]]>
</sql>
</mapper>
......@@ -4,7 +4,7 @@
],
"entities":[
{
"dename":"JOBInfo",
"dename":"JobsInfo",
"delogicname":"任务信息",
"sysmoudle":{"id":"TASK","name":"task"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
......@@ -12,7 +12,7 @@
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
"dename":"JOBLog",
"dename":"JobsLog",
"delogicname":"任务调度日志",
"sysmoudle":{"id":"TASK","name":"task"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
......@@ -20,7 +20,7 @@
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
"dename":"JOBLock",
"dename":"JobsLock",
"delogicname":"任务锁",
"sysmoudle":{"id":"TASK","name":"task"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
......@@ -28,7 +28,7 @@
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
"dename":"JOBRegistry",
"dename":"JobsRegistry",
"delogicname":"任务注册信息",
"sysmoudle":{"id":"TASK","name":"task"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
......
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[JobsInfoDTO]
*/
@Data
public class JobsInfoDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [ID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
private BigInteger id;
/**
* 属性 [TENANT_ID]
*
*/
@JSONField(name = "tenant_id")
@JsonProperty("tenant_id")
private String tenantId;
/**
* 属性 [APP]
*
*/
@JSONField(name = "app")
@JsonProperty("app")
private String app;
/**
* 属性 [CRON]
*
*/
@JSONField(name = "cron")
@JsonProperty("cron")
private String cron;
/**
* 属性 [HANDLER]
*
*/
@JSONField(name = "handler")
@JsonProperty("handler")
private String handler;
/**
* 属性 [PARAM]
*
*/
@JSONField(name = "param")
@JsonProperty("param")
private String param;
/**
* 属性 [TIMEOUT]
*
*/
@JSONField(name = "timeout")
@JsonProperty("timeout")
private Integer timeout;
/**
* 属性 [FAIL_RETRY_COUNT]
*
*/
@JSONField(name = "fail_retry_count")
@JsonProperty("fail_retry_count")
private Integer failRetryCount;
/**
* 属性 [LAST_TIME]
*
*/
@JSONField(name = "last_time")
@JsonProperty("last_time")
private BigInteger lastTime;
/**
* 属性 [NEXT_TIME]
*
*/
@JSONField(name = "next_time")
@JsonProperty("next_time")
private BigInteger nextTime;
/**
* 属性 [AUTHOR]
*
*/
@JSONField(name = "author")
@JsonProperty("author")
private String author;
/**
* 属性 [REMARK]
*
*/
@JSONField(name = "remark")
@JsonProperty("remark")
private String remark;
/**
* 属性 [STATUS]
*
*/
@JSONField(name = "status")
@JsonProperty("status")
private Integer status;
/**
* 属性 [UPDATE_TIME]
*
*/
@JSONField(name = "update_time")
@JsonProperty("update_time")
private BigInteger updateTime;
/**
* 属性 [CREATE_TIME]
*
*/
@JSONField(name = "create_time")
@JsonProperty("create_time")
private BigInteger createTime;
/**
* 设置 [TENANT_ID]
*/
public void setTenantId(String tenantId){
this.tenantId = tenantId ;
this.modify("tenant_id",tenantId);
}
/**
* 设置 [APP]
*/
public void setApp(String app){
this.app = app ;
this.modify("app",app);
}
/**
* 设置 [CRON]
*/
public void setCron(String cron){
this.cron = cron ;
this.modify("cron",cron);
}
/**
* 设置 [HANDLER]
*/
public void setHandler(String handler){
this.handler = handler ;
this.modify("handler",handler);
}
/**
* 设置 [PARAM]
*/
public void setParam(String param){
this.param = param ;
this.modify("param",param);
}
/**
* 设置 [TIMEOUT]
*/
public void setTimeout(Integer timeout){
this.timeout = timeout ;
this.modify("timeout",timeout);
}
/**
* 设置 [FAIL_RETRY_COUNT]
*/
public void setFailRetryCount(Integer failRetryCount){
this.failRetryCount = failRetryCount ;
this.modify("fail_retry_count",failRetryCount);
}
/**
* 设置 [LAST_TIME]
*/
public void setLastTime(BigInteger lastTime){
this.lastTime = lastTime ;
this.modify("last_time",lastTime);
}
/**
* 设置 [NEXT_TIME]
*/
public void setNextTime(BigInteger nextTime){
this.nextTime = nextTime ;
this.modify("next_time",nextTime);
}
/**
* 设置 [AUTHOR]
*/
public void setAuthor(String author){
this.author = author ;
this.modify("author",author);
}
/**
* 设置 [REMARK]
*/
public void setRemark(String remark){
this.remark = remark ;
this.modify("remark",remark);
}
/**
* 设置 [STATUS]
*/
public void setStatus(Integer status){
this.status = status ;
this.modify("status",status);
}
/**
* 设置 [UPDATE_TIME]
*/
public void setUpdateTime(BigInteger updateTime){
this.updateTime = updateTime ;
this.modify("update_time",updateTime);
}
/**
* 设置 [CREATE_TIME]
*/
public void setCreateTime(BigInteger createTime){
this.createTime = createTime ;
this.modify("create_time",createTime);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[JobsLockDTO]
*/
@Data
public class JobsLockDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [ID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
private BigInteger id;
/**
* 属性 [CREATE_TIME]
*
*/
@JSONField(name = "create_time")
@JsonProperty("create_time")
private BigInteger createTime;
/**
* 设置 [CREATE_TIME]
*/
public void setCreateTime(BigInteger createTime){
this.createTime = createTime ;
this.modify("create_time",createTime);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[JobsLogDTO]
*/
@Data
public class JobsLogDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [ID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
private BigInteger id;
/**
* 属性 [JOB_ID]
*
*/
@JSONField(name = "job_id")
@JsonProperty("job_id")
private BigInteger jobId;
/**
* 属性 [ADDRESS]
*
*/
@JSONField(name = "address")
@JsonProperty("address")
private String address;
/**
* 属性 [HANDLER]
*
*/
@JSONField(name = "handler")
@JsonProperty("handler")
private String handler;
/**
* 属性 [PARAM]
*
*/
@JSONField(name = "param")
@JsonProperty("param")
private String param;
/**
* 属性 [FAIL_RETRY_COUNT]
*
*/
@JSONField(name = "fail_retry_count")
@JsonProperty("fail_retry_count")
private Integer failRetryCount;
/**
* 属性 [TRIGGER_CODE]
*
*/
@JSONField(name = "trigger_code")
@JsonProperty("trigger_code")
private Integer triggerCode;
/**
* 属性 [TRIGGER_TYPE]
*
*/
@JSONField(name = "trigger_type")
@JsonProperty("trigger_type")
private String triggerType;
/**
* 属性 [TRIGGER_MSG]
*
*/
@JSONField(name = "trigger_msg")
@JsonProperty("trigger_msg")
private String triggerMsg;
/**
* 属性 [CREATE_TIME]
*
*/
@JSONField(name = "create_time")
@JsonProperty("create_time")
private BigInteger createTime;
/**
* 设置 [JOB_ID]
*/
public void setJobId(BigInteger jobId){
this.jobId = jobId ;
this.modify("job_id",jobId);
}
/**
* 设置 [ADDRESS]
*/
public void setAddress(String address){
this.address = address ;
this.modify("address",address);
}
/**
* 设置 [HANDLER]
*/
public void setHandler(String handler){
this.handler = handler ;
this.modify("handler",handler);
}
/**
* 设置 [PARAM]
*/
public void setParam(String param){
this.param = param ;
this.modify("param",param);
}
/**
* 设置 [FAIL_RETRY_COUNT]
*/
public void setFailRetryCount(Integer failRetryCount){
this.failRetryCount = failRetryCount ;
this.modify("fail_retry_count",failRetryCount);
}
/**
* 设置 [TRIGGER_CODE]
*/
public void setTriggerCode(Integer triggerCode){
this.triggerCode = triggerCode ;
this.modify("trigger_code",triggerCode);
}
/**
* 设置 [TRIGGER_TYPE]
*/
public void setTriggerType(String triggerType){
this.triggerType = triggerType ;
this.modify("trigger_type",triggerType);
}
/**
* 设置 [TRIGGER_MSG]
*/
public void setTriggerMsg(String triggerMsg){
this.triggerMsg = triggerMsg ;
this.modify("trigger_msg",triggerMsg);
}
/**
* 设置 [CREATE_TIME]
*/
public void setCreateTime(BigInteger createTime){
this.createTime = createTime ;
this.modify("create_time",createTime);
}
}
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[JobsRegistryDTO]
*/
@Data
public class JobsRegistryDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [ID]
*
*/
@JSONField(name = "id")
@JsonProperty("id")
private BigInteger id;
/**
* 属性 [APP]
*
*/
@JSONField(name = "app")
@JsonProperty("app")
private String app;
/**
* 属性 [ADDRESS]
*
*/
@JSONField(name = "address")
@JsonProperty("address")
private String address;
/**
* 属性 [STATUS]
*
*/
@JSONField(name = "status")
@JsonProperty("status")
private Integer status;
/**
* 属性 [UPDATE_TIME]
*
*/
@JSONField(name = "update_time")
@JsonProperty("update_time")
private BigInteger updateTime;
/**
* 设置 [APP]
*/
public void setApp(String app){
this.app = app ;
this.modify("app",app);
}
/**
* 设置 [ADDRESS]
*/
public void setAddress(String address){
this.address = address ;
this.modify("address",address);
}
/**
* 设置 [STATUS]
*/
public void setStatus(Integer status){
this.status = status ;
this.modify("status",status);
}
/**
* 设置 [UPDATE_TIME]
*/
public void setUpdateTime(BigInteger updateTime){
this.updateTime = updateTime ;
this.modify("update_time",updateTime);
}
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.task.domain.JobsInfo;
import cn.ibizlab.api.dto.JobsInfoDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface JobsInfoMapping extends MappingBase<JobsInfoDTO, JobsInfo> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.task.domain.JobsLock;
import cn.ibizlab.api.dto.JobsLockDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface JobsLockMapping extends MappingBase<JobsLockDTO, JobsLock> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.task.domain.JobsLog;
import cn.ibizlab.api.dto.JobsLogDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface JobsLogMapping extends MappingBase<JobsLogDTO, JobsLog> {
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.task.domain.JobsRegistry;
import cn.ibizlab.api.dto.JobsRegistryDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface JobsRegistryMapping extends MappingBase<JobsRegistryDTO, JobsRegistry> {
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.task.domain.JobsInfo;
import cn.ibizlab.core.task.service.IJobsInfoService;
import cn.ibizlab.core.task.filter.JobsInfoSearchContext;
@Slf4j
@Api(tags = {"任务信息" })
@RestController("api-jobsinfo")
@RequestMapping("")
public class JobsInfoResource {
@Autowired
public IJobsInfoService jobsinfoService;
@Autowired
@Lazy
public JobsInfoMapping jobsinfoMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Update-all')")
@ApiOperation(value = "更新任务信息", tags = {"任务信息" }, notes = "更新任务信息")
@RequestMapping(method = RequestMethod.PUT, value = "/jobsinfos/{jobsinfo_id}")
@Transactional
public ResponseEntity<JobsInfoDTO> update(@PathVariable("jobsinfo_id") BigInteger jobsinfo_id, @RequestBody JobsInfoDTO jobsinfodto) {
JobsInfo domain = jobsinfoMapping.toDomain(jobsinfodto);
domain .setId(jobsinfo_id);
jobsinfoService.update(domain );
JobsInfoDTO dto = jobsinfoMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Update-all')")
@ApiOperation(value = "批量更新任务信息", tags = {"任务信息" }, notes = "批量更新任务信息")
@RequestMapping(method = RequestMethod.PUT, value = "/jobsinfos/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<JobsInfoDTO> jobsinfodtos) {
jobsinfoService.updateBatch(jobsinfoMapping.toDomain(jobsinfodtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查任务信息", tags = {"任务信息" }, notes = "检查任务信息")
@RequestMapping(method = RequestMethod.POST, value = "/jobsinfos/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody JobsInfoDTO jobsinfodto) {
return ResponseEntity.status(HttpStatus.OK).body(jobsinfoService.checkKey(jobsinfoMapping.toDomain(jobsinfodto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Save-all')")
@ApiOperation(value = "保存任务信息", tags = {"任务信息" }, notes = "保存任务信息")
@RequestMapping(method = RequestMethod.POST, value = "/jobsinfos/save")
public ResponseEntity<Boolean> save(@RequestBody JobsInfoDTO jobsinfodto) {
return ResponseEntity.status(HttpStatus.OK).body(jobsinfoService.save(jobsinfoMapping.toDomain(jobsinfodto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Save-all')")
@ApiOperation(value = "批量保存任务信息", tags = {"任务信息" }, notes = "批量保存任务信息")
@RequestMapping(method = RequestMethod.POST, value = "/jobsinfos/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<JobsInfoDTO> jobsinfodtos) {
jobsinfoService.saveBatch(jobsinfoMapping.toDomain(jobsinfodtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取任务信息草稿", tags = {"任务信息" }, notes = "获取任务信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/jobsinfos/getdraft")
public ResponseEntity<JobsInfoDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(jobsinfoMapping.toDto(jobsinfoService.getDraft(new JobsInfo())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Remove-all')")
@ApiOperation(value = "删除任务信息", tags = {"任务信息" }, notes = "删除任务信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/jobsinfos/{jobsinfo_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("jobsinfo_id") BigInteger jobsinfo_id) {
return ResponseEntity.status(HttpStatus.OK).body(jobsinfoService.remove(jobsinfo_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Remove-all')")
@ApiOperation(value = "批量删除任务信息", tags = {"任务信息" }, notes = "批量删除任务信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/jobsinfos/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<BigInteger> ids) {
jobsinfoService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Get-all')")
@ApiOperation(value = "获取任务信息", tags = {"任务信息" }, notes = "获取任务信息")
@RequestMapping(method = RequestMethod.GET, value = "/jobsinfos/{jobsinfo_id}")
public ResponseEntity<JobsInfoDTO> get(@PathVariable("jobsinfo_id") BigInteger jobsinfo_id) {
JobsInfo domain = jobsinfoService.get(jobsinfo_id);
JobsInfoDTO dto = jobsinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Create-all')")
@ApiOperation(value = "新建任务信息", tags = {"任务信息" }, notes = "新建任务信息")
@RequestMapping(method = RequestMethod.POST, value = "/jobsinfos")
@Transactional
public ResponseEntity<JobsInfoDTO> create(@RequestBody JobsInfoDTO jobsinfodto) {
JobsInfo domain = jobsinfoMapping.toDomain(jobsinfodto);
jobsinfoService.create(domain);
JobsInfoDTO dto = jobsinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Create-all')")
@ApiOperation(value = "批量新建任务信息", tags = {"任务信息" }, notes = "批量新建任务信息")
@RequestMapping(method = RequestMethod.POST, value = "/jobsinfos/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<JobsInfoDTO> jobsinfodtos) {
jobsinfoService.createBatch(jobsinfoMapping.toDomain(jobsinfodtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Default-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"任务信息" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/jobsinfos/fetchdefault")
public ResponseEntity<List<JobsInfoDTO>> fetchDefault(JobsInfoSearchContext context) {
Page<JobsInfo> domains = jobsinfoService.searchDefault(context) ;
List<JobsInfoDTO> list = jobsinfoMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsInfo-Default-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"任务信息" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/jobsinfos/searchdefault")
public ResponseEntity<Page<JobsInfoDTO>> searchDefault(@RequestBody JobsInfoSearchContext context) {
Page<JobsInfo> domains = jobsinfoService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(jobsinfoMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.task.domain.JobsLock;
import cn.ibizlab.core.task.service.IJobsLockService;
import cn.ibizlab.core.task.filter.JobsLockSearchContext;
@Slf4j
@Api(tags = {"任务锁" })
@RestController("api-jobslock")
@RequestMapping("")
public class JobsLockResource {
@Autowired
public IJobsLockService jobslockService;
@Autowired
@Lazy
public JobsLockMapping jobslockMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Create-all')")
@ApiOperation(value = "新建任务锁", tags = {"任务锁" }, notes = "新建任务锁")
@RequestMapping(method = RequestMethod.POST, value = "/jobslocks")
@Transactional
public ResponseEntity<JobsLockDTO> create(@RequestBody JobsLockDTO jobslockdto) {
JobsLock domain = jobslockMapping.toDomain(jobslockdto);
jobslockService.create(domain);
JobsLockDTO dto = jobslockMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Create-all')")
@ApiOperation(value = "批量新建任务锁", tags = {"任务锁" }, notes = "批量新建任务锁")
@RequestMapping(method = RequestMethod.POST, value = "/jobslocks/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<JobsLockDTO> jobslockdtos) {
jobslockService.createBatch(jobslockMapping.toDomain(jobslockdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Save-all')")
@ApiOperation(value = "保存任务锁", tags = {"任务锁" }, notes = "保存任务锁")
@RequestMapping(method = RequestMethod.POST, value = "/jobslocks/save")
public ResponseEntity<Boolean> save(@RequestBody JobsLockDTO jobslockdto) {
return ResponseEntity.status(HttpStatus.OK).body(jobslockService.save(jobslockMapping.toDomain(jobslockdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Save-all')")
@ApiOperation(value = "批量保存任务锁", tags = {"任务锁" }, notes = "批量保存任务锁")
@RequestMapping(method = RequestMethod.POST, value = "/jobslocks/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<JobsLockDTO> jobslockdtos) {
jobslockService.saveBatch(jobslockMapping.toDomain(jobslockdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Get-all')")
@ApiOperation(value = "获取任务锁", tags = {"任务锁" }, notes = "获取任务锁")
@RequestMapping(method = RequestMethod.GET, value = "/jobslocks/{jobslock_id}")
public ResponseEntity<JobsLockDTO> get(@PathVariable("jobslock_id") BigInteger jobslock_id) {
JobsLock domain = jobslockService.get(jobslock_id);
JobsLockDTO dto = jobslockMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Update-all')")
@ApiOperation(value = "更新任务锁", tags = {"任务锁" }, notes = "更新任务锁")
@RequestMapping(method = RequestMethod.PUT, value = "/jobslocks/{jobslock_id}")
@Transactional
public ResponseEntity<JobsLockDTO> update(@PathVariable("jobslock_id") BigInteger jobslock_id, @RequestBody JobsLockDTO jobslockdto) {
JobsLock domain = jobslockMapping.toDomain(jobslockdto);
domain .setId(jobslock_id);
jobslockService.update(domain );
JobsLockDTO dto = jobslockMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Update-all')")
@ApiOperation(value = "批量更新任务锁", tags = {"任务锁" }, notes = "批量更新任务锁")
@RequestMapping(method = RequestMethod.PUT, value = "/jobslocks/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<JobsLockDTO> jobslockdtos) {
jobslockService.updateBatch(jobslockMapping.toDomain(jobslockdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查任务锁", tags = {"任务锁" }, notes = "检查任务锁")
@RequestMapping(method = RequestMethod.POST, value = "/jobslocks/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody JobsLockDTO jobslockdto) {
return ResponseEntity.status(HttpStatus.OK).body(jobslockService.checkKey(jobslockMapping.toDomain(jobslockdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Remove-all')")
@ApiOperation(value = "删除任务锁", tags = {"任务锁" }, notes = "删除任务锁")
@RequestMapping(method = RequestMethod.DELETE, value = "/jobslocks/{jobslock_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("jobslock_id") BigInteger jobslock_id) {
return ResponseEntity.status(HttpStatus.OK).body(jobslockService.remove(jobslock_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Remove-all')")
@ApiOperation(value = "批量删除任务锁", tags = {"任务锁" }, notes = "批量删除任务锁")
@RequestMapping(method = RequestMethod.DELETE, value = "/jobslocks/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<BigInteger> ids) {
jobslockService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取任务锁草稿", tags = {"任务锁" }, notes = "获取任务锁草稿")
@RequestMapping(method = RequestMethod.GET, value = "/jobslocks/getdraft")
public ResponseEntity<JobsLockDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(jobslockMapping.toDto(jobslockService.getDraft(new JobsLock())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Default-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"任务锁" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/jobslocks/fetchdefault")
public ResponseEntity<List<JobsLockDTO>> fetchDefault(JobsLockSearchContext context) {
Page<JobsLock> domains = jobslockService.searchDefault(context) ;
List<JobsLockDTO> list = jobslockMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLock-Default-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"任务锁" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/jobslocks/searchdefault")
public ResponseEntity<Page<JobsLockDTO>> searchDefault(@RequestBody JobsLockSearchContext context) {
Page<JobsLock> domains = jobslockService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(jobslockMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.task.domain.JobsLog;
import cn.ibizlab.core.task.service.IJobsLogService;
import cn.ibizlab.core.task.filter.JobsLogSearchContext;
@Slf4j
@Api(tags = {"任务调度日志" })
@RestController("api-jobslog")
@RequestMapping("")
public class JobsLogResource {
@Autowired
public IJobsLogService jobslogService;
@Autowired
@Lazy
public JobsLogMapping jobslogMapping;
@ApiOperation(value = "获取任务调度日志草稿", tags = {"任务调度日志" }, notes = "获取任务调度日志草稿")
@RequestMapping(method = RequestMethod.GET, value = "/jobslogs/getdraft")
public ResponseEntity<JobsLogDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(jobslogMapping.toDto(jobslogService.getDraft(new JobsLog())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Update-all')")
@ApiOperation(value = "更新任务调度日志", tags = {"任务调度日志" }, notes = "更新任务调度日志")
@RequestMapping(method = RequestMethod.PUT, value = "/jobslogs/{jobslog_id}")
@Transactional
public ResponseEntity<JobsLogDTO> update(@PathVariable("jobslog_id") BigInteger jobslog_id, @RequestBody JobsLogDTO jobslogdto) {
JobsLog domain = jobslogMapping.toDomain(jobslogdto);
domain .setId(jobslog_id);
jobslogService.update(domain );
JobsLogDTO dto = jobslogMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Update-all')")
@ApiOperation(value = "批量更新任务调度日志", tags = {"任务调度日志" }, notes = "批量更新任务调度日志")
@RequestMapping(method = RequestMethod.PUT, value = "/jobslogs/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<JobsLogDTO> jobslogdtos) {
jobslogService.updateBatch(jobslogMapping.toDomain(jobslogdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Create-all')")
@ApiOperation(value = "新建任务调度日志", tags = {"任务调度日志" }, notes = "新建任务调度日志")
@RequestMapping(method = RequestMethod.POST, value = "/jobslogs")
@Transactional
public ResponseEntity<JobsLogDTO> create(@RequestBody JobsLogDTO jobslogdto) {
JobsLog domain = jobslogMapping.toDomain(jobslogdto);
jobslogService.create(domain);
JobsLogDTO dto = jobslogMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Create-all')")
@ApiOperation(value = "批量新建任务调度日志", tags = {"任务调度日志" }, notes = "批量新建任务调度日志")
@RequestMapping(method = RequestMethod.POST, value = "/jobslogs/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<JobsLogDTO> jobslogdtos) {
jobslogService.createBatch(jobslogMapping.toDomain(jobslogdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查任务调度日志", tags = {"任务调度日志" }, notes = "检查任务调度日志")
@RequestMapping(method = RequestMethod.POST, value = "/jobslogs/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody JobsLogDTO jobslogdto) {
return ResponseEntity.status(HttpStatus.OK).body(jobslogService.checkKey(jobslogMapping.toDomain(jobslogdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Save-all')")
@ApiOperation(value = "保存任务调度日志", tags = {"任务调度日志" }, notes = "保存任务调度日志")
@RequestMapping(method = RequestMethod.POST, value = "/jobslogs/save")
public ResponseEntity<Boolean> save(@RequestBody JobsLogDTO jobslogdto) {
return ResponseEntity.status(HttpStatus.OK).body(jobslogService.save(jobslogMapping.toDomain(jobslogdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Save-all')")
@ApiOperation(value = "批量保存任务调度日志", tags = {"任务调度日志" }, notes = "批量保存任务调度日志")
@RequestMapping(method = RequestMethod.POST, value = "/jobslogs/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<JobsLogDTO> jobslogdtos) {
jobslogService.saveBatch(jobslogMapping.toDomain(jobslogdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Remove-all')")
@ApiOperation(value = "删除任务调度日志", tags = {"任务调度日志" }, notes = "删除任务调度日志")
@RequestMapping(method = RequestMethod.DELETE, value = "/jobslogs/{jobslog_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("jobslog_id") BigInteger jobslog_id) {
return ResponseEntity.status(HttpStatus.OK).body(jobslogService.remove(jobslog_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Remove-all')")
@ApiOperation(value = "批量删除任务调度日志", tags = {"任务调度日志" }, notes = "批量删除任务调度日志")
@RequestMapping(method = RequestMethod.DELETE, value = "/jobslogs/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<BigInteger> ids) {
jobslogService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Get-all')")
@ApiOperation(value = "获取任务调度日志", tags = {"任务调度日志" }, notes = "获取任务调度日志")
@RequestMapping(method = RequestMethod.GET, value = "/jobslogs/{jobslog_id}")
public ResponseEntity<JobsLogDTO> get(@PathVariable("jobslog_id") BigInteger jobslog_id) {
JobsLog domain = jobslogService.get(jobslog_id);
JobsLogDTO dto = jobslogMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Default-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"任务调度日志" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/jobslogs/fetchdefault")
public ResponseEntity<List<JobsLogDTO>> fetchDefault(JobsLogSearchContext context) {
Page<JobsLog> domains = jobslogService.searchDefault(context) ;
List<JobsLogDTO> list = jobslogMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsLog-Default-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"任务调度日志" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/jobslogs/searchdefault")
public ResponseEntity<Page<JobsLogDTO>> searchDefault(@RequestBody JobsLogSearchContext context) {
Page<JobsLog> domains = jobslogService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(jobslogMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.task.domain.JobsRegistry;
import cn.ibizlab.core.task.service.IJobsRegistryService;
import cn.ibizlab.core.task.filter.JobsRegistrySearchContext;
@Slf4j
@Api(tags = {"任务注册信息" })
@RestController("api-jobsregistry")
@RequestMapping("")
public class JobsRegistryResource {
@Autowired
public IJobsRegistryService jobsregistryService;
@Autowired
@Lazy
public JobsRegistryMapping jobsregistryMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Get-all')")
@ApiOperation(value = "获取任务注册信息", tags = {"任务注册信息" }, notes = "获取任务注册信息")
@RequestMapping(method = RequestMethod.GET, value = "/jobsregistries/{jobsregistry_id}")
public ResponseEntity<JobsRegistryDTO> get(@PathVariable("jobsregistry_id") BigInteger jobsregistry_id) {
JobsRegistry domain = jobsregistryService.get(jobsregistry_id);
JobsRegistryDTO dto = jobsregistryMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Remove-all')")
@ApiOperation(value = "删除任务注册信息", tags = {"任务注册信息" }, notes = "删除任务注册信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/jobsregistries/{jobsregistry_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("jobsregistry_id") BigInteger jobsregistry_id) {
return ResponseEntity.status(HttpStatus.OK).body(jobsregistryService.remove(jobsregistry_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Remove-all')")
@ApiOperation(value = "批量删除任务注册信息", tags = {"任务注册信息" }, notes = "批量删除任务注册信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/jobsregistries/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<BigInteger> ids) {
jobsregistryService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Update-all')")
@ApiOperation(value = "更新任务注册信息", tags = {"任务注册信息" }, notes = "更新任务注册信息")
@RequestMapping(method = RequestMethod.PUT, value = "/jobsregistries/{jobsregistry_id}")
@Transactional
public ResponseEntity<JobsRegistryDTO> update(@PathVariable("jobsregistry_id") BigInteger jobsregistry_id, @RequestBody JobsRegistryDTO jobsregistrydto) {
JobsRegistry domain = jobsregistryMapping.toDomain(jobsregistrydto);
domain .setId(jobsregistry_id);
jobsregistryService.update(domain );
JobsRegistryDTO dto = jobsregistryMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Update-all')")
@ApiOperation(value = "批量更新任务注册信息", tags = {"任务注册信息" }, notes = "批量更新任务注册信息")
@RequestMapping(method = RequestMethod.PUT, value = "/jobsregistries/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<JobsRegistryDTO> jobsregistrydtos) {
jobsregistryService.updateBatch(jobsregistryMapping.toDomain(jobsregistrydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Save-all')")
@ApiOperation(value = "保存任务注册信息", tags = {"任务注册信息" }, notes = "保存任务注册信息")
@RequestMapping(method = RequestMethod.POST, value = "/jobsregistries/save")
public ResponseEntity<Boolean> save(@RequestBody JobsRegistryDTO jobsregistrydto) {
return ResponseEntity.status(HttpStatus.OK).body(jobsregistryService.save(jobsregistryMapping.toDomain(jobsregistrydto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Save-all')")
@ApiOperation(value = "批量保存任务注册信息", tags = {"任务注册信息" }, notes = "批量保存任务注册信息")
@RequestMapping(method = RequestMethod.POST, value = "/jobsregistries/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<JobsRegistryDTO> jobsregistrydtos) {
jobsregistryService.saveBatch(jobsregistryMapping.toDomain(jobsregistrydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Create-all')")
@ApiOperation(value = "新建任务注册信息", tags = {"任务注册信息" }, notes = "新建任务注册信息")
@RequestMapping(method = RequestMethod.POST, value = "/jobsregistries")
@Transactional
public ResponseEntity<JobsRegistryDTO> create(@RequestBody JobsRegistryDTO jobsregistrydto) {
JobsRegistry domain = jobsregistryMapping.toDomain(jobsregistrydto);
jobsregistryService.create(domain);
JobsRegistryDTO dto = jobsregistryMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Create-all')")
@ApiOperation(value = "批量新建任务注册信息", tags = {"任务注册信息" }, notes = "批量新建任务注册信息")
@RequestMapping(method = RequestMethod.POST, value = "/jobsregistries/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<JobsRegistryDTO> jobsregistrydtos) {
jobsregistryService.createBatch(jobsregistryMapping.toDomain(jobsregistrydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查任务注册信息", tags = {"任务注册信息" }, notes = "检查任务注册信息")
@RequestMapping(method = RequestMethod.POST, value = "/jobsregistries/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody JobsRegistryDTO jobsregistrydto) {
return ResponseEntity.status(HttpStatus.OK).body(jobsregistryService.checkKey(jobsregistryMapping.toDomain(jobsregistrydto)));
}
@ApiOperation(value = "获取任务注册信息草稿", tags = {"任务注册信息" }, notes = "获取任务注册信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/jobsregistries/getdraft")
public ResponseEntity<JobsRegistryDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(jobsregistryMapping.toDto(jobsregistryService.getDraft(new JobsRegistry())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Default-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"任务注册信息" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/jobsregistries/fetchdefault")
public ResponseEntity<List<JobsRegistryDTO>> fetchDefault(JobsRegistrySearchContext context) {
Page<JobsRegistry> domains = jobsregistryService.searchDefault(context) ;
List<JobsRegistryDTO> list = jobsregistryMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibztask-JobsRegistry-Default-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"任务注册信息" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/jobsregistries/searchdefault")
public ResponseEntity<Page<JobsRegistryDTO>> searchDefault(@RequestBody JobsRegistrySearchContext context) {
Page<JobsRegistry> domains = jobsregistryService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(jobsregistryMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册