yun-zuoyi
alwaysfrin 7 years ago
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;
}
}
}

@ -443,7 +443,10 @@ public class CommonEnumUtil {
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum METHOD_LEVEL {
PLUGIN(1, "插件"),MODULE(2, "模块"), METHOD(3, "功能"), BUTTON(4, "按钮");
PLUGIN(1, "插件"),
MODULE(2, "顶级目录"),
METHOD(3, "二级目录"),
BUTTON(4, "按钮");
private int value;
private String description;

@ -38,7 +38,7 @@ public class BrElement extends BaseBean {
@Column(name="ELEMENT_TYPE")
@ApiParam(value ="元素类型")
//BlockEnumUtil.REPORT_ELEMENT_TYPE
//BlockReportEnumUtil.REPORT_ELEMENT_TYPE
private Integer elementType;
@Column(name="ELEMENT_VALUE")
@ -53,11 +53,7 @@ public class BrElement extends BaseBean {
@ApiParam(value ="元素样式css")
private String elementStyle;
@Transient
@ApiParam(value ="元素明细列表")
private List<BrReportElementDetail> brReportElementDetailList;
@Transient
@ApiParam(value ="元素所在的列")
private BrLayoutColumn brLayoutColumn;
@Column(name="ELEMENT_HTML",columnDefinition = "TEXT")
@ApiParam(value ="元素html")
private String elementHtml;
}

@ -54,11 +54,15 @@ public class BrLayout extends BaseBean {
@ApiParam(value ="排序")
private Integer seq;
@Column(name="LAYOUT_HTML",columnDefinition = "TEXT")
@ApiParam(value ="布局html")
private String layoutHtml;
@Column(name = "LAYOUT_DESCRIPTION",columnDefinition = "TEXT")
@ApiParam(value ="布局描述")
private String layoutDescription;
@Transient
@ApiParam(value ="模板行列表")
private List<BrLayoutRow> brLayoutRowList;
@Transient
@ApiParam(value ="使用模板的报表")
private List<BrReport> brReportList;
}

@ -42,27 +42,31 @@ public class BrLayoutColumn extends BaseBean {
@JsonSerialize(using = ToStringSerializer.class)
private Long layoutRowId;
@Column(name="COLUMN_CROSS")
@Column(name="COLUMN_COLSPAN")
@ApiParam(value ="跨列数")
private Integer columnCross;
private Integer columnColspan;
@Column(name="COLUMN_ROWSPAN")
@ApiParam(value ="跨行数")
private Integer columnRowspan;
@Column(name="COLUMN_WIDTH")
@ApiParam(value ="列宽")
private Integer columnWidth;
@Column(name="COLUMN_HEIGHT")
@ApiParam(value ="列高")
private Integer columnHeight;
@Column(name="SEQ")
@ApiParam(value ="排序")
private Integer seq;
@Transient
@ApiParam(value ="列所在的行")
private BrLayoutRow brLayoutRow;
@Transient
@ApiParam(value ="列所包含的元素")
private List<BrElement> brElementList;
@Column(name = "COLUMN_DESCRIPTION",columnDefinition = "TEXT")
@ApiParam(value ="列描述")
private String columnDescription;
@Transient
@ApiParam(value ="列所包含的报表模板")
private List<BrReportTemplate> brReportTemplateList;
@Column(name="COLUMN_HTML")
@ApiParam(value ="列html")
private String columnHtml;
}

@ -37,9 +37,9 @@ public class BrLayoutRow extends BaseBean {
@JsonSerialize(using = ToStringSerializer.class)
private Long layoutId;
@Column(name="ROW_CROSS")
@ApiParam(value ="行")
private Integer rowCross;
@Column(name="ROW_WIDTH")
@ApiParam(value ="")
private Integer rowWidth;
@Column(name="ROW_HEIGHT")
@ApiParam(value ="行高")
@ -49,12 +49,15 @@ public class BrLayoutRow extends BaseBean {
@ApiParam(value ="排序")
private Integer seq;
@Transient
@ApiParam(value ="行所在的布局")
private BrLayout brLayout;
@Column(name="ROW_STYLE")
@ApiParam(value ="行样式")
private String rowStyle;
@Column(name="ROW_HTML")
@ApiParam(value ="行样式")
private String rowHtml;
@Transient
@ApiParam(value ="行所包含的列")
private List<BrLayoutColumn> brLayoutColumns;
}

@ -0,0 +1,99 @@
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;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-01-17 11:17
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_MENU")
@Api(value="报表目录",description = "报表目录")
public class BrMenu extends BaseBean {
@Column(name="NAME")
@ApiParam(value ="功能名称")
private String name;
@Column(name="NAME_ZH_SHORTENING")
@ApiParam(value ="功能名称中文简写")
private String nameZhShortening;
@Column(name="MENU_CODE")
@ApiParam(value ="功能代码")
private String menuCode;
@Column(name="MENU_TYPE")
@ApiParam(value ="功能类型枚举1.模块2.菜单3.按钮)" , example ="-1")
private Integer menuType;
// 根节点-1
@Column(name="PARENT_ID")
@ApiParam(value ="父级功能ID" , example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentId;
@Column(name="PARENT_NAME_RDD")
@ApiParam(value ="父级功能名称" , access ="父级功能名称")
private String parentNameRdd;
@Column(name="MENU_CLASS_PATH")
@ApiParam(value ="功能 class path" , access ="资源class path")
private String menuClassPath;
@Column(name="MENU_GRADE")
@ApiParam(value ="功能等级", example = "1")
private String menuGrade;
@Column(name="MENU_SORT")
@ApiParam(value ="功能排序", example = "0")
private Integer menuSort;
@Column(name="MENU_URL")
@ApiParam(value ="功能 url" , access ="资源 url")
private String menuUrl;
@Column(name="MENU_CSS")
@ApiParam(value ="功能 css" , access ="资源css")
private String menuCss;
@Column(name="MENU_ICON")
@ApiParam(value ="功能icon" , access ="资源icon")
private String menuIcon;
@Column(name="MENU_DESCRIPTION")
@ApiParam(value ="功能描述" , access ="配置描述")
private String menuDescription;
@Column(name="MENU_STATUS")
@ApiParam(value ="功能状态1.正常2.禁用)" , example ="1" , access ="功能状态1.正常2.禁用)",defaultValue="1")
private Integer menuStatus;
@Transient
@ApiParam(value ="子集列表")
private List<BrMenu> childList = new ArrayList<>();
}

@ -28,25 +28,37 @@ import java.util.List;
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_REPORT_ELEMENT_DETAIL")
@Table(name="BR_REF_REPORT_ELEMENT")
@Api(value="元素&报表",description = "元素和报表的关联表 * -》 *")
public class BrReportElementDetail extends BaseBean {
public class BrRefReportElement extends BaseBean {
@Column(name = "REPORT_ID")
@ApiParam(value = "报表主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long reportId;
@Column(name = "ELEMENT_ID")
@ApiParam(value = "元素主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long elementId;
@Column(name = "REPORT_NAME_RDD")
@ApiParam(value = "报表名称")
private String reportNameRdd;
@Column(name = "LAYOUT_COLUMN_ID")
@ApiParam(value = "列主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long layoutColumnId;
@Column(name = "ELEMENT_ID")
@ApiParam(value = "元素主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long elementId;
@Column(name = "ELEMENT_NAME_RDD")
@ApiParam(value = "元素名称")
private String elementNameRdd;
@Column(name = "ELEMENT_HTML_RDD")
@ApiParam(value = "元素html")
@JsonSerialize(using = ToStringSerializer.class)
private Long elementHtmlRdd;
@Transient
@ApiParam(value = "报表实例")

@ -27,29 +27,36 @@ import javax.persistence.Transient;
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_REPORT_TEMPLATE_DETAIL")
@Table(name="BR_REF_REPORT_TEMPLATE")
@Api(value="报表模板&报表",description = "报表模板和报表的关联表 * -》 *")
public class BrReportTemplateDetail extends BaseBean {
public class BrRefReportTemplate extends BaseBean {
@Column(name="REPORT_ID")
@ApiParam(value ="报表主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long reportId;
@Column(name="REPORT_TEMPLATE_ID")
@ApiParam(value ="报表模板主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long reportTemplateId;
@Column(name = "REPORT_NAME_RDD")
@ApiParam(value = "报表名称")
private String reportNameRdd;
@Column(name="LAYOUT_COLUMN_ID")
@ApiParam(value ="列主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long layoutColumnId;
@Column(name="REPORT_TEMPLATE_ID")
@ApiParam(value ="报表模板主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long reportTemplateId;
@Column(name="REPORT_TEMPLATE_NAME_RDD")
@ApiParam(value ="报表模板名称")
private String reportTemplateNameRdd;
@Transient
@ApiParam(value = "报表实例")
private BrReport brReport;
@Column(name="REPORT_TEMPLATE_HTML_RDD")
@ApiParam(value ="报表模板html")
private String reportTemplateHtmlRdd;
@Transient
@ApiParam(value = "报表模板")

@ -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;
}

@ -39,10 +39,14 @@ public class BrReport extends BaseBean {
@JsonSerialize(using = ToStringSerializer.class)
private Long layoutId;
@Column(name="SOFT_TYPE")
@ApiParam(value ="模块")
//所属模块CommonEnumUtil.SOFT_TYPE
private Integer softType;
@Column(name="LAYOUT_ID_RDD")
@ApiParam(value ="布局名称")
@JsonSerialize(using = ToStringSerializer.class)
private Long layoutNameRdd;
@Column(name="LAYOUT_HTML")
@ApiParam(value ="布局html")
private String reportHtml;
@Column(name="SEQ")
@ApiParam(value ="排序")

@ -48,7 +48,7 @@ public class BrReportTemplate extends BaseBean {
@Transient
@ApiParam(value ="报表模板列表")
private List<BrReportTemplateDetail> brReportTemplateDetailList;
private List<BrRefReportTemplate> brReportTemplateDetailList;
@Transient
@ApiParam(value ="元素所在的列")

@ -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> {
}

@ -1,7 +1,7 @@
package cn.estsh.i3plus.pojo.report.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.report.bean.BrReportElementDetail;
import cn.estsh.i3plus.pojo.report.bean.BrRefReportElement;
/**
* @Description :
@ -10,5 +10,5 @@ import cn.estsh.i3plus.pojo.report.bean.BrReportElementDetail;
* @CreateDate : 2018-12-26 20:23
* @Modify:
**/
public interface BrReportElementDetailRepository extends BaseRepository<BrReportElementDetail,Long> {
public interface BrRefReportElementRepository extends BaseRepository<BrRefReportElement,Long> {
}

@ -1,7 +1,7 @@
package cn.estsh.i3plus.pojo.report.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.report.bean.BrReportTemplateDetail;
import cn.estsh.i3plus.pojo.report.bean.BrRefReportTemplate;
/**
* @Description :
@ -10,5 +10,5 @@ import cn.estsh.i3plus.pojo.report.bean.BrReportTemplateDetail;
* @CreateDate : 2018-12-26 20:23
* @Modify:
**/
public interface BrReportTemplateDetailRepository extends BaseRepository<BrReportTemplateDetail,Long> {
public interface BrRefReportTemplateRepository extends BaseRepository<BrRefReportTemplate,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…
Cancel
Save