Compare commits
37 Commits
Author | SHA1 | Date |
---|---|---|
|
8e5782e8bc | |
|
35fd16ad12 | |
|
6e70e3f721 | |
|
96123ae891 | |
|
16f5b95e1f | |
|
f6013d0f82 | |
|
dc00a1d299 | |
|
24e91550db | |
|
43546c4749 | |
|
82ae994601 | |
|
88865776cd | |
|
37486c58c4 | |
|
0994a54363 | |
|
8a7e779783 | |
|
4e4d7c2f82 | |
|
e39c5cb11c | |
|
9ae19e1144 | |
|
79f2041468 | |
|
35f694f7b2 | |
|
7f05431f41 | |
|
6ab4dbf279 | |
|
e9de4fbd3b | |
|
c64f4eddc6 | |
|
b78a8cab1b | |
|
7336085f6b | |
|
bf6cbc41a2 | |
|
46bbf326c4 | |
|
aa7127a66b | |
|
0de8218ea0 | |
|
1cc1af4cd9 | |
|
89903d759c | |
|
af333df7cb | |
|
8fbb00151b | |
|
abe99dccce | |
|
6de8bc74b8 | |
|
830dc64d08 | |
|
92595bf769 |
|
@ -19,7 +19,6 @@ out
|
||||||
.project
|
.project
|
||||||
.settings
|
.settings
|
||||||
.springBeans
|
.springBeans
|
||||||
*.yml
|
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
### IntelliJ IDEA ###
|
||||||
.idea
|
.idea
|
||||||
|
|
|
@ -21,9 +21,9 @@ public class SysPasswordService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
private int maxRetryCount = CacheConstants.PASSWORD_MAX_RETRY_COUNT;
|
private final int maxRetryCount = CacheConstants.PASSWORD_MAX_RETRY_COUNT;
|
||||||
|
|
||||||
private Long lockTime = CacheConstants.PASSWORD_LOCK_TIME;
|
private final Long lockTime = CacheConstants.PASSWORD_LOCK_TIME;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRecordLogService recordLogService;
|
private SysRecordLogService recordLogService;
|
||||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
||||||
addr: 47.101.53.251:8848
|
addr: 47.101.53.251:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: four
|
namespace: lgy
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
|
|
|
@ -21,134 +21,134 @@ public @interface Excel {
|
||||||
/**
|
/**
|
||||||
* 导出时在excel中排序
|
* 导出时在excel中排序
|
||||||
*/
|
*/
|
||||||
public int sort () default Integer.MAX_VALUE;
|
int sort() default Integer.MAX_VALUE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出到Excel中的名字.
|
* 导出到Excel中的名字.
|
||||||
*/
|
*/
|
||||||
public String name () default "";
|
String name() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期格式, 如: yyyy-MM-dd
|
* 日期格式, 如: yyyy-MM-dd
|
||||||
*/
|
*/
|
||||||
public String dateFormat () default "";
|
String dateFormat() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读取内容转表达式 (如: 0=男,1=女,2=未知)
|
* 读取内容转表达式 (如: 0=男,1=女,2=未知)
|
||||||
*/
|
*/
|
||||||
public String readConverterExp () default "";
|
String readConverterExp() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分隔符,读取字符串组内容
|
* 分隔符,读取字符串组内容
|
||||||
*/
|
*/
|
||||||
public String separator () default ",";
|
String separator() default ",";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
|
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
|
||||||
*/
|
*/
|
||||||
public int scale () default -1;
|
int scale() default -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
||||||
*/
|
*/
|
||||||
public int roundingMode () default BigDecimal.ROUND_HALF_EVEN;
|
int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出时在excel中每个列的高度
|
* 导出时在excel中每个列的高度
|
||||||
*/
|
*/
|
||||||
public double height () default 14;
|
double height() default 14;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出时在excel中每个列的宽度
|
* 导出时在excel中每个列的宽度
|
||||||
*/
|
*/
|
||||||
public double width () default 16;
|
double width() default 16;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文字后缀,如% 90 变成90%
|
* 文字后缀,如% 90 变成90%
|
||||||
*/
|
*/
|
||||||
public String suffix () default "";
|
String suffix() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当值为空时,字段的默认值
|
* 当值为空时,字段的默认值
|
||||||
*/
|
*/
|
||||||
public String defaultValue () default "";
|
String defaultValue() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提示信息
|
* 提示信息
|
||||||
*/
|
*/
|
||||||
public String prompt () default "";
|
String prompt() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置只能选择不能输入的列内容.
|
* 设置只能选择不能输入的列内容.
|
||||||
*/
|
*/
|
||||||
public String[] combo () default {};
|
String[] combo() default {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否需要纵向合并单元格,应对需求:含有list集合单元格)
|
* 是否需要纵向合并单元格,应对需求:含有list集合单元格)
|
||||||
*/
|
*/
|
||||||
public boolean needMerge () default false;
|
boolean needMerge() default false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
||||||
*/
|
*/
|
||||||
public boolean isExport () default true;
|
boolean isExport() default true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 另一个类中的属性名称,支持多级获取,以小数点隔开
|
* 另一个类中的属性名称,支持多级获取,以小数点隔开
|
||||||
*/
|
*/
|
||||||
public String targetAttr () default "";
|
String targetAttr() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否自动统计数据,在最后追加一行统计数据总和
|
* 是否自动统计数据,在最后追加一行统计数据总和
|
||||||
*/
|
*/
|
||||||
public boolean isStatistics () default false;
|
boolean isStatistics() default false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出类型(0数字 1字符串)
|
* 导出类型(0数字 1字符串)
|
||||||
*/
|
*/
|
||||||
public ColumnType cellType () default ColumnType.STRING;
|
ColumnType cellType() default ColumnType.STRING;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出列头背景颜色
|
* 导出列头背景颜色
|
||||||
*/
|
*/
|
||||||
public IndexedColors headerBackgroundColor () default IndexedColors.GREY_50_PERCENT;
|
IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出列头字体颜色
|
* 导出列头字体颜色
|
||||||
*/
|
*/
|
||||||
public IndexedColors headerColor () default IndexedColors.WHITE;
|
IndexedColors headerColor() default IndexedColors.WHITE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出单元格背景颜色
|
* 导出单元格背景颜色
|
||||||
*/
|
*/
|
||||||
public IndexedColors backgroundColor () default IndexedColors.WHITE;
|
IndexedColors backgroundColor() default IndexedColors.WHITE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出单元格字体颜色
|
* 导出单元格字体颜色
|
||||||
*/
|
*/
|
||||||
public IndexedColors color () default IndexedColors.BLACK;
|
IndexedColors color() default IndexedColors.BLACK;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出字段对齐方式
|
* 导出字段对齐方式
|
||||||
*/
|
*/
|
||||||
public HorizontalAlignment align () default HorizontalAlignment.CENTER;
|
HorizontalAlignment align() default HorizontalAlignment.CENTER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义数据处理器
|
* 自定义数据处理器
|
||||||
*/
|
*/
|
||||||
public Class<?> handler () default ExcelHandlerAdapter.class;
|
Class<?> handler() default ExcelHandlerAdapter.class;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义数据处理器参数
|
* 自定义数据处理器参数
|
||||||
*/
|
*/
|
||||||
public String[] args () default {};
|
String[] args() default {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
||||||
*/
|
*/
|
||||||
Type type () default Type.ALL;
|
Type type () default Type.ALL;
|
||||||
|
|
||||||
public enum Type {
|
enum Type {
|
||||||
ALL(0), EXPORT(1), IMPORT(2);
|
ALL(0), EXPORT(1), IMPORT(2);
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ public @interface Excel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ColumnType {
|
enum ColumnType {
|
||||||
NUMERIC(0), STRING(1), IMAGE(2);
|
NUMERIC(0), STRING(1), IMAGE(2);
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
|
|
|
@ -43,9 +43,9 @@ public class ScheduleConstants {
|
||||||
*/
|
*/
|
||||||
PAUSE("1");
|
PAUSE("1");
|
||||||
|
|
||||||
private String value;
|
private final String value;
|
||||||
|
|
||||||
private Status (String value) {
|
Status(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,22 +11,22 @@ public class BaseException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* 所属模块
|
* 所属模块
|
||||||
*/
|
*/
|
||||||
private String module;
|
private final String module;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误码
|
* 错误码
|
||||||
*/
|
*/
|
||||||
private String code;
|
private final String code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误码对应的参数
|
* 错误码对应的参数
|
||||||
*/
|
*/
|
||||||
private Object[] args;
|
private final Object[] args;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误消息
|
* 错误消息
|
||||||
*/
|
*/
|
||||||
private String defaultMessage;
|
private final String defaultMessage;
|
||||||
|
|
||||||
public BaseException (String module, String code, Object[] args, String defaultMessage) {
|
public BaseException (String module, String code, Object[] args, String defaultMessage) {
|
||||||
this.module = module;
|
this.module = module;
|
||||||
|
|
|
@ -10,9 +10,9 @@ import java.util.Arrays;
|
||||||
public class InvalidExtensionException extends FileUploadException {
|
public class InvalidExtensionException extends FileUploadException {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private String[] allowedExtension;
|
private final String[] allowedExtension;
|
||||||
private String extension;
|
private final String extension;
|
||||||
private String filename;
|
private final String filename;
|
||||||
|
|
||||||
public InvalidExtensionException (String[] allowedExtension, String extension, String filename) {
|
public InvalidExtensionException (String[] allowedExtension, String extension, String filename) {
|
||||||
super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]");
|
super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]");
|
||||||
|
|
|
@ -8,7 +8,7 @@ package com.muyu.common.core.exception.job;
|
||||||
public class TaskException extends Exception {
|
public class TaskException extends Exception {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Code code;
|
private final Code code;
|
||||||
|
|
||||||
public TaskException (String msg, Code code) {
|
public TaskException (String msg, Code code) {
|
||||||
this(msg, code, null);
|
this(msg, code, null);
|
||||||
|
|
|
@ -27,11 +27,11 @@ public class CharsetKit {
|
||||||
/**
|
/**
|
||||||
* ISO-8859-1
|
* ISO-8859-1
|
||||||
*/
|
*/
|
||||||
public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
|
public static final Charset CHARSET_ISO_8859_1 = StandardCharsets.ISO_8859_1;
|
||||||
/**
|
/**
|
||||||
* UTF-8
|
* UTF-8
|
||||||
*/
|
*/
|
||||||
public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
|
public static final Charset CHARSET_UTF_8 = StandardCharsets.UTF_8;
|
||||||
/**
|
/**
|
||||||
* GBK
|
* GBK
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||||
|
|
||||||
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
|
||||||
private static String[] parsePatterns = {
|
private static final String[] parsePatterns = {
|
||||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||||
|
|
|
@ -211,11 +211,7 @@ public class ServletUtils {
|
||||||
* @return 编码后的内容
|
* @return 编码后的内容
|
||||||
*/
|
*/
|
||||||
public static String urlEncode (String str) {
|
public static String urlEncode (String str) {
|
||||||
try {
|
return URLEncoder.encode(str, StandardCharsets.UTF_8);
|
||||||
return URLEncoder.encode(str, Constants.UTF8);
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
return StringUtils.EMPTY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -43,7 +43,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor {
|
||||||
* @throws org.springframework.beans.BeansException
|
* @throws org.springframework.beans.BeansException
|
||||||
*/
|
*/
|
||||||
public static <T> T getBean (Class<T> clz) throws BeansException {
|
public static <T> T getBean (Class<T> clz) throws BeansException {
|
||||||
T result = (T) beanFactory.getBean(clz);
|
T result = beanFactory.getBean(clz);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,17 +125,17 @@ public class FileUtils {
|
||||||
String filename = fileName;
|
String filename = fileName;
|
||||||
if (agent.contains("MSIE")) {
|
if (agent.contains("MSIE")) {
|
||||||
// IE浏览器
|
// IE浏览器
|
||||||
filename = URLEncoder.encode(filename, "utf-8");
|
filename = URLEncoder.encode(filename, StandardCharsets.UTF_8);
|
||||||
filename = filename.replace("+", " ");
|
filename = filename.replace("+", " ");
|
||||||
} else if (agent.contains("Firefox")) {
|
} else if (agent.contains("Firefox")) {
|
||||||
// 火狐浏览器
|
// 火狐浏览器
|
||||||
filename = new String(fileName.getBytes(), "ISO8859-1");
|
filename = new String(fileName.getBytes(), "ISO8859-1");
|
||||||
} else if (agent.contains("Chrome")) {
|
} else if (agent.contains("Chrome")) {
|
||||||
// google浏览器
|
// google浏览器
|
||||||
filename = URLEncoder.encode(filename, "utf-8");
|
filename = URLEncoder.encode(filename, StandardCharsets.UTF_8);
|
||||||
} else {
|
} else {
|
||||||
// 其它浏览器
|
// 其它浏览器
|
||||||
filename = URLEncoder.encode(filename, "utf-8");
|
filename = URLEncoder.encode(filename, StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
@ -197,15 +197,14 @@ public class FileUtils {
|
||||||
public static void setAttachmentResponseHeader (HttpServletResponse response, String realFileName) throws UnsupportedEncodingException {
|
public static void setAttachmentResponseHeader (HttpServletResponse response, String realFileName) throws UnsupportedEncodingException {
|
||||||
String percentEncodedFileName = percentEncode(realFileName);
|
String percentEncodedFileName = percentEncode(realFileName);
|
||||||
|
|
||||||
StringBuilder contentDispositionValue = new StringBuilder();
|
String contentDispositionValue = "attachment; filename=" +
|
||||||
contentDispositionValue.append("attachment; filename=")
|
percentEncodedFileName +
|
||||||
.append(percentEncodedFileName)
|
";" +
|
||||||
.append(";")
|
"filename*=" +
|
||||||
.append("filename*=")
|
"utf-8''" +
|
||||||
.append("utf-8''")
|
percentEncodedFileName;
|
||||||
.append(percentEncodedFileName);
|
|
||||||
|
|
||||||
response.setHeader("Content-disposition", contentDispositionValue.toString());
|
response.setHeader("Content-disposition", contentDispositionValue);
|
||||||
response.setHeader("download-filename", percentEncodedFileName);
|
response.setHeader("download-filename", percentEncodedFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +216,7 @@ public class FileUtils {
|
||||||
* @return 百分号编码后的字符串
|
* @return 百分号编码后的字符串
|
||||||
*/
|
*/
|
||||||
public static String percentEncode (String s) throws UnsupportedEncodingException {
|
public static String percentEncode (String s) throws UnsupportedEncodingException {
|
||||||
String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
|
String encode = URLEncoder.encode(s, StandardCharsets.UTF_8);
|
||||||
return encode.replaceAll("\\+", "%20");
|
return encode.replaceAll("\\+", "%20");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class EscapeUtil {
|
||||||
tmp.append(content.substring(lastPos));
|
tmp.append(content.substring(lastPos));
|
||||||
lastPos = content.length();
|
lastPos = content.length();
|
||||||
} else {
|
} else {
|
||||||
tmp.append(content.substring(lastPos, pos));
|
tmp.append(content, lastPos, pos);
|
||||||
lastPos = pos;
|
lastPos = pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,7 +225,7 @@ public class IpUtils {
|
||||||
if (ip != null && ip.indexOf(",") > 0) {
|
if (ip != null && ip.indexOf(",") > 0) {
|
||||||
final String[] ips = ip.trim().split(",");
|
final String[] ips = ip.trim().split(",");
|
||||||
for (String subIp : ips) {
|
for (String subIp : ips) {
|
||||||
if (false == isUnknown(subIp)) {
|
if (!isUnknown(subIp)) {
|
||||||
ip = subIp;
|
ip = subIp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class ExcelUtil<T> {
|
||||||
/**
|
/**
|
||||||
* 统计列表
|
* 统计列表
|
||||||
*/
|
*/
|
||||||
private Map<Integer, Double> statistics = new HashMap<Integer, Double>();
|
private final Map<Integer, Double> statistics = new HashMap<Integer, Double>();
|
||||||
|
|
||||||
public ExcelUtil (Class<T> clazz) {
|
public ExcelUtil (Class<T> clazz) {
|
||||||
this.clazz = clazz;
|
this.clazz = clazz;
|
||||||
|
@ -531,7 +531,7 @@ public class ExcelUtil<T> {
|
||||||
rowNo = isSubList() ? (i > 1 ? rowNo + 1 : rowNo + i) : i + 1 + rownum - startNo;
|
rowNo = isSubList() ? (i > 1 ? rowNo + 1 : rowNo + i) : i + 1 + rownum - startNo;
|
||||||
row = sheet.createRow(rowNo);
|
row = sheet.createRow(rowNo);
|
||||||
// 得到导出对象.
|
// 得到导出对象.
|
||||||
T vo = (T) list.get(i);
|
T vo = list.get(i);
|
||||||
Collection<?> subList = null;
|
Collection<?> subList = null;
|
||||||
if (isSubList()) {
|
if (isSubList()) {
|
||||||
if (isSubListValue(vo)) {
|
if (isSubListValue(vo)) {
|
||||||
|
@ -913,7 +913,7 @@ public class ExcelUtil<T> {
|
||||||
public String dataFormatHandlerAdapter (Object value, Excel excel, Cell cell) {
|
public String dataFormatHandlerAdapter (Object value, Excel excel, Cell cell) {
|
||||||
try {
|
try {
|
||||||
Object instance = excel.handler().newInstance();
|
Object instance = excel.handler().newInstance();
|
||||||
Method formatMethod = excel.handler().getMethod("format", new Class[]{Object.class, String[].class, Cell.class, Workbook.class});
|
Method formatMethod = excel.handler().getMethod("format", Object.class, String[].class, Cell.class, Workbook.class);
|
||||||
value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb);
|
value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("不能格式化数据 " + excel.handler(), e.getMessage());
|
log.error("不能格式化数据 " + excel.handler(), e.getMessage());
|
||||||
|
@ -1200,7 +1200,7 @@ public class ExcelUtil<T> {
|
||||||
public Collection<?> getListCellValue (Object obj) {
|
public Collection<?> getListCellValue (Object obj) {
|
||||||
Object value;
|
Object value;
|
||||||
try {
|
try {
|
||||||
value = subMethod.invoke(obj, new Object[]{});
|
value = subMethod.invoke(obj);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return new ArrayList<Object>();
|
return new ArrayList<Object>();
|
||||||
}
|
}
|
||||||
|
@ -1221,7 +1221,7 @@ public class ExcelUtil<T> {
|
||||||
getMethodName.append(name.substring(1));
|
getMethodName.append(name.substring(1));
|
||||||
Method method = null;
|
Method method = null;
|
||||||
try {
|
try {
|
||||||
method = pojoClass.getMethod(getMethodName.toString(), new Class[]{});
|
method = pojoClass.getMethod(getMethodName.toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("获取对象异常{}", e.getMessage());
|
log.error("获取对象异常{}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class ReflectUtils {
|
||||||
|
|
||||||
private static final String CGLIB_CLASS_SEPARATOR = "$$";
|
private static final String CGLIB_CLASS_SEPARATOR = "$$";
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class);
|
private static final Logger logger = LoggerFactory.getLogger(ReflectUtils.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调用Getter方法.
|
* 调用Getter方法.
|
||||||
|
@ -113,7 +113,7 @@ public class ReflectUtils {
|
||||||
try {
|
try {
|
||||||
return (E) method.invoke(obj, args);
|
return (E) method.invoke(obj, args);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = "method: " + method + ", obj: " + obj + ", args: " + args + "";
|
String msg = "method: " + method + ", obj: " + obj + ", args: " + args;
|
||||||
throw convertReflectionExceptionToUnchecked(msg, e);
|
throw convertReflectionExceptionToUnchecked(msg, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ public class ReflectUtils {
|
||||||
}
|
}
|
||||||
return (E) method.invoke(obj, args);
|
return (E) method.invoke(obj, args);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = "method: " + method + ", obj: " + obj + ", args: " + args + "";
|
String msg = "method: " + method + ", obj: " + obj + ", args: " + args;
|
||||||
throw convertReflectionExceptionToUnchecked(msg, e);
|
throw convertReflectionExceptionToUnchecked(msg, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,8 @@ public final class Base64 {
|
||||||
for (int i = 52, j = 0 ; i <= 61 ; i++, j++) {
|
for (int i = 52, j = 0 ; i <= 61 ; i++, j++) {
|
||||||
lookUpBase64Alphabet[i] = (char) ('0' + j);
|
lookUpBase64Alphabet[i] = (char) ('0' + j);
|
||||||
}
|
}
|
||||||
lookUpBase64Alphabet[62] = (char) '+';
|
lookUpBase64Alphabet[62] = '+';
|
||||||
lookUpBase64Alphabet[63] = (char) '/';
|
lookUpBase64Alphabet[63] = '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isWhiteSpace (char octect) {
|
private static boolean isWhiteSpace (char octect) {
|
||||||
|
@ -82,7 +82,7 @@ public final class Base64 {
|
||||||
int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
|
int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
|
||||||
int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
|
int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
|
||||||
int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
|
int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
|
||||||
char encodedData[] = null;
|
char[] encodedData = null;
|
||||||
|
|
||||||
encodedData = new char[numberQuartet * 4];
|
encodedData = new char[numberQuartet * 4];
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ public final class Base64 {
|
||||||
return new byte[0];
|
return new byte[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
byte decodedData[] = null;
|
byte[] decodedData = null;
|
||||||
byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
|
byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
|
||||||
char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
|
char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,9 @@ public class Seq {
|
||||||
// 机器标识
|
// 机器标识
|
||||||
private static final String machineCode = "A";
|
private static final String machineCode = "A";
|
||||||
// 通用接口序列数
|
// 通用接口序列数
|
||||||
private static AtomicInteger commSeq = new AtomicInteger(1);
|
private static final AtomicInteger commSeq = new AtomicInteger(1);
|
||||||
// 上传接口序列数
|
// 上传接口序列数
|
||||||
private static AtomicInteger uploadSeq = new AtomicInteger(1);
|
private static final AtomicInteger uploadSeq = new AtomicInteger(1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取通用序列号
|
* 获取通用序列号
|
||||||
|
|
|
@ -353,22 +353,22 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
|
||||||
final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36);
|
final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36);
|
||||||
// time_low
|
// time_low
|
||||||
builder.append(digits(mostSigBits >> 32, 8));
|
builder.append(digits(mostSigBits >> 32, 8));
|
||||||
if (false == isSimple) {
|
if (!isSimple) {
|
||||||
builder.append('-');
|
builder.append('-');
|
||||||
}
|
}
|
||||||
// time_mid
|
// time_mid
|
||||||
builder.append(digits(mostSigBits >> 16, 4));
|
builder.append(digits(mostSigBits >> 16, 4));
|
||||||
if (false == isSimple) {
|
if (!isSimple) {
|
||||||
builder.append('-');
|
builder.append('-');
|
||||||
}
|
}
|
||||||
// time_high_and_version
|
// time_high_and_version
|
||||||
builder.append(digits(mostSigBits, 4));
|
builder.append(digits(mostSigBits, 4));
|
||||||
if (false == isSimple) {
|
if (!isSimple) {
|
||||||
builder.append('-');
|
builder.append('-');
|
||||||
}
|
}
|
||||||
// variant_and_sequence
|
// variant_and_sequence
|
||||||
builder.append(digits(leastSigBits >> 48, 4));
|
builder.append(digits(leastSigBits >> 48, 4));
|
||||||
if (false == isSimple) {
|
if (!isSimple) {
|
||||||
builder.append('-');
|
builder.append('-');
|
||||||
}
|
}
|
||||||
// node
|
// node
|
||||||
|
|
|
@ -14,15 +14,15 @@ public @interface DataScope {
|
||||||
/**
|
/**
|
||||||
* 部门表的别名
|
* 部门表的别名
|
||||||
*/
|
*/
|
||||||
public String deptAlias () default "";
|
String deptAlias() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户表的别名
|
* 用户表的别名
|
||||||
*/
|
*/
|
||||||
public String userAlias () default "";
|
String userAlias() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@RequiresPermissions获取,多个权限用逗号分隔开来
|
* 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@RequiresPermissions获取,多个权限用逗号分隔开来
|
||||||
*/
|
*/
|
||||||
public String permission () default "";
|
String permission() default "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,8 +109,7 @@ public class DataScopeAspect {
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(sqlString.toString())) {
|
if (StringUtils.isNotBlank(sqlString.toString())) {
|
||||||
Object params = joinPoint.getArgs()[0];
|
Object params = joinPoint.getArgs()[0];
|
||||||
if (StringUtils.isNotNull(params) && params instanceof BaseEntity) {
|
if (StringUtils.isNotNull(params) && params instanceof BaseEntity baseEntity) {
|
||||||
BaseEntity baseEntity = (BaseEntity) params;
|
|
||||||
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
|
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,8 +140,7 @@ public class DataScopeAspect {
|
||||||
*/
|
*/
|
||||||
private void clearDataScope (final JoinPoint joinPoint) {
|
private void clearDataScope (final JoinPoint joinPoint) {
|
||||||
Object params = joinPoint.getArgs()[0];
|
Object params = joinPoint.getArgs()[0];
|
||||||
if (StringUtils.isNotNull(params) && params instanceof BaseEntity) {
|
if (StringUtils.isNotNull(params) && params instanceof BaseEntity baseEntity) {
|
||||||
BaseEntity baseEntity = (BaseEntity) params;
|
|
||||||
baseEntity.getParams().put(DATA_SCOPE, "");
|
baseEntity.getParams().put(DATA_SCOPE, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,30 +17,30 @@ public @interface Log {
|
||||||
/**
|
/**
|
||||||
* 模块
|
* 模块
|
||||||
*/
|
*/
|
||||||
public String title () default "";
|
String title() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能
|
* 功能
|
||||||
*/
|
*/
|
||||||
public BusinessType businessType () default BusinessType.OTHER;
|
BusinessType businessType() default BusinessType.OTHER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作人类别
|
* 操作人类别
|
||||||
*/
|
*/
|
||||||
public OperatorType operatorType () default OperatorType.MANAGE;
|
OperatorType operatorType() default OperatorType.MANAGE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否保存请求的参数
|
* 是否保存请求的参数
|
||||||
*/
|
*/
|
||||||
public boolean isSaveRequestData () default true;
|
boolean isSaveRequestData() default true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否保存响应的参数
|
* 是否保存响应的参数
|
||||||
*/
|
*/
|
||||||
public boolean isSaveResponseData () default true;
|
boolean isSaveResponseData() default true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排除指定的请求参数
|
* 排除指定的请求参数
|
||||||
*/
|
*/
|
||||||
public String[] excludeParamNames () default {};
|
String[] excludeParamNames() default {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,12 +169,12 @@ public class LogAspect {
|
||||||
*/
|
*/
|
||||||
private String argsArrayToString (Object[] paramsArray, String[] excludeParamNames) {
|
private String argsArrayToString (Object[] paramsArray, String[] excludeParamNames) {
|
||||||
String params = "";
|
String params = "";
|
||||||
if (paramsArray != null && paramsArray.length > 0) {
|
if (paramsArray != null) {
|
||||||
for (Object o : paramsArray) {
|
for (Object o : paramsArray) {
|
||||||
if (StringUtils.isNotNull(o) && !isFilterObject(o)) {
|
if (StringUtils.isNotNull(o) && !isFilterObject(o)) {
|
||||||
try {
|
try {
|
||||||
String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter(excludeParamNames));
|
String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter(excludeParamNames));
|
||||||
params += jsonObj.toString() + " ";
|
params += jsonObj + " ";
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T> {
|
||||||
|
|
||||||
static final Filter AUTO_TYPE_FILTER = JSONReader.autoTypeFilter(Constants.JSON_WHITELIST_STR);
|
static final Filter AUTO_TYPE_FILTER = JSONReader.autoTypeFilter(Constants.JSON_WHITELIST_STR);
|
||||||
|
|
||||||
private Class<T> clazz;
|
private final Class<T> clazz;
|
||||||
|
|
||||||
public FastJson2JsonRedisSerializer (Class<T> clazz) {
|
public FastJson2JsonRedisSerializer (Class<T> clazz) {
|
||||||
super();
|
super();
|
||||||
|
|
|
@ -29,8 +29,10 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-common-security</artifactId>
|
<artifactId>cloud-common-security</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -6,17 +6,20 @@ import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
|
||||||
import com.muyu.cloud.common.many.datasource.constents.DatasourceContent;
|
import com.muyu.cloud.common.many.datasource.constents.DatasourceContent;
|
||||||
import com.muyu.cloud.common.many.datasource.domain.model.DataSourceInfo;
|
import com.muyu.cloud.common.many.datasource.domain.model.DataSourceInfo;
|
||||||
import com.muyu.cloud.common.many.datasource.factory.DruidDataSourceFactory;
|
import com.muyu.cloud.common.many.datasource.factory.DruidDataSourceFactory;
|
||||||
|
import com.muyu.cloud.common.many.datasource.init.InitDataSource;
|
||||||
import com.muyu.cloud.common.many.datasource.role.DynamicDataSource;
|
import com.muyu.cloud.common.many.datasource.role.DynamicDataSource;
|
||||||
|
import com.muyu.cloud.common.saas.domain.Datasource;
|
||||||
import com.muyu.cloud.common.saas.domain.model.EntInfo;
|
import com.muyu.cloud.common.saas.domain.model.EntInfo;
|
||||||
import com.muyu.cloud.common.saas.exception.SaaSException;
|
import com.muyu.cloud.common.saas.exception.SaaSException;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.utils.SpringUtils;
|
import com.muyu.common.core.utils.SpringUtils;
|
||||||
import com.muyu.common.system.domain.Datasource;
|
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.common.system.remote.RemoteSaaSService;
|
import com.muyu.common.system.remote.RemoteSaaSService;
|
||||||
import com.muyu.common.system.remote.RemoteUserService;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration;
|
import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.ApplicationArguments;
|
import org.springframework.boot.ApplicationArguments;
|
||||||
import org.springframework.boot.ApplicationRunner;
|
import org.springframework.boot.ApplicationRunner;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
|
@ -38,9 +41,14 @@ import java.util.Map;
|
||||||
@Component
|
@Component
|
||||||
@AutoConfiguration(before = {MybatisPlusAutoConfiguration.class, MybatisAutoConfiguration.class})
|
@AutoConfiguration(before = {MybatisPlusAutoConfiguration.class, MybatisAutoConfiguration.class})
|
||||||
public class ManyDataSource implements ApplicationRunner{
|
public class ManyDataSource implements ApplicationRunner{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InitDataSource initDataSource;
|
||||||
|
|
||||||
|
|
||||||
private List<EntInfo> dataSourceInfoList(){
|
private List<EntInfo> dataSourceInfoList(){
|
||||||
RemoteSaaSService remoteSaaSService = SpringUtils.getBean(RemoteSaaSService.class);
|
RemoteSaaSService remoteSaaSService = SpringUtils.getBean(RemoteSaaSService.class);
|
||||||
Result<List<Datasource>> tableDataInfoResult = remoteSaaSService.findDatabaseList();
|
Result<List<Datasource>> tableDataInfoResult = initDataSource.initDatasource();
|
||||||
if (tableDataInfoResult==null){
|
if (tableDataInfoResult==null){
|
||||||
throw new SaaSException("saas远调数据源错误");
|
throw new SaaSException("saas远调数据源错误");
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.muyu.cloud.common.many.datasource.init;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.cloud.common.saas.domain.Datasource;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.system.domain.Firm;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.sql.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Log4j2
|
||||||
|
public class InitDataSource {
|
||||||
|
|
||||||
|
public static final String USER="root";
|
||||||
|
public static final String PASSWORD="Lw030106";
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@Primary
|
||||||
|
public Result<List<Datasource>> initDatasource(){
|
||||||
|
ArrayList<Datasource> list = new ArrayList<>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
DriverManager.registerDriver(new com.mysql.cj.jdbc.Driver());
|
||||||
|
Connection connection= DriverManager.getConnection("jdbc:mysql://47.101.53.251:3306/datasource?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT&useSSL=false",USER,PASSWORD);
|
||||||
|
String sql="select * from `datasource` ";
|
||||||
|
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
ResultSet rs = stmt.executeQuery(sql);
|
||||||
|
|
||||||
|
while (rs.next()){
|
||||||
|
Datasource datasource = new Datasource();
|
||||||
|
datasource.setId(rs.getInt("id"));
|
||||||
|
datasource.setFirmName(rs.getString("firm_name"));
|
||||||
|
datasource.setDatabaseName(rs.getString("database_name"));
|
||||||
|
list.add(datasource);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return Result.success(list);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -25,5 +25,5 @@ public interface RemoteFileService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
public Result<SysFile> upload (@RequestPart(value = "file") MultipartFile file);
|
Result<SysFile> upload(@RequestPart(value = "file") MultipartFile file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ public interface RemoteLogService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/operlog")
|
@PostMapping("/operlog")
|
||||||
public Result<Boolean> saveLog (@RequestBody SysOperLog sysOperLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception;
|
Result<Boolean> saveLog(@RequestBody SysOperLog sysOperLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存访问记录
|
* 保存访问记录
|
||||||
|
@ -38,5 +38,5 @@ public interface RemoteLogService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/logininfor")
|
@PostMapping("/logininfor")
|
||||||
public Result<Boolean> saveLogininfor (@RequestBody SysLogininfor sysLogininfor, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
Result<Boolean> saveLogininfor(@RequestBody SysLogininfor sysLogininfor, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
||||||
public interface RemoteSaaSService {
|
public interface RemoteSaaSService {
|
||||||
|
|
||||||
@GetMapping("/saas/findDatabaseList")
|
@GetMapping("/saas/findDatabaseList")
|
||||||
public Result<List<Datasource>> findDatabaseList();
|
Result<List<Datasource>> findDatabaseList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.muyu.common.core.constant.SecurityConstants;
|
||||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.common.system.domain.Firm;
|
|
||||||
import com.muyu.common.system.domain.SysFirmUser;
|
import com.muyu.common.system.domain.SysFirmUser;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
||||||
|
@ -24,13 +23,13 @@ public interface RemoteUserService {
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户信息
|
* 通过用户名查询用户信息
|
||||||
*
|
*
|
||||||
* @param
|
* @param username 用户名
|
||||||
* @param source 请求来源
|
* @param source 请求来源
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/user/info")
|
@GetMapping("/user/info/{username}")
|
||||||
public Result<LoginUser> getUserInfo (@RequestBody Firm firm, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
Result<LoginUser> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册用户信息
|
* 注册用户信息
|
||||||
|
@ -41,8 +40,8 @@ public interface RemoteUserService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/user/register")
|
@PostMapping("/user/register")
|
||||||
public Result<Boolean> registerUserInfo (@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
Result<Boolean> registerUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
|
|
||||||
@GetMapping("/user/companyList")
|
@GetMapping("/user/companyList")
|
||||||
public Result<List<SysUser>> companyList ();
|
Result<List<SysUser>> companyList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class BlackListUrlFilter extends AbstractGatewayFilterFactory<BlackListUr
|
||||||
public static class Config {
|
public static class Config {
|
||||||
private List<String> blacklistUrl;
|
private List<String> blacklistUrl;
|
||||||
|
|
||||||
private List<Pattern> blacklistUrlPattern = new ArrayList<>();
|
private final List<Pattern> blacklistUrlPattern = new ArrayList<>();
|
||||||
|
|
||||||
public boolean matchBlacklist (String url) {
|
public boolean matchBlacklist (String url) {
|
||||||
return !blacklistUrlPattern.isEmpty() && blacklistUrlPattern.stream().anyMatch(p -> p.matcher(url).find());
|
return !blacklistUrlPattern.isEmpty() && blacklistUrlPattern.stream().anyMatch(p -> p.matcher(url).find());
|
||||||
|
|
|
@ -34,8 +34,7 @@ public class GatewayExceptionHandler implements ErrorWebExceptionHandler {
|
||||||
|
|
||||||
if (ex instanceof NotFoundException) {
|
if (ex instanceof NotFoundException) {
|
||||||
msg = "服务未找到";
|
msg = "服务未找到";
|
||||||
} else if (ex instanceof ResponseStatusException) {
|
} else if (ex instanceof ResponseStatusException responseStatusException) {
|
||||||
ResponseStatusException responseStatusException = (ResponseStatusException) ex;
|
|
||||||
msg = responseStatusException.getMessage();
|
msg = responseStatusException.getMessage();
|
||||||
} else {
|
} else {
|
||||||
msg = "内部服务器错误";
|
msg = "内部服务器错误";
|
||||||
|
|
|
@ -14,10 +14,10 @@ public interface ValidateCodeService {
|
||||||
/**
|
/**
|
||||||
* 生成验证码
|
* 生成验证码
|
||||||
*/
|
*/
|
||||||
public Result createCaptcha () throws IOException, CaptchaException;
|
Result createCaptcha() throws IOException, CaptchaException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验验证码
|
* 校验验证码
|
||||||
*/
|
*/
|
||||||
public void checkCaptcha (String key, String value) throws CaptchaException;
|
void checkCaptcha(String key, String value) throws CaptchaException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
||||||
addr: 47.101.53.251:8848
|
addr: 47.101.53.251:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: four
|
namespace: lgy
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
|
@ -0,0 +1,129 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cloud-data</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||||
|
<version>4.1.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Sentinel -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot Actuator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.kafka</groupId>
|
||||||
|
<artifactId>spring-kafka</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 接口模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-api-doc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-modules-car</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-modules-fence</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.paho</groupId>
|
||||||
|
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||||
|
<version>1.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.muyu.data;
|
||||||
|
|
||||||
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@EnableFeignClients
|
||||||
|
public class DataApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(DataApplication.class,args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
package com.muyu.data.config;
|
||||||
|
|
||||||
|
|
||||||
|
import org.apache.kafka.clients.consumer.ConsumerConfig;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.SpringBootConfiguration;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
|
||||||
|
import org.springframework.kafka.config.KafkaListenerContainerFactory;
|
||||||
|
import org.springframework.kafka.core.ConsumerFactory;
|
||||||
|
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
|
||||||
|
import org.springframework.kafka.listener.ConcurrentMessageListenerContainer;
|
||||||
|
import org.springframework.kafka.listener.ContainerProperties;
|
||||||
|
import org.springframework.kafka.support.serializer.JsonDeserializer;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 徐一杰
|
||||||
|
* @date 2022/10/31 18:05
|
||||||
|
* kafka配置,也可以写在yml,这个文件会覆盖yml
|
||||||
|
*/
|
||||||
|
@SpringBootConfiguration
|
||||||
|
public class KafkaConsumerConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置 Kafka的 主机地址
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.consumer.bootstrap-servers}")
|
||||||
|
private String bootstrapServers;
|
||||||
|
/**
|
||||||
|
* 配置分分组
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.consumer.group-id}")
|
||||||
|
private String groupId;
|
||||||
|
/**
|
||||||
|
* 是否自动提交 偏移量
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.consumer.enable-auto-commit}")
|
||||||
|
private boolean enableAutoCommit;
|
||||||
|
/**
|
||||||
|
* 消费者与Kafka的心跳续约的会话超时时间
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.properties.session.timeout.ms}")
|
||||||
|
private String sessionTimeout;
|
||||||
|
/**
|
||||||
|
* 两次poll之间的最大间隔,默认值为5分钟。如果超过这个间隔会触发reBalance
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.properties.max.poll.interval.ms}")
|
||||||
|
private String maxPollIntervalTime;
|
||||||
|
|
||||||
|
@Value("${spring.kafka.consumer.max-poll-records}")
|
||||||
|
private String maxPollRecords;
|
||||||
|
|
||||||
|
@Value("${spring.kafka.consumer.auto-offset-reset}")
|
||||||
|
private String autoOffsetReset;
|
||||||
|
|
||||||
|
@Value("${spring.kafka.listener.concurrency}")
|
||||||
|
private Integer concurrency;
|
||||||
|
|
||||||
|
@Value("${spring.kafka.listener.missing-topics-fatal}")
|
||||||
|
private boolean missingTopicsFatal;
|
||||||
|
|
||||||
|
@Value("${spring.kafka.listener.poll-timeout}")
|
||||||
|
private long pollTimeout;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Map<String, Object> consumerConfigs() {
|
||||||
|
Map<String, Object> propsMap = new HashMap<>(16);
|
||||||
|
propsMap.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
|
||||||
|
propsMap.put(ConsumerConfig.GROUP_ID_CONFIG, groupId);
|
||||||
|
//是否自动提交偏移量,默认值是true,为了避免出现重复数据和数据丢失,可以把它设置为false,然后手动提交偏移量
|
||||||
|
propsMap.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, enableAutoCommit);
|
||||||
|
//自动提交的时间间隔,自动提交开启时生效
|
||||||
|
propsMap.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "2000");
|
||||||
|
//该属性指定了消费者在读取一个没有偏移量的分区或者偏移量无效的情况下该作何处理:
|
||||||
|
//earliest:当各分区下有已提交的offset时,从提交的offset开始消费;无提交的offset时,从头开始消费分区的记录
|
||||||
|
//latest:当各分区下有已提交的offset时,从提交的offset开始消费;无提交的offset时,消费新产生的该分区下的数据(在消费者启动之后生成的记录)
|
||||||
|
//none:当各分区都存在已提交的offset时,从提交的offset开始消费;只要有一个分区不存在已提交的offset,则抛出异常
|
||||||
|
propsMap.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, autoOffsetReset);
|
||||||
|
//两次poll之间的最大间隔,默认值为5分钟。如果超过这个间隔会触发reBalance
|
||||||
|
propsMap.put(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, maxPollIntervalTime);
|
||||||
|
//这个参数定义了poll方法最多可以拉取多少条消息,默认值为500。如果在拉取消息的时候新消息不足500条,那有多少返回多少;如果超过500条,每次只返回500。
|
||||||
|
//这个默认值在有些场景下太大,有些场景很难保证能够在5min内处理完500条消息,
|
||||||
|
//如果消费者无法在5分钟内处理完500条消息的话就会触发reBalance,
|
||||||
|
//然后这批消息会被分配到另一个消费者中,还是会处理不完,这样这批消息就永远也处理不完。
|
||||||
|
//要避免出现上述问题,提前评估好处理一条消息最长需要多少时间,然后覆盖默认的max.poll.records参数
|
||||||
|
//注:需要开启BatchListener批量监听才会生效,如果不开启BatchListener则不会出现reBalance情况
|
||||||
|
propsMap.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, maxPollRecords);
|
||||||
|
//当broker多久没有收到consumer的心跳请求后就触发reBalance,默认值是10s
|
||||||
|
propsMap.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, sessionTimeout);
|
||||||
|
//序列化(建议使用Json,这种序列化方式可以无需额外配置传输实体类)
|
||||||
|
propsMap.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, JsonDeserializer.class);
|
||||||
|
propsMap.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, JsonDeserializer.class);
|
||||||
|
return propsMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public ConsumerFactory<Object, Object> consumerFactory() {
|
||||||
|
// 配置消费者的 Json 反序列化的可信赖包,反序列化实体类需要
|
||||||
|
try (JsonDeserializer<Object> deserializer = new JsonDeserializer<>()) {
|
||||||
|
deserializer.trustedPackages("*");
|
||||||
|
return new DefaultKafkaConsumerFactory<>(consumerConfigs(), new JsonDeserializer<>(), deserializer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* kafka监听容器工厂 负责 从 Kafka的主题中 取出消息进行消费 可以设置消费者的配置
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<Object, Object>> kafkaListenerContainerFactory() {
|
||||||
|
ConcurrentKafkaListenerContainerFactory<Object, Object> factory = new ConcurrentKafkaListenerContainerFactory<>();
|
||||||
|
factory.setConsumerFactory(consumerFactory());
|
||||||
|
//在侦听器容器中运行的线程数,一般设置为 机器数*分区数
|
||||||
|
factory.setConcurrency(concurrency);
|
||||||
|
// 消费监听接口监听的主题不存在时,默认会报错,所以设置为false忽略错误
|
||||||
|
factory.setMissingTopicsFatal(missingTopicsFatal);
|
||||||
|
// 自动提交关闭,需要设置手动消息确认
|
||||||
|
factory.getContainerProperties().setAckMode(ContainerProperties.AckMode.MANUAL_IMMEDIATE);
|
||||||
|
factory.getContainerProperties().setPollTimeout(pollTimeout);
|
||||||
|
// 设置为批量监听,需要用List接收
|
||||||
|
// factory.setBatchListener(true);
|
||||||
|
return factory;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,127 @@
|
||||||
|
package com.muyu.data.config;
|
||||||
|
|
||||||
|
import org.apache.kafka.clients.producer.ProducerConfig;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.kafka.core.DefaultKafkaProducerFactory;
|
||||||
|
import org.springframework.kafka.core.KafkaTemplate;
|
||||||
|
import org.springframework.kafka.core.ProducerFactory;
|
||||||
|
import org.springframework.kafka.transaction.KafkaTransactionManager;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主题生产者的配置类
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class KafkaProviderConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* kafka 的主机地址
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.producer.bootstrap-servers}")
|
||||||
|
private String bootstrapServers;
|
||||||
|
/**
|
||||||
|
* 配置 Kafka的事务
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.producer.transaction-id-prefix}")
|
||||||
|
private String transactionIdPrefix;
|
||||||
|
/**
|
||||||
|
* 发送确认机制
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.producer.acks}")
|
||||||
|
private String acks;
|
||||||
|
/**
|
||||||
|
* 发送重试
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.producer.retries}")
|
||||||
|
private String retries;
|
||||||
|
/**
|
||||||
|
* 发送消息的批次大小
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.producer.batch-size}")
|
||||||
|
private String batchSize;
|
||||||
|
/**
|
||||||
|
* 消息的缓冲区内存大小
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.producer.buffer-memory}")
|
||||||
|
private String bufferMemory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置 健的序列化方式
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.producer.key-serializer}")
|
||||||
|
private String keySerializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置 值的序列化方式
|
||||||
|
*/
|
||||||
|
@Value("${spring.kafka.producer.value-serializer}")
|
||||||
|
private String valueSerializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建 map 配置消息生产者对象的配置
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public Map<String, Object> producerConfigs() {
|
||||||
|
Map<String, Object> props = new HashMap<>(16);
|
||||||
|
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
|
||||||
|
//acks=0 : 生产者在成功写入消息之前不会等待任何来自服务器的响应。
|
||||||
|
//acks=1 : 只要集群的首领节点收到消息,生产者就会收到一个来自服务器成功响应。
|
||||||
|
//acks=all :只有当所有参与复制的节点全部收到消息时,生产者才会收到一个来自服务器的成功响应。
|
||||||
|
//开启事务必须设为all
|
||||||
|
props.put(ProducerConfig.ACKS_CONFIG, acks);
|
||||||
|
//发生错误后,消息重发的次数,开启事务必须大于0
|
||||||
|
props.put(ProducerConfig.RETRIES_CONFIG, retries);
|
||||||
|
//当多个消息发送到相同分区时,生产者会将消息打包到一起,以减少请求交互. 而不是一条条发送
|
||||||
|
//批次的大小可以通过batch.size 参数设置.默认是16KB
|
||||||
|
//较小的批次大小有可能降低吞吐量(批次大小为0则完全禁用批处理)。
|
||||||
|
//比如说,kafka里的消息5秒钟Batch才凑满了16KB,才能发送出去。那这些消息的延迟就是5秒钟
|
||||||
|
//实测batchSize这个参数没有用
|
||||||
|
props.put(ProducerConfig.BATCH_SIZE_CONFIG, batchSize);
|
||||||
|
//有的时刻消息比较少,过了很久,比如5min也没有凑够16KB,这样延时就很大,所以需要一个参数. 再设置一个时间,到了这个时间,
|
||||||
|
//即使数据没达到16KB,也将这个批次发送出去
|
||||||
|
props.put(ProducerConfig.LINGER_MS_CONFIG, "5000");
|
||||||
|
//生产者内存缓冲区的大小
|
||||||
|
props.put(ProducerConfig.BUFFER_MEMORY_CONFIG, bufferMemory);
|
||||||
|
//反序列化,和生产者的序列化方式对应
|
||||||
|
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, keySerializer);
|
||||||
|
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, valueSerializer);
|
||||||
|
return props;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建 主题生产者工厂
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public ProducerFactory<Object, Object> producerFactory() {
|
||||||
|
DefaultKafkaProducerFactory<Object, Object> factory = new DefaultKafkaProducerFactory<>(producerConfigs());
|
||||||
|
//开启事务,会导致 LINGER_MS_CONFIG 配置失效
|
||||||
|
factory.setTransactionIdPrefix(transactionIdPrefix);
|
||||||
|
return factory;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置 Kafka的事务管理器
|
||||||
|
* @param producerFactory
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public KafkaTransactionManager<Object, Object> kafkaTransactionManager(ProducerFactory<Object, Object> producerFactory) {
|
||||||
|
return new KafkaTransactionManager<>(producerFactory);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建 KafkaTemplate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public KafkaTemplate<Object, Object> kafkaTemplate() {
|
||||||
|
return new KafkaTemplate<>(producerFactory());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.muyu.data.config;
|
||||||
|
|
||||||
|
import jakarta.annotation.Nullable;
|
||||||
|
import org.apache.kafka.clients.producer.ProducerRecord;
|
||||||
|
import org.apache.kafka.clients.producer.RecordMetadata;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.kafka.core.KafkaTemplate;
|
||||||
|
import org.springframework.kafka.support.ProducerListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class KafkaSendResultHandler implements ProducerListener<Object,Object> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private KafkaTemplate<Object,Object> kafkaTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* bean 初始化方法
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
public void init(){
|
||||||
|
this.kafkaTemplate.setProducerListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息发送到Kafka成功的回调
|
||||||
|
* @param producerRecord
|
||||||
|
* @param recordMetadata
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ProducerRecord producerRecord, RecordMetadata recordMetadata){
|
||||||
|
System.out.println("信息发送成功:"+ producerRecord.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 息发送到 Kafka 失败的回调
|
||||||
|
* @param producerRecord the failed record
|
||||||
|
* @param recordMetadata The metadata for the record that was sent (i.e. the partition
|
||||||
|
* and offset). If an error occurred, metadata will contain only valid topic and maybe
|
||||||
|
* the partition. If the partition is not provided in the ProducerRecord and an error
|
||||||
|
* occurs before partition is assigned, then the partition will be set to
|
||||||
|
* RecordMetadata.UNKNOWN_PARTITION.
|
||||||
|
* @param exception the exception thrown
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onError(ProducerRecord producerRecord, @Nullable RecordMetadata recordMetadata,
|
||||||
|
Exception exception){
|
||||||
|
System.out.println("消息发送失败: "+ producerRecord.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.data.config;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.NonNull;
|
||||||
|
import org.apache.kafka.clients.consumer.Consumer;
|
||||||
|
import org.springframework.kafka.annotation.KafkaListener;
|
||||||
|
import org.springframework.kafka.listener.KafkaListenerErrorHandler;
|
||||||
|
import org.springframework.kafka.listener.ListenerExecutionFailedException;
|
||||||
|
import org.springframework.kafka.support.Acknowledgment;
|
||||||
|
import org.springframework.messaging.Message;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class MyKafkaListenerErrorHandler implements KafkaListenerErrorHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@NonNull
|
||||||
|
public Object handleError(@NonNull Message<?> message,
|
||||||
|
ListenerExecutionFailedException exception) {
|
||||||
|
return new Object();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@NonNull
|
||||||
|
public Object handleError(@NonNull Message<?> message,
|
||||||
|
@NonNull ListenerExecutionFailedException exception,
|
||||||
|
Consumer<?, ?> consumer) {
|
||||||
|
System.out.println("消息详情:"+ message);
|
||||||
|
System.out.println("异常信息:"+ exception);
|
||||||
|
System.out.println("消费者详情:" +consumer.groupMetadata());
|
||||||
|
System.out.println("监听主题:"+ consumer.listTopics());
|
||||||
|
return KafkaListenerErrorHandler.super.handleError(message, exception, consumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.muyu.data.controller;
|
||||||
|
|
||||||
|
import com.muyu.data.service.DataService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("data")
|
||||||
|
public class DataController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataService dataService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.muyu.data.domian;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("event")
|
||||||
|
public class Event {
|
||||||
|
|
||||||
|
@TableId(value ="event_id" )
|
||||||
|
@Excel(name = "事件id")
|
||||||
|
private Integer eventId;
|
||||||
|
|
||||||
|
@Excel(name = "事件名称")
|
||||||
|
private String eventName;
|
||||||
|
|
||||||
|
@Excel(name = "车辆vin")
|
||||||
|
private String carVin;
|
||||||
|
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.muyu.data.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface DataMapper {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.muyu.data.remote;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.domain.req.SysCarReq;
|
||||||
|
import com.muyu.domain.resp.SysCarVo;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(name = "cloud-car")
|
||||||
|
public interface RemoteCarService {
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/car/selectSysCarVoList")
|
||||||
|
public Result<List<SysCarVo>> selectSysCarVoList(
|
||||||
|
@RequestBody SysCarReq sysCarReq);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.muyu.data.remote;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.fence.domain.req.ElectronicFenceGroupListReq;
|
||||||
|
import com.muyu.fence.domain.resp.GroupFenceListresp;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(name = "cloud-fence")
|
||||||
|
public interface RemoteFenceService {
|
||||||
|
|
||||||
|
@PostMapping("/fence/selectGroupList")
|
||||||
|
public Result<List<GroupFenceListresp>> selectGroupList(
|
||||||
|
@RequestBody ElectronicFenceGroupListReq req);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
package com.muyu.data.service;
|
||||||
|
|
||||||
|
public interface DataService {
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.muyu.data.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DataServiceImpl {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.muyu.data.util;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.data.remote.RemoteCarService;
|
||||||
|
import com.muyu.data.remote.RemoteFenceService;
|
||||||
|
import com.muyu.domain.resp.SysCarVo;
|
||||||
|
import com.muyu.fence.domain.resp.GroupFenceListresp;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.ApplicationArguments;
|
||||||
|
import org.springframework.boot.ApplicationRunner;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class InitDataRedis implements ApplicationRunner {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RedisTemplate redisTemplate;
|
||||||
|
@Autowired
|
||||||
|
private RemoteCarService remoteCarService;
|
||||||
|
@Autowired
|
||||||
|
private RemoteFenceService remoteFenceService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
|
|
||||||
|
//查询数控库中的车辆列表基本信息
|
||||||
|
Result<List<SysCarVo>> sysCarVoListResult = remoteCarService.selectSysCarVoList(null);
|
||||||
|
List<SysCarVo> sysCarVoList = sysCarVoListResult.getData();
|
||||||
|
//将全部信息存入redis中
|
||||||
|
for (SysCarVo sysCarVo : sysCarVoList) {
|
||||||
|
String carVin = sysCarVo.getCarVin();
|
||||||
|
redisTemplate.opsForValue().set("four:car:"+carVin,sysCarVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询车辆围栏组列表信息
|
||||||
|
Result<List<GroupFenceListresp>> groupListResult = remoteFenceService.selectGroupList(null);
|
||||||
|
List<GroupFenceListresp> groupFenceList = groupListResult.getData();
|
||||||
|
//将去全部信息存入redis中
|
||||||
|
for (GroupFenceListresp groupFenceListresp : groupFenceList) {
|
||||||
|
Long id = groupFenceListresp.getId();
|
||||||
|
redisTemplate.opsForValue().set("four:fenceGroup:"+id,groupFenceListresp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.muyu.data.util;
|
||||||
|
|
||||||
|
|
||||||
|
import org.eclipse.paho.client.mqttv3.MqttClient;
|
||||||
|
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
|
||||||
|
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||||
|
|
||||||
|
public class Receive {
|
||||||
|
|
||||||
|
public static MqttClient mqttClient= null;
|
||||||
|
private static MemoryPersistence memoryPersistence=null;
|
||||||
|
private static MqttConnectOptions mqttConnectOptions=null;
|
||||||
|
|
||||||
|
private static String ClientName="";
|
||||||
|
|
||||||
|
private static String IP="";
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void start(String clientId){
|
||||||
|
//初始化连接设置对象
|
||||||
|
mqttConnectOptions = new MqttConnectOptions();
|
||||||
|
//设置是否情
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.muyu.data.util;
|
||||||
|
|
||||||
|
import org.eclipse.paho.client.mqttv3.*;
|
||||||
|
|
||||||
|
public class ReceiveTwo {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String topic = "vehicle";
|
||||||
|
String broker = "tcp://47.101.53.251:1883";
|
||||||
|
String clientId="lw";
|
||||||
|
|
||||||
|
try {
|
||||||
|
MqttClient mqttClient= new MqttClient(broker,clientId);
|
||||||
|
MqttConnectOptions connectOptions=new MqttConnectOptions();
|
||||||
|
connectOptions.setCleanSession(true);
|
||||||
|
System.out.println("Connecting to broker:" + broker);
|
||||||
|
mqttClient.connect(connectOptions);
|
||||||
|
System.out.println("已连接");
|
||||||
|
mqttClient.setCallback(new MqttCallback(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void connectionLost(Throwable throwable) {
|
||||||
|
System.out.println("Connect lost!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void messageArrived(String s, MqttMessage mqttMessage) throws Exception {
|
||||||
|
System.out.println("Message arrived. topic:"+topic);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mqttClient.subscribe(topic);
|
||||||
|
System.out.println("Subscribed to topic " + topic);
|
||||||
|
} catch (MqttException e) {
|
||||||
|
System.out.println("reason "+e.getReasonCode());
|
||||||
|
System.out.println("msg " +e.getMessage());
|
||||||
|
System.out.println("loc " +e.getLocalizedMessage());
|
||||||
|
System.out.println("cause "+e.getCause());
|
||||||
|
System.out.println("excep "+e);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 10003
|
||||||
|
# nacos线上地址
|
||||||
|
nacos:
|
||||||
|
addr: 47.101.53.251:8848
|
||||||
|
user-name: nacos
|
||||||
|
password: nacos
|
||||||
|
namespace: four
|
||||||
|
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
amqp:
|
||||||
|
deserialization:
|
||||||
|
trust:
|
||||||
|
all: true
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: cloud-data
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: ${nacos.addr}
|
||||||
|
# nacos用户名
|
||||||
|
username: ${nacos.user-name}
|
||||||
|
# nacos密码
|
||||||
|
password: ${nacos.password}
|
||||||
|
# 命名空间
|
||||||
|
namespace: ${nacos.namespace}
|
||||||
|
config:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: ${nacos.addr}
|
||||||
|
# nacos用户名
|
||||||
|
username: ${nacos.user-name}
|
||||||
|
# nacos密码
|
||||||
|
password: ${nacos.password}
|
||||||
|
# 命名空间
|
||||||
|
namespace: ${nacos.namespace}
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
# 系统共享配置
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
# 系统环境Config共享配置
|
||||||
|
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
# xxl-job 配置文件
|
||||||
|
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
# rabbit 配置文件
|
||||||
|
- application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.muyu.fence.mapper: DEBUG
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
<!-- 日志存放路径 -->
|
<!-- 日志存放路径 -->
|
||||||
<property name="log.path" value="logs/cloud-saas"/>
|
<property name="log.path" value="logs/cloud-data"/>
|
||||||
<!-- 日志输出格式 -->
|
<!-- 日志输出格式 -->
|
||||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/cloud-data"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||||
|
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<Pattern>${log.sky.pattern}</Pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="GRPC_LOG"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,88 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/cloud-data"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||||
|
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<Pattern>${log.sky.pattern}</Pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="GRPC_LOG"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -42,6 +42,8 @@ public class SysCarFaultController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出车辆故障管理列表
|
* 导出车辆故障管理列表
|
||||||
*/
|
*/
|
||||||
|
@ -72,9 +74,13 @@ public class SysCarFaultController extends BaseController
|
||||||
public Result<Integer> add(
|
public Result<Integer> add(
|
||||||
@Validated @RequestBody SysCarFault sysCarFault)
|
@Validated @RequestBody SysCarFault sysCarFault)
|
||||||
{
|
{
|
||||||
if (sysCarFaultService.checkIdUnique(sysCarFault)) {
|
//判断故障码是否重复
|
||||||
return error("新增 车辆故障管理 ,失败,车辆故障码已存在");
|
SysCarFault selectFaultByFaultCode = sysCarFaultService.selectFaultByFaultCode(sysCarFault.getFaultCode());
|
||||||
|
if (selectFaultByFaultCode!=null){
|
||||||
|
return error("新增车辆故障 ,故障码已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sysCarFault.setCreateBy(SecurityUtils.getUsername());
|
sysCarFault.setCreateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(sysCarFaultService.save(sysCarFault));
|
return toAjax(sysCarFaultService.save(sysCarFault));
|
||||||
}
|
}
|
||||||
|
@ -88,9 +94,7 @@ public class SysCarFaultController extends BaseController
|
||||||
public Result<Integer> edit(
|
public Result<Integer> edit(
|
||||||
@Validated @RequestBody SysCarFault sysCarFault)
|
@Validated @RequestBody SysCarFault sysCarFault)
|
||||||
{
|
{
|
||||||
if (!sysCarFaultService.checkIdUnique(sysCarFault)) {
|
|
||||||
return error("修改 车辆故障管理 '" + sysCarFault + "'失败,车辆故障管理不存在");
|
|
||||||
}
|
|
||||||
sysCarFault.setUpdateBy(SecurityUtils.getUsername());
|
sysCarFault.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(sysCarFaultService.updateById(sysCarFault));
|
return toAjax(sysCarFaultService.updateById(sysCarFault));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package com.muyu.breakdown.controller;
|
package com.muyu.breakdown.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.muyu.breakdown.domain.SysCarFaultMessage;
|
import com.muyu.breakdown.domain.SysCarFaultMessage;
|
||||||
import com.muyu.breakdown.service.SysCarFaultMessageService;
|
import com.muyu.breakdown.service.SysCarFaultMessageService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -25,6 +24,10 @@ public class SysCarFaultMessageController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysCarFaultMessageService service;
|
private SysCarFaultMessageService service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有故障信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo<SysCarFaultMessage>> list(){
|
public Result<TableDataInfo<SysCarFaultMessage>> list(){
|
||||||
startPage();
|
startPage();
|
||||||
|
@ -32,6 +35,11 @@ public class SysCarFaultMessageController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询状态为1的故障信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
@GetMapping("/listStatusOne")
|
@GetMapping("/listStatusOne")
|
||||||
public Result<TableDataInfo<SysCarFaultMessage>>listStatusOne(){
|
public Result<TableDataInfo<SysCarFaultMessage>>listStatusOne(){
|
||||||
startPage();
|
startPage();
|
||||||
|
@ -39,10 +47,27 @@ public class SysCarFaultMessageController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询状态为2的故障信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/listStatusTwo")
|
@GetMapping("/listStatusTwo")
|
||||||
public Result<TableDataInfo<SysCarFaultMessage>>listStatusTwo(){
|
public Result<TableDataInfo<SysCarFaultMessage>>listStatusTwo(){
|
||||||
startPage();
|
startPage();
|
||||||
List<SysCarFaultMessage> list = service.listStatusTwo();
|
List<SysCarFaultMessage> list = service.listStatusTwo();
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 修改未读站内信息为已读
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping("/updateStatusById/{id}")
|
||||||
|
public Result updateStatusById(@PathVariable("id")Long id){
|
||||||
|
UpdateWrapper<SysCarFaultMessage> wrapper = new UpdateWrapper<>();
|
||||||
|
wrapper.eq("id",id);
|
||||||
|
wrapper.set("status",1);
|
||||||
|
boolean update = service.update(wrapper);
|
||||||
|
return Result.success(update);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
package com.muyu.breakdown.controller;
|
package com.muyu.breakdown.controller;
|
||||||
|
|
||||||
|
import cn.hutool.http.server.HttpServerResponse;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||||
import com.muyu.breakdown.service.SysCarFaultLogService;
|
import com.muyu.breakdown.service.SysCarFaultLogService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,4 +64,28 @@ public class sysCarFaultLogController extends BaseController {
|
||||||
return toAjax(service.save(sysCarFaultLog));
|
return toAjax(service.save(sysCarFaultLog));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysCarFaultLog sysCarFaultLog){
|
||||||
|
List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog);
|
||||||
|
ExcelUtil<SysCarFaultLog> util = new ExcelUtil<SysCarFaultLog>(SysCarFaultLog.class);
|
||||||
|
util.exportExcel(response,list,"车辆故障记录数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改为忽略
|
||||||
|
* @param idsStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping("/updateStatusById/{ids}")
|
||||||
|
public Result updateStatusById(@PathVariable("ids")String idsStr){
|
||||||
|
Long[] ids = Arrays.stream(idsStr.split(","))
|
||||||
|
.map(Long::valueOf)
|
||||||
|
.toArray(Long[]::new);
|
||||||
|
UpdateWrapper<SysCarFaultLog> wrapper = new UpdateWrapper<>();
|
||||||
|
wrapper.in("id",ids).set("status",3);
|
||||||
|
boolean update = service.update(null, wrapper);
|
||||||
|
return Result.success(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,10 @@ public class SysCarFault extends BaseEntity{
|
||||||
@Excel(name = "是否警告(0.开启 1.禁止)")
|
@Excel(name = "是否警告(0.开启 1.禁止)")
|
||||||
private Integer warnStatus;
|
private Integer warnStatus;
|
||||||
|
|
||||||
|
/**车辆类型 */
|
||||||
|
@Excel(name = "车辆类型")
|
||||||
|
private Integer carTypeId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.breakdown.domain;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
@ -28,19 +29,28 @@ public class SysCarFaultLog extends BaseEntity {
|
||||||
/** 参数主键 */
|
/** 参数主键 */
|
||||||
@TableId( type = IdType.AUTO)
|
@TableId( type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 故障码编码 */
|
/** 故障码编码 */
|
||||||
|
|
||||||
private Integer sysCarFaultId;
|
private Integer sysCarFaultId;
|
||||||
|
@Excel(name = "故障码编码")
|
||||||
|
private String faultCode;
|
||||||
|
|
||||||
/**记录时间*/
|
/**记录时间*/
|
||||||
|
@Excel(name = "记录时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/** 结束时间*/
|
/** 结束时间*/
|
||||||
|
@Excel(name = "结束时间")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
/** VIN码 */
|
/** VIN码 */
|
||||||
|
@Excel(name = "VIN码")
|
||||||
private String vin;
|
private String vin;
|
||||||
|
|
||||||
/** 处理状态 1-解决 2-处理中 3-忽略 */
|
/** 处理状态 1-解决 2-处理中 3-忽略 */
|
||||||
|
@Excel(name = "处理状态 1-解决 2-处理中 3-忽略")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.muyu.breakdown.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassDescription:
|
||||||
|
* @JdkVersion: 1.8
|
||||||
|
* @Author: YZL
|
||||||
|
* @Created: 2024/9/26 19:54
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("sys_car_enterprise")
|
||||||
|
public class sysCarEnterprise extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 企业id*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 企业名称*/
|
||||||
|
@Excel(name = "企业名称")
|
||||||
|
private String enterpriseName;
|
||||||
|
/** 用户姓名 */
|
||||||
|
@Excel(name = "用户姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Excel(name = "用户职位")
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
@Excel(name = "公司所在省")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
@Excel(name = "公司所在市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@Excel(name = "公司所在县/区")
|
||||||
|
private String county;
|
||||||
|
|
||||||
|
@Excel(name = "公司详细地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Excel(name = "统一社会信用代码")
|
||||||
|
private String creditCode;
|
||||||
|
|
||||||
|
@Excel(name = "营业执照")
|
||||||
|
private String businessLicense;
|
||||||
|
|
||||||
|
}
|
|
@ -19,7 +19,7 @@ public interface SysCarFaultLogMapper extends BaseMapper<SysCarFaultLog> {
|
||||||
|
|
||||||
|
|
||||||
@Select("select * from sys_car_fault_log where is_read=1")
|
@Select("select * from sys_car_fault_log where is_read=1")
|
||||||
public List<SysCarFaultLog> listIsReadAlready( );
|
List<SysCarFaultLog> listIsReadAlready();
|
||||||
@Select("select * from sys_car_fault_log where is_read=2")
|
@Select("select * from sys_car_fault_log where is_read=2")
|
||||||
public List<SysCarFaultLog>listISReadNotYet( );
|
List<SysCarFaultLog>listISReadNotYet();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,9 @@ package com.muyu.breakdown.mapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.breakdown.domain.SysCarFault;
|
import com.muyu.breakdown.domain.SysCarFault;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassDescription: 车辆故障管理Mapper接口
|
* @ClassDescription: 车辆故障管理Mapper接口
|
||||||
|
@ -13,4 +16,18 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface SysCarFaultMapper extends BaseMapper<SysCarFault>{
|
public interface SysCarFaultMapper extends BaseMapper<SysCarFault>{
|
||||||
|
|
||||||
|
//根据添加的故障码进行查询
|
||||||
|
@Select("select fault_code from sys_car_fault where fault_code=#{faultCode}")
|
||||||
|
SysCarFault selectFaultByFaultCode(String faultCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障码信息
|
||||||
|
* @param ids 故障码信息主键
|
||||||
|
* @return 故障码信息
|
||||||
|
*/
|
||||||
|
public List<SysCarFault> selectSysCarFaultIds(String[] ids);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@ import java.util.List;
|
||||||
public interface SysCarFaultMessageMapper extends BaseMapper<SysCarFaultMessage> {
|
public interface SysCarFaultMessageMapper extends BaseMapper<SysCarFaultMessage> {
|
||||||
|
|
||||||
@Select("select * from sys_car_fault_message where status=1")
|
@Select("select * from sys_car_fault_message where status=1")
|
||||||
public List<SysCarFaultMessage>listStatusOnt( );
|
List<SysCarFaultMessage>listStatusOnt();
|
||||||
@Select("select * from sys_car_fault_message where status=2")
|
@Select("select * from sys_car_fault_message where status=2")
|
||||||
public List<SysCarFaultMessage>listStatusTwo( );
|
List<SysCarFaultMessage>listStatusTwo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,10 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface SysCarFaultLogService extends IService<SysCarFaultLog> {
|
public interface SysCarFaultLogService extends IService<SysCarFaultLog> {
|
||||||
|
|
||||||
public List<SysCarFaultLog>selectSysCarFaultLogList(SysCarFaultLog sysCarFaultLog);
|
List<SysCarFaultLog>selectSysCarFaultLogList(SysCarFaultLog sysCarFaultLog);
|
||||||
|
|
||||||
public List<SysCarFaultLog> listStatusIgnore(SysCarFaultLog sysCarFaultLog);
|
List<SysCarFaultLog> listStatusIgnore(SysCarFaultLog sysCarFaultLog);
|
||||||
public List<SysCarFaultLog>listStatusProcess(SysCarFaultLog sysCarFaultLog );
|
List<SysCarFaultLog>listStatusProcess(SysCarFaultLog sysCarFaultLog);
|
||||||
|
|
||||||
public List<SysCarFaultLog>listStatusSolve(SysCarFaultLog sysCarFaultLog);
|
List<SysCarFaultLog>listStatusSolve(SysCarFaultLog sysCarFaultLog);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@ import java.util.stream.IntStream;
|
||||||
* @Created: 2024/9/22 14:35
|
* @Created: 2024/9/22 14:35
|
||||||
*/
|
*/
|
||||||
public interface SysCarFaultMessageService extends IService<SysCarFaultMessage> {
|
public interface SysCarFaultMessageService extends IService<SysCarFaultMessage> {
|
||||||
public List<SysCarFaultMessage> selectSysCarFaultMessageList(SysCarFaultMessage sysCarFaultMessage);
|
List<SysCarFaultMessage> selectSysCarFaultMessageList(SysCarFaultMessage sysCarFaultMessage);
|
||||||
|
|
||||||
public List<SysCarFaultMessage>listStatusOnt( );
|
List<SysCarFaultMessage>listStatusOnt();
|
||||||
public List<SysCarFaultMessage>listStatusTwo( );
|
List<SysCarFaultMessage>listStatusTwo();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ public interface SysCarFaultService extends IService<SysCarFault> {
|
||||||
* @param id 车辆故障管理主键
|
* @param id 车辆故障管理主键
|
||||||
* @return 车辆故障管理
|
* @return 车辆故障管理
|
||||||
*/
|
*/
|
||||||
public SysCarFault selectSysCarFaultById(Long id);
|
SysCarFault selectSysCarFaultById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询车辆故障管理列表
|
* 查询车辆故障管理列表
|
||||||
|
@ -26,14 +26,16 @@ public interface SysCarFaultService extends IService<SysCarFault> {
|
||||||
* @param sysCarFault 车辆故障管理
|
* @param sysCarFault 车辆故障管理
|
||||||
* @return 车辆故障管理集合
|
* @return 车辆故障管理集合
|
||||||
*/
|
*/
|
||||||
public List<SysCarFault> selectSysCarFaultList(SysCarFault sysCarFault);
|
List<SysCarFault> selectSysCarFaultList(SysCarFault sysCarFault);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断 车辆故障管理 id是否唯一
|
* 判断 车辆故障管理 faultCode(故障码)是否唯一
|
||||||
* @param sysCarFault 车辆故障管理
|
* @param faultCode 车辆故障管理
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
Boolean checkIdUnique(SysCarFault sysCarFault);
|
|
||||||
|
SysCarFault selectFaultByFaultCode(String faultCode);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,30 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class SysCarFaultMessageServiceImpl extends ServiceImpl<SysCarFaultMessageMapper, SysCarFaultMessage> implements SysCarFaultMessageService {
|
public class SysCarFaultMessageServiceImpl extends ServiceImpl<SysCarFaultMessageMapper, SysCarFaultMessage> implements SysCarFaultMessageService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障消息列表
|
||||||
|
* @param sysCarFaultMessage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultMessage> selectSysCarFaultMessageList(SysCarFaultMessage sysCarFaultMessage) {
|
public List<SysCarFaultMessage> selectSysCarFaultMessageList(SysCarFaultMessage sysCarFaultMessage) {
|
||||||
LambdaQueryWrapper<SysCarFaultMessage> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysCarFaultMessage> wrapper = new LambdaQueryWrapper<>();
|
||||||
return baseMapper.selectList(wrapper);
|
return baseMapper.selectList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障消息列表中状态为1的故障消息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultMessage> listStatusOnt( ) {
|
public List<SysCarFaultMessage> listStatusOnt( ) {
|
||||||
return baseMapper.listStatusOnt();
|
return baseMapper.listStatusOnt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障消息列表中状态为2的故障消息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultMessage> listStatusTwo( ) {
|
public List<SysCarFaultMessage> listStatusTwo( ) {
|
||||||
return baseMapper.listStatusTwo();
|
return baseMapper.listStatusTwo();
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.muyu.breakdown.domain.SysCarFault;
|
||||||
import com.muyu.breakdown.mapper.SysCarFaultMapper;
|
import com.muyu.breakdown.mapper.SysCarFaultMapper;
|
||||||
import com.muyu.breakdown.service.SysCarFaultService;
|
import com.muyu.breakdown.service.SysCarFaultService;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
@ -22,6 +23,9 @@ public class SysCarFaultServiceImpl
|
||||||
extends ServiceImpl<SysCarFaultMapper, SysCarFault>
|
extends ServiceImpl<SysCarFaultMapper, SysCarFault>
|
||||||
implements SysCarFaultService {
|
implements SysCarFaultService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysCarFaultMapper mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 精确查询车辆故障管理
|
* 精确查询车辆故障管理
|
||||||
*
|
*
|
||||||
|
@ -57,25 +61,29 @@ public class SysCarFaultServiceImpl
|
||||||
if (sysCarFault.getFaultRank()!=null){
|
if (sysCarFault.getFaultRank()!=null){
|
||||||
queryWrapper.eq(SysCarFault::getFaultRank, sysCarFault.getFaultRank());
|
queryWrapper.eq(SysCarFault::getFaultRank, sysCarFault.getFaultRank());
|
||||||
}
|
}
|
||||||
|
//故障码类型
|
||||||
if (sysCarFault.getTypeId()!=null){
|
if (sysCarFault.getTypeId()!=null){
|
||||||
queryWrapper.eq(SysCarFault::getTypeId,sysCarFault.getTypeId());
|
queryWrapper.eq(SysCarFault::getTypeId,sysCarFault.getTypeId());
|
||||||
}
|
}
|
||||||
|
//车辆类型查询
|
||||||
|
if (sysCarFault.getCarTypeId()!=null){
|
||||||
|
queryWrapper.eq(SysCarFault::getCarTypeId,sysCarFault.getTypeId());
|
||||||
|
}
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 唯一 判断
|
* 唯一 判断
|
||||||
* @param sysCarFault 车辆故障管理
|
* @param faultCode 车辆故障管理
|
||||||
* @return 车辆故障管理
|
* @return 车辆故障管理
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean checkIdUnique(SysCarFault sysCarFault) {
|
public SysCarFault selectFaultByFaultCode(String faultCode) {
|
||||||
LambdaQueryWrapper<SysCarFault> queryWrapper = new LambdaQueryWrapper<>();
|
return mapper.selectFaultByFaultCode(faultCode);
|
||||||
queryWrapper.eq(SysCarFault::getId, sysCarFault.getId());
|
|
||||||
queryWrapper.eq(SysCarFault::getFaultCode,sysCarFault.getFaultCode());
|
|
||||||
return this.count(queryWrapper) == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.breakdown.service.impl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.breakdown.domain.SysCarFault;
|
||||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||||
import com.muyu.breakdown.mapper.SysCarFaultLogMapper;
|
import com.muyu.breakdown.mapper.SysCarFaultLogMapper;
|
||||||
|
@ -26,17 +27,13 @@ import java.util.List;
|
||||||
public class sysCarFaultLogServiceImpl extends ServiceImpl<SysCarFaultLogMapper, SysCarFaultLog> implements SysCarFaultLogService {
|
public class sysCarFaultLogServiceImpl extends ServiceImpl<SysCarFaultLogMapper, SysCarFaultLog> implements SysCarFaultLogService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysCarFaultLogMapper sysCarFaultLogMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultLog> selectSysCarFaultLogList(SysCarFaultLog sysCarFaultLog) {
|
public List<SysCarFaultLog> selectSysCarFaultLogList(SysCarFaultLog sysCarFaultLog) {
|
||||||
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
|
return sysCarFaultLogMapper.selectSysCarFaultLogList(sysCarFaultLog);
|
||||||
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
|
|
||||||
}
|
|
||||||
if (sysCarFaultLog.getStatus()!=null){
|
|
||||||
wrapper.eq(SysCarFaultLog::getStatus,sysCarFaultLog.getStatus());
|
|
||||||
}
|
|
||||||
return this.list(wrapper);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,12 +43,8 @@ public class sysCarFaultLogServiceImpl extends ServiceImpl<SysCarFaultLogMapper,
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultLog> listStatusIgnore(SysCarFaultLog sysCarFaultLog) {
|
public List<SysCarFaultLog> listStatusIgnore(SysCarFaultLog sysCarFaultLog) {
|
||||||
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.eq(SysCarFaultLog::getStatus,3);
|
return sysCarFaultLogMapper.listStatusIgnore(sysCarFaultLog);
|
||||||
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
|
|
||||||
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
|
|
||||||
}
|
|
||||||
return this.list(wrapper);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,24 +54,16 @@ public class sysCarFaultLogServiceImpl extends ServiceImpl<SysCarFaultLogMapper,
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultLog> listStatusProcess(SysCarFaultLog sysCarFaultLog) {
|
public List<SysCarFaultLog> listStatusProcess(SysCarFaultLog sysCarFaultLog) {
|
||||||
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.eq(SysCarFaultLog::getStatus,2);
|
return sysCarFaultLogMapper.listStatusProcess(sysCarFaultLog);
|
||||||
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
|
|
||||||
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
|
|
||||||
}
|
|
||||||
return this.list(wrapper);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//只展示已解决的数据
|
//只展示已解决的数据
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultLog> listStatusSolve(SysCarFaultLog sysCarFaultLog) {
|
public List<SysCarFaultLog> listStatusSolve(SysCarFaultLog sysCarFaultLog) {
|
||||||
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
|
return sysCarFaultLogMapper.listStatusSolve(sysCarFaultLog);
|
||||||
wrapper.eq(SysCarFaultLog::getStatus,1);
|
|
||||||
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
|
|
||||||
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
|
|
||||||
}
|
|
||||||
return this.list(wrapper);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
||||||
addr: 47.101.53.251:8848
|
addr: 47.101.53.251:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: four
|
namespace: yzl
|
||||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.muyu.breakdown.mapper.SysCarFaultLogMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.breakdown.domain.SysCarFaultLog" id="SysCarFaultLogResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="sysCarFaultId" column="sys_car_fault_id"/>
|
||||||
|
<result property="faultCode" column="fault_code"/>
|
||||||
|
<result property="vin" column="vin"/>
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSysCarFaultLogVo">
|
||||||
|
SELECT fault.fault_code,log.update_time,log.create_time,log.vin,log.status FROM sys_car_fault_log log LEFT JOIN sys_car_fault fault on log.sys_car_fault_id=fault.id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSysCarFaultLogList" parameterType="com.muyu.breakdown.domain.SysCarFaultLog" resultMap="SysCarFaultLogResult">
|
||||||
|
<include refid="selectSysCarFaultLogVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="faultCode != null and faultCode != ''"> and fault.fault_code = #{faultCode}</if>
|
||||||
|
<if test="vin != null and vin != ''"> and log.vin = #{vin}</if>
|
||||||
|
<if test="status != null "> and log.status = #{status}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="listStatusSolve" resultType="com.muyu.breakdown.domain.SysCarFaultLog" resultMap="SysCarFaultLogResult">
|
||||||
|
<include refid="selectSysCarFaultLogVo" />
|
||||||
|
<where>
|
||||||
|
<if test="faultCode!=null and faultCode!=''">and fault.fault_code=#{faultCode}</if>
|
||||||
|
<if test="vin!=null and vin!=''">and log.vin=#{vin}</if>
|
||||||
|
and log.status=1
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="listStatusProcess" resultType="com.muyu.breakdown.domain.SysCarFaultLog" resultMap="SysCarFaultLogResult">
|
||||||
|
<include refid="selectSysCarFaultLogVo" />
|
||||||
|
<where>
|
||||||
|
<if test="faultCode!=null and faultCode!=''">and fault.fault_code=#{faultCode}</if>
|
||||||
|
<if test="vin!=null and vin!=''">and log.vin=#{vin}</if>
|
||||||
|
and log.status=2
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="listStatusIgnore" resultType="com.muyu.breakdown.domain.SysCarFaultLog" resultMap="SysCarFaultLogResult">
|
||||||
|
<include refid="selectSysCarFaultLogVo" />
|
||||||
|
<where>
|
||||||
|
<if test="faultCode!=null and faultCode!=''">and fault.fault_code=#{faultCode}</if>
|
||||||
|
<if test="vin!=null and vin!=''">and log.vin=#{vin}</if>
|
||||||
|
and log.status=3
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteSysCarFaultByIds" parameterType="String">
|
||||||
|
delete from sys_car_fault where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -23,10 +23,11 @@
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="carTypeId" column="car_type_id"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSysCarFaultVo">
|
<sql id="selectSysCarFaultVo">
|
||||||
select id, fault_code, fault_name, type_id, fault_label, fault_bit, fault_value, fault_rank, fault_desc, fault_min_threshold, fault_max_threshold, status, warn_status, remark, create_by, create_time, update_by, update_time from sys_car_fault
|
select id, fault_code, fault_name, type_id, fault_label, fault_bit, fault_value, fault_rank, fault_desc, fault_min_threshold, fault_max_threshold, status, warn_status, remark, create_by, create_time, update_by, update_time,car_type_id from sys_car_fault
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSysCarFaultList" parameterType="com.muyu.breakdown.domain.SysCarFault" resultMap="SysCarFaultResult">
|
<select id="selectSysCarFaultList" parameterType="com.muyu.breakdown.domain.SysCarFault" resultMap="SysCarFaultResult">
|
||||||
|
@ -42,6 +43,13 @@
|
||||||
<include refid="selectSysCarFaultVo"/>
|
<include refid="selectSysCarFaultVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectSysCarFaultIds" resultMap="SysCarFaultResult">
|
||||||
|
<include refid="selectSysCarFaultVo"/>
|
||||||
|
where id in
|
||||||
|
<foreach collection="array" item="id" index="index" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertSysCarFault" parameterType="com.muyu.breakdown.domain.SysCarFault" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertSysCarFault" parameterType="com.muyu.breakdown.domain.SysCarFault" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into sys_car_fault
|
insert into sys_car_fault
|
||||||
|
@ -63,6 +71,7 @@
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="carTypeId !=null">car_type_id</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="faultCode != null and faultCode != ''">#{faultCode},</if>
|
<if test="faultCode != null and faultCode != ''">#{faultCode},</if>
|
||||||
|
@ -82,6 +91,7 @@
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="carTypeId != null">#{catTypeId}</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -105,6 +115,7 @@
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="carTypeId !=null">car_type_id=#{catTypeId}</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
|
@ -25,5 +25,6 @@ public class SysCar extends BaseEntity {
|
||||||
private String carBatteryManufacturer;
|
private String carBatteryManufacturer;
|
||||||
private String carBatteryModel;
|
private String carBatteryModel;
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
|
private Long groupId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,8 @@ public class SysCarVo extends SysCar {
|
||||||
private String typeName;
|
private String typeName;
|
||||||
@Excel(name = "策略名称")
|
@Excel(name = "策略名称")
|
||||||
private String strategyName;
|
private String strategyName;
|
||||||
|
@Excel(name = "围栏组名称")
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
||||||
addr: 47.101.53.251:8848
|
addr: 47.101.53.251:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: four
|
namespace: yzl
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
<insert id="addSysCar">
|
<insert id="addSysCar">
|
||||||
INSERT INTO `four`.`sys_car`
|
INSERT INTO `four`.`sys_car`
|
||||||
( `car_vin`, `car_type_id`, `state`, `car_motor_manufacturer`, `car_motor_model`,
|
( `car_vin`, `car_type_id`, `state`, `car_motor_manufacturer`, `car_motor_model`,
|
||||||
`car_battery_manufacturer`, `car_battery_model`, `strategy_id`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
`car_battery_manufacturer`, `car_battery_model`, `strategy_id`,`group_id`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`,)
|
||||||
VALUES (#{carVin}, #{carTypeId}, '1', #{carMotorManufacturer}, #{carMotorModel},
|
VALUES (#{carVin}, #{carTypeId}, '1', #{carMotorManufacturer}, #{carMotorModel},
|
||||||
#{carBatteryManufacturer}, #{carBatteryModel}, #{strategyId},#{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark})
|
#{carBatteryManufacturer}, #{carBatteryModel}, #{strategyId},#{groupId},#{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark})
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updSysCarById">
|
<update id="updSysCarById">
|
||||||
UPDATE `four`.`sys_car`
|
UPDATE `four`.`sys_car`
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
`car_battery_manufacturer` = #{carBatteryManufacturer},
|
`car_battery_manufacturer` = #{carBatteryManufacturer},
|
||||||
`car_battery_model` = #{carBatteryModel},
|
`car_battery_model` = #{carBatteryModel},
|
||||||
`strategy_id` = #{strategyId},
|
`strategy_id` = #{strategyId},
|
||||||
|
`group_id`=#{groupId}
|
||||||
`create_by` = #{createBy},
|
`create_by` = #{createBy},
|
||||||
`create_time` = #{createTime},
|
`create_time` = #{createTime},
|
||||||
`update_by` = #{updateBy},
|
`update_by` = #{updateBy},
|
||||||
|
@ -27,10 +28,11 @@
|
||||||
`remark` = #{remark} WHERE `id` = #{id}
|
`remark` = #{remark} WHERE `id` = #{id}
|
||||||
</update>
|
</update>
|
||||||
<select id="selectSysCarVoList" resultType="com.muyu.domain.resp.SysCarVo">
|
<select id="selectSysCarVoList" resultType="com.muyu.domain.resp.SysCarVo">
|
||||||
SELECT * ,car_type.type_name,warn_strategy.strategy_name
|
SELECT * ,car_type.type_name,warn_strategy.strategy_name,electronic_fence_group.group_name
|
||||||
FROM `sys_car`
|
FROM `sys_car`
|
||||||
LEFT JOIN car_type ON sys_car.car_type_id=car_type.id
|
LEFT JOIN car_type ON sys_car.car_type_id=car_type.id
|
||||||
LEFT JOIN warn_strategy ON sys_car.strategy_id=warn_strategy.id
|
LEFT JOIN warn_strategy ON sys_car.strategy_id=warn_strategy.id
|
||||||
|
LEFT JOIN electronic_fence_group ON sys_car.group_id=electronic_fence_group.id
|
||||||
<where>
|
<where>
|
||||||
<if test="carVin!=null and carVin!=''">
|
<if test="carVin!=null and carVin!=''">
|
||||||
sys_car.car_vin=#{carVin}
|
sys_car.car_vin=#{carVin}
|
||||||
|
@ -55,10 +57,11 @@
|
||||||
|
|
||||||
|
|
||||||
<select id="selectSysCarVoById" resultType="com.muyu.domain.resp.SysCarVo">
|
<select id="selectSysCarVoById" resultType="com.muyu.domain.resp.SysCarVo">
|
||||||
SELECT * ,car_type.type_name,warn_strategy.strategy_name
|
SELECT * ,car_type.type_name,warn_strategy.strategy_name,electronic_fence_group.group_name
|
||||||
FROM `sys_car`
|
FROM `sys_car`
|
||||||
LEFT JOIN car_type ON sys_car.car_type_id=car_type.id
|
LEFT JOIN car_type ON sys_car.car_type_id=car_type.id
|
||||||
LEFT JOIN warn_strategy ON sys_car.strategy_id=warn_strategy.id
|
LEFT JOIN warn_strategy ON sys_car.strategy_id=warn_strategy.id
|
||||||
|
LEFT JOIN electronic_fence_group ON sys_car.group_id=electronic_fence_group.id
|
||||||
where sys_car.id=#{id}
|
where sys_car.id=#{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="findFenceByCarVin" resultType="com.muyu.domain.resp.SysCarFaultLogVo">
|
<select id="findFenceByCarVin" resultType="com.muyu.domain.resp.SysCarFaultLogVo">
|
||||||
|
|
|
@ -0,0 +1,102 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<groupId>com.muyu.processing</groupId>
|
||||||
|
<artifactId>cloud-modules-data-processing</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Sentinel -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot Actuator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 接口模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-api-doc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- XllJob定时任务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-xxl</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-rabbit</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.processing;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author YuPing
|
||||||
|
* @Description 数据处理启动类
|
||||||
|
* @Version 1.0
|
||||||
|
* @Data 2024-09-26 15:03:29
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class ProcessingApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(ProcessingApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,10 +17,6 @@
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>cloud-common-saas</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
DruidDataSourceAutoConfigure.class,
|
DruidDataSourceAutoConfigure.class,
|
||||||
DynamicDataSourceAutoConfiguration.class
|
DynamicDataSourceAutoConfiguration.class
|
||||||
})
|
})
|
||||||
|
|
||||||
public class CloudElectronicFenceApplication {
|
public class CloudElectronicFenceApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(CloudElectronicFenceApplication.class, args);
|
SpringApplication.run(CloudElectronicFenceApplication.class, args);
|
||||||
|
|
|
@ -20,6 +20,8 @@ import java.util.Date;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ElectroicFenceListReq {
|
public class ElectroicFenceListReq {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 围栏名称
|
* 围栏名称
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -13,4 +13,5 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ElectronicFenceMapper extends BaseMapper<ElectronicFence> {
|
public interface ElectronicFenceMapper extends BaseMapper<ElectronicFence> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ nacos:
|
||||||
addr: 47.101.53.251:8848
|
addr: 47.101.53.251:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: four
|
namespace: yzl
|
||||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
|
@ -17,5 +17,5 @@ public interface ISysFileService {
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public String uploadFile (MultipartFile file) throws Exception;
|
String uploadFile(MultipartFile file) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
||||||
addr: 47.101.53.251:8848
|
addr: 47.101.53.251:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: four
|
namespace: yzl
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
|
@ -20,7 +20,7 @@ public interface GenTableColumnMapper
|
||||||
* @param dbName
|
* @param dbName
|
||||||
* @return 列信息
|
* @return 列信息
|
||||||
*/
|
*/
|
||||||
public List<GenTableColumn> selectDbTableColumnsByName(@Param("tableName") String tableName, @Param("dbName") String dbName);
|
List<GenTableColumn> selectDbTableColumnsByName(@Param("tableName") String tableName, @Param("dbName") String dbName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询业务字段列表
|
* 查询业务字段列表
|
||||||
|
@ -28,7 +28,7 @@ public interface GenTableColumnMapper
|
||||||
* @param tableId 业务字段编号
|
* @param tableId 业务字段编号
|
||||||
* @return 业务字段集合
|
* @return 业务字段集合
|
||||||
*/
|
*/
|
||||||
public List<GenTableColumn> selectGenTableColumnListByTableId(@Param("tableId") Long tableId);
|
List<GenTableColumn> selectGenTableColumnListByTableId(@Param("tableId") Long tableId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增业务字段
|
* 新增业务字段
|
||||||
|
@ -36,7 +36,7 @@ public interface GenTableColumnMapper
|
||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertGenTableColumn(GenTableColumn genTableColumn);
|
int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改业务字段
|
* 修改业务字段
|
||||||
|
@ -44,7 +44,7 @@ public interface GenTableColumnMapper
|
||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateGenTableColumn(GenTableColumn genTableColumn);
|
int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除业务字段
|
* 删除业务字段
|
||||||
|
@ -52,7 +52,7 @@ public interface GenTableColumnMapper
|
||||||
* @param genTableColumns 列数据
|
* @param genTableColumns 列数据
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteGenTableColumns(@Param("genTableColumns") List<GenTableColumn> genTableColumns);
|
int deleteGenTableColumns(@Param("genTableColumns") List<GenTableColumn> genTableColumns);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除业务字段
|
* 批量删除业务字段
|
||||||
|
@ -60,5 +60,5 @@ public interface GenTableColumnMapper
|
||||||
* @param ids 需要删除的数据ID
|
* @param ids 需要删除的数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteGenTableColumnByIds(@Param("ids") Long[] ids);
|
int deleteGenTableColumnByIds(@Param("ids") Long[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ public interface GenTableMapper
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 业务集合
|
* @return 业务集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectGenTableList(GenTable genTable);
|
List<GenTable> selectGenTableList(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
|
@ -27,7 +27,7 @@ public interface GenTableMapper
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableList(GenTable genTable);
|
List<GenTable> selectDbTableList(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
|
@ -36,14 +36,14 @@ public interface GenTableMapper
|
||||||
* @param dbName
|
* @param dbName
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableListByNames(@Param("tableNames") String[] tableNames, @Param("dbName") String dbName);
|
List<GenTable> selectDbTableListByNames(@Param("tableNames") String[] tableNames, @Param("dbName") String dbName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有表信息
|
* 查询所有表信息
|
||||||
*
|
*
|
||||||
* @return 表信息集合
|
* @return 表信息集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectGenTableAll();
|
List<GenTable> selectGenTableAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询表ID业务信息
|
* 查询表ID业务信息
|
||||||
|
@ -51,7 +51,7 @@ public interface GenTableMapper
|
||||||
* @param id 业务ID
|
* @param id 业务ID
|
||||||
* @return 业务信息
|
* @return 业务信息
|
||||||
*/
|
*/
|
||||||
public GenTable selectGenTableById(@Param("id") Long id);
|
GenTable selectGenTableById(@Param("id") Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询表名称业务信息
|
* 查询表名称业务信息
|
||||||
|
@ -59,7 +59,7 @@ public interface GenTableMapper
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
* @return 业务信息
|
* @return 业务信息
|
||||||
*/
|
*/
|
||||||
public GenTable selectGenTableByName(@Param("tableName") String tableName);
|
GenTable selectGenTableByName(@Param("tableName") String tableName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增业务
|
* 新增业务
|
||||||
|
@ -67,7 +67,7 @@ public interface GenTableMapper
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertGenTable(GenTable genTable);
|
int insertGenTable(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改业务
|
* 修改业务
|
||||||
|
@ -75,7 +75,7 @@ public interface GenTableMapper
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateGenTable(GenTable genTable);
|
int updateGenTable(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除业务
|
* 批量删除业务
|
||||||
|
@ -83,7 +83,7 @@ public interface GenTableMapper
|
||||||
* @param ids 需要删除的数据ID
|
* @param ids 需要删除的数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteGenTableByIds(@Param("ids") Long[] ids);
|
int deleteGenTableByIds(@Param("ids") Long[] ids);
|
||||||
|
|
||||||
List<String> selDbNameAll();
|
List<String> selDbNameAll();
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ public interface IGenTableColumnService
|
||||||
* @param tableId 业务字段编号
|
* @param tableId 业务字段编号
|
||||||
* @return 业务字段集合
|
* @return 业务字段集合
|
||||||
*/
|
*/
|
||||||
public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增业务字段
|
* 新增业务字段
|
||||||
|
@ -25,7 +25,7 @@ public interface IGenTableColumnService
|
||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertGenTableColumn(GenTableColumn genTableColumn);
|
int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改业务字段
|
* 修改业务字段
|
||||||
|
@ -33,7 +33,7 @@ public interface IGenTableColumnService
|
||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateGenTableColumn(GenTableColumn genTableColumn);
|
int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除业务字段信息
|
* 删除业务字段信息
|
||||||
|
@ -41,7 +41,7 @@ public interface IGenTableColumnService
|
||||||
* @param ids 需要删除的数据ID
|
* @param ids 需要删除的数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteGenTableColumnByIds(String ids);
|
int deleteGenTableColumnByIds(String ids);
|
||||||
|
|
||||||
List<GenTableColumn> selectDbTableColumnsByName(String table, String dbName);
|
List<GenTableColumn> selectDbTableColumnsByName(String table, String dbName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ public interface IGenTableService
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 业务集合
|
* @return 业务集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectGenTableList(GenTable genTable);
|
List<GenTable> selectGenTableList(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
|
@ -27,7 +27,7 @@ public interface IGenTableService
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableList(GenTable genTable);
|
List<GenTable> selectDbTableList(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
|
@ -36,14 +36,14 @@ public interface IGenTableService
|
||||||
* @param dbName
|
* @param dbName
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableListByNames(String[] tableNames, String dbName);
|
List<GenTable> selectDbTableListByNames(String[] tableNames, String dbName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有表信息
|
* 查询所有表信息
|
||||||
*
|
*
|
||||||
* @return 表信息集合
|
* @return 表信息集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectGenTableAll();
|
List<GenTable> selectGenTableAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询业务信息
|
* 查询业务信息
|
||||||
|
@ -51,7 +51,7 @@ public interface IGenTableService
|
||||||
* @param id 业务ID
|
* @param id 业务ID
|
||||||
* @return 业务信息
|
* @return 业务信息
|
||||||
*/
|
*/
|
||||||
public GenTable selectGenTableById(Long id);
|
GenTable selectGenTableById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改业务
|
* 修改业务
|
||||||
|
@ -59,7 +59,7 @@ public interface IGenTableService
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void updateGenTable(GenTable genTable);
|
void updateGenTable(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除业务信息
|
* 删除业务信息
|
||||||
|
@ -67,14 +67,14 @@ public interface IGenTableService
|
||||||
* @param tableIds 需要删除的表数据ID
|
* @param tableIds 需要删除的表数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void deleteGenTableByIds(Long[] tableIds);
|
void deleteGenTableByIds(Long[] tableIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入表结构
|
* 导入表结构
|
||||||
*
|
*
|
||||||
* @param tableList 导入表列表
|
* @param tableList 导入表列表
|
||||||
*/
|
*/
|
||||||
public void importGenTable(List<GenTable> tableList);
|
void importGenTable(List<GenTable> tableList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预览代码
|
* 预览代码
|
||||||
|
@ -82,7 +82,7 @@ public interface IGenTableService
|
||||||
* @param tableId 表编号
|
* @param tableId 表编号
|
||||||
* @return 预览数据列表
|
* @return 预览数据列表
|
||||||
*/
|
*/
|
||||||
public Map<String, String> previewCode(Long tableId);
|
Map<String, String> previewCode(Long tableId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成代码(下载方式)
|
* 生成代码(下载方式)
|
||||||
|
@ -90,7 +90,7 @@ public interface IGenTableService
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
public byte[] downloadCode(String tableName);
|
byte[] downloadCode(String tableName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成代码(自定义路径)
|
* 生成代码(自定义路径)
|
||||||
|
@ -98,7 +98,7 @@ public interface IGenTableService
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
public void generatorCode(String tableName);
|
void generatorCode(String tableName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步数据库
|
* 同步数据库
|
||||||
|
@ -106,7 +106,7 @@ public interface IGenTableService
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
* @param dbName
|
* @param dbName
|
||||||
*/
|
*/
|
||||||
public void synchDb(String tableName, String dbName);
|
void synchDb(String tableName, String dbName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量生成代码(下载方式)
|
* 批量生成代码(下载方式)
|
||||||
|
@ -114,14 +114,14 @@ public interface IGenTableService
|
||||||
* @param tableNames 表数组
|
* @param tableNames 表数组
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
public byte[] downloadCode(String[] tableNames);
|
byte[] downloadCode(String[] tableNames);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存参数校验
|
* 修改保存参数校验
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
*/
|
*/
|
||||||
public void validateEdit(GenTable genTable);
|
void validateEdit(GenTable genTable);
|
||||||
|
|
||||||
List<String> selDbNameAll();
|
List<String> selDbNameAll();
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
||||||
addr: 47.101.53.251:8848
|
addr: 47.101.53.251:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: four
|
namespace: yzl
|
||||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
|
@ -17,7 +17,7 @@ public interface I${ClassName}Service extends IService<${ClassName}> {
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
* @param ${pkColumn.javaField} ${functionName}主键
|
||||||
* @return ${functionName}
|
* @return ${functionName}
|
||||||
*/
|
*/
|
||||||
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}列表
|
* 查询${functionName}列表
|
||||||
|
@ -25,7 +25,7 @@ public interface I${ClassName}Service extends IService<${ClassName}> {
|
||||||
* @param ${className} ${functionName}
|
* @param ${className} ${functionName}
|
||||||
* @return ${functionName}集合
|
* @return ${functionName}集合
|
||||||
*/
|
*/
|
||||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断 ${functionName} id是否唯一
|
* 判断 ${functionName} id是否唯一
|
||||||
|
|
|
@ -494,7 +494,7 @@ export default {
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
||||||
return del${BusinessName}(row.${pkColumn.javaField});
|
return del${BusinessName}(row.${pkColumn.javaField})
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.#[[$modal]]#.msgSuccess("删除成功");
|
this.#[[$modal]]#.msgSuccess("删除成功");
|
||||||
|
|
|
@ -580,7 +580,7 @@ export default {
|
||||||
this.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
|
this.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
|
||||||
} else {
|
} else {
|
||||||
const ${subclassName}List = this.${subclassName}List;
|
const ${subclassName}List = this.${subclassName}List;
|
||||||
const checked${subClassName} = this.checked${subClassName};
|
const checked${subClassName} = this.checked${subClassName}
|
||||||
this.${subclassName}List = ${subclassName}List.filter(function(item) {
|
this.${subclassName}List = ${subclassName}List.filter(function(item) {
|
||||||
return checked${subClassName}.indexOf(item.index) == -1
|
return checked${subClassName}.indexOf(item.index) == -1
|
||||||
});
|
});
|
||||||
|
@ -598,5 +598,5 @@ export default {
|
||||||
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -463,7 +463,7 @@ function submitForm() {
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
||||||
return del${BusinessName}(row.${pkColumn.javaField});
|
return del${BusinessName}(row.${pkColumn.javaField})
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
getList();
|
getList();
|
||||||
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
||||||
|
|
|
@ -535,7 +535,7 @@ function submitForm() {
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value;
|
const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value;
|
||||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').then(function() {
|
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').then(function() {
|
||||||
return del${BusinessName}(_${pkColumn.javaField}s);
|
return del${BusinessName}(_${pkColumn.javaField}s)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
getList();
|
getList();
|
||||||
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
||||||
|
|
|
@ -19,7 +19,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 部门信息集合
|
* @return 部门信息集合
|
||||||
*/
|
*/
|
||||||
public List<SysDept> selectDeptList (SysDept dept);
|
List<SysDept> selectDeptList(SysDept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询部门树信息
|
* 根据角色ID查询部门树信息
|
||||||
|
@ -29,7 +29,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 选中部门列表
|
* @return 选中部门列表
|
||||||
*/
|
*/
|
||||||
public List<Long> selectDeptListByRoleId (@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
|
List<Long> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门ID查询信息
|
* 根据部门ID查询信息
|
||||||
|
@ -38,7 +38,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 部门信息
|
* @return 部门信息
|
||||||
*/
|
*/
|
||||||
public SysDept selectDeptById (Long deptId);
|
SysDept selectDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询所有子部门
|
* 根据ID查询所有子部门
|
||||||
|
@ -47,7 +47,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 部门列表
|
* @return 部门列表
|
||||||
*/
|
*/
|
||||||
public List<SysDept> selectChildrenDeptById (Long deptId);
|
List<SysDept> selectChildrenDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询所有子部门(正常状态)
|
* 根据ID查询所有子部门(正常状态)
|
||||||
|
@ -56,7 +56,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 子部门数
|
* @return 子部门数
|
||||||
*/
|
*/
|
||||||
public int selectNormalChildrenDeptById (Long deptId);
|
int selectNormalChildrenDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否存在子节点
|
* 是否存在子节点
|
||||||
|
@ -65,7 +65,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int hasChildByDeptId (Long deptId);
|
int hasChildByDeptId(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门是否存在用户
|
* 查询部门是否存在用户
|
||||||
|
@ -74,7 +74,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int checkDeptExistUser (Long deptId);
|
int checkDeptExistUser(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称是否唯一
|
* 校验部门名称是否唯一
|
||||||
|
@ -84,7 +84,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysDept checkDeptNameUnique (@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增部门信息
|
* 新增部门信息
|
||||||
|
@ -93,7 +93,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDept (SysDept dept);
|
int insertDept(SysDept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改部门信息
|
* 修改部门信息
|
||||||
|
@ -102,14 +102,14 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDept (SysDept dept);
|
int updateDept(SysDept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改所在部门正常状态
|
* 修改所在部门正常状态
|
||||||
*
|
*
|
||||||
* @param deptIds 部门ID组
|
* @param deptIds 部门ID组
|
||||||
*/
|
*/
|
||||||
public void updateDeptStatusNormal (Long[] deptIds);
|
void updateDeptStatusNormal(Long[] deptIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改子元素关系
|
* 修改子元素关系
|
||||||
|
@ -118,7 +118,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDeptChildren (@Param("depts") List<SysDept> depts);
|
int updateDeptChildren(@Param("depts") List<SysDept> depts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除部门管理信息
|
* 删除部门管理信息
|
||||||
|
@ -127,5 +127,5 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById (Long deptId);
|
int deleteDeptById(Long deptId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ public interface SysDictDataMapper extends BaseMapper<SysDictData> {
|
||||||
*
|
*
|
||||||
* @return 字典数据集合信息
|
* @return 字典数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictData> selectDictDataList (SysDictData dictData);
|
List<SysDictData> selectDictDataList(SysDictData dictData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型查询字典数据
|
* 根据字典类型查询字典数据
|
||||||
|
@ -28,7 +28,7 @@ public interface SysDictDataMapper extends BaseMapper<SysDictData> {
|
||||||
*
|
*
|
||||||
* @return 字典数据集合信息
|
* @return 字典数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictData> selectDictDataByType (String dictType);
|
List<SysDictData> selectDictDataByType(String dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型和字典键值查询字典数据信息
|
* 根据字典类型和字典键值查询字典数据信息
|
||||||
|
@ -38,7 +38,7 @@ public interface SysDictDataMapper extends BaseMapper<SysDictData> {
|
||||||
*
|
*
|
||||||
* @return 字典标签
|
* @return 字典标签
|
||||||
*/
|
*/
|
||||||
public String selectDictLabel (@Param("dictType") String dictType, @Param("dictValue") String dictValue);
|
String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典数据ID查询信息
|
* 根据字典数据ID查询信息
|
||||||
|
@ -47,7 +47,7 @@ public interface SysDictDataMapper extends BaseMapper<SysDictData> {
|
||||||
*
|
*
|
||||||
* @return 字典数据
|
* @return 字典数据
|
||||||
*/
|
*/
|
||||||
public SysDictData selectDictDataById (Long dictCode);
|
SysDictData selectDictDataById(Long dictCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询字典数据
|
* 查询字典数据
|
||||||
|
@ -56,7 +56,7 @@ public interface SysDictDataMapper extends BaseMapper<SysDictData> {
|
||||||
*
|
*
|
||||||
* @return 字典数据
|
* @return 字典数据
|
||||||
*/
|
*/
|
||||||
public int countDictDataByType (String dictType);
|
int countDictDataByType(String dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过字典ID删除字典数据信息
|
* 通过字典ID删除字典数据信息
|
||||||
|
@ -65,7 +65,7 @@ public interface SysDictDataMapper extends BaseMapper<SysDictData> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDictDataById (Long dictCode);
|
int deleteDictDataById(Long dictCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除字典数据信息
|
* 批量删除字典数据信息
|
||||||
|
@ -74,7 +74,7 @@ public interface SysDictDataMapper extends BaseMapper<SysDictData> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDictDataByIds (Long[] dictCodes);
|
int deleteDictDataByIds(Long[] dictCodes);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增字典数据信息
|
* 新增字典数据信息
|
||||||
|
@ -83,7 +83,7 @@ public interface SysDictDataMapper extends BaseMapper<SysDictData> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDictData (SysDictData dictData);
|
int insertDictData(SysDictData dictData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改字典数据信息
|
* 修改字典数据信息
|
||||||
|
@ -92,7 +92,7 @@ public interface SysDictDataMapper extends BaseMapper<SysDictData> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDictData (SysDictData dictData);
|
int updateDictData(SysDictData dictData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步修改字典类型
|
* 同步修改字典类型
|
||||||
|
@ -102,5 +102,5 @@ public interface SysDictDataMapper extends BaseMapper<SysDictData> {
|
||||||
*
|
*
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDictDataType (@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
|
int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue