Merge remote-tracking branch 'remotes/origin/dev' into test

yun-zuoyi
wei.peng 6 years ago
commit a2bbd4b5f0

@ -3,6 +3,7 @@ package cn.estsh.i3plus.pojo.base.bean;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import java.util.List;
import java.util.Map;

@ -0,0 +1,110 @@
package cn.estsh.i3plus.pojo.base.codemaker;
/**
* @Description :
* @Reference :
* @Author : alwaysfrin
* @CreateDate : 2019-01-10 13:11
* @Modify:
**/
@Deprecated
public class SnowFlake {
// 起始的时间戳
private final static long START_STMP = 1480166465631L;
// 每一部分占用的位数,就三个
private final static long SEQUENCE_BIT = 12;// 序列号占用的位数
private final static long MACHINE_BIT = 5; // 机器标识占用的位数
private final static long DATACENTER_BIT = 5;// 数据中心占用的位数
// 每一部分最大值
private final static long MAX_DATACENTER_NUM = -1L ^ (-1L << DATACENTER_BIT);
private final static long MAX_MACHINE_NUM = -1L ^ (-1L << MACHINE_BIT);
private final static long MAX_SEQUENCE = -1L ^ (-1L << SEQUENCE_BIT);
// 每一部分向左的位移
private final static long MACHINE_LEFT = SEQUENCE_BIT;
private final static long DATACENTER_LEFT = SEQUENCE_BIT + MACHINE_BIT;
private final static long TIMESTMP_LEFT = DATACENTER_LEFT + DATACENTER_BIT;
private long datacenterId; // 数据中心
private long machineId; // 机器标识
private long sequence = 0L; // 序列号
private long lastStmp = -1L;// 上一次时间戳
public SnowFlake(long datacenterId, long machineId) {
if (datacenterId > MAX_DATACENTER_NUM || datacenterId < 0) {
throw new IllegalArgumentException("datacenterId can't be greater than MAX_DATACENTER_NUM or less than 0");
}
if (machineId > MAX_MACHINE_NUM || machineId < 0) {
throw new IllegalArgumentException("machineId can't be greater than MAX_MACHINE_NUM or less than 0");
}
this.datacenterId = datacenterId;
this.machineId = machineId;
}
//产生下一个ID
public synchronized long nextId() {
long currStmp = getNewstmp();
if (currStmp < lastStmp) {
throw new RuntimeException("Clock moved backwards. Refusing to generate id");
}
if (currStmp == lastStmp) {
//if条件里表示当前调用和上一次调用落在了相同毫秒内只能通过第三部分序列号自增来判断为唯一所以+1.
sequence = (sequence + 1) & MAX_SEQUENCE;
//同一毫秒的序列数已经达到最大,只能等待下一个毫秒
if (sequence == 0L) {
currStmp = getNextMill();
}
} else {
//不同毫秒内序列号置为0
//执行到这个分支的前提是currTimestamp > lastTimestamp说明本次调用跟上次调用对比已经不再同一个毫秒内了这个时候序号可以重新回置0了。
sequence = 0L;
}
lastStmp = currStmp;
//就是用相对毫秒数、机器ID和自增序号拼接
return (currStmp - START_STMP) << TIMESTMP_LEFT //时间戳部分
| datacenterId << DATACENTER_LEFT //数据中心部分
| machineId << MACHINE_LEFT //机器标识部分
| sequence; //序列号部分
}
private long getNextMill() {
long mill = getNewstmp();
while (mill <= lastStmp) {
mill = getNewstmp();
}
return mill;
}
private long getNewstmp() {
return System.currentTimeMillis();
}
/** 测试 */
public static void main(String[] args) {
SnowFlake idWorker = new SnowFlake(0, 0);
for (int i = 0; i < 100; i++) {
long id = idWorker.nextId();
//System.out.println(Long.toBinaryString(id));
System.out.println(id);
}
Runnable testRun = new Runnable() {
@Override
public void run() {
SnowFlake idWorker = new SnowFlake(0, 0);
for (int i = 0; i < 10; i++) {
System.out.println(idWorker.nextId());
}
}
};
Thread thread1 = new Thread(testRun);
thread1.start();
Thread thread2 = new Thread(testRun);
thread2.start();
Thread thread3 = new Thread(testRun);
thread3.start();
Thread thread4 = new Thread(testRun);
thread4.start();
Thread thread5 = new Thread(testRun);
thread5.start();
}
}

@ -0,0 +1,123 @@
package cn.estsh.i3plus.pojo.base.codemaker;
/**
* @Description :
* @Reference :
* @Author : alwaysfrin
* @CreateDate : 2019-01-10 13:27
* @Modify:
**/
@Deprecated
public class SnowflakeId {
private long workerId;
private long datacenterId;
private long sequence = 0L;
public SnowflakeId(){
this.workerId = 1;
this.datacenterId = 1;
this.sequence = 0L;
}
public SnowflakeId(long workerId, long datacenterId){
if (workerId > maxWorkerId || workerId < 0) {
throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0",maxWorkerId));
}
if (datacenterId > maxDatacenterId || datacenterId < 0) {
throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0",maxDatacenterId));
}
this.workerId = workerId;
this.datacenterId = datacenterId;
}
private long twepoch = 1288834974657L;
private long workerIdBits = 5L;
private long datacenterIdBits = 5L;
private long maxWorkerId = -1L ^ (-1L << workerIdBits);
private long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
private long sequenceBits = 12L;
private long workerIdShift = sequenceBits;
private long datacenterIdShift = sequenceBits + workerIdBits;
private long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
private long sequenceMask = -1L ^ (-1L << sequenceBits);
private long lastTimestamp = -1L;
private long getWorkerId(){
return workerId;
}
private long getDatacenterId(){
return datacenterId;
}
public synchronized long nextId() {
long timestamp = timeGen();
if (timestamp < lastTimestamp) {
System.err.printf("clock is moving backwards. Rejecting requests until %d.", lastTimestamp);
throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds",
lastTimestamp - timestamp));
}
if (lastTimestamp == timestamp) {
sequence = (sequence + 1) & sequenceMask;
if (sequence == 0) {
timestamp = tilNextMillis(lastTimestamp);
}
} else {
sequence = 0;
}
lastTimestamp = timestamp;
return ((timestamp - twepoch) << timestampLeftShift) |
(datacenterId << datacenterIdShift) |
(workerId << workerIdShift) |
sequence;
}
private long tilNextMillis(long lastTimestamp) {
long timestamp = timeGen();
while (timestamp <= lastTimestamp) {
timestamp = timeGen();
}
return timestamp;
}
private long timeGen(){
return System.currentTimeMillis();
}
//---------------测试---------------
public static void main(String[] args) {
SnowflakeId worker = new SnowflakeId();
Runnable testRun = new Runnable() {
@Override
public void run() {
for (int i = 0; i < 10; i++) {
System.out.println(i + "=" + worker.nextId());
}
}
};
Thread thread1 = new Thread(testRun);
thread1.start();
Thread thread2 = new Thread(testRun);
thread2.start();
Thread thread3 = new Thread(testRun);
thread3.start();
Thread thread4 = new Thread(testRun);
thread4.start();
Thread thread5 = new Thread(testRun);
thread5.start();
System.out.println(new SnowflakeId().nextId());
for (int i = 0; i < 10; i++) {
//System.out.println(worker.nextId());
}
}
}

@ -10,30 +10,27 @@ package cn.estsh.i3plus.pojo.base.codemaker;
* @Modify:
**/
public class SnowflakeIdMaker {
private long workerId;
private long datacenterId;
private long sequence;
private long sequence = 0L;
public SnowflakeIdMaker(){
this.workerId = 1;
this.datacenterId = 1;
this.sequence = 1;
this.sequence = 0L;
}
public SnowflakeIdMaker(long workerId, long datacenterId, long sequence){
// sanity check for workerId
public SnowflakeIdMaker(long workerId, long datacenterId){
if (workerId > maxWorkerId || workerId < 0) {
throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0",maxWorkerId));
}
if (datacenterId > maxDatacenterId || datacenterId < 0) {
throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0",maxDatacenterId));
}
// System.out.printf("worker starting. timestamp left shift %d, datacenter id bits %d, worker id bits %d, sequence bits %d, workerid %d",
// timestampLeftShift, datacenterIdBits, workerIdBits, sequenceBits, workerId);
this.workerId = workerId;
this.datacenterId = datacenterId;
this.sequence = sequence;
}
private long twepoch = 1288834974657L;
@ -59,10 +56,6 @@ public class SnowflakeIdMaker {
return datacenterId;
}
private long getTimestamp(){
return System.currentTimeMillis();
}
public synchronized long nextId() {
long timestamp = timeGen();
@ -102,13 +95,26 @@ public class SnowflakeIdMaker {
//---------------测试---------------
public static void main(String[] args) {
System.out.println(new SnowflakeIdMaker().nextId());
SnowflakeIdMaker worker = new SnowflakeIdMaker();
for (int i = 0; i < 10; i++) {
System.out.println(worker.nextId());
}
Runnable testRun = new Runnable() {
@Override
public void run() {
for (int i = 0; i < 10; i++) {
System.out.println(worker.nextId());
}
}
};
Thread thread1 = new Thread(testRun);
thread1.start();
Thread thread2 = new Thread(testRun);
thread2.start();
Thread thread3 = new Thread(testRun);
thread3.start();
Thread thread4 = new Thread(testRun);
thread4.start();
Thread thread5 = new Thread(testRun);
thread5.start();
worker = new SnowflakeIdMaker(1,1,1);
for (int i = 0; i < 10; i++) {
System.out.println(worker.nextId());
}

@ -0,0 +1,161 @@
package cn.estsh.i3plus.pojo.base.codemaker;
/**
* @Description :
* @Reference :
* @Author : alwaysfrin
* @CreateDate : 2019-01-10 13:07
* @Modify:
**/
@Deprecated
public class SnowflakeIdWorker {
/** 开始时间截 (2015-01-01) */
private final long twepoch = 1420041600000L;
/** 机器id所占的位数 */
private final long workerIdBits = 5L;
/** 数据标识id所占的位数 */
private final long datacenterIdBits = 5L;
/** 支持的最大机器id结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) */
private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
/** 支持的最大数据标识id结果是31 */
private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
/** 序列在id中占的位数 */
private final long sequenceBits = 12L;
/** 机器ID向左移12位 */
private final long workerIdShift = sequenceBits;
/** 数据标识id向左移17位(12+5) */
private final long datacenterIdShift = sequenceBits + workerIdBits;
/** 时间截向左移22位(5+5+12) */
private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
/** 生成序列的掩码这里为4095 (0b111111111111=0xfff=4095) */
private final long sequenceMask = -1L ^ (-1L << sequenceBits);
/** 工作机器ID(0~31) */
private long workerId;
/** 数据中心ID(0~31) */
private long datacenterId;
/** 毫秒内序列(0~4095) */
private long sequence = 0L;
/** 上次生成ID的时间截 */
private long lastTimestamp = -1L;
//==============================Constructors=====================================
/**
*
* @param workerId ID (0~31)
* @param datacenterId ID (0~31)
*/
public SnowflakeIdWorker(long workerId, long datacenterId) {
if (workerId > maxWorkerId || workerId < 0) {
throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
}
if (datacenterId > maxDatacenterId || datacenterId < 0) {
throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
}
this.workerId = workerId;
this.datacenterId = datacenterId;
}
// ==============================Methods==========================================
/**
* ID (线)
* @return SnowflakeId
*/
public synchronized long nextId() {
long timestamp = timeGen();
//如果当前时间小于上一次ID生成的时间戳说明系统时钟回退过这个时候应当抛出异常
if (timestamp < lastTimestamp) {
throw new RuntimeException(
String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
}
//如果是同一时间生成的,则进行毫秒内序列
if (lastTimestamp == timestamp) {
sequence = (sequence + 1) & sequenceMask;
//毫秒内序列溢出
if (sequence == 0) {
//阻塞到下一个毫秒,获得新的时间戳
timestamp = tilNextMillis(lastTimestamp);
}
}
//时间戳改变,毫秒内序列重置
else {
sequence = 0L;
}
//上次生成ID的时间截
lastTimestamp = timestamp;
//移位并通过或运算拼到一起组成64位的ID
return ((timestamp - twepoch) << timestampLeftShift) //
| (datacenterId << datacenterIdShift) //
| (workerId << workerIdShift) //
| sequence;
}
/**
*
* @param lastTimestamp ID
* @return
*/
protected long tilNextMillis(long lastTimestamp) {
long timestamp = timeGen();
while (timestamp <= lastTimestamp) {
timestamp = timeGen();
}
return timestamp;
}
/**
*
* @return ()
*/
protected long timeGen() {
return System.currentTimeMillis();
}
//==============================Test=============================================
/** 测试 */
public static void main(String[] args) {
SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);
for (int i = 0; i < 100; i++) {
long id = idWorker.nextId();
//System.out.println(Long.toBinaryString(id));
System.out.println(id);
}
Runnable testRun = new Runnable() {
@Override
public void run() {
SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);
for (int i = 0; i < 10; i++) {
System.out.println(idWorker.nextId());
}
}
};
Thread thread1 = new Thread(testRun);
thread1.start();
Thread thread2 = new Thread(testRun);
thread2.start();
Thread thread3 = new Thread(testRun);
thread3.start();
Thread thread4 = new Thread(testRun);
thread4.start();
Thread thread5 = new Thread(testRun);
thread5.start();
}
}

@ -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,845 @@
package cn.estsh.i3plus.pojo.base.enumutil;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.ArrayList;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : alwaysfrin
* @CreateDate : 2018-12-25 21:08
* @Modify:
**/
public class BlockReportEnumUtil {
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SOFT_TYPE {
CORE(2, "i3core", "i3业务平台");
private int value;
private String code;
private String description;
private SOFT_TYPE(int value, String code, String description) {
this.value = value;
this.code = code;
this.description = description;
}
public int getValue() {
return value;
}
public String getCode() {
return code;
}
public String getDescription() {
return description;
}
public static String valueOfCode(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].code;
}
}
return tmp;
}
public static int codeOfValue(String code) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].code.equals(code)) {
tmp = values()[i].value;
}
}
return tmp;
}
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;
}
public static SOFT_TYPE valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static String codeOfDescription(String code) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].code.equals(code)) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
*
* 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;
}
}
/**
*
* 1
* 2
* 3
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum DATA_STATUS {
ENABLE(1, "启用", "fa fa-success cell-fa fa-check"),
DISABLE(2, "禁用", "fa fa-disabled cell-fa fa-times-circle");
private int value;
private String name;
private String description;
DATA_STATUS() {
}
DATA_STATUS(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
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].getName();
}
}
return tmp;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
*
* 1
* 2
* 3
* 4
* 5
* 6
* 7
* 8
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum TEMPLATE_STATUS {
SAVE_TEMPLATE(1, "新建模板", "新建模板"),
SAVE_TEMPLATE_POJO(2, "新建模板对象", "新建模板对象"),
SAVE_TEMPLATE_ATTR_WHERE(3, "新建模板查询条件", "新建模板查询条件"),
SAVE_TEMPLATE_ATTR_GROUP(4, "新建模板分组条件", "新建模板分组条件"),
SAVE_TEMPLATE_ATTR_AGGREGATION(5, "新建模板聚合条件", "新建模板聚合条件"),
SAVE_TEMPLATE_ATTR_SHOW(6, "新建模板显示条件", "新建模板显示条件"),
SAVE_TEMPLATE_ATTR_CONFIRM(7, "新建模板确认条件", "新建模板确认条件"),
SAVE_TEMPLATE_FULFIL(8, "新建模板确认条件", "新建模板确认条件");
private int value;
private String name;
private String description;
TEMPLATE_STATUS() {
}
TEMPLATE_STATUS(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
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].getName();
}
}
return tmp;
}
public static TEMPLATE_STATUS enumOf(int val) {
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
*
* 1
* 2
* 3
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum TEMPLATE_TYPE {
TABLE(1, "表格", "表格模板");
private int value;
private String name;
private String description;
TEMPLATE_TYPE() {
}
TEMPLATE_TYPE(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
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].getName();
}
}
return tmp;
}
public static TEMPLATE_TYPE enumOf(int val) {
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum TEMPLATE_STYLE {
TABLE_LEFT(1, TEMPLATE_TYPE.TABLE, "text-left", "表单左对齐"),
TABLE_RIGHT(2, TEMPLATE_TYPE.TABLE, "text-center", "表单右对齐"),
TABLE_CENTER(3, TEMPLATE_TYPE.TABLE, "text-right", "表单居中");
private int value;
private TEMPLATE_TYPE group;
private String name;
private String description;
TEMPLATE_STYLE() {
}
TEMPLATE_STYLE(int value,TEMPLATE_TYPE group, String name, String description) {
this.value = value;
this.group = group;
this.name = name;
this.description = description;
}
public static TEMPLATE_STYLE[] getGroup(TEMPLATE_TYPE type){
if(type != null){
List<TEMPLATE_STYLE> list = new ArrayList<>();
for (TEMPLATE_STYLE style : TEMPLATE_STYLE.values()) {
if(style.group.equals(type)){
list.add(style);
}
}
return list.toArray(new TEMPLATE_STYLE[list.size()]);
}
return null;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
public static TEMPLATE_STYLE valueOf(int val) {
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
* HQL WHERE
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum HQL_WHERE{
GT(1, ">", "大于"),
GT_EQUAL(2, ">=", "大于等于"),
LT(3, "<", "小于等于"),
LT_EQUAL(4, "<=", "小于等于"),
LIKE(5, "LIKE", "模糊"),
LIKE_LEFT(6, "LIKE", "左模糊"),
LIKE_RIGHT(7, "LIKE", "右模糊"),
EQUAL(8, "=", "等于"),
EQUAL_NOT(9, "!=", "不等于"),
AND(10, "AND", "AND"),
OR(11, "OR", "OR"),
NOT(12, "NOT", "NOT"),
IS_NULL(13, "IS NULL", "IS NULL"),
IS_NOT_NULL(14, "IS NOT NULL", "IS NOT NULL");
private int value;
private String name;
private String description;
HQL_WHERE() {
}
HQL_WHERE(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
public static HQL_WHERE valueOf(int val) {
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/***
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum HQL_REF{
LEFT_JOIN(1, "left join", "左连接"),
RIGHT_JOIN(2, "right join", "右连接"),
INNER_JOIN(3, "inner join", "内连接");
private int value;
private String name;
private String description;
HQL_REF() {
}
HQL_REF(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
public static HQL_REF valueOf(int val) {
HQL_REF tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum HQL_AGGREGATION{
AVG(1, "avg", "平均值"),
MIN(2, "min", "最小值"),
MAX(3, "max", "最大值"),
SUM(4, "sum", "总和"),
COUNT(5, "count", "计数");
private int value;
private String name;
private String description;
HQL_AGGREGATION() {
}
HQL_AGGREGATION(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
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].getName();
}
}
return tmp;
}
public static HQL_AGGREGATION valueOf(Integer val) {
if(val != null){
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val.intValue()) {
return values()[i];
}
}
}
return null;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum HQL_ATTR_DATA_TYPE{
SHOW(1, "show", "显示"),
WHERE(2, "where", "查询"),
GROUP(3, "group", "分组"),
AGGREGATION(4, "聚合", "聚合");
private int value;
private String name;
private String description;
HQL_ATTR_DATA_TYPE() {
}
HQL_ATTR_DATA_TYPE(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
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].getName();
}
}
return tmp;
}
public static HQL_ATTR_DATA_TYPE valueOf(Integer val) {
if(val != null){
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val.intValue()) {
return values()[i];
}
}
}
return null;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum HQL_ORDER{
ASC(1, "ASC", "升序"),
DESC(2, "DESC", "降序");
private int value;
private String name;
private String description;
HQL_ORDER() {
}
HQL_ORDER(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
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].getName();
}
}
return tmp;
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
*
* ELEMENT(1,"元素"),TEMPLATE(2,"模板");
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum REPORT_TYPESET_TYPE{
ELEMENT(1,"元素"),TEMPLATE(2,"模板");
private int value;
private String description;
REPORT_TYPESET_TYPE() {
}
REPORT_TYPESET_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;
}
}
}

@ -85,14 +85,23 @@ public class CommonEnumUtil {
return tmp;
}
public static String codeOfDescription(String code) {
public static SOFT_TYPE valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static SOFT_TYPE codeOfDescription(String code) {
for (int i = 0; i < values().length; i++) {
if (values()[i].code.equals(code)) {
tmp = values()[i].description;
return values()[i];
}
}
return tmp;
return null;
}
}
@ -443,7 +452,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;

@ -158,11 +158,11 @@ public class ImppEnumUtil {
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum LOG_LEVEL{
DEBUG(1,"DEBUG","调试程序信息"),
INFO(2,"INFO","程序运行信息"),
WARN(3,"WARN","具有潜在危害的信息"),
ERROR(4,"ERROR","错误信息但允许程序继续运行"),
FATAL(5,"FATAL","非常严重的错误,可能导致程序中止");
DEBUG(1,"DEBUG","调试"),
INFO(2,"INFO","信息"),
WARN(3,"WARN","注意"),
ERROR(4,"ERROR","错误"),
FATAL(5,"FATAL","严重");
private int value;
private String name;

@ -293,8 +293,8 @@ public class WmsEnumUtil {
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum QUEUE_NAME {
SUCCESS_QUEUE(1, "success_queue", "成功消息队列"),
FAIL_QUEUE(2, "fail_queue", "成功消息队列");
SUCCESS_QUEUE(1, "wms_success_queue", "成功消息队列"),
FAIL_QUEUE(2, "wms_fail_queue", "成功消息队列");
private int value;
private String name;

@ -16,6 +16,7 @@ import org.bson.json.JsonMode;
import org.bson.json.JsonWriterSettings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity;
@ -110,8 +111,26 @@ public class BaseMongoRepositoryImpl<T, ID extends Serializable> extends SimpleM
}
}
this.mongoOperations.insert(item, this.entityInformation.getCollectionName());
if(idField!=null){
// try {
this.mongoOperations.insert(item, this.entityInformation.getCollectionName());
// }catch (DuplicateKeyException dke){
// LOGGER.error("【出现重复主键】");
// //出现重复主键,再次插入
// if(idField != null){
// Class<?> type = idField.getType();
// Object val = idField.get(item);
// if((type == long.class || type == Long.class) && (val == null || Long.parseLong(val.toString()) == 0)){
// // long类型主键以snowflake为主键
// idField.set(item, snowflakeIdMaker.nextId());
// } else if(type == String.class && (val==null || "".equals(val))){
// // String类型主键以UUID为主键
// idField.set(item, UUID.randomUUID().toString().replace("-", "").toLowerCase());
// }
// }
//
// this.mongoOperations.insert(item, this.entityInformation.getCollectionName());
// }
if(idField != null){
return item;
}else {
return null;

@ -37,11 +37,11 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
private Class<T> persistentClass;
private SnowflakeIdMaker snowflakeIdMaker;
public BaseRepositoryImpl(Class<T> clz, EntityManager em) {
public BaseRepositoryImpl(Class<T> clz, EntityManager em,SnowflakeIdMaker snowflakeIdMaker) {
super(clz, em);
this.entityManager = em;
this.persistentClass = clz;
this.snowflakeIdMaker = new SnowflakeIdMaker();
this.snowflakeIdMaker = snowflakeIdMaker;
}
private void setParameter(Query query, String[] propName, Object[] propValue) {

@ -1,8 +1,10 @@
package cn.estsh.i3plus.pojo.base.jpa.factory;
import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker;
import cn.estsh.i3plus.pojo.base.jpa.daoimpl.BaseRepositoryImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.support.JpaRepositoryFactory;
import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean;
@ -23,6 +25,9 @@ import java.io.Serializable;
public class BaseRepositoryFactoryBean<R extends JpaRepository<T, I>, T, I extends Serializable> extends JpaRepositoryFactoryBean<R, T, I> {
public static final Logger LOGGER = LoggerFactory.getLogger(BaseRepositoryFactoryBean.class);
@Autowired
public SnowflakeIdMaker snowflakeIdMaker;
public BaseRepositoryFactoryBean(Class<? extends R> repositoryInterface) {
super(repositoryInterface);
}
@ -30,22 +35,24 @@ public class BaseRepositoryFactoryBean<R extends JpaRepository<T, I>, T, I exten
@Override
protected RepositoryFactorySupport createRepositoryFactory(EntityManager em) {
//LOGGER.info("【初始JPA持久仓】");
return new BaseRepositoryFactory(em);
return new BaseRepositoryFactory(em,snowflakeIdMaker);
}
//创建一个内部类,该类不用在外部访问
private static class BaseRepositoryFactory<T, I extends Serializable> extends JpaRepositoryFactory {
private final EntityManager em;
private final SnowflakeIdMaker snowflakeIdMaker;
public BaseRepositoryFactory(EntityManager em) {
public BaseRepositoryFactory(EntityManager em,SnowflakeIdMaker snowflakeIdMaker) {
super(em);
this.em = em;
this.snowflakeIdMaker = snowflakeIdMaker;
}
//设置具体的实现类是BaseRepositoryImpl
@Override
protected Object getTargetRepository(RepositoryInformation information) {
return new BaseRepositoryImpl<T, I>((Class<T>) information.getDomainType(), em);
return new BaseRepositoryImpl<T, I>((Class<T>) information.getDomainType(), em,snowflakeIdMaker);
}
//设置具体的实现类的class

@ -24,6 +24,11 @@
<artifactId>i3plus-pojo-platform</artifactId>
</dependency>
<dependency>
<groupId>i3plus.pojo</groupId>
<artifactId>i3plus-pojo-report</artifactId>
</dependency>
</dependencies>

@ -1,10 +1,11 @@
package cn.estsh.i3plus.pojo.model.common;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiParam;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.Data;
import javax.persistence.Column;
import java.io.Serializable;
/**
@ -14,9 +15,7 @@ import java.io.Serializable;
* @CreateDate : 2018-12-29 15:17
* @Modify:
**/
@Getter
@Setter
@ToString
@Data
public class ClassFieldModel implements Serializable {
@ApiParam(value ="包名")
@ -31,6 +30,15 @@ public class ClassFieldModel implements Serializable {
@ApiParam(value ="属性名")
private String fieldName;
@ApiParam(value ="属性别名")
private String fieldNameAlias;
@ApiParam(value ="属性描述")
private String fieldDesc;
@Column(name="AGGREGATION_TYPE")
@ApiParam(value ="聚合ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long aggregationId;
}

@ -1,11 +1,15 @@
package cn.estsh.i3plus.pojo.model.common;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.List;
/**
* @Description :
@ -14,11 +18,22 @@ import java.io.Serializable;
* @CreateDate : 2018-12-29 15:17
* @Modify:
**/
@Getter
@Setter
@ToString
@Data
public class ClassModel implements Serializable {
@ApiParam(value ="服务ID")
private int serverId;
@ApiParam(value ="服务ID")
private String serverName;
@ApiParam(value ="服务对象ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long serverPojoId;
@ApiParam(value ="服务对象别名")
private String serverPojoNameAlias;
@ApiParam(value ="包名")
private String packageName;
@ -30,4 +45,7 @@ public class ClassModel implements Serializable {
@ApiParam(value ="类描述")
private String clzDesc;
@ApiParam(value ="属性集合")
private List<ClassFieldModel> fieldList;
}

@ -0,0 +1,35 @@
package cn.estsh.i3plus.pojo.model.report;
import cn.estsh.i3plus.pojo.report.bean.BrPojoAttr;
import cn.estsh.i3plus.pojo.report.bean.BrTemplateCustomHql;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import java.util.List;
/**
* @Description ://TODO 提交注意修改 临时使用 带改动
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-01-25 18:19
* @Modify:
**/
@Data
public class BeanBrPojoAttrModel {
@ApiParam(value = "表单模板ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long templateId;
@ApiParam(value = "数据类型")
private Integer dataType;
@ApiParam(value = "对象属性")
private List<BrPojoAttr> attrList;
@ApiParam(value = "自定义HQL")
private BrTemplateCustomHql customHql;
}

@ -0,0 +1,30 @@
package cn.estsh.i3plus.pojo.model.report;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiParam;
import lombok.Data;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-01-20 14:05
* @Modify:
**/
@Data
public class TemplateModel {
@ApiParam("模板ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long templateId;
@ApiParam("执行 HQL ")
private String hql;
@ApiParam("执行 HQL 参数名称 ")
private String[] paramName;
@ApiParam("执行 HQL 参数值 ")
private Object[] paramValue;
}

@ -0,0 +1,34 @@
package cn.estsh.i3plus.pojo.platform.bean;
import io.swagger.annotations.ApiParam;
import lombok.Data;
/**
* @Description :
* @Reference :
* @Author : yunhao
* @CreateDate : 2019-01-27 10:53
* @Modify:
**/
@Data
public class MailConfig {
@ApiParam(value = "邮箱服务器")
private String mailHost;
@ApiParam(value = "邮箱端口")
private Integer mailPort;
@ApiParam(value = "邮箱账号")
private String mailUser;
@ApiParam(value = "邮箱密码")
private String mailPassword;
@ApiParam(value = "发信昵称")
private String mailNick;
@ApiParam(value = "测试收信人")
private String testTo;
}

@ -30,7 +30,6 @@ import javax.persistence.Table;
@Api(value="关系-用户角色",description = "关系-用户角色")
public class SysRefUserRole extends BaseBean {
private static final long serialVersionUID = 1L;
@Column(name="USER_ID")
@ApiParam(value ="用户ID" , example = "-1")

@ -3,9 +3,6 @@ package cn.estsh.i3plus.pojo.platform.bean;
import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.bean.BaseConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;

@ -38,26 +38,26 @@ 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")
@ApiParam(value ="元素值")
private String elementValue;
@Column(name="ELEMENT_LINK")
@ApiParam(value ="元素连接")
private String elementLink;
@Column(name="ELEMENT_FILE_ID")
@ApiParam(value ="元素文件id")
private Long elementFileId;
@Column(name="ELEMENT_FILE_URL")
@ApiParam(value ="元素文件Url")
private String elementFileUrl;
@Column(name="ELEMENT_STYLE")
@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;
}

@ -42,23 +42,27 @@ public class BrLayout extends BaseBean {
@ApiParam(value ="布局高度")
private Double layoutHeight;
@Column(name="ROW_COUNT")
@Column(name="LAYOUT_ROW_COUNT")
@ApiParam(value ="行数")
private Integer rowCount;
private Integer layoutRowCount;
@Column(name="COLUMN_COUNT")
@Column(name="LAYOUT_COLUMN_COUNT")
@ApiParam(value ="列数")
private Integer columnCount;
private Integer layoutColumnCount;
@Column(name="SEQ")
@ApiParam(value ="排序")
private Integer seq;
@Column(name="LAYOUT_REPORT_COUNT")
@ApiParam(value ="引用报表数量")
private Integer layoutReportCount;
@Transient
@ApiParam(value ="模板行列表")
private List<BrLayoutRow> brLayoutRowList;
@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<BrReport> brReportList;
@ApiParam(value ="模板行列表")
private List<BrLayoutRow> brLayoutRows;
}

@ -42,27 +42,35 @@ 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="SEQ")
@ApiParam(value ="排序")
private Integer seq;
@Column(name="COLUMN_HEIGHT")
@ApiParam(value ="列高")
private Integer columnHeight;
@Transient
@ApiParam(value ="列所在的行")
private BrLayoutRow brLayoutRow;
@Column(name="COLUMN_STYLE")
@ApiParam(value ="列样式")
private String columnStyle;
@Column(name="COLUMN_SEQ")
@ApiParam(value ="排序")
private Integer columnSeq;
@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",columnDefinition = "TEXT")
@ApiParam(value ="列html")
private String columnHtml;
}

@ -37,24 +37,31 @@ 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 ="行高")
private Integer rowHeight;
@Column(name="SEQ")
@Column(name="ROW_SEQ")
@ApiParam(value ="排序")
private Integer seq;
private Integer rowSeq;
@Transient
@ApiParam(value ="行所在的布局")
private BrLayout brLayout;
@Column(name="ROW_STYLE",columnDefinition = "TEXT")
@ApiParam(value ="行样式")
private String rowStyle;
@Column(name="ROW_COL_NUM")
@ApiParam(value ="行所关联列数")
private Integer rowColNum;
@Column(name="ROW_HTML",columnDefinition = "TEXT")
@ApiParam(value ="行html")
private String rowHtml;
@Transient
@ApiParam(value ="行所包含的列")
private List<BrLayoutColumn> brLayoutColumns;
}

@ -0,0 +1,119 @@
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;
// 根节点-1
@Column(name="REPORT_ID")
@ApiParam(value ="报表ID" , example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long reportId;
@Column(name="REPORT_NAME_RDD")
@ApiParam(value ="报表名称" , access ="父级功能名称")
private String reportNameRdd;
@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;
@Column(name="ROLE_NAMES_RDD")
@ApiParam(value ="角色名称" , access ="角色名称")
private String roleNamesRdd;
@Transient
@ApiParam(value ="查询 ID 集合")
private List<Long> findIdList = new ArrayList<>();
@Transient
@ApiParam(value ="角色ID 集合")
private List<String> roleIdList = new ArrayList<>();
@Transient
@ApiParam(value ="子集列表")
private List<BrMenu> childList = new ArrayList<>();
}

@ -0,0 +1,112 @@
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-18 11:32
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_POJO_ATTR")
@Api(value="对象属性",description = "对象属性")
public class BrPojoAttr extends BaseBean {
@Column(name="TEMPLATE_ID")
@ApiParam(value ="模板编号" ,example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long templateId;
@Column(name="SERVER_ID")
@ApiParam(value ="服务ID",example = "-1")
private Integer serverId;
@Column(name="POJO_ID")
@ApiParam(value ="模板对象ID" ,example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long pojoId;
@Column(name="POJO_NAME")
@ApiParam(value ="对象名称")
private String pojoName;
@Column(name="PACKAGE_NAME_RDD")
@ApiParam(value ="主服务对象包名称" , access ="服务对象包名称")
private String packageNameRdd;
@Column(name="POJO_NAME_ALIAS")
@ApiParam(value ="对象别名")
private String pojoNameAlias;
@Column(name="ATTR_NAME")
@ApiParam(value ="属性别名")
private String attrName;
@Column(name="ATTR_NAME_ALIAS")
@ApiParam(value ="属性别名")
private String attrNameAlias;
@Column(name="ATTR_TYPE")
@ApiParam(value ="属性类型",example = "-1")
private Integer attrType;
@Column(name="ATTR_REF_TYPE")
@ApiParam(value ="关系类型",example = "-1")
private Integer attrRefType;
@Column(name="DATA_TYPE")
@ApiParam(value ="数据类型",example = "-1")
private Integer dataType;
@Column(name="AGGREGATION_TYPE")
@ApiParam(value ="聚合类型",example = "-1")
private Integer aggregationType;
@Column(name="AGGREGATION_ID")
@ApiParam(value ="聚合类型",example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long aggregationId;
@Column(name="ATTR_SORT")
@ApiParam(value ="字段排序")
private Integer attrSort;
@Column(name="ATTR_DATA_SORT")
@ApiParam(value ="字段排序")
private Integer attrDataSort;
@Column(name="ATTR_STYLE")
@ApiParam(value ="字段样式")
private Integer attrStyle;
@Column(name="ATTR_STYLE_RDD")
@ApiParam(value ="字段样式")
private String attrStyleRdd;
@Column(name="ATTR_DEFAULT_VALUE")
@ApiParam(value ="属性默认值")
private String attrDefaultValue;
@Column(name="ATTR_SHOW")
@ApiParam(value ="属性是否显示",example = "-1")
private Integer attrShow;
}

@ -0,0 +1,77 @@
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-18 11:32
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_REF_POJO")
@Api(value="对象关系",description = "对象关系")
public class BrRefPojo extends BaseBean {
@Column(name="TEMPLATE_ID")
@ApiParam(value ="模板编号" ,example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long templateId;
@Column(name="REF_TYPE")
@ApiParam(value ="关系类型")
private Integer refType;
@Column(name="REF_SORT")
@ApiParam(value ="关系排序")
private Integer refSort;
@Column(name="MASTER_SERVER_ID")
@ApiParam(value ="主服务编号" ,example = "-1")
private Integer masterServerId;
@Column(name="MASTER_POJO_NAME")
@ApiParam(value ="副对象名称")
private String masterPojoName;
@Column(name="MASTER_POJO_NAME_ALIAS")
@ApiParam(value ="主对象别名")
private String masterPojoNameAlias;
@Column(name="MASTER_POJO_NAME_ATTR_NAME")
@ApiParam(value ="主对象属性名称" )
private String masterPojoAttName;
@Column(name="SECONDARY_SERVER_ID")
@ApiParam(value ="主服务编号")
private Integer secondaryServerId;
@Column(name="SECONDARY_POJO_NAME")
@ApiParam(value ="副对象名称")
private String secondaryPojoName;
@Column(name="SECONDARY_POJO_NAME_ALIAS")
@ApiParam(value ="副对象别名" )
private String secondaryPojoNameAlias;
@Column(name="SECONDARY_POJO_ATTR_NAME")
@ApiParam(value ="副对象属性名称")
private String secondaryPojoAttrName;
}

@ -13,8 +13,6 @@ import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;
/**
* @Description :
@ -28,31 +26,44 @@ import java.util.List;
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_REPORT_ELEMENT_DETAIL")
@Api(value="元素&报表",description = "元素和报表的关联表 * -》 *")
public class BrReportElementDetail extends BaseBean {
@Table(name="BR_REF_REPORT_TYPESET")
@Api(value="元素&模板&报表",description = "报表,元素和模板的关联表 * -》 *")
public class BrRefReportTypeset 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 = "REPORT_TYPESET_TYPE")
@ApiParam(value = "报表列类型")
private Integer reportTypesetType;
@Column(name = "LAYOUT_COLUMN_ID")
@ApiParam(value = "列主键")
@ApiParam(value = "布局列主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long layoutColumnId;
/**
* idid
*/
@Column(name = "REF_ID")
@ApiParam(value = "关联id")
@JsonSerialize (using = ToStringSerializer.class)
private Long refId;
@Transient
@ApiParam(value = "报表实例")
private BrReport brReport;
/**
* html
*/
@Column(name = "REF_HTML")
@ApiParam(value = "关联对象html")
private String refHtml;
@Transient
@ApiParam(value = "报表元素")
private BrElement brElement;
@Column(name = "TYPESET_DESCRIPTION",columnDefinition = "TEXT")
@ApiParam(value ="排版描述")
private String typesetDescription;
}

@ -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,115 @@
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.List;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-01-18 11:31
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_REF_SERVER_POJO")
@Api(value="报表模板服务对象",description = "报表模板服务对象")
public class BrRefServerPojo extends BaseBean {
@Column(name="TEMPLATE_ID")
@ApiParam(value ="模板编号" ,example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long templateId;
@Column(name="TEMPLATE_NAME_RDD")
@ApiParam(value ="模板名称" , access ="模板名称")
private String templateNameRdd;
@Column(name="POJO_REF_TYPE")
@ApiParam(value ="关系类型")
private Integer pojoRefType;
@Column(name="POJO_WHERE_TYPE")
@ApiParam(value ="连接关系")
private Integer pojoWhereType;
@Column(name="POJO_SORT")
@ApiParam(value ="主服务编号" ,example = "-1")
private Integer pojoSort;
@Column(name="MASTER_SERVER_ID")
@ApiParam(value ="主服务编号" ,example = "-1")
private Integer masterServerId;
@Column(name="MASTER_SERVER_NAME_RDD")
@ApiParam(value ="主服务名称" ,example = "-1")
private String masterServerNameRdd;
@Column(name="MASTER_POJO_NAME")
@ApiParam(value ="副对象名称")
private String masterPojoName;
@Column(name="MASTER_PACKAGE_NAME_RDD")
@ApiParam(value ="主服务对象包名称" , access ="服务对象包名称")
private String masterPackageNameRdd;
@Column(name="MASTER_POJO_NAME_ALIAS")
@ApiParam(value ="主对象别名")
private String masterPojoNameAlias;
@Column(name="MASTER_POJO_NAME_DESC")
@ApiParam(value ="主对象中文名称")
private String masterPojoNameDesc;
@Column(name="MASTER_POJO_NAME_ATTR_NAME")
@ApiParam(value ="主对象属性名称" )
private String masterPojoAttrName;
@Column(name="SECONDARY_SERVER_ID")
@ApiParam(value ="主服务编号")
private Integer secondaryServerId;
@Column(name="SECONDARY_SERVER_NAME")
@ApiParam(value ="主服务编号")
private String secondaryServerName;
@Column(name="SECONDARY_POJO_NAME")
@ApiParam(value ="副对象名称")
private String secondaryPojoName;
@Column(name="SECONDARY_PACKAGE_NAME")
@ApiParam(value ="主服务对象包名称" , access ="服务对象包名称")
private String secondaryPackageName;
@Column(name="SECONDARY_POJO_NAME_ALIAS")
@ApiParam(value ="副对象别名" )
private String secondaryPojoNameAlias;
@Column(name="SECONDARY_POJO_NAME_DESC")
@ApiParam(value ="副对象中文名称")
private String secondaryPojoNameDesc;
@Column(name="SECONDARY_POJO_ATTR_NAME")
@ApiParam(value ="副对象属性名称")
private String secondaryPojoAttrName;
@Transient
@ApiParam(value ="模板服务对象属性")
private List<BrPojoAttr> pojoAttrList;
}

@ -0,0 +1,50 @@
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-18 11:31
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_REF_TEMPLATE_SERVER")
@Api(value="报表模板-服务",description = "报表模板-服务")
public class BrRefTemplateServer extends BaseBean {
@Column(name="TEMPLATE_ID")
@ApiParam(value ="模板编号" ,example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long templateId;
@Column(name="TEMPLATE_NAME_RDD")
@ApiParam(value ="模板名称" , access ="模板名称")
private String templateNameRdd;
@Column(name="SERVER_ID")
@ApiParam(value ="服务编号" ,example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Integer serverId;
@Column(name="SERVER_NAME_RDD")
@ApiParam(value ="服务名称" , access ="模板名称")
private String serverNameRdd;
}

@ -4,6 +4,7 @@ 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.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -13,6 +14,8 @@ import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;
/**
* @Description :
@ -39,12 +42,44 @@ public class BrReport extends BaseBean {
@JsonSerialize(using = ToStringSerializer.class)
private Long layoutId;
@Column(name="SOFT_TYPE")
@ApiParam(value ="模块")
//所属模块CommonEnumUtil.SOFT_TYPE
private Integer softType;
//get单独处理
public Long getLayoutId() {
if(layoutId != null) {
return layoutId.longValue();
}else{
return layoutId;
}
}
@Column(name="LAYOUT_NAME_RDD")
@ApiParam(value ="布局名称")
private String layoutNameRdd;
@Column(name="LAYOUT_HTML")
@ApiParam(value ="报表html")
private String reportHtml;
@Column(name="SEQ")
@ApiParam(value ="排序")
private Integer seq;
@Column(name="TEMPLATE_NUM")
@ApiParam(value ="模板数量")
private Integer templateNum;
@Column(name="ELEMENT_NUM")
@ApiParam(value ="元素数量")
private Integer elementNum;
@Column(name = "REPORT_DESCRIPTION",columnDefinition = "TEXT")
@ApiParam(value ="报表描述")
private String reportDescription;
@Transient
@ApiParam(value = "报表关联布局对象")
private BrLayout brLayout;
@Transient
@ApiParam(value = "报表排版关系")
private List<BrRefReportTypeset> brRefReportTypesetList;
}

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

@ -1,57 +0,0 @@
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;
/**
* @Description :
* @Reference :
* @Author : alwaysfrin
* @CreateDate : 2018-12-25 19:54
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_REPORT_TEMPLATE_DETAIL")
@Api(value="报表模板&报表",description = "报表模板和报表的关联表 * -》 *")
public class BrReportTemplateDetail 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="LAYOUT_COLUMN_ID")
@ApiParam(value ="列主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long layoutColumnId;
@Transient
@ApiParam(value = "报表实例")
private BrReport brReport;
@Transient
@ApiParam(value = "报表模板")
private BrReportTemplate brReportTemplate;
}

@ -0,0 +1,151 @@
package cn.estsh.i3plus.pojo.report.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
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-18 11:23
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_TEMPLATE")
@Api(value="报表模板",description = "报表模板")
public class BrTemplate extends BaseBean {
@Column(name="NAME")
@ApiParam(value ="模板名称" , access ="模板名称")
private String name;
@Column(name="TEMPLATE_TYPE")
@ApiParam(value ="模板类型" , example ="-1",access="表格,图表")
private Integer templateType;
@Column(name="TEMPLATE_STATUS")
@ApiParam(value ="模板状态" , example ="-1",access="模板状态")
private Integer templateStatus;
@Column(name="NUM_POJO")
@ApiParam(value ="对象数量" , example ="0" , access ="对象数量")
private Integer numPojo;
@Column(name="TEMPLATE_POJO_NAMES_RDD",columnDefinition = "TEXT")
@ApiParam(value ="对象名称" , access ="对象名称")
private String templatePojoNamesRdd;
@Column(name="NUM_SERVER")
@ApiParam(value ="对象数量" , example ="0" , access ="对象数量")
private Integer numServer;
@Column(name="TEMPLATE_SERVER_ID_LIST",columnDefinition = "TEXT")
@ApiParam(value ="数据服务ID集合" , access ="服务名称")
private String templateServerIdList;
@Column(name="TEMPLATE_SERVER_NAMES_RDD",columnDefinition = "TEXT")
@ApiParam(value ="服务名称" , access ="服务名称")
private String templateServerNamesRdd;
@Column(name="NUM_TEMPLATE_ATTR_FILTER")
@ApiParam(value ="对象数量" , example ="0" , access ="对象数量")
private Integer numTemplateAttrFilter;
@Column(name="template_attr_filter_list",columnDefinition = "TEXT")
@ApiParam(value ="模板查询条件" , access ="模板查询条件")
private String templateAttrFilterList;
@Column(name="NUM_TEMPLATE_ATTR_FILTER_GROUP")
@ApiParam(value ="对象数量" , example ="0" , access ="对象数量")
private Integer numTemplateAttrFilterGroup;
@Column(name="TEMPLATE_ATTR_FILTER_GROUP_LIST",columnDefinition = "TEXT")
@ApiParam(value ="模板分组条件" , access ="模板分組条件")
private String templateAttrFilterGroupList;
@Column(name="NUM_TEMPLATE_ATTR_SHOW")
@ApiParam(value ="对象数量" , example ="0" , access ="对象数量")
private Integer numTemplateAttrShow;
@Column(name="TEMPLATE_ATTR_SHOW_LIST",columnDefinition = "TEXT")
@ApiParam(value ="模板显示属性" , access ="模板显示属性")
private String templateAttrShowList;
@Column(name="NUM_TEMPLATE_AGGREGATION")
@ApiParam(value ="对象聚集数量" , example ="0" , access ="对象聚集数量")
private Integer numTemplateAggregation;
@Column(name="TEMPLATE_ATTR_AGGREGATION_LIST",columnDefinition = "TEXT")
@ApiParam(value ="模板聚集属性" , access ="模板聚集属性")
private String templateAttrAggregationList;
@Column(name="TEMPLATE_DESCRIPTION")
@ApiParam(value ="模板描述" , access ="模板描述")
private String templateDescription;
@Column(name="TEMPLATE_HQL",columnDefinition = "TEXT")
@ApiParam(value ="模板执行HQL" , access ="模板执行HQL")
private String templateHql;
@Column(name="TEMPLATE_HTML",columnDefinition = "TEXT")
@ApiParam(value ="模板HTML" , access ="模板HTML")
private String templateHtml;
@Transient
@ApiParam(value ="模板服务编号集合")
private List<Integer> serverIdList = new ArrayList<>();
@Transient
@ApiParam(value ="模板服务")
private List<BrRefTemplateServer> serverList = new ArrayList<>();
@Transient
@ApiParam(value ="模板服务对象")
private List<BrRefServerPojo> serverPojoList = new ArrayList<>();
@Transient
@ApiParam(value ="模板服务对象关系")
private List<BrRefPojo> serverPojoRefList = new ArrayList<>();
@Transient
@ApiParam(value ="模板服务对象关联属性")
private List<BrPojoAttr> pojoAttrList = new ArrayList<>();
@Transient
@ApiParam(value ="模板服务对象查询条件")
private List<BrPojoAttr> pojoAttrWhereList = new ArrayList<>();
@Transient
@ApiParam(value ="模板服务对象分组条件")
private List<BrPojoAttr> pojoAttrGroupList = new ArrayList<>();
@Transient
@ApiParam(value ="模板服务对象聚合条件")
private List<BrPojoAttr> pojoAttrAggregationList = new ArrayList<>();
@Transient
@ApiParam(value ="模板服务对象显示属性")
private List<BrPojoAttr> pojoAttrShowList = new ArrayList<>();
@Transient
@ApiParam(value ="模板服务集合")
private List<String> serverNameList = new ArrayList<>();
}

@ -0,0 +1,46 @@
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-18 11:23
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BR_TEMPLATE_CUSTOM_HQL")
@Api(value="模板自定义语句",description = "模板自定义语句")
public class BrTemplateCustomHql extends BaseBean {
@Column(name="TEMPLATE_ID")
@ApiParam(value ="模板编号" , example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long templateId;
@Column(name="DATA_TYPE")
@ApiParam(value ="自定义类型" , example ="-1")
private Integer dataType;
@Column(name="CUSTOM_CONTENT",columnDefinition="TEXT")
@ApiParam(value ="自定义语句内容" , access ="自定义语句内容")
private String customContent;
}

@ -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,15 @@
package cn.estsh.i3plus.pojo.report.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.report.bean.BrMenu;
import cn.estsh.i3plus.pojo.report.bean.BrPojoAttr;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-01-18 15:03
* @Modify:
**/
public interface BrPojoAttrRepository extends BaseRepository<BrPojoAttr,Long> {
}

@ -0,0 +1,15 @@
package cn.estsh.i3plus.pojo.report.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.report.bean.BrRefPojo;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-01-18 15:04
* @Modify:
**/
public interface BrRefPojoRepository extends BaseRepository<BrRefPojo,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.BrRefReportTypeset;
/**
* @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 BrRefReportTypesetRepository extends BaseRepository<BrRefReportTypeset,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,15 @@
package cn.estsh.i3plus.pojo.report.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.report.bean.BrMenu;
import cn.estsh.i3plus.pojo.report.bean.BrRefServerPojo;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-01-18 15:05
* @Modify:
**/
public interface BrRefServerPojoRepository extends BaseRepository<BrRefServerPojo,Long> {
}

@ -0,0 +1,15 @@
package cn.estsh.i3plus.pojo.report.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.report.bean.BrMenu;
import cn.estsh.i3plus.pojo.report.bean.BrRefTemplateServer;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-01-18 15:05
* @Modify:
**/
public interface BrRefTemplateServerRepository extends BaseRepository<BrRefTemplateServer,Long> {
}

@ -1,14 +0,0 @@
package cn.estsh.i3plus.pojo.report.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.report.bean.BrReportTemplateDetail;
/**
* @Description :
* @Reference :
* @Author : alwaysfrin
* @CreateDate : 2018-12-26 20:23
* @Modify:
**/
public interface BrReportTemplateDetailRepository extends BaseRepository<BrReportTemplateDetail,Long> {
}

@ -0,0 +1,15 @@
package cn.estsh.i3plus.pojo.report.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.report.bean.BrMenu;
import cn.estsh.i3plus.pojo.report.bean.BrTemplateCustomHql;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-01-18 15:05
* @Modify:
**/
public interface BrTemplateCustomHqlRepository extends BaseRepository<BrTemplateCustomHql,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.BrTemplate;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2019-01-18 15:05
* @Modify:
**/
public interface BrTemplateRepository extends BaseRepository<BrTemplate,Long> {
}

@ -0,0 +1,161 @@
package cn.estsh.i3plus.pojo.report.sqlpack;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
import cn.estsh.i3plus.pojo.report.bean.*;
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);
if(menu.getFindIdList() != null && menu.getFindIdList().size() > 0){
HqlPack.getInPack(StringUtils.join(menu.getFindIdList(),","),"id",result);
}
// 添加默认排序
HqlPack.getOrderDefault(menu);
return result.toString();
}
/**
*
* @param template
* @return
*/
public static String packHqlBrTemplate(BrTemplate template){
StringBuffer result = new StringBuffer();
// 查询参数封装
HqlPack.getNumEqualPack(template.getTemplateType(),"templateType",result);
HqlPack.getNumEqualPack(template.getTemplateStatus(),"templateStatus",result);
HqlPack.getStringLikerPack(template.getName(),"name",result);
// 添加默认排序
HqlPack.getOrderDefault(template);
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();
}
/**
*
* @param brLayout
* @return
*/
public static String packHqlBrLayout(BrLayout brLayout){
StringBuffer result = new StringBuffer();
// 查询参数封装
HqlPack.getStringLikerPack(brLayout.getLayoutName(),"layoutName",result);
return result.toString();
}
/**
*
* @param rowId
* @return
*/
public static String packHqlBrLayoutColumnByRowIdSortBySeq(Long rowId){
StringBuffer result = new StringBuffer();
// 查询参数封装
HqlPack.getNumEqualPack(rowId,"layoutRowId",result);
HqlPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue(),CommonEnumUtil.ASC_OR_DESC.DESC.getValue()},new String[]{"columnSeq","modifyDatetime"},result);
return result.toString();
}
/**
*
* @param layoutId
* @return
*/
public static String packHqlBrLayoutRowByLayoutIdSortBySeq(Long layoutId){
StringBuffer result = new StringBuffer();
// 查询参数封装
HqlPack.getNumEqualPack(layoutId,"layoutId",result);
HqlPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue(),CommonEnumUtil.ASC_OR_DESC.DESC.getValue()},new String[]{"rowSeq","modifyDatetime"},result);
return result.toString();
}
/**
*
* @param brReport
* @return
*/
public static String packHqlBrReport(BrReport brReport){
StringBuffer result = new StringBuffer();
// 查询参数封装
HqlPack.getStringLikerPack(brReport.getReportName(),"reportName",result);
HqlPack.getNumEqualPack(brReport.getLayoutId(),"layoutId",result);
return result.toString();
}
}

@ -107,6 +107,12 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>i3plus.pojo</groupId>
<artifactId>i3plus-pojo-report</artifactId>
<version>${project.version}</version>
</dependency>
<!-- spring-json转换 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>

Loading…
Cancel
Save