提交 3a4a5f11 编写于 作者: ibizdev's avatar ibizdev

jackwang 部署微服务应用

上级 18d75b1f
......@@ -674,8 +674,8 @@
"srfkey": "CL_HR_0016",
"emptytext": "未定义",
"codelisttype":"dynamic",
"appdataentity":"",
"appdedataset":"",
"appdataentity":"HREmpState",
"appdedataset":"FetchDefault",
"items": []
},
{
......
......@@ -43,6 +43,7 @@ export class AuthServiceRegister {
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('hrorgcontact', () => import('@/authservice/hrorg-contact/hrorg-contact-auth-service'));
this.allAuthService.set('hrempstate', () => import('@/authservice/hremp-state/hremp-state-auth-service'));
this.allAuthService.set('hremployee', () => import('@/authservice/hremployee/hremployee-auth-service'));
this.allAuthService.set('hrlegal', () => import('@/authservice/hrlegal/hrlegal-auth-service'));
this.allAuthService.set('hrdutyedu', () => import('@/authservice/hrduty-edu/hrduty-edu-auth-service'));
......
import AuthService from '../auth-service';
/**
* 员工状态权限服务对象基类
*
* @export
* @class HREmpStateAuthServiceBase
* @extends {AuthService}
*/
export default class HREmpStateAuthServiceBase extends AuthService {
/**
* Creates an instance of HREmpStateAuthServiceBase.
*
* @param {*} [opts={}]
* @memberof HREmpStateAuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof HREmpStateAuthServiceBase
*/
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 HREmpStateAuthServiceBase from './hremp-state-auth-service-base';
/**
* 员工状态权限服务对象
*
* @export
* @class HREmpStateAuthService
* @extends {HREmpStateAuthServiceBase}
*/
export default class HREmpStateAuthService extends HREmpStateAuthServiceBase {
/**
* Creates an instance of HREmpStateAuthService.
*
* @param {*} [opts={}]
* @memberof HREmpStateAuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import HREmpStateService from '@service/hremp-state/hremp-state-service';
/**
* 代码表--员工状态
*
......@@ -56,20 +57,64 @@ export default class CL_HR_0016 {
* @memberof CL_HR_0016
*/
public queryParamNames:any ={
sort: 'showorder,asc'
}
/**
* 员工状态应用实体服务对象
*
* @type {HREmpStateService}
* @memberof CL_HR_0016
*/
public hrempstateService: HREmpStateService = new HREmpStateService();
/**
* 处理数据
*
* @public
* @param {any[]} items
* @returns {any[]}
* @memberof CL_HR_0016
*/
public doItems(items: any[]): any[] {
let _items: any[] = [];
items.forEach((item: any) => {
let itemdata:any = {};
Object.assign(itemdata,{id:item.hrempstateid});
Object.assign(itemdata,{value:item.hrempstateid});
Object.assign(itemdata,{text:item.hrempstatename});
_items.push(itemdata);
});
return _items;
}
/**
* 获取数据项
*
* @param {*} context
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof CL_HR_0016
*/
public getItems(data: any={}, isloading?: boolean): Promise<any> {
return Promise.reject([]);
public getItems(context: any={}, data: any={}, isloading?: boolean): Promise<any> {
return new Promise((resolve, reject) => {
data = this.handleQueryParam(data);
const promise: Promise<any> = this.hrempstateService.FetchDefault(context, data, isloading);
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
resolve(this.doItems(data));
} else {
resolve([]);
}
}).catch((response: any) => {
console.error(response);
reject(response);
});
});
}
/**
......
/**
* 员工状态
*
* @export
* @interface HREmpState
*/
export interface HREmpState {
/**
* 建立人
*
* @returns {*}
* @memberof HREmpState
*/
createman?: any;
/**
* 员工状态标识
*
* @returns {*}
* @memberof HREmpState
*/
hrempstateid?: any;
/**
* 员工状态名称
*
* @returns {*}
* @memberof HREmpState
*/
hrempstatename?: any;
/**
* 更新人
*
* @returns {*}
* @memberof HREmpState
*/
updateman?: any;
/**
* 更新时间
*
* @returns {*}
* @memberof HREmpState
*/
updatedate?: any;
/**
* 建立时间
*
* @returns {*}
* @memberof HREmpState
*/
createdate?: any;
/**
* 在岗状态
*
* @returns {*}
* @memberof HREmpState
*/
jobstate?: any;
/**
* 排序号
*
* @returns {*}
* @memberof HREmpState
*/
showorder?: any;
/**
* 状态编码
*
* @returns {*}
* @memberof HREmpState
*/
statecode?: any;
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ import hroperationunit_en_US from '@locale/lanres/entities/hroperation-unit/hrop
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 hrorgcontact_en_US from '@locale/lanres/entities/hrorg-contact/hrorg-contact_en_US';
import hrempstate_en_US from '@locale/lanres/entities/hremp-state/hremp-state_en_US';
import hremployee_en_US from '@locale/lanres/entities/hremployee/hremployee_en_US';
import hrlegal_en_US from '@locale/lanres/entities/hrlegal/hrlegal_en_US';
import hrdutyedu_en_US from '@locale/lanres/entities/hrduty-edu/hrduty-edu_en_US';
......@@ -257,6 +258,7 @@ export default {
hromhierarchypurposeref: hromhierarchypurposeref_en_US,
hromhierarchycat: hromhierarchycat_en_US,
hrorgcontact: hrorgcontact_en_US,
hrempstate: hrempstate_en_US,
hremployee: hremployee_en_US,
hrlegal: hrlegal_en_US,
hrdutyedu: hrdutyedu_en_US,
......
......@@ -2,6 +2,7 @@ import hroperationunit_zh_CN from '@locale/lanres/entities/hroperation-unit/hrop
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 hrorgcontact_zh_CN from '@locale/lanres/entities/hrorg-contact/hrorg-contact_zh_CN';
import hrempstate_zh_CN from '@locale/lanres/entities/hremp-state/hremp-state_zh_CN';
import hremployee_zh_CN from '@locale/lanres/entities/hremployee/hremployee_zh_CN';
import hrlegal_zh_CN from '@locale/lanres/entities/hrlegal/hrlegal_zh_CN';
import hrdutyedu_zh_CN from '@locale/lanres/entities/hrduty-edu/hrduty-edu_zh_CN';
......@@ -256,6 +257,7 @@ export default {
hromhierarchypurposeref: hromhierarchypurposeref_zh_CN,
hromhierarchycat: hromhierarchycat_zh_CN,
hrorgcontact: hrorgcontact_zh_CN,
hrempstate: hrempstate_zh_CN,
hremployee: hremployee_zh_CN,
hrlegal: hrlegal_zh_CN,
hrdutyedu: hrdutyedu_zh_CN,
......
export default {
fields: {
createman: "建立人",
hrempstateid: "员工状态标识",
hrempstatename: "员工状态名称",
updateman: "更新人",
updatedate: "更新时间",
createdate: "建立时间",
jobstate: "在岗状态",
showorder: "排序号",
statecode: "状态编码",
},
};
\ No newline at end of file
export default {
fields: {
createman: "建立人",
hrempstateid: "员工状态标识",
hrempstatename: "员工状态名称",
updateman: "更新人",
updatedate: "更新时间",
createdate: "建立时间",
jobstate: "在岗状态",
showorder: "排序号",
statecode: "状态编码",
},
};
\ No newline at end of file
......@@ -630,8 +630,8 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
"srfkey": "CL_HR_0016",
"emptytext": "未定义",
"codelisttype":"dynamic",
"appdataentity":"",
"appdedataset":"",
"appdataentity":"HREmpState",
"appdedataset":"FetchDefault",
"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\/hrempstates\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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\/hrempstates\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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(/^\/hrempstates\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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(/^\/hrempstates\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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(/^\/hrempstates\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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(/^\/hrempstates\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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> = ['hrempstateid'];
const matchArray:any = new RegExp(/^\/hrempstates\/([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.hrempstateid, tempValue.hrempstateid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/hrempstates\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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> = ['hrempstateid'];
const matchArray:any = new RegExp(/^\/hrempstates\/([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(/^\/hrempstates\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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> = ['hrempstateid'];
const matchArray:any = new RegExp(/^\/hrempstates\/([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.hrempstateid, tempValue.hrempstateid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['hrempstateid'] == tempValue['hrempstateid'] ){
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(/^\/hrempstates\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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(/^\/hrempstates\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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> = ['hrempstateid'];
const matchArray:any = new RegExp(/^\/hrempstates\/([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.hrempstateid, tempValue.hrempstateid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['hrempstateid'] == tempValue['hrempstateid'] ){
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(/^\/hrempstates\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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> = ['hrempstateid'];
const matchArray:any = new RegExp(/^\/hrempstates\/([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.hrempstateid, tempValue.hrempstateid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['hrempstateid'] == tempValue['hrempstateid'] ){
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(/^\/hrempstates\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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(/^\/hrempstates\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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(/^\/hrempstates\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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> = ['hrempstateid'];
const matchArray:any = new RegExp(/^\/hrempstates\/([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.hrempstateid, tempValue.hrempstateid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/hrempstates\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:hrempstate 方法: 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> = ['hrempstateid'];
const matchArray:any = new RegExp(/^\/hrempstates\/([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.hrempstateid, tempValue.hrempstateid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
......@@ -11,6 +11,7 @@ import './entity/hroperation-units/hroperation-units';
import './entity/hromhierarchy-purpose-refs/hromhierarchy-purpose-refs';
import './entity/hromhierarchy-cats/hromhierarchy-cats';
import './entity/hrorg-contacts/hrorg-contacts';
import './entity/hremp-states/hremp-states';
import './entity/hremployees/hremployees';
import './entity/hrlegals/hrlegals';
import './entity/hrduty-edus/hrduty-edus';
......
......@@ -43,6 +43,7 @@ export class EntityServiceRegister {
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('hrorgcontact', () => import('@/service/hrorg-contact/hrorg-contact-service'));
this.allEntityService.set('hrempstate', () => import('@/service/hremp-state/hremp-state-service'));
this.allEntityService.set('hremployee', () => import('@/service/hremployee/hremployee-service'));
this.allEntityService.set('hrlegal', () => import('@/service/hrlegal/hrlegal-service'));
this.allEntityService.set('hrdutyedu', () => import('@/service/hrduty-edu/hrduty-edu-service'));
......
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 员工状态服务对象基类
*
* @export
* @class HREmpStateServiceBase
* @extends {EntityServie}
*/
export default class HREmpStateServiceBase extends EntityService {
/**
* Creates an instance of HREmpStateServiceBase.
*
* @param {*} [opts={}]
* @memberof HREmpStateServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof HREmpStateServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='hrempstate';
this.APPDEKEY = 'hrempstateid';
this.APPDENAME = 'hrempstates';
this.APPDETEXT = 'hrempstatename';
this.APPNAME = 'pim';
this.SYSTEMNAME = 'ibizhumanresources';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HREmpStateServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/hrempstates/${context.hrempstate}/select`,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HREmpStateServiceBase
*/
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(`/hrempstates`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HREmpStateServiceBase
*/
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(`/hrempstates/${context.hrempstate}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HREmpStateServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/hrempstates/${context.hrempstate}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HREmpStateServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hrempstates/${context.hrempstate}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HREmpStateServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/hrempstates/getdraft`,isloading);
res.data.hrempstate = data.hrempstate;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HREmpStateServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/hrempstates/${context.hrempstate}/checkkey`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HREmpStateServiceBase
*/
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(`/hrempstates/${context.hrempstate}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HREmpStateServiceBase
*/
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(`/hrempstates/fetchdefault`,tempData,isloading);
return res;
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import HREmpStateServiceBase from './hremp-state-service-base';
/**
* 员工状态服务对象
*
* @export
* @class HREmpStateService
* @extends {HREmpStateServiceBase}
*/
export default class HREmpStateService extends HREmpStateServiceBase {
/**
* Creates an instance of HREmpStateService.
*
* @param {*} [opts={}]
* @memberof HREmpStateService
*/
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 HREmpStateService from '@/service/hremp-state/hremp-state-service';
import HREmpStateAuthService from '@/authservice/hremp-state/hremp-state-auth-service';
/**
* 员工状态UI服务对象基类
*
* @export
* @class HREmpStateUIServiceBase
*/
export default class HREmpStateUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof HREmpStateUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof HREmpStateUIServiceBase
*/
public dataService:HREmpStateService = new HREmpStateService();
/**
* 所有关联视图
*
* @memberof HREmpStateUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof HREmpStateUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof HREmpStateUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof HREmpStateUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof HREmpStateUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof HREmpStateUIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of HREmpStateUIServiceBase.
*
* @param {*} [opts={}]
* @memberof HREmpStateUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new HREmpStateAuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
* 初始化视图Map
*
* @memberof HREmpStateUIServiceBase
*/
public initViewMap(){
}
/**
* 初始化主状态集合
*
* @memberof HREmpStateUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 初始化主状态操作标识
*
* @memberof HREmpStateUIServiceBase
*/
public initDeMainStateOPPrivsMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof HREmpStateUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({hrempstate: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 HREmpStateUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof HREmpStateUIServiceBase
*/
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 HREmpStateUIServiceBase
*/
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 HREmpStateUIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof HREmpStateUIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
import HREmpStateUIServiceBase from './hremp-state-ui-service-base';
/**
* 员工状态UI服务对象
*
* @export
* @class HREmpStateUIService
*/
export default class HREmpStateUIService extends HREmpStateUIServiceBase {
/**
* Creates an instance of HREmpStateUIService.
*
* @param {*} [opts={}]
* @memberof HREmpStateUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
......@@ -43,6 +43,7 @@ export class UIServiceRegister {
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('hrorgcontact', () => import('@/uiservice/hrorg-contact/hrorg-contact-ui-service'));
this.allUIService.set('hrempstate', () => import('@/uiservice/hremp-state/hremp-state-ui-service'));
this.allUIService.set('hremployee', () => import('@/uiservice/hremployee/hremployee-ui-service'));
this.allUIService.set('hrlegal', () => import('@/uiservice/hrlegal/hrlegal-ui-service'));
this.allUIService.set('hrdutyedu', () => import('@/uiservice/hrduty-edu/hrduty-edu-ui-service'));
......
......@@ -23,6 +23,10 @@ zuul:
path: /hrorgcontacts/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hrempstate:
path: /hrempstates/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
stripPrefix: false
hremployee:
path: /hremployees/**
serviceId: ${ibiz.ref.service.ibizhumanresources-hrapi:ibizhumanresources-hrapi}
......
......@@ -36,6 +36,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"HREmpState",
"delogicname":"员工状态",
"sysmoudle":{"id":"HUMANRESOURCE","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",
"delogicname":"员工",
"sysmoudle":{"id":"HUMANRESOURCE","name":"人力"},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册