Merge branch 'dev' of http://git.estsh.com/i3-IMPP/i3plus-pojo into dev
commit
cfbd536004
@ -1,54 +0,0 @@
|
||||
package cn.estsh.i3plus.pojo.base.enumutil;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* @Description : 模块枚举类
|
||||
* @Reference :
|
||||
* @Author : alwaysfrin
|
||||
* @CreateDate : 2018-12-25 21:08
|
||||
* @Modify:
|
||||
**/
|
||||
public class BlockEnumUtil {
|
||||
|
||||
|
||||
/**
|
||||
* 报表元素枚举
|
||||
* WORDS(1,"文字"),PIC(2,"图片"),REPORT(3,"报表");
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum REPORT_ELEMENT_TYPE{
|
||||
|
||||
WORDS(1,"文字"),PIC(2,"图片"),REPORT(3,"报表");
|
||||
|
||||
private int value;
|
||||
private String description;
|
||||
|
||||
REPORT_ELEMENT_TYPE() {
|
||||
}
|
||||
|
||||
REPORT_ELEMENT_TYPE(int value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String valueOfDescription(int val) {
|
||||
String tmp = null;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].value == val) {
|
||||
tmp = values()[i].description;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
package cn.estsh.i3plus.pojo.base.enumutil;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* @Description : 模块枚举类
|
||||
* @Reference :
|
||||
* @Author : alwaysfrin
|
||||
* @CreateDate : 2018-12-25 21:08
|
||||
* @Modify:
|
||||
**/
|
||||
public class BlockReportEnumUtil {
|
||||
|
||||
|
||||
/**
|
||||
* 报表元素枚举
|
||||
* WORDS(1,"文字"),PIC(2,"图片"),REPORT(3,"报表");
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum REPORT_ELEMENT_TYPE{
|
||||
|
||||
WORDS(1,"文字"),PIC(2,"图片");
|
||||
|
||||
private int value;
|
||||
private String description;
|
||||
|
||||
REPORT_ELEMENT_TYPE() {
|
||||
}
|
||||
|
||||
REPORT_ELEMENT_TYPE(int value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String valueOfDescription(int val) {
|
||||
String tmp = null;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].value == val) {
|
||||
tmp = values()[i].description;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 报表布局枚举
|
||||
* TABLE(1,"表格"),CHART(2,"图表");
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum REPORT_LAYOUT_TYPE{
|
||||
|
||||
TABLE(1,"表格"),CHART(2,"图表");
|
||||
|
||||
private int value;
|
||||
private String description;
|
||||
|
||||
REPORT_LAYOUT_TYPE() {
|
||||
}
|
||||
|
||||
REPORT_LAYOUT_TYPE(int value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String valueOfDescription(int val) {
|
||||
String tmp = null;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].value == val) {
|
||||
tmp = values()[i].description;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 功能级别
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum METHOD_LEVEL {
|
||||
// PLUGIN(1, "插件"),
|
||||
MODULE(2, "顶级目录"),
|
||||
METHOD(3, "二级目录");
|
||||
// BUTTON(4, "按钮");
|
||||
|
||||
private int value;
|
||||
private String description;
|
||||
|
||||
private METHOD_LEVEL(int value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String valueOf(int val) {
|
||||
String tmp = null;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].value == val) {
|
||||
tmp = values()[i].description;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public static int descOf(String desc) {
|
||||
int tmp = 1;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].description.equals(desc)) {
|
||||
tmp = values()[i].value;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.estsh.i3plus.pojo.report.bean;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : Adair Peng
|
||||
* @CreateDate : 2019-01-17 11:17
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name="SYS_REF_ROLE_MENU")
|
||||
@Api(value="关系-角色目录",description = "关系-角色目录")
|
||||
public class BrRefRoleMenu extends BaseBean {
|
||||
|
||||
@Column(name="MENU_ID")
|
||||
@ApiParam(value ="菜单ID" ,example = "-1")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long menuId;
|
||||
|
||||
@Column(name="MENU_NAME_RDD")
|
||||
@ApiParam(value ="菜单名称" , access ="菜单名称")
|
||||
private String menuNameRdd;
|
||||
|
||||
@Column(name="MENU_TYPE_RDD")
|
||||
@ApiParam(value ="菜单类型")
|
||||
private Integer menuTypeRdd;
|
||||
|
||||
@Column(name="ROLE_ID")
|
||||
@ApiParam(value ="角色ID" , example = "-1")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long roleId;
|
||||
|
||||
@Column(name="ROLE_NAME_Rdd")
|
||||
@ApiParam(value ="角色名称" , access ="角色名称")
|
||||
private String roleNameRdd;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.estsh.i3plus.pojo.report.repository;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import cn.estsh.i3plus.pojo.report.bean.BrMenu;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : Adair Peng
|
||||
* @CreateDate : 2019-01-17 11:59
|
||||
* @Modify:
|
||||
**/
|
||||
public interface BrMenuRepository extends BaseRepository<BrMenu,Long> {
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.estsh.i3plus.pojo.report.repository;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import cn.estsh.i3plus.pojo.report.bean.BrRefRoleMenu;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : Adair Peng
|
||||
* @CreateDate : 2019-01-17 12:00
|
||||
* @Modify:
|
||||
**/
|
||||
public interface BrRefRoleMenuRepository extends BaseRepository<BrRefRoleMenu,Long> {
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package cn.estsh.i3plus.pojo.report.sqlpack;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
|
||||
import cn.estsh.i3plus.pojo.report.bean.BrElement;
|
||||
import cn.estsh.i3plus.pojo.report.bean.BrMenu;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @Description : 报表对象封装
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2019-01-17 15:41
|
||||
* @Modify:
|
||||
**/
|
||||
public class ReportHqlPack {
|
||||
|
||||
/**
|
||||
* In 参数封装
|
||||
* @param columnName
|
||||
* @return
|
||||
*/
|
||||
public static String packHqlIds(String columnName,String[] params){
|
||||
StringBuffer result = new StringBuffer();
|
||||
|
||||
// 参数数组 [1,2,3] -> "1,2,3"
|
||||
HqlPack.getInPack(String.join(",",params),columnName,result);
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* In 参数封装
|
||||
* @param columnName
|
||||
* @return
|
||||
*/
|
||||
public static String packHqlIds(String columnName,Long[] params){
|
||||
StringBuffer result = new StringBuffer();
|
||||
|
||||
// 参数数组 [1,2,3] -> "1,2,3"
|
||||
HqlPack.getInPack(StringUtils.join(params,","),columnName,result);
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 目录查询封装
|
||||
* @param menu
|
||||
* @return
|
||||
*/
|
||||
public static String packHqlBrMenu(BrMenu menu){
|
||||
StringBuffer result = new StringBuffer();
|
||||
|
||||
// 查询参数封装
|
||||
HqlPack.getNumEqualPack(menu.getParentId(),"parentId",result);
|
||||
HqlPack.getNumEqualPack(menu.getMenuType(),"menuType",result);
|
||||
HqlPack.getNumEqualPack(menu.getMenuStatus(),"menuStatus",result);
|
||||
HqlPack.getStringLikerPack(menu.getName(),"name",result);
|
||||
HqlPack.getStringLikerPack(menu.getMenuCode(),"menuCode",result);
|
||||
|
||||
// 添加默认排序
|
||||
HqlPack.getOrderDefault(menu);
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 报表元素查询
|
||||
* @param brElement
|
||||
* @return
|
||||
*/
|
||||
public static String packHqlBrElement(BrElement brElement){
|
||||
StringBuffer result = new StringBuffer();
|
||||
|
||||
// 查询参数封装
|
||||
HqlPack.getNumEqualPack(brElement.getElementType(),"elementType",result);
|
||||
HqlPack.getStringLikerPack(brElement.getElementName(),"elementName",result);
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue