提交 94ebb895 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码

上级 c4591be4
......@@ -79,6 +79,14 @@
"viewname": "IBZEmployeeGridView",
"viewtag": "40fe6b28b9f7902341da46bb74a02d59"
},
"syspermissionpickupview": {
"title": "权限表数据选择视图",
"caption": "权限/资源",
"viewtype": "DEPICKUPVIEW",
"viewmodule": "uaa",
"viewname": "SysPermissionPickupView",
"viewtag": "53385c6effc6ba778dbccf82286fbe4f"
},
"wfremodeleditview": {
"title": "流程模型编辑视图",
"caption": "流程模型",
......@@ -159,6 +167,14 @@
"viewname": "SysRolePickupGridView",
"viewtag": "7c25865f5864a734477c7cb987632f4f"
},
"syspermissionmpickupview": {
"title": "权限表数据多项选择视图",
"caption": "权限/资源",
"viewtype": "DEMPICKUPVIEW",
"viewmodule": "uaa",
"viewname": "SysPermissionMPickupView",
"viewtag": "86bd4f6d4f771870e10b9717046a1b14"
},
"ibzdepartmenteditview": {
"title": "部门编辑视图",
"caption": "部门",
......@@ -167,6 +183,14 @@
"viewname": "IBZDepartmentEditView",
"viewtag": "90c0ced2720b85d5e051e7935a93d3c5"
},
"syspermissionpickupgridview": {
"title": "权限表选择表格视图",
"caption": "权限/资源",
"viewtype": "DEPICKUPGRIDVIEW",
"viewmodule": "uaa",
"viewname": "SysPermissionPickupGridView",
"viewtag": "95d8c933cf4df47634a25d791b3d8564"
},
"ibzorganizationeditview": {
"title": "单位机构编辑视图",
"caption": "单位机构",
......
......@@ -11,6 +11,7 @@ import wfprocessdefinition_en_US from '@locale/lanres/wfprocess-definition/wfpro
import sysrole_en_US from '@locale/lanres/sys-role/sys-role_en_US';
import ibzdeptmember_en_US from '@locale/lanres/ibzdept-member/ibzdept-member_en_US';
import ibzdepartment_en_US from '@locale/lanres/ibzdepartment/ibzdepartment_en_US';
import syspermission_en_US from '@locale/lanres/sys-permission/sys-permission_en_US';
import ibzemployee_en_US from '@locale/lanres/ibzemployee/ibzemployee_en_US';
import components_en_US from '@locale/lanres/components/components_en_US';
import codelist_en_US from '@locale/lanres/codelist/codelist_en_US';
......@@ -97,6 +98,7 @@ export default {
sysrole: sysrole_en_US,
ibzdeptmember: ibzdeptmember_en_US,
ibzdepartment: ibzdepartment_en_US,
syspermission: syspermission_en_US,
ibzemployee: ibzemployee_en_US,
},
components: components_en_US,
......
......@@ -11,6 +11,7 @@ import wfprocessdefinition_zh_CN from '@locale/lanres/wfprocess-definition/wfpro
import sysrole_zh_CN from '@locale/lanres/sys-role/sys-role_zh_CN';
import ibzdeptmember_zh_CN from '@locale/lanres/ibzdept-member/ibzdept-member_zh_CN';
import ibzdepartment_zh_CN from '@locale/lanres/ibzdepartment/ibzdepartment_zh_CN';
import syspermission_zh_CN from '@locale/lanres/sys-permission/sys-permission_zh_CN';
import ibzemployee_zh_CN from '@locale/lanres/ibzemployee/ibzemployee_zh_CN';
import components_zh_CN from '@locale/lanres/components/components_zh_CN';
import codelist_zh_CN from '@locale/lanres/codelist/codelist_zh_CN';
......@@ -97,6 +98,7 @@ export default {
sysrole: sysrole_zh_CN,
ibzdeptmember: ibzdeptmember_zh_CN,
ibzdepartment: ibzdepartment_zh_CN,
syspermission: syspermission_zh_CN,
ibzemployee: ibzemployee_zh_CN,
},
components: components_zh_CN,
......
export default {
fields: {
permissionid: '资源标识',
permissionname: '资源名称',
permissiontype: '资源类别',
pssystemid: '系统',
enable: '逻辑有效',
createdate: '>',
updatedate: 'Upload',
},
views: {
pickupview: {
caption: "<>",
title: '权限/资源',
},
mpickupview: {
caption: "<>",
title: '权限/资源',
},
pickupgridview: {
caption: "<>",
title: 'Add',
},
},
main_grid: {
columns: {
sys_permissionid: "资源标识",
sys_permissionname: "资源名称",
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: "Restart",
},
uiactions: {
},
},
};
\ No newline at end of file
export default {
fields: {
permissionid: '资源标识',
permissionname: '资源名称',
permissiontype: '资源类别',
pssystemid: '系统',
enable: '逻辑有效',
createdate: '建立时间',
updatedate: '更新时间',
},
views: {
pickupview: {
caption: '权限/资源',
title: '权限/资源',
},
mpickupview: {
caption: '权限/资源',
title: '权限/资源',
},
pickupgridview: {
caption: '权限/资源',
title: '权限/资源',
},
},
main_grid: {
columns: {
sys_permissionid: '资源标识',
sys_permissionname: '资源名称',
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: '常规条件',
},
uiactions: {
},
},
};
\ No newline at end of file
......@@ -20,4 +20,5 @@ import './entity/wfprocess-definitions/wfprocess-definitions';
import './entity/sys-roles/sys-roles';
import './entity/ibzdept-members/ibzdept-members';
import './entity/ibzdepartments/ibzdepartments';
import './entity/sys-permissions/sys-permissions';
import './entity/ibzemployees/ibzemployees';
......@@ -87,6 +87,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "IBZEmployeeGridView",
"viewtag": "40fe6b28b9f7902341da46bb74a02d59"
},
"syspermissionpickupview": {
"title": "权限表数据选择视图",
"caption": "权限/资源",
"viewtype": "DEPICKUPVIEW",
"viewmodule": "uaa",
"viewname": "SysPermissionPickupView",
"viewtag": "53385c6effc6ba778dbccf82286fbe4f"
},
"wfremodeleditview": {
"title": "流程模型编辑视图",
"caption": "流程模型",
......@@ -167,6 +175,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "SysRolePickupGridView",
"viewtag": "7c25865f5864a734477c7cb987632f4f"
},
"syspermissionmpickupview": {
"title": "权限表数据多项选择视图",
"caption": "权限/资源",
"viewtype": "DEMPICKUPVIEW",
"viewmodule": "uaa",
"viewname": "SysPermissionMPickupView",
"viewtag": "86bd4f6d4f771870e10b9717046a1b14"
},
"ibzdepartmenteditview": {
"title": "部门编辑视图",
"caption": "部门",
......@@ -175,6 +191,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "IBZDepartmentEditView",
"viewtag": "90c0ced2720b85d5e051e7935a93d3c5"
},
"syspermissionpickupgridview": {
"title": "权限表选择表格视图",
"caption": "权限/资源",
"viewtype": "DEPICKUPGRIDVIEW",
"viewmodule": "uaa",
"viewname": "SysPermissionPickupGridView",
"viewtag": "95d8c933cf4df47634a25d791b3d8564"
},
"ibzorganizationeditview": {
"title": "单位机构编辑视图",
"caption": "单位机构",
......
......@@ -52,6 +52,7 @@ export class EntityServiceRegister {
this.allEntityService.set('sysrole', () => import('@/service/sys-role/sys-role-service'));
this.allEntityService.set('ibzdeptmember', () => import('@/service/ibzdept-member/ibzdept-member-service'));
this.allEntityService.set('ibzdepartment', () => import('@/service/ibzdepartment/ibzdepartment-service'));
this.allEntityService.set('syspermission', () => import('@/service/sys-permission/sys-permission-service'));
this.allEntityService.set('ibzemployee', () => import('@/service/ibzemployee/ibzemployee-service'));
}
......
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 权限/资源服务对象基类
*
* @export
* @class SysPermissionServiceBase
* @extends {EntityServie}
*/
export default class SysPermissionServiceBase extends EntityService {
/**
* Creates an instance of SysPermissionServiceBase.
*
* @param {*} [opts={}]
* @memberof SysPermissionServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof SysPermissionServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='syspermission';
this.APPDEKEY = 'permissionid';
this.APPDENAME = 'syspermissions';
this.APPDETEXT = 'permissionname';
this.APPNAME = 'web';
this.SYSTEMNAME = 'ibzrt';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/syspermissions/${context.syspermission}/select`,isloading);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
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(`/syspermissions/${context.syspermission}/save`,data,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/syspermissions/getdraft`,isloading);
res.data.syspermission = data.syspermission;
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/syspermissions/${context.syspermission}`,isloading);
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
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(`/syspermissions/${context.syspermission}`,data,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
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(`/syspermissions`,data,isloading);
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/syspermissions/${context.syspermission}/checkkey`,data,isloading);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}`,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/syspermissions/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import SysPermissionServiceBase from './sys-permission-service-base';
/**
* 权限/资源服务对象
*
* @export
* @class SysPermissionService
* @extends {SysPermissionServiceBase}
*/
export default class SysPermissionService extends SysPermissionServiceBase {
/**
* Creates an instance of SysPermissionService.
*
* @param {*} [opts={}]
* @memberof SysPermissionService
*/
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 SysPermissionService from '@/service/sys-permission/sys-permission-service';
/**
* 权限/资源UI服务对象基类
*
* @export
* @class SysPermissionUIServiceBase
*/
export default class SysPermissionUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof SysPermissionUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof SysPermissionUIServiceBase
*/
public dataService:SysPermissionService = new SysPermissionService();
/**
* 所有关联视图
*
* @memberof SysPermissionUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof SysPermissionUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof SysPermissionUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof SysPermissionUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof SysPermissionUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* Creates an instance of SysPermissionUIServiceBase.
*
* @param {*} [opts={}]
* @memberof SysPermissionUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.initViewMap();
this.initDeMainStateMap();
}
/**
* 初始化视图Map
*
* @memberof SysPermissionUIServiceBase
*/
public initViewMap(){
this.allViewMap.set('PICKUPVIEW:',{viewname:'pickupview',srfappde:'syspermissions'});
this.allViewMap.set('MPICKUPVIEW:',{viewname:'mpickupview',srfappde:'syspermissions'});
this.allViewMap.set(':',{viewname:'pickupgridview',srfappde:'syspermissions'});
}
/**
* 初始化主状态集合
*
* @memberof SysPermissionUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof SysPermissionUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({syspermission: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 SysPermissionUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof SysPermissionUIServiceBase
*/
public async getDESDDEViewPDTParam(curData:any, bDataInWF:boolean, bWFMode:boolean){
let strPDTParam:string = '';
if (bDataInWF) {
// 判断数据是否在流程中
}
//多表单,todo
const isEnableMultiForm:boolean = false;
const multiFormDEField:string|null =null;
if (isEnableMultiForm && multiFormDEField) {
const objFormValue:string = curData[multiFormDEField];
if(!Environment.isAppMode){
return 'MOBEDITVIEW'+objFormValue;
}
return 'EDITVIEW'+objFormValue;
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
return `MOBEDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof SysPermissionUIServiceBase
*/
public async getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.error(`当前数据对象不包含属性singleMainField,可能会发生错误`);
}
})
let strTag:String = "";
for (let i = 0; i <= 1; i++) {
let strTag:string = (curData[this.mainStateFields[0]])?(i == 0) ? curData[this.mainStateFields[0]] : "":"";
if (this.mainStateFields.length >= 2) {
for (let j = 0; j <= 1; j++) {
let strTag2:string = (curData[this.mainStateFields[1]])?`${strTag}__${(j == 0) ? curData[this.mainStateFields[1]] : ""}`:strTag;
if (this.mainStateFields.length >= 3) {
for (let k = 0; k <= 1; k++) {
let strTag3:string = (curData[this.mainStateFields[2]])?`${strTag2}__${(k == 0) ? curData[this.mainStateFields[2]] : ""}`:strTag2;
// 判断是否存在
return this.allDeMainStateMap.get(strTag3);
}
}else{
return this.allDeMainStateMap.get(strTag2);
}
}
}else{
return this.allDeMainStateMap.get(strTag);
}
}
return null;
}
}
\ No newline at end of file
import SysPermissionUIServiceBase from './sys-permission-ui-service-base';
/**
* 权限/资源UI服务对象
*
* @export
* @class SysPermissionUIService
*/
export default class SysPermissionUIService extends SysPermissionUIServiceBase {
/**
* Creates an instance of SysPermissionUIService.
*
* @param {*} [opts={}]
* @memberof SysPermissionUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
......@@ -52,6 +52,7 @@ export class UIServiceRegister {
this.allUIService.set('sysrole', () => import('@/uiservice/sys-role/sys-role-ui-service'));
this.allUIService.set('ibzdeptmember', () => import('@/uiservice/ibzdept-member/ibzdept-member-ui-service'));
this.allUIService.set('ibzdepartment', () => import('@/uiservice/ibzdepartment/ibzdepartment-ui-service'));
this.allUIService.set('syspermission', () => import('@/uiservice/sys-permission/sys-permission-ui-service'));
this.allUIService.set('ibzemployee', () => import('@/uiservice/ibzemployee/ibzemployee-ui-service'));
}
......
......@@ -55,6 +55,10 @@ zuul:
path: /ibzdepartments/**
serviceId: ibzou-api
stripPrefix: false
sys_permission:
path: /syspermissions/**
serviceId: ibzuaa-api
stripPrefix: false
ibzemp:
path: /ibzemployees/**
serviceId: ibzou-api
......
......@@ -108,6 +108,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"curorg","name":"当前单位"},{"id":"porg","name":"上级单位"},{"id":"sorg","name":"下级单位"} ]
}
, {
"dename":"SysPermission",
"delogicname":"权限/资源",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
"dename":"IBZEmployee",
"delogicname":"人员",
"sysmoudle":{"id":"OU","name":"ou"},
......
package cn.ibizlab.api.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[SysPermissionDTO]
*/
@Data
public class SysPermissionDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [SYS_PERMISSIONID]
*
*/
@JSONField(name = "permissionid")
@JsonProperty("permissionid")
private String permissionid;
/**
* 属性 [SYS_PERMISSIONNAME]
*
*/
@JSONField(name = "permissionname")
@JsonProperty("permissionname")
private String permissionname;
/**
* 属性 [PERMISSIONTYPE]
*
*/
@JSONField(name = "permissiontype")
@JsonProperty("permissiontype")
private String permissiontype;
/**
* 属性 [PSSYSTEMID]
*
*/
@JSONField(name = "pssystemid")
@JsonProperty("pssystemid")
private String pssystemid;
/**
* 属性 [ENABLE]
*
*/
@JSONField(name = "enable")
@JsonProperty("enable")
private Integer enable;
/**
* 属性 [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;
/**
* 属性 [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;
/**
* 设置 [SYS_PERMISSIONNAME]
*/
public void setPermissionname(String permissionname){
this.permissionname = permissionname ;
this.modify("sys_permissionname",permissionname);
}
/**
* 设置 [PERMISSIONTYPE]
*/
public void setPermissiontype(String permissiontype){
this.permissiontype = permissiontype ;
this.modify("permissiontype",permissiontype);
}
/**
* 设置 [PSSYSTEMID]
*/
public void setPssystemid(String pssystemid){
this.pssystemid = pssystemid ;
this.modify("pssystemid",pssystemid);
}
}
package cn.ibizlab.api.mapping;
import org.mapstruct.*;
import cn.ibizlab.core.uaa.domain.SysPermission;
import cn.ibizlab.api.dto.SysPermissionDTO;
import cn.ibizlab.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface SysPermissionMapping extends MappingBase<SysPermissionDTO, SysPermission> {
}
package cn.ibizlab.api.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.api.dto.*;
import cn.ibizlab.api.mapping.*;
import cn.ibizlab.core.uaa.domain.SysPermission;
import cn.ibizlab.core.uaa.service.ISysPermissionService;
import cn.ibizlab.core.uaa.filter.SysPermissionSearchContext;
@Slf4j
@Api(tags = {"SysPermission" })
@RestController("api-syspermission")
@RequestMapping("")
public class SysPermissionResource {
@Autowired
public ISysPermissionService syspermissionService;
@Autowired
@Lazy
public SysPermissionMapping syspermissionMapping;
@ApiOperation(value = "Save", tags = {"SysPermission" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/save")
public ResponseEntity<Boolean> save(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.save(syspermissionMapping.toDomain(syspermissiondto)));
}
@ApiOperation(value = "SaveBatch", tags = {"SysPermission" }, notes = "SaveBatch")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) {
syspermissionService.saveBatch(syspermissionMapping.toDomain(syspermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "GetDraft", tags = {"SysPermission" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/getdraft")
public ResponseEntity<SysPermissionDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionMapping.toDto(syspermissionService.getDraft(new SysPermission())));
}
@ApiOperation(value = "Remove", tags = {"SysPermission" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/{syspermission_id}")
public ResponseEntity<Boolean> remove(@PathVariable("syspermission_id") String syspermission_id) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.remove(syspermission_id));
}
@ApiOperation(value = "RemoveBatch", tags = {"SysPermission" }, notes = "RemoveBatch")
@RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
syspermissionService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "Update", tags = {"SysPermission" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/syspermissions/{syspermission_id}")
public ResponseEntity<SysPermissionDTO> update(@PathVariable("syspermission_id") String syspermission_id, @RequestBody SysPermissionDTO syspermissiondto) {
SysPermission domain = syspermissionMapping.toDomain(syspermissiondto);
domain .setPermissionid(syspermission_id);
syspermissionService.update(domain );
SysPermissionDTO dto = syspermissionMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "UpdateBatch", tags = {"SysPermission" }, notes = "UpdateBatch")
@RequestMapping(method = RequestMethod.PUT, value = "/syspermissions/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) {
syspermissionService.updateBatch(syspermissionMapping.toDomain(syspermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "Create", tags = {"SysPermission" }, notes = "Create")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions")
public ResponseEntity<SysPermissionDTO> create(@RequestBody SysPermissionDTO syspermissiondto) {
SysPermission domain = syspermissionMapping.toDomain(syspermissiondto);
syspermissionService.create(domain);
SysPermissionDTO dto = syspermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "createBatch", tags = {"SysPermission" }, notes = "createBatch")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) {
syspermissionService.createBatch(syspermissionMapping.toDomain(syspermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "CheckKey", tags = {"SysPermission" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.checkKey(syspermissionMapping.toDomain(syspermissiondto)));
}
@ApiOperation(value = "Get", tags = {"SysPermission" }, notes = "Get")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/{syspermission_id}")
public ResponseEntity<SysPermissionDTO> get(@PathVariable("syspermission_id") String syspermission_id) {
SysPermission domain = syspermissionService.get(syspermission_id);
SysPermissionDTO dto = syspermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "fetchDEFAULT", tags = {"SysPermission" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/syspermissions/fetchdefault")
public ResponseEntity<List<SysPermissionDTO>> fetchDefault(SysPermissionSearchContext context) {
Page<SysPermission> domains = syspermissionService.searchDefault(context) ;
List<SysPermissionDTO> list = syspermissionMapping.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);
}
@ApiOperation(value = "searchDEFAULT", tags = {"SysPermission" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/syspermissions/searchdefault")
public ResponseEntity<Page<SysPermissionDTO>> searchDefault(@RequestBody SysPermissionSearchContext context) {
Page<SysPermission> domains = syspermissionService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(syspermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册