fix: 驼峰转换下划线、lucene
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package org.nl.common.enums;
|
||||
|
||||
public enum LogTypeEnum {
|
||||
DEVICE_LOG("设备日志"),
|
||||
INTERFACE_LOG("接口日志");
|
||||
|
||||
private String desc;
|
||||
|
||||
LogTypeEnum(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package org.nl.config.lucene;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.TextField;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
import org.apache.lucene.index.IndexWriterConfig;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.store.FSDirectory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.wltea.analyzer.lucene.IKAnalyzer;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* lucene索引器
|
||||
*/
|
||||
public class Indexer {
|
||||
/**
|
||||
* 写索引实例
|
||||
*/
|
||||
private IndexWriter writer;
|
||||
|
||||
public IndexWriter getWriter() {
|
||||
return writer;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造方法,实例化IndexWriter
|
||||
* @param indexDir
|
||||
* @throws Exception
|
||||
*/
|
||||
public Indexer(String indexDir) throws Exception {
|
||||
Directory dir = FSDirectory.open(Paths.get(indexDir));
|
||||
//标准分词器,会自动去掉空格啊,is a the等单词
|
||||
// Analyzer analyzer = new StandardAnalyzer();
|
||||
Analyzer analyzer = new IKAnalyzer();
|
||||
//将标准分词器配到写索引的配置中
|
||||
IndexWriterConfig config = new IndexWriterConfig(analyzer);
|
||||
//实例化写索引对象
|
||||
writer = new IndexWriter(dir, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 索引指定目录下的所有文件
|
||||
* @param dataDir
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int indexAll(String dataDir) throws Exception {
|
||||
// 获取该路径下的所有文件
|
||||
File[] files = new File(dataDir).listFiles();
|
||||
if (null != files) {
|
||||
for (File file : files) {
|
||||
//调用下面的indexFile方法,对每个文件进行索引
|
||||
indexFile(file);
|
||||
}
|
||||
}
|
||||
//返回索引的文件数
|
||||
// return writer.numDocs();
|
||||
return writer.numRamDocs();
|
||||
}
|
||||
|
||||
/**
|
||||
* 索引指定的文件
|
||||
* @param file
|
||||
* @throws Exception
|
||||
*/
|
||||
private void indexFile(File file) throws Exception {
|
||||
System.out.println("索引文件的路径:" + file.getCanonicalPath());
|
||||
//调用下面的getDocument方法,获取该文件的document
|
||||
Document doc = getDocument(file);
|
||||
//添加索引文档
|
||||
//Document doc = json2Doc(jsonDoc);
|
||||
// Document doc = new Document();
|
||||
// doc.add(new TextField("content", jsonDoc, Field.Store.YES));
|
||||
Field fieldContent=new TextField("fieldContent", FileUtils.readFileToString(null,"UTF-8"), Field.Store.YES);
|
||||
|
||||
//将doc添加到索引中
|
||||
writer.addDocument(doc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档,文档里再设置每个字段,就类似于数据库中的一行记录
|
||||
* @param file
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private Document getDocument(File file) throws Exception {
|
||||
Document doc = new Document();
|
||||
//开始添加字段
|
||||
//添加内容
|
||||
doc.add(new TextField("contents", new FileReader(file)));
|
||||
//添加文件名,并把这个字段存到索引文件里
|
||||
doc.add(new TextField("fileName", file.getName(), Field.Store.YES));
|
||||
//添加文件路径
|
||||
doc.add(new TextField("fullPath", file.getCanonicalPath(), Field.Store.YES));
|
||||
return doc;
|
||||
}
|
||||
public Document json2Doc(String strDoc) {
|
||||
Document doc = new Document();
|
||||
JSONObject jsonDoc = JSONObject.parseObject(strDoc);
|
||||
Set<String> keys = jsonDoc.keySet();
|
||||
for (String key : keys) {
|
||||
doc.add(new TextField(key, jsonDoc.getString(key), Field.Store.YES));
|
||||
}
|
||||
return doc;
|
||||
}
|
||||
|
||||
public void addLogIndex(String msg) throws IOException {
|
||||
//步骤一:创建Directory对象,用于指定索引库的位置 RAMDirectory内存
|
||||
Directory directory = FSDirectory.open(new File("D:\\lucene\\index").toPath());
|
||||
//步骤二:创建一个IndexWriter对象,用于写索引
|
||||
// Analyzer analyzer = new StandardAnalyzer();
|
||||
IndexWriter indexWriter=new IndexWriter(directory,new IndexWriterConfig(new IKAnalyzer(false)));
|
||||
// indexWriter.deleteAll();//清理所有索引库
|
||||
// IndexWriter indexWriter=new IndexWriter(directory,new IndexWriterConfig(new StandardAnalyzer()));
|
||||
//记录索引开始时间
|
||||
long startTime = System.currentTimeMillis();
|
||||
//步骤三:读取磁盘中文件,对应每一个文件创建一个文档对象
|
||||
Document document = new Document();
|
||||
// document.add(new TextField("fieldContent", device_id, Field.Store.YES));
|
||||
document.add(new TextField("fieldContent", msg, Field.Store.YES));
|
||||
indexWriter.addDocument(document);
|
||||
//记录索引结束时间
|
||||
long endTime = System.currentTimeMillis();
|
||||
System.out.println("建立索引"+ "共耗时" + (endTime-startTime) + "毫秒");
|
||||
indexWriter.commit();
|
||||
//步骤八:关闭资源
|
||||
indexWriter.close();
|
||||
System.out.println("建立索引成功-----关闭资源");
|
||||
}
|
||||
//系统的日志文件路径
|
||||
@Value("${logging.file.path}")
|
||||
private String logUrl;
|
||||
|
||||
public static void main(String[] args)throws IOException {
|
||||
//步骤一:创建Directory对象,用于指定索引库的位置 RAMDirectory内存
|
||||
Directory directory = FSDirectory.open(new File("D:\\lucene\\index").toPath());
|
||||
//步骤二:创建一个IndexWriter对象,用于写索引
|
||||
// Analyzer analyzer = new StandardAnalyzer();
|
||||
IndexWriter indexWriter=new IndexWriter(directory,new IndexWriterConfig(new IKAnalyzer(false)));
|
||||
|
||||
indexWriter.deleteAll();//清理所有索引库
|
||||
// IndexWriter indexWriter=new IndexWriter(directory,new IndexWriterConfig(new StandardAnalyzer()));
|
||||
//记录索引开始时间
|
||||
long startTime = System.currentTimeMillis();
|
||||
//步骤三:读取磁盘中文件,对应每一个文件创建一个文档对象
|
||||
File file=new File("D:\\testlog");
|
||||
//步骤四:获取文件列表
|
||||
File[] files = file.listFiles();
|
||||
for (File item:files) {
|
||||
BufferedReader bufferedReader = new BufferedReader(new FileReader(item));
|
||||
String strLine = null;
|
||||
while(null != (strLine = bufferedReader.readLine())){
|
||||
Document document = new Document();
|
||||
// document.add(new Field());
|
||||
document.add(new TextField("fieldContent", strLine, Field.Store.YES));
|
||||
indexWriter.addDocument(document);
|
||||
}
|
||||
}
|
||||
//记录索引结束时间
|
||||
long endTime = System.currentTimeMillis();
|
||||
System.out.println("建立索引"+ "共耗时" + (endTime-startTime) + "毫秒");
|
||||
indexWriter.commit();
|
||||
//步骤八:关闭资源
|
||||
indexWriter.close();
|
||||
System.out.println("建立索引成功-----关闭资源");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.nl.config.lucene;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.apache.lucene.index.CorruptIndexException;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
import org.apache.lucene.index.IndexWriterConfig;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.store.FSDirectory;
|
||||
import org.wltea.analyzer.lucene.IKAnalyzer;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class LuceneIndexWriter {
|
||||
private static IndexWriter indexWriter;
|
||||
|
||||
static {
|
||||
try {
|
||||
Directory directory = FSDirectory.open(new File(UrlConfig.luceneUrl).toPath());
|
||||
IndexWriterConfig config = new IndexWriterConfig(new IKAnalyzer());
|
||||
indexWriter = new IndexWriter(directory, config);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
/**当当前线程结束时,自动关闭IndexWriter,使用Runtime对象*/
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(){
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
closeIndexWriter();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/**在线程结束时,自动关闭IndexWriter*/
|
||||
public static IndexWriter getIndexWriter() {
|
||||
return indexWriter;
|
||||
}
|
||||
/**关闭IndexWriter
|
||||
* @throws IOException
|
||||
* @throws CorruptIndexException */
|
||||
public static void closeIndexWriter() throws Exception {
|
||||
if(indexWriter != null) {
|
||||
indexWriter.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
indexWriter.deleteAll();
|
||||
}
|
||||
|
||||
public static String getDate(String timeString) throws ParseException {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");//时间格式
|
||||
Date date = sdf.parse(timeString);
|
||||
timeString = DateUtil.format(date, "yyyy-MM-dd HH:mm:ss.SSS");//格式化后的时间
|
||||
return timeString;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package org.nl.config.lucene;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.apache.lucene.queryparser.classic.QueryParser;
|
||||
import org.apache.lucene.search.*;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.store.FSDirectory;
|
||||
import org.wltea.analyzer.lucene.IKAnalyzer;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* lucene查询器
|
||||
*/
|
||||
@Slf4j
|
||||
public class Searcher {
|
||||
|
||||
public static Map<String, Object> search(String indexDir, String ext,Map whereJson) throws Exception {
|
||||
//获取要查询的路径,也就是索引所在的位置
|
||||
Directory dir = FSDirectory.open(Paths.get(indexDir));
|
||||
IndexReader reader = DirectoryReader.open(dir);
|
||||
//构建IndexSearcher
|
||||
IndexSearcher searcher = new IndexSearcher(reader);
|
||||
//标准分词器,会自动去掉空格啊,is a the等单词
|
||||
// Analyzer analyzer = new StandardAnalyzer();
|
||||
Analyzer analyzer = new IKAnalyzer(false);
|
||||
//查询解析器
|
||||
QueryParser queryParser = new QueryParser("fieldContent", analyzer);
|
||||
|
||||
//记录索引开始时间
|
||||
long startTime = System.currentTimeMillis();
|
||||
// 实际上Lucene本身不支持分页。因此我们需要自己进行逻辑分页。我们要准备分页参数:
|
||||
int pageSize = Integer.parseInt(whereJson.get("size").toString());// 每页条数
|
||||
int pageNum = Integer.parseInt(whereJson.get("page").toString());// 当前页码
|
||||
int start = pageNum * pageSize;// 当前页的起始条数
|
||||
int end = start + pageSize;// 当前页的结束条数(不能包含)
|
||||
// 创建排序对象,需要排序字段SortField,参数:字段的名称、字段的类型、是否反转如果是false,升序。true降序
|
||||
Sort sort = new Sort(new SortField("logTime", SortField.Type.DOC,true));
|
||||
|
||||
TopDocs docs = null;
|
||||
BooleanQuery.Builder booleanQueryBuilder = new BooleanQuery.Builder();
|
||||
//时间范围查询
|
||||
String startDate = (String) whereJson.get("begin_time");
|
||||
String endDate = (String) whereJson.get("end_time");
|
||||
Calendar calendar=Calendar.getInstance();
|
||||
calendar.set(1970, 0, 1);
|
||||
if (startDate == null){
|
||||
startDate = DateUtil.format(calendar.getTime(),"yyyy-MM-dd HH:mm:ss.SSS");
|
||||
}else{
|
||||
startDate = LuceneIndexWriter.getDate(startDate);
|
||||
}
|
||||
if (endDate == null){
|
||||
endDate = DateUtil.format(new DateTime(),"yyyy-MM-dd HH:mm:ss.SSS");
|
||||
} else {
|
||||
endDate = LuceneIndexWriter.getDate(endDate);
|
||||
}
|
||||
TermRangeQuery termRangeQuery = new TermRangeQuery("logTime", new BytesRef(startDate), new BytesRef(endDate), true, true);
|
||||
booleanQueryBuilder.add(termRangeQuery,BooleanClause.Occur.MUST);
|
||||
if (whereJson.get("device_code") != null){
|
||||
Query termQuery = new TermQuery(new Term("device_code", (String) whereJson.get("device_code")));
|
||||
booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST);
|
||||
}
|
||||
if (whereJson.get("method") != null){
|
||||
Query termQuery = new TermQuery(new Term("method", (String) whereJson.get("method")));
|
||||
booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST);
|
||||
}
|
||||
if (whereJson.get("status_code") != null){
|
||||
Query termQuery = new TermQuery(new Term("status_code", (String) whereJson.get("status_code")));
|
||||
booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST);
|
||||
}
|
||||
if (whereJson.get("blurry") != null) {
|
||||
Query query = queryParser.parse((String) whereJson.get("blurry"));
|
||||
booleanQueryBuilder.add(query, BooleanClause.Occur.MUST);
|
||||
}
|
||||
docs = searcher.search(booleanQueryBuilder.build(), end,sort);
|
||||
//记录索引时间
|
||||
long endTime = System.currentTimeMillis();
|
||||
log.info("匹配{}共耗时{}毫秒",booleanQueryBuilder.build(),(endTime-startTime));
|
||||
log.info("查询到{}条日志文件", docs.totalHits.value);
|
||||
List<String> list = new ArrayList<>();
|
||||
ScoreDoc[] scoreDocs = docs.scoreDocs;
|
||||
if (end > docs.totalHits.value) end = (int) docs.totalHits.value;
|
||||
JSONArray array = new JSONArray();
|
||||
|
||||
for (int i = start; i < end; i++) {
|
||||
ScoreDoc scoreDoc = scoreDocs[i];
|
||||
Document doc = reader.document(scoreDoc.doc);
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("content",doc.get("fieldContent"));
|
||||
object.put("device_code",doc.get("device_code"));
|
||||
object.put("logTime",doc.get("logTime"));
|
||||
object.put("method",doc.get("method"));
|
||||
object.put("status_code",doc.get("status_code"));
|
||||
object.put("requestparam",doc.get("requestparam"));
|
||||
object.put("responseparam",doc.get("responseparam"));
|
||||
if(doc.get("fieldContent") != null) {
|
||||
array.add(object);
|
||||
}
|
||||
}
|
||||
for(Object logDto:array){
|
||||
log.info(logDto.toString());
|
||||
}
|
||||
reader.close();
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("content", array);
|
||||
jo.put("totalElements", docs.totalHits.value);
|
||||
return jo;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String indexDir = "D:\\lucene\\index";
|
||||
//查询这个字符串
|
||||
String q = "07.832";
|
||||
Map whereJson = null;
|
||||
try {
|
||||
search(indexDir, q,whereJson);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.config.lucene;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @deprecated 设置静态参数初始化
|
||||
*/
|
||||
@Configuration
|
||||
public class StaticConfig {
|
||||
//日志索引目录
|
||||
@Value("${lucene.index.path}")
|
||||
private String luceneDir;
|
||||
|
||||
@Bean
|
||||
public int initStatic() {
|
||||
UrlConfig.setLuceneUrl(luceneDir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.nl.config.lucene;
|
||||
|
||||
public class UrlConfig {
|
||||
public static String luceneUrl;
|
||||
|
||||
public static String getLuceneUrl() {
|
||||
return luceneUrl;
|
||||
}
|
||||
|
||||
public static void setLuceneUrl(String luceneUrl) {
|
||||
UrlConfig.luceneUrl = luceneUrl;
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,6 @@ import org.apache.commons.configuration.PropertiesConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author: lyd
|
||||
* @description: sql字段转java
|
||||
* @Date: 2022/12/3
|
||||
*/
|
||||
public class ColUtil {
|
||||
private static final Logger log = LoggerFactory.getLogger(ColUtil.class);
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package org.nl.modules.loki.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.annotation.RateLimiter;
|
||||
import org.nl.modules.loki.service.LokiService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 日志监控
|
||||
* @Date: 2022-08-15
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "日志监控")
|
||||
@RequestMapping("/api/loki")
|
||||
@Slf4j
|
||||
public class LokiController {
|
||||
|
||||
private final LokiService lokiService;
|
||||
|
||||
@GetMapping("/labels/values")
|
||||
@ApiOperation("获取标签")
|
||||
public ResponseEntity<Object> labelsValues() {
|
||||
return new ResponseEntity<>(lokiService.getLabelsValues(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/logs")
|
||||
@ApiOperation("获取日志")
|
||||
@RateLimiter(value = 1, timeout = 300) // 限流
|
||||
public ResponseEntity<Object> getLogData(@RequestBody JSONObject json) {
|
||||
return new ResponseEntity<>(lokiService.getLogData(json), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package org.nl.modules.loki.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 服务类
|
||||
* @Date: 2022-08-15
|
||||
*/
|
||||
public interface LokiService {
|
||||
|
||||
/**
|
||||
* 获取日志信息
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
JSONObject getLogData(JSONObject json);
|
||||
|
||||
/**
|
||||
* 获取labels和values树
|
||||
* @return
|
||||
*/
|
||||
JSONArray getLabelsValues();
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
package org.nl.modules.loki.service.impl;
|
||||
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.loki.service.LokiService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 实现类
|
||||
* @Date: 2022-08-15
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class LokiServiceImpl implements LokiService {
|
||||
|
||||
@Value("${loki.url}")
|
||||
private String lokiUrl;
|
||||
|
||||
@Value("${loki.systemName}")
|
||||
private String systemName;
|
||||
|
||||
@Override
|
||||
public JSONObject getLogData(JSONObject json) {
|
||||
String logLabel = "";
|
||||
String logLabelValue = "";
|
||||
Long start = 0L;
|
||||
Long end = 0L;
|
||||
String text = "";
|
||||
String limit = "100";
|
||||
String direction = "backward";
|
||||
if (json.get("logLabel") != null) logLabel = json.getString("logLabel");
|
||||
if (json.get("logLabelValue") != null) logLabelValue = json.getString("logLabelValue");
|
||||
if (json.get("text") != null) text = json.getString("text");
|
||||
if (json.get("start") != null) start = json.getLong("start");
|
||||
if (json.get("end") != null) end = json.getLong("end");
|
||||
if (json.get("limits") != null) limit = json.getString("limits");
|
||||
if (json.get("direction") != null) direction = json.getString("direction");
|
||||
/**
|
||||
* 组织参数
|
||||
* 纳秒数
|
||||
* 1660037391880000000
|
||||
* 1641453208415000000
|
||||
* http://localhost:3100/loki/api/v1/query_range?query={host="localhost"} |= ``&limit=1500&start=1641453208415000000&end=1660027623419419002
|
||||
*/
|
||||
JSONObject parse = null;
|
||||
String query = lokiUrl + "/query_range?query={system=\"" + systemName + "\", " + logLabel + "=\"" + logLabelValue + "\"} |= `" + text + "`";
|
||||
String result = "";
|
||||
if (start==0L) {
|
||||
result = HttpUtil.get(query + "&limit=" + limit + "&direction=" + direction, CharsetUtil.CHARSET_UTF_8);
|
||||
} else {
|
||||
result = HttpUtil.get(query + "&limit=" + limit + "&start=" + start + "&end=" + end + "&direction=" + direction, CharsetUtil.CHARSET_UTF_8);
|
||||
}
|
||||
try {
|
||||
parse = (JSONObject) JSONObject.parse(result);
|
||||
} catch (Exception e) {
|
||||
// reslut的值可能为:too many outstanding requests,无法转化成Json
|
||||
System.out.println("reslut:" + result);
|
||||
// e.printStackTrace();
|
||||
}
|
||||
return parse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取labels和values树
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JSONArray getLabelsValues() {
|
||||
/**
|
||||
* [{
|
||||
* label:
|
||||
* value:
|
||||
* children:[{
|
||||
* label
|
||||
* value
|
||||
* }]
|
||||
* }]
|
||||
*/
|
||||
JSONArray result = new JSONArray();
|
||||
// 获取所有标签
|
||||
String labelString = HttpUtil.get(lokiUrl + "/labels", CharsetUtil.CHARSET_UTF_8);
|
||||
JSONObject parse = (JSONObject) JSONObject.parse(labelString);
|
||||
JSONArray labels = parse.getJSONArray("data");
|
||||
for (int i=0; i<labels.size(); i++) {
|
||||
// 获取标签下的所有值
|
||||
String valueString = HttpUtil.get(lokiUrl + "/label/" + labels.getString(i) + "/values", CharsetUtil.CHARSET_UTF_8);
|
||||
JSONObject parse2 = (JSONObject) JSONObject.parse(valueString);
|
||||
JSONArray values = parse2.getJSONArray("data");
|
||||
JSONArray children = new JSONArray();
|
||||
// 组成树形状态 两级
|
||||
for (int j=0; j<values.size(); j++) {
|
||||
JSONObject leaf = new JSONObject();
|
||||
leaf.put("label", values.getString(j));
|
||||
leaf.put("value", values.getString(j));
|
||||
children.add(leaf);
|
||||
}
|
||||
|
||||
JSONObject node = new JSONObject();
|
||||
node.put("label", labels.getString(i));
|
||||
node.put("value", labels.getString(i));
|
||||
node.put("children", children);
|
||||
result.add(node);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,13 +4,13 @@ package org.nl.system.controller.coderule;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.coderule.ISysCodeRuleService;
|
||||
import org.nl.system.service.coderule.dao.SysCodeRule;
|
||||
import org.nl.system.service.coderule.dto.CodeRuleQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -30,10 +30,10 @@ import java.util.Set;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "系统:编码生成")
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/genCode")
|
||||
public class SysCodeRuleController {
|
||||
private final ISysCodeRuleService codeRuleService;
|
||||
@Autowired
|
||||
private ISysCodeRuleService codeRuleService;
|
||||
|
||||
@ApiOperation("查询编码")
|
||||
@GetMapping
|
||||
|
||||
@@ -4,13 +4,13 @@ package org.nl.system.controller.coderule;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.coderule.ISysCodeRuleDetailService;
|
||||
import org.nl.system.service.coderule.dao.SysCodeRuleDetail;
|
||||
import org.nl.system.service.coderule.dto.CodeRuleDetailQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -25,10 +25,11 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@Api(tags = "系统:编码详情管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/codeDetail")
|
||||
public class SysCodeRuleDetailController {
|
||||
private final ISysCodeRuleDetailService codeDetailService;
|
||||
|
||||
@Autowired
|
||||
private ISysCodeRuleDetailService codeDetailService;
|
||||
|
||||
@ApiOperation("查询编码明细")
|
||||
@GetMapping
|
||||
|
||||
@@ -20,7 +20,6 @@ import cn.dev33.satoken.annotation.SaMode;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -29,6 +28,7 @@ import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.dept.ISysDeptService;
|
||||
import org.nl.system.service.dept.dao.SysDept;
|
||||
import org.nl.system.service.dept.dto.DeptQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -43,12 +43,12 @@ import java.util.Set;
|
||||
* @date 2019-03-25
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "系统:部门管理")
|
||||
@RequestMapping("/api/dept")
|
||||
public class DeptController {
|
||||
|
||||
private final ISysDeptService deptService;
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@ApiOperation("查询部门")
|
||||
@GetMapping
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.nl.system.controller.dept;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2022-12-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sysUserDept")
|
||||
public class SysUserDeptController {
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.dict.dto.DictQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -28,11 +29,11 @@ import java.util.Set;
|
||||
* @since 2022-12-14
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/dict")
|
||||
public class SysDictController {
|
||||
|
||||
private final ISysDictService dictService;
|
||||
@Autowired
|
||||
private ISysDictService dictService;
|
||||
|
||||
@Log("查询字典")
|
||||
@GetMapping
|
||||
|
||||
@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.system.service.generator.ICodeGenConfigService;
|
||||
import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -22,11 +23,12 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@SaIgnore
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "系统:代码生成管理")
|
||||
@RequestMapping("api/genConfig")
|
||||
public class CodeGenConfigController {
|
||||
private final ICodeGenConfigService genConfigService;
|
||||
|
||||
@Autowired
|
||||
private ICodeGenConfigService genConfigService;
|
||||
|
||||
@ApiOperation("查询表数据")
|
||||
@GetMapping(value = "/{tableName}")
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package org.nl.system.controller.generator;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.system.service.generator.ICodeGenConfigService;
|
||||
import org.nl.system.service.generator.ICodeGeneratorService;
|
||||
import org.nl.system.service.generator.dao.CodeColumnConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -30,12 +29,13 @@ import java.util.List;
|
||||
*/
|
||||
@SaIgnore
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/generator")
|
||||
@Api(tags = "系统:代码生成管理")
|
||||
public class CodeGeneratorController {
|
||||
private final ICodeGeneratorService generatorService;
|
||||
private final ICodeGenConfigService genConfigService;
|
||||
@Autowired
|
||||
private ICodeGeneratorService generatorService;
|
||||
@Autowired
|
||||
private ICodeGenConfigService genConfigService;
|
||||
|
||||
@Value("${generator.enabled}")
|
||||
private Boolean generatorEnabled;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.system.controller.lucence;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.lucene.LuceneService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "日志检索")
|
||||
@RequestMapping("/api/lucene")
|
||||
@Slf4j
|
||||
public class LuceneController {
|
||||
|
||||
private final LuceneService luceneService;
|
||||
|
||||
@GetMapping("/getAll")
|
||||
@Log("日志检索")
|
||||
@ApiOperation("日志检索")
|
||||
//@PreAuthorize("@el.check('task:list')")
|
||||
public ResponseEntity<Object> get(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(luceneService.getAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import org.nl.system.service.menu.ISysMenuService;
|
||||
import org.nl.system.service.menu.dao.SysMenu;
|
||||
import org.nl.system.service.menu.dto.MenuDto;
|
||||
import org.nl.system.service.menu.dto.MenuQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -33,9 +34,9 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/sysMenu")
|
||||
@RequiredArgsConstructor
|
||||
public class SysMenuController {
|
||||
private final ISysMenuService iSysMenuService;
|
||||
@Autowired
|
||||
private ISysMenuService iSysMenuService;
|
||||
|
||||
@GetMapping(value = "/build")
|
||||
@ApiOperation("根据用户获取菜单")
|
||||
|
||||
@@ -3,13 +3,13 @@ package org.nl.system.controller.param;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.dao.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -31,10 +31,10 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/param")
|
||||
@RequiredArgsConstructor
|
||||
class SysParamController {
|
||||
|
||||
private final ISysParamService paramService;
|
||||
@Autowired
|
||||
private ISysParamService paramService;
|
||||
@GetMapping
|
||||
@Log("查询系统参数")
|
||||
@ApiOperation("查询系统参数")
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.nl.sso.service.dto.DataPermissionDto;
|
||||
import org.nl.system.service.permission.ISysDataPermissionService;
|
||||
import org.nl.system.service.permission.dao.SysDataPermission;
|
||||
import org.nl.system.service.permission.dto.SysDataPermissionQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -30,12 +31,12 @@ import java.util.Set;
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "数据管理")
|
||||
@RequestMapping("/api/dataPermission")
|
||||
public class SysDataPermissionController {
|
||||
|
||||
private final ISysDataPermissionService dataPermissionService;
|
||||
@Autowired
|
||||
private ISysDataPermissionService dataPermissionService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询数据权限")
|
||||
|
||||
@@ -4,7 +4,6 @@ package org.nl.system.controller.quartz;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
@@ -13,6 +12,7 @@ import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.quartz.ISysQuartzJobService;
|
||||
import org.nl.system.service.quartz.dao.SysQuartzJob;
|
||||
import org.nl.system.service.quartz.dto.JobQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -30,13 +30,13 @@ import java.util.Set;
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/jobs")
|
||||
@Api(tags = "系统:定时任务管理")
|
||||
public class SysQuartzJobController {
|
||||
private static final String ENTITY_NAME = "quartzJob";
|
||||
|
||||
private final ISysQuartzJobService quartzJobService;
|
||||
@Autowired
|
||||
private ISysQuartzJobService quartzJobService;
|
||||
|
||||
@ApiOperation("查询定时任务")
|
||||
@GetMapping
|
||||
|
||||
@@ -3,11 +3,11 @@ package org.nl.system.controller.role;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.role.ISysRoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -25,10 +25,10 @@ import java.util.Set;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/sysRole")
|
||||
@RequiredArgsConstructor
|
||||
public class SysRoleController {
|
||||
|
||||
private final ISysRoleService roleService;
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@ApiOperation("分页查询角色")
|
||||
@GetMapping
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.wf.captcha.base.Captcha;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
@@ -20,11 +19,12 @@ import org.nl.modules.system.service.RoleService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.system.service.secutiry.impl.OnlineUserService;
|
||||
import org.nl.system.service.user.ISysUserService;
|
||||
import org.nl.system.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -38,22 +38,25 @@ import java.util.concurrent.TimeUnit;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/auth")
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "系统:系统授权接口")
|
||||
public class AuthorizationController {
|
||||
private final RedisUtils redisUtils;
|
||||
private final OnlineUserService onlineUserService;
|
||||
private final ISysUserService userService;
|
||||
private final RoleService roleService;
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
@Autowired
|
||||
private OnlineUserService onlineUserService;
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private LoginProperties loginProperties;
|
||||
|
||||
@ApiOperation("登录授权")
|
||||
@PostMapping(value = "/login")
|
||||
public ResponseEntity<Object> login(@RequestBody Map authMap) throws Exception {
|
||||
if (ObjectUtil.isEmpty(authMap)){
|
||||
return ResponseEntity.noContent().build();
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
return ResponseEntity.ok(onlineUserService.login(authMap));
|
||||
}
|
||||
@@ -73,8 +76,7 @@ public class AuthorizationController {
|
||||
@GetMapping(value = "/userInfo")
|
||||
public ResponseEntity<Object> getUserInfo(Long loginId) {
|
||||
if (loginId != null){
|
||||
WQLObject userTab = WQLObject.getWQLObject("sys_user");
|
||||
JSONObject user = userTab.query("user_id = '" + loginId + "'").uniqueResult(0);
|
||||
SysUser user = userService.getById(loginId);
|
||||
return ResponseEntity.ok(user);
|
||||
}
|
||||
return ResponseEntity.noContent().build();
|
||||
|
||||
@@ -5,7 +5,6 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -14,6 +13,7 @@ import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.tools.IToolLocalStorageService;
|
||||
import org.nl.system.service.tools.dao.ToolLocalStorage;
|
||||
import org.nl.system.service.tools.dto.ToolLocalStorageQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -31,11 +31,11 @@ import java.util.Set;
|
||||
* @since 2022-12-20
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "工具:本地存储管理")
|
||||
@RequestMapping("/api/localStorage")
|
||||
public class ToolLocalStorageController {
|
||||
private final IToolLocalStorageService localStorageService;
|
||||
@Autowired
|
||||
private IToolLocalStorageService localStorageService;
|
||||
|
||||
@ApiOperation("查询文件")
|
||||
@GetMapping
|
||||
|
||||
@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.utils.EncryptUtils;
|
||||
import org.nl.system.service.secutiry.impl.OnlineUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -33,12 +34,12 @@ import java.util.Set;
|
||||
* @author Zheng Jie
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/auth/online")
|
||||
@Api(tags = "系统:在线用户管理")
|
||||
public class OnlineController {
|
||||
|
||||
private final OnlineUserService onlineUserService;
|
||||
@Autowired
|
||||
private OnlineUserService onlineUserService;
|
||||
|
||||
@ApiOperation("查询在线用户")
|
||||
@GetMapping
|
||||
|
||||
@@ -52,7 +52,7 @@ import java.util.Set;
|
||||
public class UserController {
|
||||
|
||||
@Autowired
|
||||
ISysUserService userService;
|
||||
private ISysUserService userService;
|
||||
|
||||
|
||||
@ApiOperation("查询用户")
|
||||
|
||||
@@ -5,15 +5,15 @@ import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.system.service.coderule.ISysCodeRuleDetailService;
|
||||
import org.nl.system.service.coderule.dao.SysCodeRuleDetail;
|
||||
import org.nl.system.service.coderule.dao.mapper.SysCodeRuleDetailMapper;
|
||||
import org.nl.system.service.coderule.ISysCodeRuleDetailService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.system.service.coderule.dto.CodeRuleDetailQuery;
|
||||
import org.nl.system.service.coderule.utils.CodeRuleTypeEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -28,10 +28,9 @@ import java.util.Date;
|
||||
* @since 2022-12-20
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SysCodeRuleDetailServiceImpl extends ServiceImpl<SysCodeRuleDetailMapper, SysCodeRuleDetail> implements ISysCodeRuleDetailService {
|
||||
|
||||
private final SysCodeRuleDetailMapper codeRuleDetailMapper;
|
||||
@Autowired
|
||||
private SysCodeRuleDetailMapper codeRuleDetailMapper;
|
||||
@Override
|
||||
public IPage<SysCodeRuleDetail> queryAll(CodeRuleDetailQuery form, PageQuery page) {
|
||||
LambdaQueryWrapper<SysCodeRuleDetail> lam = new LambdaQueryWrapper<>();
|
||||
|
||||
@@ -6,19 +6,19 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.tools.MapOf;
|
||||
import org.nl.system.service.coderule.ISysCodeRuleService;
|
||||
import org.nl.system.service.coderule.dao.SysCodeRule;
|
||||
import org.nl.system.service.coderule.dao.SysCodeRuleDetail;
|
||||
import org.nl.system.service.coderule.dao.mapper.SysCodeRuleDetailMapper;
|
||||
import org.nl.system.service.coderule.dao.mapper.SysCodeRuleMapper;
|
||||
import org.nl.system.service.coderule.ISysCodeRuleService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.system.service.coderule.dto.CodeRuleQuery;
|
||||
import org.nl.system.service.coderule.utils.CodeRuleTypeEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -36,11 +36,11 @@ import java.util.Set;
|
||||
* @since 2022-12-19
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCodeRule> implements ISysCodeRuleService {
|
||||
|
||||
private final SysCodeRuleMapper codeRuleMapper;
|
||||
private final SysCodeRuleDetailMapper codeRuleDetailMapper;
|
||||
@Autowired
|
||||
private SysCodeRuleMapper codeRuleMapper;
|
||||
@Autowired
|
||||
private SysCodeRuleDetailMapper codeRuleDetailMapper;
|
||||
|
||||
@Override
|
||||
public IPage<SysCodeRule> queryAll(CodeRuleQuery form, PageQuery pageable) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.dict.dao.mapper.SysDictMapper;
|
||||
import org.nl.system.service.dict.dto.DictQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -32,10 +33,9 @@ import java.util.Set;
|
||||
* @since 2022-12-14
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> implements ISysDictService {
|
||||
|
||||
private final SysDictMapper sysDictMapper;
|
||||
@Autowired
|
||||
private SysDictMapper sysDictMapper;
|
||||
|
||||
@Override
|
||||
public IPage<Dict> queryAll(Map whereJson, PageQuery page) {
|
||||
|
||||
@@ -4,11 +4,11 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.system.service.generator.ICodeGenConfigService;
|
||||
import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||
import org.nl.system.service.generator.dao.mapper.CodeGenConfigMapper;
|
||||
import org.nl.system.service.generator.ICodeGenConfigService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
@@ -22,10 +22,10 @@ import java.io.File;
|
||||
* @since 2023-05-03
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CodeGenConfigServiceImpl extends ServiceImpl<CodeGenConfigMapper, CodeGenConfig> implements ICodeGenConfigService {
|
||||
|
||||
private final CodeGenConfigMapper codeGenConfigMapper;
|
||||
@Autowired
|
||||
private CodeGenConfigMapper codeGenConfigMapper;
|
||||
|
||||
@Override
|
||||
public CodeGenConfig findByTableName(String tableName) {
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.FileUtil;
|
||||
@@ -20,6 +19,7 @@ import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||
import org.nl.system.service.generator.dao.mapper.CodeColumnConfigMapper;
|
||||
import org.nl.system.service.generator.dto.ColumnInfo;
|
||||
import org.nl.system.service.generator.dto.TablesInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -41,10 +41,10 @@ import java.util.stream.Collectors;
|
||||
* @since 2023-05-03
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CodeGeneratorServiceImpl extends ServiceImpl<CodeColumnConfigMapper, CodeColumnConfig> implements ICodeGeneratorService {
|
||||
|
||||
private final CodeColumnConfigMapper columnConfigMapper;
|
||||
@Autowired
|
||||
private CodeColumnConfigMapper columnConfigMapper;
|
||||
|
||||
@Override
|
||||
public IPage<TablesInfo> getTables(String name, PageQuery pageQuery) {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.nl.system.service.lucene;
|
||||
|
||||
import org.nl.system.service.lucene.dto.LuceneLogDto;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public interface LuceneExecuteLogService {
|
||||
/**
|
||||
* 设备光电变化实时光电信号
|
||||
*
|
||||
* @param device_code 设备编号
|
||||
* @param key plc信号
|
||||
* @param value plc信号值
|
||||
*/
|
||||
void deviceItemValue(String device_code, String key, String value);
|
||||
|
||||
/**
|
||||
* 设备执行日志,会保留历史记录
|
||||
*
|
||||
* @param luceneLogDto 日志结果对象
|
||||
*/
|
||||
void deviceExecuteLog(LuceneLogDto luceneLogDto);
|
||||
|
||||
/**
|
||||
* 接口日志,会保留历史记录
|
||||
*
|
||||
* @param luceneLogDto 日志结果对象
|
||||
*/
|
||||
void interfaceExecuteLog(LuceneLogDto luceneLogDto) throws IOException;
|
||||
|
||||
/**
|
||||
* 设备执行日志,会保留历史记录
|
||||
*
|
||||
* @param name 日志名称
|
||||
* @param message 日志信息
|
||||
*/
|
||||
void extLog(String name, String message);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.system.service.lucene;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public interface LuceneService {
|
||||
|
||||
/**
|
||||
* 获取数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> getAll(Map whereJson, Pageable page);
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.nl.system.service.lucene.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LuceneLogDto {
|
||||
|
||||
/* 日志标识 */
|
||||
private String log_uuid;
|
||||
/*日志类型*/
|
||||
private String logType;
|
||||
/*设备编号*/
|
||||
private String device_code;
|
||||
/*内容详情*/
|
||||
private String content;
|
||||
|
||||
/* 任务编码 */
|
||||
private String task_code;
|
||||
|
||||
/* 指令编码 */
|
||||
private String instruct_code;
|
||||
|
||||
/* 任务标识 */
|
||||
private String task_id;
|
||||
|
||||
/* 载具号 */
|
||||
private String vehicle_code;
|
||||
|
||||
/* 备注 */
|
||||
private String remark;
|
||||
|
||||
/* 日志类型 */
|
||||
private String log_type;
|
||||
|
||||
/* 方法 */
|
||||
private String method;
|
||||
|
||||
/* 请求参数 */
|
||||
private String requestparam;
|
||||
|
||||
/* 响应参数 */
|
||||
private String responseparam;
|
||||
|
||||
/* 请求地址 */
|
||||
private String requesturl;
|
||||
|
||||
/* 状态码 */
|
||||
private String status_code;
|
||||
|
||||
/* 是否删除 1:是;0:否 */
|
||||
private String is_delete;
|
||||
|
||||
/* 创建者 */
|
||||
private String create_by;
|
||||
|
||||
/* 创建时间 YYYY-MM-DD hh:mm:ss */
|
||||
private String create_time;
|
||||
|
||||
/* 修改者 */
|
||||
private String update_by;
|
||||
|
||||
/* 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
|
||||
|
||||
public LuceneLogDto (final String opc_server_code,final String opc_plc_code,
|
||||
final String device_code,final String to_home,final int last_home,
|
||||
final int home) {
|
||||
super ();
|
||||
this.device_code = device_code;
|
||||
this.content = "信号"
|
||||
+ opc_server_code + "."
|
||||
+ opc_plc_code + "."
|
||||
+ device_code + "."
|
||||
+ to_home + "变更从"
|
||||
+ last_home + "->"
|
||||
+ home;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package org.nl.system.service.lucene.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.StringField;
|
||||
import org.apache.lucene.document.TextField;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
import org.nl.common.enums.LogTypeEnum;
|
||||
import org.nl.config.lucene.LuceneIndexWriter;
|
||||
import org.nl.system.service.lucene.LuceneExecuteLogService;
|
||||
import org.nl.system.service.lucene.dto.LuceneLogDto;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author jlm
|
||||
* @description 服务实现
|
||||
* @date 2023-04-11
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class LuceneExecuteLogServiceImpl implements LuceneExecuteLogService {
|
||||
|
||||
@Override
|
||||
public void deviceItemValue(String device_code, String key, String value) {
|
||||
String now = DateUtil.now();
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public void deviceExecuteLog(LuceneLogDto luceneLogDto) {
|
||||
luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc());
|
||||
addIndex(luceneLogDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void interfaceExecuteLog(LuceneLogDto luceneLogDto) throws IOException {
|
||||
luceneLogDto.setLogType(LogTypeEnum.INTERFACE_LOG.getDesc());
|
||||
addIndex(luceneLogDto);
|
||||
}
|
||||
|
||||
private void addIndex(LuceneLogDto luceneLogDto) throws IOException {
|
||||
IndexWriter indexWriter = LuceneIndexWriter.getIndexWriter();
|
||||
//创建一个Document对象
|
||||
Document document = new Document();
|
||||
try {
|
||||
//记录索引开始时间
|
||||
long startTime = System.currentTimeMillis();
|
||||
//向document对象中添加域。
|
||||
if (ObjectUtil.isNotEmpty(luceneLogDto.getDevice_code())) {
|
||||
document.add(new StringField("device_code", luceneLogDto.getDevice_code(), Field.Store.YES));
|
||||
// document.add(new TextField("device_code", luceneLogDto.getDevice_code(), Field.Store.YES));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(luceneLogDto.getContent())) {
|
||||
document.add(new TextField("fieldContent", luceneLogDto.getContent(), Field.Store.YES));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(luceneLogDto.getMethod())) {
|
||||
document.add(new StringField("method", luceneLogDto.getMethod(), Field.Store.YES));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(luceneLogDto.getStatus_code())) {
|
||||
document.add(new StringField("status_code", luceneLogDto.getStatus_code(), Field.Store.YES));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(luceneLogDto.getRequestparam())) {
|
||||
document.add(new TextField("requestparam", luceneLogDto.getRequestparam(), Field.Store.YES));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(luceneLogDto.getResponseparam())) {
|
||||
document.add(new TextField("responseparam", luceneLogDto.getResponseparam(), Field.Store.YES));
|
||||
}
|
||||
document.add(new StringField("logType", luceneLogDto.getLogType(), Field.Store.YES));
|
||||
document.add(new StringField("logTime", DateUtil.format(new DateTime(), "yyyy-MM-dd HH:mm:ss.SSS"), Field.Store.YES));
|
||||
indexWriter.addDocument(document);
|
||||
//记录索引结束时间
|
||||
long endTime = System.currentTimeMillis();
|
||||
log.info("建立索引共耗时{}毫秒", endTime - startTime);
|
||||
indexWriter.commit();
|
||||
MDC.put("DEVICECODE", luceneLogDto.getDevice_code());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
} finally {
|
||||
// MDC.remove("DEVICECODE");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extLog(String name, String message) {
|
||||
try {
|
||||
MDC.put(name, name);
|
||||
log.info("{}", message);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
MDC.remove(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.nl.system.service.lucene.impl;
|
||||
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.config.lucene.Searcher;
|
||||
import org.nl.system.service.lucene.LuceneService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class LuceneServiceImpl implements LuceneService {
|
||||
|
||||
//日志索引目录
|
||||
@Value("${lucene.index.path}")
|
||||
private String luceneUrl;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getAll(Map whereJson, Pageable page) {
|
||||
JSONObject jo = new JSONObject();
|
||||
try {
|
||||
JSONObject jsonObject = (JSONObject) Searcher.search(luceneUrl, "", whereJson);
|
||||
JSONArray array = jsonObject.getJSONArray("content");
|
||||
int totalElements = Integer.parseInt(jsonObject.get("totalElements").toString());
|
||||
jo.put("content", array);
|
||||
jo.put("totalElements", totalElements);
|
||||
} catch (Exception e) {
|
||||
log.error("索引查询为空", e);
|
||||
throw new NullPointerException("索引查询为空");
|
||||
}
|
||||
|
||||
return jo;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,11 +21,14 @@ import org.nl.modules.system.util.CopyUtil;
|
||||
import org.nl.modules.tools.IdUtil;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.dict.dao.mapper.SysDictMapper;
|
||||
import org.nl.system.service.lucene.LuceneExecuteLogService;
|
||||
import org.nl.system.service.lucene.dto.LuceneLogDto;
|
||||
import org.nl.system.service.menu.dto.MenuDto;
|
||||
import org.nl.system.service.menu.ISysMenuService;
|
||||
import org.nl.system.service.menu.dao.SysMenu;
|
||||
import org.nl.system.service.menu.dao.mapper.SysMenuMapper;
|
||||
import org.nl.system.service.menu.dto.MenuQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -42,12 +45,17 @@ import java.util.stream.Collectors;
|
||||
* @since 2022-12-15
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService {
|
||||
|
||||
private final SysMenuMapper baseMapper;
|
||||
private final SysDictMapper sysDictMapper;
|
||||
@Autowired
|
||||
private SysMenuMapper baseMapper;
|
||||
|
||||
@Autowired
|
||||
private SysDictMapper sysDictMapper;
|
||||
|
||||
@Autowired
|
||||
private LuceneExecuteLogService luceneExecuteLogService;
|
||||
|
||||
@Override
|
||||
public List<MenuDto> queryAll(Map<String, Object> param) {
|
||||
@@ -59,6 +67,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
|
||||
@Override
|
||||
public List query(MenuQuery query, PageQuery page) {
|
||||
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder().log_type("we").device_code("sd").content("saf").build());
|
||||
if (StringUtils.isNotEmpty(query.getBlurry())){
|
||||
query.setPid(null);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.system.service.param.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -20,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -66,7 +68,14 @@ public class SysParamServiceImpl extends ServiceImpl<SysParamMapper, Param> impl
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Param param) {
|
||||
Param paramObj = paramMapper.selectById(param.getId());
|
||||
if (ObjectUtil.isEmpty(paramObj)) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (ObjectUtil.isEmpty(paramObj)) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
Param param1 = paramMapper.selectOne(new LambdaQueryWrapper<Param>().eq(Param::getCode, param.getCode())
|
||||
.and(lam -> lam.ne(Param::getId, param.getId())));
|
||||
if (ObjectUtil.isNotEmpty(param1)) {
|
||||
throw new BadRequestException("编码[" + param.getCode() + "]已存在");
|
||||
}
|
||||
param.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
param.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
param.setUpdate_time(DateUtil.now());
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
<mapper namespace="org.nl.system.service.permission.dao.mapper.SysDataPermissionMapper">
|
||||
<insert id="insertDataScope">
|
||||
INSERT INTO sys_data_scope(self_user_id, permission_scope_type, user_id)
|
||||
VALUES (#{dataScope.selfUserId}, #{dataScope.permissionScopeType}, #{dataScope.userId})
|
||||
VALUES (#{dataScope.self_user_id}, #{dataScope.permission_scope_type}, #{dataScope.user_id})
|
||||
</insert>
|
||||
<insert id="insertDataScopes">
|
||||
INSERT INTO sys_data_scope(self_user_id, permission_scope_type, user_id, dept_id)
|
||||
VALUES (#{dataScope.selfUserId}, #{dataScope.permissionScopeType}, #{dataScope.userId}, #{dataScope.deptId})
|
||||
VALUES (#{dataScope.self_user_id}, #{dataScope.permission_scope_type}, #{dataScope.user_id}, #{dataScope.dept_id})
|
||||
</insert>
|
||||
<delete id="deleteScopeBySelfUserId">
|
||||
DELETE FROM sys_data_scope WHERE self_user_id = #{userId}
|
||||
|
||||
@@ -7,21 +7,21 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.dict.dao.mapper.SysDictMapper;
|
||||
import org.nl.system.service.permission.ISysDataPermissionService;
|
||||
import org.nl.system.service.permission.dao.SysDataPermission;
|
||||
import org.nl.system.service.permission.dao.SysDataScope;
|
||||
import org.nl.system.service.permission.dao.mapper.SysDataPermissionMapper;
|
||||
import org.nl.system.service.permission.ISysDataPermissionService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.system.service.permission.dto.DataScopeEnum;
|
||||
import org.nl.system.service.permission.dto.SysDataPermissionQuery;
|
||||
import org.nl.system.service.user.ISysUserService;
|
||||
import org.nl.system.service.user.dto.UserDataPermissionDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -37,12 +37,14 @@ import java.util.Set;
|
||||
* @since 2022-12-20
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SysDataPermissionServiceImpl extends ServiceImpl<SysDataPermissionMapper, SysDataPermission> implements ISysDataPermissionService {
|
||||
|
||||
private final SysDataPermissionMapper dataPermissionMapper;
|
||||
private final ISysUserService userService;
|
||||
private final SysDictMapper dictMapper;
|
||||
@Autowired
|
||||
private SysDataPermissionMapper dataPermissionMapper;
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private SysDictMapper dictMapper;
|
||||
|
||||
@Override
|
||||
public IPage<SysDataPermission> queryAll(SysDataPermissionQuery dataPermissionQuery, PageQuery page) {
|
||||
@@ -122,7 +124,7 @@ public class SysDataPermissionServiceImpl extends ServiceImpl<SysDataPermissionM
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void savePermission(JSONObject datas) {
|
||||
String user_id = datas.getString("userId");
|
||||
String user_id = datas.getString("user_id");
|
||||
JSONArray data = datas.getJSONArray("datas");
|
||||
if (ObjectUtil.isEmpty(user_id)) throw new BadRequestException("用户不能为空");
|
||||
// 删除用户绑定的数据
|
||||
@@ -131,7 +133,7 @@ public class SysDataPermissionServiceImpl extends ServiceImpl<SysDataPermissionM
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject scopeObj = data.getJSONObject(i);
|
||||
String permission_scope_type = scopeObj.getString("value");
|
||||
String permission_id = scopeObj.getString("permissionId");
|
||||
String permission_id = scopeObj.getString("permission_id");
|
||||
UserDataPermissionDto userDataPermissionDto = new UserDataPermissionDto();
|
||||
userDataPermissionDto.setUser_id(user_id);
|
||||
userDataPermissionDto.setPermission_id(permission_id);
|
||||
@@ -142,7 +144,7 @@ public class SysDataPermissionServiceImpl extends ServiceImpl<SysDataPermissionM
|
||||
if (ObjectUtil.isNotEmpty(users)) { // 如果是用户直接将用户的id绑定进去
|
||||
for (int j = 0; j < users.size(); j++) {
|
||||
JSONObject user = users.getJSONObject(j);
|
||||
String userId = user.getString("userId");
|
||||
String userId = user.getString("user_id");
|
||||
SysDataScope dataScope = new SysDataScope();
|
||||
dataScope.setUser_id(userId);
|
||||
dataScope.setSelf_user_id(user_id);
|
||||
@@ -154,12 +156,12 @@ public class SysDataPermissionServiceImpl extends ServiceImpl<SysDataPermissionM
|
||||
if (ObjectUtil.isNotEmpty(depts)) { // 如果是部门,先根据部门id求出所有的用户id
|
||||
for (int j = 0; j < depts.size(); j++) {
|
||||
JSONObject dept = depts.getJSONObject(j);
|
||||
String deptId = dept.getString("deptId");
|
||||
List<String> user_ids = userService.getUserIdByDeptId(deptId);
|
||||
String dept_id = dept.getString("dept_id");
|
||||
List<String> user_ids = userService.getUserIdByDeptId(dept_id);
|
||||
user_ids.forEach(id -> {
|
||||
SysDataScope dataScope = new SysDataScope();
|
||||
dataScope.setUser_id(id);
|
||||
dataScope.setDept_id(deptId);
|
||||
dataScope.setDept_id(dept_id);
|
||||
dataScope.setSelf_user_id(user_id);
|
||||
dataScope.setPermission_scope_type(permission_scope_type);
|
||||
dataPermissionMapper.insertDataScopes(dataScope);
|
||||
|
||||
@@ -7,20 +7,20 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.system.service.quartz.ISysQuartzJobService;
|
||||
import org.nl.system.service.quartz.dao.SysQuartzJob;
|
||||
import org.nl.system.service.quartz.dao.SysQuartzLog;
|
||||
import org.nl.system.service.quartz.dao.mapper.SysQuartzJobMapper;
|
||||
import org.nl.system.service.quartz.ISysQuartzJobService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.system.service.quartz.dao.mapper.SysQuartzLogMapper;
|
||||
import org.nl.system.service.quartz.dto.JobQuery;
|
||||
import org.nl.system.service.quartz.utils.QuartzManage;
|
||||
import org.quartz.CronExpression;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -38,13 +38,15 @@ import java.util.Set;
|
||||
* @since 2022-12-19
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SysQuartzJobServiceImpl extends ServiceImpl<SysQuartzJobMapper, SysQuartzJob> implements ISysQuartzJobService {
|
||||
|
||||
private final SysQuartzJobMapper quartzJobMapper;
|
||||
private final SysQuartzLogMapper quartzLogMapper;
|
||||
private final QuartzManage quartzManage;
|
||||
private final RedisUtils redisUtils;
|
||||
@Autowired
|
||||
private SysQuartzJobMapper quartzJobMapper;
|
||||
@Autowired
|
||||
private SysQuartzLogMapper quartzLogMapper;
|
||||
@Autowired
|
||||
private QuartzManage quartzManage;
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
|
||||
@Override
|
||||
public IPage<SysQuartzJob> queryAll(JobQuery criteria, PageQuery pageable) {
|
||||
|
||||
@@ -10,15 +10,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.system.service.menu.dao.mapper.SysMenuMapper;
|
||||
import org.nl.system.service.role.ISysRoleService;
|
||||
import org.nl.system.service.role.dao.SysRole;
|
||||
import org.nl.system.service.role.dao.mapper.SysRoleMapper;
|
||||
import org.nl.system.service.menu.dao.mapper.SysMenuMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -34,12 +34,12 @@ import java.util.*;
|
||||
* @since 2022-12-15
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {
|
||||
|
||||
private final SysRoleMapper roleMapper;
|
||||
|
||||
private final SysMenuMapper sysMenuMapper;
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
@Autowired
|
||||
private SysMenuMapper sysMenuMapper;
|
||||
|
||||
@Override
|
||||
public IPage<SysRole> query(Map param, PageQuery page) {
|
||||
@@ -112,7 +112,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateMenu(JSONObject form) {
|
||||
String roleId = form.getString("roleId");
|
||||
String roleId = form.getString("role_id");
|
||||
JSONArray menus = form.getJSONArray("menus");
|
||||
Set<String> menuIds = new HashSet<>();
|
||||
for (int i = 0; i < menus.size(); i++) {
|
||||
|
||||
@@ -56,7 +56,8 @@ public class OnlineUserService {
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
private final RedisUtils redisUtils;
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
|
||||
public OnlineUserService(RedisUtils redisUtils) {
|
||||
this.redisUtils = redisUtils;
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.nl.system.service.tools.dao.mapper.ToolLocalStorageMapper;
|
||||
import org.nl.system.service.tools.IToolLocalStorageService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.system.service.tools.dto.ToolLocalStorageQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -32,11 +33,12 @@ import java.util.Set;
|
||||
* @since 2022-12-20
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ToolLocalStorageServiceImpl extends ServiceImpl<ToolLocalStorageMapper, ToolLocalStorage> implements IToolLocalStorageService {
|
||||
|
||||
private final FileProperties properties;
|
||||
private final ToolLocalStorageMapper localStorageMapper;
|
||||
@Autowired
|
||||
private FileProperties properties;
|
||||
@Autowired
|
||||
private ToolLocalStorageMapper localStorageMapper;
|
||||
|
||||
@Override
|
||||
public IPage<ToolLocalStorage> queryAll(ToolLocalStorageQuery criteria, PageQuery pageable) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
sys_user.extuser_id as extuserId
|
||||
</sql>
|
||||
<insert id="insertDataPermission">
|
||||
INSERT INTO sys_user_data_permission(user_id, permission_scope_type, permission_id) VALUES (#{dataPermission.userId}, #{dataPermission.permissionScopeType}, #{dataPermission.permissionId})
|
||||
INSERT INTO sys_user_data_permission(user_id, permission_scope_type, permission_id) VALUES (#{dataPermission.user_id}, #{dataPermission.permission_scope_type}, #{dataPermission.permission_id})
|
||||
</insert>
|
||||
<delete id="deleteDataPermissionById">
|
||||
DELETE FROM sys_user_data_permission WHERE user_id = #{userId}
|
||||
|
||||
@@ -100,22 +100,19 @@ public class ISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> imp
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(Map userDetail) {
|
||||
if(CollectionUtils.isEmpty(userDetail)|| userDetail.get("userId")==null){
|
||||
if(CollectionUtils.isEmpty(userDetail) || ObjectUtil.isEmpty(userDetail.get("user_id"))){
|
||||
return;
|
||||
}
|
||||
|
||||
SysUser sysUser = new SysUser();
|
||||
org.springframework.beans.BeanUtils.copyProperties(userDetail,sysUser);
|
||||
//转换器
|
||||
ConvertUtils.register(new Converter() {
|
||||
@Override
|
||||
public Object convert(Class aClass, Object o) {
|
||||
try {
|
||||
if (o == null){ return null; }
|
||||
return new SimpleDateFormat("yyyy-MM-dd").parse(o.toString());
|
||||
}catch (Exception ex){
|
||||
return null;
|
||||
}
|
||||
ConvertUtils.register((aClass, o) -> {
|
||||
try {
|
||||
if (o == null){ return null; }
|
||||
return new SimpleDateFormat("yyyy-MM-dd").parse(o.toString());
|
||||
}catch (Exception ex){
|
||||
return null;
|
||||
}
|
||||
}, Date.class);
|
||||
try {
|
||||
|
||||
@@ -31,10 +31,10 @@ public class MdBaseWorkshop implements Serializable {
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
private String is_used;
|
||||
private Boolean is_used;
|
||||
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
private String is_delete;
|
||||
private Boolean is_delete;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String create_id;
|
||||
|
||||
@@ -46,7 +46,6 @@ public class MdBaseWorkshopServiceImpl extends ServiceImpl<MdBaseWorkshopMapper,
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
entity.setWorkshop_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setCreate_id(currentUserId);
|
||||
entity.setCreate_name(nickName);
|
||||
entity.setCreate_time(now);
|
||||
@@ -58,9 +57,6 @@ public class MdBaseWorkshopServiceImpl extends ServiceImpl<MdBaseWorkshopMapper,
|
||||
|
||||
@Override
|
||||
public void update(MdBaseWorkshop entity) {
|
||||
MdBaseWorkshop dto = mdBaseWorkshopMapper.selectById(entity.getWorkshop_code());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.nl.wms.pdm.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.pdm.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "工单管理管理")
|
||||
@RequestMapping("/api/pdmBdWorkorder")
|
||||
public class PdmBdWorkorderController {
|
||||
|
||||
@Autowired
|
||||
private IPdmBdWorkorderService pdmBdWorkorderService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询工单管理")
|
||||
@ApiOperation("查询工单管理")
|
||||
//@SaCheckPermission("@el.check('pdmBdWorkorder:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
||||
return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增工单管理")
|
||||
@ApiOperation("新增工单管理")
|
||||
//@SaCheckPermission("@el.check('pdmBdWorkorder:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody PdmBdWorkorder entity){
|
||||
pdmBdWorkorderService.create(entity);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改工单管理")
|
||||
@ApiOperation("修改工单管理")
|
||||
//@SaCheckPermission("@el.check('pdmBdWorkorder:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody PdmBdWorkorder entity){
|
||||
pdmBdWorkorderService.update(entity);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除工单管理")
|
||||
@ApiOperation("删除工单管理")
|
||||
//@SaCheckPermission("@el.check('pdmBdWorkorder:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
pdmBdWorkorderService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package org.nl.wms.pdm.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
public interface IPdmBdWorkorderService extends IService<PdmBdWorkorder> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param pageable 分页参数
|
||||
* @return IPage<PdmBdWorkorder>
|
||||
*/
|
||||
IPage<PdmBdWorkorder> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param entity /
|
||||
*/
|
||||
void create(PdmBdWorkorder entity);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param entity /
|
||||
*/
|
||||
void update(PdmBdWorkorder entity);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package org.nl.wms.pdm.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("pdm_bd_workorder")
|
||||
public class PdmBdWorkorder implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "workorder_id", type = IdType.NONE)
|
||||
@ApiModelProperty(value = "工单标识")
|
||||
private String workorder_id;
|
||||
|
||||
@ApiModelProperty(value = "工单编号")
|
||||
private String workorder_code;
|
||||
|
||||
@ApiModelProperty(value = "生产日期")
|
||||
private String produce_date;
|
||||
|
||||
@ApiModelProperty(value = "计划数量")
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
@ApiModelProperty(value = "实际数量")
|
||||
private BigDecimal real_qty;
|
||||
|
||||
@ApiModelProperty(value = "物料标识")
|
||||
private String material_id;
|
||||
|
||||
@ApiModelProperty(value = "载具类型")
|
||||
private String vehicle_type;
|
||||
|
||||
@ApiModelProperty(value = "计划开始时间")
|
||||
private String planproducestart_date;
|
||||
|
||||
@ApiModelProperty(value = "计划结束时间")
|
||||
private String planproduceend_date;
|
||||
|
||||
@ApiModelProperty(value = "实际开始时间")
|
||||
private String realproducestart_date;
|
||||
|
||||
@ApiModelProperty(value = "实际结束时间")
|
||||
private String realproduceend_date;
|
||||
|
||||
@ApiModelProperty(value = "静置时间(分钟)")
|
||||
private BigDecimal standing_time;
|
||||
|
||||
@ApiModelProperty(value = "点位编码")
|
||||
private String point_code;
|
||||
|
||||
@ApiModelProperty(value = "点位名称")
|
||||
private String point_name;
|
||||
|
||||
@ApiModelProperty(value = "区域编码")
|
||||
private String region_code;
|
||||
|
||||
@ApiModelProperty(value = "区域名称")
|
||||
private String region_name;
|
||||
|
||||
@ApiModelProperty(value = "工单状态")
|
||||
private String workorder_status;
|
||||
|
||||
@ApiModelProperty(value = "是否需要AGV搬运")
|
||||
private String is_needmove;
|
||||
|
||||
@ApiModelProperty(value = "工单类型")
|
||||
private String workorder_type;
|
||||
|
||||
@ApiModelProperty(value = "回传MES状态")
|
||||
private String passback_status;
|
||||
|
||||
@ApiModelProperty(value = "车间编码")
|
||||
private String workshop_code;
|
||||
|
||||
@ApiModelProperty(value = "外部标识")
|
||||
private String ext_id;
|
||||
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
private Boolean is_delete;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String create_id;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String create_name;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String create_time;
|
||||
|
||||
@ApiModelProperty(value = "修改人")
|
||||
private String update_id;
|
||||
|
||||
@ApiModelProperty(value = "修改人")
|
||||
private String update_name;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private String update_time;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.nl.wms.pdm.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
public interface PdmBdWorkorderMapper extends BaseMapper<PdmBdWorkorder> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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="org.nl.wms.pdm.service.dao.mapper.PdmBdWorkorderMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,101 @@
|
||||
package org.nl.wms.pdm.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
@Data
|
||||
public class PdmBdWorkorderDto implements Serializable {
|
||||
|
||||
/** 工单标识 */
|
||||
private String workorder_id;
|
||||
|
||||
/** 工单编号 */
|
||||
private String workorder_code;
|
||||
|
||||
/** 生产日期 */
|
||||
private String produce_date;
|
||||
|
||||
/** 计划数量 */
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
/** 实际数量 */
|
||||
private BigDecimal real_qty;
|
||||
|
||||
/** 物料标识 */
|
||||
private String material_id;
|
||||
|
||||
/** 载具类型 */
|
||||
private String vehicle_type;
|
||||
|
||||
/** 计划开始时间 */
|
||||
private String planproducestart_date;
|
||||
|
||||
/** 计划结束时间 */
|
||||
private String planproduceend_date;
|
||||
|
||||
/** 实际开始时间 */
|
||||
private String realproducestart_date;
|
||||
|
||||
/** 实际结束时间 */
|
||||
private String realproduceend_date;
|
||||
|
||||
/** 静置时间(分钟) */
|
||||
private BigDecimal standing_time;
|
||||
|
||||
/** 点位编码 */
|
||||
private String point_code;
|
||||
|
||||
/** 点位名称 */
|
||||
private String point_name;
|
||||
|
||||
/** 区域编码 */
|
||||
private String region_code;
|
||||
|
||||
/** 区域名称 */
|
||||
private String region_name;
|
||||
|
||||
/** 工单状态 */
|
||||
private String workorder_status;
|
||||
|
||||
/** 是否需要AGV搬运 */
|
||||
private String is_needmove;
|
||||
|
||||
/** 工单类型 */
|
||||
private String workorder_type;
|
||||
|
||||
/** 回传MES状态 */
|
||||
private String passback_status;
|
||||
|
||||
/** 车间编码 */
|
||||
private String workshop_code;
|
||||
|
||||
/** 外部标识 */
|
||||
private String ext_id;
|
||||
|
||||
/** 是否删除 */
|
||||
private Boolean is_delete;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_id;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private String update_id;
|
||||
|
||||
/** 修改人 */
|
||||
private String update_name;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.nl.wms.pdm.service.dto;
|
||||
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
public class PdmBdWorkorderQuery extends BaseQuery<PdmBdWorkorder> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package org.nl.wms.pdm.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.wms.pdm.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.pdm.service.dao.mapper.PdmBdWorkorderMapper;
|
||||
import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper, PdmBdWorkorder> implements IPdmBdWorkorderService {
|
||||
|
||||
@Autowired
|
||||
private PdmBdWorkorderMapper pdmBdWorkorderMapper;
|
||||
|
||||
@Override
|
||||
public IPage<PdmBdWorkorder> queryAll(Map whereJson, PageQuery page){
|
||||
LambdaQueryWrapper<PdmBdWorkorder> lam = new LambdaQueryWrapper<>();
|
||||
IPage<PdmBdWorkorder> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
pdmBdWorkorderMapper.selectPage(pages, lam);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(PdmBdWorkorder entity) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
entity.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setCreate_id(currentUserId);
|
||||
entity.setCreate_name(nickName);
|
||||
entity.setCreate_time(now);
|
||||
entity.setUpdate_id(currentUserId);
|
||||
entity.setUpdate_name(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
pdmBdWorkorderMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(PdmBdWorkorder entity) {
|
||||
PdmBdWorkorder dto = pdmBdWorkorderMapper.selectById(entity.getWorkorder_id());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
entity.setUpdate_id(currentUserId);
|
||||
entity.setUpdate_name(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
|
||||
pdmBdWorkorderMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Set<String> ids) {
|
||||
// 真删除
|
||||
pdmBdWorkorderMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -161,8 +161,3 @@ sa-token:
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
|
||||
|
||||
loki:
|
||||
url: http://localhost:3100/loki/api/v1
|
||||
systemName: acs
|
||||
|
||||
@@ -159,7 +159,3 @@ sa-token:
|
||||
token-prefix: Bearer
|
||||
is-read-cookie: false
|
||||
is-read-body: false
|
||||
|
||||
loki:
|
||||
url: http://localhost:3100/loki/api/v1
|
||||
systemName: lms
|
||||
|
||||
@@ -157,7 +157,3 @@ sa-token:
|
||||
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
|
||||
# token 前缀
|
||||
token-prefix: Bearer
|
||||
|
||||
loki:
|
||||
url: http://localhost:3100/loki/api/v1
|
||||
systemName: lms
|
||||
|
||||
@@ -89,3 +89,6 @@ mybatis-plus:
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: INPUT
|
||||
lucene:
|
||||
index:
|
||||
path: D:\lucene\index
|
||||
|
||||
@@ -1,27 +1,20 @@
|
||||
#数据库类型转Java类型
|
||||
tinyint=Integer
|
||||
# ????Java????
|
||||
tinyint=Boolean
|
||||
smallint=Integer
|
||||
mediumint=Integer
|
||||
int=Integer
|
||||
integer=Integer
|
||||
|
||||
bigint=Long
|
||||
|
||||
float=Float
|
||||
|
||||
double=Double
|
||||
|
||||
decimal=BigDecimal
|
||||
|
||||
bit=Boolean
|
||||
|
||||
char=String
|
||||
varchar=String
|
||||
tinytext=String
|
||||
text=String
|
||||
mediumtext=String
|
||||
longtext=String
|
||||
|
||||
date=Date
|
||||
datetime=Date
|
||||
Date=Date
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<included>
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!--<define name="DEVICECODE" class="org.nl.modules.logging.DeviceCodeDir"/>-->
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE_XGAGV" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/XgAgvDeviceDriver/${DEVICECODE}/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<maxHistory>15</maxHistory>
|
||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
<!--所有日志最多占多大容量-->
|
||||
<totalSizeCap>2GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||
<charset>${log.charset}</charset>
|
||||
</encoder>
|
||||
|
||||
</appender>
|
||||
|
||||
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||
<appender-ref ref="FILE3"/>
|
||||
</logger>-->
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org.nl.system.service.lucene.impl.LuceneExecuteLogServiceImpl" level="info" additivity="false">
|
||||
<appender-ref ref="FILE_XGAGV"/>
|
||||
</logger>
|
||||
</included>
|
||||
@@ -14,14 +14,11 @@ https://juejin.cn/post/6844903775631572999
|
||||
<property name="log.pattern"
|
||||
value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n)"/>
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<springProperty scope="context" name="lokiUrl" source="loki.url"/>
|
||||
<springProperty scope="context" name="systemName" source="loki.systemName"/>
|
||||
<property name="LOKI_URL" value="${lokiUrl}"/>
|
||||
<property name="SYSTEM_NAME" value="${systemName}"/>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!--引入默认的一些设置-->
|
||||
<!--<include resource="log/XrToMes.xml"/>
|
||||
<include resource="log/MesToErp.xml"/>-->
|
||||
<include resource="log/XgAgvDeviceDriver.xml"/>
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
@@ -57,29 +54,10 @@ https://juejin.cn/post/6844903775631572999
|
||||
<queueSize>500</queueSize>
|
||||
<appender-ref ref="FILE"/>
|
||||
</appender>
|
||||
|
||||
<!--添加loki-->
|
||||
<appender name="lokiAppender" class="com.github.loki4j.logback.Loki4jAppender">
|
||||
<batchTimeoutMs>1000</batchTimeoutMs>
|
||||
<http class="com.github.loki4j.logback.ApacheHttpSender">
|
||||
<url>${LOKI_URL}/push</url>
|
||||
</http>
|
||||
<format>
|
||||
<label>
|
||||
<pattern>system=${SYSTEM_NAME},level=%level,logType=%X{log_file_type:-logType}</pattern>
|
||||
</label>
|
||||
<message>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</message>
|
||||
<sortByTime>true</sortByTime>
|
||||
</format>
|
||||
</appender>
|
||||
|
||||
<!--开发环境:打印控制台-->
|
||||
<springProfile name="dev">
|
||||
<root level="debug">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="lokiAppender" />
|
||||
</root>
|
||||
<logger name="org.springframework" level="ERROR" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
@@ -124,55 +102,42 @@ https://juejin.cn/post/6844903775631572999
|
||||
<springProfile name="prod">
|
||||
<root level="debug">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</root>
|
||||
<logger name="org.springframework" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="org.apache" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="org.hibernate" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="io.netty" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="jdbc" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="io.lettuce" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="com.fasterxml" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="org.quartz" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="com.google" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="springfox" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="log4jdbc" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
<logger name="nl.basjes" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="lokiAppender"/>
|
||||
</logger>
|
||||
</springProfile>
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package ${package}.service.dto;
|
||||
|
||||
<#if hasTimestamp>
|
||||
import java.sql.Timestamp;
|
||||
</#if>
|
||||
<#if hasBigDecimal>
|
||||
import java.math.BigDecimal;
|
||||
</#if>
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@@ -9,7 +9,12 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Table;
|
||||
<#if hasTimestamp>
|
||||
import java.sql.Timestamp;
|
||||
</#if>
|
||||
<#if hasBigDecimal>
|
||||
import java.math.BigDecimal;
|
||||
</#if>
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author ${author}
|
||||
|
||||
Reference in New Issue
Block a user