mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
删除案例同步的服务,已经转移到单独的case仓库
This commit is contained in:
@@ -1,180 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
|
||||||
<version>2.6.3</version>
|
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
|
||||||
</parent>
|
|
||||||
<groupId>com.xboe</groupId>
|
|
||||||
<artifactId>boe-server-case</artifactId>
|
|
||||||
<version>2.0.0</version>
|
|
||||||
<name>boe-server-case</name>
|
|
||||||
<description>BOEDX项目的任务处理服务</description>
|
|
||||||
<properties>
|
|
||||||
<java.version>1.8</java.version>
|
|
||||||
</properties>
|
|
||||||
<dependencies>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.xboe</groupId>
|
|
||||||
<artifactId>xboe-core</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.boe</groupId>
|
|
||||||
<artifactId>httpsdk</artifactId>
|
|
||||||
<scope>system</scope>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
<systemPath>${project.basedir}/src/main/resources/libs/httpsdk-1.0.0.jar</systemPath>
|
|
||||||
</dependency>
|
|
||||||
<!-- java-jwt -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.auth0</groupId>
|
|
||||||
<artifactId>java-jwt</artifactId>
|
|
||||||
<version>3.18.3</version>
|
|
||||||
</dependency>
|
|
||||||
<!--
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.bitbucket.b_c</groupId>
|
|
||||||
<artifactId>jose4j</artifactId>
|
|
||||||
<version>0.7.9</version>
|
|
||||||
</dependency>
|
|
||||||
-->
|
|
||||||
<!-- apache commons -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-codec</groupId>
|
|
||||||
<artifactId>commons-codec</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
|
||||||
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
|
||||||
<version>5.1.27</version>
|
|
||||||
<!-- <scope>runtime</scope> -->
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
<!-- aspose -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.aspose</groupId>
|
|
||||||
<artifactId>slides</artifactId>
|
|
||||||
<version>15.9.0</version>
|
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>${project.basedir}/src/main/resources/aspose/aspose.slides-15.9.0.jar</systemPath>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.aspose</groupId>
|
|
||||||
<artifactId>words</artifactId>
|
|
||||||
<version>15.8.0</version>
|
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>${project.basedir}/src/main/resources/aspose/aspose-words-15.8.0.jar</systemPath>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.aspose</groupId>
|
|
||||||
<artifactId>cells</artifactId>
|
|
||||||
<version>18.11</version>
|
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>${project.basedir}/src/main/resources/aspose/aspose-cells-java-18.11.jar</systemPath>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!--加密配置文件-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.ulisesbocchio</groupId>
|
|
||||||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
|
||||||
<version>3.0.3</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<build>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
<includes>
|
|
||||||
<include>application-${profileActive}.properties</include>
|
|
||||||
<include>application.properties</include>
|
|
||||||
</includes>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<filtering>false</filtering>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
<excludes>
|
|
||||||
<exclude>*.properties</exclude>
|
|
||||||
</excludes>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<!-- <version>3.8.0</version> -->
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<excludes>
|
|
||||||
<exclude>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</exclude>
|
|
||||||
</excludes>
|
|
||||||
<includeSystemScope>true</includeSystemScope>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
<profiles>
|
|
||||||
<profile>
|
|
||||||
<id>pro</id>
|
|
||||||
<properties>
|
|
||||||
<profileActive>pro</profileActive>
|
|
||||||
</properties>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>pre</id>
|
|
||||||
<properties>
|
|
||||||
<profileActive>pre</profileActive>
|
|
||||||
</properties>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>test</id>
|
|
||||||
<properties>
|
|
||||||
<profileActive>test</profileActive>
|
|
||||||
</properties>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>dev</id>
|
|
||||||
<properties>
|
|
||||||
<profileActive>dev</profileActive>
|
|
||||||
</properties>
|
|
||||||
<activation>
|
|
||||||
<activeByDefault>true</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
</project>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
package com.xboe;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.boot.system.ApplicationPid;
|
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@SpringBootApplication
|
|
||||||
@EnableCaching
|
|
||||||
public class BoeServerCaseApplication {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.setProperty("jasypt.encryptor.password","jasypt");
|
|
||||||
SpringApplication.run(BoeServerCaseApplication.class, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
private void handlePid() throws IOException {
|
|
||||||
File file = new File("application-case.pid");
|
|
||||||
new ApplicationPid().write(file);
|
|
||||||
file.deleteOnExit();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package com.xboe;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回的数据中如果是null 就会转化成空字符串
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class ResultNullToEmptyConfig {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
@Primary
|
|
||||||
@ConditionalOnMissingBean(ObjectMapper.class)
|
|
||||||
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
|
|
||||||
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
|
|
||||||
objectMapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer<Object>() {
|
|
||||||
@Override
|
|
||||||
public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
|
|
||||||
throws IOException, JsonProcessingException {
|
|
||||||
jsonGenerator.writeString("");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return objectMapper;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
package com.xboe.casetask;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Configuration
|
|
||||||
public class CaseApiConfig {
|
|
||||||
|
|
||||||
@Value("${xboe.case.sync.init}")
|
|
||||||
private Boolean init;
|
|
||||||
|
|
||||||
@Value("${xboe.case.sync.api.url}")
|
|
||||||
private String apiUrl;
|
|
||||||
|
|
||||||
@Value("${xboe.case.sync.api.name}")
|
|
||||||
private String apiName;
|
|
||||||
|
|
||||||
@Value("${xboe.case.sync.api.version}")
|
|
||||||
private String apiVersion;
|
|
||||||
|
|
||||||
@Value("${xboe.case.sync.api.method}")
|
|
||||||
private String apiMethod;
|
|
||||||
|
|
||||||
@Value("${xboe.case.sync.api.ak}")
|
|
||||||
private String apiAK;
|
|
||||||
|
|
||||||
@Value("${xboe.case.sync.api.sk}")
|
|
||||||
private String apiSK;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,436 +0,0 @@
|
|||||||
package com.xboe.casetask;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import com.aspose.cells.PdfSaveOptions;
|
|
||||||
import com.aspose.cells.Workbook;
|
|
||||||
import com.aspose.slides.Presentation;
|
|
||||||
import com.aspose.words.Document;
|
|
||||||
import com.boe.csb.sdk.HttpCaller;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncCustomize;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncLog;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncRecord;
|
|
||||||
import com.xboe.casetask.entity.DictItem;
|
|
||||||
import com.xboe.casetask.entity.User;
|
|
||||||
import com.xboe.casetask.service.ICaseSyncLogService;
|
|
||||||
import com.xboe.casetask.service.ICaseSyncService;
|
|
||||||
import com.xboe.common.utils.StringUtil;
|
|
||||||
import com.xboe.core.SysConstant;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 案例同步运行者
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class CaseDataSyncRunner {
|
|
||||||
|
|
||||||
private static final String FILETYPE=".pdf";
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
ICaseSyncService syncService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
ICaseSyncLogService syncLogService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
CaseApiConfig config;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 指定时间参数
|
|
||||||
* @param start
|
|
||||||
* @param end
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public void runByTime(String start,String end) throws Exception {
|
|
||||||
|
|
||||||
log.info("开始执行案例同步数据任务");
|
|
||||||
String httpUrl=config.getApiUrl();
|
|
||||||
String version=config.getApiVersion();
|
|
||||||
String reqMethod=config.getApiMethod();
|
|
||||||
String API_NAME = config.getApiName();
|
|
||||||
String ak = config.getApiAK();
|
|
||||||
String sk = config.getApiSK();
|
|
||||||
|
|
||||||
Map<String, String> data = new HashMap<String, String>();
|
|
||||||
data.put("TYLC07QueryService","{\"header\":{\"startTime\":\""+start+"\",\"endTime\":\""+end+"\"}}");
|
|
||||||
String result = null;
|
|
||||||
if("get".equals(reqMethod.toLowerCase())){
|
|
||||||
result = HttpCaller.doGet(httpUrl, API_NAME, version, data, ak, sk);
|
|
||||||
}else if("post".equals(reqMethod.toLowerCase())){
|
|
||||||
result = HttpCaller.doPost(httpUrl, API_NAME, version, data, ak, sk);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
CaseSyncLog csl=new CaseSyncLog();
|
|
||||||
csl.setLogTime(LocalDateTime.now());
|
|
||||||
csl.setRequest("{\"header\":{\"startTime\":\""+start+"\",\"endTime\":\""+end+"\"}}");
|
|
||||||
csl.setResponse(result);
|
|
||||||
syncLogService.save(csl);
|
|
||||||
}catch(Exception e) {
|
|
||||||
log.error("记录请求日志错误",e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(result)) {
|
|
||||||
//记录结果字符串
|
|
||||||
//System.out.println(result);
|
|
||||||
log.info(result);
|
|
||||||
//解析等处理
|
|
||||||
doParser(result);
|
|
||||||
//
|
|
||||||
}else {
|
|
||||||
log.error("同步案例数据错误,未返回任何数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 直接运行,自动计算一天天
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public void run() throws Exception {
|
|
||||||
|
|
||||||
LocalDate today=LocalDate.now();
|
|
||||||
DateTimeFormatter formatter=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
||||||
String start=formatter.format(today);
|
|
||||||
String end=formatter.format(today.plusDays(1));
|
|
||||||
runByTime(start,end);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void appendError(CaseSyncRecord csr,String error) {
|
|
||||||
csr.setStatus(1);
|
|
||||||
csr.setErrorInfo(csr.getErrorInfo()+","+error);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void downFile(CaseSyncRecord csr,JsonResultParser parser) {
|
|
||||||
String rootPath=SysConstant.getConfigValue(SysConstant.CONFIG_UPLOAD_FILES_SAVEPATH);
|
|
||||||
int lastIndex=csr.getAttachmentName().lastIndexOf(".");
|
|
||||||
if(lastIndex>0) {
|
|
||||||
String fileType=csr.getAttachmentName().substring(lastIndex);
|
|
||||||
//System.out.println("fileType="+fileType);
|
|
||||||
String savePathName=csr.getApprovalNumber()+fileType;//原文件名
|
|
||||||
String savePdfName=csr.getApprovalNumber()+FILETYPE;//保存的pdf名
|
|
||||||
|
|
||||||
LocalDate localDate=LocalDate.now();
|
|
||||||
String year=String.valueOf(localDate.getYear());
|
|
||||||
String month=String.valueOf(localDate.getMonthValue());
|
|
||||||
|
|
||||||
String savePath=rootPath+"/case/"+year+"/"+month;
|
|
||||||
|
|
||||||
File f=new File(savePath);
|
|
||||||
if(!f.exists()) {
|
|
||||||
f.mkdirs();
|
|
||||||
}
|
|
||||||
String fileUrl=csr.getAttachmentUrl();
|
|
||||||
try {
|
|
||||||
String beforePath=rootPath+"/case/"+year+"/"+month+"/"+savePathName;
|
|
||||||
//把名称进行转码处理
|
|
||||||
int urlLast=fileUrl.lastIndexOf("/");
|
|
||||||
if(urlLast==-1) {
|
|
||||||
this.appendError(csr, "下载案例文件地址解析错误【"+csr.getAttachmentUrl()+"】");
|
|
||||||
log.error("下载案例文件地址解析错误【"+csr.getAttachmentUrl()+"】");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String urlName=fileUrl.substring(urlLast+1);
|
|
||||||
fileUrl=fileUrl.substring(0, urlLast+1)+URLEncoder.encode(urlName, "UTF-8");
|
|
||||||
fileUrl=fileUrl.replaceAll("\\+","%20");
|
|
||||||
log.info("下载文件:"+fileUrl);
|
|
||||||
parser.download(fileUrl, beforePath);
|
|
||||||
//转化为pdf
|
|
||||||
File downFile=new File(beforePath);
|
|
||||||
if(downFile.exists()) {
|
|
||||||
String dbPath="/case/"+year+"/"+month+"/"+savePdfName;
|
|
||||||
|
|
||||||
if(!fileType.toLowerCase().equals(FILETYPE)) {
|
|
||||||
log.info("转化pdf:"+beforePath);
|
|
||||||
this.convertPdf(fileType, beforePath,rootPath+dbPath);
|
|
||||||
}
|
|
||||||
csr.setFilePath(dbPath);//设置到存储数据库
|
|
||||||
}else {
|
|
||||||
log.error("下载案例文件错误【"+csr.getAttachmentUrl()+"】");
|
|
||||||
log.error("下载的处理之后的url路径【"+fileUrl+"】");
|
|
||||||
this.appendError(csr, "下载案例文件错误【"+csr.getAttachmentUrl()+"】");
|
|
||||||
}
|
|
||||||
|
|
||||||
}catch(Exception e) {
|
|
||||||
log.error("下载案例文件错误【"+csr.getAttachmentUrl()+"】");
|
|
||||||
log.error("下载的处理之后的url路径【"+fileUrl+"】");
|
|
||||||
log.error("下载案例文件错误",e);
|
|
||||||
this.appendError(csr, "下载案例文件错误或转化PDF错误【"+csr.getAttachmentUrl()+"】"+e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getNameStr(String name) {
|
|
||||||
String first=name.replaceAll("\\(","(");
|
|
||||||
int index1=first.indexOf("(");
|
|
||||||
if(index1>0) {
|
|
||||||
first=first.substring(0,index1);
|
|
||||||
}
|
|
||||||
return first;
|
|
||||||
}
|
|
||||||
|
|
||||||
// public static void main(String[] args) {
|
|
||||||
// String str="显示-前台SBU1__eol__(包括:前台:MNT SBU、NB SBU、TPC SBU、TV SBU、F1 SBU、Mobile SBU、产销管理中心、车载SBU、SC SBU、C SBU、显示事业数字化变革管理办公室;终端营销协调组:MNT终端产品线、TV终端产品线、NB终端产品线、TPC终端产品线、3D显示特战队;中台:产销管理中心)";
|
|
||||||
// CaseDataSyncRunner runner=new CaseDataSyncRunner();
|
|
||||||
// System.out.println(runner.getNameStr(str));
|
|
||||||
// System.out.println("显示-前台SBU1__eol__");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
|
|
||||||
public void doParser(String json) throws Exception {
|
|
||||||
|
|
||||||
JsonResultParser parser=new JsonResultParser();
|
|
||||||
String rootPath=SysConstant.getConfigValue(SysConstant.CONFIG_UPLOAD_FILES_SAVEPATH);
|
|
||||||
|
|
||||||
|
|
||||||
List<CaseSyncRecord> cases = parser.parseJson(json,rootPath);
|
|
||||||
if(cases.size()>0) {
|
|
||||||
Map<String,String> majorTypeMap = syncService.getMajorTypes();
|
|
||||||
//因为每次同步并不一定多,所以这里直接一条一条的查询比对
|
|
||||||
for(CaseSyncRecord csr : cases) {
|
|
||||||
|
|
||||||
String hasId=syncService.getIdByApprovalNumber(csr.getApprovalNumber());
|
|
||||||
if(StringUtils.isNotBlank(hasId)){
|
|
||||||
//已经存在,不再更新
|
|
||||||
csr.setAddNew(false);
|
|
||||||
csr.setStatus(1);
|
|
||||||
csr.setErrorInfo(csr.getErrorInfo()+",内容已存在,不再替换");
|
|
||||||
syncService.saveRecord(csr);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
//下载附件文件
|
|
||||||
if(StringUtils.isNotBlank(csr.getAttachmentUrl())){
|
|
||||||
downFile(csr,parser);
|
|
||||||
}else {
|
|
||||||
if(csr.getAttachmentList()!=null) {
|
|
||||||
CaseSyncCustomize customize= syncService.getLastCustomizeByApprovalNumber(csr.getApprovalNumber());
|
|
||||||
if(customize!=null && customize.getAttachmentIndex()!=null) {
|
|
||||||
if(csr.getAttachmentList().size()>customize.getAttachmentIndex()) {
|
|
||||||
String[] choose=csr.getAttachmentList().get(customize.getAttachmentIndex());
|
|
||||||
if(choose[0].equals(customize.getAttachmentName())) {
|
|
||||||
csr.setAttachmentUrl(choose[1]);
|
|
||||||
csr.setAttachmentName(choose[0]);
|
|
||||||
downFile(csr,parser);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
appendError(csr,"附件配置与返回结果有变化,无法清确匹配,需要重新指定");
|
|
||||||
}
|
|
||||||
|
|
||||||
}else {
|
|
||||||
appendError(csr,"附件处理失败");
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
appendError(csr,"附件处理失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//组织领域,无根据名称查找 ,再根据找到filter 对应code去找上级的名称
|
|
||||||
if(StringUtils.isNotBlank(csr.getCaseOwnerOrg())) {
|
|
||||||
String firstName=null;
|
|
||||||
DictItem dictItem=null;
|
|
||||||
List<DictItem> items=syncService.findDictItemByName(csr.getCaseOwnerOrg());
|
|
||||||
if(!items.isEmpty()) {
|
|
||||||
dictItem=items.get(0);
|
|
||||||
firstName=csr.getCaseOwnerOrg();
|
|
||||||
}else {
|
|
||||||
firstName=getNameStr(csr.getCaseOwnerOrg());
|
|
||||||
List<DictItem> item2s=syncService.findDictItemByName(firstName);
|
|
||||||
if(!item2s.isEmpty()) {
|
|
||||||
dictItem=item2s.get(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(dictItem!=null) {
|
|
||||||
csr.setOrgDomain(firstName);
|
|
||||||
csr.setOrgDomainId(dictItem.getCode());
|
|
||||||
//上级的名称
|
|
||||||
DictItem parent=syncService.getDictItemByCode(dictItem.getFilter());
|
|
||||||
if(parent==null) {
|
|
||||||
csr.setStatus(1);
|
|
||||||
csr.setErrorInfo(csr.getErrorInfo()+",未匹配到组织领域上级【"+csr.getCaseOwnerOrg()+"】"+firstName);
|
|
||||||
}else {
|
|
||||||
csr.setOrgDomainParent(parent.getName());
|
|
||||||
csr.setOrgDomainParentId(parent.getCode());
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
appendError(csr, "未匹配到组织领域【"+csr.getCaseOwnerOrg()+"】"+firstName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}else {
|
|
||||||
appendError(csr,"无组织领域【"+csr.getCaseOwnerOrg()+"】");
|
|
||||||
}
|
|
||||||
//专业分类
|
|
||||||
if(StringUtil.isNotBlank(csr.getCaseSpecialtySequence()) ) {
|
|
||||||
//替换逗号
|
|
||||||
String[] names=csr.getCaseSpecialtySequence().split(",");
|
|
||||||
csr.setMajorTypeIdList(new ArrayList<>());
|
|
||||||
for(String sname :names) {
|
|
||||||
String first=getNameStr(sname);
|
|
||||||
if(majorTypeMap.containsKey(first)) {
|
|
||||||
String code=majorTypeMap.get(first);
|
|
||||||
csr.getMajorTypeIdList().add(code);
|
|
||||||
// csr.setMajorType(first);
|
|
||||||
// csr.setMajorTypeId(code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(csr.getMajorTypeIdList().isEmpty()) {
|
|
||||||
this.appendError(csr, "未匹配到任何专业分类【"+csr.getCaseSpecialtySequence()+"】");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//System.out.println("first="+first);
|
|
||||||
// if(majorTypeMap.containsKey(first)) {
|
|
||||||
// String code=majorTypeMap.get(first);
|
|
||||||
// csr.setMajorType(first);
|
|
||||||
// csr.setMajorTypeId(code);
|
|
||||||
// }else {
|
|
||||||
// csr.setStatus(1);
|
|
||||||
// this.appendError(csr, "未匹配到专业分类【"+csr.getCaseSpecialtySequence()+"】");
|
|
||||||
// }
|
|
||||||
}else {
|
|
||||||
if(StringUtils.isBlank(csr.getMajorTypeId())) {
|
|
||||||
csr.setStatus(1);
|
|
||||||
csr.setErrorInfo(csr.getErrorInfo()+",未匹配到专业分类【"+csr.getCaseSpecialtySequence()+"】");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//用户的转化处理,各种异常处理
|
|
||||||
String owner =csr.getCaseOwner();
|
|
||||||
if(StringUtils.isNotBlank(owner)) {
|
|
||||||
int leftIdx=owner.indexOf("<");
|
|
||||||
if(leftIdx>-1) {
|
|
||||||
String no=owner.substring(0,leftIdx);
|
|
||||||
//String author=owner.substring(leftIdx+1,owner.length()-1);
|
|
||||||
//1010返回的json作者信息有变化,后面多了两个<>, 所以这里规则改一下
|
|
||||||
String author=owner.substring(leftIdx+1,owner.indexOf(">"));
|
|
||||||
String id= syncService.getIdByUserNo(no);
|
|
||||||
if(id==null) {
|
|
||||||
csr.setStatus(1);
|
|
||||||
csr.setErrorInfo(csr.getErrorInfo()+",关联用户失败【"+csr.getCaseOwner()+"】");
|
|
||||||
}else {
|
|
||||||
csr.setAuthorId(id);
|
|
||||||
csr.setAuthorName(author);
|
|
||||||
}
|
|
||||||
|
|
||||||
}else {
|
|
||||||
//这种情况把它当成单独的工号处理
|
|
||||||
User u= syncService.getByUserNo(owner);
|
|
||||||
if(u==null) {
|
|
||||||
csr.setStatus(1);
|
|
||||||
csr.setErrorInfo(csr.getErrorInfo()+",关联用户失败【"+csr.getCaseOwner()+"】");
|
|
||||||
}else {
|
|
||||||
csr.setAuthorId(u.getId());
|
|
||||||
csr.setAuthorName(u.getName());
|
|
||||||
}
|
|
||||||
// csr.setStatus(1);
|
|
||||||
// csr.setErrorInfo(csr.getErrorInfo()+",caseOwner数据格式错误【"+owner+"】");
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
csr.setStatus(1);
|
|
||||||
csr.setErrorInfo(csr.getErrorInfo()+",无caseOwner信息");
|
|
||||||
}
|
|
||||||
//检查是否已存在,移到Service中
|
|
||||||
//Cases has=syncService.getByApprovalNumber(csr.getApprovalNumber());
|
|
||||||
// String hasId=syncService.getIdByApprovalNumber(csr.getApprovalNumber());
|
|
||||||
// if(StringUtils.isBlank(hasId)){
|
|
||||||
// csr.setAddNew(true);
|
|
||||||
// }else {
|
|
||||||
// //csr.setCaseInfo(has);
|
|
||||||
// csr.setAddNew(false);
|
|
||||||
// }
|
|
||||||
}catch(Exception ee) {
|
|
||||||
log.error("解决处理字段错误",ee);
|
|
||||||
this.appendError(csr,"处理字段错误:"+ee.getMessage());
|
|
||||||
}
|
|
||||||
syncService.saveRecord(csr);
|
|
||||||
//单独的保存
|
|
||||||
syncService.saveCase(csr);
|
|
||||||
}
|
|
||||||
|
|
||||||
//syncService.saveCase(cases);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean loadLicense = false;
|
|
||||||
|
|
||||||
private boolean getLicense() {
|
|
||||||
if (!loadLicense) {
|
|
||||||
try {
|
|
||||||
InputStream is = this.getClass().getResourceAsStream("/aspose/license.xml");
|
|
||||||
com.aspose.cells.License cellAposeLic = new com.aspose.cells.License();
|
|
||||||
cellAposeLic.setLicense(is);
|
|
||||||
|
|
||||||
is = this.getClass().getResourceAsStream("/aspose/license.xml");
|
|
||||||
com.aspose.words.License wordAposeLic = new com.aspose.words.License();
|
|
||||||
wordAposeLic.setLicense(is);
|
|
||||||
|
|
||||||
is = this.getClass().getResourceAsStream("/aspose/license.xml");
|
|
||||||
com.aspose.slides.License pptAposeLic = new com.aspose.slides.License();
|
|
||||||
pptAposeLic.setLicense(is);
|
|
||||||
|
|
||||||
loadLicense = true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("读取aspose license文件失败",e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return loadLicense;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void convertPdf(String fileType, String filePath,String pdfPath) throws Exception{
|
|
||||||
if (this.getLicense()) {
|
|
||||||
File pdfFile = new File(pdfPath);// 输出路径
|
|
||||||
FileOutputStream fileOS =null;
|
|
||||||
try {
|
|
||||||
if(".doc,.docx".indexOf(fileType)>-1) {
|
|
||||||
fileOS = new FileOutputStream(pdfFile);
|
|
||||||
Document doc = new Document(filePath);//
|
|
||||||
doc.save(fileOS, com.aspose.words.SaveFormat.PDF);
|
|
||||||
}else if(".xls,.xlsx".indexOf(fileType)>-1) {
|
|
||||||
fileOS = new FileOutputStream(pdfFile);
|
|
||||||
Workbook wb = new Workbook(filePath);// 原始excel路径
|
|
||||||
//wb.save(fileOS, com.aspose.cells.SaveFormat.PDF);
|
|
||||||
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
|
|
||||||
pdfSaveOptions.setAllColumnsInOnePagePerSheet(true);
|
|
||||||
wb.save(fileOS, pdfSaveOptions);
|
|
||||||
}else if(".ppt,.pptx".indexOf(fileType)>-1) {
|
|
||||||
fileOS = new FileOutputStream(pdfFile);
|
|
||||||
InputStream slides = new FileInputStream(filePath);// 原始ppt路径
|
|
||||||
Presentation pres = new Presentation(slides);
|
|
||||||
pres.save(fileOS, com.aspose.slides.SaveFormat.Pdf);
|
|
||||||
}
|
|
||||||
|
|
||||||
}catch(Exception e) {
|
|
||||||
throw e;
|
|
||||||
}finally {
|
|
||||||
if(fileOS!=null) {
|
|
||||||
fileOS.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package com.xboe.casetask;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 案例数据同步处理
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@EnableScheduling
|
|
||||||
@Component("com.xboe.casetask.CaseDataTimeSchedule")
|
|
||||||
public class CaseDataTimeSchedule{
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
CaseDataSyncRunner runner;
|
|
||||||
|
|
||||||
/**每隔12个小时执行一次*/
|
|
||||||
@Scheduled(cron="0 0 12,22 * * ?")
|
|
||||||
public void execute() {
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
runner.run();
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("同步案例数据错误",e);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,214 +0,0 @@
|
|||||||
package com.xboe.casetask;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.http.HttpEntity;
|
|
||||||
import org.apache.http.HttpResponse;
|
|
||||||
import org.apache.http.client.HttpClient;
|
|
||||||
import org.apache.http.client.methods.HttpGet;
|
|
||||||
import org.apache.http.impl.client.HttpClients;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncRecord;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 案例的解析处理
|
|
||||||
* 此类只是负责解析处理,不做业务逻辑判断
|
|
||||||
*/
|
|
||||||
public class JsonResultParser {
|
|
||||||
|
|
||||||
|
|
||||||
private String getString(JsonNode node,String name, String def) {
|
|
||||||
if(node.has(name)) {
|
|
||||||
return node.get(name).asText();
|
|
||||||
}else {
|
|
||||||
return def;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private LocalDateTime getTime(JsonNode node,String name) {
|
|
||||||
if(node.has(name)) {
|
|
||||||
//System.out.println("node.get(name)="+node.get(name));
|
|
||||||
String strTime=node.get(name).asText();
|
|
||||||
if(strTime.lastIndexOf(".0")>-1) {
|
|
||||||
LocalDateTime dateTime=LocalDateTime.parse(node.get(name).asText(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.0"));
|
|
||||||
return dateTime;
|
|
||||||
}else {
|
|
||||||
LocalDateTime dateTime=LocalDateTime.parse(node.get(name).asText(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
||||||
return dateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void download(String url, String filepath) throws Exception{
|
|
||||||
|
|
||||||
InputStream is =null;
|
|
||||||
File file=null;
|
|
||||||
FileOutputStream fileout=null;
|
|
||||||
try {
|
|
||||||
HttpClient client = HttpClients.createDefault();
|
|
||||||
HttpGet httpget = new HttpGet(url);
|
|
||||||
// 加入Referer,防止防盗链
|
|
||||||
//httpget.setHeader("Referer", url);
|
|
||||||
httpget.setHeader("Referer", "");
|
|
||||||
HttpResponse response = client.execute(httpget);
|
|
||||||
HttpEntity entity = response.getEntity();
|
|
||||||
is=entity.getContent();
|
|
||||||
|
|
||||||
file = new File(filepath);
|
|
||||||
file.getParentFile().mkdirs();
|
|
||||||
fileout = new FileOutputStream(file);
|
|
||||||
byte[] buffer = new byte[10240];
|
|
||||||
int ch = 0;
|
|
||||||
while ((ch = is.read(buffer)) != -1) {
|
|
||||||
fileout.write(buffer, 0, ch);
|
|
||||||
}
|
|
||||||
fileout.flush();
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw e;
|
|
||||||
} catch (UnsupportedOperationException e) {
|
|
||||||
throw e;
|
|
||||||
} finally {
|
|
||||||
if(fileout!=null) {
|
|
||||||
try {
|
|
||||||
fileout.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(is!=null) {
|
|
||||||
try {
|
|
||||||
is.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CaseSyncRecord> parseJson(String json,String rootPath) throws Exception {
|
|
||||||
|
|
||||||
JsonResultParser parser=new JsonResultParser();
|
|
||||||
List<CaseSyncRecord> cases=new ArrayList<CaseSyncRecord>();
|
|
||||||
|
|
||||||
ObjectMapper mapper=new ObjectMapper();
|
|
||||||
|
|
||||||
JsonNode root = mapper.readTree(json);
|
|
||||||
JsonNode result=root.get("TYLC07QueryServiceResponse").get("return");
|
|
||||||
int code=result.get("code").asInt();
|
|
||||||
if(code!=0) {
|
|
||||||
//System.out.println("code:"+code+",msg="+result.get("msg"));
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
JsonNode dataList=result.get("data");
|
|
||||||
//因为返回内容有null的情况
|
|
||||||
if(dataList==null || dataList.isEmpty()) {
|
|
||||||
return cases;
|
|
||||||
}
|
|
||||||
|
|
||||||
Iterator<JsonNode> list=dataList.iterator();
|
|
||||||
|
|
||||||
while(list.hasNext()) {
|
|
||||||
JsonNode item=list.next();
|
|
||||||
CaseSyncRecord c=new CaseSyncRecord();
|
|
||||||
c.setStatus(0);
|
|
||||||
c.setAddNew(true);
|
|
||||||
c.setErrorInfo("");
|
|
||||||
|
|
||||||
c.setApprovalNumber(parser.getString(item,"approvalNumber",""));
|
|
||||||
c.setCaseChannel(parser.getString(item,"caseChannel",""));
|
|
||||||
c.setCaseFlow(parser.getString(item,"caseFlow",""));
|
|
||||||
c.setCaseOtherContributor(parser.getString(item,"caseOtherContributor",""));
|
|
||||||
c.setCaseOwner(parser.getString(item,"caseOwner",""));
|
|
||||||
c.setCaseOwnerDepartment(parser.getString(item,"caseOwnerDepartment",""));
|
|
||||||
c.setCaseOwnerOrg(parser.getString(item,"caseOwnerOrg",""));
|
|
||||||
c.setCaseOwnerPhone(parser.getString(item,"caseOwnerPhone",""));
|
|
||||||
c.setCaseScope(parser.getString(item,"caseScope",""));
|
|
||||||
c.setCaseSpecialtySequence(parser.getString(item,"caseSpecialtySequence",""));
|
|
||||||
|
|
||||||
c.setCaseTheme(parser.getString(item,"caseTheme",""));
|
|
||||||
c.setCaseThemeDescription(parser.getString(item,"caseThemeDescription",""));
|
|
||||||
c.setCaseTheme1(parser.getString(item,"caseTheme1",""));
|
|
||||||
c.setCaseThemeDescription1(parser.getString(item,"caseThemeDescription1",""));
|
|
||||||
c.setCaseTheme2(parser.getString(item,"caseTheme2",""));
|
|
||||||
c.setCaseThemeDescription2(parser.getString(item,"caseThemeDescription2",""));
|
|
||||||
|
|
||||||
c.setCaseType(parser.getString(item,"caseType",""));
|
|
||||||
c.setCaseType1(parser.getString(item,"caseType1",""));
|
|
||||||
c.setCaseType2(parser.getString(item,"caseType2",""));
|
|
||||||
|
|
||||||
c.setCaseValue(parser.getString(item,"caseValue",""));
|
|
||||||
c.setConfidentialityLevel(parser.getString(item,"confidentialityLevel",""));
|
|
||||||
c.setContactNumber(parser.getString(item,"caseFlow",""));
|
|
||||||
c.setDrafter(parser.getString(item,"drafter",""));
|
|
||||||
c.setDrafter(parser.getString(item,"draftingTime",""));
|
|
||||||
|
|
||||||
c.setEmail(parser.getString(item,"email",""));
|
|
||||||
|
|
||||||
String isLeadershipPlan=parser.getString(item,"isLeadershipPlan","");
|
|
||||||
c.setIsLeadershipPlan(isLeadershipPlan.equals("是")? true:false);
|
|
||||||
|
|
||||||
c.setKeyword1(parser.getString(item,"keyword1",""));
|
|
||||||
c.setKeyword2(parser.getString(item,"keyword2",""));
|
|
||||||
c.setKeyword3(parser.getString(item,"keyword3",""));
|
|
||||||
c.setKeyword4(parser.getString(item,"keyword4",""));
|
|
||||||
c.setKeyword5(parser.getString(item,"keyword5",""));
|
|
||||||
c.setReaders(parser.getString(item,"readers",""));
|
|
||||||
c.setDepartment(parser.getString(item,"department",""));
|
|
||||||
c.setCaseName(parser.getString(item,"caseName",""));
|
|
||||||
c.setCaseSummary(parser.getString(item,"caseSummary",""));
|
|
||||||
|
|
||||||
c.setDraftingTime(parser.getTime(item,"draftingTime"));
|
|
||||||
c.setEndTime(parser.getTime(item,"endTime"));
|
|
||||||
//approvalRecord 直接转化为json保存
|
|
||||||
JsonNode approvalRecord=item.get("approvalRecord");
|
|
||||||
if(approvalRecord!=null) {
|
|
||||||
c.setApprovalRecord(approvalRecord.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
JsonNode attachment=item.get("attachment");
|
|
||||||
if(attachment!=null) {
|
|
||||||
if(attachment.isArray()) {
|
|
||||||
//多个附件的情况下,所附件弄成字符串保存起来
|
|
||||||
c.setAttachment(attachment.toString());
|
|
||||||
//在数据组中查找名字
|
|
||||||
c.setAttachmentList(new ArrayList<>());
|
|
||||||
Iterator<JsonNode> fileList=attachment.iterator();
|
|
||||||
while(fileList.hasNext()) {
|
|
||||||
JsonNode one=fileList.next();
|
|
||||||
String[] values=new String[2];
|
|
||||||
values[0]=parser.getString(one,"attachmentName","");
|
|
||||||
values[1]=parser.getString(one,"attachmentUrl","");
|
|
||||||
c.getAttachmentList().add(values);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
c.setAttachmentName(parser.getString(item.get("attachment"),"attachmentName",""));
|
|
||||||
c.setAttachmentUrl(parser.getString(item.get("attachment"),"attachmentUrl",""));
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
c.setStatus(1);//附件处理失败
|
|
||||||
c.setErrorInfo(c.getErrorInfo()+"附件字段attachment不存在");
|
|
||||||
}
|
|
||||||
cases.add(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return cases;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
package com.xboe.casetask.api;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.xboe.casetask.CaseDataSyncRunner;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncCustomize;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncLog;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncRecord;
|
|
||||||
import com.xboe.casetask.service.ICaseSyncLogService;
|
|
||||||
import com.xboe.casetask.service.ICaseSyncService;
|
|
||||||
import com.xboe.common.PageList;
|
|
||||||
import com.xboe.common.Pagination;
|
|
||||||
import com.xboe.core.JsonResponse;
|
|
||||||
import com.xboe.core.api.ApiBaseController;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping(value = "/inner/task/cases")
|
|
||||||
public class CaseTaskApi extends ApiBaseController{
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
ICaseSyncService service;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
ICaseSyncLogService logService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
CaseDataSyncRunner runner;
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/logs")
|
|
||||||
public JsonResponse<PageList<CaseSyncLog>> logs(Pagination page) {
|
|
||||||
|
|
||||||
PageList<CaseSyncLog> result = logService.findPage(page.getPageIndex(),page.getPageSize());
|
|
||||||
|
|
||||||
return success(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/logs-clear")
|
|
||||||
public JsonResponse<Boolean> logsClear() {
|
|
||||||
|
|
||||||
logService.clearLogs();
|
|
||||||
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/records")
|
|
||||||
public JsonResponse<PageList<CaseSyncRecord>> records(Pagination page, CaseSyncRecord record) {
|
|
||||||
|
|
||||||
PageList<CaseSyncRecord> result = service.findPage(page.getPageIndex(),page.getPageSize(), record);
|
|
||||||
|
|
||||||
return success(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/records-delete")
|
|
||||||
public JsonResponse<Boolean> recordDelete(String id) {
|
|
||||||
if(StringUtils.isBlank(id)) {
|
|
||||||
return error("未指定id");
|
|
||||||
}
|
|
||||||
|
|
||||||
service.deleteRecord(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/save-config")
|
|
||||||
public JsonResponse<CaseSyncCustomize> saveConfig(CaseSyncCustomize csc) {
|
|
||||||
if (StringUtils.isBlank(csc.getApprovalNumber())) {
|
|
||||||
return error("未批定审批单号");
|
|
||||||
}
|
|
||||||
if (csc.getAttachmentIndex()==null) {
|
|
||||||
return error("未指定附件记录");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
service.saveCaseSyncCustomize(csc);
|
|
||||||
return success(csc);
|
|
||||||
}catch(Exception e) {
|
|
||||||
log.error("保存同步附件设置错误",e);
|
|
||||||
return error("保存同步附件设置失败",e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按指定时间同步处理
|
|
||||||
* @param start
|
|
||||||
* @param end
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/sync-start-end")
|
|
||||||
public JsonResponse<Boolean> runByStartEnd(String start,String end) {
|
|
||||||
if (StringUtils.isBlank(start)) {
|
|
||||||
return error("缺少必要参数");
|
|
||||||
}
|
|
||||||
if (StringUtils.isBlank(end)) {
|
|
||||||
return error("缺少必要参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
runner.runByTime(start, end);
|
|
||||||
return success(true);
|
|
||||||
}catch(Exception e) {
|
|
||||||
log.error("指定时间同步案例错误",e);
|
|
||||||
return error("同步案例失败",e.getMessage(),false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按时间执行
|
|
||||||
* @param start
|
|
||||||
* @param end
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/sync-by-time")
|
|
||||||
public JsonResponse<Boolean> runByTime(String id,String time) {
|
|
||||||
// if (StringUtils.isBlank(id)) {
|
|
||||||
// return error("缺少必要参数");
|
|
||||||
// }
|
|
||||||
if (StringUtils.isBlank(time)) {
|
|
||||||
return error("缺少必要参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
//转化时间
|
|
||||||
LocalDateTime dateTime=null;
|
|
||||||
if(time.lastIndexOf(".0")>-1) {
|
|
||||||
dateTime=LocalDateTime.parse(time, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.0"));
|
|
||||||
}else {
|
|
||||||
dateTime=LocalDateTime.parse(time, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
||||||
}
|
|
||||||
|
|
||||||
DateTimeFormatter formatter=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
||||||
//通过前后10分钟上设置查询区间
|
|
||||||
String start=formatter.format(dateTime);
|
|
||||||
//String end=formatter.format(dateTime.plusMinutes(10));
|
|
||||||
|
|
||||||
runner.runByTime(start, start);
|
|
||||||
return success(true);
|
|
||||||
}catch(Exception e) {
|
|
||||||
log.error("指定时间同步案例错误",e);
|
|
||||||
return error("同步案例失败",e.getMessage(),false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.xboe.casetask.dao;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import com.xboe.casetask.entity.CaseSyncCustomize;
|
|
||||||
import com.xboe.core.orm.BaseDao;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public class CaseSyncCustomizeDao extends BaseDao<CaseSyncCustomize>{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.xboe.casetask.dao;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import com.xboe.casetask.entity.CaseSyncLog;
|
|
||||||
import com.xboe.core.orm.BaseDao;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public class CaseSyncLogDao extends BaseDao<CaseSyncLog>{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
package com.xboe.casetask.dao;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import com.xboe.casetask.entity.CaseSyncRecord;
|
|
||||||
import com.xboe.casetask.entity.DictItem;
|
|
||||||
import com.xboe.core.orm.BaseDao;
|
|
||||||
import com.xboe.standard.BaseConstant;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public class CaseSyncRecordDao extends BaseDao<CaseSyncRecord>{
|
|
||||||
|
|
||||||
public List<DictItem> findDictItemByName(String name){
|
|
||||||
//Map<String,String> keys=new HashMap<String,String>();
|
|
||||||
String sql="Select code,name,filter from "+BaseConstant.DICTIONARY_TABLE_NAMEPRE+"org_domain where name=?1";
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<Object[]> list = this.sqlFindList(sql,name);
|
|
||||||
List<DictItem> items=new ArrayList<DictItem>();
|
|
||||||
for(Object[] objs : list) {
|
|
||||||
DictItem item=new DictItem();
|
|
||||||
item.setCode((String)objs[0]);
|
|
||||||
item.setName((String)objs[1]);
|
|
||||||
item.setFilter((String)objs[2]);
|
|
||||||
items.add(item);
|
|
||||||
}
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DictItem> findDictItemByName(String name1,String name2){
|
|
||||||
//Map<String,String> keys=new HashMap<String,String>();
|
|
||||||
String sql="Select code,name,filter from "+BaseConstant.DICTIONARY_TABLE_NAMEPRE+"org_domain where name=?1 or name=?2";
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<Object[]> list = this.sqlFindList(sql,name1,name2);
|
|
||||||
List<DictItem> items=new ArrayList<DictItem>();
|
|
||||||
for(Object[] objs : list) {
|
|
||||||
DictItem item=new DictItem();
|
|
||||||
item.setCode((String)objs[0]);
|
|
||||||
item.setName((String)objs[1]);
|
|
||||||
item.setFilter((String)objs[2]);
|
|
||||||
items.add(item);
|
|
||||||
}
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DictItem findDictItemByCode(String code){
|
|
||||||
//Map<String,String> keys=new HashMap<String,String>();
|
|
||||||
String sql="Select code,name,filter from "+BaseConstant.DICTIONARY_TABLE_NAMEPRE+"org_domain where code=?1";
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<Object[]> list = this.sqlFindList(sql,code);
|
|
||||||
if(list!=null && !list.isEmpty()) {
|
|
||||||
Object[] objs=list.get(0);
|
|
||||||
DictItem item=new DictItem();
|
|
||||||
item.setCode((String)objs[0]);
|
|
||||||
item.setName((String)objs[1]);
|
|
||||||
item.setFilter((String)objs[2]);
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String,DictItem> getOrgDomains(){
|
|
||||||
//Map<String,String> keys=new HashMap<String,String>();
|
|
||||||
String sql="Select code,name,filter from "+BaseConstant.DICTIONARY_TABLE_NAMEPRE+"org_domain";
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<Object[]> list = this.sqlFindList(sql);
|
|
||||||
Map<String,DictItem> maps=new HashMap<String,DictItem>();
|
|
||||||
|
|
||||||
for(Object[] objs : list) {
|
|
||||||
DictItem item=new DictItem();
|
|
||||||
item.setCode((String)objs[0]);
|
|
||||||
item.setName((String)objs[1]);
|
|
||||||
item.setFilter((String)objs[2]);
|
|
||||||
maps.put(item.getName(), item);
|
|
||||||
}
|
|
||||||
// for(Object[] objs : list) {
|
|
||||||
// String code=(String)objs[0];
|
|
||||||
// String filter=(String)objs[2];
|
|
||||||
// DictItem current=maps.get(code);
|
|
||||||
// DictItem parent=maps.get(filter);
|
|
||||||
// if(parent!=null) {
|
|
||||||
// keys.put(current.getName(), parent.getName());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
return maps;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String,String> getMajorTypes(){
|
|
||||||
//Map<String,String> keys=new HashMap<String,String>();
|
|
||||||
String sql="Select code,name,filter from "+BaseConstant.DICTIONARY_TABLE_NAMEPRE+"major_type";
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<Object[]> list = this.sqlFindList(sql);
|
|
||||||
Map<String,String> maps=new HashMap<String,String>();
|
|
||||||
|
|
||||||
for(Object[] objs : list) {
|
|
||||||
DictItem item=new DictItem();
|
|
||||||
item.setCode((String)objs[0]);
|
|
||||||
item.setName((String)objs[1]);
|
|
||||||
item.setFilter((String)objs[2]);
|
|
||||||
maps.put(item.getName(), item.getCode());
|
|
||||||
}
|
|
||||||
|
|
||||||
return maps;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package com.xboe.casetask.dao;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import com.xboe.casetask.entity.Cases;
|
|
||||||
import com.xboe.core.orm.BaseDao;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public class CasesDao extends BaseDao<Cases> {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package com.xboe.casetask.dao;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import com.xboe.casetask.entity.CasesMajorType;
|
|
||||||
import com.xboe.core.orm.BaseDao;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public class CasesMajorTypeDao extends BaseDao<CasesMajorType> {
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package com.xboe.casetask.dao;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import com.xboe.casetask.entity.User;
|
|
||||||
import com.xboe.core.orm.BaseDao;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户DAO
|
|
||||||
*/
|
|
||||||
@Repository
|
|
||||||
public class UserDao extends BaseDao<User> {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
package com.xboe.casetask.entity;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import com.xboe.core.SysConstant;
|
|
||||||
import com.xboe.core.orm.IdEntity;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 同步自定义指定
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Entity
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Table(name = SysConstant.TABLE_PRE+"case_sync_customize")
|
|
||||||
public class CaseSyncCustomize extends IdEntity{
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Column(name = "approval_number",length = 100)
|
|
||||||
private String approvalNumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 要使用的附件的索引
|
|
||||||
*/
|
|
||||||
@Column(name = "attachment_index",length = 1)
|
|
||||||
private Integer attachmentIndex;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 要使用的附件的名称
|
|
||||||
*/
|
|
||||||
@Column(name = "attachment_name",length =300)
|
|
||||||
private String attachmentName;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package com.xboe.casetask.entity;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.xboe.core.SysConstant;
|
|
||||||
import com.xboe.core.orm.IdEntity;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Entity
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Table(name = SysConstant.TABLE_PRE+"case_sync_log")
|
|
||||||
public class CaseSyncLog extends IdEntity{
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Column(name = "log_time",nullable = false,length = 100)
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime logTime;
|
|
||||||
|
|
||||||
@Column(name = "request",length = 200)
|
|
||||||
private String request;
|
|
||||||
|
|
||||||
@Column(name = "response",columnDefinition = "mediumtext")
|
|
||||||
private String response;
|
|
||||||
}
|
|
||||||
@@ -1,243 +0,0 @@
|
|||||||
package com.xboe.casetask.entity;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
import javax.persistence.Transient;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.xboe.core.SysConstant;
|
|
||||||
import com.xboe.core.orm.IdEntity;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 案例同步记录
|
|
||||||
* @author seastar
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Entity
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Table(name = SysConstant.TABLE_PRE+"case_sync_record")
|
|
||||||
public class CaseSyncRecord extends IdEntity{
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
//以下几项,是转化后的结果数据
|
|
||||||
@Column(name = "org_domain_id",length =30)
|
|
||||||
private String orgDomainId;
|
|
||||||
|
|
||||||
@Column(name = "org_domain",length =30)
|
|
||||||
private String orgDomain;
|
|
||||||
|
|
||||||
@Column(name = "org_domain_parent_id",length =30)
|
|
||||||
private String orgDomainParentId;
|
|
||||||
|
|
||||||
@Column(name = "org_domain_parent",length =30)
|
|
||||||
private String orgDomainParent;
|
|
||||||
|
|
||||||
@Column(name = "major_type_code",length =30)
|
|
||||||
private String majorTypeId;
|
|
||||||
|
|
||||||
@Column(name = "major_type",length =30)
|
|
||||||
private String majorType;
|
|
||||||
|
|
||||||
@Column(name = "file_path",length =200)
|
|
||||||
private String filePath;
|
|
||||||
|
|
||||||
@Column(name = "author_id",length =50)
|
|
||||||
private String authorId;
|
|
||||||
|
|
||||||
@Column(name = "author_name",length =50)
|
|
||||||
private String authorName;
|
|
||||||
|
|
||||||
@Column(name = "add_new",length = 1)
|
|
||||||
private Boolean addNew;
|
|
||||||
|
|
||||||
@Transient
|
|
||||||
private Cases caseInfo;
|
|
||||||
|
|
||||||
@Transient
|
|
||||||
private List<String[]> attachmentList;
|
|
||||||
|
|
||||||
@Transient
|
|
||||||
private List<String> majorTypeIdList;
|
|
||||||
|
|
||||||
|
|
||||||
//以下是接收的内容
|
|
||||||
/**审批单号*/
|
|
||||||
@Column(name = "approval_number",length = 100)
|
|
||||||
private String approvalNumber;
|
|
||||||
|
|
||||||
@Column(name = "case_name",length = 200)
|
|
||||||
private String caseName;
|
|
||||||
|
|
||||||
/**摘要,对应数据对接中的,caseSummary字段*/
|
|
||||||
@Column(name = "case_summary", nullable = true, columnDefinition = "text")
|
|
||||||
private String caseSummary;
|
|
||||||
|
|
||||||
/**保密级别*/
|
|
||||||
@Column(name = "confidentiality_level",length = 100)
|
|
||||||
private String confidentialityLevel;
|
|
||||||
|
|
||||||
/**起草时间*/
|
|
||||||
@Column(name = "drafting_time")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime draftingTime;
|
|
||||||
|
|
||||||
/**结束时间*/
|
|
||||||
@Column(name = "end_time")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime endTime;
|
|
||||||
|
|
||||||
/**起草人*/
|
|
||||||
@Column(name = "drafter")
|
|
||||||
private String drafter;
|
|
||||||
|
|
||||||
/**部门*/
|
|
||||||
@Column(name = "department")
|
|
||||||
private String department;
|
|
||||||
|
|
||||||
/**联系电话*/
|
|
||||||
@Column(name = "contact_number")
|
|
||||||
private String contactNumber;
|
|
||||||
|
|
||||||
@Column(name = "email")
|
|
||||||
private String email;
|
|
||||||
|
|
||||||
/**案例渠道,需要字典数据,当前系统未使用此字段,只是记录*/
|
|
||||||
@Column(name = "case_channel")
|
|
||||||
private String caseChannel;
|
|
||||||
|
|
||||||
/**是否为关联管理职级晋升的领导力方案*/
|
|
||||||
@Column(name = "is_leadership_plan")
|
|
||||||
private Boolean isLeadershipPlan;
|
|
||||||
|
|
||||||
/**案例公开范围,默认全员公开*/
|
|
||||||
@Column(name = "case_scope")
|
|
||||||
private String caseScope;
|
|
||||||
|
|
||||||
/**案例涉及流程*/
|
|
||||||
@Column(name = "case_flow")
|
|
||||||
private String caseFlow;
|
|
||||||
|
|
||||||
/**实际案例主*/
|
|
||||||
@Column(name = "case_owner")
|
|
||||||
private String caseOwner;
|
|
||||||
|
|
||||||
/**案主所在部门*/
|
|
||||||
@Column(name = "case_owner_department")
|
|
||||||
private String caseOwnerDepartment;
|
|
||||||
|
|
||||||
/**案主电话*/
|
|
||||||
@Column(name = "case_owner_phone")
|
|
||||||
private String caseOwnerPhone;
|
|
||||||
|
|
||||||
/**案例其他主要贡献人*/
|
|
||||||
@Column(name = "case_other_contributor")
|
|
||||||
private String caseOtherContributor;
|
|
||||||
|
|
||||||
@Column(name = "case_specialty_sequence")
|
|
||||||
private String caseSpecialtySequence;
|
|
||||||
|
|
||||||
/**案主所属组织*/
|
|
||||||
@Column(name = "case_owner_org")
|
|
||||||
private String caseOwnerOrg;
|
|
||||||
|
|
||||||
/**案例类型,需要字典数据*/
|
|
||||||
@Column(name = "case_type")
|
|
||||||
private String caseType;
|
|
||||||
|
|
||||||
@Column(name = "case_type1")
|
|
||||||
private String caseType1;
|
|
||||||
|
|
||||||
@Column(name = "case_type2")
|
|
||||||
private String caseType2;
|
|
||||||
|
|
||||||
/**案例主题,需要字典数据*/
|
|
||||||
@Column(name = "case_theme")
|
|
||||||
private String caseTheme;
|
|
||||||
|
|
||||||
/**案例主题为“自定义”时,会返回案例说明,caseTheme在什么情况下才自定义*/
|
|
||||||
@Column(name = "case_theme_description")
|
|
||||||
private String caseThemeDescription;
|
|
||||||
|
|
||||||
/**案例主题,需要字典数据*/
|
|
||||||
@Column(name = "case_theme1")
|
|
||||||
private String caseTheme1;
|
|
||||||
|
|
||||||
/**案例主题为“自定义”时,会返回案例说明,caseTheme在什么情况下才自定义*/
|
|
||||||
@Column(name = "case_theme_description1")
|
|
||||||
private String caseThemeDescription1;
|
|
||||||
|
|
||||||
/**案例主题,需要字典数据*/
|
|
||||||
@Column(name = "case_theme2")
|
|
||||||
private String caseTheme2;
|
|
||||||
|
|
||||||
/**案例主题为“自定义”时,会返回案例说明,caseTheme在什么情况下才自定义*/
|
|
||||||
@Column(name = "case_theme_description2")
|
|
||||||
private String caseThemeDescription2;
|
|
||||||
|
|
||||||
@Column(name = "keyword1")
|
|
||||||
private String keyword1;
|
|
||||||
|
|
||||||
@Column(name = "keyword2")
|
|
||||||
private String keyword2;
|
|
||||||
|
|
||||||
@Column(name = "keyword3")
|
|
||||||
private String keyword3;
|
|
||||||
|
|
||||||
@Column(name = "keyword4")
|
|
||||||
private String keyword4;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "keyword5")
|
|
||||||
private String keyword5;
|
|
||||||
|
|
||||||
@Column(name = "readers")
|
|
||||||
private String readers;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "case_value")
|
|
||||||
private String caseValue;
|
|
||||||
|
|
||||||
/**对就的attachment内容的json字符串*/
|
|
||||||
@Column(name = "attachment",columnDefinition = "text")
|
|
||||||
private String attachment;
|
|
||||||
|
|
||||||
@Column(name = "attachment_url",length = 500)
|
|
||||||
private String attachmentUrl;
|
|
||||||
|
|
||||||
@Column(name = "attachment_name",length = 200)
|
|
||||||
private String attachmentName;
|
|
||||||
|
|
||||||
/**对就的approvalRecord内容的json字符串*/
|
|
||||||
@Column(name = "approval_record",columnDefinition = "text")
|
|
||||||
private String approvalRecord;
|
|
||||||
|
|
||||||
/**0表执行成功,1表数据解析失败*/
|
|
||||||
@Column(name = "status",length=2)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
/**0表执行成功,1表数据接收失败,2表数据解析失败,3组织领域关联失败,4表专业分类关联失败,5表用户关联失败,6表文件识别失败,7表文件下载失败*/
|
|
||||||
@Column(name = "error_info")
|
|
||||||
private String errorInfo;
|
|
||||||
|
|
||||||
/**执行时间*/
|
|
||||||
@Column(name = "sync_time")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime syncTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库的id
|
|
||||||
*/
|
|
||||||
@Column(name = "case_id",length=19)
|
|
||||||
private String caseId;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,228 +0,0 @@
|
|||||||
package com.xboe.casetask.entity;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.xboe.core.SysConstant;
|
|
||||||
import com.xboe.core.orm.BaseEntity;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 案例表
|
|
||||||
* */
|
|
||||||
@Data
|
|
||||||
@Entity
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Table(name = SysConstant.TABLE_PRE+"cases")
|
|
||||||
public class Cases extends BaseEntity {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**标题*/
|
|
||||||
@Column(name = "title",nullable = false,length = 100)
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
/**企业ID, 多企业使用*/
|
|
||||||
@Column(name = "company_id", length = 36)
|
|
||||||
private String companyId;
|
|
||||||
|
|
||||||
/**内容*/
|
|
||||||
@Column(name = "content",nullable = true,columnDefinition = "text")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
/**文件的路径*/
|
|
||||||
@Column(name = "file_path")
|
|
||||||
private String filePath;
|
|
||||||
|
|
||||||
@Column(name = "file_name")
|
|
||||||
private String fileName;
|
|
||||||
|
|
||||||
|
|
||||||
/**作者id,对应案主ID,原数据 caseOwner 对应是原系统数据,这里是当前系统的用户id,需要一个转化*/
|
|
||||||
@Column(name = "author_id")
|
|
||||||
private String authorId;
|
|
||||||
|
|
||||||
/**作者名称*/
|
|
||||||
@Column(name = "author_name")
|
|
||||||
private String authorName;
|
|
||||||
|
|
||||||
/** 封面图地址*/
|
|
||||||
@Column(name = "cover_url",length = 400)
|
|
||||||
private String coverUrl;
|
|
||||||
|
|
||||||
/**是否推荐 0:未推荐 1:推荐*/
|
|
||||||
@Column(name = "bre_commend",length = 1)
|
|
||||||
private Integer breCommend;
|
|
||||||
|
|
||||||
/**推荐时间*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@Column(name = "recommend_time")
|
|
||||||
private LocalDateTime recommendTime;
|
|
||||||
|
|
||||||
/**是否置顶 0:未置顶,1:已置顶*/
|
|
||||||
@Column(name = "is_top",length = 1)
|
|
||||||
private Boolean isTop;
|
|
||||||
|
|
||||||
/**置顶时间*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@Column(name = "top_time")
|
|
||||||
private LocalDateTime topTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0:草稿
|
|
||||||
* 1:待审核
|
|
||||||
* 2:已审核未通过
|
|
||||||
* 3:已审核通过
|
|
||||||
* */
|
|
||||||
// @Column(name = "status",length = 1)
|
|
||||||
// private Integer status;
|
|
||||||
|
|
||||||
@Column(name = "views", nullable = false)
|
|
||||||
private Integer views;
|
|
||||||
|
|
||||||
@Column(name = "comments", nullable = false)
|
|
||||||
private Integer comments;
|
|
||||||
|
|
||||||
@Column(name = "praises", nullable = false)
|
|
||||||
private Integer praises;
|
|
||||||
|
|
||||||
@Column(name = "shares", nullable = false)
|
|
||||||
private Integer shares;
|
|
||||||
|
|
||||||
@Column(name = "favorites", nullable = false)
|
|
||||||
private Integer favorites;
|
|
||||||
|
|
||||||
/**摘要,对应数据对接中的,caseSummary字段*/
|
|
||||||
@Column(name = "summary", nullable = true, length = 400)
|
|
||||||
private String summary;
|
|
||||||
|
|
||||||
/**组织领域二级 对应原数据 caseOwnerOrg 案主所属组织*/
|
|
||||||
@Column(name = "org_domain")
|
|
||||||
private String orgDomain;
|
|
||||||
|
|
||||||
/**组织领域一级 对应原数据 二级对应的关系上级的名称*/
|
|
||||||
@Column(name = "org_domain_parent")
|
|
||||||
private String orgDomainParent;
|
|
||||||
|
|
||||||
/**专业分类,原数据 案例专业序列caseSpecialtySequence*/
|
|
||||||
@Column(name = "major_type")
|
|
||||||
private String majorType;
|
|
||||||
|
|
||||||
/**审批单号*/
|
|
||||||
@Column(name = "approval_number",length = 100)
|
|
||||||
private String approvalNumber;
|
|
||||||
|
|
||||||
/**保密级别*/
|
|
||||||
@Column(name = "confidentiality_level",length = 100)
|
|
||||||
private String confidentialityLevel;
|
|
||||||
|
|
||||||
/**起草时间*/
|
|
||||||
@Column(name = "drafting_time")
|
|
||||||
private LocalDateTime draftingTime;
|
|
||||||
|
|
||||||
/**结束时间*/
|
|
||||||
@Column(name = "end_time")
|
|
||||||
private LocalDateTime endTime;
|
|
||||||
|
|
||||||
/**起草人*/
|
|
||||||
@Column(name = "drafter")
|
|
||||||
private String drafter;
|
|
||||||
|
|
||||||
/**部门*/
|
|
||||||
@Column(name = "department")
|
|
||||||
private String department;
|
|
||||||
|
|
||||||
/**联系电话*/
|
|
||||||
@Column(name = "contact_number")
|
|
||||||
private String contactNumber;
|
|
||||||
|
|
||||||
@Column(name = "email")
|
|
||||||
private String email;
|
|
||||||
|
|
||||||
/**案例渠道,需要字典数据,当前系统未使用此字段,只是记录*/
|
|
||||||
@Column(name = "case_channel")
|
|
||||||
private String caseChannel;
|
|
||||||
|
|
||||||
/**是否为关联管理职级晋升的领导力方案*/
|
|
||||||
@Column(name = "is_leadership_plan")
|
|
||||||
private Boolean isLeadershipPlan;
|
|
||||||
|
|
||||||
/**案例公开范围,默认全员公开*/
|
|
||||||
@Column(name = "case_scope")
|
|
||||||
private String caseScope;
|
|
||||||
|
|
||||||
/**案例涉及流程*/
|
|
||||||
@Column(name = "case_flow")
|
|
||||||
private String caseFlow;
|
|
||||||
|
|
||||||
/**实际案例主*/
|
|
||||||
@Column(name = "case_owner")
|
|
||||||
private String caseOwner;
|
|
||||||
|
|
||||||
/**案主所在部门*/
|
|
||||||
@Column(name = "case_owner_department")
|
|
||||||
private String caseOwnerDepartment;
|
|
||||||
|
|
||||||
/**案主电话*/
|
|
||||||
@Column(name = "case_owner_phone")
|
|
||||||
private String caseOwnerPhone;
|
|
||||||
|
|
||||||
/**案例其他主要贡献人*/
|
|
||||||
@Column(name = "case_other_contributor")
|
|
||||||
private String caseOtherContributor;
|
|
||||||
|
|
||||||
@Column(name = "case_specialty_sequence")
|
|
||||||
private String caseSpecialtySequence;
|
|
||||||
|
|
||||||
/**案主所属组织*/
|
|
||||||
@Column(name = "case_owner_org")
|
|
||||||
private String caseOwnerOrg;
|
|
||||||
|
|
||||||
/**案例类型,需要字典数据*/
|
|
||||||
@Column(name = "case_type")
|
|
||||||
private String caseType;
|
|
||||||
|
|
||||||
@Column(name = "case_type1")
|
|
||||||
private String caseType1;
|
|
||||||
|
|
||||||
@Column(name = "case_type2")
|
|
||||||
private String caseType2;
|
|
||||||
|
|
||||||
/**案例主题,需要字典数据*/
|
|
||||||
@Column(name = "case_theme")
|
|
||||||
private String caseTheme;
|
|
||||||
|
|
||||||
/**案例主题为“自定义”时,会返回案例说明,caseTheme在什么情况下才自定义*/
|
|
||||||
@Column(name = "case_theme_description")
|
|
||||||
private String caseThemeDescription;
|
|
||||||
|
|
||||||
@Column(name = "keyword1")
|
|
||||||
private String keyword1;
|
|
||||||
|
|
||||||
@Column(name = "keyword2")
|
|
||||||
private String keyword2;
|
|
||||||
|
|
||||||
@Column(name = "keyword3")
|
|
||||||
private String keyword3;
|
|
||||||
|
|
||||||
@Column(name = "keyword4")
|
|
||||||
private String keyword4;
|
|
||||||
|
|
||||||
@Column(name = "keyword5")
|
|
||||||
private String keyword5;
|
|
||||||
|
|
||||||
@Column(name = "readers")
|
|
||||||
private String readers;
|
|
||||||
|
|
||||||
/**案例价值和应用场景*/
|
|
||||||
@Column(name = "case_value")
|
|
||||||
private String caseValue;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package com.xboe.casetask.entity;
|
|
||||||
|
|
||||||
import com.xboe.core.SysConstant;
|
|
||||||
import com.xboe.core.orm.IdEntity;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 中间表
|
|
||||||
* */
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Entity
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Table(name = SysConstant.TABLE_PRE+"cases_major_type")
|
|
||||||
public class CasesMajorType extends IdEntity{
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 内容分类id
|
|
||||||
* */
|
|
||||||
|
|
||||||
@Column(name = "major_id",length = 20)
|
|
||||||
private String majorId;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 案例id
|
|
||||||
* */
|
|
||||||
@Column(name = "case_id",length = 20)
|
|
||||||
// @ManyToOne(optional = true)
|
|
||||||
// @JoinColumn(name = "id")
|
|
||||||
private String caseId;
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
package com.xboe.casetask.entity;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import javax.persistence.Transient;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字典条目
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class DictItem implements java.io.Serializable{
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**代码*/
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
/**中文名称*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**过滤条件,一般是code,用于字典关联,比如省市县*/
|
|
||||||
private String filter;
|
|
||||||
|
|
||||||
/**分组说明*/
|
|
||||||
private String group;
|
|
||||||
|
|
||||||
private String explanation;
|
|
||||||
|
|
||||||
/**显示顺序*/
|
|
||||||
private Integer norder;
|
|
||||||
|
|
||||||
/**是否允许删除*/
|
|
||||||
private Boolean deletable;
|
|
||||||
|
|
||||||
/**是否已删除*/
|
|
||||||
private Boolean deleted;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 二级
|
|
||||||
* */
|
|
||||||
@Transient
|
|
||||||
private List<DictItem> list;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,223 +0,0 @@
|
|||||||
package com.xboe.casetask.entity;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
import javax.persistence.Transient;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.xboe.core.SysConstant;
|
|
||||||
import com.xboe.core.orm.IdEntity;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户信息表
|
|
||||||
* 存储所有的用户信息,原表中的部分信息
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Entity
|
|
||||||
@Table(name = SysConstant.TABLE_PRE + "user")
|
|
||||||
public class User extends IdEntity {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 旧系统id
|
|
||||||
*/
|
|
||||||
@Column(name = "sys_id", length = 36)
|
|
||||||
private String sysId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 旧系统机构id
|
|
||||||
*/
|
|
||||||
@Column(name = "sys_depart_id", length = 36)
|
|
||||||
private String sysDepartId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 姓名
|
|
||||||
*/
|
|
||||||
@Column(name = "name", length = 30)
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 员工编号
|
|
||||||
*/
|
|
||||||
@Column(name = "user_no", length = 30)
|
|
||||||
private String userNo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 性别 1:男 2:女
|
|
||||||
*/
|
|
||||||
@Column(name = "gender", length = 1)
|
|
||||||
private Integer gender;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生日
|
|
||||||
*/
|
|
||||||
@Column(name = "birthday")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private LocalDate birthday;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 身份证号
|
|
||||||
*/
|
|
||||||
@Column(name = "id_number", length = 18)
|
|
||||||
private String idNumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
@Column(name = "mobile_no", length = 11)
|
|
||||||
private String mobileNo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 家庭电话
|
|
||||||
*/
|
|
||||||
@Column(name = "home_phone_no", length = 50)
|
|
||||||
private String homePhoneNo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国籍
|
|
||||||
*/
|
|
||||||
@Column(name = "nationality", length = 50)
|
|
||||||
private String nationality;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 毕业院校
|
|
||||||
*/
|
|
||||||
@Column(name = "graduated_from", length = 50)
|
|
||||||
private String graduatedFrom;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 毕业专业
|
|
||||||
*/
|
|
||||||
@Column(name = "graduated_major", length = 50)
|
|
||||||
private String graduatedMajor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最高学历
|
|
||||||
*/
|
|
||||||
@Column(name = "highest_education", length = 50)
|
|
||||||
private String highestEducation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 办公电话
|
|
||||||
*/
|
|
||||||
@Column(name = "telephone_no", length = 50)
|
|
||||||
private String telephoneNo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 职务
|
|
||||||
*/
|
|
||||||
@Column(name = "duty", length = 50)
|
|
||||||
private String duty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 职级
|
|
||||||
*/
|
|
||||||
@Column(name = "rank", length = 50)
|
|
||||||
private String rank;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
@Column(name = "description")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所在公司
|
|
||||||
*/
|
|
||||||
@Column(name = "company_id", length = 36)
|
|
||||||
private String companyId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所在部门
|
|
||||||
*/
|
|
||||||
@Column(name = "depart_id", length = 18)
|
|
||||||
private String departId;
|
|
||||||
|
|
||||||
@Transient
|
|
||||||
private String departName;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所在域
|
|
||||||
*/
|
|
||||||
@Column(name = "domain_id", length = 36)
|
|
||||||
private String domainId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 扩展字段,多租户系统的标识值
|
|
||||||
*/
|
|
||||||
@Column(name = "sass_id", length = 18)
|
|
||||||
private String sassId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户类型,1表学员,2表教师,3表管理员
|
|
||||||
* 该字段暂用于表示是否前台管理员
|
|
||||||
*/
|
|
||||||
@Column(name = "user_type", length = 1)
|
|
||||||
private Integer userType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学习总时长
|
|
||||||
*/
|
|
||||||
@Column(name = "study_total", length = 11)
|
|
||||||
private Integer studyTotal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* boe的时长,和系统时长单独保存
|
|
||||||
*/
|
|
||||||
@Column(name = "learning_Duration", length = 11)
|
|
||||||
private Integer learningDuration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近一次登录时间
|
|
||||||
*/
|
|
||||||
@Column(name = "last_login_at")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime lastLoginAt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近一次登录IP
|
|
||||||
*/
|
|
||||||
@Column(name = "last_login_ip", length = 30)
|
|
||||||
private String lastLoginIp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近一次登录MAC地址
|
|
||||||
*/
|
|
||||||
@Column(name = "last_login_mac", length = 30)
|
|
||||||
private String lastLoginMac;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近一次操作时间
|
|
||||||
*/
|
|
||||||
@Column(name = "last_action_at")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime lastActionAt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近一次操作IP
|
|
||||||
*/
|
|
||||||
@Column(name = "last_action_ip", length = 30)
|
|
||||||
private String lastActionIp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近一次操作MAC地址
|
|
||||||
*/
|
|
||||||
@Column(name = "last_action_mac", length = 30)
|
|
||||||
private String lastActionMac;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 在线状态;
|
|
||||||
* 0:离线,1:在线
|
|
||||||
*/
|
|
||||||
@Column(name = "online", length = 1)
|
|
||||||
private Boolean online;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package com.xboe.casetask.service;
|
|
||||||
|
|
||||||
import com.xboe.casetask.entity.CaseSyncLog;
|
|
||||||
import com.xboe.common.PageList;
|
|
||||||
|
|
||||||
public interface ICaseSyncLogService{
|
|
||||||
|
|
||||||
void save(CaseSyncLog log);
|
|
||||||
|
|
||||||
|
|
||||||
PageList<CaseSyncLog> findPage(int pageIndex,int pageSize);
|
|
||||||
|
|
||||||
void clearLogs();
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
package com.xboe.casetask.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.xboe.casetask.entity.CaseSyncCustomize;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncRecord;
|
|
||||||
import com.xboe.casetask.entity.Cases;
|
|
||||||
import com.xboe.casetask.entity.DictItem;
|
|
||||||
import com.xboe.casetask.entity.User;
|
|
||||||
import com.xboe.common.PageList;
|
|
||||||
|
|
||||||
public interface ICaseSyncService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户的id
|
|
||||||
* @param userNo
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
String getIdByUserNo(String userNo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据工号,查询用户信息
|
|
||||||
* @param userNo
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
User getByUserNo(String userNo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得所有的组织领域
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Map<String,DictItem> getOrgDomains();
|
|
||||||
|
|
||||||
List<DictItem> findDictItemByName(String name);
|
|
||||||
|
|
||||||
List<DictItem> findDictItemByNames(String name1,String name2);
|
|
||||||
|
|
||||||
DictItem getDictItemByCode(String code);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取专业分类
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Map<String,String> getMajorTypes();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据审批单号查询案例信息
|
|
||||||
* @param approvalNumber
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Cases getByApprovalNumber(String approvalNumber);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据单号得到案例的id
|
|
||||||
* @param approvalNumber
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
String getIdByApprovalNumber(String approvalNumber);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存案例信息
|
|
||||||
* @param records
|
|
||||||
*/
|
|
||||||
// void saveCase(List<CaseSyncRecord> records);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单独的同步保存
|
|
||||||
* @param csr
|
|
||||||
*/
|
|
||||||
void saveCase(CaseSyncRecord csr);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存记录
|
|
||||||
* @param record
|
|
||||||
*/
|
|
||||||
void saveRecord(CaseSyncRecord record);
|
|
||||||
|
|
||||||
void deleteRecord(String id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新同步记录
|
|
||||||
* @param id
|
|
||||||
* @param status
|
|
||||||
* @param error
|
|
||||||
*/
|
|
||||||
void updateRecord(String id,int status,String error);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询案例的同步记录
|
|
||||||
* @param pageIndex
|
|
||||||
* @param pageSize
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
PageList<CaseSyncRecord> findPage(int pageIndex,int pageSize,CaseSyncRecord record);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存用户的配置
|
|
||||||
* @param customize
|
|
||||||
*/
|
|
||||||
void saveCaseSyncCustomize(CaseSyncCustomize customize);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过审核批单号查询用户定义配置
|
|
||||||
* @param approvalNumber
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
CaseSyncCustomize getLastCustomizeByApprovalNumber(String approvalNumber);
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package com.xboe.casetask.service.impl;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.transaction.Transactional;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.xboe.casetask.dao.CaseSyncLogDao;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncLog;
|
|
||||||
import com.xboe.casetask.service.ICaseSyncLogService;
|
|
||||||
import com.xboe.common.OrderCondition;
|
|
||||||
import com.xboe.common.PageList;
|
|
||||||
import com.xboe.core.orm.FieldFilters;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class CaseSyncLogServiceImpl implements ICaseSyncLogService{
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
CaseSyncLogDao dao;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public void save(CaseSyncLog log) {
|
|
||||||
dao.save(log);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageList<CaseSyncLog> findPage(int pageIndex, int pageSize) {
|
|
||||||
|
|
||||||
return dao.findPage(pageIndex, pageSize,OrderCondition.desc("id"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public void clearLogs() {
|
|
||||||
//dao.deleteByField("1",1);
|
|
||||||
dao.deleteByFilter(FieldFilters.eq("1","1"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,361 +0,0 @@
|
|||||||
package com.xboe.casetask.service.impl;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.transaction.Transactional;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.xboe.casetask.dao.CaseSyncCustomizeDao;
|
|
||||||
import com.xboe.casetask.dao.CaseSyncRecordDao;
|
|
||||||
import com.xboe.casetask.dao.CasesDao;
|
|
||||||
import com.xboe.casetask.dao.CasesMajorTypeDao;
|
|
||||||
import com.xboe.casetask.dao.UserDao;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncCustomize;
|
|
||||||
import com.xboe.casetask.entity.CaseSyncRecord;
|
|
||||||
import com.xboe.casetask.entity.Cases;
|
|
||||||
import com.xboe.casetask.entity.CasesMajorType;
|
|
||||||
import com.xboe.casetask.entity.DictItem;
|
|
||||||
import com.xboe.casetask.entity.User;
|
|
||||||
import com.xboe.casetask.service.ICaseSyncService;
|
|
||||||
import com.xboe.common.OrderCondition;
|
|
||||||
import com.xboe.common.PageList;
|
|
||||||
import com.xboe.core.event.IEventDataSender;
|
|
||||||
import com.xboe.core.orm.FieldFilters;
|
|
||||||
import com.xboe.core.orm.QueryBuilder;
|
|
||||||
import com.xboe.core.orm.UpdateBuilder;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class CaseSyncServiceImpl implements ICaseSyncService{
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CasesDao caseDao;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CasesMajorTypeDao majorDao;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CaseSyncRecordDao recordDao;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CaseSyncCustomizeDao customizeDao;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private UserDao userDao;
|
|
||||||
|
|
||||||
@Autowired(required = false)
|
|
||||||
private IEventDataSender eventSender;
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// @Transactional
|
|
||||||
// public void saveCase(List<CaseSyncRecord> records) {
|
|
||||||
// //用于控制重复的记录
|
|
||||||
// Set<String> hasNumber=new HashSet<>();
|
|
||||||
// for(CaseSyncRecord csr : records) {
|
|
||||||
// if(csr.getStatus()==0) {
|
|
||||||
// if(hasNumber.contains(csr.getApprovalNumber())) {
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// hasNumber.add(csr.getApprovalNumber());
|
|
||||||
//
|
|
||||||
// String hasId=getIdByApprovalNumber(csr.getApprovalNumber());
|
|
||||||
// if(StringUtils.isNotBlank(hasId)){
|
|
||||||
// //已经存在,不再更新
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Cases c=new Cases();
|
|
||||||
// c.setTitle(csr.getCaseName());//设置标题
|
|
||||||
//
|
|
||||||
// c.setFileName(csr.getAttachmentName());
|
|
||||||
// c.setApprovalNumber(csr.getApprovalNumber());
|
|
||||||
// c.setAuthorId(csr.getAuthorId());
|
|
||||||
// c.setAuthorName(csr.getAuthorName());
|
|
||||||
// c.setCaseChannel(csr.getCaseChannel());
|
|
||||||
// c.setCaseFlow(csr.getCaseFlow());
|
|
||||||
// c.setCaseOtherContributor(csr.getCaseOtherContributor());
|
|
||||||
// c.setCaseOwner(csr.getCaseOwner());
|
|
||||||
// c.setCaseOwnerDepartment(csr.getCaseOwnerDepartment());
|
|
||||||
// c.setCaseOwnerOrg(csr.getCaseOwnerOrg());
|
|
||||||
// c.setCaseOwnerPhone(csr.getCaseOwnerPhone());
|
|
||||||
// c.setCaseScope(csr.getCaseScope());
|
|
||||||
// c.setCaseSpecialtySequence(csr.getCaseSpecialtySequence());
|
|
||||||
// c.setCaseTheme(csr.getCaseTheme());
|
|
||||||
// c.setCaseThemeDescription(csr.getCaseThemeDescription());
|
|
||||||
// c.setCaseType(csr.getCaseType());
|
|
||||||
// c.setCaseType1(csr.getCaseType1());
|
|
||||||
// c.setCaseType2(csr.getCaseType2());
|
|
||||||
// c.setCaseValue(csr.getCaseValue());
|
|
||||||
// c.setConfidentialityLevel(csr.getConfidentialityLevel());
|
|
||||||
// c.setContactNumber(csr.getContactNumber());
|
|
||||||
// c.setContent("");
|
|
||||||
// c.setDepartment(csr.getDepartment());
|
|
||||||
// c.setDrafter(csr.getDrafter());
|
|
||||||
// c.setDraftingTime(csr.getDraftingTime());
|
|
||||||
// c.setEmail(csr.getEmail());
|
|
||||||
// c.setEndTime(csr.getEndTime());
|
|
||||||
// c.setFileName(csr.getAttachmentName());
|
|
||||||
// c.setFilePath(csr.getFilePath());
|
|
||||||
// c.setIsLeadershipPlan(csr.getIsLeadershipPlan());
|
|
||||||
// c.setKeyword1(csr.getKeyword1());
|
|
||||||
// c.setKeyword2(csr.getKeyword2());
|
|
||||||
// c.setKeyword3(csr.getKeyword3());
|
|
||||||
// c.setKeyword4(csr.getKeyword4());
|
|
||||||
// c.setKeyword5(csr.getKeyword5());
|
|
||||||
// c.setReaders(csr.getReaders());
|
|
||||||
// c.setSummary(csr.getCaseSummary());
|
|
||||||
//
|
|
||||||
// //
|
|
||||||
// c.setOrgDomain(csr.getOrgDomainId());
|
|
||||||
// c.setOrgDomainParent(csr.getOrgDomainParentId());
|
|
||||||
// c.setMajorType(csr.getMajorTypeId());
|
|
||||||
// //设置创建时间是endtime对应的时间
|
|
||||||
// c.setSysCreateTime(csr.getEndTime());
|
|
||||||
// //默认值
|
|
||||||
// c.setSysCreateAid(csr.getAuthorId());
|
|
||||||
// c.setSysCreateBy(csr.getAuthorName());
|
|
||||||
// c.setSysUpdateBy(csr.getAuthorName());
|
|
||||||
// c.setComments(0);
|
|
||||||
// c.setBreCommend(0);
|
|
||||||
// c.setFavorites(0);
|
|
||||||
// c.setPraises(0);
|
|
||||||
// c.setShares(0);
|
|
||||||
// c.setTopTime(null);
|
|
||||||
// c.setViews(0);
|
|
||||||
// c.setRecommendTime(null);
|
|
||||||
// c.setIsTop(false);
|
|
||||||
// c.setCoverUrl("");
|
|
||||||
// c.setDeleted(false);
|
|
||||||
// //通过字典关系 ,找到上级的名称 ,加进去
|
|
||||||
// caseDao.save(c);
|
|
||||||
// if(csr.getMajorTypeIdList()!=null && !csr.getMajorTypeIdList().isEmpty()) {
|
|
||||||
// for(String s : csr.getMajorTypeIdList()) {
|
|
||||||
// CasesMajorType cmt=new CasesMajorType();
|
|
||||||
// cmt.setCaseId(c.getId());
|
|
||||||
// cmt.setMajorId(s);
|
|
||||||
// majorDao.save(cmt);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// recordDao.updateFieldById(csr.getId(), "caseId", c.getId());
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public void saveCase(CaseSyncRecord csr) {
|
|
||||||
//用于控制重复的记录
|
|
||||||
if(csr.getStatus()==0) {
|
|
||||||
String hasId=getIdByApprovalNumber(csr.getApprovalNumber());
|
|
||||||
if(StringUtils.isNotBlank(hasId)){
|
|
||||||
//已经存在,不再更新
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Cases c=new Cases();
|
|
||||||
c.setTitle(csr.getCaseName());//设置标题
|
|
||||||
|
|
||||||
c.setFileName(csr.getAttachmentName());
|
|
||||||
c.setApprovalNumber(csr.getApprovalNumber());
|
|
||||||
c.setAuthorId(csr.getAuthorId());
|
|
||||||
c.setAuthorName(csr.getAuthorName());
|
|
||||||
c.setCaseChannel(csr.getCaseChannel());
|
|
||||||
c.setCaseFlow(csr.getCaseFlow());
|
|
||||||
c.setCaseOtherContributor(csr.getCaseOtherContributor());
|
|
||||||
c.setCaseOwner(csr.getCaseOwner());
|
|
||||||
c.setCaseOwnerDepartment(csr.getCaseOwnerDepartment());
|
|
||||||
c.setCaseOwnerOrg(csr.getCaseOwnerOrg());
|
|
||||||
c.setCaseOwnerPhone(csr.getCaseOwnerPhone());
|
|
||||||
c.setCaseScope(csr.getCaseScope());
|
|
||||||
c.setCaseSpecialtySequence(csr.getCaseSpecialtySequence());
|
|
||||||
c.setCaseTheme(csr.getCaseTheme());
|
|
||||||
c.setCaseThemeDescription(csr.getCaseThemeDescription());
|
|
||||||
c.setCaseType(csr.getCaseType());
|
|
||||||
c.setCaseType1(csr.getCaseType1());
|
|
||||||
c.setCaseType2(csr.getCaseType2());
|
|
||||||
c.setCaseValue(csr.getCaseValue());
|
|
||||||
c.setConfidentialityLevel(csr.getConfidentialityLevel());
|
|
||||||
c.setContactNumber(csr.getContactNumber());
|
|
||||||
c.setContent("");
|
|
||||||
c.setDepartment(csr.getDepartment());
|
|
||||||
c.setDrafter(csr.getDrafter());
|
|
||||||
c.setDraftingTime(csr.getDraftingTime());
|
|
||||||
c.setEmail(csr.getEmail());
|
|
||||||
c.setEndTime(csr.getEndTime());
|
|
||||||
c.setFileName(csr.getAttachmentName());
|
|
||||||
c.setFilePath(csr.getFilePath());
|
|
||||||
c.setIsLeadershipPlan(csr.getIsLeadershipPlan());
|
|
||||||
c.setKeyword1(csr.getKeyword1());
|
|
||||||
c.setKeyword2(csr.getKeyword2());
|
|
||||||
c.setKeyword3(csr.getKeyword3());
|
|
||||||
c.setKeyword4(csr.getKeyword4());
|
|
||||||
c.setKeyword5(csr.getKeyword5());
|
|
||||||
c.setReaders(csr.getReaders());
|
|
||||||
c.setSummary(csr.getCaseSummary());
|
|
||||||
|
|
||||||
//
|
|
||||||
c.setOrgDomain(csr.getOrgDomainId());
|
|
||||||
c.setOrgDomainParent(csr.getOrgDomainParentId());
|
|
||||||
c.setMajorType(csr.getMajorTypeId());
|
|
||||||
//设置创建时间是endtime对应的时间
|
|
||||||
c.setSysCreateTime(csr.getEndTime());
|
|
||||||
//默认值
|
|
||||||
c.setSysCreateAid(csr.getAuthorId());
|
|
||||||
c.setSysCreateBy(csr.getAuthorName());
|
|
||||||
c.setSysUpdateBy(csr.getAuthorName());
|
|
||||||
c.setComments(0);
|
|
||||||
c.setBreCommend(0);
|
|
||||||
c.setFavorites(0);
|
|
||||||
c.setPraises(0);
|
|
||||||
c.setShares(0);
|
|
||||||
c.setTopTime(null);
|
|
||||||
c.setViews(0);
|
|
||||||
c.setRecommendTime(null);
|
|
||||||
c.setIsTop(false);
|
|
||||||
c.setCoverUrl("");
|
|
||||||
c.setDeleted(false);
|
|
||||||
//通过字典关系 ,找到上级的名称 ,加进去
|
|
||||||
caseDao.save(c);
|
|
||||||
if(csr.getMajorTypeIdList()!=null && !csr.getMajorTypeIdList().isEmpty()) {
|
|
||||||
for(String s : csr.getMajorTypeIdList()) {
|
|
||||||
CasesMajorType cmt=new CasesMajorType();
|
|
||||||
cmt.setCaseId(c.getId());
|
|
||||||
cmt.setMajorId(s);
|
|
||||||
majorDao.save(cmt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
recordDao.updateFieldById(csr.getId(), "caseId", c.getId());
|
|
||||||
if(eventSender!=null) {
|
|
||||||
eventSender.send("发布案例", "SyncCase",c.getTitle(), c.getId(), "3",c.getTitle(),c.getSysCreateAid(), c.getSysCreateBy(),"");
|
|
||||||
}else {
|
|
||||||
System.out.print("未配置事件消息发送的实现");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public void saveRecord(CaseSyncRecord record) {
|
|
||||||
record.setSyncTime(LocalDateTime.now());
|
|
||||||
recordDao.save(record);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public void updateRecord(String id, int status, String error) {
|
|
||||||
recordDao.updateMultiFieldById(id,UpdateBuilder.create("status", status),UpdateBuilder.create("errorInfo", error));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String,DictItem> getOrgDomains() {
|
|
||||||
|
|
||||||
return recordDao.getOrgDomains();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DictItem> findDictItemByName(String name) {
|
|
||||||
|
|
||||||
return recordDao.findDictItemByName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DictItem getDictItemByCode(String code) {
|
|
||||||
|
|
||||||
return recordDao.findDictItemByCode(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, String> getMajorTypes() {
|
|
||||||
|
|
||||||
return recordDao.getMajorTypes();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Cases getByApprovalNumber(String approvalNumber) {
|
|
||||||
Cases c=caseDao.findOne(FieldFilters.eq("approvalNumber", approvalNumber));
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getIdByUserNo(String userNo) {
|
|
||||||
Object id=userDao.findField("id",FieldFilters.eq("userNo", userNo));
|
|
||||||
return (String)id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getIdByApprovalNumber(String approvalNumber) {
|
|
||||||
// Object id=caseDao.findField("id",FieldFilters.eq("approvalNumber", approvalNumber),FieldFilters.eq("deleted", false));
|
|
||||||
// return (String)id;
|
|
||||||
List<?> list =caseDao.findListField("id", FieldFilters.eq("approvalNumber", approvalNumber));
|
|
||||||
if(list!=null && !list.isEmpty()) {
|
|
||||||
return list.get(0).toString();
|
|
||||||
}else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageList<CaseSyncRecord> findPage(int pageIndex, int pageSize, CaseSyncRecord record) {
|
|
||||||
QueryBuilder query=QueryBuilder.from(CaseSyncRecord.class);
|
|
||||||
query.setPageIndex(pageIndex);
|
|
||||||
query.setPageSize(pageSize);
|
|
||||||
query.addOrder(OrderCondition.desc("id"));
|
|
||||||
if(record!=null) {
|
|
||||||
if(StringUtils.isNotBlank(record.getCaseName())) {
|
|
||||||
query.addFilter(FieldFilters.like("caseName", record.getCaseName()));
|
|
||||||
}
|
|
||||||
if(record.getStatus()!=null) {
|
|
||||||
query.addFilter(FieldFilters.eq("status", record.getStatus()));
|
|
||||||
}
|
|
||||||
//特定的需求过滤
|
|
||||||
if(StringUtils.isNotBlank(record.getErrorInfo())) {
|
|
||||||
query.addFilter(FieldFilters.ne("errorInfo", record.getErrorInfo()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return recordDao.findPage(query.builder());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public void saveCaseSyncCustomize(CaseSyncCustomize customize) {
|
|
||||||
customizeDao.save(customize);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public CaseSyncCustomize getLastCustomizeByApprovalNumber(String approvalNumber) {
|
|
||||||
List<CaseSyncCustomize> list=customizeDao.findList(1,OrderCondition.desc("id"),FieldFilters.eq("approvalNumber", approvalNumber));
|
|
||||||
if(!list.isEmpty()) {
|
|
||||||
return list.get(0);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public void deleteRecord(String id) {
|
|
||||||
recordDao.deleteById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DictItem> findDictItemByNames(String name1, String name2) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return recordDao.findDictItemByName(name1, name2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public User getByUserNo(String userNo) {
|
|
||||||
User user=userDao.findOne(FieldFilters.eq("userNo", userNo));
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
package com.xboe.stat;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.xboe.core.SysConstant;
|
|
||||||
import com.xboe.core.api.TokenProxy;
|
|
||||||
import com.xboe.core.event.IEventDataSender;
|
|
||||||
import com.xboe.core.utils.OkHttpUtil;
|
|
||||||
import com.xboe.standard.BaseConstant;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 事件数据发送实现,如果是云环境,只需要修改此类的实现就可以了
|
|
||||||
* @author seastar
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class EventDataSender implements IEventDataSender{
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private OkHttpUtil okHttpUtil;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private HttpServletRequest request;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void send(String title, String eventKey, String content, String objId, String objType, String objInfo,
|
|
||||||
String aid, String aname,String author) {
|
|
||||||
String statBaseUrl=SysConstant.getConfigValue("xboe.stat.base.url");
|
|
||||||
if(StringUtils.isBlank(statBaseUrl)) {
|
|
||||||
log.error("发送事件失败:未配置【xboe.stat.base.url】的值");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String urlPre="/xboe/m/stat/event/send";
|
|
||||||
//案例同步不需要token
|
|
||||||
if(eventKey.equals("SyncCase")) {
|
|
||||||
urlPre ="/inner/stat/event/send";
|
|
||||||
}
|
|
||||||
|
|
||||||
final String url = statBaseUrl + urlPre;
|
|
||||||
Map<String, String> params = new HashMap<>();
|
|
||||||
params.put("title", title);
|
|
||||||
params.put("source", "all");
|
|
||||||
params.put("content", content);
|
|
||||||
params.put("objId", objId);
|
|
||||||
params.put("key", eventKey);
|
|
||||||
params.put("objType", objType);
|
|
||||||
params.put("objInfo", objInfo);
|
|
||||||
params.put("aid", aid);
|
|
||||||
params.put("aname", aname);
|
|
||||||
params.put("parameters","");
|
|
||||||
String token = TokenProxy.getToken(request);
|
|
||||||
//最后采用异常发送,不影响当前进程
|
|
||||||
|
|
||||||
new Thread(()->{
|
|
||||||
try {
|
|
||||||
ObjectMapper mapper=new ObjectMapper();
|
|
||||||
String json =mapper.writeValueAsString(params);
|
|
||||||
//String[] headers=new String[] {"token",token};
|
|
||||||
String[] headers=new String[] {BaseConstant.HTTP_ACCESS_TOKEN,token};
|
|
||||||
|
|
||||||
String responseStr = okHttpUtil.doPostJson(url, json,headers);
|
|
||||||
if(responseStr.indexOf("\"status\":200")==-1) {
|
|
||||||
log.error("发送事件失败:"+responseStr);
|
|
||||||
log.info("【发送的token】"+headers[0]+": "+headers[1]);
|
|
||||||
}
|
|
||||||
}catch(Exception e) {
|
|
||||||
log.error("发送事件错误",e);
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
## datasource config
|
|
||||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
|
||||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
|
||||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boeu_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
|
||||||
spring.datasource.username=root
|
|
||||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
|
||||||
|
|
||||||
logging.level.org.hibernate.SQL=DEBUG
|
|
||||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## xboe config
|
|
||||||
xboe.api.cross_filter=true
|
|
||||||
|
|
||||||
## 案例同步发事件的接口
|
|
||||||
xboe.stat.base.url=http://127.0.0.1:9090
|
|
||||||
|
|
||||||
|
|
||||||
## 案例接口配置,init 是否需要初始化
|
|
||||||
xboe.case.sync.init=true
|
|
||||||
xboe.case.sync.api.url=https://csb-broker.boe.com.cn:8086/test
|
|
||||||
xboe.case.sync.api.name=BoeCaseQueryService
|
|
||||||
xboe.case.sync.api.version=1.0.0
|
|
||||||
xboe.case.sync.api.method=POST
|
|
||||||
xboe.case.sync.api.ak=2fc434b249a9402baa070f4cf162bd01
|
|
||||||
xboe.case.sync.api.sk=HSrZqDJfkQg2LmHP1uwOi5BOA2I=
|
|
||||||
|
|
||||||
#加密盐
|
|
||||||
#jasypt.encryptor.password=jasypt
|
|
||||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
|
||||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
## datasource config
|
|
||||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
|
||||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
|
||||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
|
||||||
spring.datasource.username=root
|
|
||||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
|
||||||
|
|
||||||
logging.level.org.hibernate.SQL=ERROR
|
|
||||||
# logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
|
||||||
|
|
||||||
|
|
||||||
## xboe config
|
|
||||||
xboe.api.cross_filter=true
|
|
||||||
|
|
||||||
## 案例同步发事件的接口
|
|
||||||
xboe.stat.base.url=https://u.boe.com/statApi
|
|
||||||
|
|
||||||
|
|
||||||
## 案例接口配置
|
|
||||||
## 案例接口配置,init 是否需要初始化
|
|
||||||
xboe.case.sync.init=false
|
|
||||||
xboe.case.sync.api.url=https://api-csb-broker.boe.com.cn:8086/test
|
|
||||||
xboe.case.sync.api.name=BoeCaseQueryService
|
|
||||||
xboe.case.sync.api.version=1.0.0
|
|
||||||
xboe.case.sync.api.method=POST
|
|
||||||
xboe.case.sync.api.ak=62f60d4cde0c4e8aa08517081649fdb7
|
|
||||||
xboe.case.sync.api.sk=Qg9sVwQI55vmU3/EQ0yPJJxU92E=
|
|
||||||
|
|
||||||
#加密盐
|
|
||||||
#jasypt.encryptor.password=jasypt
|
|
||||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
|
||||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
|
||||||
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
## datasource config
|
|
||||||
spring.jpa.show-sql = false
|
|
||||||
spring.jpa.hibernate.ddl-auto=none
|
|
||||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
|
||||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
|
||||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
|
||||||
spring.datasource.username=root
|
|
||||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
|
||||||
|
|
||||||
logging.level.org.hibernate.SQL=ERROR
|
|
||||||
# logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
|
||||||
|
|
||||||
|
|
||||||
## xboe config
|
|
||||||
xboe.api.cross_filter=true
|
|
||||||
|
|
||||||
## 案例同步发事件的接口
|
|
||||||
xboe.stat.base.url=https://u.boe.com/statApi
|
|
||||||
|
|
||||||
|
|
||||||
## 案例接口配置
|
|
||||||
## 案例接口配置,init 是否需要初始化
|
|
||||||
xboe.case.sync.init=false
|
|
||||||
xboe.case.sync.api.url=https://api-csb-broker.boe.com.cn:8086/test
|
|
||||||
xboe.case.sync.api.name=BoeCaseQueryService
|
|
||||||
xboe.case.sync.api.version=1.0.0
|
|
||||||
xboe.case.sync.api.method=POST
|
|
||||||
xboe.case.sync.api.ak=62f60d4cde0c4e8aa08517081649fdb7
|
|
||||||
xboe.case.sync.api.sk=Qg9sVwQI55vmU3/EQ0yPJJxU92E=
|
|
||||||
|
|
||||||
#加密盐
|
|
||||||
#jasypt.encryptor.password=jasypt
|
|
||||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
|
||||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
|
||||||
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
## datasource config
|
|
||||||
spring.jpa.show-sql = false
|
|
||||||
spring.jpa.hibernate.ddl-auto=none
|
|
||||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
|
||||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
|
||||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
|
||||||
spring.datasource.username=boe_base
|
|
||||||
spring.datasource.password=ENC(MaC28GJw2JcbH8Lil0CrqSDTYxX49FJ0rxcmHH2pX0k=)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## xboe config
|
|
||||||
xboe.api.cross_filter=true
|
|
||||||
|
|
||||||
## 案例同步发事件的接口
|
|
||||||
xboe.stat.base.url=https://u-pre.boe.com/statApi
|
|
||||||
|
|
||||||
|
|
||||||
## 案例接口配置
|
|
||||||
## 案例接口配置,init 是否需要初始化
|
|
||||||
xboe.case.sync.init=true
|
|
||||||
xboe.case.sync.api.url=https://csb-broker.boe.com.cn:8086/test
|
|
||||||
xboe.case.sync.api.name=BoeCaseQueryService
|
|
||||||
xboe.case.sync.api.version=1.0.0
|
|
||||||
xboe.case.sync.api.method=POST
|
|
||||||
xboe.case.sync.api.ak=2fc434b249a9402baa070f4cf162bd01
|
|
||||||
xboe.case.sync.api.sk=HSrZqDJfkQg2LmHP1uwOi5BOA2I=
|
|
||||||
|
|
||||||
#加密盐
|
|
||||||
#jasypt.encryptor.password=jasypt
|
|
||||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
|
||||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
spring.profiles.active=@profileActive@
|
|
||||||
spring.application.name=boe-server-case
|
|
||||||
server.port=9093
|
|
||||||
server.servlet.session.timeout=30m
|
|
||||||
|
|
||||||
|
|
||||||
server.servlet.encoding.charset=UTF-8
|
|
||||||
server.servlet.encoding.enabled=true
|
|
||||||
server.servlet.encoding.force=true
|
|
||||||
|
|
||||||
server.tomcat.uri-encoding=UTF-8
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ok.http.connect-timeout=30
|
|
||||||
ok.http.read-timeout=30
|
|
||||||
ok.http.write-timeout=30
|
|
||||||
# 连接池中整体的空闲连接的最大数量
|
|
||||||
ok.http.max-idle-connections=200
|
|
||||||
# 连接空闲时间最多为 300 秒
|
|
||||||
ok.http.keep-alive-duration=300
|
|
||||||
|
|
||||||
#spring.jackson.locale=
|
|
||||||
#spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
|
||||||
# spring.jackson.default-property-inclusion=NON_NULL
|
|
||||||
spring.jackson.time-zone=GMT+8
|
|
||||||
|
|
||||||
spring.servlet.multipart.max-file-size=1024MB
|
|
||||||
spring.servlet.multipart.max-request-size=1024MB
|
|
||||||
|
|
||||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
|
||||||
spring.mvc.static-path-pattern=/cdn/**
|
|
||||||
|
|
||||||
|
|
||||||
spring.redis.lettuce.pool.max-active=8
|
|
||||||
spring.redis.lettuce.pool.min-idle=0
|
|
||||||
spring.redis.lettuce.pool.max-idle=30
|
|
||||||
spring.redis.lettuce.pool.max-wait=10000ms
|
|
||||||
spring.redis.lettuce.shutdown-timeout=100ms
|
|
||||||
|
|
||||||
# 上传的临时目录,部署到服务器必须指定
|
|
||||||
# spring.servlet.multipart.location=
|
|
||||||
|
|
||||||
# jpa config
|
|
||||||
spring.jpa.database = MYSQL
|
|
||||||
spring.jpa.show-sql = false
|
|
||||||
# spring.jpa.properties.hibernate.cache.use_second_level_cache=true
|
|
||||||
# spring.jpa.properties.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory
|
|
||||||
spring.jpa.hibernate.ddl-auto=none
|
|
||||||
spring.jpa.properties.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy
|
|
||||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
|
|
||||||
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
|
|
||||||
#spring.transaction
|
|
||||||
# spring.jpa.properties.hibernate.allow_update_outside_transaction=true
|
|
||||||
# spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
|
||||||
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
|
||||||
|
|
||||||
|
|
||||||
# 设置logback.xml位置
|
|
||||||
logging.config=classpath:log/logback-@profileActive@.xml
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,14 +0,0 @@
|
|||||||
<License>
|
|
||||||
<Data>
|
|
||||||
<Products>
|
|
||||||
<Product>Aspose.Total for Java</Product>
|
|
||||||
<Product>Aspose.Words for Java</Product>
|
|
||||||
</Products>
|
|
||||||
<EditionType>Enterprise</EditionType>
|
|
||||||
<SubscriptionExpiry>20991231</SubscriptionExpiry>
|
|
||||||
<LicenseExpiry>20991231</LicenseExpiry>
|
|
||||||
<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>
|
|
||||||
</Data>
|
|
||||||
<Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=
|
|
||||||
</Signature>
|
|
||||||
</License>
|
|
||||||
Binary file not shown.
@@ -1,54 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration debug="false" scan="false">
|
|
||||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
|
||||||
<property name="log.path" value="logs/${spring.application.name}"/>
|
|
||||||
<!-- 彩色日志格式 -->
|
|
||||||
<property name="CONSOLE_LOG_PATTERN"
|
|
||||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
|
||||||
<!-- 彩色日志依赖的渲染类 -->
|
|
||||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
|
||||||
<conversionRule conversionWord="wex"
|
|
||||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
|
||||||
<conversionRule conversionWord="wEx"
|
|
||||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
|
||||||
<!-- Console log output -->
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file debug output -->
|
|
||||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/debug.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file error output -->
|
|
||||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/error.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
||||||
<level>ERROR</level>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
|
||||||
<root level="INFO">
|
|
||||||
<appender-ref ref="console"/>
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration debug="false" scan="false">
|
|
||||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
|
||||||
<property name="log.path" value="/home/logs/${spring.application.name}"/>
|
|
||||||
<!-- 彩色日志格式 -->
|
|
||||||
<property name="CONSOLE_LOG_PATTERN"
|
|
||||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
|
||||||
<!-- 彩色日志依赖的渲染类 -->
|
|
||||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
|
||||||
<conversionRule conversionWord="wex"
|
|
||||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
|
||||||
<conversionRule conversionWord="wEx"
|
|
||||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
|
||||||
<!-- Console log output -->
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file debug output -->
|
|
||||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/debug.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file error output -->
|
|
||||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/error.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
||||||
<level>ERROR</level>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
|
||||||
<root level="ERROR">
|
|
||||||
<appender-ref ref="debug"/>
|
|
||||||
<appender-ref ref="error"/>
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration debug="false" scan="false">
|
|
||||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
|
||||||
<property name="log.path" value="/home/logs/${spring.application.name}"/>
|
|
||||||
<!-- 彩色日志格式 -->
|
|
||||||
<property name="CONSOLE_LOG_PATTERN"
|
|
||||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
|
||||||
<!-- 彩色日志依赖的渲染类 -->
|
|
||||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
|
||||||
<conversionRule conversionWord="wex"
|
|
||||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
|
||||||
<conversionRule conversionWord="wEx"
|
|
||||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
|
||||||
<!-- Console log output -->
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file debug output -->
|
|
||||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/debug.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file error output -->
|
|
||||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/error.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
||||||
<level>ERROR</level>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
|
||||||
<root level="ERROR">
|
|
||||||
<appender-ref ref="debug"/>
|
|
||||||
<appender-ref ref="error"/>
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration debug="false" scan="false">
|
|
||||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
|
||||||
<property name="log.path" value="logs/${spring.application.name}"/>
|
|
||||||
<!-- 彩色日志格式 -->
|
|
||||||
<property name="CONSOLE_LOG_PATTERN"
|
|
||||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
|
||||||
<!-- 彩色日志依赖的渲染类 -->
|
|
||||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
|
||||||
<conversionRule conversionWord="wex"
|
|
||||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
|
||||||
<conversionRule conversionWord="wEx"
|
|
||||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
|
||||||
<!-- Console log output -->
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file debug output -->
|
|
||||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/debug.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file error output -->
|
|
||||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/error.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
||||||
<level>ERROR</level>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
|
||||||
<root level="INFO">
|
|
||||||
<appender-ref ref="debug"/>
|
|
||||||
<appender-ref ref="error"/>
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
package com.xboe;
|
|
||||||
|
|
||||||
public class AttachmentUrlTest {
|
|
||||||
|
|
||||||
// public static String getNameStr(String name) {
|
|
||||||
// String first=name.replaceAll("\\(","(");
|
|
||||||
// int index1=first.indexOf("(");
|
|
||||||
// if(index1>0) {
|
|
||||||
// first=first.substring(0,index1);
|
|
||||||
// }
|
|
||||||
// return first;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static void main(String[] args) throws Exception {
|
|
||||||
//// String fileUrl="http://bpm.boe.com.cn/portal/apps/com.awspaas.user.apps.showfj/temp/tylc07_boealfjdz/00002770-张玉欣-专利包质量基准.docx";
|
|
||||||
//// int urlLast=fileUrl.lastIndexOf("/");
|
|
||||||
////
|
|
||||||
//// String urlName=fileUrl.substring(urlLast+1);
|
|
||||||
////
|
|
||||||
//// fileUrl=fileUrl.substring(0, urlLast+1)+URLEncoder.encode(urlName, "UTF-8");
|
|
||||||
//// System.out.println(fileUrl);
|
|
||||||
//// fileUrl=fileUrl.replaceAll("\\+","%20");
|
|
||||||
//// System.out.println(fileUrl);
|
|
||||||
//
|
|
||||||
// String caseName="经营管理(一级、二级经营责任者撰写),战略预算(战略企划与执行、预算),投融资(投资管理、资金、股证)】,未匹配到专业分类【经营管理(一级、二级经营责任者撰写),战略预算(战略企划与执行、预算),投融资(投资管理、资金、股证)";
|
|
||||||
// System.out.println(caseName.replaceAll("\\(","("));
|
|
||||||
// System.out.println(AttachmentUrlTest.getNameStr(caseName));
|
|
||||||
// //替换英文的括号为中文的括号
|
|
||||||
// //caseName=caseName.replaceAll("(","(");
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user