提交 450be376 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码 [ibz-ou,统一组织单位]

上级 8af836e9
......@@ -24,6 +24,8 @@ import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -39,6 +41,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IBZDEPT", resultMap = "SysDepartmentResultMap")
@ApiModel("部门")
public class SysDepartment extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -50,6 +53,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableId(value = "deptid", type = IdType.ASSIGN_UUID)
@JSONField(name = "deptid")
@JsonProperty("deptid")
@ApiModelProperty("部门标识")
private String deptid;
/**
* 部门代码
......@@ -57,6 +61,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "deptcode")
@JSONField(name = "deptcode")
@JsonProperty("deptcode")
@ApiModelProperty("部门代码")
private String deptcode;
/**
* 部门名称
......@@ -64,6 +69,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "deptname")
@JSONField(name = "deptname")
@JsonProperty("deptname")
@ApiModelProperty("部门名称")
private String deptname;
/**
* 单位
......@@ -72,6 +78,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "orgid")
@JSONField(name = "orgid")
@JsonProperty("orgid")
@ApiModelProperty("单位")
private String orgid;
/**
* 上级部门
......@@ -80,6 +87,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "pdeptid")
@JSONField(name = "parentdeptid")
@JsonProperty("parentdeptid")
@ApiModelProperty("上级部门")
private String parentdeptid;
/**
* 部门简称
......@@ -87,6 +95,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "shortname")
@JSONField(name = "shortname")
@JsonProperty("shortname")
@ApiModelProperty("部门简称")
private String shortname;
/**
* 部门级别
......@@ -94,6 +103,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "deptlevel")
@JSONField(name = "deptlevel")
@JsonProperty("deptlevel")
@ApiModelProperty("部门级别")
private Integer deptlevel;
/**
* 区属
......@@ -101,6 +111,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "domains")
@JSONField(name = "domains")
@JsonProperty("domains")
@ApiModelProperty("区属")
private String domains;
/**
* 排序
......@@ -108,6 +119,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "showorder")
@JSONField(name = "showorder")
@JsonProperty("showorder")
@ApiModelProperty("排序")
private Integer showorder;
/**
* 业务编码
......@@ -115,6 +127,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "bcode")
@JSONField(name = "bcode")
@JsonProperty("bcode")
@ApiModelProperty("业务编码")
private String bcode;
/**
* 分管领导标识
......@@ -122,6 +135,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "leaderid")
@JSONField(name = "leaderid")
@JsonProperty("leaderid")
@ApiModelProperty("分管领导标识")
private String leaderid;
/**
* 分管领导
......@@ -129,6 +143,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "leadername")
@JSONField(name = "leadername")
@JsonProperty("leadername")
@ApiModelProperty("分管领导")
private String leadername;
/**
* 逻辑有效
......@@ -138,6 +153,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "enable")
@JSONField(name = "enable")
@JsonProperty("enable")
@ApiModelProperty("逻辑有效")
private Integer enable;
/**
* 单位
......@@ -145,6 +161,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "orgname")
@JsonProperty("orgname")
@ApiModelProperty("单位")
private String orgname;
/**
* 上级部门
......@@ -152,6 +169,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "parentdeptname")
@JsonProperty("parentdeptname")
@ApiModelProperty("上级部门")
private String parentdeptname;
/**
* 创建时间
......@@ -161,6 +179,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@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")
@ApiModelProperty("创建时间")
private Timestamp createdate;
/**
* 最后修改时间
......@@ -170,6 +189,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@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")
@ApiModelProperty("最后修改时间")
private Timestamp updatedate;
/**
* 启用标志
......@@ -178,6 +198,7 @@ public class SysDepartment extends EntityMP implements Serializable {
@TableField(value = "isvalid")
@JSONField(name = "isvalid")
@JsonProperty("isvalid")
@ApiModelProperty("启用标志")
private Integer isvalid;
/**
......
......@@ -24,6 +24,8 @@ import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -39,6 +41,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IBZDEPTMEMBER", resultMap = "SysDeptMemberResultMap")
@ApiModel("部门成员")
public class SysDeptMember extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -50,6 +53,7 @@ public class SysDeptMember extends EntityMP implements Serializable {
@TableId(value = "memberid", type = IdType.ASSIGN_UUID)
@JSONField(name = "memberid")
@JsonProperty("memberid")
@ApiModelProperty("标识")
private String memberid;
/**
* 部门标识
......@@ -57,6 +61,7 @@ public class SysDeptMember extends EntityMP implements Serializable {
@TableField(value = "deptid")
@JSONField(name = "deptid")
@JsonProperty("deptid")
@ApiModelProperty("部门标识")
private String deptid;
/**
* 部门名称
......@@ -64,6 +69,7 @@ public class SysDeptMember extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "deptname")
@JsonProperty("deptname")
@ApiModelProperty("部门名称")
private String deptname;
/**
* 用户标识
......@@ -71,6 +77,7 @@ public class SysDeptMember extends EntityMP implements Serializable {
@TableField(value = "userid")
@JSONField(name = "userid")
@JsonProperty("userid")
@ApiModelProperty("用户标识")
private String userid;
/**
* 成员
......@@ -78,6 +85,7 @@ public class SysDeptMember extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "personname")
@JsonProperty("personname")
@ApiModelProperty("成员")
private String personname;
/**
* 岗位标识
......@@ -85,6 +93,7 @@ public class SysDeptMember extends EntityMP implements Serializable {
@TableField(value = "postid")
@JSONField(name = "postid")
@JsonProperty("postid")
@ApiModelProperty("岗位标识")
private String postid;
/**
* 岗位名称
......@@ -92,6 +101,7 @@ public class SysDeptMember extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "postname")
@JsonProperty("postname")
@ApiModelProperty("岗位名称")
private String postname;
/**
* 业务条线
......@@ -99,6 +109,7 @@ public class SysDeptMember extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "bcode")
@JsonProperty("bcode")
@ApiModelProperty("业务条线")
private String bcode;
/**
* 区属
......@@ -106,6 +117,7 @@ public class SysDeptMember extends EntityMP implements Serializable {
@TableField(value = "domains")
@JSONField(name = "domains")
@JsonProperty("domains")
@ApiModelProperty("区属")
private String domains;
/**
......
......@@ -24,6 +24,8 @@ import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -39,6 +41,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IBZORG", resultMap = "SysOrganizationResultMap")
@ApiModel("单位机构")
public class SysOrganization extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -50,6 +53,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableId(value = "orgid", type = IdType.ASSIGN_UUID)
@JSONField(name = "orgid")
@JsonProperty("orgid")
@ApiModelProperty("单位标识")
private String orgid;
/**
* 单位代码
......@@ -57,6 +61,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableField(value = "orgcode")
@JSONField(name = "orgcode")
@JsonProperty("orgcode")
@ApiModelProperty("单位代码")
private String orgcode;
/**
* 名称
......@@ -65,6 +70,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableField(value = "orgname")
@JSONField(name = "orgname")
@JsonProperty("orgname")
@ApiModelProperty("名称")
private String orgname;
/**
* 上级单位
......@@ -73,6 +79,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableField(value = "porgid")
@JSONField(name = "parentorgid")
@JsonProperty("parentorgid")
@ApiModelProperty("上级单位")
private String parentorgid;
/**
* 单位简称
......@@ -80,6 +87,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableField(value = "shortname")
@JSONField(name = "shortname")
@JsonProperty("shortname")
@ApiModelProperty("单位简称")
private String shortname;
/**
* 单位级别
......@@ -87,6 +95,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableField(value = "orglevel")
@JSONField(name = "orglevel")
@JsonProperty("orglevel")
@ApiModelProperty("单位级别")
private Integer orglevel;
/**
* 排序
......@@ -94,6 +103,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableField(value = "showorder")
@JSONField(name = "showorder")
@JsonProperty("showorder")
@ApiModelProperty("排序")
private Integer showorder;
/**
* 上级单位
......@@ -101,6 +111,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "parentorgname")
@JsonProperty("parentorgname")
@ApiModelProperty("上级单位")
private String parentorgname;
/**
* 区属
......@@ -108,6 +119,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableField(value = "domains")
@JSONField(name = "domains")
@JsonProperty("domains")
@ApiModelProperty("区属")
private String domains;
/**
* 逻辑有效
......@@ -117,6 +129,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableField(value = "enable")
@JSONField(name = "enable")
@JsonProperty("enable")
@ApiModelProperty("逻辑有效")
private Integer enable;
/**
* 创建时间
......@@ -126,6 +139,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@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")
@ApiModelProperty("创建时间")
private Timestamp createdate;
/**
* 最后修改时间
......@@ -135,6 +149,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@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")
@ApiModelProperty("最后修改时间")
private Timestamp updatedate;
/**
* 启用标志
......@@ -143,6 +158,7 @@ public class SysOrganization extends EntityMP implements Serializable {
@TableField(value = "isvalid")
@JSONField(name = "isvalid")
@JsonProperty("isvalid")
@ApiModelProperty("启用标志")
private Integer isvalid;
/**
......
......@@ -24,6 +24,8 @@ import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -39,6 +41,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IBZPOST", resultMap = "SysPostResultMap")
@ApiModel("岗位")
public class SysPost extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -50,6 +53,7 @@ public class SysPost extends EntityMP implements Serializable {
@TableId(value = "postid", type = IdType.ASSIGN_UUID)
@JSONField(name = "postid")
@JsonProperty("postid")
@ApiModelProperty("岗位标识")
private String postid;
/**
* 岗位编码
......@@ -57,6 +61,7 @@ public class SysPost extends EntityMP implements Serializable {
@TableField(value = "postcode")
@JSONField(name = "postcode")
@JsonProperty("postcode")
@ApiModelProperty("岗位编码")
private String postcode;
/**
* 岗位名称
......@@ -64,6 +69,7 @@ public class SysPost extends EntityMP implements Serializable {
@TableField(value = "postname")
@JSONField(name = "postname")
@JsonProperty("postname")
@ApiModelProperty("岗位名称")
private String postname;
/**
* 区属
......@@ -71,6 +77,7 @@ public class SysPost extends EntityMP implements Serializable {
@TableField(value = "domains")
@JSONField(name = "domains")
@JsonProperty("domains")
@ApiModelProperty("区属")
private String domains;
/**
* 备注
......@@ -78,6 +85,7 @@ public class SysPost extends EntityMP implements Serializable {
@TableField(value = "memo")
@JSONField(name = "memo")
@JsonProperty("memo")
@ApiModelProperty("备注")
private String memo;
......
......@@ -24,6 +24,8 @@ import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -39,6 +41,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IBZTEAM", resultMap = "SysTeamResultMap")
@ApiModel("组")
public class SysTeam extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -50,6 +53,7 @@ public class SysTeam extends EntityMP implements Serializable {
@TableId(value = "teamid", type = IdType.ASSIGN_UUID)
@JSONField(name = "teamid")
@JsonProperty("teamid")
@ApiModelProperty("组标识")
private String teamid;
/**
* 组名称
......@@ -57,6 +61,7 @@ public class SysTeam extends EntityMP implements Serializable {
@TableField(value = "teamname")
@JSONField(name = "teamname")
@JsonProperty("teamname")
@ApiModelProperty("组名称")
private String teamname;
/**
* 备注
......@@ -64,6 +69,7 @@ public class SysTeam extends EntityMP implements Serializable {
@TableField(value = "memo")
@JSONField(name = "memo")
@JsonProperty("memo")
@ApiModelProperty("备注")
private String memo;
/**
* 区属
......@@ -71,6 +77,7 @@ public class SysTeam extends EntityMP implements Serializable {
@TableField(value = "domains")
@JSONField(name = "domains")
@JsonProperty("domains")
@ApiModelProperty("区属")
private String domains;
......
......@@ -24,6 +24,8 @@ import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -39,6 +41,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IBZTEAMMEMBER", resultMap = "SysTeamMemberResultMap")
@ApiModel("组成员")
public class SysTeamMember extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -50,6 +53,7 @@ public class SysTeamMember extends EntityMP implements Serializable {
@TableId(value = "teammemberid", type = IdType.ASSIGN_UUID)
@JSONField(name = "teammemberid")
@JsonProperty("teammemberid")
@ApiModelProperty("组成员标识")
private String teammemberid;
/**
* 组标识
......@@ -57,6 +61,7 @@ public class SysTeamMember extends EntityMP implements Serializable {
@TableField(value = "teamid")
@JSONField(name = "teamid")
@JsonProperty("teamid")
@ApiModelProperty("组标识")
private String teamid;
/**
* 组名称
......@@ -64,6 +69,7 @@ public class SysTeamMember extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "teamname")
@JsonProperty("teamname")
@ApiModelProperty("组名称")
private String teamname;
/**
* 用户标识
......@@ -71,6 +77,7 @@ public class SysTeamMember extends EntityMP implements Serializable {
@TableField(value = "userid")
@JSONField(name = "userid")
@JsonProperty("userid")
@ApiModelProperty("用户标识")
private String userid;
/**
* 姓名
......@@ -78,6 +85,7 @@ public class SysTeamMember extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "personname")
@JsonProperty("personname")
@ApiModelProperty("姓名")
private String personname;
/**
* 岗位标识
......@@ -85,6 +93,7 @@ public class SysTeamMember extends EntityMP implements Serializable {
@TableField(value = "postid")
@JSONField(name = "postid")
@JsonProperty("postid")
@ApiModelProperty("岗位标识")
private String postid;
/**
* 岗位
......@@ -92,6 +101,7 @@ public class SysTeamMember extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "postname")
@JsonProperty("postname")
@ApiModelProperty("岗位")
private String postname;
/**
* 区属
......@@ -99,6 +109,7 @@ public class SysTeamMember extends EntityMP implements Serializable {
@TableField(value = "domains")
@JSONField(name = "domains")
@JsonProperty("domains")
@ApiModelProperty("区属")
private String domains;
/**
* 登录名
......@@ -106,6 +117,7 @@ public class SysTeamMember extends EntityMP implements Serializable {
@TableField(exist = false)
@JSONField(name = "username")
@JsonProperty("username")
@ApiModelProperty("登录名")
private String username;
/**
......
......@@ -20,11 +20,14 @@ import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 服务DTO对象[SysDepartmentDTO]
*/
@Data
@ApiModel("部门")
public class SysDepartmentDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -36,6 +39,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JSONField(name = "deptid")
@JsonProperty("deptid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("部门标识")
private String deptid;
/**
......@@ -46,6 +50,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JsonProperty("deptcode")
@NotBlank(message = "[部门代码]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("部门代码")
private String deptcode;
/**
......@@ -56,6 +61,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JsonProperty("deptname")
@NotBlank(message = "[部门名称]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("部门名称")
private String deptname;
/**
......@@ -65,6 +71,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JSONField(name = "orgid")
@JsonProperty("orgid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("单位")
private String orgid;
/**
......@@ -74,6 +81,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JSONField(name = "parentdeptid")
@JsonProperty("parentdeptid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("上级部门")
private String parentdeptid;
/**
......@@ -83,6 +91,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JSONField(name = "shortname")
@JsonProperty("shortname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("部门简称")
private String shortname;
/**
......@@ -91,6 +100,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
*/
@JSONField(name = "deptlevel")
@JsonProperty("deptlevel")
@ApiModelProperty("部门级别")
private Integer deptlevel;
/**
......@@ -100,6 +110,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JSONField(name = "domains")
@JsonProperty("domains")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("区属")
private String domains;
/**
......@@ -108,6 +119,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
*/
@JSONField(name = "showorder")
@JsonProperty("showorder")
@ApiModelProperty("排序")
private Integer showorder;
/**
......@@ -117,6 +129,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JSONField(name = "bcode")
@JsonProperty("bcode")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("业务编码")
private String bcode;
/**
......@@ -126,6 +139,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JSONField(name = "leaderid")
@JsonProperty("leaderid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("分管领导标识")
private String leaderid;
/**
......@@ -135,6 +149,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JSONField(name = "leadername")
@JsonProperty("leadername")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("分管领导")
private String leadername;
/**
......@@ -143,6 +158,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
*/
@JSONField(name = "enable")
@JsonProperty("enable")
@ApiModelProperty("逻辑有效")
private Integer enable;
/**
......@@ -152,6 +168,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JSONField(name = "orgname")
@JsonProperty("orgname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("单位")
private String orgname;
/**
......@@ -161,6 +178,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@JSONField(name = "parentdeptname")
@JsonProperty("parentdeptname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("上级部门")
private String parentdeptname;
/**
......@@ -170,6 +188,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@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")
@ApiModelProperty("创建时间")
private Timestamp createdate;
/**
......@@ -179,6 +198,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
@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")
@ApiModelProperty("最后修改时间")
private Timestamp updatedate;
/**
......@@ -187,6 +207,7 @@ public class SysDepartmentDTO extends DTOBase implements Serializable {
*/
@JSONField(name = "isvalid")
@JsonProperty("isvalid")
@ApiModelProperty("启用标志")
private Integer isvalid;
......
......@@ -20,11 +20,14 @@ import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 服务DTO对象[SysDeptMemberDTO]
*/
@Data
@ApiModel("部门成员")
public class SysDeptMemberDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -36,6 +39,7 @@ public class SysDeptMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "memberid")
@JsonProperty("memberid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("标识")
private String memberid;
/**
......@@ -46,6 +50,7 @@ public class SysDeptMemberDTO extends DTOBase implements Serializable {
@JsonProperty("deptid")
@NotBlank(message = "[部门标识]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("部门标识")
private String deptid;
/**
......@@ -55,6 +60,7 @@ public class SysDeptMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "deptname")
@JsonProperty("deptname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("部门名称")
private String deptname;
/**
......@@ -65,6 +71,7 @@ public class SysDeptMemberDTO extends DTOBase implements Serializable {
@JsonProperty("userid")
@NotBlank(message = "[用户标识]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("用户标识")
private String userid;
/**
......@@ -74,6 +81,7 @@ public class SysDeptMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "personname")
@JsonProperty("personname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("成员")
private String personname;
/**
......@@ -83,6 +91,7 @@ public class SysDeptMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "postid")
@JsonProperty("postid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("岗位标识")
private String postid;
/**
......@@ -92,6 +101,7 @@ public class SysDeptMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "postname")
@JsonProperty("postname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("岗位名称")
private String postname;
/**
......@@ -101,6 +111,7 @@ public class SysDeptMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "bcode")
@JsonProperty("bcode")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("业务条线")
private String bcode;
/**
......@@ -110,6 +121,7 @@ public class SysDeptMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "domains")
@JsonProperty("domains")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("区属")
private String domains;
......
......@@ -20,11 +20,14 @@ import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 服务DTO对象[SysOrganizationDTO]
*/
@Data
@ApiModel("单位机构")
public class SysOrganizationDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -36,6 +39,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
@JSONField(name = "orgid")
@JsonProperty("orgid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("单位标识")
private String orgid;
/**
......@@ -45,6 +49,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
@JSONField(name = "orgcode")
@JsonProperty("orgcode")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("单位代码")
private String orgcode;
/**
......@@ -54,6 +59,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
@JSONField(name = "orgname")
@JsonProperty("orgname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("名称")
private String orgname;
/**
......@@ -63,6 +69,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
@JSONField(name = "parentorgid")
@JsonProperty("parentorgid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("上级单位")
private String parentorgid;
/**
......@@ -72,6 +79,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
@JSONField(name = "shortname")
@JsonProperty("shortname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("单位简称")
private String shortname;
/**
......@@ -80,6 +88,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
*/
@JSONField(name = "orglevel")
@JsonProperty("orglevel")
@ApiModelProperty("单位级别")
private Integer orglevel;
/**
......@@ -88,6 +97,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
*/
@JSONField(name = "showorder")
@JsonProperty("showorder")
@ApiModelProperty("排序")
private Integer showorder;
/**
......@@ -97,6 +107,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
@JSONField(name = "parentorgname")
@JsonProperty("parentorgname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("上级单位")
private String parentorgname;
/**
......@@ -106,6 +117,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
@JSONField(name = "domains")
@JsonProperty("domains")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("区属")
private String domains;
/**
......@@ -114,6 +126,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
*/
@JSONField(name = "enable")
@JsonProperty("enable")
@ApiModelProperty("逻辑有效")
private Integer enable;
/**
......@@ -123,6 +136,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
@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")
@ApiModelProperty("创建时间")
private Timestamp createdate;
/**
......@@ -132,6 +146,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
@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")
@ApiModelProperty("最后修改时间")
private Timestamp updatedate;
/**
......@@ -140,6 +155,7 @@ public class SysOrganizationDTO extends DTOBase implements Serializable {
*/
@JSONField(name = "isvalid")
@JsonProperty("isvalid")
@ApiModelProperty("启用标志")
private Integer isvalid;
......
......@@ -20,11 +20,14 @@ import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 服务DTO对象[SysPostDTO]
*/
@Data
@ApiModel("岗位")
public class SysPostDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -36,6 +39,7 @@ public class SysPostDTO extends DTOBase implements Serializable {
@JSONField(name = "postid")
@JsonProperty("postid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("岗位标识")
private String postid;
/**
......@@ -46,6 +50,7 @@ public class SysPostDTO extends DTOBase implements Serializable {
@JsonProperty("postcode")
@NotBlank(message = "[岗位编码]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("岗位编码")
private String postcode;
/**
......@@ -56,6 +61,7 @@ public class SysPostDTO extends DTOBase implements Serializable {
@JsonProperty("postname")
@NotBlank(message = "[岗位名称]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("岗位名称")
private String postname;
/**
......@@ -65,6 +71,7 @@ public class SysPostDTO extends DTOBase implements Serializable {
@JSONField(name = "domains")
@JsonProperty("domains")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("区属")
private String domains;
/**
......@@ -74,6 +81,7 @@ public class SysPostDTO extends DTOBase implements Serializable {
@JSONField(name = "memo")
@JsonProperty("memo")
@Size(min = 0, max = 2000, message = "内容长度必须小于等于[2000]")
@ApiModelProperty("备注")
private String memo;
......
......@@ -20,11 +20,14 @@ import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 服务DTO对象[SysTeamDTO]
*/
@Data
@ApiModel("组")
public class SysTeamDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -36,6 +39,7 @@ public class SysTeamDTO extends DTOBase implements Serializable {
@JSONField(name = "teamid")
@JsonProperty("teamid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("组标识")
private String teamid;
/**
......@@ -46,6 +50,7 @@ public class SysTeamDTO extends DTOBase implements Serializable {
@JsonProperty("teamname")
@NotBlank(message = "[组名称]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("组名称")
private String teamname;
/**
......@@ -55,6 +60,7 @@ public class SysTeamDTO extends DTOBase implements Serializable {
@JSONField(name = "memo")
@JsonProperty("memo")
@Size(min = 0, max = 2000, message = "内容长度必须小于等于[2000]")
@ApiModelProperty("备注")
private String memo;
/**
......@@ -64,6 +70,7 @@ public class SysTeamDTO extends DTOBase implements Serializable {
@JSONField(name = "domains")
@JsonProperty("domains")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("区属")
private String domains;
......
......@@ -20,11 +20,14 @@ import javax.validation.constraints.Size;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.DTOClient;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 服务DTO对象[SysTeamMemberDTO]
*/
@Data
@ApiModel("组成员")
public class SysTeamMemberDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -36,6 +39,7 @@ public class SysTeamMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "teammemberid")
@JsonProperty("teammemberid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("组成员标识")
private String teammemberid;
/**
......@@ -46,6 +50,7 @@ public class SysTeamMemberDTO extends DTOBase implements Serializable {
@JsonProperty("teamid")
@NotBlank(message = "[组标识]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("组标识")
private String teamid;
/**
......@@ -56,6 +61,7 @@ public class SysTeamMemberDTO extends DTOBase implements Serializable {
@JsonProperty("teamname")
@NotBlank(message = "[组名称]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("组名称")
private String teamname;
/**
......@@ -66,6 +72,7 @@ public class SysTeamMemberDTO extends DTOBase implements Serializable {
@JsonProperty("userid")
@NotBlank(message = "[用户标识]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("用户标识")
private String userid;
/**
......@@ -76,6 +83,7 @@ public class SysTeamMemberDTO extends DTOBase implements Serializable {
@JsonProperty("personname")
@NotBlank(message = "[姓名]不允许为空!")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("姓名")
private String personname;
/**
......@@ -85,6 +93,7 @@ public class SysTeamMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "postid")
@JsonProperty("postid")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("岗位标识")
private String postid;
/**
......@@ -94,6 +103,7 @@ public class SysTeamMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "postname")
@JsonProperty("postname")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("岗位")
private String postname;
/**
......@@ -103,6 +113,7 @@ public class SysTeamMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "domains")
@JsonProperty("domains")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("区属")
private String domains;
/**
......@@ -112,6 +123,7 @@ public class SysTeamMemberDTO extends DTOBase implements Serializable {
@JSONField(name = "username")
@JsonProperty("username")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
@ApiModelProperty("登录名")
private String username;
......
......@@ -27,6 +27,16 @@ import java.util.Map;
@Component
public class DEFieldDefaultValueAspect
{
/**
* 操作用户标识
*/
final static String TAG_PERSONID = "SRF_PERSONID";
/**
* 操作用户名称
*/
final static String TAG_PERSONNAME = "SRF_PERSONNAME";
/**
* 新建数据切入点
* @param point
......@@ -221,16 +231,16 @@ public class DEFieldDefaultValueAspect
switch(preFieldType) {
case CREATEMAN:
et.set(fieldname, curUser.getUserid());
et.set(fieldname, StringUtils.isEmpty(curUser.getUserid()) ? et.get(TAG_PERSONID) : curUser.getUserid());
break;
case CREATEMANNAME:
et.set(fieldname, curUser.getPersonname());
et.set(fieldname, StringUtils.isEmpty(curUser.getPersonname()) ? et.get(TAG_PERSONNAME) : curUser.getPersonname());
break;
case UPDATEMAN:
et.set(fieldname, curUser.getUserid());
et.set(fieldname, StringUtils.isEmpty(curUser.getUserid()) ? et.get(TAG_PERSONID) : curUser.getUserid());
break;
case UPDATEMANNAME:
et.set(fieldname, curUser.getPersonname());
et.set(fieldname, StringUtils.isEmpty(curUser.getPersonname()) ? et.get(TAG_PERSONNAME) : curUser.getPersonname());
break;
case CREATEDATE:
et.set(fieldname, new Timestamp(new Date().getTime()));
......
package cn.ibizlab.util.aspect;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.util.domain.EntityBase;
import com.alibaba.fastjson.JSON;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Lazy;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.List;
/**
* rocketMQ消息切面
......@@ -42,66 +41,83 @@ public class RocketMQAspect
@Value("${rocketmq.producer.topic:default}")
private String topic;
@AfterReturning(value = "(execution(* cn.ibizlab.core.*.service.*SysEmployee*.remove*(..)))")
@Async
public void sysEmployeedeleteSysUser(JoinPoint point) {
sendMsg(topic, "deletesysuser", getEntity(point));
@Around(value = "(execution(* cn.ibizlab.core.*.service.ISysEmployeeService.remove*(..)))")
public Object sysEmployeedeleteSysUser(ProceedingJoinPoint point) throws Throwable{
Object entity = getEntity(point);
Object result = point.proceed();
sendMsg(topic, "deletesysuser", entity);
return result;
}
@AfterReturning(value = "(execution(* cn.ibizlab.core.*.service.*SysEmployee*.create*(..))||execution(* cn.ibizlab.core.*.service.*SysEmployee*.update*(..)))")
@Async
public void sysEmployeesaveSysUser(JoinPoint point) {
sendMsg(topic, "savesysuser", getEntity(point));
@Around(value = "(execution(* cn.ibizlab.core.*.service.ISysEmployeeService.create*(..))||execution(* cn.ibizlab.core.*.service.ISysEmployeeService.update*(..)))")
public Object sysEmployeesaveSysUser(ProceedingJoinPoint point) throws Throwable{
Object entity = getEntity(point);
Object result = point.proceed();
sendMsg(topic, "savesysuser", entity);
return result;
}
/**
* 输出过滤行为
* @param point
* @param actionName
* @param entity
*/
private void outputAction(JoinPoint point,String actionName) {
Object [] args = point.getArgs();
if(ObjectUtils.isEmpty(args) || args.length==0) {
private void outputAction(JoinPoint point, String actionName, Object entity) {
Object[] args = point.getArgs();
if (ObjectUtils.isEmpty(args) || args.length == 0 || ObjectUtils.isEmpty(entity)) {
return;
}
Object arg = args[0];
Object service = point.getTarget();
EvaluationContext serviceCtx = new StandardEvaluationContext();
serviceCtx.setVariable("service", service);
serviceCtx.setVariable("arg", arg);
serviceCtx.setVariable("arg", entity);
Expression serviceExp = parser.parseExpression(String.format("#service.%s(#arg)", actionName));
serviceExp.getValue(serviceCtx);
}
/**
* 获取实体对象
*
* @param point
* @return
*/
private Object getEntity(JoinPoint point) {
Object entity=null;
String action=point.getSignature().getName();
Object [] args = point.getArgs();
if(ObjectUtils.isEmpty(args) || args.length==0 || StringUtils.isEmpty(action)) {
private Object getEntity(ProceedingJoinPoint point) {
Object entity = null;
try {
String action = point.getSignature().getName();
Object[] args = point.getArgs();
Object serviceObj = point.getTarget();
if (ObjectUtils.isEmpty(args) || args.length == 0 || StringUtils.isEmpty(action)) {
return entity;
}
Object arg=args[0];
if(arg instanceof EntityBase || arg instanceof List) {
return arg;
if ("remove".equalsIgnoreCase(action)) {
Object idValue = args[0];
if (!ObjectUtils.isEmpty(serviceObj)) {
EvaluationContext oldContext = new StandardEvaluationContext();
oldContext.setVariable("service", serviceObj);
oldContext.setVariable("id", idValue);
Expression oldExp = parser.parseExpression("#service.get(#id)");
entity = oldExp.getValue(oldContext, EntityBase.class);
}
} else {
entity = args[0];
}
else {
return null;
} catch (Exception e) {
log.error("发送消息失败,无法获取实体对象" + e);
}
return entity;
}
/**
* 发送消息
*
* @param topic
* @param tag
* @param body
*/
private void sendMsg(String topic, String tag, Object body) {
if(ObjectUtils.isEmpty(body)) {
log.error("消息内容为空,[{}]消息将被忽略!",tag);
if (ObjectUtils.isEmpty(body)) {
log.error("消息内容为空,[{}]消息将被忽略!", tag);
return;
}
try {
......@@ -109,7 +125,7 @@ public class RocketMQAspect
SendResult sendResult = defaultMQProducer.send(message);
log.info("消息发送响应:" + sendResult.toString());
} catch (Exception e) {
log.error("消息发送异常,"+e);
log.error("消息发送异常," + e);
}
}
}
......
......@@ -2,6 +2,7 @@ package cn.ibizlab.util.client;
import cn.ibizlab.util.security.AuthenticationUser;
import cn.ibizlab.util.security.AuthorizationLogin;
import org.springframework.util.MultiValueMap;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
......
......@@ -5,6 +5,7 @@ import cn.ibizlab.util.security.AuthorizationLogin;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.util.MultiValueMap;
import com.alibaba.fastjson.JSONObject;
@FeignClient(value = "${ibiz.ref.service.uaa:ibzuaa-api}",contextId = "uaa",fallback = IBZUAAFallback.class)
......
......@@ -7,6 +7,7 @@ import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.util.ObjectUtils;
import java.sql.Timestamp;
......@@ -231,6 +232,15 @@ public class AuthenticationUser implements UserDetails
return authuserdetail;
}
public static AuthenticationUser setAuthenticationUser(String userId , String userName) {
AuthenticationUser user = new AuthenticationUser();
user.setUserid(userId);
user.setPersonname(userName);
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(user, null, user.getAuthorities());
SecurityContextHolder.getContext().setAuthentication(authentication);
return user;
}
public Map <String,Object> getSessionParams()
{
if(this.sessionParams==null)
......
......@@ -4,11 +4,17 @@ import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.LinkedHashMap;
/**
* feign请求拦截器
......@@ -19,23 +25,23 @@ public class FeignRequestInterceptor implements RequestInterceptor {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Override
public void apply(RequestTemplate requestTemplate) {
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if(requestAttributes!=null){
if (requestAttributes != null) {
HttpServletRequest request = requestAttributes.getRequest();
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
if(name.equalsIgnoreCase("transfer-encoding")){
if (name.equalsIgnoreCase("transfer-encoding")) {
continue;
}
String values = request.getHeader(name);
requestTemplate.header(name, values);
}
logger.info("feign interceptor header:{}",requestTemplate);
logger.info("feign interceptor header:{}", requestTemplate);
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册