提交 909c68f3 编写于 作者: ibizdev's avatar ibizdev

jackwang 部署微服务应用

上级 437fe570
...@@ -39,7 +39,13 @@ export class AuthServiceRegister { ...@@ -39,7 +39,13 @@ export class AuthServiceRegister {
* @memberof AuthServiceRegister * @memberof AuthServiceRegister
*/ */
protected init(): void { protected init(): void {
this.allAuthService.set('hremployee', () => import('@/authservice/hremployee/hremployee-auth-service')); this.allAuthService.set('hroperationunit', () => import('@/authservice/hroperation-unit/hroperation-unit-auth-service'));
this.allAuthService.set('hromhierarchypurposeref', () => import('@/authservice/hromhierarchy-purpose-ref/hromhierarchy-purpose-ref-auth-service'));
this.allAuthService.set('hromhierarchycat', () => import('@/authservice/hromhierarchy-cat/hromhierarchy-cat-auth-service'));
this.allAuthService.set('hremployee', () => import('@/authservice/hremployee/hremployee-auth-service'));
this.allAuthService.set('hromhierarchypurpose', () => import('@/authservice/hromhierarchypurpose/hromhierarchypurpose-auth-service'));
this.allAuthService.set('hromhierarchy', () => import('@/authservice/hromhierarchy/hromhierarchy-auth-service'));
this.allAuthService.set('hrorganization', () => import('@/authservice/hrorganization/hrorganization-auth-service'));
} }
/** /**
......
import AuthService from '../auth-service';
/**
* 结构层次类别权限服务对象基类
*
* @export
* @class HROMHierarchyCatAuthServiceBase
* @extends {AuthService}
*/
export default class HROMHierarchyCatAuthServiceBase extends AuthService {
/**
* Creates an instance of HROMHierarchyCatAuthServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyCatAuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof HROMHierarchyCatAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
return curDefaultOPPrivs;
}
}
\ No newline at end of file
import HROMHierarchyCatAuthServiceBase from './hromhierarchy-cat-auth-service-base';
/**
* 结构层次类别权限服务对象
*
* @export
* @class HROMHierarchyCatAuthService
* @extends {HROMHierarchyCatAuthServiceBase}
*/
export default class HROMHierarchyCatAuthService extends HROMHierarchyCatAuthServiceBase {
/**
* Creates an instance of HROMHierarchyCatAuthService.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyCatAuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import AuthService from '../auth-service';
/**
* 组织层次结构分配权限服务对象基类
*
* @export
* @class HROMHierarchyPurposeRefAuthServiceBase
* @extends {AuthService}
*/
export default class HROMHierarchyPurposeRefAuthServiceBase extends AuthService {
/**
* Creates an instance of HROMHierarchyPurposeRefAuthServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyPurposeRefAuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof HROMHierarchyPurposeRefAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
return curDefaultOPPrivs;
}
}
\ No newline at end of file
import HROMHierarchyPurposeRefAuthServiceBase from './hromhierarchy-purpose-ref-auth-service-base';
/**
* 组织层次结构分配权限服务对象
*
* @export
* @class HROMHierarchyPurposeRefAuthService
* @extends {HROMHierarchyPurposeRefAuthServiceBase}
*/
export default class HROMHierarchyPurposeRefAuthService extends HROMHierarchyPurposeRefAuthServiceBase {
/**
* Creates an instance of HROMHierarchyPurposeRefAuthService.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyPurposeRefAuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import AuthService from '../auth-service';
/**
* 组织层次结构权限服务对象基类
*
* @export
* @class HROMHierarchyAuthServiceBase
* @extends {AuthService}
*/
export default class HROMHierarchyAuthServiceBase extends AuthService {
/**
* Creates an instance of HROMHierarchyAuthServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyAuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof HROMHierarchyAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
return curDefaultOPPrivs;
}
}
\ No newline at end of file
import HROMHierarchyAuthServiceBase from './hromhierarchy-auth-service-base';
/**
* 组织层次结构权限服务对象
*
* @export
* @class HROMHierarchyAuthService
* @extends {HROMHierarchyAuthServiceBase}
*/
export default class HROMHierarchyAuthService extends HROMHierarchyAuthServiceBase {
/**
* Creates an instance of HROMHierarchyAuthService.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyAuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import AuthService from '../auth-service';
/**
* 组织层次结构应用权限服务对象基类
*
* @export
* @class HROMHIERARCHYPURPOSEAuthServiceBase
* @extends {AuthService}
*/
export default class HROMHIERARCHYPURPOSEAuthServiceBase extends AuthService {
/**
* Creates an instance of HROMHIERARCHYPURPOSEAuthServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHIERARCHYPURPOSEAuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof HROMHIERARCHYPURPOSEAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
return curDefaultOPPrivs;
}
}
\ No newline at end of file
import HROMHIERARCHYPURPOSEAuthServiceBase from './hromhierarchypurpose-auth-service-base';
/**
* 组织层次结构应用权限服务对象
*
* @export
* @class HROMHIERARCHYPURPOSEAuthService
* @extends {HROMHIERARCHYPURPOSEAuthServiceBase}
*/
export default class HROMHIERARCHYPURPOSEAuthService extends HROMHIERARCHYPURPOSEAuthServiceBase {
/**
* Creates an instance of HROMHIERARCHYPURPOSEAuthService.
*
* @param {*} [opts={}]
* @memberof HROMHIERARCHYPURPOSEAuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import AuthService from '../auth-service';
/**
* 运营单位权限服务对象基类
*
* @export
* @class HROperationUnitAuthServiceBase
* @extends {AuthService}
*/
export default class HROperationUnitAuthServiceBase extends AuthService {
/**
* Creates an instance of HROperationUnitAuthServiceBase.
*
* @param {*} [opts={}]
* @memberof HROperationUnitAuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof HROperationUnitAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
return curDefaultOPPrivs;
}
}
\ No newline at end of file
import HROperationUnitAuthServiceBase from './hroperation-unit-auth-service-base';
/**
* 运营单位权限服务对象
*
* @export
* @class HROperationUnitAuthService
* @extends {HROperationUnitAuthServiceBase}
*/
export default class HROperationUnitAuthService extends HROperationUnitAuthServiceBase {
/**
* Creates an instance of HROperationUnitAuthService.
*
* @param {*} [opts={}]
* @memberof HROperationUnitAuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import AuthService from '../auth-service';
/**
* 组织权限服务对象基类
*
* @export
* @class HROrganizationAuthServiceBase
* @extends {AuthService}
*/
export default class HROrganizationAuthServiceBase extends AuthService {
/**
* Creates an instance of HROrganizationAuthServiceBase.
*
* @param {*} [opts={}]
* @memberof HROrganizationAuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof HROrganizationAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
return curDefaultOPPrivs;
}
}
\ No newline at end of file
import HROrganizationAuthServiceBase from './hrorganization-auth-service-base';
/**
* 组织权限服务对象
*
* @export
* @class HROrganizationAuthService
* @extends {HROrganizationAuthServiceBase}
*/
export default class HROrganizationAuthService extends HROrganizationAuthServiceBase {
/**
* Creates an instance of HROrganizationAuthService.
*
* @param {*} [opts={}]
* @memberof HROrganizationAuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
/**
* 结构层次类别
*
* @export
* @interface HROMHierarchyCat
*/
export interface HROMHierarchyCat {
/**
* 结构层次类别标识
*
* @returns {*}
* @memberof HROMHierarchyCat
*/
omhierarchycatid?: any;
/**
* 结构层次类别名称
*
* @returns {*}
* @memberof HROMHierarchyCat
*/
omhierarchycatname?: any;
/**
* 建立人
*
* @returns {*}
* @memberof HROMHierarchyCat
*/
createman?: any;
/**
* 建立时间
*
* @returns {*}
* @memberof HROMHierarchyCat
*/
createdate?: any;
/**
* 更新人
*
* @returns {*}
* @memberof HROMHierarchyCat
*/
updateman?: any;
/**
* 更新时间
*
* @returns {*}
* @memberof HROMHierarchyCat
*/
updatedate?: any;
}
\ No newline at end of file
/**
* 组织层次结构分配
*
* @export
* @interface HROMHierarchyPurposeRef
*/
export interface HROMHierarchyPurposeRef {
/**
* 更新人
*
* @returns {*}
* @memberof HROMHierarchyPurposeRef
*/
updateman?: any;
/**
* 组织层次结构分配名称
*
* @returns {*}
* @memberof HROMHierarchyPurposeRef
*/
omhierarchypurposerefname?: any;
/**
* 建立时间
*
* @returns {*}
* @memberof HROMHierarchyPurposeRef
*/
createdate?: any;
/**
* 组织层次结构分配标识
*
* @returns {*}
* @memberof HROMHierarchyPurposeRef
*/
omhierarchypurposerefid?: any;
/**
* 更新时间
*
* @returns {*}
* @memberof HROMHierarchyPurposeRef
*/
updatedate?: any;
/**
* 建立人
*
* @returns {*}
* @memberof HROMHierarchyPurposeRef
*/
createman?: any;
/**
* 组织层次机构目的标识
*
* @returns {*}
* @memberof HROMHierarchyPurposeRef
*/
omhierarchypurposeid?: any;
/**
* 结构层次类别标识
*
* @returns {*}
* @memberof HROMHierarchyPurposeRef
*/
omhierarchycatid?: any;
}
\ No newline at end of file
/**
* 组织层次结构
*
* @export
* @interface HROMHierarchy
*/
export interface HROMHierarchy {
/**
* 建立时间
*
* @returns {*}
* @memberof HROMHierarchy
*/
createdate?: any;
/**
* 组织层次结构标识
*
* @returns {*}
* @memberof HROMHierarchy
*/
omhierarchyid?: any;
/**
* 组织层次结构名称
*
* @returns {*}
* @memberof HROMHierarchy
*/
omhierarchyname?: any;
/**
* 更新时间
*
* @returns {*}
* @memberof HROMHierarchy
*/
updatedate?: any;
/**
* 更新人
*
* @returns {*}
* @memberof HROMHierarchy
*/
updateman?: any;
/**
* 建立人
*
* @returns {*}
* @memberof HROMHierarchy
*/
createman?: any;
/**
* 组织
*
* @returns {*}
* @memberof HROMHierarchy
*/
organizationid?: any;
/**
* 父组织层次结构标识
*
* @returns {*}
* @memberof HROMHierarchy
*/
pomhierarchyid?: any;
}
\ No newline at end of file
/**
* 组织层次机构目的
*
* @export
* @interface HROMHIERARCHYPURPOSE
*/
export interface HROMHIERARCHYPURPOSE {
/**
* 更新时间
*
* @returns {*}
* @memberof HROMHIERARCHYPURPOSE
*/
updatedate?: any;
/**
* 组织层次机构目的名称
*
* @returns {*}
* @memberof HROMHIERARCHYPURPOSE
*/
omhierarchypurposename?: any;
/**
* 建立人
*
* @returns {*}
* @memberof HROMHIERARCHYPURPOSE
*/
createman?: any;
/**
* 组织层次机构目的标识
*
* @returns {*}
* @memberof HROMHIERARCHYPURPOSE
*/
omhierarchypurposeid?: any;
/**
* 建立时间
*
* @returns {*}
* @memberof HROMHIERARCHYPURPOSE
*/
createdate?: any;
/**
* 更新人
*
* @returns {*}
* @memberof HROMHIERARCHYPURPOSE
*/
updateman?: any;
}
\ No newline at end of file
/**
* 运营单位
*
* @export
* @interface HROperationUnit
*/
export interface HROperationUnit {
/**
* 更新时间
*
* @returns {*}
* @memberof HROperationUnit
*/
updatedate?: any;
/**
* 建立人
*
* @returns {*}
* @memberof HROperationUnit
*/
createman?: any;
/**
* 更新人
*
* @returns {*}
* @memberof HROperationUnit
*/
updateman?: any;
/**
* 运营单位标识
*
* @returns {*}
* @memberof HROperationUnit
*/
operationunitid?: any;
/**
* 建立时间
*
* @returns {*}
* @memberof HROperationUnit
*/
createdate?: any;
/**
* 运营单位名称
*
* @returns {*}
* @memberof HROperationUnit
*/
operationunitname?: any;
/**
* 组织类型
*
* @returns {*}
* @memberof HROperationUnit
*/
organizationtype?: any;
}
\ No newline at end of file
/**
* 组织
*
* @export
* @interface HROrganization
*/
export interface HROrganization {
/**
* 更新人
*
* @returns {*}
* @memberof HROrganization
*/
updateman?: any;
/**
* 更新时间
*
* @returns {*}
* @memberof HROrganization
*/
updatedate?: any;
/**
* 建立人
*
* @returns {*}
* @memberof HROrganization
*/
createman?: any;
/**
* 组织名称
*
* @returns {*}
* @memberof HROrganization
*/
organizationname?: any;
/**
* 建立时间
*
* @returns {*}
* @memberof HROrganization
*/
createdate?: any;
/**
* 组织
*
* @returns {*}
* @memberof HROrganization
*/
organizationid?: any;
/**
* 组织类型
*
* @returns {*}
* @memberof HROrganization
*/
organizationtype?: any;
}
\ No newline at end of file
import hroperationunit_en_US from '@locale/lanres/entities/hroperation-unit/hroperation-unit_en_US';
import hromhierarchypurposeref_en_US from '@locale/lanres/entities/hromhierarchy-purpose-ref/hromhierarchy-purpose-ref_en_US';
import hromhierarchycat_en_US from '@locale/lanres/entities/hromhierarchy-cat/hromhierarchy-cat_en_US';
import hremployee_en_US from '@locale/lanres/entities/hremployee/hremployee_en_US'; import hremployee_en_US from '@locale/lanres/entities/hremployee/hremployee_en_US';
import hromhierarchypurpose_en_US from '@locale/lanres/entities/hromhierarchypurpose/hromhierarchypurpose_en_US';
import hromhierarchy_en_US from '@locale/lanres/entities/hromhierarchy/hromhierarchy_en_US';
import hrorganization_en_US from '@locale/lanres/entities/hrorganization/hrorganization_en_US';
import components_en_US from '@locale/lanres/components/components_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 codelist_en_US from '@locale/lanres/codelist/codelist_en_US';
import userCustom_en_US from '@locale/lanres/userCustom/userCustom_en_US'; import userCustom_en_US from '@locale/lanres/userCustom/userCustom_en_US';
...@@ -123,8 +129,21 @@ export default { ...@@ -123,8 +129,21 @@ export default {
user_menus: "用户菜单", user_menus: "用户菜单",
menuitem3: "设置", menuitem3: "设置",
top_menus: "顶部菜单", top_menus: "顶部菜单",
menuitem1: "菜单项",
left_exp: "左侧菜单", left_exp: "左侧菜单",
menuitem5: "人员",
menuitem15: "员工信息", menuitem15: "员工信息",
menuitem2: "组织",
menuitem4: "法人",
menuitem6: "运营单位",
menuitem7: "组织层次结构",
menuitem8: "组织层次结构应用",
menuitem9: "内部组织",
menuitem10: "职位",
menuitem11: "有效职位",
menuitem12: "空缺职位",
menuitem13: "所有职位",
menuitem14: "无效职位",
bottom_exp: "底部内容", bottom_exp: "底部内容",
footer_left: "底部左侧", footer_left: "底部左侧",
footer_center: "底部中间", footer_center: "底部中间",
...@@ -227,7 +246,13 @@ export default { ...@@ -227,7 +246,13 @@ export default {
} }
}, },
entities: { entities: {
hroperationunit: hroperationunit_en_US,
hromhierarchypurposeref: hromhierarchypurposeref_en_US,
hromhierarchycat: hromhierarchycat_en_US,
hremployee: hremployee_en_US, hremployee: hremployee_en_US,
hromhierarchypurpose: hromhierarchypurpose_en_US,
hromhierarchy: hromhierarchy_en_US,
hrorganization: hrorganization_en_US,
}, },
components: components_en_US, components: components_en_US,
codelist: codelist_en_US, codelist: codelist_en_US,
......
import hroperationunit_zh_CN from '@locale/lanres/entities/hroperation-unit/hroperation-unit_zh_CN';
import hromhierarchypurposeref_zh_CN from '@locale/lanres/entities/hromhierarchy-purpose-ref/hromhierarchy-purpose-ref_zh_CN';
import hromhierarchycat_zh_CN from '@locale/lanres/entities/hromhierarchy-cat/hromhierarchy-cat_zh_CN';
import hremployee_zh_CN from '@locale/lanres/entities/hremployee/hremployee_zh_CN'; import hremployee_zh_CN from '@locale/lanres/entities/hremployee/hremployee_zh_CN';
import hromhierarchypurpose_zh_CN from '@locale/lanres/entities/hromhierarchypurpose/hromhierarchypurpose_zh_CN';
import hromhierarchy_zh_CN from '@locale/lanres/entities/hromhierarchy/hromhierarchy_zh_CN';
import hrorganization_zh_CN from '@locale/lanres/entities/hrorganization/hrorganization_zh_CN';
import components_zh_CN from '@locale/lanres/components/components_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 codelist_zh_CN from '@locale/lanres/codelist/codelist_zh_CN';
import userCustom_zh_CN from '@locale/lanres/userCustom/userCustom_zh_CN'; import userCustom_zh_CN from '@locale/lanres/userCustom/userCustom_zh_CN';
...@@ -123,8 +129,21 @@ export default { ...@@ -123,8 +129,21 @@ export default {
user_menus: "用户菜单", user_menus: "用户菜单",
menuitem3: "设置", menuitem3: "设置",
top_menus: "顶部菜单", top_menus: "顶部菜单",
menuitem1: "菜单项",
left_exp: "左侧菜单", left_exp: "左侧菜单",
menuitem5: "人员",
menuitem15: "员工信息", menuitem15: "员工信息",
menuitem2: "组织",
menuitem4: "法人",
menuitem6: "运营单位",
menuitem7: "组织层次结构",
menuitem8: "组织层次结构应用",
menuitem9: "内部组织",
menuitem10: "职位",
menuitem11: "有效职位",
menuitem12: "空缺职位",
menuitem13: "所有职位",
menuitem14: "无效职位",
bottom_exp: "底部内容", bottom_exp: "底部内容",
footer_left: "底部左侧", footer_left: "底部左侧",
footer_center: "底部中间", footer_center: "底部中间",
...@@ -226,7 +245,13 @@ export default { ...@@ -226,7 +245,13 @@ export default {
} }
}, },
entities: { entities: {
hroperationunit: hroperationunit_zh_CN,
hromhierarchypurposeref: hromhierarchypurposeref_zh_CN,
hromhierarchycat: hromhierarchycat_zh_CN,
hremployee: hremployee_zh_CN, hremployee: hremployee_zh_CN,
hromhierarchypurpose: hromhierarchypurpose_zh_CN,
hromhierarchy: hromhierarchy_zh_CN,
hrorganization: hrorganization_zh_CN,
}, },
components: components_zh_CN, components: components_zh_CN,
codelist: codelist_zh_CN, codelist: codelist_zh_CN,
......
export default {
fields: {
omhierarchycatid: "结构层次类别标识",
omhierarchycatname: "结构层次类别名称",
createman: "建立人",
createdate: "建立时间",
updateman: "更新人",
updatedate: "更新时间",
},
};
\ No newline at end of file
export default {
fields: {
omhierarchycatid: "结构层次类别标识",
omhierarchycatname: "结构层次类别名称",
createman: "建立人",
createdate: "建立时间",
updateman: "更新人",
updatedate: "更新时间",
},
};
\ No newline at end of file
export default {
fields: {
updateman: "更新人",
omhierarchypurposerefname: "组织层次结构分配名称",
createdate: "建立时间",
omhierarchypurposerefid: "组织层次结构分配标识",
updatedate: "更新时间",
createman: "建立人",
omhierarchypurposeid: "组织层次机构目的标识",
omhierarchycatid: "结构层次类别标识",
},
};
\ No newline at end of file
export default {
fields: {
updateman: "更新人",
omhierarchypurposerefname: "组织层次结构分配名称",
createdate: "建立时间",
omhierarchypurposerefid: "组织层次结构分配标识",
updatedate: "更新时间",
createman: "建立人",
omhierarchypurposeid: "组织层次机构目的标识",
omhierarchycatid: "结构层次类别标识",
},
};
\ No newline at end of file
export default {
fields: {
createdate: "建立时间",
omhierarchyid: "组织层次结构标识",
omhierarchyname: "组织层次结构名称",
updatedate: "更新时间",
updateman: "更新人",
createman: "建立人",
organizationid: "组织",
pomhierarchyid: "父组织层次结构标识",
},
};
\ No newline at end of file
export default {
fields: {
createdate: "建立时间",
omhierarchyid: "组织层次结构标识",
omhierarchyname: "组织层次结构名称",
updatedate: "更新时间",
updateman: "更新人",
createman: "建立人",
organizationid: "组织",
pomhierarchyid: "父组织层次结构标识",
},
};
\ No newline at end of file
export default {
fields: {
updatedate: "更新时间",
omhierarchypurposename: "组织层次机构目的名称",
createman: "建立人",
omhierarchypurposeid: "组织层次机构目的标识",
createdate: "建立时间",
updateman: "更新人",
},
};
\ No newline at end of file
export default {
fields: {
updatedate: "更新时间",
omhierarchypurposename: "组织层次机构目的名称",
createman: "建立人",
omhierarchypurposeid: "组织层次机构目的标识",
createdate: "建立时间",
updateman: "更新人",
},
};
\ No newline at end of file
export default {
fields: {
updatedate: "更新时间",
createman: "建立人",
updateman: "更新人",
operationunitid: "运营单位标识",
createdate: "建立时间",
operationunitname: "运营单位名称",
organizationtype: "组织类型",
},
};
\ No newline at end of file
export default {
fields: {
updatedate: "更新时间",
createman: "建立人",
updateman: "更新人",
operationunitid: "运营单位标识",
createdate: "建立时间",
operationunitname: "运营单位名称",
organizationtype: "组织类型",
},
};
\ No newline at end of file
export default {
fields: {
updateman: "更新人",
updatedate: "更新时间",
createman: "建立人",
organizationname: "组织名称",
createdate: "建立时间",
organizationid: "组织",
organizationtype: "组织类型",
},
};
\ No newline at end of file
export default {
fields: {
updateman: "更新人",
updatedate: "更新时间",
createman: "建立人",
organizationname: "组织名称",
createdate: "建立时间",
organizationid: "组织",
organizationtype: "组织类型",
},
};
\ No newline at end of file
...@@ -65,6 +65,26 @@ mock.onGet('v7/pimappmenu').reply((config: any) => { ...@@ -65,6 +65,26 @@ mock.onGet('v7/pimappmenu').reply((config: any) => {
textcls: '', textcls: '',
appfunctag: '', appfunctag: '',
resourcetag: '', resourcetag: '',
items: [
{
id: 'A8D78DD5-209F-4ADF-8B05-72F646DFCECD',
name: 'menuitem1',
text: '菜单项',
type: 'MENUITEM',
counterid: '',
tooltip: '菜单项',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
],
}, },
{ {
id: 'dfc129d27761fa5213b01cda5ee15778', id: 'dfc129d27761fa5213b01cda5ee15778',
...@@ -83,6 +103,24 @@ mock.onGet('v7/pimappmenu').reply((config: any) => { ...@@ -83,6 +103,24 @@ mock.onGet('v7/pimappmenu').reply((config: any) => {
textcls: '', textcls: '',
appfunctag: '', appfunctag: '',
resourcetag: '', resourcetag: '',
items: [
{
id: '1F73FB8E-0E2A-4B7A-B800-004B01AB2301',
name: 'menuitem5',
text: '人员',
type: 'MENUITEM',
counterid: '',
tooltip: '人员',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: 'fa fa-users',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
items: [ items: [
{ {
id: '4b24bf3dc681c591cb1663ce8853cc32', id: '4b24bf3dc681c591cb1663ce8853cc32',
...@@ -103,6 +141,210 @@ mock.onGet('v7/pimappmenu').reply((config: any) => { ...@@ -103,6 +141,210 @@ mock.onGet('v7/pimappmenu').reply((config: any) => {
resourcetag: '', resourcetag: '',
}, },
], ],
},
{
id: 'B25E7335-DEBD-478A-81FD-1BB47B68DFA4',
name: 'menuitem2',
text: '组织',
type: 'MENUITEM',
counterid: '',
tooltip: '组织',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: 'fa fa-bank',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
items: [
{
id: '98B816C8-2AA6-4BB4-9CC5-C2B72A61C24B',
name: 'menuitem4',
text: '法人',
type: 'MENUITEM',
counterid: '',
tooltip: '法人',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
{
id: '7950AF8B-457E-4B66-9E43-48FA95ED5A0C',
name: 'menuitem6',
text: '运营单位',
type: 'MENUITEM',
counterid: '',
tooltip: '运营单位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
{
id: '8BCD342D-9983-4932-85AF-C31662BCE75A',
name: 'menuitem7',
text: '组织层次结构',
type: 'MENUITEM',
counterid: '',
tooltip: '组织层次结构',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
{
id: 'FE369EC4-CF71-49D9-A247-8572CFAB910E',
name: 'menuitem8',
text: '组织层次结构应用',
type: 'MENUITEM',
counterid: '',
tooltip: '组织层次结构应用',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
{
id: 'F4927234-CF7B-44BA-AECC-24318EF8B794',
name: 'menuitem9',
text: '内部组织',
type: 'MENUITEM',
counterid: '',
tooltip: '内部组织',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
{
id: 'E065C1FE-A872-4209-A254-67DE568A5F43',
name: 'menuitem10',
text: '职位',
type: 'MENUITEM',
counterid: '',
tooltip: '职位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
items: [
{
id: 'F40EFB9B-4A24-45F2-8CD1-BD9CFD890109',
name: 'menuitem11',
text: '有效职位',
type: 'MENUITEM',
counterid: '',
tooltip: '有效职位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
{
id: '5866C16B-4C55-4E2C-8229-15F7533B9E4F',
name: 'menuitem12',
text: '空缺职位',
type: 'MENUITEM',
counterid: '',
tooltip: '空缺职位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
{
id: '0E9C48F5-46B8-4F0C-915D-27A35AEAD41C',
name: 'menuitem13',
text: '所有职位',
type: 'MENUITEM',
counterid: '',
tooltip: '所有职位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
{
id: '876E25B2-96E1-430F-890B-80DA30FA4DE8',
name: 'menuitem14',
text: '无效职位',
type: 'MENUITEM',
counterid: '',
tooltip: '无效职位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
],
},
],
},
],
}, },
{ {
id: 'fec63a28f5d99fd4ac7e43004b6a16f8', id: 'fec63a28f5d99fd4ac7e43004b6a16f8',
......
import qs from 'qs';
import { MockAdapter } from '@/mock/mock-adapter';
const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/ibizhumanresources-app-pim\/hromhierarchycats\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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\/ibizhumanresources-app-pim\/hromhierarchycats\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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(/^\/hromhierarchycats\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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(/^\/hromhierarchycats\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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(/^\/hromhierarchycats\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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(/^\/hromhierarchycats\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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> = ['omhierarchycatid'];
const matchArray:any = new RegExp(/^\/hromhierarchycats\/([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.omhierarchycatid, tempValue.omhierarchycatid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/hromhierarchycats\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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> = ['omhierarchycatid'];
const matchArray:any = new RegExp(/^\/hromhierarchycats\/([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]];
});
// Update
mock.onPut(new RegExp(/^\/hromhierarchycats\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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> = ['omhierarchycatid'];
const matchArray:any = new RegExp(/^\/hromhierarchycats\/([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.omhierarchycatid, tempValue.omhierarchycatid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchycatid'] == tempValue['omhierarchycatid'] ){
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(/^\/hromhierarchycats\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/hromhierarchycats\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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> = ['omhierarchycatid'];
const matchArray:any = new RegExp(/^\/hromhierarchycats\/([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.omhierarchycatid, tempValue.omhierarchycatid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchycatid'] == tempValue['omhierarchycatid'] ){
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(/^\/hromhierarchycats\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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> = ['omhierarchycatid'];
const matchArray:any = new RegExp(/^\/hromhierarchycats\/([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.omhierarchycatid, tempValue.omhierarchycatid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchycatid'] == tempValue['omhierarchycatid'] ){
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(/^\/hromhierarchycats\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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(/^\/hromhierarchycats\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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(/^\/hromhierarchycats\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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> = ['omhierarchycatid'];
const matchArray:any = new RegExp(/^\/hromhierarchycats\/([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.omhierarchycatid, tempValue.omhierarchycatid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/hromhierarchycats\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchycat 方法: 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> = ['omhierarchycatid'];
const matchArray:any = new RegExp(/^\/hromhierarchycats\/([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.omhierarchycatid, tempValue.omhierarchycatid));
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\/ibizhumanresources-app-pim\/hromhierarchypurposerefs\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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\/ibizhumanresources-app-pim\/hromhierarchypurposerefs\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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(/^\/hromhierarchypurposerefs\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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(/^\/hromhierarchypurposerefs\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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(/^\/hromhierarchypurposerefs\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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(/^\/hromhierarchypurposerefs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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> = ['omhierarchypurposerefid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposerefs\/([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.omhierarchypurposerefid, tempValue.omhierarchypurposerefid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/hromhierarchypurposerefs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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> = ['omhierarchypurposerefid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposerefs\/([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]];
});
// Update
mock.onPut(new RegExp(/^\/hromhierarchypurposerefs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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> = ['omhierarchypurposerefid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposerefs\/([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.omhierarchypurposerefid, tempValue.omhierarchypurposerefid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchypurposerefid'] == tempValue['omhierarchypurposerefid'] ){
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(/^\/hromhierarchypurposerefs\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/hromhierarchypurposerefs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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> = ['omhierarchypurposerefid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposerefs\/([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.omhierarchypurposerefid, tempValue.omhierarchypurposerefid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchypurposerefid'] == tempValue['omhierarchypurposerefid'] ){
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(/^\/hromhierarchypurposerefs\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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> = ['omhierarchypurposerefid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposerefs\/([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.omhierarchypurposerefid, tempValue.omhierarchypurposerefid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchypurposerefid'] == tempValue['omhierarchypurposerefid'] ){
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(/^\/hromhierarchypurposerefs\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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(/^\/hromhierarchypurposerefs\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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(/^\/hromhierarchypurposerefs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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> = ['omhierarchypurposerefid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposerefs\/([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.omhierarchypurposerefid, tempValue.omhierarchypurposerefid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/hromhierarchypurposerefs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurposeref 方法: 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> = ['omhierarchypurposerefid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposerefs\/([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.omhierarchypurposerefid, tempValue.omhierarchypurposerefid));
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\/ibizhumanresources-app-pim\/hromhierarchypurposes\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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\/ibizhumanresources-app-pim\/hromhierarchypurposes\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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(/^\/hromhierarchypurposes\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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(/^\/hromhierarchypurposes\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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(/^\/hromhierarchypurposes\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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(/^\/hromhierarchypurposes\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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> = ['omhierarchypurposeid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposes\/([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.omhierarchypurposeid, tempValue.omhierarchypurposeid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/hromhierarchypurposes\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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> = ['omhierarchypurposeid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposes\/([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]];
});
// Update
mock.onPut(new RegExp(/^\/hromhierarchypurposes\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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> = ['omhierarchypurposeid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposes\/([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.omhierarchypurposeid, tempValue.omhierarchypurposeid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchypurposeid'] == tempValue['omhierarchypurposeid'] ){
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(/^\/hromhierarchypurposes\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/hromhierarchypurposes\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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> = ['omhierarchypurposeid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposes\/([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.omhierarchypurposeid, tempValue.omhierarchypurposeid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchypurposeid'] == tempValue['omhierarchypurposeid'] ){
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(/^\/hromhierarchypurposes\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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> = ['omhierarchypurposeid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposes\/([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.omhierarchypurposeid, tempValue.omhierarchypurposeid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchypurposeid'] == tempValue['omhierarchypurposeid'] ){
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(/^\/hromhierarchypurposes\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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(/^\/hromhierarchypurposes\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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(/^\/hromhierarchypurposes\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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> = ['omhierarchypurposeid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposes\/([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.omhierarchypurposeid, tempValue.omhierarchypurposeid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/hromhierarchypurposes\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchypurpose 方法: 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> = ['omhierarchypurposeid'];
const matchArray:any = new RegExp(/^\/hromhierarchypurposes\/([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.omhierarchypurposeid, tempValue.omhierarchypurposeid));
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\/ibizhumanresources-app-pim\/hromhierarchies\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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\/ibizhumanresources-app-pim\/hromhierarchies\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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(/^\/hromhierarchies\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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(/^\/hromhierarchies\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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(/^\/hromhierarchies\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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(/^\/hromhierarchies\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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> = ['omhierarchyid'];
const matchArray:any = new RegExp(/^\/hromhierarchies\/([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.omhierarchyid, tempValue.omhierarchyid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/hromhierarchies\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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> = ['omhierarchyid'];
const matchArray:any = new RegExp(/^\/hromhierarchies\/([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]];
});
// Update
mock.onPut(new RegExp(/^\/hromhierarchies\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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> = ['omhierarchyid'];
const matchArray:any = new RegExp(/^\/hromhierarchies\/([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.omhierarchyid, tempValue.omhierarchyid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchyid'] == tempValue['omhierarchyid'] ){
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(/^\/hromhierarchies\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/hromhierarchies\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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> = ['omhierarchyid'];
const matchArray:any = new RegExp(/^\/hromhierarchies\/([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.omhierarchyid, tempValue.omhierarchyid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchyid'] == tempValue['omhierarchyid'] ){
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(/^\/hromhierarchies\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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> = ['omhierarchyid'];
const matchArray:any = new RegExp(/^\/hromhierarchies\/([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.omhierarchyid, tempValue.omhierarchyid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['omhierarchyid'] == tempValue['omhierarchyid'] ){
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(/^\/hromhierarchies\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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(/^\/hromhierarchies\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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(/^\/hromhierarchies\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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> = ['omhierarchyid'];
const matchArray:any = new RegExp(/^\/hromhierarchies\/([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.omhierarchyid, tempValue.omhierarchyid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/hromhierarchies\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hromhierarchy 方法: 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> = ['omhierarchyid'];
const matchArray:any = new RegExp(/^\/hromhierarchies\/([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.omhierarchyid, tempValue.omhierarchyid));
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\/ibizhumanresources-app-pim\/hroperationunits\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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\/ibizhumanresources-app-pim\/hroperationunits\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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(/^\/hroperationunits\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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(/^\/hroperationunits\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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(/^\/hroperationunits\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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(/^\/hroperationunits\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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> = ['operationunitid'];
const matchArray:any = new RegExp(/^\/hroperationunits\/([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.operationunitid, tempValue.operationunitid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/hroperationunits\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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> = ['operationunitid'];
const matchArray:any = new RegExp(/^\/hroperationunits\/([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]];
});
// Update
mock.onPut(new RegExp(/^\/hroperationunits\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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> = ['operationunitid'];
const matchArray:any = new RegExp(/^\/hroperationunits\/([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.operationunitid, tempValue.operationunitid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['operationunitid'] == tempValue['operationunitid'] ){
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(/^\/hroperationunits\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/hroperationunits\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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> = ['operationunitid'];
const matchArray:any = new RegExp(/^\/hroperationunits\/([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.operationunitid, tempValue.operationunitid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['operationunitid'] == tempValue['operationunitid'] ){
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(/^\/hroperationunits\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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> = ['operationunitid'];
const matchArray:any = new RegExp(/^\/hroperationunits\/([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.operationunitid, tempValue.operationunitid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['operationunitid'] == tempValue['operationunitid'] ){
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(/^\/hroperationunits\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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(/^\/hroperationunits\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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(/^\/hroperationunits\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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> = ['operationunitid'];
const matchArray:any = new RegExp(/^\/hroperationunits\/([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.operationunitid, tempValue.operationunitid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/hroperationunits\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hroperationunit 方法: 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> = ['operationunitid'];
const matchArray:any = new RegExp(/^\/hroperationunits\/([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.operationunitid, tempValue.operationunitid));
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\/ibizhumanresources-app-pim\/hrorganizations\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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\/ibizhumanresources-app-pim\/hrorganizations\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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(/^\/hrorganizations\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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(/^\/hrorganizations\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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(/^\/hrorganizations\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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(/^\/hrorganizations\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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> = ['organizationid'];
const matchArray:any = new RegExp(/^\/hrorganizations\/([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.organizationid, tempValue.organizationid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/hrorganizations\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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> = ['organizationid'];
const matchArray:any = new RegExp(/^\/hrorganizations\/([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]];
});
// Update
mock.onPut(new RegExp(/^\/hrorganizations\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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> = ['organizationid'];
const matchArray:any = new RegExp(/^\/hrorganizations\/([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.organizationid, tempValue.organizationid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['organizationid'] == tempValue['organizationid'] ){
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(/^\/hrorganizations\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/hrorganizations\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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> = ['organizationid'];
const matchArray:any = new RegExp(/^\/hrorganizations\/([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.organizationid, tempValue.organizationid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['organizationid'] == tempValue['organizationid'] ){
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(/^\/hrorganizations\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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> = ['organizationid'];
const matchArray:any = new RegExp(/^\/hrorganizations\/([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.organizationid, tempValue.organizationid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['organizationid'] == tempValue['organizationid'] ){
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(/^\/hrorganizations\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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(/^\/hrorganizations\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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(/^\/hrorganizations\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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> = ['organizationid'];
const matchArray:any = new RegExp(/^\/hrorganizations\/([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.organizationid, tempValue.organizationid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/hrorganizations\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hrorganization 方法: 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> = ['organizationid'];
const matchArray:any = new RegExp(/^\/hrorganizations\/([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.organizationid, tempValue.organizationid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
...@@ -7,4 +7,10 @@ import './login/login'; ...@@ -7,4 +7,10 @@ import './login/login';
import './upload/upload'; import './upload/upload';
// 实体级接口对象 // 实体级接口对象
import './entity/hroperation-units/hroperation-units';
import './entity/hromhierarchy-purpose-refs/hromhierarchy-purpose-refs';
import './entity/hromhierarchy-cats/hromhierarchy-cats';
import './entity/hremployees/hremployees'; import './entity/hremployees/hremployees';
import './entity/hromhierarchypurposes/hromhierarchypurposes';
import './entity/hromhierarchys/hromhierarchys';
import './entity/hrorganizations/hrorganizations';
...@@ -39,7 +39,13 @@ export class EntityServiceRegister { ...@@ -39,7 +39,13 @@ export class EntityServiceRegister {
* @memberof EntityServiceRegister * @memberof EntityServiceRegister
*/ */
protected init(): void { protected init(): void {
this.allEntityService.set('hremployee', () => import('@/service/hremployee/hremployee-service')); this.allEntityService.set('hroperationunit', () => import('@/service/hroperation-unit/hroperation-unit-service'));
this.allEntityService.set('hromhierarchypurposeref', () => import('@/service/hromhierarchy-purpose-ref/hromhierarchy-purpose-ref-service'));
this.allEntityService.set('hromhierarchycat', () => import('@/service/hromhierarchy-cat/hromhierarchy-cat-service'));
this.allEntityService.set('hremployee', () => import('@/service/hremployee/hremployee-service'));
this.allEntityService.set('hromhierarchypurpose', () => import('@/service/hromhierarchypurpose/hromhierarchypurpose-service'));
this.allEntityService.set('hromhierarchy', () => import('@/service/hromhierarchy/hromhierarchy-service'));
this.allEntityService.set('hrorganization', () => import('@/service/hrorganization/hrorganization-service'));
} }
/** /**
......
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 结构层次类别服务对象基类
*
* @export
* @class HROMHierarchyCatServiceBase
* @extends {EntityServie}
*/
export default class HROMHierarchyCatServiceBase extends EntityService {
/**
* Creates an instance of HROMHierarchyCatServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyCatServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof HROMHierarchyCatServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='hromhierarchycat';
this.APPDEKEY = 'omhierarchycatid';
this.APPDENAME = 'hromhierarchycats';
this.APPDETEXT = 'omhierarchycatname';
this.APPNAME = 'pim';
this.SYSTEMNAME = 'ibizhumanresources';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyCatServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/hromhierarchycats/${context.hromhierarchycat}/select`,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyCatServiceBase
*/
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(`/hromhierarchycats`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyCatServiceBase
*/
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(`/hromhierarchycats/${context.hromhierarchycat}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyCatServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/hromhierarchycats/${context.hromhierarchycat}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyCatServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hromhierarchycats/${context.hromhierarchycat}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyCatServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hromhierarchycats/getdraft`,isloading);
res.data.hromhierarchycat = data.hromhierarchycat;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyCatServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/hromhierarchycats/${context.hromhierarchycat}/checkkey`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyCatServiceBase
*/
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(`/hromhierarchycats/${context.hromhierarchycat}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyCatServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/hromhierarchycats/fetchdefault`,tempData,isloading);
return res;
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import HROMHierarchyCatServiceBase from './hromhierarchy-cat-service-base';
/**
* 结构层次类别服务对象
*
* @export
* @class HROMHierarchyCatService
* @extends {HROMHierarchyCatServiceBase}
*/
export default class HROMHierarchyCatService extends HROMHierarchyCatServiceBase {
/**
* Creates an instance of HROMHierarchyCatService.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyCatService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 组织层次结构分配服务对象基类
*
* @export
* @class HROMHierarchyPurposeRefServiceBase
* @extends {EntityServie}
*/
export default class HROMHierarchyPurposeRefServiceBase extends EntityService {
/**
* Creates an instance of HROMHierarchyPurposeRefServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyPurposeRefServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof HROMHierarchyPurposeRefServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='hromhierarchypurposeref';
this.APPDEKEY = 'omhierarchypurposerefid';
this.APPDENAME = 'hromhierarchypurposerefs';
this.APPDETEXT = 'omhierarchypurposerefname';
this.APPNAME = 'pim';
this.SYSTEMNAME = 'ibizhumanresources';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyPurposeRefServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/hromhierarchypurposerefs/${context.hromhierarchypurposeref}/select`,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyPurposeRefServiceBase
*/
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(`/hromhierarchypurposerefs`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyPurposeRefServiceBase
*/
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(`/hromhierarchypurposerefs/${context.hromhierarchypurposeref}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyPurposeRefServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/hromhierarchypurposerefs/${context.hromhierarchypurposeref}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyPurposeRefServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hromhierarchypurposerefs/${context.hromhierarchypurposeref}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyPurposeRefServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hromhierarchypurposerefs/getdraft`,isloading);
res.data.hromhierarchypurposeref = data.hromhierarchypurposeref;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyPurposeRefServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/hromhierarchypurposerefs/${context.hromhierarchypurposeref}/checkkey`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyPurposeRefServiceBase
*/
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(`/hromhierarchypurposerefs/${context.hromhierarchypurposeref}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyPurposeRefServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/hromhierarchypurposerefs/fetchdefault`,tempData,isloading);
return res;
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import HROMHierarchyPurposeRefServiceBase from './hromhierarchy-purpose-ref-service-base';
/**
* 组织层次结构分配服务对象
*
* @export
* @class HROMHierarchyPurposeRefService
* @extends {HROMHierarchyPurposeRefServiceBase}
*/
export default class HROMHierarchyPurposeRefService extends HROMHierarchyPurposeRefServiceBase {
/**
* Creates an instance of HROMHierarchyPurposeRefService.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyPurposeRefService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 组织层次结构服务对象基类
*
* @export
* @class HROMHierarchyServiceBase
* @extends {EntityServie}
*/
export default class HROMHierarchyServiceBase extends EntityService {
/**
* Creates an instance of HROMHierarchyServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof HROMHierarchyServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='hromhierarchy';
this.APPDEKEY = 'omhierarchyid';
this.APPDENAME = 'hromhierarchies';
this.APPDETEXT = 'omhierarchyname';
this.APPNAME = 'pim';
this.SYSTEMNAME = 'ibizhumanresources';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/hromhierarchies/${context.hromhierarchy}/select`,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyServiceBase
*/
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(`/hromhierarchies`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyServiceBase
*/
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(`/hromhierarchies/${context.hromhierarchy}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/hromhierarchies/${context.hromhierarchy}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hromhierarchies/${context.hromhierarchy}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hromhierarchies/getdraft`,isloading);
res.data.hromhierarchy = data.hromhierarchy;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/hromhierarchies/${context.hromhierarchy}/checkkey`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyServiceBase
*/
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(`/hromhierarchies/${context.hromhierarchy}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHierarchyServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/hromhierarchies/fetchdefault`,tempData,isloading);
return res;
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import HROMHierarchyServiceBase from './hromhierarchy-service-base';
/**
* 组织层次结构服务对象
*
* @export
* @class HROMHierarchyService
* @extends {HROMHierarchyServiceBase}
*/
export default class HROMHierarchyService extends HROMHierarchyServiceBase {
/**
* Creates an instance of HROMHierarchyService.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 组织层次结构应用服务对象基类
*
* @export
* @class HROMHIERARCHYPURPOSEServiceBase
* @extends {EntityServie}
*/
export default class HROMHIERARCHYPURPOSEServiceBase extends EntityService {
/**
* Creates an instance of HROMHIERARCHYPURPOSEServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='hromhierarchypurpose';
this.APPDEKEY = 'omhierarchypurposeid';
this.APPDENAME = 'hromhierarchypurposes';
this.APPDETEXT = 'omhierarchypurposename';
this.APPNAME = 'pim';
this.SYSTEMNAME = 'ibizhumanresources';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/hromhierarchypurposes/${context.hromhierarchypurpose}/select`,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
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(`/hromhierarchypurposes`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
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(`/hromhierarchypurposes/${context.hromhierarchypurpose}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/hromhierarchypurposes/${context.hromhierarchypurpose}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hromhierarchypurposes/${context.hromhierarchypurpose}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hromhierarchypurposes/getdraft`,isloading);
res.data.hromhierarchypurpose = data.hromhierarchypurpose;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/hromhierarchypurposes/${context.hromhierarchypurpose}/checkkey`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
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(`/hromhierarchypurposes/${context.hromhierarchypurpose}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROMHIERARCHYPURPOSEServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/hromhierarchypurposes/fetchdefault`,tempData,isloading);
return res;
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import HROMHIERARCHYPURPOSEServiceBase from './hromhierarchypurpose-service-base';
/**
* 组织层次结构应用服务对象
*
* @export
* @class HROMHIERARCHYPURPOSEService
* @extends {HROMHIERARCHYPURPOSEServiceBase}
*/
export default class HROMHIERARCHYPURPOSEService extends HROMHIERARCHYPURPOSEServiceBase {
/**
* Creates an instance of HROMHIERARCHYPURPOSEService.
*
* @param {*} [opts={}]
* @memberof HROMHIERARCHYPURPOSEService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 运营单位服务对象基类
*
* @export
* @class HROperationUnitServiceBase
* @extends {EntityServie}
*/
export default class HROperationUnitServiceBase extends EntityService {
/**
* Creates an instance of HROperationUnitServiceBase.
*
* @param {*} [opts={}]
* @memberof HROperationUnitServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof HROperationUnitServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='hroperationunit';
this.APPDEKEY = 'operationunitid';
this.APPDENAME = 'hroperationunits';
this.APPDETEXT = 'operationunitname';
this.APPNAME = 'pim';
this.SYSTEMNAME = 'ibizhumanresources';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROperationUnitServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/hroperationunits/${context.hroperationunit}/select`,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROperationUnitServiceBase
*/
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(`/hroperationunits`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROperationUnitServiceBase
*/
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(`/hroperationunits/${context.hroperationunit}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROperationUnitServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/hroperationunits/${context.hroperationunit}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROperationUnitServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hroperationunits/${context.hroperationunit}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROperationUnitServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hroperationunits/getdraft`,isloading);
res.data.hroperationunit = data.hroperationunit;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROperationUnitServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/hroperationunits/${context.hroperationunit}/checkkey`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROperationUnitServiceBase
*/
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(`/hroperationunits/${context.hroperationunit}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROperationUnitServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/hroperationunits/fetchdefault`,tempData,isloading);
return res;
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import HROperationUnitServiceBase from './hroperation-unit-service-base';
/**
* 运营单位服务对象
*
* @export
* @class HROperationUnitService
* @extends {HROperationUnitServiceBase}
*/
export default class HROperationUnitService extends HROperationUnitServiceBase {
/**
* Creates an instance of HROperationUnitService.
*
* @param {*} [opts={}]
* @memberof HROperationUnitService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 组织服务对象基类
*
* @export
* @class HROrganizationServiceBase
* @extends {EntityServie}
*/
export default class HROrganizationServiceBase extends EntityService {
/**
* Creates an instance of HROrganizationServiceBase.
*
* @param {*} [opts={}]
* @memberof HROrganizationServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof HROrganizationServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='hrorganization';
this.APPDEKEY = 'organizationid';
this.APPDENAME = 'hrorganizations';
this.APPDETEXT = 'organizationname';
this.APPNAME = 'pim';
this.SYSTEMNAME = 'ibizhumanresources';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROrganizationServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/hrorganizations/${context.hrorganization}/select`,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROrganizationServiceBase
*/
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(`/hrorganizations`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROrganizationServiceBase
*/
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(`/hrorganizations/${context.hrorganization}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROrganizationServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/hrorganizations/${context.hrorganization}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROrganizationServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hrorganizations/${context.hrorganization}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROrganizationServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hrorganizations/getdraft`,isloading);
res.data.hrorganization = data.hrorganization;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROrganizationServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/hrorganizations/${context.hrorganization}/checkkey`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROrganizationServiceBase
*/
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(`/hrorganizations/${context.hrorganization}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HROrganizationServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/hrorganizations/fetchdefault`,tempData,isloading);
return res;
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import HROrganizationServiceBase from './hrorganization-service-base';
/**
* 组织服务对象
*
* @export
* @class HROrganizationService
* @extends {HROrganizationServiceBase}
*/
export default class HROrganizationService extends HROrganizationServiceBase {
/**
* Creates an instance of HROrganizationService.
*
* @param {*} [opts={}]
* @memberof HROrganizationService
*/
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 HROMHierarchyCatService from '@/service/hromhierarchy-cat/hromhierarchy-cat-service';
import HROMHierarchyCatAuthService from '@/authservice/hromhierarchy-cat/hromhierarchy-cat-auth-service';
/**
* 结构层次类别UI服务对象基类
*
* @export
* @class HROMHierarchyCatUIServiceBase
*/
export default class HROMHierarchyCatUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public dataService:HROMHierarchyCatService = new HROMHierarchyCatService();
/**
* 所有关联视图
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of HROMHierarchyCatUIServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyCatUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new HROMHierarchyCatAuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
* 初始化视图Map
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 初始化主状态操作标识
*
* @memberof HROMHierarchyCatUIServiceBase
*/
public initDeMainStateOPPrivsMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof HROMHierarchyCatUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({hromhierarchycat: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 HROMHierarchyCatUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof HROMHierarchyCatUIServiceBase
*/
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:${ this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof HROMHierarchyCatUIServiceBase
*/
public getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.warn(`当前数据对象不包含属性${singleMainField},可能会发生错误`);
}
})
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;
}
/**
* 获取数据对象当前操作标识
*
* @param data 当前数据
* @memberof HROMHierarchyCatUIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof HROMHierarchyCatUIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
import HROMHierarchyCatUIServiceBase from './hromhierarchy-cat-ui-service-base';
/**
* 结构层次类别UI服务对象
*
* @export
* @class HROMHierarchyCatUIService
*/
export default class HROMHierarchyCatUIService extends HROMHierarchyCatUIServiceBase {
/**
* Creates an instance of HROMHierarchyCatUIService.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyCatUIService
*/
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 HROMHierarchyPurposeRefService from '@/service/hromhierarchy-purpose-ref/hromhierarchy-purpose-ref-service';
import HROMHierarchyPurposeRefAuthService from '@/authservice/hromhierarchy-purpose-ref/hromhierarchy-purpose-ref-auth-service';
/**
* 组织层次结构分配UI服务对象基类
*
* @export
* @class HROMHierarchyPurposeRefUIServiceBase
*/
export default class HROMHierarchyPurposeRefUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public dataService:HROMHierarchyPurposeRefService = new HROMHierarchyPurposeRefService();
/**
* 所有关联视图
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of HROMHierarchyPurposeRefUIServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new HROMHierarchyPurposeRefAuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
* 初始化视图Map
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 初始化主状态操作标识
*
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public initDeMainStateOPPrivsMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({hromhierarchypurposeref: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 HROMHierarchyPurposeRefUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
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:${ this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.warn(`当前数据对象不包含属性${singleMainField},可能会发生错误`);
}
})
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;
}
/**
* 获取数据对象当前操作标识
*
* @param data 当前数据
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof HROMHierarchyPurposeRefUIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
import HROMHierarchyPurposeRefUIServiceBase from './hromhierarchy-purpose-ref-ui-service-base';
/**
* 组织层次结构分配UI服务对象
*
* @export
* @class HROMHierarchyPurposeRefUIService
*/
export default class HROMHierarchyPurposeRefUIService extends HROMHierarchyPurposeRefUIServiceBase {
/**
* Creates an instance of HROMHierarchyPurposeRefUIService.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyPurposeRefUIService
*/
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 HROMHierarchyService from '@/service/hromhierarchy/hromhierarchy-service';
import HROMHierarchyAuthService from '@/authservice/hromhierarchy/hromhierarchy-auth-service';
/**
* 组织层次结构UI服务对象基类
*
* @export
* @class HROMHierarchyUIServiceBase
*/
export default class HROMHierarchyUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof HROMHierarchyUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof HROMHierarchyUIServiceBase
*/
public dataService:HROMHierarchyService = new HROMHierarchyService();
/**
* 所有关联视图
*
* @memberof HROMHierarchyUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof HROMHierarchyUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof HROMHierarchyUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof HROMHierarchyUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof HROMHierarchyUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof HROMHierarchyUIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of HROMHierarchyUIServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new HROMHierarchyAuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
* 初始化视图Map
*
* @memberof HROMHierarchyUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof HROMHierarchyUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 初始化主状态操作标识
*
* @memberof HROMHierarchyUIServiceBase
*/
public initDeMainStateOPPrivsMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof HROMHierarchyUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({hromhierarchy: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 HROMHierarchyUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof HROMHierarchyUIServiceBase
*/
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:${ this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof HROMHierarchyUIServiceBase
*/
public getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.warn(`当前数据对象不包含属性${singleMainField},可能会发生错误`);
}
})
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;
}
/**
* 获取数据对象当前操作标识
*
* @param data 当前数据
* @memberof HROMHierarchyUIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof HROMHierarchyUIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
import HROMHierarchyUIServiceBase from './hromhierarchy-ui-service-base';
/**
* 组织层次结构UI服务对象
*
* @export
* @class HROMHierarchyUIService
*/
export default class HROMHierarchyUIService extends HROMHierarchyUIServiceBase {
/**
* Creates an instance of HROMHierarchyUIService.
*
* @param {*} [opts={}]
* @memberof HROMHierarchyUIService
*/
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 HROMHIERARCHYPURPOSEService from '@/service/hromhierarchypurpose/hromhierarchypurpose-service';
import HROMHIERARCHYPURPOSEAuthService from '@/authservice/hromhierarchypurpose/hromhierarchypurpose-auth-service';
/**
* 组织层次结构应用UI服务对象基类
*
* @export
* @class HROMHIERARCHYPURPOSEUIServiceBase
*/
export default class HROMHIERARCHYPURPOSEUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public dataService:HROMHIERARCHYPURPOSEService = new HROMHIERARCHYPURPOSEService();
/**
* 所有关联视图
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of HROMHIERARCHYPURPOSEUIServiceBase.
*
* @param {*} [opts={}]
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new HROMHIERARCHYPURPOSEAuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
* 初始化视图Map
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 初始化主状态操作标识
*
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public initDeMainStateOPPrivsMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({hromhierarchypurpose: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 HROMHIERARCHYPURPOSEUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
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:${ this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.warn(`当前数据对象不包含属性${singleMainField},可能会发生错误`);
}
})
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;
}
/**
* 获取数据对象当前操作标识
*
* @param data 当前数据
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof HROMHIERARCHYPURPOSEUIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
import HROMHIERARCHYPURPOSEUIServiceBase from './hromhierarchypurpose-ui-service-base';
/**
* 组织层次结构应用UI服务对象
*
* @export
* @class HROMHIERARCHYPURPOSEUIService
*/
export default class HROMHIERARCHYPURPOSEUIService extends HROMHIERARCHYPURPOSEUIServiceBase {
/**
* Creates an instance of HROMHIERARCHYPURPOSEUIService.
*
* @param {*} [opts={}]
* @memberof HROMHIERARCHYPURPOSEUIService
*/
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 HROperationUnitService from '@/service/hroperation-unit/hroperation-unit-service';
import HROperationUnitAuthService from '@/authservice/hroperation-unit/hroperation-unit-auth-service';
/**
* 运营单位UI服务对象基类
*
* @export
* @class HROperationUnitUIServiceBase
*/
export default class HROperationUnitUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof HROperationUnitUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof HROperationUnitUIServiceBase
*/
public dataService:HROperationUnitService = new HROperationUnitService();
/**
* 所有关联视图
*
* @memberof HROperationUnitUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof HROperationUnitUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof HROperationUnitUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof HROperationUnitUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof HROperationUnitUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof HROperationUnitUIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of HROperationUnitUIServiceBase.
*
* @param {*} [opts={}]
* @memberof HROperationUnitUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new HROperationUnitAuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
* 初始化视图Map
*
* @memberof HROperationUnitUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof HROperationUnitUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 初始化主状态操作标识
*
* @memberof HROperationUnitUIServiceBase
*/
public initDeMainStateOPPrivsMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof HROperationUnitUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({hroperationunit: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 HROperationUnitUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof HROperationUnitUIServiceBase
*/
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:${ this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof HROperationUnitUIServiceBase
*/
public getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.warn(`当前数据对象不包含属性${singleMainField},可能会发生错误`);
}
})
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;
}
/**
* 获取数据对象当前操作标识
*
* @param data 当前数据
* @memberof HROperationUnitUIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof HROperationUnitUIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
import HROperationUnitUIServiceBase from './hroperation-unit-ui-service-base';
/**
* 运营单位UI服务对象
*
* @export
* @class HROperationUnitUIService
*/
export default class HROperationUnitUIService extends HROperationUnitUIServiceBase {
/**
* Creates an instance of HROperationUnitUIService.
*
* @param {*} [opts={}]
* @memberof HROperationUnitUIService
*/
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 HROrganizationService from '@/service/hrorganization/hrorganization-service';
import HROrganizationAuthService from '@/authservice/hrorganization/hrorganization-auth-service';
/**
* 组织UI服务对象基类
*
* @export
* @class HROrganizationUIServiceBase
*/
export default class HROrganizationUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof HROrganizationUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof HROrganizationUIServiceBase
*/
public dataService:HROrganizationService = new HROrganizationService();
/**
* 所有关联视图
*
* @memberof HROrganizationUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof HROrganizationUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof HROrganizationUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof HROrganizationUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof HROrganizationUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof HROrganizationUIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of HROrganizationUIServiceBase.
*
* @param {*} [opts={}]
* @memberof HROrganizationUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new HROrganizationAuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
* 初始化视图Map
*
* @memberof HROrganizationUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof HROrganizationUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 初始化主状态操作标识
*
* @memberof HROrganizationUIServiceBase
*/
public initDeMainStateOPPrivsMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof HROrganizationUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({hrorganization: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 HROrganizationUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof HROrganizationUIServiceBase
*/
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:${ this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof HROrganizationUIServiceBase
*/
public getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.warn(`当前数据对象不包含属性${singleMainField},可能会发生错误`);
}
})
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;
}
/**
* 获取数据对象当前操作标识
*
* @param data 当前数据
* @memberof HROrganizationUIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof HROrganizationUIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
import HROrganizationUIServiceBase from './hrorganization-ui-service-base';
/**
* 组织UI服务对象
*
* @export
* @class HROrganizationUIService
*/
export default class HROrganizationUIService extends HROrganizationUIServiceBase {
/**
* Creates an instance of HROrganizationUIService.
*
* @param {*} [opts={}]
* @memberof HROrganizationUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
...@@ -39,7 +39,13 @@ export class UIServiceRegister { ...@@ -39,7 +39,13 @@ export class UIServiceRegister {
* @memberof UIServiceRegister * @memberof UIServiceRegister
*/ */
protected init(): void { protected init(): void {
this.allUIService.set('hremployee', () => import('@/uiservice/hremployee/hremployee-ui-service')); this.allUIService.set('hroperationunit', () => import('@/uiservice/hroperation-unit/hroperation-unit-ui-service'));
this.allUIService.set('hromhierarchypurposeref', () => import('@/uiservice/hromhierarchy-purpose-ref/hromhierarchy-purpose-ref-ui-service'));
this.allUIService.set('hromhierarchycat', () => import('@/uiservice/hromhierarchy-cat/hromhierarchy-cat-ui-service'));
this.allUIService.set('hremployee', () => import('@/uiservice/hremployee/hremployee-ui-service'));
this.allUIService.set('hromhierarchypurpose', () => import('@/uiservice/hromhierarchypurpose/hromhierarchypurpose-ui-service'));
this.allUIService.set('hromhierarchy', () => import('@/uiservice/hromhierarchy/hromhierarchy-ui-service'));
this.allUIService.set('hrorganization', () => import('@/uiservice/hrorganization/hrorganization-ui-service'));
} }
/** /**
......
...@@ -73,6 +73,27 @@ export default class PIMModel { ...@@ -73,6 +73,27 @@ export default class PIMModel {
textcls: '', textcls: '',
appfunctag: '', appfunctag: '',
resourcetag: '', resourcetag: '',
items: [
{
id: 'A8D78DD5-209F-4ADF-8B05-72F646DFCECD',
name: 'menuitem1',
text: '菜单项',
type: 'MENUITEM',
counterid: '',
tooltip: '菜单项',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
}
,
],
} }
, ,
{ {
...@@ -94,24 +115,258 @@ export default class PIMModel { ...@@ -94,24 +115,258 @@ export default class PIMModel {
resourcetag: '', resourcetag: '',
items: [ items: [
{ {
id: '4b24bf3dc681c591cb1663ce8853cc32', id: '1F73FB8E-0E2A-4B7A-B800-004B01AB2301',
name: 'menuitem15', name: 'menuitem5',
text: '员工信息', text: '人员',
type: 'MENUITEM', type: 'MENUITEM',
counterid: '', counterid: '',
tooltip: '员工信息', tooltip: '人员',
expanded: false, expanded: false,
separator: false, separator: false,
hidden: false, hidden: false,
hidesidebar: false, hidesidebar: false,
opendefault: false, opendefault: false,
iconcls: 'fa fa-user', iconcls: 'fa fa-users',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_2', appfunctag: '',
appfuncyype: 'APPVIEW', resourcetag: '',
viewname: 'hremployee-grid-view', items: [
{
id: '4b24bf3dc681c591cb1663ce8853cc32',
name: 'menuitem15',
text: '员工信息',
type: 'MENUITEM',
counterid: '',
tooltip: '员工信息',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: 'fa fa-user',
icon: '',
textcls: '',
appfunctag: '_2',
appfuncyype: 'APPVIEW',
viewname: 'hremployee-grid-view',
resourcetag: '',
}
,
],
}
,
{
id: 'B25E7335-DEBD-478A-81FD-1BB47B68DFA4',
name: 'menuitem2',
text: '组织',
type: 'MENUITEM',
counterid: '',
tooltip: '组织',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: 'fa fa-bank',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '', resourcetag: '',
items: [
{
id: '98B816C8-2AA6-4BB4-9CC5-C2B72A61C24B',
name: 'menuitem4',
text: '法人',
type: 'MENUITEM',
counterid: '',
tooltip: '法人',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
}
,
{
id: '7950AF8B-457E-4B66-9E43-48FA95ED5A0C',
name: 'menuitem6',
text: '运营单位',
type: 'MENUITEM',
counterid: '',
tooltip: '运营单位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
}
,
{
id: '8BCD342D-9983-4932-85AF-C31662BCE75A',
name: 'menuitem7',
text: '组织层次结构',
type: 'MENUITEM',
counterid: '',
tooltip: '组织层次结构',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
}
,
{
id: 'FE369EC4-CF71-49D9-A247-8572CFAB910E',
name: 'menuitem8',
text: '组织层次结构应用',
type: 'MENUITEM',
counterid: '',
tooltip: '组织层次结构应用',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
}
,
{
id: 'F4927234-CF7B-44BA-AECC-24318EF8B794',
name: 'menuitem9',
text: '内部组织',
type: 'MENUITEM',
counterid: '',
tooltip: '内部组织',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
}
,
{
id: 'E065C1FE-A872-4209-A254-67DE568A5F43',
name: 'menuitem10',
text: '职位',
type: 'MENUITEM',
counterid: '',
tooltip: '职位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
items: [
{
id: 'F40EFB9B-4A24-45F2-8CD1-BD9CFD890109',
name: 'menuitem11',
text: '有效职位',
type: 'MENUITEM',
counterid: '',
tooltip: '有效职位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
}
,
{
id: '5866C16B-4C55-4E2C-8229-15F7533B9E4F',
name: 'menuitem12',
text: '空缺职位',
type: 'MENUITEM',
counterid: '',
tooltip: '空缺职位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
}
,
{
id: '0E9C48F5-46B8-4F0C-915D-27A35AEAD41C',
name: 'menuitem13',
text: '所有职位',
type: 'MENUITEM',
counterid: '',
tooltip: '所有职位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
}
,
{
id: '876E25B2-96E1-430F-890B-80DA30FA4DE8',
name: 'menuitem14',
text: '无效职位',
type: 'MENUITEM',
counterid: '',
tooltip: '无效职位',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
}
,
],
}
,
],
} }
, ,
], ],
......
...@@ -7,9 +7,33 @@ logging: ...@@ -7,9 +7,33 @@ logging:
#zuul网关路由设置 #zuul网关路由设置
zuul: zuul:
routes: routes:
hroperationunit:
path: /hroperationunits/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hromhierarchypurposeref:
path: /hromhierarchypurposerefs/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hromhierarchycat:
path: /hromhierarchycats/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hremployee: hremployee:
path: /hremployees/** path: /hremployees/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi} serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false stripPrefix: false
hromhierarchypurpose:
path: /hromhierarchypurposes/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hromhierarchy:
path: /hromhierarchies/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrorganization:
path: /hrorganizations/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
sensitive-headers: sensitive-headers:
- Cookie,Set-Cookie,Authorization - Cookie,Set-Cookie,Authorization
...@@ -29,7 +29,7 @@ import com.baomidou.mybatisplus.annotation.*; ...@@ -29,7 +29,7 @@ import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.humanresource.util.domain.EntityMP; import cn.ibizlab.humanresource.util.domain.EntityMP;
/** /**
* 实体[组织层次机构目的] * 实体[组织层次结构应用]
*/ */
@Getter @Getter
@Setter @Setter
......
...@@ -39,7 +39,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -39,7 +39,7 @@ import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/** /**
* 实体[组织层次机构目的] 服务对象接口实现 * 实体[组织层次结构应用] 服务对象接口实现
*/ */
@Slf4j @Slf4j
@Service("HROMHIERARCHYPURPOSEServiceImpl") @Service("HROMHIERARCHYPURPOSEServiceImpl")
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<!--输出实体[HROMHIERARCHYPURPOSE]数据结构 --> <!--输出实体[HROMHIERARCHYPURPOSE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchypurpose-3-5"> <changeSet author="a_LAB01_e85d8801c" id="tab-hromhierarchypurpose-7-5">
<createTable tableName="OMHIERARCHYPURPOSE"> <createTable tableName="OMHIERARCHYPURPOSE">
<column name="UPDATEDATE" remarks="" type="DATETIME"> <column name="UPDATEDATE" remarks="" type="DATETIME">
</column> </column>
......
...@@ -4,11 +4,59 @@ ...@@ -4,11 +4,59 @@
], ],
"entities":[ "entities":[
{ {
"dename":"HROperationUnit",
"delogicname":"运营单位",
"sysmoudle":{"id":"BASE","name":"基础"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HROMHierarchyPurposeRef",
"delogicname":"组织层次结构分配",
"sysmoudle":{"id":"BASE","name":"基础"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HROMHierarchyCat",
"delogicname":"结构层次类别",
"sysmoudle":{"id":"BASE","name":"基础"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HREmployee", "dename":"HREmployee",
"delogicname":"员工", "delogicname":"员工",
"sysmoudle":{"id":"HUMANRESOURCE","name":"人力"}, "sysmoudle":{"id":"HUMANRESOURCE","name":"人力"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }], "deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HROMHIERARCHYPURPOSE",
"delogicname":"组织层次结构应用",
"sysmoudle":{"id":"BASE","name":"基础"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HROMHierarchy",
"delogicname":"组织层次结构",
"sysmoudle":{"id":"BASE","name":"基础"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HROrganization",
"delogicname":"组织",
"sysmoudle":{"id":"BASE","name":"基础"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}] "datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
} }
], ],
...@@ -17,7 +65,7 @@ ...@@ -17,7 +65,7 @@
{ {
"appid":"PIM", "appid":"PIM",
"appname":"基础管理", "appname":"基础管理",
"appmenu":[{"menuid":"PIM", "menuname":"PIM", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" , "items":[{ "id":"menuitem3" , "name":"设置" }]},{ "id":"top_menus" , "name":"顶部菜单" },{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem15" , "name":"员工信息" }]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] }] "appmenu":[{"menuid":"PIM", "menuname":"PIM", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" , "items":[{ "id":"menuitem3" , "name":"设置" }]},{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem1" , "name":"菜单项" }]},{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem5" , "name":"人员" , "items":[{ "id":"menuitem15" , "name":"员工信息" }]},{ "id":"menuitem2" , "name":"组织" , "items":[{ "id":"menuitem4" , "name":"法人" },{ "id":"menuitem6" , "name":"运营单位" },{ "id":"menuitem7" , "name":"组织层次结构" },{ "id":"menuitem8" , "name":"组织层次结构应用" },{ "id":"menuitem9" , "name":"内部组织" },{ "id":"menuitem10" , "name":"职位" , "items":[{ "id":"menuitem11" , "name":"有效职位" },{ "id":"menuitem12" , "name":"空缺职位" },{ "id":"menuitem13" , "name":"所有职位" },{ "id":"menuitem14" , "name":"无效职位" }]}]}]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] }]
} }
] ]
} }
package cn.ibizlab.humanresource.hrapi.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.humanresource.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[HROMHIERARCHYPURPOSEDTO]
*/
@Data
public class HROMHIERARCHYPURPOSEDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [OMHIERARCHYPURPOSENAME]
*
*/
@JSONField(name = "omhierarchypurposename")
@JsonProperty("omhierarchypurposename")
private String omhierarchypurposename;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [OMHIERARCHYPURPOSEID]
*
*/
@JSONField(name = "omhierarchypurposeid")
@JsonProperty("omhierarchypurposeid")
private String omhierarchypurposeid;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 设置 [OMHIERARCHYPURPOSENAME]
*/
public void setOmhierarchypurposename(String omhierarchypurposename){
this.omhierarchypurposename = omhierarchypurposename ;
this.modify("omhierarchypurposename",omhierarchypurposename);
}
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[HROMHierarchyCatDTO]
*/
@Data
public class HROMHierarchyCatDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [OMHIERARCHYCATID]
*
*/
@JSONField(name = "omhierarchycatid")
@JsonProperty("omhierarchycatid")
private String omhierarchycatid;
/**
* 属性 [OMHIERARCHYCATNAME]
*
*/
@JSONField(name = "omhierarchycatname")
@JsonProperty("omhierarchycatname")
private String omhierarchycatname;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 设置 [OMHIERARCHYCATNAME]
*/
public void setOmhierarchycatname(String omhierarchycatname){
this.omhierarchycatname = omhierarchycatname ;
this.modify("omhierarchycatname",omhierarchycatname);
}
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[HROMHierarchyDTO]
*/
@Data
public class HROMHierarchyDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [OMHIERARCHYID]
*
*/
@JSONField(name = "omhierarchyid")
@JsonProperty("omhierarchyid")
private String omhierarchyid;
/**
* 属性 [OMHIERARCHYNAME]
*
*/
@JSONField(name = "omhierarchyname")
@JsonProperty("omhierarchyname")
private String omhierarchyname;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [ORGANIZATIONID]
*
*/
@JSONField(name = "organizationid")
@JsonProperty("organizationid")
private String organizationid;
/**
* 属性 [POMHIERARCHYID]
*
*/
@JSONField(name = "pomhierarchyid")
@JsonProperty("pomhierarchyid")
private String pomhierarchyid;
/**
* 设置 [OMHIERARCHYNAME]
*/
public void setOmhierarchyname(String omhierarchyname){
this.omhierarchyname = omhierarchyname ;
this.modify("omhierarchyname",omhierarchyname);
}
/**
* 设置 [ORGANIZATIONID]
*/
public void setOrganizationid(String organizationid){
this.organizationid = organizationid ;
this.modify("organizationid",organizationid);
}
/**
* 设置 [POMHIERARCHYID]
*/
public void setPomhierarchyid(String pomhierarchyid){
this.pomhierarchyid = pomhierarchyid ;
this.modify("pomhierarchyid",pomhierarchyid);
}
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[HROMHierarchyPurposeRefDTO]
*/
@Data
public class HROMHierarchyPurposeRefDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [OMHIERARCHYPURPOSEREFNAME]
*
*/
@JSONField(name = "omhierarchypurposerefname")
@JsonProperty("omhierarchypurposerefname")
private String omhierarchypurposerefname;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [OMHIERARCHYPURPOSEREFID]
*
*/
@JSONField(name = "omhierarchypurposerefid")
@JsonProperty("omhierarchypurposerefid")
private String omhierarchypurposerefid;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [OMHIERARCHYPURPOSEID]
*
*/
@JSONField(name = "omhierarchypurposeid")
@JsonProperty("omhierarchypurposeid")
private String omhierarchypurposeid;
/**
* 属性 [OMHIERARCHYCATID]
*
*/
@JSONField(name = "omhierarchycatid")
@JsonProperty("omhierarchycatid")
private String omhierarchycatid;
/**
* 设置 [OMHIERARCHYPURPOSEREFNAME]
*/
public void setOmhierarchypurposerefname(String omhierarchypurposerefname){
this.omhierarchypurposerefname = omhierarchypurposerefname ;
this.modify("omhierarchypurposerefname",omhierarchypurposerefname);
}
/**
* 设置 [OMHIERARCHYPURPOSEID]
*/
public void setOmhierarchypurposeid(String omhierarchypurposeid){
this.omhierarchypurposeid = omhierarchypurposeid ;
this.modify("omhierarchypurposeid",omhierarchypurposeid);
}
/**
* 设置 [OMHIERARCHYCATID]
*/
public void setOmhierarchycatid(String omhierarchycatid){
this.omhierarchycatid = omhierarchycatid ;
this.modify("omhierarchycatid",omhierarchycatid);
}
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[HROperationUnitDTO]
*/
@Data
public class HROperationUnitDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [OPERATIONUNITID]
*
*/
@JSONField(name = "operationunitid")
@JsonProperty("operationunitid")
private String operationunitid;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [OPERATIONUNITNAME]
*
*/
@JSONField(name = "operationunitname")
@JsonProperty("operationunitname")
private String operationunitname;
/**
* 属性 [ORGANIZATIONTYPE]
*
*/
@JSONField(name = "organizationtype")
@JsonProperty("organizationtype")
private String organizationtype;
/**
* 设置 [OPERATIONUNITNAME]
*/
public void setOperationunitname(String operationunitname){
this.operationunitname = operationunitname ;
this.modify("operationunitname",operationunitname);
}
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[HROrganizationDTO]
*/
@Data
public class HROrganizationDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [ORGANIZATIONNAME]
*
*/
@JSONField(name = "organizationname")
@JsonProperty("organizationname")
private String organizationname;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [ORGANIZATIONID]
*
*/
@JSONField(name = "organizationid")
@JsonProperty("organizationid")
private String organizationid;
/**
* 属性 [ORGANIZATIONTYPE]
*
*/
@JSONField(name = "organizationtype")
@JsonProperty("organizationtype")
private String organizationtype;
/**
* 设置 [ORGANIZATIONNAME]
*/
public void setOrganizationname(String organizationname){
this.organizationname = organizationname ;
this.modify("organizationname",organizationname);
}
/**
* 设置 [ORGANIZATIONTYPE]
*/
public void setOrganizationtype(String organizationtype){
this.organizationtype = organizationtype ;
this.modify("organizationtype",organizationtype);
}
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.base.domain.HROMHIERARCHYPURPOSE;
import cn.ibizlab.humanresource.hrapi.dto.HROMHIERARCHYPURPOSEDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHROMHIERARCHYPURPOSEMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HROMHIERARCHYPURPOSEMapping extends MappingBase<HROMHIERARCHYPURPOSEDTO, HROMHIERARCHYPURPOSE> {
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.base.domain.HROMHierarchyCat;
import cn.ibizlab.humanresource.hrapi.dto.HROMHierarchyCatDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHROMHierarchyCatMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HROMHierarchyCatMapping extends MappingBase<HROMHierarchyCatDTO, HROMHierarchyCat> {
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.base.domain.HROMHierarchy;
import cn.ibizlab.humanresource.hrapi.dto.HROMHierarchyDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHROMHierarchyMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HROMHierarchyMapping extends MappingBase<HROMHierarchyDTO, HROMHierarchy> {
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.base.domain.HROMHierarchyPurposeRef;
import cn.ibizlab.humanresource.hrapi.dto.HROMHierarchyPurposeRefDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHROMHierarchyPurposeRefMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HROMHierarchyPurposeRefMapping extends MappingBase<HROMHierarchyPurposeRefDTO, HROMHierarchyPurposeRef> {
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.base.domain.HROperationUnit;
import cn.ibizlab.humanresource.hrapi.dto.HROperationUnitDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHROperationUnitMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HROperationUnitMapping extends MappingBase<HROperationUnitDTO, HROperationUnit> {
}
package cn.ibizlab.humanresource.hrapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.humanresource.core.base.domain.HROrganization;
import cn.ibizlab.humanresource.hrapi.dto.HROrganizationDTO;
import cn.ibizlab.humanresource.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="HRApiHROrganizationMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface HROrganizationMapping extends MappingBase<HROrganizationDTO, HROrganization> {
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.hrapi.dto.*;
import cn.ibizlab.humanresource.hrapi.mapping.*;
import cn.ibizlab.humanresource.core.base.domain.HROMHIERARCHYPURPOSE;
import cn.ibizlab.humanresource.core.base.service.IHROMHIERARCHYPURPOSEService;
import cn.ibizlab.humanresource.core.base.filter.HROMHIERARCHYPURPOSESearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"组织层次结构应用" })
@RestController("HRApi-hromhierarchypurpose")
@RequestMapping("")
public class HROMHIERARCHYPURPOSEResource {
@Autowired
public IHROMHIERARCHYPURPOSEService hromhierarchypurposeService;
@Autowired
@Lazy
public HROMHIERARCHYPURPOSEMapping hromhierarchypurposeMapping;
@PreAuthorize("hasPermission(this.hromhierarchypurposeMapping.toDomain(#hromhierarchypurposedto),'iBizHumanResources-HROMHIERARCHYPURPOSE-Create')")
@ApiOperation(value = "新建组织层次结构应用", tags = {"组织层次结构应用" }, notes = "新建组织层次结构应用")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchypurposes")
@Transactional
public ResponseEntity<HROMHIERARCHYPURPOSEDTO> create(@RequestBody HROMHIERARCHYPURPOSEDTO hromhierarchypurposedto) {
HROMHIERARCHYPURPOSE domain = hromhierarchypurposeMapping.toDomain(hromhierarchypurposedto);
hromhierarchypurposeService.create(domain);
HROMHIERARCHYPURPOSEDTO dto = hromhierarchypurposeMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hromhierarchypurposeMapping.toDomain(#hromhierarchypurposedtos),'iBizHumanResources-HROMHIERARCHYPURPOSE-Create')")
@ApiOperation(value = "批量新建组织层次结构应用", tags = {"组织层次结构应用" }, notes = "批量新建组织层次结构应用")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchypurposes/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HROMHIERARCHYPURPOSEDTO> hromhierarchypurposedtos) {
hromhierarchypurposeService.createBatch(hromhierarchypurposeMapping.toDomain(hromhierarchypurposedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hromhierarchypurpose" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hromhierarchypurposeService.get(#hromhierarchypurpose_id),'iBizHumanResources-HROMHIERARCHYPURPOSE-Update')")
@ApiOperation(value = "更新组织层次结构应用", tags = {"组织层次结构应用" }, notes = "更新组织层次结构应用")
@RequestMapping(method = RequestMethod.PUT, value = "/hromhierarchypurposes/{hromhierarchypurpose_id}")
@Transactional
public ResponseEntity<HROMHIERARCHYPURPOSEDTO> update(@PathVariable("hromhierarchypurpose_id") String hromhierarchypurpose_id, @RequestBody HROMHIERARCHYPURPOSEDTO hromhierarchypurposedto) {
HROMHIERARCHYPURPOSE domain = hromhierarchypurposeMapping.toDomain(hromhierarchypurposedto);
domain .setOmhierarchypurposeid(hromhierarchypurpose_id);
hromhierarchypurposeService.update(domain );
HROMHIERARCHYPURPOSEDTO dto = hromhierarchypurposeMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hromhierarchypurposeService.getHromhierarchypurposeByEntities(this.hromhierarchypurposeMapping.toDomain(#hromhierarchypurposedtos)),'iBizHumanResources-HROMHIERARCHYPURPOSE-Update')")
@ApiOperation(value = "批量更新组织层次结构应用", tags = {"组织层次结构应用" }, notes = "批量更新组织层次结构应用")
@RequestMapping(method = RequestMethod.PUT, value = "/hromhierarchypurposes/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HROMHIERARCHYPURPOSEDTO> hromhierarchypurposedtos) {
hromhierarchypurposeService.updateBatch(hromhierarchypurposeMapping.toDomain(hromhierarchypurposedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hromhierarchypurposeService.get(#hromhierarchypurpose_id),'iBizHumanResources-HROMHIERARCHYPURPOSE-Remove')")
@ApiOperation(value = "删除组织层次结构应用", tags = {"组织层次结构应用" }, notes = "删除组织层次结构应用")
@RequestMapping(method = RequestMethod.DELETE, value = "/hromhierarchypurposes/{hromhierarchypurpose_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hromhierarchypurpose_id") String hromhierarchypurpose_id) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchypurposeService.remove(hromhierarchypurpose_id));
}
@PreAuthorize("hasPermission(this.hromhierarchypurposeService.getHromhierarchypurposeByIds(#ids),'iBizHumanResources-HROMHIERARCHYPURPOSE-Remove')")
@ApiOperation(value = "批量删除组织层次结构应用", tags = {"组织层次结构应用" }, notes = "批量删除组织层次结构应用")
@RequestMapping(method = RequestMethod.DELETE, value = "/hromhierarchypurposes/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hromhierarchypurposeService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hromhierarchypurposeMapping.toDomain(returnObject.body),'iBizHumanResources-HROMHIERARCHYPURPOSE-Get')")
@ApiOperation(value = "获取组织层次结构应用", tags = {"组织层次结构应用" }, notes = "获取组织层次结构应用")
@RequestMapping(method = RequestMethod.GET, value = "/hromhierarchypurposes/{hromhierarchypurpose_id}")
public ResponseEntity<HROMHIERARCHYPURPOSEDTO> get(@PathVariable("hromhierarchypurpose_id") String hromhierarchypurpose_id) {
HROMHIERARCHYPURPOSE domain = hromhierarchypurposeService.get(hromhierarchypurpose_id);
HROMHIERARCHYPURPOSEDTO dto = hromhierarchypurposeMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取组织层次结构应用草稿", tags = {"组织层次结构应用" }, notes = "获取组织层次结构应用草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hromhierarchypurposes/getdraft")
public ResponseEntity<HROMHIERARCHYPURPOSEDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchypurposeMapping.toDto(hromhierarchypurposeService.getDraft(new HROMHIERARCHYPURPOSE())));
}
@ApiOperation(value = "检查组织层次结构应用", tags = {"组织层次结构应用" }, notes = "检查组织层次结构应用")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchypurposes/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HROMHIERARCHYPURPOSEDTO hromhierarchypurposedto) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchypurposeService.checkKey(hromhierarchypurposeMapping.toDomain(hromhierarchypurposedto)));
}
@PreAuthorize("hasPermission(this.hromhierarchypurposeMapping.toDomain(#hromhierarchypurposedto),'iBizHumanResources-HROMHIERARCHYPURPOSE-Save')")
@ApiOperation(value = "保存组织层次结构应用", tags = {"组织层次结构应用" }, notes = "保存组织层次结构应用")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchypurposes/save")
public ResponseEntity<Boolean> save(@RequestBody HROMHIERARCHYPURPOSEDTO hromhierarchypurposedto) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchypurposeService.save(hromhierarchypurposeMapping.toDomain(hromhierarchypurposedto)));
}
@PreAuthorize("hasPermission(this.hromhierarchypurposeMapping.toDomain(#hromhierarchypurposedtos),'iBizHumanResources-HROMHIERARCHYPURPOSE-Save')")
@ApiOperation(value = "批量保存组织层次结构应用", tags = {"组织层次结构应用" }, notes = "批量保存组织层次结构应用")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchypurposes/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HROMHIERARCHYPURPOSEDTO> hromhierarchypurposedtos) {
hromhierarchypurposeService.saveBatch(hromhierarchypurposeMapping.toDomain(hromhierarchypurposedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROMHIERARCHYPURPOSE-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROMHIERARCHYPURPOSE-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"组织层次结构应用" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hromhierarchypurposes/fetchdefault")
public ResponseEntity<List<HROMHIERARCHYPURPOSEDTO>> fetchDefault(HROMHIERARCHYPURPOSESearchContext context) {
Page<HROMHIERARCHYPURPOSE> domains = hromhierarchypurposeService.searchDefault(context) ;
List<HROMHIERARCHYPURPOSEDTO> list = hromhierarchypurposeMapping.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','iBizHumanResources-HROMHIERARCHYPURPOSE-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROMHIERARCHYPURPOSE-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"组织层次结构应用" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hromhierarchypurposes/searchdefault")
public ResponseEntity<Page<HROMHIERARCHYPURPOSEDTO>> searchDefault(@RequestBody HROMHIERARCHYPURPOSESearchContext context) {
Page<HROMHIERARCHYPURPOSE> domains = hromhierarchypurposeService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hromhierarchypurposeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.hrapi.dto.*;
import cn.ibizlab.humanresource.hrapi.mapping.*;
import cn.ibizlab.humanresource.core.base.domain.HROMHierarchyCat;
import cn.ibizlab.humanresource.core.base.service.IHROMHierarchyCatService;
import cn.ibizlab.humanresource.core.base.filter.HROMHierarchyCatSearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"结构层次类别" })
@RestController("HRApi-hromhierarchycat")
@RequestMapping("")
public class HROMHierarchyCatResource {
@Autowired
public IHROMHierarchyCatService hromhierarchycatService;
@Autowired
@Lazy
public HROMHierarchyCatMapping hromhierarchycatMapping;
@PreAuthorize("hasPermission(this.hromhierarchycatMapping.toDomain(#hromhierarchycatdto),'iBizHumanResources-HROMHierarchyCat-Create')")
@ApiOperation(value = "新建结构层次类别", tags = {"结构层次类别" }, notes = "新建结构层次类别")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchycats")
@Transactional
public ResponseEntity<HROMHierarchyCatDTO> create(@RequestBody HROMHierarchyCatDTO hromhierarchycatdto) {
HROMHierarchyCat domain = hromhierarchycatMapping.toDomain(hromhierarchycatdto);
hromhierarchycatService.create(domain);
HROMHierarchyCatDTO dto = hromhierarchycatMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hromhierarchycatMapping.toDomain(#hromhierarchycatdtos),'iBizHumanResources-HROMHierarchyCat-Create')")
@ApiOperation(value = "批量新建结构层次类别", tags = {"结构层次类别" }, notes = "批量新建结构层次类别")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchycats/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HROMHierarchyCatDTO> hromhierarchycatdtos) {
hromhierarchycatService.createBatch(hromhierarchycatMapping.toDomain(hromhierarchycatdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hromhierarchycat" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hromhierarchycatService.get(#hromhierarchycat_id),'iBizHumanResources-HROMHierarchyCat-Update')")
@ApiOperation(value = "更新结构层次类别", tags = {"结构层次类别" }, notes = "更新结构层次类别")
@RequestMapping(method = RequestMethod.PUT, value = "/hromhierarchycats/{hromhierarchycat_id}")
@Transactional
public ResponseEntity<HROMHierarchyCatDTO> update(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id, @RequestBody HROMHierarchyCatDTO hromhierarchycatdto) {
HROMHierarchyCat domain = hromhierarchycatMapping.toDomain(hromhierarchycatdto);
domain .setOmhierarchycatid(hromhierarchycat_id);
hromhierarchycatService.update(domain );
HROMHierarchyCatDTO dto = hromhierarchycatMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hromhierarchycatService.getHromhierarchycatByEntities(this.hromhierarchycatMapping.toDomain(#hromhierarchycatdtos)),'iBizHumanResources-HROMHierarchyCat-Update')")
@ApiOperation(value = "批量更新结构层次类别", tags = {"结构层次类别" }, notes = "批量更新结构层次类别")
@RequestMapping(method = RequestMethod.PUT, value = "/hromhierarchycats/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HROMHierarchyCatDTO> hromhierarchycatdtos) {
hromhierarchycatService.updateBatch(hromhierarchycatMapping.toDomain(hromhierarchycatdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hromhierarchycatService.get(#hromhierarchycat_id),'iBizHumanResources-HROMHierarchyCat-Remove')")
@ApiOperation(value = "删除结构层次类别", tags = {"结构层次类别" }, notes = "删除结构层次类别")
@RequestMapping(method = RequestMethod.DELETE, value = "/hromhierarchycats/{hromhierarchycat_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchycatService.remove(hromhierarchycat_id));
}
@PreAuthorize("hasPermission(this.hromhierarchycatService.getHromhierarchycatByIds(#ids),'iBizHumanResources-HROMHierarchyCat-Remove')")
@ApiOperation(value = "批量删除结构层次类别", tags = {"结构层次类别" }, notes = "批量删除结构层次类别")
@RequestMapping(method = RequestMethod.DELETE, value = "/hromhierarchycats/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hromhierarchycatService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hromhierarchycatMapping.toDomain(returnObject.body),'iBizHumanResources-HROMHierarchyCat-Get')")
@ApiOperation(value = "获取结构层次类别", tags = {"结构层次类别" }, notes = "获取结构层次类别")
@RequestMapping(method = RequestMethod.GET, value = "/hromhierarchycats/{hromhierarchycat_id}")
public ResponseEntity<HROMHierarchyCatDTO> get(@PathVariable("hromhierarchycat_id") String hromhierarchycat_id) {
HROMHierarchyCat domain = hromhierarchycatService.get(hromhierarchycat_id);
HROMHierarchyCatDTO dto = hromhierarchycatMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取结构层次类别草稿", tags = {"结构层次类别" }, notes = "获取结构层次类别草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hromhierarchycats/getdraft")
public ResponseEntity<HROMHierarchyCatDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchycatMapping.toDto(hromhierarchycatService.getDraft(new HROMHierarchyCat())));
}
@ApiOperation(value = "检查结构层次类别", tags = {"结构层次类别" }, notes = "检查结构层次类别")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchycats/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HROMHierarchyCatDTO hromhierarchycatdto) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchycatService.checkKey(hromhierarchycatMapping.toDomain(hromhierarchycatdto)));
}
@PreAuthorize("hasPermission(this.hromhierarchycatMapping.toDomain(#hromhierarchycatdto),'iBizHumanResources-HROMHierarchyCat-Save')")
@ApiOperation(value = "保存结构层次类别", tags = {"结构层次类别" }, notes = "保存结构层次类别")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchycats/save")
public ResponseEntity<Boolean> save(@RequestBody HROMHierarchyCatDTO hromhierarchycatdto) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchycatService.save(hromhierarchycatMapping.toDomain(hromhierarchycatdto)));
}
@PreAuthorize("hasPermission(this.hromhierarchycatMapping.toDomain(#hromhierarchycatdtos),'iBizHumanResources-HROMHierarchyCat-Save')")
@ApiOperation(value = "批量保存结构层次类别", tags = {"结构层次类别" }, notes = "批量保存结构层次类别")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchycats/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HROMHierarchyCatDTO> hromhierarchycatdtos) {
hromhierarchycatService.saveBatch(hromhierarchycatMapping.toDomain(hromhierarchycatdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROMHierarchyCat-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROMHierarchyCat-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"结构层次类别" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hromhierarchycats/fetchdefault")
public ResponseEntity<List<HROMHierarchyCatDTO>> fetchDefault(HROMHierarchyCatSearchContext context) {
Page<HROMHierarchyCat> domains = hromhierarchycatService.searchDefault(context) ;
List<HROMHierarchyCatDTO> list = hromhierarchycatMapping.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','iBizHumanResources-HROMHierarchyCat-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROMHierarchyCat-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"结构层次类别" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hromhierarchycats/searchdefault")
public ResponseEntity<Page<HROMHierarchyCatDTO>> searchDefault(@RequestBody HROMHierarchyCatSearchContext context) {
Page<HROMHierarchyCat> domains = hromhierarchycatService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hromhierarchycatMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.hrapi.dto.*;
import cn.ibizlab.humanresource.hrapi.mapping.*;
import cn.ibizlab.humanresource.core.base.domain.HROMHierarchyPurposeRef;
import cn.ibizlab.humanresource.core.base.service.IHROMHierarchyPurposeRefService;
import cn.ibizlab.humanresource.core.base.filter.HROMHierarchyPurposeRefSearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"组织层次结构分配" })
@RestController("HRApi-hromhierarchypurposeref")
@RequestMapping("")
public class HROMHierarchyPurposeRefResource {
@Autowired
public IHROMHierarchyPurposeRefService hromhierarchypurposerefService;
@Autowired
@Lazy
public HROMHierarchyPurposeRefMapping hromhierarchypurposerefMapping;
@PreAuthorize("hasPermission(this.hromhierarchypurposerefMapping.toDomain(#hromhierarchypurposerefdto),'iBizHumanResources-HROMHierarchyPurposeRef-Create')")
@ApiOperation(value = "新建组织层次结构分配", tags = {"组织层次结构分配" }, notes = "新建组织层次结构分配")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchypurposerefs")
@Transactional
public ResponseEntity<HROMHierarchyPurposeRefDTO> create(@RequestBody HROMHierarchyPurposeRefDTO hromhierarchypurposerefdto) {
HROMHierarchyPurposeRef domain = hromhierarchypurposerefMapping.toDomain(hromhierarchypurposerefdto);
hromhierarchypurposerefService.create(domain);
HROMHierarchyPurposeRefDTO dto = hromhierarchypurposerefMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hromhierarchypurposerefMapping.toDomain(#hromhierarchypurposerefdtos),'iBizHumanResources-HROMHierarchyPurposeRef-Create')")
@ApiOperation(value = "批量新建组织层次结构分配", tags = {"组织层次结构分配" }, notes = "批量新建组织层次结构分配")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchypurposerefs/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HROMHierarchyPurposeRefDTO> hromhierarchypurposerefdtos) {
hromhierarchypurposerefService.createBatch(hromhierarchypurposerefMapping.toDomain(hromhierarchypurposerefdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hromhierarchypurposeref" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hromhierarchypurposerefService.get(#hromhierarchypurposeref_id),'iBizHumanResources-HROMHierarchyPurposeRef-Update')")
@ApiOperation(value = "更新组织层次结构分配", tags = {"组织层次结构分配" }, notes = "更新组织层次结构分配")
@RequestMapping(method = RequestMethod.PUT, value = "/hromhierarchypurposerefs/{hromhierarchypurposeref_id}")
@Transactional
public ResponseEntity<HROMHierarchyPurposeRefDTO> update(@PathVariable("hromhierarchypurposeref_id") String hromhierarchypurposeref_id, @RequestBody HROMHierarchyPurposeRefDTO hromhierarchypurposerefdto) {
HROMHierarchyPurposeRef domain = hromhierarchypurposerefMapping.toDomain(hromhierarchypurposerefdto);
domain .setOmhierarchypurposerefid(hromhierarchypurposeref_id);
hromhierarchypurposerefService.update(domain );
HROMHierarchyPurposeRefDTO dto = hromhierarchypurposerefMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hromhierarchypurposerefService.getHromhierarchypurposerefByEntities(this.hromhierarchypurposerefMapping.toDomain(#hromhierarchypurposerefdtos)),'iBizHumanResources-HROMHierarchyPurposeRef-Update')")
@ApiOperation(value = "批量更新组织层次结构分配", tags = {"组织层次结构分配" }, notes = "批量更新组织层次结构分配")
@RequestMapping(method = RequestMethod.PUT, value = "/hromhierarchypurposerefs/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HROMHierarchyPurposeRefDTO> hromhierarchypurposerefdtos) {
hromhierarchypurposerefService.updateBatch(hromhierarchypurposerefMapping.toDomain(hromhierarchypurposerefdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hromhierarchypurposerefService.get(#hromhierarchypurposeref_id),'iBizHumanResources-HROMHierarchyPurposeRef-Remove')")
@ApiOperation(value = "删除组织层次结构分配", tags = {"组织层次结构分配" }, notes = "删除组织层次结构分配")
@RequestMapping(method = RequestMethod.DELETE, value = "/hromhierarchypurposerefs/{hromhierarchypurposeref_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hromhierarchypurposeref_id") String hromhierarchypurposeref_id) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchypurposerefService.remove(hromhierarchypurposeref_id));
}
@PreAuthorize("hasPermission(this.hromhierarchypurposerefService.getHromhierarchypurposerefByIds(#ids),'iBizHumanResources-HROMHierarchyPurposeRef-Remove')")
@ApiOperation(value = "批量删除组织层次结构分配", tags = {"组织层次结构分配" }, notes = "批量删除组织层次结构分配")
@RequestMapping(method = RequestMethod.DELETE, value = "/hromhierarchypurposerefs/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hromhierarchypurposerefService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hromhierarchypurposerefMapping.toDomain(returnObject.body),'iBizHumanResources-HROMHierarchyPurposeRef-Get')")
@ApiOperation(value = "获取组织层次结构分配", tags = {"组织层次结构分配" }, notes = "获取组织层次结构分配")
@RequestMapping(method = RequestMethod.GET, value = "/hromhierarchypurposerefs/{hromhierarchypurposeref_id}")
public ResponseEntity<HROMHierarchyPurposeRefDTO> get(@PathVariable("hromhierarchypurposeref_id") String hromhierarchypurposeref_id) {
HROMHierarchyPurposeRef domain = hromhierarchypurposerefService.get(hromhierarchypurposeref_id);
HROMHierarchyPurposeRefDTO dto = hromhierarchypurposerefMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取组织层次结构分配草稿", tags = {"组织层次结构分配" }, notes = "获取组织层次结构分配草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hromhierarchypurposerefs/getdraft")
public ResponseEntity<HROMHierarchyPurposeRefDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchypurposerefMapping.toDto(hromhierarchypurposerefService.getDraft(new HROMHierarchyPurposeRef())));
}
@ApiOperation(value = "检查组织层次结构分配", tags = {"组织层次结构分配" }, notes = "检查组织层次结构分配")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchypurposerefs/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HROMHierarchyPurposeRefDTO hromhierarchypurposerefdto) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchypurposerefService.checkKey(hromhierarchypurposerefMapping.toDomain(hromhierarchypurposerefdto)));
}
@PreAuthorize("hasPermission(this.hromhierarchypurposerefMapping.toDomain(#hromhierarchypurposerefdto),'iBizHumanResources-HROMHierarchyPurposeRef-Save')")
@ApiOperation(value = "保存组织层次结构分配", tags = {"组织层次结构分配" }, notes = "保存组织层次结构分配")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchypurposerefs/save")
public ResponseEntity<Boolean> save(@RequestBody HROMHierarchyPurposeRefDTO hromhierarchypurposerefdto) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchypurposerefService.save(hromhierarchypurposerefMapping.toDomain(hromhierarchypurposerefdto)));
}
@PreAuthorize("hasPermission(this.hromhierarchypurposerefMapping.toDomain(#hromhierarchypurposerefdtos),'iBizHumanResources-HROMHierarchyPurposeRef-Save')")
@ApiOperation(value = "批量保存组织层次结构分配", tags = {"组织层次结构分配" }, notes = "批量保存组织层次结构分配")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchypurposerefs/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HROMHierarchyPurposeRefDTO> hromhierarchypurposerefdtos) {
hromhierarchypurposerefService.saveBatch(hromhierarchypurposerefMapping.toDomain(hromhierarchypurposerefdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROMHierarchyPurposeRef-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROMHierarchyPurposeRef-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"组织层次结构分配" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hromhierarchypurposerefs/fetchdefault")
public ResponseEntity<List<HROMHierarchyPurposeRefDTO>> fetchDefault(HROMHierarchyPurposeRefSearchContext context) {
Page<HROMHierarchyPurposeRef> domains = hromhierarchypurposerefService.searchDefault(context) ;
List<HROMHierarchyPurposeRefDTO> list = hromhierarchypurposerefMapping.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','iBizHumanResources-HROMHierarchyPurposeRef-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROMHierarchyPurposeRef-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"组织层次结构分配" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hromhierarchypurposerefs/searchdefault")
public ResponseEntity<Page<HROMHierarchyPurposeRefDTO>> searchDefault(@RequestBody HROMHierarchyPurposeRefSearchContext context) {
Page<HROMHierarchyPurposeRef> domains = hromhierarchypurposerefService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hromhierarchypurposerefMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.hrapi.dto.*;
import cn.ibizlab.humanresource.hrapi.mapping.*;
import cn.ibizlab.humanresource.core.base.domain.HROMHierarchy;
import cn.ibizlab.humanresource.core.base.service.IHROMHierarchyService;
import cn.ibizlab.humanresource.core.base.filter.HROMHierarchySearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"组织层次结构" })
@RestController("HRApi-hromhierarchy")
@RequestMapping("")
public class HROMHierarchyResource {
@Autowired
public IHROMHierarchyService hromhierarchyService;
@Autowired
@Lazy
public HROMHierarchyMapping hromhierarchyMapping;
@PreAuthorize("hasPermission(this.hromhierarchyMapping.toDomain(#hromhierarchydto),'iBizHumanResources-HROMHierarchy-Create')")
@ApiOperation(value = "新建组织层次结构", tags = {"组织层次结构" }, notes = "新建组织层次结构")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchies")
@Transactional
public ResponseEntity<HROMHierarchyDTO> create(@RequestBody HROMHierarchyDTO hromhierarchydto) {
HROMHierarchy domain = hromhierarchyMapping.toDomain(hromhierarchydto);
hromhierarchyService.create(domain);
HROMHierarchyDTO dto = hromhierarchyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hromhierarchyMapping.toDomain(#hromhierarchydtos),'iBizHumanResources-HROMHierarchy-Create')")
@ApiOperation(value = "批量新建组织层次结构", tags = {"组织层次结构" }, notes = "批量新建组织层次结构")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchies/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HROMHierarchyDTO> hromhierarchydtos) {
hromhierarchyService.createBatch(hromhierarchyMapping.toDomain(hromhierarchydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hromhierarchy" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hromhierarchyService.get(#hromhierarchy_id),'iBizHumanResources-HROMHierarchy-Update')")
@ApiOperation(value = "更新组织层次结构", tags = {"组织层次结构" }, notes = "更新组织层次结构")
@RequestMapping(method = RequestMethod.PUT, value = "/hromhierarchies/{hromhierarchy_id}")
@Transactional
public ResponseEntity<HROMHierarchyDTO> update(@PathVariable("hromhierarchy_id") String hromhierarchy_id, @RequestBody HROMHierarchyDTO hromhierarchydto) {
HROMHierarchy domain = hromhierarchyMapping.toDomain(hromhierarchydto);
domain .setOmhierarchyid(hromhierarchy_id);
hromhierarchyService.update(domain );
HROMHierarchyDTO dto = hromhierarchyMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hromhierarchyService.getHromhierarchyByEntities(this.hromhierarchyMapping.toDomain(#hromhierarchydtos)),'iBizHumanResources-HROMHierarchy-Update')")
@ApiOperation(value = "批量更新组织层次结构", tags = {"组织层次结构" }, notes = "批量更新组织层次结构")
@RequestMapping(method = RequestMethod.PUT, value = "/hromhierarchies/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HROMHierarchyDTO> hromhierarchydtos) {
hromhierarchyService.updateBatch(hromhierarchyMapping.toDomain(hromhierarchydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hromhierarchyService.get(#hromhierarchy_id),'iBizHumanResources-HROMHierarchy-Remove')")
@ApiOperation(value = "删除组织层次结构", tags = {"组织层次结构" }, notes = "删除组织层次结构")
@RequestMapping(method = RequestMethod.DELETE, value = "/hromhierarchies/{hromhierarchy_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hromhierarchy_id") String hromhierarchy_id) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchyService.remove(hromhierarchy_id));
}
@PreAuthorize("hasPermission(this.hromhierarchyService.getHromhierarchyByIds(#ids),'iBizHumanResources-HROMHierarchy-Remove')")
@ApiOperation(value = "批量删除组织层次结构", tags = {"组织层次结构" }, notes = "批量删除组织层次结构")
@RequestMapping(method = RequestMethod.DELETE, value = "/hromhierarchies/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hromhierarchyService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hromhierarchyMapping.toDomain(returnObject.body),'iBizHumanResources-HROMHierarchy-Get')")
@ApiOperation(value = "获取组织层次结构", tags = {"组织层次结构" }, notes = "获取组织层次结构")
@RequestMapping(method = RequestMethod.GET, value = "/hromhierarchies/{hromhierarchy_id}")
public ResponseEntity<HROMHierarchyDTO> get(@PathVariable("hromhierarchy_id") String hromhierarchy_id) {
HROMHierarchy domain = hromhierarchyService.get(hromhierarchy_id);
HROMHierarchyDTO dto = hromhierarchyMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取组织层次结构草稿", tags = {"组织层次结构" }, notes = "获取组织层次结构草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hromhierarchies/getdraft")
public ResponseEntity<HROMHierarchyDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchyMapping.toDto(hromhierarchyService.getDraft(new HROMHierarchy())));
}
@ApiOperation(value = "检查组织层次结构", tags = {"组织层次结构" }, notes = "检查组织层次结构")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchies/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HROMHierarchyDTO hromhierarchydto) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchyService.checkKey(hromhierarchyMapping.toDomain(hromhierarchydto)));
}
@PreAuthorize("hasPermission(this.hromhierarchyMapping.toDomain(#hromhierarchydto),'iBizHumanResources-HROMHierarchy-Save')")
@ApiOperation(value = "保存组织层次结构", tags = {"组织层次结构" }, notes = "保存组织层次结构")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchies/save")
public ResponseEntity<Boolean> save(@RequestBody HROMHierarchyDTO hromhierarchydto) {
return ResponseEntity.status(HttpStatus.OK).body(hromhierarchyService.save(hromhierarchyMapping.toDomain(hromhierarchydto)));
}
@PreAuthorize("hasPermission(this.hromhierarchyMapping.toDomain(#hromhierarchydtos),'iBizHumanResources-HROMHierarchy-Save')")
@ApiOperation(value = "批量保存组织层次结构", tags = {"组织层次结构" }, notes = "批量保存组织层次结构")
@RequestMapping(method = RequestMethod.POST, value = "/hromhierarchies/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HROMHierarchyDTO> hromhierarchydtos) {
hromhierarchyService.saveBatch(hromhierarchyMapping.toDomain(hromhierarchydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROMHierarchy-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROMHierarchy-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"组织层次结构" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hromhierarchies/fetchdefault")
public ResponseEntity<List<HROMHierarchyDTO>> fetchDefault(HROMHierarchySearchContext context) {
Page<HROMHierarchy> domains = hromhierarchyService.searchDefault(context) ;
List<HROMHierarchyDTO> list = hromhierarchyMapping.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','iBizHumanResources-HROMHierarchy-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROMHierarchy-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"组织层次结构" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hromhierarchies/searchdefault")
public ResponseEntity<Page<HROMHierarchyDTO>> searchDefault(@RequestBody HROMHierarchySearchContext context) {
Page<HROMHierarchy> domains = hromhierarchyService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hromhierarchyMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.hrapi.dto.*;
import cn.ibizlab.humanresource.hrapi.mapping.*;
import cn.ibizlab.humanresource.core.base.domain.HROperationUnit;
import cn.ibizlab.humanresource.core.base.service.IHROperationUnitService;
import cn.ibizlab.humanresource.core.base.filter.HROperationUnitSearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"运营单位" })
@RestController("HRApi-hroperationunit")
@RequestMapping("")
public class HROperationUnitResource {
@Autowired
public IHROperationUnitService hroperationunitService;
@Autowired
@Lazy
public HROperationUnitMapping hroperationunitMapping;
@PreAuthorize("hasPermission(this.hroperationunitMapping.toDomain(#hroperationunitdto),'iBizHumanResources-HROperationUnit-Create')")
@ApiOperation(value = "新建运营单位", tags = {"运营单位" }, notes = "新建运营单位")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits")
@Transactional
public ResponseEntity<HROperationUnitDTO> create(@RequestBody HROperationUnitDTO hroperationunitdto) {
HROperationUnit domain = hroperationunitMapping.toDomain(hroperationunitdto);
hroperationunitService.create(domain);
HROperationUnitDTO dto = hroperationunitMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hroperationunitMapping.toDomain(#hroperationunitdtos),'iBizHumanResources-HROperationUnit-Create')")
@ApiOperation(value = "批量新建运营单位", tags = {"运营单位" }, notes = "批量新建运营单位")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HROperationUnitDTO> hroperationunitdtos) {
hroperationunitService.createBatch(hroperationunitMapping.toDomain(hroperationunitdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hroperationunit" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hroperationunitService.get(#hroperationunit_id),'iBizHumanResources-HROperationUnit-Update')")
@ApiOperation(value = "更新运营单位", tags = {"运营单位" }, notes = "更新运营单位")
@RequestMapping(method = RequestMethod.PUT, value = "/hroperationunits/{hroperationunit_id}")
@Transactional
public ResponseEntity<HROperationUnitDTO> update(@PathVariable("hroperationunit_id") String hroperationunit_id, @RequestBody HROperationUnitDTO hroperationunitdto) {
HROperationUnit domain = hroperationunitMapping.toDomain(hroperationunitdto);
domain .setOperationunitid(hroperationunit_id);
hroperationunitService.update(domain );
HROperationUnitDTO dto = hroperationunitMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hroperationunitService.getHroperationunitByEntities(this.hroperationunitMapping.toDomain(#hroperationunitdtos)),'iBizHumanResources-HROperationUnit-Update')")
@ApiOperation(value = "批量更新运营单位", tags = {"运营单位" }, notes = "批量更新运营单位")
@RequestMapping(method = RequestMethod.PUT, value = "/hroperationunits/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HROperationUnitDTO> hroperationunitdtos) {
hroperationunitService.updateBatch(hroperationunitMapping.toDomain(hroperationunitdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hroperationunitService.get(#hroperationunit_id),'iBizHumanResources-HROperationUnit-Remove')")
@ApiOperation(value = "删除运营单位", tags = {"运营单位" }, notes = "删除运营单位")
@RequestMapping(method = RequestMethod.DELETE, value = "/hroperationunits/{hroperationunit_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hroperationunit_id") String hroperationunit_id) {
return ResponseEntity.status(HttpStatus.OK).body(hroperationunitService.remove(hroperationunit_id));
}
@PreAuthorize("hasPermission(this.hroperationunitService.getHroperationunitByIds(#ids),'iBizHumanResources-HROperationUnit-Remove')")
@ApiOperation(value = "批量删除运营单位", tags = {"运营单位" }, notes = "批量删除运营单位")
@RequestMapping(method = RequestMethod.DELETE, value = "/hroperationunits/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hroperationunitService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hroperationunitMapping.toDomain(returnObject.body),'iBizHumanResources-HROperationUnit-Get')")
@ApiOperation(value = "获取运营单位", tags = {"运营单位" }, notes = "获取运营单位")
@RequestMapping(method = RequestMethod.GET, value = "/hroperationunits/{hroperationunit_id}")
public ResponseEntity<HROperationUnitDTO> get(@PathVariable("hroperationunit_id") String hroperationunit_id) {
HROperationUnit domain = hroperationunitService.get(hroperationunit_id);
HROperationUnitDTO dto = hroperationunitMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取运营单位草稿", tags = {"运营单位" }, notes = "获取运营单位草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hroperationunits/getdraft")
public ResponseEntity<HROperationUnitDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hroperationunitMapping.toDto(hroperationunitService.getDraft(new HROperationUnit())));
}
@ApiOperation(value = "检查运营单位", tags = {"运营单位" }, notes = "检查运营单位")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HROperationUnitDTO hroperationunitdto) {
return ResponseEntity.status(HttpStatus.OK).body(hroperationunitService.checkKey(hroperationunitMapping.toDomain(hroperationunitdto)));
}
@PreAuthorize("hasPermission(this.hroperationunitMapping.toDomain(#hroperationunitdto),'iBizHumanResources-HROperationUnit-Save')")
@ApiOperation(value = "保存运营单位", tags = {"运营单位" }, notes = "保存运营单位")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/save")
public ResponseEntity<Boolean> save(@RequestBody HROperationUnitDTO hroperationunitdto) {
return ResponseEntity.status(HttpStatus.OK).body(hroperationunitService.save(hroperationunitMapping.toDomain(hroperationunitdto)));
}
@PreAuthorize("hasPermission(this.hroperationunitMapping.toDomain(#hroperationunitdtos),'iBizHumanResources-HROperationUnit-Save')")
@ApiOperation(value = "批量保存运营单位", tags = {"运营单位" }, notes = "批量保存运营单位")
@RequestMapping(method = RequestMethod.POST, value = "/hroperationunits/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HROperationUnitDTO> hroperationunitdtos) {
hroperationunitService.saveBatch(hroperationunitMapping.toDomain(hroperationunitdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROperationUnit-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROperationUnit-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"运营单位" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hroperationunits/fetchdefault")
public ResponseEntity<List<HROperationUnitDTO>> fetchDefault(HROperationUnitSearchContext context) {
Page<HROperationUnit> domains = hroperationunitService.searchDefault(context) ;
List<HROperationUnitDTO> list = hroperationunitMapping.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','iBizHumanResources-HROperationUnit-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROperationUnit-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"运营单位" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hroperationunits/searchdefault")
public ResponseEntity<Page<HROperationUnitDTO>> searchDefault(@RequestBody HROperationUnitSearchContext context) {
Page<HROperationUnit> domains = hroperationunitService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hroperationunitMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.humanresource.hrapi.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.humanresource.hrapi.dto.*;
import cn.ibizlab.humanresource.hrapi.mapping.*;
import cn.ibizlab.humanresource.core.base.domain.HROrganization;
import cn.ibizlab.humanresource.core.base.service.IHROrganizationService;
import cn.ibizlab.humanresource.core.base.filter.HROrganizationSearchContext;
import cn.ibizlab.humanresource.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"组织" })
@RestController("HRApi-hrorganization")
@RequestMapping("")
public class HROrganizationResource {
@Autowired
public IHROrganizationService hrorganizationService;
@Autowired
@Lazy
public HROrganizationMapping hrorganizationMapping;
@PreAuthorize("hasPermission(this.hrorganizationMapping.toDomain(#hrorganizationdto),'iBizHumanResources-HROrganization-Create')")
@ApiOperation(value = "新建组织", tags = {"组织" }, notes = "新建组织")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations")
@Transactional
public ResponseEntity<HROrganizationDTO> create(@RequestBody HROrganizationDTO hrorganizationdto) {
HROrganization domain = hrorganizationMapping.toDomain(hrorganizationdto);
hrorganizationService.create(domain);
HROrganizationDTO dto = hrorganizationMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorganizationMapping.toDomain(#hrorganizationdtos),'iBizHumanResources-HROrganization-Create')")
@ApiOperation(value = "批量新建组织", tags = {"组织" }, notes = "批量新建组织")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<HROrganizationDTO> hrorganizationdtos) {
hrorganizationService.createBatch(hrorganizationMapping.toDomain(hrorganizationdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrorganization" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrorganizationService.get(#hrorganization_id),'iBizHumanResources-HROrganization-Update')")
@ApiOperation(value = "更新组织", tags = {"组织" }, notes = "更新组织")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}")
@Transactional
public ResponseEntity<HROrganizationDTO> update(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrganizationDTO hrorganizationdto) {
HROrganization domain = hrorganizationMapping.toDomain(hrorganizationdto);
domain .setOrganizationid(hrorganization_id);
hrorganizationService.update(domain );
HROrganizationDTO dto = hrorganizationMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorganizationService.getHrorganizationByEntities(this.hrorganizationMapping.toDomain(#hrorganizationdtos)),'iBizHumanResources-HROrganization-Update')")
@ApiOperation(value = "批量更新组织", tags = {"组织" }, notes = "批量更新组织")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<HROrganizationDTO> hrorganizationdtos) {
hrorganizationService.updateBatch(hrorganizationMapping.toDomain(hrorganizationdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrorganizationService.get(#hrorganization_id),'iBizHumanResources-HROrganization-Remove')")
@ApiOperation(value = "删除组织", tags = {"组织" }, notes = "删除组织")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("hrorganization_id") String hrorganization_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrorganizationService.remove(hrorganization_id));
}
@PreAuthorize("hasPermission(this.hrorganizationService.getHrorganizationByIds(#ids),'iBizHumanResources-HROrganization-Remove')")
@ApiOperation(value = "批量删除组织", tags = {"组织" }, notes = "批量删除组织")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
hrorganizationService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrorganizationMapping.toDomain(returnObject.body),'iBizHumanResources-HROrganization-Get')")
@ApiOperation(value = "获取组织", tags = {"组织" }, notes = "获取组织")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}")
public ResponseEntity<HROrganizationDTO> get(@PathVariable("hrorganization_id") String hrorganization_id) {
HROrganization domain = hrorganizationService.get(hrorganization_id);
HROrganizationDTO dto = hrorganizationMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取组织草稿", tags = {"组织" }, notes = "获取组织草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/getdraft")
public ResponseEntity<HROrganizationDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(hrorganizationMapping.toDto(hrorganizationService.getDraft(new HROrganization())));
}
@ApiOperation(value = "检查组织", tags = {"组织" }, notes = "检查组织")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody HROrganizationDTO hrorganizationdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorganizationService.checkKey(hrorganizationMapping.toDomain(hrorganizationdto)));
}
@PreAuthorize("hasPermission(this.hrorganizationMapping.toDomain(#hrorganizationdto),'iBizHumanResources-HROrganization-Save')")
@ApiOperation(value = "保存组织", tags = {"组织" }, notes = "保存组织")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/save")
public ResponseEntity<Boolean> save(@RequestBody HROrganizationDTO hrorganizationdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorganizationService.save(hrorganizationMapping.toDomain(hrorganizationdto)));
}
@PreAuthorize("hasPermission(this.hrorganizationMapping.toDomain(#hrorganizationdtos),'iBizHumanResources-HROrganization-Save')")
@ApiOperation(value = "批量保存组织", tags = {"组织" }, notes = "批量保存组织")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<HROrganizationDTO> hrorganizationdtos) {
hrorganizationService.saveBatch(hrorganizationMapping.toDomain(hrorganizationdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrganization-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrganization-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"组织" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrorganizations/fetchdefault")
public ResponseEntity<List<HROrganizationDTO>> fetchDefault(HROrganizationSearchContext context) {
Page<HROrganization> domains = hrorganizationService.searchDefault(context) ;
List<HROrganizationDTO> list = hrorganizationMapping.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','iBizHumanResources-HROrganization-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrganization-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"组织" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrorganizations/searchdefault")
public ResponseEntity<Page<HROrganizationDTO>> searchDefault(@RequestBody HROrganizationSearchContext context) {
Page<HROrganization> domains = hrorganizationService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorganizationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册