提交 34e5abdb authored 作者: renjianyu's avatar renjianyu

--no commit message

上级 c6ca9911
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
差异被折叠。
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.zrqx.core</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.springframework.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.genuitec.eclipse.springframework.springnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=target\\generated-sources\\annotations
org.eclipse.jdt.apt.genTestSrcDir=target\\generated-test-sources\\test-annotations
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.processAnnotations=enabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
boot.validation.initialized=true
eclipse.preferences.version=1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.zrqx</groupId>
<artifactId>com.zrqx.core</artifactId>
<name>com.zrqx.core</name>
<version>4.0.0</version>
<properties>
<!--设置字符编码及java版本 -->
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!--二维码 -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.18</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.7</version>
</dependency>
<!-- apache lang3工具包 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.12</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>META-INF/**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>UTF-8</encoding>
<!-- <compilerArgs>
<arg>-bootclasspath</arg>
<arg>${env.JAVA_HOME}/jre/lib/rt.jar;${env.JAVA_HOME}/jre/lib/jce.jar;${env.JAVA_HOME}/jre/lib/jsse.jar</arg>
</compilerArgs> -->
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.zrqx.core.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.zrqx.core.enums.ProperyTypeEnum;
/**
* 将属性 转换为 datas对象
* @author lpf
* @date 2018年12月11日下午7:05:05
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface DatasBean {
/**
* 对象类型 默认为基础类型 直接转换为Datas对象
* OBJECT 会再解析该对象
* LIST 会遍历解析集合内容 集合内泛型为对象
* @see com.zrqx.core.enums.ProperyTypeEnum
* @return
* @author lpf
* @date: 2018年12月12日 上午9:34:26
*/
ProperyTypeEnum type() default ProperyTypeEnum.SIMPLE;
/**
* 是否为标题
* @return
* @author lpf
* @date: 2018年12月11日 下午7:56:36
*/
boolean isTitle() default false;
/**
* 数据项的名称 默认为字段名称
* @return
*/
String key() default "";
/**
* 该项数据显示的名称
* @return
* @author lpf
* @date: 2018年12月11日 下午7:07:32
*/
String label();
/***
* 排序
* @return
* @author lpf
* @date: 2018年12月11日 下午7:08:12
*/
int index();
/***
* 超链接地址
* @return
* @author lpf
* @date: 2018年12月11日 下午7:08:30
*/
String href() default "";
/**
* 表示该项数据是否可编辑
* @return
* @author lpf
* @date: 2018年12月11日 下午7:08:54
*/
boolean edit() default false;
/**
* 表明该项数据是否与网易七鱼系统中固定的数据项有映射关系
* @return
* @author lpf
* @date: 2018年12月11日 下午7:09:15
*/
String map() default "";
/**
* 是否将姓名、邮箱、手机号三个保留字段数据保存到网易七鱼系统中
* @return
* @author lpf
* @date: 2018年12月11日 下午7:09:44
*/
boolean save() default false;
/**
* 用于表明该项数据信息的展现位置
* @return
* @author lpf
* @date: 2018年12月11日 下午7:10:15
*/
String zone() default "";
/**
* 用于标识该项数据是否为select下拉框
* @return
* @author lpf
* @date: 2018年12月11日 下午7:11:02
*/
boolean select() default false;
/**
* 用于标识该select下拉框选项是否被选中
* @return
* @author lpf
* @date: 2018年12月11日 下午7:11:22
*/
boolean check() default false;
}
package com.zrqx.core.asc;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import com.zrqx.core.asc.annotation.Encrypt;
import com.zrqx.core.util.ASCUtil;
import com.zrqx.core.util.BeanUtils;
/**
* 对对象加密解密
* @author xjg
* @date 2018年11月16日 下午2:15:23
*/
public class ASCBeansUtil {
/**
* 加密
* @param t
* @throws Exception
* @author lpf
* @date: 2018年11月16日 下午5:05:16
*/
public static <T> void addASC(T t) {
encrypt(t, ASCUtil :: addAESEncode);
}
/**
* 批量对象加密
* @param list
* @author lpf
* @date: 2018年11月16日 下午5:27:11
*/
public static <T> void batchAddAsc(List<T> list) {
list.forEach(ASCBeansUtil :: addASC);
}
/**
* 解密
* @param t
* @author lpf
* @date: 2018年11月16日 下午5:05:23
*/
public static <T> void disASC(T t) {
encrypt(t, ASCUtil :: disAESDncode);
}
/**
* 批量解密
* @param list
* @author lpf
* @date: 2018年11月16日 下午5:28:08
*/
public static <T> void batchDisAsc(List<T> list) {
list.forEach(ASCBeansUtil :: disASC);
}
/**
* 加解密公用
* @param t 待加解密对象
* @param fun 加解密算法
* @author lpf
* @date: 2018年11月16日 下午5:10:30
*/
public static <T> void encrypt(T t, Function<String,String> fun) {
if (t == null) return;
Class<?> clazz = t.getClass();
Arrays.stream(BeanUtils.getAllFields(clazz))
.map(f -> {
f.setAccessible(true);
return f;
})
.filter(f -> f.getAnnotation(Encrypt.class) != null)
.filter(f -> {
try {
return f.get(t) != null;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}).forEach(f -> {
try {
f.set(t, fun.apply(String.valueOf(f.get(t))));
} catch (Exception e) {
e.printStackTrace();
}
});
}
}
package com.zrqx.core.asc.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 字段是否需要加密注解
* @author lpf
* @date 2018年11月16日下午5:05:43
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Encrypt {
}
package com.zrqx.core.constant;
/**
* @Description: 基础uri常量类
* @author lpf
* @date 2018年5月23日上午11:56:09
*
*/
public class BaseRequestPath {
/** 后台根路径 */
public static final String BG = "/bg";
/** 前台根路径 */
public static final String FG = "/fg";
public static final String OBJECTID = "oid";
public static final String PARENTID = "pid";
public static final String IDSTRING = "id";
// 一元
/** /{wid} 根据id获取 搭配@PathVariable使用 */
// 解决 {wid}占位符造成api冲突
//父类ID
public static final String PID = "/{"+ PARENTID +"}";
//对象ID
public static final String OID = "/{"+ OBJECTID +"}";
/** 保存操作 */
public static final String SAVE = "/save";
/** 单条修改 */
public static final String UPDATE = "/update";
/** 单条删除 */
public static final String DELETE = "/delete";
/** 批量操作 */
public static final String BATCH = "/batch";
/** 根据条件查找一个 */
public static final String GET = "/get";
/** 分页 */
public static final String PAGE = "/page";
/** 列表 */
public static final String LIST = "/list";
/** 获取树形数据 */
public static final String TREE = "/tree";
/** 判断是否存在*/
public static final String ISEXIST = "/isExist";
/** 导入 */
public static final String IMPORT = "/import";
/** 导出 */
public static final String EXPORT = "/export";
/** 合并 */
public static final String MARGE = "/marge";
/** 状态 */
public static final String STATUS = "/status";
/** 所有 */
public static final String ALL = "/all";
/** 创建 */
public static final String CREATE = "/create";
/** 校验 */
public static final String CHECK = "/check";
/** 置顶 */
public static final String TOP = "/top";
/** 推送 */
public static final String PUSH = "/push";
/** 计数 */
public static final String COUNT = "/count";
/** 数据字典 */
public static final String DICTIONARY = "/dictionary";
/** 地理标志 */
public static final String GEOGRAPHYSIGN = "/geographysign";
/** 网易七鱼 ifream */
public static final String IQIYU = "/iqiyu";
/**
* 最大排序号
*/
public static final String MAXORDERNUM = "/maxOrderNum";
//二元
/** 批量添加 */
public static final String BATCH_SAVE = BATCH + SAVE;
/** 批量修改 */
public static final String BATCH_UPDATE = BATCH + UPDATE;
/** 批量删除 */
public static final String BATCH_DELETE = BATCH + DELETE;
/** 修改指定id对象的属性信息 */
public static final String UPDATE_OID = UPDATE + OID;
/** 修改并保存 */
public static final String UPDATE_SAVE = UPDATE + SAVE;
/** 根据指定id删除 */
public static final String DELETE_OID = DELETE + OID;
/** 根据指定id查询 */
public static final String GET_OID = GET + OID;
/** 获取退货收货人 */
public static final String GET_RECIVER = GET + "/reciver";
/** 根据置顶id保存 */
public static final String SAVE_OID = SAVE + OID;
/** 根据指定id创建 */
public static final String CREATE_OID = CREATE + OID;
/** 根据指定id导出 */
public static final String EXPORT_OID = EXPORT + OID;
/** 根据指定id导出图书关系 */
public static final String EXPORT_OID_BOOK = EXPORT_OID + "/book";
/** 根据id分页查询 */
public static final String PAGE_OID = PAGE + OID;
/** 修改默认 */
public static final String UPDATE_DEFUALT = UPDATE + "/defualt";
/** 批量修改状态 */
public static final String BATCH_UPDATE_STATUS = BATCH_UPDATE + STATUS;
/** 修改指定id对象的数量信息 */
public static final String UPDATE_OID_NUM = UPDATE + OID + "/num";
/** 重名校验 */
public static final String CHECK_NAME = CHECK + "/name";
/** 取消置顶 */
public static final String DELETE_TOP = DELETE + TOP;
/** 修改置顶 */
public static final String UPDATE_TOP = UPDATE + TOP;
/** 获取code下树形数据 */
public static final String TREE_CODE = TREE + "/code";
/** 获取推荐位商品的所有类型 */
public static final String GET_TYPE = GET + "/type";
/** 分页查询推荐位下推荐商品 */
public static final String GOODS_PAGE = "/goods" + PAGE;
/** 修改库存锁定数 */
public static final String UPDATE_LOCK = UPDATE + "/lock";
/** 获取锁定数详情 */
public static final String LOCK_INFO = "/lock_info";
/** 初始化 */
public static final String INIT = "/init";
/** 初始化 */
public static final String AVERAGE = "/average";
/** 获取默认 */
public static final String GET_DEFAULT = GET + "/default";
/** 直接购买 */
public static final String BUY = "/buy";
/**爬虫 */
public static final String REPTILE = "/reptile";
/**************** 第三方支付交互 *******************/
/**
* 获取需支付信息的详情
*/
public static final String GET_VALIDATE_INFOMATION = "/get-validate-infomation";
/**
* 获取需支付信息的详情
*/
public static final String GET_VALIDATE_ORDER = "/get-validate-order";
/**
* 支付结束后回调接口
*/
public static final String CALLBACK_RESULT = "/callback-result";
}
package com.zrqx.core.constant.book;
/**
* 验证提示信息类
* @author chenglei
*/
public class ValidateMessage {
public static final String ORDER_FILE_NOT_EXIST = "排序字段不合法";
public static final String ORDER_BY_NOT_EXIST = "排序不合法";
public static final String ORDER_BY_EXCEPTION = "排序验证不通过";
public static final String EBOOK_ORDER_FILE_NOT_EXIST = "电子书排序字段不合法";
public static final String EBOOK_ORDER_BY_NOT_EXIST = "电子书排序不合法";
public static final String EBOOK_ORDER_BY_EXCEPTION = "电子书排序验证不通过";
public static final String STATUS_EXCEPTION = "字段不合法";
/** 查无组合推荐 */
public static final String NO_RECOMMEND_BOOK = "查无组合推荐";
public static final String GOODS_SAVED = "商品已存在其他推荐组";
}
package com.zrqx.core.constant.geography;
import com.zrqx.core.constant.BaseRequestPath;
public class GeographyRequestPath extends BaseRequestPath{
/** 保存操作 */
public static final String SAVE = "/save";
/** 单条修改 */
public static final String UPDATE = "/update";
/** 单条删除 */
public static final String DELETE = "/delete";
/** 批量操作 */
public static final String BATCH = "/batch";
/** 导入 */
public static final String IMPORT = "/import";
}
package com.zrqx.core.enums;
import com.zrqx.core.constant.book.ValidateMessage;
import com.zrqx.core.exception.BusinessValidateException;
public enum BooleanStatusEnum {
/** 是 */
YES("1","是"),
/** 否 */
NO("0","否");
private final String code;
private final String name;
private BooleanStatusEnum(String code, String name) {
this.code = code;
this.name = name;
}
/**
* 判断名称是否有效
* @param name
* @return
* @author lpf
* @date: 2018年6月11日 下午6:30:16
*/
public static boolean isExist(String code) {
BooleanStatusEnum[] enums = BooleanStatusEnum.values();
for (BooleanStatusEnum BooleanStatusEnum : enums) {
if (BooleanStatusEnum.code.equals(code)) {
return true;
}
}
throw new BusinessValidateException(ValidateMessage.STATUS_EXCEPTION);
}
/**
* 根据code 获取名字
* @Title getName
* @param code
* @return String
* @author Conan
* @date 2018年6月19日 上午11:28:16
*/
public static String getName(String code) {
BooleanStatusEnum[] enums = BooleanStatusEnum.values();
for (BooleanStatusEnum BooleanStatusEnum : enums) {
if (BooleanStatusEnum.code.equals(code)) {
return BooleanStatusEnum.name;
}
}
return null;
}
/**
* 根据名字 获取code
* @Title getCode
* @param name
* @return String
* @author Conan
* @date 2018年7月9日 下午2:52:30
*/
public static String getCode(String name) {
BooleanStatusEnum[] enums = BooleanStatusEnum.values();
for (BooleanStatusEnum BooleanStatusEnum : enums) {
if (BooleanStatusEnum.name.equals(name)) {
return BooleanStatusEnum.code;
}
}
throw new BusinessValidateException(ValidateMessage.STATUS_EXCEPTION);
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums;
/**
*
* @ClassName StatusEnum
* @Description: 共享状态枚举
* @author lpf
* @date 2018年5月9日上午9:46:35
*
*/
public enum CompleteEnum {
/** 成功 */
SUCCESS("0","成功"),
/** 失败 */
FAIL("1","失败");
private final String code;
private final String name;
private CompleteEnum(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums;
import java.util.HashMap;
import org.apache.commons.lang3.StringUtils;
/**
* 导出状态枚举<br>
* 已导出,未导出
* @author lpf
* @date 2018年7月9日下午4:44:56
*/
public enum ExportStatusEnum {
UN_EXPORT("0", "未导出"),
HAVE_EXPORT("1","已导出");
private final String code;
private final String name;
private ExportStatusEnum(String code,String name){
this.code=code;
this.name=name;
}
public static ExportStatusEnum valueOfCode(String code) {
if (StringUtils.isBlank(code)) {
throw new IllegalArgumentException("Export Status " + code + " is blank");
}
for (ExportStatusEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt;
}
}
throw new IllegalArgumentException("Export Status " + code + " is not exist");
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static String getName(String code) {
if (StringUtils.isBlank(code)) {
return null;
}
for (ExportStatusEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt.getName();
}
}
return null;
}
/**
* 获取所有的枚举,以MAP返回
* @return
*/
public static HashMap<String,String> getAllEnumMap() {
HashMap<String,String> map = new HashMap<String,String>();
for (ExportStatusEnum mt : values()) {
map.put(mt.getCode(), mt.getName());
}
return map;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
/**
* 商品分类枚举
* @author lpf
* @date 2018年7月11日上午10:48:39
*/
public enum GoodsTypeEnum {
/** 纸质书 */
PBOOK("0", "纸质书"),
/** 电子书 */
EBOOK("1", "电子书"),
/** 套餐 */
PACKAGE("2","套餐"),
/** 课程 */
COURSE("3","课程"),
/** 试题 */
QUESTION("4","试题");
private final String code;
private final String name;
private GoodsTypeEnum(String code,String name){
this.code=code;
this.name=name;
}
/**
* 获取需要收取邮费的商品类型
* @return
* @author ydm
* @date: 2018年8月24日 下午2:33:23
*/
public static List<Integer> getNeedCarriage(){
List<Integer> list = new ArrayList<>();
list.add(Integer.valueOf(PBOOK.code));
list.add(Integer.valueOf(PACKAGE.code));
return list;
}
/**
* 获取需要拆分商品的商品类型
* @return
* @author ydm
* @date: 2018年10月22日 下午2:24:19
*/
public static List<Integer> getNeedUnZipCarriage(){
List<Integer> list = new ArrayList<>();
list.add(Integer.valueOf(PACKAGE.code));
return list;
}
public static GoodsTypeEnum valueOfCode(String code) {
if (StringUtils.isBlank(code)) {
throw new IllegalArgumentException("GoodsType Status " + code + " is blank");
}
for (GoodsTypeEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt;
}
}
throw new IllegalArgumentException("GoodsType Status " + code + " is not exist");
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static String getName(String code) {
if (StringUtils.isBlank(code)) {
return null;
}
for (GoodsTypeEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt.getName();
}
}
return null;
}
/**
* 获取所有的枚举,以MAP返回
* @return
*/
public static HashMap<String,String> getAllEnumMap() {
HashMap<String,String> map = new HashMap<String,String>();
for (GoodsTypeEnum mt : values()) {
map.put(mt.getCode(), mt.getName());
}
return map;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums;
import com.zrqx.core.util.qiyu.ListTypeImpl;
import com.zrqx.core.util.qiyu.ObjectTypeImpl;
import com.zrqx.core.util.qiyu.ProperyTypeInterface;
import com.zrqx.core.util.qiyu.SimpleTypeImpl;
public enum ProperyTypeEnum {
/** 基本类型 */
SIMPLE(SimpleTypeImpl.getInstance()),
/** list 泛型为非基本类型 */
LIST(ListTypeImpl.getInstance()),
/** 对象类型 */
OBJECT(ObjectTypeImpl.getInstance());
private ProperyTypeInterface interfaces;
private ProperyTypeEnum(ProperyTypeInterface interfaces){
this.interfaces = interfaces;
}
public ProperyTypeInterface getInterfaces() {
return interfaces;
}
}
package com.zrqx.core.enums;
/**
*
* ClassName: StatusEnum
* @Description: TODO
* @author lizhuo
* @date 2019年1月29日
*/
public enum ResourceStatusEnum {
ENTRY(0,"录入中"),
TOBEAUDITED(1,"待审核"),
INAUDIT(2,"审核中"),
AUDITPASS(3,"审核通过"),
AUDITFAILED(4,"审核未通过");
//状态码
private final int value;
private final String value_zh;
private ResourceStatusEnum(int value, String value_zh) {
this.value = value;
this.value_zh = value_zh;
}
public int getValue() {
return value;
}
public String getValue_zh() {
return value_zh;
}
}
package com.zrqx.core.enums;
/**
* 响应编码
* @ClassName ReponseCodeEnum
* @Description:
* @author lpf
* @date 2018年5月9日下午4:27:58
*
*/
public enum ResponseCodeEnum {
/** 0,操作成功" */
OK(0,"操作成功"),
/** -1,操作失败" */
FAIL(-1,"操作失败"),
/** -2,验证不通过" */
VALIDATE(-2,"验证不通过"),
/** -3,服务器异常" */
EXCEPTION(-3,"服务器异常"),
/** -4 接口调用 参数类型转换异常*/
BIND_EXCEPTION(-4,"不合法的参数"),
/** -5 接口调用缺少必填参数 */
MISS_EXCEPTION(-5,"缺少必填参数"),
/** -6 登录过期或未登录 */
NO_LOGIN(-6,"请重新登录");
private final int code;
private final String msg;
private ResponseCodeEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
package com.zrqx.core.enums;
import java.util.HashMap;
import org.apache.commons.lang3.StringUtils;
/**
* 来源<br>
* pc | wap | app
* @author lpf
* @date 2018年7月9日下午4:23:25
*/
public enum SourceEnum {
/** pc */
PC("0","PC"),
/** wap */
WAP("1","WAP"),
/** app */
APP("2","APP");
private final String code;
private final String name;
private SourceEnum(String code,String name){
this.code=code;
this.name=name;
}
public static SourceEnum valueOfCode(String code) {
if (StringUtils.isBlank(code)) {
throw new IllegalArgumentException("Source Status " + code + " is blank");
}
for (SourceEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt;
}
}
throw new IllegalArgumentException("Source Status " + code + " is not exist");
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static String getName(String code) {
if (StringUtils.isBlank(code)) {
return null;
}
for (SourceEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt.getName();
}
}
return null;
}
/**
* 获取所有的枚举,以MAP返回
* @return
*/
public static HashMap<String,String> getAllEnumMap() {
HashMap<String,String> map = new HashMap<String,String>();
for (SourceEnum mt : values()) {
map.put(mt.getCode(), mt.getName());
}
return map;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums;
/**
*
* @ClassName StatusEnum
* @Description: 共享状态枚举
* @author lpf
* @date 2018年5月9日上午9:46:35
*
*/
public enum StatusEnum {
/** 启用 */
ENABLE(1,"启用"),
/** 禁用 */
DISABLE(0,"禁用");
//状态码
private final int value;
// test submit
// test submit
// test co 1
// test conflict 1
private final String value_zh;
private StatusEnum(int value, String value_zh) {
this.value = value;
this.value_zh = value_zh;
}
public int getValue() {
return value;
}
public String getValue_zh() {
return value_zh;
}
}
package com.zrqx.core.enums;
import java.util.concurrent.TimeUnit;
public enum TimeUnitEnum {
// 微秒 一百万分之一秒(就是毫秒/1000)
微秒(TimeUnit.MICROSECONDS),
// 毫秒 千分之一秒
毫秒(TimeUnit.MILLISECONDS),
// 毫微秒 十亿分之一秒(就是微秒/1000)
毫微秒(TimeUnit.NANOSECONDS),
// 秒
(TimeUnit.SECONDS),
// 分钟
分钟(TimeUnit.MINUTES),
// 小时
小时(TimeUnit.HOURS),
// 天
(TimeUnit.DAYS);
private final TimeUnit value;
private TimeUnitEnum(TimeUnit value) {
this.value = value;
}
public static void main(String[] args) {
System.out.println(分钟.value);
System.out.println(TimeUnitEnum.getValue("小时"));
}
public static TimeUnit getValue(String name) {
if (name == null) {
throw new IllegalArgumentException("TimeUnitEnum name is not null");
}
for (TimeUnitEnum mt : values()) {
if (mt.name().equals(name)) {
return mt.value;
}
}
return .value;
}
}
package com.zrqx.core.enums.resource;
import java.util.HashMap;
/**
* 资源库数据状态
* @author cxc
* @date 2018年7月13日下午9:26:42
*/
public enum EbookStatusEnum {
/** 录入中 */
_0(0, "录入中"),
/** 待审核*/
_1(1, "待审核"),
/** 审核中 */
_2(2, "审核中"),
/** 审核未通过*/
_3(3, "审核通过"),
/** 审核未通过 */
_4(4, "审核未通过");
private final Integer code;
private final String name;
private EbookStatusEnum(Integer code,String name){
this.code=code;
this.name=name;
}
public static EbookStatusEnum valueOfCode(Integer code) {
if (code == null) {
throw new IllegalArgumentException("Book Status " + code + " is blank");
}
for (EbookStatusEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt;
}
}
throw new IllegalArgumentException("Book Status " + code + " is not exist");
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static String getName(Integer code) {
if (code == null) {
return null;
}
for (EbookStatusEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt.getName();
}
}
return null;
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static boolean isExists (Integer code) {
if (code == null) {
return false;
}
for (EbookStatusEnum mt : values()) {
if (mt.getCode().equals(code)) {
return true;
}
}
return false;
}
/**
* 获取所有的枚举,以MAP返回
* @return
*/
public static HashMap<Integer,String> getAllEnumMap() {
HashMap<Integer,String> map = new HashMap<Integer,String>();
for (EbookStatusEnum mt : values()) {
map.put(mt.getCode(), mt.getName());
}
return map;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums.resource;
import java.util.HashMap;
import org.apache.commons.lang3.StringUtils;
/**
* 资源库数据状态
* @author cxc
* @date 2018年7月13日下午9:26:42
*/
public enum LibraryStatusEnum {
/** 已录入 */
STATUS_0("0", "已录入"),
/** 已上架*/
STATUS_1("1", "已上架"),
/** 未上架 */
STATUS_2("2", "未上架");
private final String code;
private final String name;
private LibraryStatusEnum(String code,String name){
this.code=code;
this.name=name;
}
public static LibraryStatusEnum valueOfCode(String code) {
if (StringUtils.isBlank(code)) {
throw new IllegalArgumentException("Library Status " + code + " is blank");
}
for (LibraryStatusEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt;
}
}
throw new IllegalArgumentException("Library Status " + code + " is not exist");
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static String getName(String code) {
if (StringUtils.isBlank(code)) {
return null;
}
for (LibraryStatusEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt.getName();
}
}
return null;
}
/**
* 获取所有的枚举,以MAP返回
* @return
*/
public static HashMap<String,String> getAllEnumMap() {
HashMap<String,String> map = new HashMap<String,String>();
for (LibraryStatusEnum mt : values()) {
map.put(mt.getCode(), mt.getName());
}
return map;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums.resource.questionlibrary;
import java.util.HashMap;
import org.apache.commons.lang3.StringUtils;
/**
* 学习答题枚举
* @author ydm
*
*/
public enum FunctionTypeEnum {
STUDY(1,"学习"),
EXAM(2,"答题");
private final Integer code;
private final String name;
private FunctionTypeEnum(Integer code,String name){
this.code=code;
this.name=name;
}
public static FunctionTypeEnum valueOfCode(Integer code) {
if (code == null) {
throw new IllegalArgumentException("Question Type " + code + " is blank");
}
for (FunctionTypeEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt;
}
}
throw new IllegalArgumentException("Question Type " + code + " is not exist");
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static String getName(Integer code) {
if (code == null) {
return null;
}
for (FunctionTypeEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt.getName();
}
}
return null;
}
/**
* 通过中文名称获取ID
* @param code
* @return
*/
public static Integer getCode(String name) {
if (StringUtils.isBlank(name)) {
return null;
}
for (FunctionTypeEnum mt : values()) {
if (mt.getName().equals(name)) {
return mt.getCode();
}
}
return null;
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static boolean isExists (Integer code) {
if (code == null) {
return false;
}
for (FunctionTypeEnum mt : values()) {
if (mt.getCode().equals(code)) {
return true;
}
}
return false;
}
/**
* 获取所有的枚举,以MAP返回
* @return
*/
public static HashMap<Integer,String> getAllEnumMap() {
HashMap<Integer,String> map = new HashMap<Integer,String>();
for (FunctionTypeEnum mt : values()) {
map.put(mt.getCode(), mt.getName());
}
return map;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums.resource.questionlibrary;
import java.util.HashMap;
import org.apache.commons.lang3.StringUtils;
/**
* 用户年龄段
* @author ydm
* @date 2019年3月17日下午9:26:42
*/
public enum MemberAgeAreaEnum {
AGE_1(1,"25岁以下"),
AGE_2(2,"26-35"),
AGE_3(3,"36-45"),
AGE_4(4,"46-60");
private final Integer code;
private final String name;
private MemberAgeAreaEnum(Integer code,String name){
this.code=code;
this.name=name;
}
public static MemberAgeAreaEnum valueOfCode(Integer code) {
if (code == null) {
throw new IllegalArgumentException("MemberAgeArea " + code + " is blank");
}
for (MemberAgeAreaEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt;
}
}
throw new IllegalArgumentException("MemberAgeArea " + code + " is not exist");
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static String getName(Integer code) {
if (code == null) {
return null;
}
for (MemberAgeAreaEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt.getName();
}
}
return null;
}
/**
* 通过中文名称获取ID
* @param code
* @return
*/
public static Integer getCode(String name) {
if (StringUtils.isBlank(name)) {
return null;
}
for (MemberAgeAreaEnum mt : values()) {
if (mt.getName().equals(name)) {
return mt.getCode();
}
}
return null;
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static boolean isExists (Integer code) {
if (code == null) {
return false;
}
for (MemberAgeAreaEnum mt : values()) {
if (mt.getCode().equals(code)) {
return true;
}
}
return false;
}
/**
* 获取所有的枚举,以MAP返回
* @return
*/
public static HashMap<Integer,String> getAllEnumMap() {
HashMap<Integer,String> map = new HashMap<Integer,String>();
for (MemberAgeAreaEnum mt : values()) {
map.put(mt.getCode(), mt.getName());
}
return map;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums.resource.questionlibrary;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
/**
* 试题类型
* @author ydm
* @date 2019年3月17日下午9:26:42
*/
public enum QuestionTypeEnum {
TYPE_1(1,"单选"),
TYPE_2(2,"多选"),
TYPE_3(3,"判断"),
TYPE_4(4,"填空"),
TYPE_5(5,"简答"),
TYPE_6(6,"案例");
private final Integer code;
private final String name;
private QuestionTypeEnum(Integer code,String name){
this.code=code;
this.name=name;
}
/**
* 获取测试需要的试题类型
* @return
*/
public static List<QuestionTypeEnum> getExamType(){
List<QuestionTypeEnum> list = new ArrayList<QuestionTypeEnum>();
list.add(TYPE_1);
list.add(TYPE_2);
list.add(TYPE_3);
list.add(TYPE_4);
return list;
}
public static QuestionTypeEnum valueOfCode(Integer code) {
if (code == null) {
throw new IllegalArgumentException("Question Type " + code + " is blank");
}
for (QuestionTypeEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt;
}
}
throw new IllegalArgumentException("Question Type " + code + " is not exist");
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static String getName(Integer code) {
if (code == null) {
return null;
}
for (QuestionTypeEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt.getName();
}
}
return null;
}
/**
* 通过中文名称获取ID
* @param code
* @return
*/
public static Integer getCode(String name) {
if (StringUtils.isBlank(name)) {
return null;
}
for (QuestionTypeEnum mt : values()) {
if (mt.getName().equals(name)) {
return mt.getCode();
}
}
return null;
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public static boolean isExists (Integer code) {
if (code == null) {
return false;
}
for (QuestionTypeEnum mt : values()) {
if (mt.getCode().equals(code)) {
return true;
}
}
return false;
}
/**
* 获取所有的枚举,以MAP返回
* @return
*/
public static HashMap<Integer,String> getAllEnumMap() {
HashMap<Integer,String> map = new HashMap<Integer,String>();
for (QuestionTypeEnum mt : values()) {
map.put(mt.getCode(), mt.getName());
}
return map;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums.sysuser.collection;
/**
* 收藏或取消收藏状态
* @author lw
* @date 2018年8月27日下午3:54:33
*/
public enum CollectionUpdateStatusEnum {
// 收藏
COLLECTON(1,"收藏"),
// 删除收藏
DEL_COLLECTION(0,"删除收藏");
private final Integer code;
private final String name;
private CollectionUpdateStatusEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
}
/**
* @author niguanghui
* @date 2018年12月5日 上午11:55:11
*/
package com.zrqx.core.enums.sysuser.correction;
import java.util.HashMap;
import org.apache.commons.lang3.StringUtils;
/**
* 纠错管理
*
* @author niguanghui
* @date 2018年12月5日上午11:55:11
*/
public enum CorrectionEnum {
// 未审核
NOT_REVIEW(0, "未审核"),
// 已审核
YES_REVIEW(1, "已审核"),
// 已修改
YES_REVISED(2, "已修改");
private final Integer code;
private final String name;
private CorrectionEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
/**
* 通过ID获取中文名称
*
* @param code
* @return
*/
public static String getName(String code) {
if (StringUtils.isBlank(code)) {
return null;
}
for (CorrectionEnum mt : values()) {
if (mt.getCode().equals(code)) {
return mt.getName();
}
}
return null;
}
/**
* 获取所有的枚举,以MAP返回
*
* @return
*/
public static HashMap<Integer, String> getAllEnumMap() {
HashMap<Integer, String> map = new HashMap<Integer, String>();
for (CorrectionEnum mt : values()) {
map.put(mt.getCode(), mt.getName());
}
return map;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums.sysuser.dictionary;
/**
* 数据字典code
* @author pc
*
*/
public enum DictonaryCodeEnum {
/**
* 系统安全配置
*/
SYSTEMSAFTY("SYSTEMSAFTY","系统安全") ,
/**
* 网站基础参数配置
*/
SITE("SITE","网站基础参数") ,
/**
* 会员参数配置
*/
MEMBER("MEMBER","会员参数") ,
/**
* 邮件参数配置
*/
EMAIL("EMAIL","邮件参数") ,
/**
* 短信参数配置
*/
SHORTMESSAGE("SHORTMESSAGE","短信参数") ,
/**
* 会员签到参数
*/
MEMBERSIGNED("MEMBERSIGNED","会员签到参数") ;
private final String code;
private final String description;
private DictonaryCodeEnum(String code, String description) {
this.code = code;
this.description = description;
}
public String getCode() {
return code;
}
public String getDescription() {
return description;
}
}
package com.zrqx.core.enums.sysuser.member;
import java.util.HashMap;
import java.util.Map;
import com.zrqx.core.exception.BaseException;
/**
* 个人会员
* 启用、禁用
* @author lw
* @date 2018年7月25日下午5:27:39
*/
public enum MemberStatusEnum {
/** 启用 */
ENABLE("1","启用"),
/** 禁用 */
DISABLE("0","禁用");
private final String code;
private final String name;
public static String getName(String code){
Map<String, String> map = new HashMap<String, String>();
map.put(ENABLE.getCode(), ENABLE.getName());
map.put(DISABLE.getCode(), DISABLE.getName());
return map.get(code);
}
private MemberStatusEnum(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.zrqx.core.enums.sysuser.member;
/**
* 充值类型
* @author pc
*
*/
public enum RechargeType {
/**
* 积分
*/
SCORE(0,"积分"),
/**
* 成长值
*/
GROWTHVALUE(1,"成长值");
private final Integer value;
private final String description;
private RechargeType(Integer value, String description) {
this.value = value;
this.description = description;
}
public Integer getValue() {
return value;
}
public String getDescription() {
return description;
}
}
package com.zrqx.core.enums.sysuser.member;
/**
* 充值类型
* @author pc
*
*/
public enum RechargeTypeInfo {
/**
* 减少
*/
SUB(0,"减少"),
/**
* 增加
*/
ADD(1,"增加");
private final Integer value;
private final String description;
private RechargeTypeInfo(Integer value, String description) {
this.value = value;
this.description = description;
}
public Integer getValue() {
return value;
}
public String getDescription() {
return description;
}
}
package com.zrqx.core.exception;
import com.zrqx.core.enums.ResponseCodeEnum;
public class BaseException extends RuntimeException{
/**
*
*/
private static final long serialVersionUID = 1L;
private int code = ResponseCodeEnum.EXCEPTION.getCode();
//无参构造方法
public BaseException(){
super();
}
//有参的构造方法
public BaseException(String message){
super(message);
}
//有参的构造方法
public BaseException(int code,String message){
super(message);
this.code = code;
}
//有参的构造方法
public BaseException(ResponseCodeEnum res){
super(res.getMsg());
this.code = res.getCode();
}
// 用指定的详细信息和原因构造一个新的异常
public BaseException(String message, Throwable cause){
super(message,cause);
}
//用指定原因构造一个新的异常
public BaseException(Throwable cause) {
super(cause);
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}
\ No newline at end of file
package com.zrqx.core.exception;
import com.zrqx.core.enums.ResponseCodeEnum;
/**
* 业务验证异常
* @author lpf
* @date 2018年8月10日下午4:28:59
*/
public class BusinessValidateException extends BaseException {
/**
*
*/
private static final long serialVersionUID = 1L;
public BusinessValidateException() {
super(ResponseCodeEnum.VALIDATE.getCode(), null);
}
public BusinessValidateException(String message) {
super(ResponseCodeEnum.VALIDATE.getCode(),message);
}
}
package com.zrqx.core.mapper;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;
public interface BaseMapper<T> extends Mapper<T>,MySqlMapper<T>{
/** 字符串不能为空 NOTBLANK (your filed) */
String NOTBLANK = "@org.apache.commons.lang3.StringUtils@isNotBlank";
/** 字符串为空 BLANK (your filed) */
String BLANK = "@org.apache.commons.lang3.StringUtils@isBlank";
/** List集合不能为空 LIST_NOT_EMPTY (your filed) */
String LIST_NOT_EMPTY = "@com.zrqx.core.util.ArrayUtils@isNotEmpty";
}
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 abel533@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.zrqx.core.mapper;
import java.util.List;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
/**
* 通用Mapper接口,特殊方法,批量插入,支持批量插入的数据库都可以使用,例如mysql,h2等
* @author lizhuo
*
* @param <T>
*/
public interface ZrqxMapper<T>{
/**
* 批量插入,针对uuid
*
* @param recordList
* @return
*/
@Options(keyProperty = "id")
@InsertProvider(type = ZrqxProvider.class, method = "dynamicSQL")
int insertUuidList(List<T> recordList);
}
\ No newline at end of file
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 abel533@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.zrqx.core.mapper;
import org.apache.ibatis.mapping.MappedStatement;
import tk.mybatis.mapper.entity.EntityColumn;
import tk.mybatis.mapper.mapperhelper.EntityHelper;
import tk.mybatis.mapper.mapperhelper.MapperHelper;
import tk.mybatis.mapper.mapperhelper.MapperTemplate;
import tk.mybatis.mapper.mapperhelper.SqlHelper;
import java.util.Set;
/**
* SpecialProvider实现类,特殊方法实现类
*
* @author lizhuo
*/
public class ZrqxProvider extends MapperTemplate {
public ZrqxProvider(Class<?> mapperClass, MapperHelper mapperHelper) {
super(mapperClass, mapperHelper);
}
/**
* 批量插入
*
* @param ms
*/
public String insertUuidList(MappedStatement ms) {
final Class<?> entityClass = getEntityClass(ms);
//开始拼sql
StringBuilder sql = new StringBuilder();
//uuid的情况,直接插入bind节点
sql.append(SqlHelper.insertIntoTable(entityClass, tableName(entityClass)));
sql.append(SqlHelper.insertColumns(entityClass, false, false, false));
sql.append(" VALUES ");
sql.append("<foreach collection=\"list\" item=\"record\" separator=\",\" >");
sql.append("<trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\">");
//获取全部列
Set<EntityColumn> columnList = EntityHelper.getColumns(entityClass);
//当某个列有主键策略时,不需要考虑他的属性是否为空,因为如果为空,一定会根据主键策略给他生成一个值
for (EntityColumn column : columnList) {
if (!column.isId() && column.isInsertable()) {
sql.append(column.getColumnHolder("record") + ",");
}else if(column.isId()){
sql.append("REPLACE (UUID(), '-', '')" + ",");
}
}
sql.append("</trim>");
sql.append("</foreach>");
return sql.toString();
}
public String insertUseGeneratedKeys(MappedStatement ms) {
final Class<?> entityClass = getEntityClass(ms);
//开始拼sql
StringBuilder sql = new StringBuilder();
sql.append(SqlHelper.insertIntoTable(entityClass, tableName(entityClass)));
sql.append(SqlHelper.insertColumns(entityClass, true, false, false));
sql.append(SqlHelper.insertValuesColumns(entityClass, true, false, false));
return sql.toString();
}
}
package com.zrqx.core.model.file;
import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class FileInfo {
@Id
@GeneratedValue(generator="JDBC")
@ApiModelProperty(value="文件ID")
private Integer id;
@ApiModelProperty(value="文件名")
private String fileName;
@ApiModelProperty(value="内容类型")
private String contentType;
@ApiModelProperty(value="后缀名")
private String suffixName;
@ApiModelProperty(value="原文件名")
private String originalFileName;
@ApiModelProperty(value="存储路径")
private String path;
@ApiModelProperty(value="文件大小")
private Long size;
@ApiModelProperty(value="文件时长")
private Long time;
@ApiModelProperty(value="封面")
private String img;
@ApiModelProperty(value="创建时间")
private Date createTime;
}
package com.zrqx.core.model.geography;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@Table(name="dl_approvalEnterprise")
@ApiModel(value = "ApprovalEnterprise", description = "核准企业")
public class ApprovalEnterprise {
@Id
@GeneratedValue(strategy =GenerationType.IDENTITY, generator = "SELECT REPLACE (UUID(), '-', '')")
@ApiModelProperty("记录id")
private String id;
@ApiModelProperty("核准公告号")
private String approvalNoticeId;
@ApiModelProperty("产品名称")
private String productName;
@ApiModelProperty("核准企业名称")
private String approvalEnterpriseName;
@ApiModelProperty("地址")
private String address;
@ApiModelProperty("法人代表")
private String legalPerson;
@ApiModelProperty("核准公告-商标")
private String approvalNoticeTrademark;
@ApiModelProperty("电话")
private String telephone;
@ApiModelProperty("批次")
private String batch;
@ApiModelProperty("核准时间")
private String approvalDate;
@ApiModelProperty("主表序号")
private String masterTableid;
@ApiModelProperty("省")
private String province;
@ApiModelProperty("市")
private String city;
@ApiModelProperty("县")
private String county;
@ApiModelProperty(" 1:未爬数据 2:已爬数据 3:数据有问题")
private String ReptileState;
@ApiModelProperty("冗余字段1")
private String reserve1;
@ApiModelProperty("冗余字段2")
private String reserve2;
@ApiModelProperty("冗余字段3")
private String reserve3;
@ApiModelProperty("冗余字段4")
private String reserve4;
@ApiModelProperty("冗余字段5")
private String reserve5;
@ApiModelProperty("冗余字段6")
private String reserve6;
@ApiModelProperty("冗余字段7")
private String reserve7;
@ApiModelProperty("冗余字段8")
private String reserve8;
@ApiModelProperty("冗余字段9")
private String reserve9;
@ApiModelProperty("冗余字段10")
private String reserve10;
}
package com.zrqx.core.model.geography;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@Table(name="dl_geographysign")
@ApiModel(value = "GeographySign", description = "地理标志源数据表")
public class Geographysign {
@Id
@GeneratedValue(strategy =GenerationType.IDENTITY, generator = "SELECT REPLACE (UUID(), '-', '')")
@ApiModelProperty("记录id")
private String id;
@ApiModelProperty("数据类别")
private String signState;
@ApiModelProperty("产品名称")
private String productName;
@ApiModelProperty("国名经济分类")
private String economicsClass;
@ApiModelProperty("公告号(注册号)")
private String registrationId;
@ApiModelProperty("公告时间(注册时间)")
private String registerDate;
@ApiModelProperty("公告类型(权利状态)")
private String registerState;
@ApiModelProperty("公告单位")
private String registerCompany;
@ApiModelProperty("所在地域")
private String wherePlace;
@ApiModelProperty("保护范围(产地范围)")
private String protectRange;
@ApiModelProperty("申请人")
private String applicant;
@ApiModelProperty("申请人地址")
private String applicantAddress;
@ApiModelProperty("初审时间")
private String preliminaryExaminationDate;
@ApiModelProperty("代理组织")
private String agentOrganization;
@ApiModelProperty("使用商品")
private String commodity;
@ApiModelProperty("商品组别")
private String commodityCategory;
@ApiModelProperty("省")
private String province;
@ApiModelProperty("市")
private String city;
@ApiModelProperty("县")
private String county;
@ApiModelProperty("内容")
private String content;
@ApiModelProperty("图片")
private String imgPath;
@ApiModelProperty("document")
private String document;
@ApiModelProperty(" 1:未爬数据 2:已爬数据 3:数据有问题")
private String ReptileState;
@ApiModelProperty("冗余字段1")
private String reserve1;
@ApiModelProperty("冗余字段2")
private String reserve2;
@ApiModelProperty("冗余字段3")
private String reserve3;
@ApiModelProperty("冗余字段4")
private String reserve4;
@ApiModelProperty("冗余字段5")
private String reserve5;
@ApiModelProperty("冗余字段6")
private String reserve6;
@ApiModelProperty("冗余字段7")
private String reserve7;
@ApiModelProperty("冗余字段8")
private String reserve8;
@ApiModelProperty("冗余字段9")
private String reserve9;
@ApiModelProperty("冗余字段10")
private String reserve10;
}
package com.zrqx.core.model.third.qiyu;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import lombok.Data;
@Data
public class Blocks {
@ApiModelProperty(value="用于排序")
private Integer index;
@ApiModelProperty(value="用一个数组表示该区块包含的数据")
private List<Datas> data;
@ApiModelProperty(value="")
private Boolean is_title;
}
package com.zrqx.core.model.third.qiyu;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "promotion-book",description = "促销组合与图书关系")
@Data
public class Datas {
@ApiModelProperty("是否为标题")
private Boolean titleFlag;
@ApiModelProperty(value="数据项的名称")
private String key;
@ApiModelProperty(value="该数据显示的值")
private Object value;
@ApiModelProperty(value="该项数据显示的名称")
private String label;
@ApiModelProperty(value="排序")
private Integer index;
@ApiModelProperty(value="超链接地址")
private String href;
@ApiModelProperty(value="表示该项数据是否可编辑")
private Boolean edit;
@ApiModelProperty(value="表明该项数据是否与网易七鱼系统中固定的数据项有映射关系")
private String map;
@ApiModelProperty(value="是否将姓名、邮箱、手机号三个保留字段数据保存到网易七鱼系统中")
private Boolean save;
@ApiModelProperty(value="用于表明该项数据信息的展现位置")
private String zone;
@ApiModelProperty(value="用于标识该项数据是否为select下拉框")
private Boolean select;
@ApiModelProperty(value="用于标识该select下拉框选项是否被选中")
private Boolean check;
}
package com.zrqx.core.model.third.qiyu;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import lombok.Data;
@Data
public class Orders {
@ApiModelProperty(value="用于排序")
private Integer index;
@ApiModelProperty(value="用一个数组表示该订单包含的区块")
private List<Blocks> blocks;
}
package com.zrqx.core.service;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
import org.apache.ibatis.session.RowBounds;
import com.zrqx.core.util.PageInfo;
import com.zrqx.core.util.PageParam;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;
public interface BaseService<M, ID extends Serializable> {
/**
* 返回一个where模板
*/
public Criteria createCriteria();
/**
* 返回一个where模板
*/
public Criteria createCriteria(Class<M> entityClass);
/**
* 返回一个模板
*/
public Example createExample();
/**
* 返回一个模板
*/
public Example createExample(Class entityClass);
/**
* 分页
*/
public PageInfo<M> queryAll(PageParam pageParam);
/**
* 分页查询
*/
public PageInfo<M> query(M entity, PageParam pageParam);
/**
* 分页查询,使用内部模板,条件查询
*/
public PageInfo<M> queryCriteria(PageParam pageParam);
/**
* 根据实体属性作为条件进行删除,查询条件使用等号
*
* @param record
* @return
*/
boolean delete(M record);
/**
* 需要从当前service 调用createCriteria()方法 返回Criteria 对象,在外部封装参数
* 根据内置Criteria条件删除数据
*
* @return
*/
boolean deleteByCriteria();
/**
* 根据主键字段进行删除,方法参数必须包含完整的主键属性
*
* @param key
* @return
*/
boolean deleteByPrimaryKey(Object key);
/**
* 根据主键字段查询总数,方法参数必须包含完整的主键属性,查询条件使用等号
*
* @param key
* @return
*/
boolean existsWithPrimaryKey(Object key);
/**
* 保存一个实体,null的属性也会保存,不会使用数据库默认值
*
* @param record
* @return
*/
boolean insert(M record);
/**
* 批量插入,支持批量插入的数据库可以使用,例如MySQL,H2等,另外该接口限制实体包含`id`属性并且必须为自增列
*
* @param recordList
* @return
*/
boolean insertList(List<M> recordList);
/**
* 保存一个实体,null的属性不会保存,会使用数据库默认值
*
* @param record
* @return
*/
boolean insertSelective(M record);
/**
* 插入数据,限制为实体包含`id`属性并且必须为自增列,实体配置的主键策略无效
*
* @param record
* @return
*/
boolean insertUseGeneratedKeys(M record);
/**
* 需要从当前service 调用createCriteria()方法 返回Criteria 对象,在外部封装参数
* 根据内置Criteria条件更新实体`record`包含的全部属性,null值会被更新
*
* @param record
* @return
*/
boolean updateByCriteria(M record);
/**
* 需要从当前service 调用createCriteria()方法 返回Criteria 对象,在外部封装参数
* 根据内置Criteria条件更新实体`record`包含的不是null的属性值
*
* @param record
* @return
*/
boolean updateByCriteriaSelective(M record);
/**
* 根据主键更新实体全部字段,null值会被更新
*
* @param record
* @return
*/
boolean updateByPrimaryKey(M record);
/**
* 根据主键更新属性不为null的值
*
* @param record
* @return
*/
boolean updateByPrimaryKeySelective(M record);
/**
* 根据实体中的属性值进行查询,查询条件使用等号
*
* @param record
* @return
*/
List<M> select(M record);
/**
* 查询全部结果
*
* @return
*/
List<M> selectAll();
/**
* 需要从当前service 调用createCriteria()方法 返回Criteria 对象,在外部封装参数
* 根据内置Criteria条件进行查询
*
* @return
*/
List<M> selectByCriteria();
/**
* 需要从当前service 调用createCriteria()方法 返回Criteria 对象,在外部封装参数
* 根据内置Criteria条件和RowBounds进行分页查询
*
* @param rowBounds
* @return
*/
List<M> selectByCriteriaAndRowBounds(RowBounds rowBounds);
/**
* 根据主键字段进行查询,方法参数必须包含完整的主键属性,查询条件使用等号
*
* @param key
* @return
*/
M selectByPrimaryKey(Object key);
/**
* 根据实体属性和RowBounds进行分页查询
*
* @param record
* @param rowBounds
* @return
*/
List<M> selectByRowBounds(M record, RowBounds rowBounds);
/**
* 根据实体中的属性查询总数,查询条件使用等号
*
* @param record
* @return
*/
int selectCount(M record);
/**
* 需要从当前service 调用createCriteria()方法 返回Criteria 对象,在外部封装参数
* 根据内置Criteria条件进行查询总数
*
* @return
*/
int selectCountByCriteria();
/**
* 根据实体中的属性进行查询,只能有一个返回值,有多个结果是抛出异常,查询条件使用等号
*
* @param record
* @return
*/
M selectOne(M record);
/**
* 需要从当前service 调用createCriteria()方法 返回Criteria 对象,在外部封装参数
* 根据内置Criteria条件进行查询
*
* @return
*/
M selectOneByCriteria();
}
\ No newline at end of file
package com.zrqx.core.service;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
import org.apache.ibatis.session.RowBounds;
import com.github.pagehelper.PageHelper;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.util.PageInfo;
import com.zrqx.core.util.PageParam;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;
public abstract class BaseServiceImpl<M, ID extends Serializable> implements BaseService<M, ID> {
public abstract BaseMapper<M> getMapper();
protected Example example;
private Class<M> entityClass;
@SuppressWarnings("unchecked")
public Example createExample(){
if(entityClass == null){
/**
* 为泛型指定具体实体对象
* @Method getClass() 运行时类 ---api
* @Method getGenericSuperclass() 取得支持泛型的父类
* @Method getActualTypeArguments()[0] 取得父类真正对应的参数,即实体对象
*/
Type paramType = getClass().getGenericSuperclass();
if(paramType instanceof ParameterizedType){
ParameterizedType pty = (ParameterizedType)paramType;
this.entityClass = (Class<M>)pty.getActualTypeArguments()[0];
}
}
return createExample(entityClass);
}
public Example createExample(Class entityClass){
example = new Example(entityClass);
return example;
}
public Criteria createCriteria() {
createExample();
return example.createCriteria();
}
public Criteria createCriteria(Class entityClass) {
createExample(entityClass);
return example.createCriteria();
}
/**
* 开启分页
*
* @Title: startPage
* @Description:
* @param pageParam
* @author lpf
* @date: 2018年5月11日 上午10:24:17
*
*/
protected void startPage(PageParam pageParam) {
PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize(), pageParam.getOrderBy());
}
@Override
public PageInfo<M> query(M entity, PageParam pageParam) {
startPage(pageParam);
List<M> list = select(entity);
return new PageInfo<M>(list);
}
@Override
public PageInfo<M> queryCriteria(PageParam pageParam) {
startPage(pageParam);
List<M> list = selectByCriteria();
return new PageInfo<M>(list);
}
@Override
public PageInfo<M> queryAll(PageParam pageParam) {
startPage(pageParam);
List<M> list = selectAll();
return new PageInfo<M>(list);
}
@Override
public boolean delete(M record) {
return getMapper().delete(record)>0;
}
@Override
public boolean deleteByCriteria() {
return getMapper().deleteByExample(example)>0;
}
@Override
public boolean deleteByPrimaryKey(Object key) {
return getMapper().deleteByPrimaryKey(key)>0;
}
@Override
public boolean existsWithPrimaryKey(Object key) {
return getMapper().existsWithPrimaryKey(key);
}
@Override
public boolean insert(M record) {
return getMapper().insert(record)>0;
}
@Override
public boolean insertList(List<M> recordList) {
return getMapper().insertList(recordList)>0;
}
@Override
public boolean insertSelective(M record) {
return getMapper().insertSelective(record)>0;
}
@Override
public boolean insertUseGeneratedKeys(M record) {
return getMapper().insertUseGeneratedKeys(record)>0;
}
@Override
public boolean updateByCriteria(M record) {
return getMapper().updateByExample(record, example)>0;
}
@Override
public boolean updateByCriteriaSelective(M record) {
return getMapper().updateByExampleSelective(record, example)>0;
}
@Override
public boolean updateByPrimaryKey(M record) {
return getMapper().updateByPrimaryKey(record)>0;
}
@Override
public boolean updateByPrimaryKeySelective(M record) {
return getMapper().updateByPrimaryKeySelective(record)>0;
}
@Override
public List<M> select(M record) {
return getMapper().select(record);
}
@Override
public List<M> selectAll() {
return getMapper().selectAll();
}
@Override
public List<M> selectByCriteria() {
return getMapper().selectByExample(example);
}
@Override
public List<M> selectByCriteriaAndRowBounds(RowBounds rowBounds) {
return getMapper().selectByExampleAndRowBounds(example, rowBounds);
}
@Override
public M selectByPrimaryKey(Object key) {
return getMapper().selectByPrimaryKey(key);
}
@Override
public List<M> selectByRowBounds(M record, RowBounds rowBounds) {
return getMapper().selectByRowBounds(record, rowBounds);
}
@Override
public int selectCount(M record) {
return getMapper().selectCount(record);
}
@Override
public int selectCountByCriteria() {
return getMapper().selectCountByExample(example);
}
@Override
public M selectOne(M record) {
return getMapper().selectOne(record);
}
@Override
public M selectOneByCriteria(){
return getMapper().selectOneByExample(example);
}
}
\ No newline at end of file
package com.zrqx.core.util;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
/*
* AES对称加密和解密
*/
public class ASCUtil {
/** 是否需要加密 */
private static final boolean NEED = true;
/** 加密密钥 */
private static final String ENCODE_RULES = "rsks2018";
private final static Logger logger = LoggerFactory.getLogger(ASCUtil.class);
/**
* 使用默认密钥加密
* @param content 待加密内容
* @return
* @author lpf
* @date: 2018年11月16日 下午2:02:16
*/
public static String addAESEncode(String content) {
return AESEncode(ENCODE_RULES, content);
}
/**
* 加密 1.构造密钥生成器 2.根据ecnodeRules规则初始化密钥生成器 3.产生密钥 4.创建和初始化密码器 5.内容加密 6.返回字符串
* @param encodeRules 加密密钥
* @param content 待加密内容
* @return
* @author lpf
* @date: 2018年11月16日 上午9:38:41
*/
public static String AESEncode(String encodeRules, String content) {
if (!NEED) {
return content;
}
try {
// 1.构造密钥生成器,指定为AES算法,不区分大小写
KeyGenerator keygen = KeyGenerator.getInstance("AES");
// 2.根据ecnodeRules规则初始化密钥生成器
// 生成一个128位的随机源,根据传入的字节数组
SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
secureRandom.setSeed(encodeRules.getBytes());
keygen.init(128, secureRandom);
// 3.产生原始对称密钥
SecretKey original_key = keygen.generateKey();
// 4.获得原始对称密钥的字节数组
byte[] raw = original_key.getEncoded();
// 5.根据字节数组生成AES密钥
SecretKey key = new SecretKeySpec(raw, "AES");
// 6.根据指定算法AES自成密码器
Cipher cipher = Cipher.getInstance("AES");
// 7.初始化密码器,第一个参数为加密(Encrypt_mode)或者解密解密(Decrypt_mode)操作,第二个参数为使用的KEY
cipher.init(Cipher.ENCRYPT_MODE, key);
// 8.获取加密内容的字节数组(这里要设置为utf-8)不然内容中如果有中文和英文混合中文就会解密为乱码
byte[] byte_encode = content.getBytes("utf-8");
// 9.根据密码器的初始化方式--加密:将数据加密
byte[] byte_AES = cipher.doFinal(byte_encode);
// 10.将加密后的数据转换为字符串
// 这里用Base64Encoder中会找不到包
// 解决办法:
// 在项目的Build path中先移除JRE System Library,再添加库JRE System
// Library,重新编译后就一切正常了。
String AES_encode = new String(new BASE64Encoder().encode(byte_AES));
// 11.将字符串返回
return AES_encode;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
// 如果有错就返回原文
return content;
}
/**
* 根据默认密钥解密
* @param content 待解密内容
* @return
* @author lpf
* @date: 2018年11月16日 下午2:03:13
*/
public static String disAESDncode(String content) {
return AESDncode(ENCODE_RULES, content);
}
/**
* 解密 解密过程: 1.同加密1-4步 2.将加密后的字符串反纺成byte[]数组 3.将加密内容解密
* @param encodeRules 解密密钥
* @param content 待解密内容
* @return
* @author lpf
* @date: 2018年11月16日 上午9:39:34
*/
public static String AESDncode(String encodeRules, String content) {
if (!NEED) {
return content;
}
try {
// 1.构造密钥生成器,指定为AES算法,不区分大小写
KeyGenerator keygen = KeyGenerator.getInstance("AES");
// 2.根据ecnodeRules规则初始化密钥生成器
// 生成一个128位的随机源,根据传入的字节数组
SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
secureRandom.setSeed(encodeRules.getBytes());
keygen.init(128, secureRandom);
// 3.产生原始对称密钥
SecretKey original_key = keygen.generateKey();
// 4.获得原始对称密钥的字节数组
byte[] raw = original_key.getEncoded();
// 5.根据字节数组生成AES密钥
SecretKey key = new SecretKeySpec(raw, "AES");
// 6.根据指定算法AES自成密码器
Cipher cipher = Cipher.getInstance("AES");
// 7.初始化密码器,第一个参数为加密(Encrypt_mode)或者解密(Decrypt_mode)操作,第二个参数为使用的KEY
cipher.init(Cipher.DECRYPT_MODE, key);
// 8.将加密并编码后的内容解码成字节数组
byte[] byte_content = new BASE64Decoder().decodeBuffer(content);
/*
* 解密
*/
byte[] byte_decode = cipher.doFinal(byte_content);
String AES_decode = new String(byte_decode, "utf-8");
return AES_decode;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
logger.info("要解密的参数(" + content + ")异常");
} catch (BadPaddingException e) {
e.printStackTrace();
}
// 如果有错就返回原文
return content;
}
public static void main(String[] args) {
/*
* 加密
*/
String encodeRules = "rsks2018";
String content = "13335881155";
String str = ASCUtil.AESEncode(encodeRules, content);
System.out.println("密钥" + encodeRules + "加密后的密文是:" + str);
str = "7P2/fNSjJGaRvUebdNzvxw==";
str = "aaqe+HJCiTeUwjQhGqr1XuJ+5GaLdEhlMOwdlsdmbxZiHR+NfoIwkvhRSojT09+N";
str = "zTDBo4QyX/JFPSM4gF6cDA==";
/*
* 解密
*/
str = ASCUtil.AESDncode(encodeRules, str);
System.out.println("密钥" + encodeRules + "解密后的明文是:" + str);
String context1 = "cxc";
String str1 = ASCUtil.AESEncode(encodeRules, context1);
System.out.println("密钥" + encodeRules + "加密后的密文是:" + str1);
str = ASCUtil.AESDncode(encodeRules, str1);
System.out.println("密钥" + encodeRules + "解密后的明文是:" + str);
}
}
package com.zrqx.core.util;
public class ArrayUtils {
/**
* 省份对比
*
* @param array
* @param objectToFind
* @return
* @author Conan
* @date: 2018年10月24日 下午6:02:05
*/
public static boolean contains(String[] array, String objectToFind) {
if (objectToFind == null) {
for (int i = 0; i < array.length; i++) {
if (array[i] == null) {
return true;
}
}
}
String str = (String)objectToFind;
objectToFind = str.substring(0, 2);
for (int i = 0; i < array.length; i++) {
if (array[i].startsWith(objectToFind)) {
return true;
}
}
return false;
}
public static void main(String[] args) {
String[] s = {"新疆維吾爾族自治區","上海","香港"};
String str = "香港特別行政區";
System.out.println(contains(s, str));
}
}
package com.zrqx.core.util;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Stream;
public class BeanUtils {
/**
* 获取包括父类在内的所有属性
* @param c
* @return
* @author lw
* @date: 2018年11月26日 下午4:18:30
*/
public static Field[] getAllFields(Class<?> clazz) {
List<Field> fieldList = new ArrayList<>();
while (clazz != null) {
fieldList.addAll(new ArrayList<>(Arrays.asList(clazz
.getDeclaredFields())));
clazz = clazz.getSuperclass();
}
Field[] fields = new Field[fieldList.size()];
fieldList.toArray(fields);
return fields;
}
/**
* 筛选类的属性
* @param clazz
* @param filters
* @return
* @author lpf
* @date: 2018年12月11日 下午7:29:51
*/
@SafeVarargs
public static <T> Stream<Field> getFieldsByAnnotation(Class<?> clazz,Predicate<Field>... filters){
Stream<Field> stream = Arrays.stream(BeanUtils.getAllFields(clazz))
.map(f -> {
f.setAccessible(true);
return f;
});
if (filters != null && filters.length > 0){
for (Predicate<Field> predicate : filters) {
stream = stream.filter(predicate);
}
}
return stream;
}
}
package com.zrqx.core.util;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import com.alibaba.fastjson.annotation.JSONField;
import com.zrqx.core.enums.ResponseCodeEnum;
@ApiModel("响应报文")
public class CallBack<T> implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty("标志位,标记操作是否成功")
private boolean status = true;
@ApiModelProperty("响应编码")
private int code;
@ApiModelProperty("响应描述")
private String msg;
@ApiModelProperty("响应数据")
@JSONField(name = "data")
private T data;
@ApiModelProperty("响应时间戳")
private Date timestamp = new Date();
private CallBack(int code,String msg) {
this.code = code;
this.msg = msg;
}
public CallBack(ResponseCodeEnum en) {
this(en.getCode(),en.getMsg());
}
public CallBack(){
}
public static <T> CallBack<T> create(ResponseCodeEnum en,T data){
CallBack<T> back = new CallBack<T>(en);
if (back.code == 0) {
back.data = data;
}else{
back.status = false;
if(data != null){
back.msg = data.toString();
}
}
return back;
}
public static <T> CallBack<T> create(int code, T data,String message) {
CallBack<T> back = new CallBack<T>();
back.code = code;
if(ResponseCodeEnum.OK.getCode()!=code){
back.status=false;
}
back.data = data;
back.msg = message;
return back;
}
public static <T> CallBack<T> create(ResponseCodeEnum en){
return create(en,null);
}
public static <T> CallBack<T> success() {
return create(ResponseCodeEnum.OK, null);
}
public static <T> CallBack<T> success(T data) {
return create(ResponseCodeEnum.OK,data);
}
public static <T> CallBack<T> fail(T data) {
return create(ResponseCodeEnum.FAIL,data);
}
public static <T> CallBack<T> fail() {
return fail(null);
}
public static <T> CallBack<T> validate(T data) {
return create(ResponseCodeEnum.VALIDATE,data);
}
public static <T> CallBack<T> validate() {
return fail(null);
}
public static <T> CallBack<T> exception(T data) {
return create(ResponseCodeEnum.EXCEPTION,data);
}
public static <T> CallBack<T> exception(int code, T data) {
return create(code,data,null);
}
public static <T> CallBack<T> exception(int code, T data,String message) {
return create(code,data,message);
}
public static <T> CallBack<T> exception() {
return fail(null);
}
public boolean isStatus() {
return this.status;
}
public T getData() {
return this.data;
}
public Date getTimestamp() {
return this.timestamp;
}
public void setStatus(boolean status) {
this.status = status;
}
public void setCode(int code) {
this.code = code;
}
public int getCode() {
return this.code;
}
public String getMsg() {
return this.msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public boolean notEntity() {
return this.isStatus() && this.data != null;
}
// public boolean isEntity() {
// return this.isStatus() && this.data == null;
// }
public boolean hasError() {
return !this.isStatus() || this.data == null;
}
public void setData(T data) {
this.data = data;
}
}
package com.zrqx.core.util;
import java.util.Random;
public class CardUtil {
static final char[] STR = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B',
'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z' };
/**
* 数字数组
*/
static final char[] STR_NUMBER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
/**
* 小写字母数组
*/
static final char[] STR_XZM = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
/**
* 大写字母数组
*/
static final char[] STR_DZM = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y' };
/**
* 纯数字
*/
static final int LEVEL_ONE = 1;
/**
* 小写字母加数字
*/
static final int LEVEL_TOW = 2;
/**
* 大小写字母加数字
*/
static final int LEVEL_THREE = 3;
static Random rand = new Random();
public static void main(String[] args) {
String pwd = createPassword(8, 1);
System.out.println(pwd);
}
public static String createPassword(int length, int level) {
char[] chars = new char[length];
for (int i = 0; i < length; i++) {
if (i % level == 2) {
chars[i] = randomChar(STR_DZM);
} else if (i % level == 1) {
chars[i] = randomChar(STR_XZM);
} else {
chars[i] = randomChar(STR_NUMBER);
}
}
if(LEVEL_THREE != level){
for (int i = 0; i < chars.length; i++) {
int p = rand.nextInt(i+1);
char tmp = chars[i];
chars[i] = chars[p];
chars[p] = tmp;
}
}
return new String(chars);
}
public static char randomChar(char[] str) {
// 从字符数组中随机取出 对应下标字符拼接
return str[rand.nextInt(str.length)];
}
public static String[] chars = new String[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
"o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8",
"9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
"U", "V", "W", "X", "Y", "Z" };
public static String[] base24 = new String[] {
"B", "C", "D", "F", "G",
"H", "J", "K", "M", "P",
"Q", "R", "T", "V", "W",
"X", "Y","2", "3", "4",
"6", "7", "8", "9"};
public static String generateShortUuid() {
StringBuffer shortBuffer = new StringBuffer();
String uuid = UUIDUtil.getUUID();
for (int i = 0; i < 8; i++) {
String str = uuid.substring(i * 4, i * 4 + 4);
int x = Integer.parseInt(str, 16);
shortBuffer.append(chars[x % 0x3E]);
}
return shortBuffer.toString();
}
public static String generateShortUuid(int length) {
StringBuffer shortBuffer = new StringBuffer();
for (int i = 0; i < length; i++) {
shortBuffer.append(base24[rand.nextInt(24)]);
}
return shortBuffer.toString();
}
}
package com.zrqx.core.util;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.springframework.beans.BeanInstantiationException;
import org.springframework.beans.BeanUtils;
import com.zrqx.core.exception.BaseException;
public class Copy {
/**
* 批量复制对象
* @param list
* @param clazz
* @return
* @author lpf
*/
public static <VO, R> List<VO> copyList(List<R> list, Class<VO> clazz) {
return copyList(list, clazz, (r,vo) ->{}, (R r) -> true);
}
/**
* 过滤批量复制对象执行操作
* @param list
* @param clazz
* @param BiConsumer (R,VO) -> void 复制对象后 执行程序
* @param filter
* @return
* @author lpf
*/
@SafeVarargs
public static <VO, R> List<VO> copyList(List<R> list, Class<VO> clazz, BiConsumer<R, VO> biConSumer, Predicate<R>... filter) {
Stream<R> stream = list.stream();
for (Predicate<R> predicate : filter) {
stream = stream.filter(predicate);
}
return stream.map(obj -> {
try {
VO vo = BeanUtils.instantiate(clazz);
BeanUtils.copyProperties(obj, vo);
biConSumer.accept(obj, vo);
return vo;
} catch (BeanInstantiationException e) {
e.printStackTrace();
throw new BaseException("批量复制对象时创建对象失败。");
}
}).collect(Collectors.toList());
}
/**
* 过滤批量复制对象
*
* @param list
* @param clazz
* @param filter
* @return
*/
public static <VO, R> List<VO> copyList(List<R> list, Class<VO> clazz, Predicate<R> filter) {
return list.stream().filter(filter).map(obj -> {
VO vo = null;
try {
vo = clazz.newInstance();
BeanUtils.copyProperties(obj, vo);
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
throw new BaseException("批量复制对象时创建对象失败。");
}
return vo;
}).collect(Collectors.toList());
}
}
package com.zrqx.core.util;
import javax.servlet.http.HttpServletRequest;
public class CusAccessObjectUtil {
/**
* 获取用户真实IP地址,不使用request.getRemoteAddr();的原因是有可能用户使用了代理软件方式避免真实IP地址,
*
* 可是,如果通过了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP值,究竟哪个才是真正的用户端的真实IP呢?
* 答案是取X-Forwarded-For中第一个非unknown的有效IP字符串。
*
* 如:X-Forwarded-For:192.168.1.110, 192.168.1.120, 192.168.1.130, 192.168.1.100
*
* 用户真实IP为: 192.168.1.110
*
* @param request
* @return
*/
public static String getIpAddress(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_CLIENT_IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
return ip;
}
}
package com.zrqx.core.util;
import java.net.URLEncoder;
import javax.servlet.http.HttpServletRequest;
public class HttpUtils {
private static String[] IEBrowserSignals = {"MSIE", "Trident", "Edge"};
public static boolean isMSBrowser(HttpServletRequest request) {
String userAgent = request.getHeader("User-Agent");
for (String signal : IEBrowserSignals) {
if (userAgent.contains(signal))
return true;
}
return false;
}
/**
* 根据不同的浏览器转字符编码
*
* @param request
* @param str
* @return
* @throws Exception
*/
public static String transCharacter(HttpServletRequest request, String fileName) throws Exception {
boolean isMSIE = isMSBrowser(request);
if (isMSIE) {
fileName = URLEncoder.encode(fileName, "UTF-8");
}
return new String(fileName.getBytes("UTF-8"), "UTF-8");
}
}
\ No newline at end of file
package com.zrqx.core.util.JsonUtil;
import java.io.IOException;
import java.io.StringWriter;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class JsonUtil {
private static ObjectMapper mapper = new ObjectMapper();
@SuppressWarnings("deprecation")
public static String bean2Json(Object obj) throws IOException {
StringWriter sw = new StringWriter();
JsonGenerator gen = new JsonFactory().createJsonGenerator(sw);
mapper.writeValue(gen, obj);
gen.close();
return sw.toString();
}
public static <T> T json2Bean(String jsonStr, Class<T> objClass)
throws JsonParseException, JsonMappingException, IOException {
return mapper.readValue(jsonStr, objClass);
}
}
package com.zrqx.core.util;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.commons.codec.digest.DigestUtils;
public class MD5Util {
public static String getEncoderByMd5(String sessionid) throws NoSuchAlgorithmException, UnsupportedEncodingException {
StringBuffer hexString = new StringBuffer();
byte[] defaultBytes = sessionid.getBytes();
try {
MessageDigest algorithm = MessageDigest.getInstance("MD5");
algorithm.reset();
algorithm.update(defaultBytes);
byte messageDigest[] = algorithm.digest();
hexString = new StringBuffer();
for (int i = 0; i < messageDigest.length; i++) {
if (Integer.toHexString(0xFF & messageDigest[i]).length() == 1) {
hexString.append(0);
}
hexString.append(Integer.toHexString(0xFF & messageDigest[i]));
}
// messageDigest.toString();
// sessionid = hexString + "";
} catch (NoSuchAlgorithmException nsae) {
}
return hexString.toString().toUpperCase();
}
public static void main(String[] args) throws NoSuchAlgorithmException, UnsupportedEncodingException {
// String pass = MD5Util.getEncoderByMd5("123456");
// System.out.println(pass);
// System.out.println("E10ADC3949BA59ABBE56E057F20F883E");
System.out.println(MD5Util.MD5("testtimestamp12345678test"));
}
public static String MD5(String str) {
String encodeStr = DigestUtils.md5Hex(str);
System.out.println("MD5加密后的字符串为:encodeStr=" + encodeStr);
return encodeStr;
}
}
package com.zrqx.core.util;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Map;
import lombok.Data;
@ApiModel(value="PageMap",description="分页分组工具类")
@Data
public class PageMap<K,V> implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("当前页")
private int pageNum;
@ApiModelProperty("每页的数量")
private int pageSize;
@ApiModelProperty("当前页的数量")
private int size;
@ApiModelProperty("当前页面第一个元素在数据库中的行号")
private int startRow;
@ApiModelProperty("当前页面最后一个元素在数据库中的行号")
private int endRow;
@ApiModelProperty("总记录数")
private long total;
@ApiModelProperty("总页数")
private int pages;
@ApiModelProperty("结果集")
private Map<K,V> map;
@ApiModelProperty("前一页")
private int prePage;
@ApiModelProperty("下一页")
private int nextPage;
@ApiModelProperty("是否为第一页")
private boolean isFirstPage = false;
@ApiModelProperty("是否为最后一页")
private boolean isLastPage = false;
@ApiModelProperty("是否有前一页")
private boolean hasPreviousPage = false;
@ApiModelProperty("是否有下一页")
private boolean hasNextPage = false;
@ApiModelProperty("导航页码数")
private int navigatePages;
@ApiModelProperty("所有导航页号")
private int[] navigatepageNums;
@ApiModelProperty("导航条上的第一页")
private int navigateFirstPage;
@ApiModelProperty("导航条上的最后一页")
private int navigateLastPage;
}
\ No newline at end of file
package com.zrqx.core.util;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value="PageParam",description="分页参数")
@Data
public class PageParam {
@ApiModelProperty(value="页码",example="1", required = true)
private Integer pageNum = 1;
@ApiModelProperty(value="每页展示行数",example="10", required = true)
private Integer pageSize = 10;
@ApiModelProperty("排序列")
private String orderBy;
}
\ No newline at end of file
package com.zrqx.core.util;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Hashtable;
import javax.imageio.ImageIO;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.EncodeHintType;
import com.google.zxing.LuminanceSource;
import com.google.zxing.ReaderException;
import com.google.zxing.Result;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.qrcode.QRCodeReader;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
/**
* 二维码生成和读的工具类
*
*/
public class QrCodeCreateUtil {
private static String TYPE = "JPEG";
private static int SIZE = 300;
/**
* 生成包含字符串信息的二维码图片
*
* @param outputStream
* 文件输出流路径
* @param content
* 二维码携带信息
* @param qrCodeSize
* 二维码图片大小
* @param imageFormat
* 二维码的格式
* @throws WriterException
* @throws IOException
*/
public static boolean createQrCode(OutputStream outputStream, String content, int qrCodeSize, String imageFormat)
throws WriterException, IOException {
if(qrCodeSize < 130){
qrCodeSize = 130;
}
// 设置二维码纠错级别MAP
Hashtable<EncodeHintType, ErrorCorrectionLevel> hintMap = new Hashtable<EncodeHintType, ErrorCorrectionLevel>();
hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L); // 矫错级别
QRCodeWriter qrCodeWriter = new QRCodeWriter();
// 创建比特矩阵(位矩阵)的QR码编码的字符串
BitMatrix byteMatrix = qrCodeWriter.encode(content, BarcodeFormat.QR_CODE, qrCodeSize, qrCodeSize, hintMap);
// 使BufferedImage勾画QRCode (matrixWidth 是行二维码像素点)
int matrixWidth = byteMatrix.getWidth();
BufferedImage image = new BufferedImage(matrixWidth - 50, matrixWidth - 50, BufferedImage.TYPE_INT_RGB);
image.createGraphics();
Graphics2D graphics = (Graphics2D) image.getGraphics();
graphics.setColor(Color.WHITE);
graphics.fillRect(0, 0, matrixWidth, matrixWidth);
// 使用比特矩阵画并保存图像
graphics.setColor(Color.BLACK);
for (int i = 0; i < matrixWidth; i++) {
for (int j = 0; j < matrixWidth; j++) {
if (byteMatrix.get(i, j)) {
graphics.fillRect(i-25, j-25, 1, 1);
}
}
}
return ImageIO.write(image, imageFormat, outputStream);
}
public static boolean createQrCode(OutputStream outputStream, String content, int qrCodeSize)
throws WriterException, IOException {
return createQrCode(outputStream, content, qrCodeSize, TYPE);
}
public static boolean createQrCode(OutputStream outputStream, String content, String imageFormat)
throws WriterException, IOException {
return createQrCode(outputStream, content, SIZE, imageFormat);
}
public static boolean createQrCode(OutputStream outputStream, String content) throws WriterException, IOException {
return createQrCode(outputStream, content, SIZE, TYPE);
}
public static boolean createQrCode(String file, String content) throws WriterException, IOException {
return createQrCode(new FileOutputStream(new File(file)), content, SIZE, TYPE);
}
public static boolean createQrCode(File file, String content) throws WriterException, IOException {
return createQrCode(new FileOutputStream(file), content, SIZE, TYPE);
}
/**
* 读二维码并输出携带的信息
*/
public static String readQrCode(InputStream inputStream) throws IOException {
// 从输入流中获取字符串信息
BufferedImage image = ImageIO.read(inputStream);
// 将图像转换为二进制位图源
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
QRCodeReader reader = new QRCodeReader();
Result result = null;
try {
result = reader.decode(bitmap);
} catch (ReaderException e) {
e.printStackTrace();
}
return result.getText();
}
/**
* 测试代码
*
* @throws WriterException
*/
public static void main(String[] args) throws IOException, WriterException {
createQrCode(new FileOutputStream(new File("d:\\qrcode.jpg")), "WE11111111111111111111111111111111111111111111");
readQrCode(new FileInputStream(new File("d:\\qrcode.jpg")));
}
}
\ No newline at end of file
package com.zrqx.core.util;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
public class SpringContextUtils implements ApplicationContextAware {
private ApplicationContext context;
@Override
public void setApplicationContext(ApplicationContext context)
throws BeansException {
this.context = context;
}
public ApplicationContext getContext() {
return this.context;
}
}
package com.zrqx.core.util;
/**
* 字符串的一些公共方法
* @ClassName: StringUtils
* @author
* @date 2014-7-14 上午11:14:00
*
*/
public class StringUtils {
private final static String[] agent = { "Android", "iPhone", "iPod","iPad", "Windows Phone", "MQQBrowser" };
private final static String[] enletters = {"a","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","t","u","v","w","x","y","z"};
/**
* 判断User-Agent 是不是来自于手机
* @param ua
* @return
*/
public static boolean checkAgentIsMobile(String ua) {
boolean flag = false;
if (!ua.contains("Windows NT") || (ua.contains("Windows NT") && ua.contains("compatible; MSIE 9.0;"))) {
// 排除 苹果桌面系统
if (!ua.contains("Windows NT") && !ua.contains("Macintosh")) {
for (String item : agent) {
if (ua.contains(item)) {
flag = true;
break;
}
}
}
}
return flag;
}
/**
* 给定指定字符串res,去除字符串首尾的指定字符c
* @Title: trim
* @param res 原字符串
* @param c 要删除的字符,只删除首尾,且不能截取Unicode 大于 'A'的字符
* @return
* @return String 返回类型
* @author
* @date 2014-7-14 上午11:21:21
*/
public static String trim(String res,char c) {
int count = res.toCharArray().length;
int len = res.toCharArray().length;
int st = 0;
int off = 0; /* avoid getfield opcode */
char[] val = res.toCharArray(); /* avoid getfield opcode */
while ((st < len) && (val[off + st] <= c)) {
st++;
}
while ((st < len) && (val[off + len - 1] <= c)) {
len--;
}
return ((st > 0) || (len < count)) ? res.substring(st, len) : res;
}
/**
* 获取setter方法名称
* @Title: getSetterMethodName
* @param key
* @return
* @return String 返回类型
* @author
* @date 2014年7月24日 下午3:43:22
*/
public static String getMethodName(String begin,String key) {
StringBuilder result = new StringBuilder(begin);
result.append(key.substring(0,1).toUpperCase()).append(key.substring(1));
return result.toString();
}
/**
* 获取随机英文字符串
* @param caseType 1大写,其他小写
* @param length 返回字符串长度
* @param hasRepeat 是否包含重复字符 1包含0不包含
* @return
* @author ydm
* @date: 2018年7月11日 上午11:33:25
*/
public static String getRandomEnSign(int caseType,int length,int hasRepeat){
StringBuffer resultBuffer = new StringBuffer();
for(int i = 0 ; i < length ; i ++ ){
int x=1+(int)(Math.random()*enletters.length-1);
if(hasRepeat * 1 == 0){
if(resultBuffer.toString().toLowerCase().indexOf(enletters[x].toLowerCase())>0){
continue;
}
}
resultBuffer.append(caseType*1==1 ? enletters[x].toUpperCase() : enletters[x].toLowerCase());
}
return resultBuffer.toString();
}
}
package com.zrqx.core.util;
import java.util.UUID;
import com.zrqx.core.exception.BaseException;
public class UUIDUtil {
/**
* 获得指定数目的UUID
*
* @param number
* int 需要获得的UUID数量
* @return String[] UUID数组
*/
public static String[] getUUID(int number) {
if (number < 1) {
return null;
}
String[] retArray = new String[number];
for (int i = 0; i < number; i++) {
retArray[i] = getUUID();
}
return retArray;
}
/**
* 获得一个UUID
*
* @return String UUID
*/
public static String getUUID() {
String uuid = UUID.randomUUID().toString();
// 去掉“-”符号
return uuid.replaceAll("-", "");
}
/**
* 有序生成代号
* @param code
* @return
*/
public static String newCode(String code){
if(code != null){
Integer numCode = Integer.parseInt(code.substring(code.length()-2, code.length()));
numCode+=1;
code = code.substring(0, code.length()-2);
if((numCode+"").length()==2){
return code + "" + numCode;
}else{
return code + "0" + numCode + "";
}
}else{
throw new BaseException("同级子分类 分类编号 为空,无法自动生成分类编号。");
}
}
}
package com.zrqx.core.util;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Random;
import javax.imageio.ImageIO;
/**
* 图形验证码生成
*/
public class VerifyUtil {
// 验证码字符集
private static final char[] chars = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
// 字符数量
private static final int SIZE = 4;
// 干扰线数量
private static final int LINES = 5;
// 宽度
private static final int WIDTH = 80;
// 高度
private static final int HEIGHT = 40;
// 字体大小
private static final int FONT_SIZE = 30;
/**
* 生成随机验证码及图片
* Object[0]:验证码字符串;
* Object[1]:验证码图片。
*/
public static Object[] createImage() {
StringBuffer sb = new StringBuffer();
// 1.创建空白图片
BufferedImage image = new BufferedImage(
WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
// 2.获取图片画笔
Graphics graphic = image.getGraphics();
// 3.设置背景颜色
graphic.setColor(Color.WHITE);
// 4.绘制矩形背景
graphic.fillRect(0, 0, WIDTH, HEIGHT);
// 5.画随机字符
Random ran = new Random();
for (int i = 0; i <SIZE; i++) {
// 取随机字符索引
int n = ran.nextInt(chars.length);
// 随机设置画笔颜色
graphic.setColor(getRandomColor());
// 设置字体大小
graphic.setFont(new Font(
null, Font.BOLD + Font.ITALIC, FONT_SIZE));
// 画字符
graphic.drawString(
chars[n] + "", i * WIDTH / SIZE, HEIGHT*2/3);
// 记录字符
sb.append(chars[n]);
}
// 6.画干扰线
for (int i = 0; i < LINES; i++) {
// 设置随机颜色
graphic.setColor(getRandomColor());
// 随机画线
graphic.drawLine(ran.nextInt(WIDTH), ran.nextInt(HEIGHT),
ran.nextInt(WIDTH), ran.nextInt(HEIGHT));
}
// 7.返回验证码和图片
return new Object[]{sb.toString(), image};
}
/**
* 随机取色
*/
public static Color getRandomColor() {
Random ran = new Random();
Color color = new Color(ran.nextInt(256),
ran.nextInt(256), ran.nextInt(256));
return color;
}
public static void main(String[] args) throws IOException {
Object[] objs = createImage();
BufferedImage image = (BufferedImage) objs[1];
OutputStream os = new FileOutputStream("d:/1.png");
ImageIO.write(image, "png", os);
os.close();
}
}
\ No newline at end of file
package com.zrqx.core.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
public class WeekEveryDay {
static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
public static String getTimeInterval(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
// 判断要计算的日期是否是周日,如果是则减一天计算周六的,否则会出问题,计算到下一周去了
int dayWeek = cal.get(Calendar.DAY_OF_WEEK);// 获得当前日期是一个星期的第几天
if (1 == dayWeek) {
cal.add(Calendar.DAY_OF_MONTH, -1);
}
// System.out.println("要计算日期为:" + sdf.format(cal.getTime())); // 输出要计算日期
// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一
cal.setFirstDayOfWeek(Calendar.MONDAY);
// 获得当前日期是一个星期的第几天
int day = cal.get(Calendar.DAY_OF_WEEK);
// 根据日历的规则,给当前日期减去星期几与一个星期第一天的差值
cal.add(Calendar.DATE, cal.getFirstDayOfWeek() - day);
String imptimeBegin = sdf.format(cal.getTime());
// System.out.println("所在周星期一的日期:" + imptimeBegin);
cal.add(Calendar.DATE, 6);
String imptimeEnd = sdf.format(cal.getTime());
// System.out.println("所在周星期日的日期:" + imptimeEnd);
return imptimeBegin + "," + imptimeEnd;
}
public String getLastTimeInterval() {
Calendar calendar1 = Calendar.getInstance();
Calendar calendar2 = Calendar.getInstance();
int dayOfWeek = calendar1.get(Calendar.DAY_OF_WEEK) - 1;
int offset1 = 1 - dayOfWeek;
int offset2 = 7 - dayOfWeek;
calendar1.add(Calendar.DATE, offset1 - 7);
calendar2.add(Calendar.DATE, offset2 - 7);
// System.out.println(sdf.format(calendar1.getTime()));// last Monday
String lastBeginDate = sdf.format(calendar1.getTime());
// System.out.println(sdf.format(calendar2.getTime()));// last Sunday
String lastEndDate = sdf.format(calendar2.getTime());
return lastBeginDate + "," + lastEndDate;
}
public static List<Date> findDates(Date dBegin, Date dEnd)
{
List lDate = new ArrayList();
lDate.add(dBegin);
Calendar calBegin = Calendar.getInstance();
// 使用给定的 Date 设置此 Calendar 的时间
calBegin.setTime(dBegin);
Calendar calEnd = Calendar.getInstance();
// 使用给定的 Date 设置此 Calendar 的时间
calEnd.setTime(dEnd);
// 测试此日期是否在指定日期之后
while (dEnd.after(calBegin.getTime()))
{
// 根据日历的规则,为给定的日历字段添加或减去指定的时间量
calBegin.add(Calendar.DAY_OF_MONTH, 1);
lDate.add(calBegin.getTime());
}
return lDate;
}
public static List<Date> weekDate() {
String yz_time = getTimeInterval(new Date());//获取本周时间
String array[]=yz_time.split(",");
String start_time=array[0];//本周第一天
String end_time=array[1]; //本周最后一天
//格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date dBegin = null;
try {
dBegin = sdf.parse(start_time);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Date dEnd = null;
try {
dEnd = sdf.parse(end_time);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
List<Date> SDate = findDates(dBegin, dEnd);//获取这周所有date
/* for (Date date : lDate)
{
System.out.println(sdf.format(date));
}*/
return SDate;
}
}
package com.zrqx.core.util.download;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLEncoder;
import javax.servlet.http.HttpServletResponse;
public class DownloadUtil {
/**
* 默认每次读取长度
*/
private static final int length = 2*1024;
/**
* 设置响应头,并把文件写入response
* @param response 响应对象
* @param file 要下载的文件
* @param fileName 下载后文件的名称
* @param length 每次读取长度
* @throws Exception
*/
public static void start(HttpServletResponse response,File file,String fileName,int length) throws Exception {
setResponse(response,file,fileName);
readWrite(response.getOutputStream(),file,length);
}
/**
* 设置响应头,并把文件写入response
* @param response 响应对象
* @param file 要下载的文件
* @param fileName 下载后文件的名称
* @throws Exception
*/
public static void start(HttpServletResponse response,File file,String fileName) throws Exception {
start(response,file,fileName,length);
}
/**
* 设置响应头,并把文件写入response
* @param response 响应对象
* @param filePath 要下载的文件路径
* @param fileName 下载后文件的名称
* @throws Exception
*/
public static void start(HttpServletResponse response,String filePath,String fileName) throws Exception {
start(response,new File(filePath),fileName,length);
}
/**
* 设置响应头,并把文件写入response
* @param response 响应对象
* @param file 要下载的文件
* @param fileName 下载后文件的名称
* @throws Exception
*/
public static void startOpen(HttpServletResponse response,String filePath) throws Exception {
startOpen(response,new File(filePath));
}
/**
* 设置响应头,并把文件写入response
* @param response 响应对象
* @param filePath 要下载的文件路径
* @param fileName 下载后文件的名称
* @throws Exception
*/
public static void startOpen(HttpServletResponse response,File file) throws Exception {
setOpenResponse(response,file);
readWrite(response.getOutputStream(),file,length);
}
/**
* 设置响应头
* @param response 响应对象
* @param file 要下载的文件
* @param fileName 下载后文件的名称
* @throws Exception
*/
public static void setResponse(HttpServletResponse response,File file,String fileName) throws Exception {
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
}
/**
* 设置响应头
* @param response 响应对象
* @param file 要打开的文件
* @throws Exception
*/
public static void setOpenResponse(HttpServletResponse response,File file) throws Exception {
URL u = new URL("file:///" + file.getPath());
response.setContentType(u.openConnection().getContentType());
response.setHeader("Content-Disposition", "inline; filename=" + file.getName());
}
/**
* 设置响应头
* @param response 响应对象
* @param filePath 要下载的文件路径
* @param fileName 下载后文件的名称
* @throws Exception
*/
public static void setResponse(HttpServletResponse response,String filePath,String fileName) throws Exception {
setResponse(response,new File(filePath),fileName);
}
/**
* 读写文件
* @param out 文件输出流
* @param file 要读取的文件
*/
public static void readWrite(OutputStream out, File file) {
readWrite(out, file,length);
}
/**
* 读写文件
* @param out 文件输出流
* @param file 要读取的文件
* @param length 每次读取长度
*/
public static void readWrite(OutputStream out, File file,int length) {
byte[] buffer = new byte[length];
FileInputStream fis = null;
BufferedInputStream bis = null;
try {
fis = new FileInputStream(file);
// 文件输入流
bis = new BufferedInputStream(fis);
// 输出流
while (-1 != bis.read(buffer)) {
out.write(buffer);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (null != fis)
fis.close();
if (null != bis)
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
package com.zrqx.core.util.erweima;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Hashtable;
import javax.imageio.ImageIO;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.EncodeHintType;
import com.google.zxing.LuminanceSource;
import com.google.zxing.ReaderException;
import com.google.zxing.Result;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.qrcode.QRCodeReader;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
/**
* 二维码生成和读的工具类
*
*/
public class QrCodeCreateUtil {
private static String TYPE = "JPEG";
private static int SIZE = 300;
/**
* 生成包含字符串信息的二维码图片
*
* @param outputStream
* 文件输出流路径
* @param content
* 二维码携带信息
* @param qrCodeSize
* 二维码图片大小
* @param imageFormat
* 二维码的格式
* @throws WriterException
* @throws IOException
*/
public static boolean createQrCode(OutputStream outputStream, String content, int qrCodeSize, String imageFormat)
throws WriterException, IOException {
if(qrCodeSize < 130){
qrCodeSize = 130;
}
// 设置二维码纠错级别MAP
Hashtable<EncodeHintType, ErrorCorrectionLevel> hintMap = new Hashtable<EncodeHintType, ErrorCorrectionLevel>();
hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L); // 矫错级别
QRCodeWriter qrCodeWriter = new QRCodeWriter();
// 创建比特矩阵(位矩阵)的QR码编码的字符串
BitMatrix byteMatrix = qrCodeWriter.encode(content, BarcodeFormat.QR_CODE, qrCodeSize, qrCodeSize, hintMap);
// 使BufferedImage勾画QRCode (matrixWidth 是行二维码像素点)
int matrixWidth = byteMatrix.getWidth();
BufferedImage image = new BufferedImage(matrixWidth - 50, matrixWidth - 50, BufferedImage.TYPE_INT_RGB);
image.createGraphics();
Graphics2D graphics = (Graphics2D) image.getGraphics();
graphics.setColor(Color.WHITE);
graphics.fillRect(0, 0, matrixWidth, matrixWidth);
// 使用比特矩阵画并保存图像
graphics.setColor(Color.BLACK);
for (int i = 0; i < matrixWidth; i++) {
for (int j = 0; j < matrixWidth; j++) {
if (byteMatrix.get(i, j)) {
graphics.fillRect(i-25, j-25, 1, 1);
}
}
}
boolean flag = ImageIO.write(image, imageFormat, outputStream);
outputStream.close();
return flag;
}
/**
* 生成包含字符串信息的二维码图片
*
* @param outputStream
* 文件输出流路径
* @param content
* 二维码携带信息
* @param qrCodeSize
* 二维码图片大小
* @throws WriterException
* @throws IOException
*/
public static boolean createQrCode(OutputStream outputStream, String content, int qrCodeSize)
throws WriterException, IOException {
return createQrCode(outputStream, content, qrCodeSize, TYPE);
}
/**
* 生成包含字符串信息的二维码图片
*
* @param outputStream
* 文件输出流路径
* @param content
* 二维码携带信息
* @param imageFormat
* 二维码的格式
* @throws WriterException
* @throws IOException
*/
public static boolean createQrCode(OutputStream outputStream, String content, String imageFormat)
throws WriterException, IOException {
return createQrCode(outputStream, content, SIZE, imageFormat);
}
/**
* 生成包含字符串信息的二维码图片
*
* @param outputStream
* 文件输出流路径
* @param content
* 二维码携带信息
* @throws WriterException
* @throws IOException
*/
public static boolean createQrCode(OutputStream outputStream, String content) throws WriterException, IOException {
return createQrCode(outputStream, content, SIZE, TYPE);
}
/**
* 生成包含字符串信息的二维码图片
*
* @param filePath
* 文件输出路径
* @param content
* 二维码携带信息
* @throws WriterException
* @throws IOException
*/
public static boolean createQrCode(String filePath, String content) throws WriterException, IOException {
return createQrCode(new FileOutputStream(new File(filePath)), content, SIZE, TYPE);
}
/**
* 生成包含字符串信息的二维码图片
*
* @param file
* 文件
* @param content
* 二维码携带信息
* @throws WriterException
* @throws IOException
*/
public static boolean createQrCode(File file, String content) throws WriterException, IOException {
return createQrCode(new FileOutputStream(file), content, SIZE, TYPE);
}
/**
* 读二维码并输出携带的信息
*/
public static String readQrCode(InputStream inputStream) throws IOException {
// 从输入流中获取字符串信息
BufferedImage image = ImageIO.read(inputStream);
// 将图像转换为二进制位图源
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
QRCodeReader reader = new QRCodeReader();
Result result = null;
try {
result = reader.decode(bitmap);
return result.getText();
} catch (ReaderException e) {
e.printStackTrace();
}
return null;
}
/**
* 测试代码
*
* @throws WriterException
*/
public static void main(String[] args) throws IOException, WriterException {
createQrCode(new FileOutputStream(new File("d:\\qrcode.jpg")), "WE11111111111111111111111111111111111111111111");
readQrCode(new FileInputStream(new File("d:\\qrcode.jpg")));
}
}
\ No newline at end of file
package com.zrqx.core.util.excelutil;
public class ExcelHeader implements Comparable<ExcelHeader>{
/**
* excel的标题名称
*/
private String title;
/**
* 每一个标题的顺序
*/
private int order;
/**
* 说对应方法名称
*/
private String methodName;
/**
* date格式
*/
private String dateFmt;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getOrder() {
return order;
}
public void setOrder(int order) {
this.order = order;
}
public String getMethodName() {
return methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
}
public String getDateFmt() {
return dateFmt;
}
public void setDateFmt(String dateFmt) {
this.dateFmt = dateFmt;
}
public int compareTo(ExcelHeader o) {
return order>o.order?1:(order<o.order?-1:0);
}
public ExcelHeader(String title, int order, String methodName, String dateFmt) {
super();
this.title = title;
this.order = order;
this.methodName = methodName;
this.dateFmt = dateFmt;
}
}
\ No newline at end of file
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论