mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-08 02:16:49 +08:00
Compare commits
63 Commits
dev0525
...
zcwy0923-w
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6bd808a3d | ||
|
|
b87eb65b3e | ||
|
|
28af48581e | ||
|
|
6a04082245 | ||
|
|
81a1a88eab | ||
|
|
1dfdc9277d | ||
|
|
7c840d2bfc | ||
|
|
48e2adad7f | ||
|
|
e04735ee44 | ||
|
|
c2de2a433b | ||
|
|
cb0e784d5e | ||
|
|
e6feea6dbf | ||
|
|
012f987de0 | ||
|
|
3cbef3e3f7 | ||
|
|
2e2edbbf57 | ||
|
|
403e72ec5f | ||
|
|
9136f338da | ||
|
|
f8257a1806 | ||
|
|
2986344fd5 | ||
|
|
056d15e5fa | ||
|
|
d2043da062 | ||
|
|
af6c232d49 | ||
|
|
aa32e9136c | ||
|
|
22ebe90c08 | ||
|
|
0dc58db106 | ||
|
|
749a6b69e7 | ||
|
|
6dadd80372 | ||
|
|
04a4f528bf | ||
|
|
4fa0215373 | ||
|
|
f7cd9f8469 | ||
|
|
163425cad2 | ||
|
|
3735c38001 | ||
|
|
1021f0bd43 | ||
|
|
1fd0c32f97 | ||
|
|
0d0b45f017 | ||
|
|
2440b6ca50 | ||
|
|
9591e60ac4 | ||
|
|
363dba845f | ||
|
|
6220f212d2 | ||
|
|
5ed277e918 | ||
|
|
e52d9b682b | ||
|
|
436eedd570 | ||
|
|
345e28fdee | ||
|
|
312c85d92c | ||
|
|
a590cd19b1 | ||
|
|
58c5ab499a | ||
|
|
a38cfc553f | ||
|
|
56199f1480 | ||
|
|
6d5fd5364d | ||
|
|
99792ccab6 | ||
|
|
78b36b6da0 | ||
|
|
f6a7bb77c0 | ||
|
|
dfb0825cfd | ||
|
|
ba8ef92700 | ||
|
|
56d064e533 | ||
|
|
654da73faf | ||
|
|
627e87509f | ||
|
|
2911ef8d46 | ||
|
|
b86ce744a7 | ||
|
|
c096c44a91 | ||
|
|
db84181523 | ||
|
|
b568285fed | ||
|
|
e38be093f4 |
@@ -20,7 +20,7 @@ import com.xboe.common.utils.StringUtil;
|
||||
public class ElasticsearchConfig {
|
||||
|
||||
@Value("${xboe.elasticsearch.server.ip}")
|
||||
private String esIp="127.0.0.1";
|
||||
private String esIp="10.251.88.214";
|
||||
|
||||
@Value("${xboe.elasticsearch.server.port}")
|
||||
private int esPort=9200;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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">
|
||||
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>
|
||||
@@ -16,38 +16,38 @@
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud.version>2021.0.5</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2021.0.5.0</spring-cloud-alibaba.version>
|
||||
<nacos-client.version>2.2.0</nacos-client.version>
|
||||
<spring-cloud-alibaba.version>2021.0.5.0</spring-cloud-alibaba.version>
|
||||
<nacos-client.version>2.2.0</nacos-client.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- 引入Cloud -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
<version>${spring-cloud-alibaba.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
<version>${nacos-client.version}</version>
|
||||
</dependency>
|
||||
<!-- end -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
<version>${spring-cloud-alibaba.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
<version>${nacos-client.version}</version>
|
||||
</dependency>
|
||||
<!-- end -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>4.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>xboe-api</artifactId>
|
||||
@@ -58,7 +58,7 @@
|
||||
<artifactId>xboe-module-scorm</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>xboe-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
@@ -92,9 +92,9 @@
|
||||
<systemPath>${project.basedir}/src/main/resources/libs/jave-1.0.2.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.18.3</version>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.18.3</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
@@ -109,8 +109,8 @@
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -129,10 +129,10 @@
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
@@ -184,13 +184,13 @@
|
||||
</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>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>
|
||||
@@ -213,20 +213,20 @@
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-client</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-client</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.retry</groupId>
|
||||
<artifactId>spring-retry</artifactId>
|
||||
@@ -235,32 +235,32 @@
|
||||
</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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -271,8 +271,8 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
@@ -295,12 +295,12 @@
|
||||
<profileActive>test</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test135</id>
|
||||
<properties>
|
||||
<profileActive>test135</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test135</id>
|
||||
<properties>
|
||||
<profileActive>test135</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
|
||||
@@ -12,12 +12,14 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.system.ApplicationPid;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@Configuration
|
||||
@SpringBootApplication
|
||||
@EnableCaching
|
||||
@EnableAsync
|
||||
@EnableRetry
|
||||
@EnableScheduling
|
||||
public class BoeServerAllApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -34,8 +34,6 @@ public class UrlSecurityFilterImpl implements IUrlSecurityFilter{
|
||||
noLoginUrls.add("/xboe/m/exam/alone-extend/save");
|
||||
|
||||
noLoginUrls.add("/xboe/m/course/manage/test");
|
||||
// 暂时取消验证 todo by yyk
|
||||
noLoginUrls.add("/xboe/m/course/manage/getCourseCoverUrl");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,14 +4,11 @@ import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.lang.Opt;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.GsonBuilder;
|
||||
import com.xboe.api.vo.*;
|
||||
import com.xboe.module.course.vo.StudyCourseVo;
|
||||
import com.xboe.module.course.vo.TeacherInfoVo;
|
||||
import com.xboe.module.course.vo.TeacherVo;
|
||||
import com.xboe.module.dict.entity.DictDto;
|
||||
import com.xboe.module.exam.entity.AloneExam;
|
||||
import com.xboe.module.exam.entity.ExamTest;
|
||||
import com.xboe.school.study.entity.StudyCourse;
|
||||
import com.xboe.system.user.dao.UserDao;
|
||||
@@ -21,18 +18,16 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ThirdApi {
|
||||
@@ -74,15 +69,12 @@ public class ThirdApi {
|
||||
@Value("${manageApi.editExam}")
|
||||
private String editExam;
|
||||
|
||||
@Value("${userBasic.getUserIdByWorkNum}")
|
||||
private String getUserIdByWorkNum;
|
||||
|
||||
@Value("${coursesuilt.syncExamScoreToCourseSuite}")
|
||||
private String syncExamScoreToCourseSuite;
|
||||
@Value("${userBasic.getUserBasicInfo}")
|
||||
private String getUserBasicInfo;
|
||||
|
||||
//获取例外人员的id
|
||||
public List<String> getUserId(){
|
||||
String responseBody = Optional.ofNullable(HttpRequest.get(infarasApiUrl+"?pid=136&type=1").execute() //prod 316
|
||||
String responseBody = Optional.ofNullable(HttpRequest.get(infarasApiUrl+"?pid=316&type=1").execute() //prod 316
|
||||
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||
log.info("正在获取例外人员工号 responseBody = " + responseBody);
|
||||
try {
|
||||
@@ -232,7 +224,6 @@ public class ThirdApi {
|
||||
Opt.ofBlankAble(resp).map(t -> JSONUtil.toBean(t, DynamicBean.class).success());
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String token = "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJjb21wYW55Q29kZSI6IkMwMDEiLCJ1SWQiOiI5NjUzNDIwMjc0OTc2MDcxNjgiLCJjb21wYW55SWQiOiIxMDQxNjczOTc3Mzc5OTQ2NDk2IiwibG9naW5JZCI6IjE2ODg0NDg5MjIwNzY0OTE3NzgiLCJpc3MiOiJodHRwOi8vdS5ib2UuY29tIiwiR2l2ZW5OYW1lIjoiYm9ldSIsImV4cCI6MTY5MTM5OTc2NzU1OCwidXNlck5hbWUiOiLmnY7njonlhrAiLCJ1c2VySWQiOiI2QjA0OUZBRi1DMzE0LTdDQ0YtMEQyOC0wRDIzRjRDNDI1MzEifQ==.8b52dcf4d48a790ed258b9ca2b279bb269f5301722095382fbd352705b51c893";
|
||||
String resp = Optional.ofNullable(HttpRequest.post("https://u-pre.boe.com/statApi/xboe/m/stat/userdynamic/list").body(JSONUtil.toJsonStr(UserdynamicParam.builder().
|
||||
@@ -244,42 +235,9 @@ public class ThirdApi {
|
||||
List<UserDynamic> list = a.getResult().getList();
|
||||
System.out.println(" list = " +list.size());
|
||||
System.out.println(" list = " +list);
|
||||
}
|
||||
|
||||
|
||||
public HashMap<String, String> getUserIdByWorkNum(String token, List<String> workNumList) {
|
||||
// 将workNum列表转换为逗号分隔的字符串
|
||||
String workNums = workNumList.stream()
|
||||
.collect(Collectors.joining(","));
|
||||
// 构建请求URL
|
||||
String url = getUserIdByWorkNum+"?workNums=" + workNums;
|
||||
String respStr = Optional.ofNullable(
|
||||
HttpRequest.get(url)
|
||||
.header("token", token)
|
||||
.execute().body()
|
||||
).orElseThrow(() -> new RuntimeException("Token校验失败"));
|
||||
// 解析JSON字符串为HashMap
|
||||
GetUserIdByWorkNumResult getUserIdByWorkNumResult = JSONUtil.parseObj(respStr).toBean(GetUserIdByWorkNumResult.class);
|
||||
HashMap<String, String> result = getUserIdByWorkNumResult.getResult();
|
||||
return result;
|
||||
}
|
||||
|
||||
public void syncExamScoreToCourseSuite(AloneExam aloneExam,String token) {
|
||||
Gson gson = new GsonBuilder()
|
||||
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer())
|
||||
.create();
|
||||
|
||||
String json = gson.toJson(aloneExam);
|
||||
String resp = HttpRequest.post(syncExamScoreToCourseSuite)
|
||||
.body(json)
|
||||
.header("token", token)
|
||||
.execute()
|
||||
.body();
|
||||
|
||||
if (StringUtils.isBlank(resp)){
|
||||
return;
|
||||
}
|
||||
JSONUtil.toBean(resp, SyncExamScoreBean.class).success();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -316,4 +274,32 @@ public class ThirdApi {
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 虽然当前已存在接口查询用户基本信息,目前仅仅包括用户名、工号、用户ID
|
||||
*/
|
||||
public List<UserBasicInfo> getUserBasicInfoByUserId(List<String> userIds, HttpServletRequest request) {
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
token = request.getHeader("token");
|
||||
}
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
token = request.getHeader("x-access-token");
|
||||
}
|
||||
|
||||
// 将userIds列表转换为逗号分隔的字符串
|
||||
String userIdsStr = userIds.stream()
|
||||
.collect(Collectors.joining(","));
|
||||
String url = getUserBasicInfo +"?userIds=" + userIdsStr;
|
||||
|
||||
String respStr = Optional.ofNullable(HttpRequest
|
||||
.get(url)
|
||||
.header("token", token)
|
||||
.execute().body()).orElseThrow(() -> new RuntimeException("用户中心用户数据获取失败"));
|
||||
|
||||
UserBasicInfoResult userBasicInfoResult = JSONUtil.parseObj(respStr).toBean(UserBasicInfoResult.class);
|
||||
List<UserBasicInfo> basicInfos = userBasicInfoResult.getResult();
|
||||
return basicInfos;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.xboe.api.vo;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.xboe.school.study.entity.StudyCourse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Slf4j
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CheckExamBandingBean {
|
||||
|
||||
private boolean show;
|
||||
private String version;
|
||||
private int code;
|
||||
private String msg;
|
||||
private Object data;
|
||||
private boolean success;
|
||||
|
||||
public CheckExamBandingBean success() {
|
||||
if (this.code!=200) {
|
||||
log.error("获取绑定关系失败----{}", JSONUtil.toJsonPrettyStr(this));
|
||||
return null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.xboe.api.vo;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.xboe.module.course.vo.TeacherVo;
|
||||
import com.xboe.module.exam.dto.ExamTestDto;
|
||||
import com.xboe.module.exam.entity.AloneExam;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Slf4j
|
||||
public class GetExamSyncResult {
|
||||
private String error;
|
||||
private String message;
|
||||
private String permissions;
|
||||
private List<AloneExam> result;
|
||||
private int status;
|
||||
private Date timestamp;
|
||||
|
||||
public GetExamSyncResult success() {
|
||||
if (this.status != 200) {
|
||||
log.error("同步考试记录失败----{}", JSONUtil.toJsonPrettyStr(this));
|
||||
return null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.xboe.api.vo;
|
||||
|
||||
import com.alibaba.nacos.shaded.com.google.gson.JsonElement;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.JsonPrimitive;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.JsonSerializationContext;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.JsonSerializer;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public class LocalDateTimeSerializer implements JsonSerializer<LocalDateTime> {
|
||||
private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Override
|
||||
public JsonElement serialize(LocalDateTime src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
return new JsonPrimitive(formatter.format(src));
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.xboe.api.vo;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Data
|
||||
@Slf4j
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SyncExamScoreBean {
|
||||
|
||||
private boolean show;
|
||||
private String version;
|
||||
private int code;
|
||||
private String msg;
|
||||
private Object data;
|
||||
private boolean success;
|
||||
|
||||
public SyncExamScoreBean success() {
|
||||
if (this.code!=200) {
|
||||
log.error("同步考试到boe库失败----{}", JSONUtil.toJsonPrettyStr(this));
|
||||
return null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.xboe.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserBasicInfo {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户名。
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 工号。
|
||||
*/
|
||||
private String workNum;
|
||||
|
||||
}
|
||||
@@ -8,31 +8,26 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* Auto-generated: 2022-12-10 14:3:18
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
@Slf4j
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetUserIdByWorkNumResult {
|
||||
public class UserBasicInfoResult {
|
||||
|
||||
private String error;
|
||||
private String message;
|
||||
private String permissions;
|
||||
private HashMap<String,String> result;
|
||||
private List<UserBasicInfo> result;
|
||||
private int status;
|
||||
private Date timestamp;
|
||||
|
||||
public GetUserIdByWorkNumResult success() {
|
||||
public UserBasicInfoResult success() {
|
||||
if (this.status != 200) {
|
||||
log.error("获取用户ID列表失败----{}", JSONUtil.toJsonPrettyStr(this));
|
||||
log.error("获取用户基本信息失败----{}", JSONUtil.toJsonPrettyStr(this));
|
||||
return null;
|
||||
}
|
||||
return this;
|
||||
@@ -134,6 +134,8 @@ public interface CacheName {
|
||||
* */
|
||||
String KEY_DICT="dict";
|
||||
|
||||
String STUDY_KEY = "StudyKey:";
|
||||
|
||||
/**
|
||||
* 季度观看量排行key
|
||||
* */
|
||||
@@ -153,6 +155,4 @@ public interface CacheName {
|
||||
* 总点赞排行key
|
||||
* */
|
||||
String CASE_RANK_PRAISE_ALL="case:rank:praise:all";
|
||||
|
||||
String STUDY_KEY = "StudyKey:";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.xboe.module.boecase.api;
|
||||
|
||||
import com.xboe.module.boecase.service.ICasesService;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Component
|
||||
public class CaseScheduledTasks {
|
||||
|
||||
@Resource
|
||||
private ICasesService casesService;
|
||||
|
||||
@Scheduled(cron = "0 0 1 1 * ?") // 每月的第一天的1:00执行
|
||||
public void refreshViewsRankOfMajor() {
|
||||
casesService.refreshViewsRankOfMajor();
|
||||
}
|
||||
|
||||
/**
|
||||
* 季初执行,cron表达式设置为每个季度的第一个月的第一天的特定时间。每个季度的第一个月是1月、4月、7月和10月:
|
||||
*/
|
||||
@Scheduled(cron = "0 0 2 1 1,4,7,10 ?")
|
||||
public void refreshLastQuarterStatistics() {
|
||||
casesService.refreshLastQuarterStatistics();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -686,7 +686,7 @@ public class CasesApi extends ApiBaseController {
|
||||
@SuppressWarnings("unchecked")
|
||||
@GetMapping("/queryPopularityOfMajor")
|
||||
public JsonResponse<List<Cases>> queryPopularityOfMajor(@RequestParam(required = false) Integer pageSize,
|
||||
@RequestParam Long majorId,
|
||||
@RequestParam String majorId,
|
||||
@RequestParam LocalDateTime rankMonth) {
|
||||
String accountId = getCurrent().getAccountId();
|
||||
List<Cases> caseRankingVoList =casesService.queryPopularityOfMajor(pageSize,majorId,rankMonth,accountId);
|
||||
@@ -698,8 +698,8 @@ public class CasesApi extends ApiBaseController {
|
||||
* 所有上榜的的(专业ID-时间), 用于下拉框.优化可将majorName一并查询,返回为List<List<Entity>> todo by anyone
|
||||
*/
|
||||
@GetMapping("/queryAllTimePopularityOfMajor")
|
||||
public JsonResponse<Map<Long, List<String>>> queryAllTimePopularityOfMajor() {
|
||||
Map<Long, List<String>> time = casesService.queryAllTimePopularityOfMajor();
|
||||
public JsonResponse<Map<String, List<String>>> queryAllTimePopularityOfMajor() {
|
||||
Map<String, List<String>> time = casesService.queryAllTimePopularityOfMajor();
|
||||
return success(time);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public class CasesRankDao extends BaseDao<CasesRank> {
|
||||
"FROM\n" +
|
||||
" boe_cases_rank bcvr\n" +
|
||||
"JOIN boe_dict_major_type bdmt \n" +
|
||||
" ON CAST(bdmt.code AS SIGNED) = bcvr.major_id \n" +
|
||||
" ON bdmt.code = bcvr.major_id \n" +
|
||||
"WHERE bcvr.case_id = ?1 AND bcvr.deleted=0 AND bdmt.deleted=0\n" +
|
||||
"ORDER BY bcvr.sys_update_time DESC \n" +
|
||||
"LIMIT 2;";
|
||||
@@ -35,7 +35,7 @@ public class CasesRankDao extends BaseDao<CasesRank> {
|
||||
casesRank.setMajorName(o[0].toString());
|
||||
casesRank.setRiseRankTime(((Timestamp) o[1]).toLocalDateTime());
|
||||
casesRank.setRank(Integer.valueOf(o[2].toString()));
|
||||
casesRank.setMajorId(Long.valueOf(o[3].toString()));
|
||||
casesRank.setMajorId(o[3].toString());
|
||||
resultList.add(casesRank);
|
||||
}
|
||||
return resultList;
|
||||
@@ -63,7 +63,7 @@ public class CasesRankDao extends BaseDao<CasesRank> {
|
||||
}
|
||||
|
||||
|
||||
public List<HashMap<String, Object>> findPopularityOfMajor(Integer pageSize, LocalDateTime startTime, LocalDateTime endTime, Long majorId) {
|
||||
public List<HashMap<String, Object>> findPopularityOfMajor(Integer pageSize, LocalDateTime startTime, LocalDateTime endTime, String majorId) {
|
||||
|
||||
String sql =
|
||||
"SELECT bcr.case_id,bcr.rank\n" +
|
||||
|
||||
@@ -33,7 +33,7 @@ public class CasesRank extends BaseEntity {
|
||||
* 专业ID
|
||||
*/
|
||||
@Column(name = "major_id")
|
||||
private Long majorId;
|
||||
private String majorId;
|
||||
|
||||
/**
|
||||
* 排名
|
||||
@@ -54,7 +54,7 @@ public class CasesRank extends BaseEntity {
|
||||
@Transient
|
||||
private String majorName;
|
||||
|
||||
public CasesRank(Long majorId, LocalDateTime riseRankTime) {
|
||||
public CasesRank(String majorId, LocalDateTime riseRankTime) {
|
||||
this.majorId = majorId;
|
||||
this.riseRankTime = riseRankTime;
|
||||
}
|
||||
|
||||
@@ -133,12 +133,12 @@ public interface ICasesService{
|
||||
|
||||
List<CaseRankingVo> queryRank(Integer pageSize, Integer rankType);
|
||||
|
||||
List<Cases> queryPopularityOfMajor(Integer pageSize, Long majorId, LocalDateTime month, String accountId);
|
||||
List<Cases> queryPopularityOfMajor(Integer pageSize, String majorId, LocalDateTime month, String accountId);
|
||||
|
||||
PageList<FavoriteCaseOfIndexVo> queryFavoriteCaseOfIndex(Integer pageIndex, Integer pageSize, String accountId);
|
||||
|
||||
PageList<CasesBrowsingHistoryVo> browsingHistory(Integer pageIndex, Integer pageSize, String accountId, HttpServletRequest request);
|
||||
|
||||
Map<Long, List<String>> queryAllTimePopularityOfMajor();
|
||||
Map<String, List<String>> queryAllTimePopularityOfMajor();
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
@@ -508,7 +509,11 @@ public class CasesServiceImpl implements ICasesService {
|
||||
|
||||
// 拼接生成年度最佳标签
|
||||
if (e.getExcellent()!=null && e.getExcellent()) {
|
||||
e.setExcellentTag(e.getExcellentTime().format(DateTimeFormatter.ofPattern("yy年"))+"度最佳");
|
||||
if (e.getDraftingTime()!=null){
|
||||
e.setExcellentTag(e.getDraftingTime().format(DateTimeFormatter.ofPattern("yy年"))+"度最佳");
|
||||
} else {
|
||||
e.setExcellentTag(e.getSysCreateTime().format(DateTimeFormatter.ofPattern("yy年"))+"度最佳");
|
||||
}
|
||||
}
|
||||
|
||||
List<String> authorTags = new ArrayList<>();
|
||||
@@ -1163,6 +1168,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void refreshViewsRankOfMajor(){
|
||||
log.info("开始执行每月案例浏览量相关定时任务");
|
||||
// 获取上个月的第一天的00:00
|
||||
// LocalDateTime firstDayOfLastMonth = LocalDateTime.now().minusMonths(1).with(TemporalAdjusters.firstDayOfMonth()).toLocalDate().atStartOfDay();
|
||||
// 获取上个月的最后一天的23:59:59,将其设置为上榜时间。注意,定时统计任务是在本月月初执行的,而上榜时间是在上个月最后一天23:59:59
|
||||
@@ -1175,10 +1181,16 @@ public class CasesServiceImpl implements ICasesService {
|
||||
}
|
||||
|
||||
//获取案例当月排名
|
||||
// String sql =
|
||||
// "SELECT bc.id,bcmt.major_id,bc.views - COALESCE(bc.last_month_views, 0) AS increment\n" +
|
||||
// "FROM boe_cases bc\n" +
|
||||
// "JOIN boe_cases_major_type bcmt ON bcmt.case_id = bc.id and bc.deleted=0 and file_path is not null and file_path!='' and bc.views - COALESCE(bc.last_month_views, 0)!=0";
|
||||
|
||||
String sql =
|
||||
"SELECT bc.id,bcmt.major_id,bc.views - COALESCE(bc.last_month_views, 0) AS increment\n" +
|
||||
"FROM boe_cases bc\n" +
|
||||
"JOIN boe_cases_major_type bcmt ON bcmt.case_id = bc.id and bc.deleted=0 and file_path is not null and file_path!='' and bc.views - COALESCE(bc.last_month_views, 0)!=0";
|
||||
"SELECT bc.id,bcmt.major_id,bc.views AS increment\n" +
|
||||
"FROM boe_cases bc\n" +
|
||||
"JOIN boe_cases_major_type bcmt ON bcmt.case_id = bc.id and bc.deleted=0 and file_path is not null and file_path!='' and bc.views !=0 and bc.views is not null";
|
||||
|
||||
List<Object> caseListOfObject = casesDao.sqlFindList(sql);
|
||||
|
||||
// 转为casesRank
|
||||
@@ -1186,13 +1198,13 @@ public class CasesServiceImpl implements ICasesService {
|
||||
.map(o -> {
|
||||
CasesRank casesRank = new CasesRank();
|
||||
casesRank.setCaseId(Long.valueOf(Array.get(o, 0).toString()));
|
||||
casesRank.setMajorId(Long.valueOf(Array.get(o, 1).toString()));
|
||||
casesRank.setMajorId(Array.get(o, 1).toString());
|
||||
casesRank.setMonthlyIncrement(Integer.parseInt(Array.get(o, 2).toString()));
|
||||
casesRank.setRiseRankTime(lastDayOfLastMonth);
|
||||
return casesRank;
|
||||
}).collect(Collectors.toList());
|
||||
// 根据专业分类进行分组
|
||||
Map<Long, List<CasesRank>> casesRankMap = casesRankList.stream().collect(Collectors.groupingBy(CasesRank::getMajorId));
|
||||
Map<String, List<CasesRank>> casesRankMap = casesRankList.stream().collect(Collectors.groupingBy(CasesRank::getMajorId));
|
||||
|
||||
// 生成当前月不同分类的最新的浏览量排名
|
||||
ArrayList<CasesRank> lastMonthRank = new ArrayList<>();
|
||||
@@ -1209,15 +1221,18 @@ public class CasesServiceImpl implements ICasesService {
|
||||
|
||||
casesRankDao.saveList(lastMonthRank);
|
||||
// 重置上月观看量:last_month_views
|
||||
casesDao.sqlUpdate("update boe_cases set last_month_views=views where deleted=0");
|
||||
int i = casesDao.sqlUpdate("update boe_cases set last_month_views=views where deleted=0");
|
||||
log.info("每月案例浏览量相关定时任务执行完成,boe_cases更新数据量为条数为"+i);
|
||||
log.info("每月案例浏览量相关定时任务执行完成,boe_cases_rank添加数据量为条数为"+lastMonthRank.size());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void refreshLastQuarterStatistics() {
|
||||
casesDao.sqlUpdate("update boe_cases set last_quarter_views=views where deleted=0");
|
||||
casesDao.sqlUpdate("update boe_cases set last_quarter_praise=praise where deleted=0");
|
||||
log.info("开始执行每季案例相关定时任务");
|
||||
int i = casesDao.sqlUpdate("update boe_cases set last_quarter_views=views,last_quarter_praise=praise where deleted=0");
|
||||
log.info("每季案例相关定时任务执行完成,boe_cases更新数据量为条数为"+i);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1247,8 +1262,8 @@ public class CasesServiceImpl implements ICasesService {
|
||||
if (CollectionUtil.isNotEmpty(casesList)) {
|
||||
// 缓存不存在数据,数据库中不存在数据,重建缓存
|
||||
List<String> serializedCases = casesList.stream().map(item -> JSONUtil.toJsonStr(item)).collect(Collectors.toList());
|
||||
// stringRedisTemplate.opsForList().rightPushAll(cacheKey, serializedCases);
|
||||
// stringRedisTemplate.expire(cacheKey, 600, TimeUnit.SECONDS);
|
||||
stringRedisTemplate.opsForList().rightPushAll(cacheKey, serializedCases);
|
||||
stringRedisTemplate.expire(cacheKey, 600, TimeUnit.SECONDS);
|
||||
return casesList;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
@@ -1257,7 +1272,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<Cases> queryPopularityOfMajor(Integer pageSize, Long majorId, LocalDateTime month, String accountId) {
|
||||
public List<Cases> queryPopularityOfMajor(Integer pageSize, String majorId, LocalDateTime month, String accountId) {
|
||||
if (pageSize == null) {
|
||||
pageSize = 10;
|
||||
}
|
||||
@@ -1483,7 +1498,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, List<String>> queryAllTimePopularityOfMajor() {
|
||||
public Map<String, List<String>> queryAllTimePopularityOfMajor() {
|
||||
QueryBuilder builder = QueryBuilder.from(CasesRank.class);
|
||||
builder.addField("new CasesRank(majorId,riseRankTime)");
|
||||
builder.addFilter(FieldFilters.eq("deleted",false));
|
||||
@@ -1493,7 +1508,7 @@ public class CasesServiceImpl implements ICasesService {
|
||||
// 定义日期时间的格式
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yy-MM");
|
||||
|
||||
Map<Long, List<String>> collect = list.stream().collect(Collectors.groupingBy
|
||||
Map<String, List<String>> collect = list.stream().collect(Collectors.groupingBy
|
||||
(CasesRank::getMajorId, Collectors.mapping(casesRank -> casesRank.getRiseRankTime().format(formatter), Collectors.toList())));
|
||||
|
||||
return collect;
|
||||
|
||||
@@ -7,7 +7,9 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -236,46 +238,22 @@ public class CourseFileApi extends ApiBaseController {
|
||||
|
||||
file.setDeleted(false);
|
||||
file.setDown(true);//默认允许下载
|
||||
file.setDuration(0);
|
||||
if (file.getResType() == null) {
|
||||
if ("mp4".indexOf(file.getFileType()) > -1) {
|
||||
file.setResType(10);//以后换成变量
|
||||
} else if ("jpg,png,gif".indexOf(file.getFileType()) > -1) {
|
||||
file.setResType(30);//以后换成变量
|
||||
if (file.getDuration()!=null){
|
||||
file.setDuration(file.getDuration()*60);
|
||||
}
|
||||
} else if ("mp3,wmv".indexOf(file.getFileType()) > -1) {
|
||||
file.setResType(20);//以后换成变量
|
||||
} else if ("doc,xls,ppt,docx,xlsx,pptx".indexOf(file.getFileType()) > -1) {
|
||||
file.setResType(40);//以后换成变量
|
||||
if (file.getDuration()!=null){
|
||||
file.setDuration(file.getDuration()*60);
|
||||
}
|
||||
}else if(file.getFileType().equalsIgnoreCase("zip")) {
|
||||
file.setResType(BoedxCourseFileType.Scrom.getValue());//scorm课件
|
||||
if (file.getDuration()!=null){
|
||||
file.setDuration(file.getDuration()*60);
|
||||
}
|
||||
} else {
|
||||
file.setResType(90);//以后换成变量
|
||||
}
|
||||
}
|
||||
if (file.getResType() != null) {
|
||||
if ("jpg,png,gif".indexOf(file.getFileType()) > -1) {
|
||||
if (file.getDuration() != null) {
|
||||
file.setDuration(file.getDuration() * 60);
|
||||
}
|
||||
}else if ("doc,xls,ppt,docx,xlsx,pptx".indexOf(file.getFileType()) > -1) {
|
||||
if (file.getDuration() != null) {
|
||||
file.setDuration(file.getDuration() * 60);
|
||||
}
|
||||
} else if (file.getFileType().equalsIgnoreCase("zip")) {
|
||||
file.setResType(BoedxCourseFileType.Scrom.getValue());//scorm课件
|
||||
if (file.getDuration() != null) {
|
||||
file.setDuration(file.getDuration() * 60);
|
||||
}
|
||||
}
|
||||
}
|
||||
String fileFullPath = SysConstant.getConfigValue(BaseConstant.CONFIG_UPLOAD_FILES_SAVEPATH) + file.getFilePath();
|
||||
if ("mp3,mp4".indexOf(file.getFileType()) > -1){
|
||||
log.info("上传 "+file.getFileType()+"文件:"+file.getFilePath());
|
||||
@@ -306,12 +284,12 @@ public class CourseFileApi extends ApiBaseController {
|
||||
}
|
||||
|
||||
try {
|
||||
Set<String> officeFileTypes = new HashSet<>(Arrays.asList("doc", "xls", "ppt", "docx", "xlsx", "pptx"));
|
||||
file.setFileType(file.getFileType());
|
||||
|
||||
if(file.getFileType().equalsIgnoreCase("pdf")) {
|
||||
file.setPreviewFilePath(file.getFilePath());
|
||||
file.setConverStatus(0);//代表不需要转化
|
||||
}else if (officeFileTypes.contains(file.getFileType().toLowerCase())) {
|
||||
}else if ("doc,xls,ppt,docx,xlsx,pptx".indexOf(file.getFileType().toLowerCase()) > -1) {
|
||||
file.setConverStatus(1);//转化中
|
||||
}else if(file.getFileType().equalsIgnoreCase("zip")) {
|
||||
//scorm包的内容
|
||||
|
||||
@@ -9,7 +9,12 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.common.Pagination;
|
||||
@@ -1159,11 +1164,5 @@ public class CourseManageApi extends ApiBaseController{
|
||||
return success(courses);
|
||||
}
|
||||
|
||||
@GetMapping("/getCourseCoverUrl")
|
||||
public JsonResponse<Map<String, String>> getCourseCoverUrl(@RequestParam String courseIds){
|
||||
Map<String, String> courseUrlMap = courseService.getCourseCoverUrl(courseIds);
|
||||
return success(courseUrlMap);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,64 +1,50 @@
|
||||
package com.xboe.module.course.api;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.module.course.entity.*;
|
||||
import com.xboe.module.course.vo.TeacherVo;
|
||||
import com.xboe.school.study.dao.StudyCourseDao;
|
||||
import com.xboe.school.study.entity.StudyHomeWork;
|
||||
import com.xboe.school.study.service.IStudyHomeWorkService;
|
||||
import com.xboe.school.study.service.IStudyService;
|
||||
import com.xboe.system.user.entity.User;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.api.vo.UserBasicInfo;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.common.Pagination;
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.module.course.dto.CourseQueryDto;
|
||||
import com.xboe.module.course.dto.CourseTeacherDto;
|
||||
import com.xboe.module.course.dto.RankingDto;
|
||||
import com.xboe.module.course.entity.*;
|
||||
import com.xboe.module.course.service.ICourseContentService;
|
||||
import com.xboe.module.course.service.ICourseSectionService;
|
||||
import com.xboe.module.course.service.ICourseService;
|
||||
import com.xboe.module.course.service.ICourseTeacherService;
|
||||
import com.xboe.module.course.vo.CourseStudyVo;
|
||||
import com.xboe.module.course.vo.TeacherVo;
|
||||
import com.xboe.module.teacher.entity.Teacher;
|
||||
import com.xboe.module.teacher.service.ITeacherService;
|
||||
import com.xboe.module.usergroup.service.IUserGroupService;
|
||||
import com.xboe.school.study.dao.StudyCourseDao;
|
||||
import com.xboe.school.study.entity.StudyCourse;
|
||||
import com.xboe.school.study.entity.StudyCourseItem;
|
||||
import com.xboe.school.study.entity.StudyHomeWork;
|
||||
import com.xboe.school.study.service.IStudyCourseService;
|
||||
|
||||
import com.xboe.school.study.service.IStudyHomeWorkService;
|
||||
import com.xboe.school.study.service.IStudyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
|
||||
/**
|
||||
@@ -74,19 +60,19 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
|
||||
@Resource
|
||||
private ICourseService courseService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ITeacherService teacherService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ICourseContentService contentService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ICourseSectionService sectionService;
|
||||
|
||||
@Resource
|
||||
private ICourseTeacherService courseTeacherService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IUserGroupService userGroupService;
|
||||
|
||||
@@ -124,9 +110,9 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
Map<String,Object> list=courseService.findImages(cids);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 人气榜
|
||||
* 人气榜
|
||||
* */
|
||||
@PostMapping("/ranking")
|
||||
public JsonResponse<List<RankingDto>> Ranking(Integer type,Integer time){
|
||||
@@ -152,7 +138,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
return success(rankingDtos);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询列表,数量,类型,最新,最热
|
||||
* @param num
|
||||
@@ -178,7 +164,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
dto.setDevice(device);
|
||||
try {
|
||||
|
||||
|
||||
List<Course> list=courseService.findList(num, dto);
|
||||
return success(list);
|
||||
}catch(Exception e) {
|
||||
@@ -186,10 +172,10 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
return error("查询课程列表失败",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/pagelist-new")
|
||||
public JsonResponse<PageList<Course>> findNewPage(Pagination pager,CourseQueryDto dto){
|
||||
|
||||
|
||||
//只是查询已发布的
|
||||
|
||||
dto.setPublish(true);
|
||||
@@ -211,9 +197,9 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return success(coursePageList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,7 +210,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
*/
|
||||
@PostMapping("/pagelist")
|
||||
public JsonResponse<PageList<Course>> findPage(Pagination pager,CourseQueryDto dto){
|
||||
|
||||
|
||||
//只是查询已发布的
|
||||
|
||||
dto.setPublish(true);
|
||||
@@ -245,11 +231,11 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return success(coursePageList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
* @param id
|
||||
@@ -260,19 +246,19 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
if(StringUtils.isBlank(id)) {
|
||||
return badRequest("参数错误,未指定课程");
|
||||
}
|
||||
|
||||
|
||||
//当前对于课程不增加浏览量,课程的意义并不是看过
|
||||
// if(addView==null) {
|
||||
// addView=false;
|
||||
// }
|
||||
|
||||
|
||||
Map<String,Object> rs=new HashMap<String,Object>();
|
||||
Course course=courseService.getAddView(id);
|
||||
if(course==null || course.getDeleted()){
|
||||
return badRequest("课程不存在或已被删除");
|
||||
}
|
||||
rs.put("course",course);
|
||||
|
||||
|
||||
List<CourseCrowd> courseCrowdList = courseService.findCrowdByCourseId(id);
|
||||
if(crowd!=null && crowd) {
|
||||
rs.put("crowds",courseCrowdList);
|
||||
@@ -315,7 +301,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
List<CourseContent> cclist=contentService.getByCourseId(id);
|
||||
List<CourseSection> sectionlist=sectionService.getByCourseId(id);
|
||||
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(id);
|
||||
|
||||
|
||||
|
||||
//获取教师的介绍信息,因为一门课程 的教师不会太多,所以这里简单直接遍历查询,后续再优化
|
||||
for(CourseTeacher ct : teachers) {
|
||||
@@ -335,7 +321,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
rs.put("isCrowd",pass);
|
||||
@@ -344,7 +330,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
rs.put("teachers",teachers);
|
||||
//查询课程
|
||||
return success(rs);
|
||||
|
||||
|
||||
}
|
||||
private void getTeacherInfo(String token, List<String> teacherIds) {
|
||||
List<TeacherVo> teacherInfo = thirdApi.getTeacherInfo(teacherIds, token);
|
||||
@@ -363,15 +349,17 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
|
||||
}
|
||||
//作业导出
|
||||
//作业导出
|
||||
@GetMapping("/export")
|
||||
public JsonResponse<String> export(String courseId,String courseName,String contentId,String name,Integer status) throws IOException {
|
||||
public JsonResponse<String> export(String courseId,String courseName,String contentId,String name,Integer status,HttpServletRequest request) throws IOException {
|
||||
Map<String, String>map=new HashMap<>();
|
||||
List<String> userIds = studyCourseDao.findList(FieldFilters.eq("courseId", courseId)).stream().filter(Objects::nonNull).map(StudyCourse::getAid).collect(Collectors.toList());
|
||||
if (userIds.isEmpty()){
|
||||
return error("查询不到用户");
|
||||
}
|
||||
List<User>user=studyService.getUserNo(userIds);
|
||||
|
||||
List <UserBasicInfo> userBasicInfoList =thirdApi.getUserBasicInfoByUserId(userIds,request);
|
||||
|
||||
try {//筛选出的人员
|
||||
List<StudyCourseItem> list = studyService.getList(courseId, contentId, name, status);
|
||||
if(list.isEmpty()){
|
||||
@@ -383,12 +371,12 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
return success("暂无数据");
|
||||
}
|
||||
studyHomeWorks.forEach(e->{
|
||||
user.forEach(u->{
|
||||
if(u.getId().equals(s.getAid())){
|
||||
userBasicInfoList.forEach(u->{
|
||||
if(u.getUserId().equals(s.getAid())){
|
||||
//取后缀
|
||||
int dotIndex = e.getFilePath().lastIndexOf('.'); // 查找最后一个'.'的位置
|
||||
String extension = e.getFilePath().substring(dotIndex);
|
||||
map.put(u.getName()+"-"+u.getUserNo()+extension,"/home/www/elearning/upload"+e.getFilePath());
|
||||
map.put(u.getUserName()+"-"+u.getWorkNum()+extension,"/home/www/elearning/upload"+e.getFilePath());
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -408,49 +396,6 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
String zipFilePath = "/home/www/elearning/upload/saveZip/" + courseName+"【作业】" + ".zip";
|
||||
createZipFile(map, zipFilePath);
|
||||
return success(zipFilePath);
|
||||
// 创建一个临时文件用于存储ZIP文件
|
||||
// File tempZipFile = new File("/home/www/elearning/upload/temp.zip");
|
||||
//
|
||||
// try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(tempZipFile))) {
|
||||
// for (Map.Entry<String, String> e : map.entrySet()) {
|
||||
// File fileToZip = new File(e.getValue());
|
||||
// // 添加 ZIP 条目
|
||||
// ZipEntry entry = new ZipEntry(e.getKey());
|
||||
// entry.setSize(fileToZip.length());
|
||||
//
|
||||
// zos.putNextEntry(entry);
|
||||
//
|
||||
// try (FileInputStream fis = new FileInputStream(fileToZip)) {
|
||||
// byte[] buffer = new byte[4096];
|
||||
// int len;
|
||||
// while ((len = fis.read(buffer)) > 0) {
|
||||
// zos.write(buffer, 0, len);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// zos.closeEntry();
|
||||
// }
|
||||
// }
|
||||
// // 将临时文件移动到指定位置
|
||||
// Path source = tempZipFile.toPath();
|
||||
// //生成uuid
|
||||
//// String uuid = UUID.randomUUID().toString();
|
||||
// Path destination = Paths.get("/home/www/elearning/upload/saveZip/" + courseName+"【作业】" + ".zip");
|
||||
//
|
||||
// // 确保目标目录存在
|
||||
// Files.createDirectories(destination.getParent());
|
||||
//
|
||||
// // 删除目标文件如果已存在
|
||||
// if (Files.exists(destination)) {
|
||||
// Files.delete(destination);
|
||||
// }
|
||||
//
|
||||
// // 移动文件
|
||||
// Files.copy(source, destination, StandardCopyOption.REPLACE_EXISTING);
|
||||
//
|
||||
// // 返回文件路径给前端
|
||||
// String filePath = destination.toAbsolutePath().toString();
|
||||
// return success(filePath);
|
||||
}
|
||||
private static void createZipFile(Map<String, String> map, String zipFilePath) throws IOException {
|
||||
try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFilePath))) {
|
||||
@@ -522,7 +467,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
cv.setStatus(9);
|
||||
}
|
||||
}
|
||||
//音视频
|
||||
//音视频
|
||||
}else{
|
||||
cv.setStatus(study.getStatus());
|
||||
|
||||
|
||||
@@ -85,6 +85,4 @@ public interface ICourseContentService{
|
||||
|
||||
void updateProcessVideo(String contentId, String courseId, Float processVideo);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -340,8 +340,9 @@ public interface ICourseService {
|
||||
* */
|
||||
List<Course> mobiledelList(Integer num,CourseQueryDto courseQueryDto);
|
||||
|
||||
/**
|
||||
* 获取课程封面
|
||||
* */
|
||||
Map<String, String> getCourseCoverUrl(String courseIds);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -53,17 +53,13 @@ public class CourseContentServiceImpl implements ICourseContentService {
|
||||
CourseAssess assess=dto.getAssess();
|
||||
CourseExam exam=dto.getExam();
|
||||
CourseHomeWork homework=dto.getHomework();
|
||||
|
||||
if(StringUtils.isBlank(cc.getId())) {
|
||||
//新增的情况
|
||||
cc.setDeleted(false);
|
||||
if (cc.getDuration()==null){
|
||||
if(cc.getDuration()==null) {
|
||||
cc.setDuration(0);
|
||||
}
|
||||
if(exam!=null) {
|
||||
if (exam.getTestDuration()!=null) {
|
||||
cc.setDuration(exam.getTestDuration() * 60);
|
||||
}
|
||||
}
|
||||
//如果是没有目录的,并具是课程内容
|
||||
if(dto.getType()!=null && dto.getType()==10) {
|
||||
if(cc.getSortIndex()==1) {
|
||||
@@ -73,11 +69,6 @@ public class CourseContentServiceImpl implements ICourseContentService {
|
||||
}
|
||||
ccDao.save(cc);
|
||||
}else {
|
||||
if(exam!=null) {
|
||||
if (exam.getTestDuration()!=null) {
|
||||
cc.setDuration(exam.getTestDuration() * 60);
|
||||
}
|
||||
}
|
||||
ccDao.update(cc);
|
||||
cc.setSysVersion(ccDao.getVersion(cc.getId()));
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ public class CourseServiceImpl implements ICourseService {
|
||||
String sql = "SELECT DISTINCT\n" +
|
||||
"rt.course_id\n" +
|
||||
"FROM\n" +
|
||||
"boe.student s INNER JOIN boe.router_task rt on s.pid=rt.router_id inner join boe_course c on c.id=rt.course_id\n" +
|
||||
"boe_new.student s INNER JOIN boe_new.router_task rt on s.pid=rt.router_id inner join boe_course c on c.id=rt.course_id\n" +
|
||||
"\n" +
|
||||
"WHERE\n" +
|
||||
"\n" +
|
||||
@@ -504,7 +504,7 @@ public class CourseServiceImpl implements ICourseService {
|
||||
String sql = "SELECT DISTINCT\n" +
|
||||
"pt.course_id\n" +
|
||||
"FROM\n" +
|
||||
"boe.student s INNER JOIN boe.project_task pt on s.pid=pt.project_id inner join boe_course c on c.id=pt.course_id\n" +
|
||||
"boe_new.student s INNER JOIN boe_new.project_task pt on s.pid=pt.project_id inner join boe_course c on c.id=pt.course_id\n" +
|
||||
"\n" +
|
||||
"WHERE\n" +
|
||||
"\n" +
|
||||
@@ -561,8 +561,8 @@ public class CourseServiceImpl implements ICourseService {
|
||||
String sql = "SELECT DISTINCT\n" +
|
||||
"\tc.id \n" +
|
||||
"FROM\n" +
|
||||
"\tboe.student s\n" +
|
||||
"\tINNER JOIN boe.grow_task gt ON s.pid = gt.grow_id\n" +
|
||||
"\tboe_new.student s\n" +
|
||||
"\tINNER JOIN boe_new.grow_task gt ON s.pid = gt.grow_id\n" +
|
||||
"\tINNER JOIN boe_course c ON gt.course_id = c.id \n" +
|
||||
"WHERE\n" +
|
||||
"\ts.type = 14 \n" +
|
||||
@@ -1979,16 +1979,5 @@ public class CourseServiceImpl implements ICourseService {
|
||||
return courseDao.findListByHql("Select new Course(id,studys,score) from Course where id in(?1)", ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getCourseCoverUrl(String courseIds) {
|
||||
List<String> courseIdList = Arrays.asList(courseIds.split(","));
|
||||
List<Course> courseList = courseDao.findList(FieldFilters.in("id", courseIdList));
|
||||
Map<String, String> coverUrlMap = courseList.stream()
|
||||
.filter(course -> StringUtils.isNotBlank(course.getCoverImg()))
|
||||
.collect(Collectors.toMap(Course::getId, Course::getCoverImg));
|
||||
|
||||
return coverUrlMap;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.xboe.module.exam.api;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
@@ -15,12 +14,15 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xboe.module.exam.dto.SaveExamScoreDto;
|
||||
import com.xboe.module.exam.entity.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
@@ -39,6 +41,9 @@ import com.xboe.core.cache.IXaskCache;
|
||||
import com.xboe.core.cache.XaskCacheProvider;
|
||||
import com.xboe.core.exception.XaskException;
|
||||
import com.xboe.module.exam.dto.AloneExamExportDto;
|
||||
import com.xboe.module.exam.entity.AloneExam;
|
||||
import com.xboe.module.exam.entity.AloneExamAnswer;
|
||||
import com.xboe.module.exam.entity.ExamTest;
|
||||
import com.xboe.module.exam.service.IAloneExamService;
|
||||
import com.xboe.module.exam.service.IExamPaperService;
|
||||
import com.xboe.module.exam.service.IExamTestService;
|
||||
@@ -548,7 +553,6 @@ public class AloneExamApi extends ApiBaseController {
|
||||
//转化成百分数
|
||||
//answer.setScore(this.calculateScore(detail));
|
||||
service.submit(answer,scoreType);
|
||||
service.syncExamScoreToCourseSuite(answer, request);
|
||||
return success(map);
|
||||
} catch (Exception e) {
|
||||
log.error("提交答卷错误", e);
|
||||
@@ -703,19 +707,4 @@ public class AloneExamApi extends ApiBaseController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param request
|
||||
* @param saveExamScoreDtoList
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
@PostMapping("/examScoreBatchAdd")
|
||||
public JsonResponse examScoreBatchAdd(HttpServletRequest request, @RequestBody List<SaveExamScoreDto> saveExamScoreDtoList){
|
||||
service.examScoreBatchAdd(request, saveExamScoreDtoList);
|
||||
return success("导入成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public class ExamQuestionApi extends ApiBaseController {
|
||||
//从第二行开始获取数据
|
||||
List<ExamQuestion> examQuestions1 = new ArrayList<>();
|
||||
QuestionDto questionDto = new QuestionDto();
|
||||
if(sheetAt.getRow(1).getCell(1).getStringCellValue().equals("标题(*)")){
|
||||
if(sheetAt.getRow(1).getCell(0).getStringCellValue().equals("标题(*)")){
|
||||
row = sheetAt.getRow(1);
|
||||
for (int i = 2;i<sheetAt.getPhysicalNumberOfRows();i++) {
|
||||
//获取每一行
|
||||
|
||||
@@ -3,12 +3,14 @@ package com.xboe.module.exam.api;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.xboe.api.ThirdApi;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.hibernate.exception.ConstraintViolationException;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.common.Pagination;
|
||||
@@ -21,8 +23,6 @@ import com.xboe.module.exam.service.IExamTestService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考试
|
||||
* */
|
||||
@@ -33,10 +33,8 @@ public class ExamTestApi extends ApiBaseController {
|
||||
|
||||
@Resource
|
||||
private IExamTestService examTestService;
|
||||
|
||||
@Resource
|
||||
private ThirdApi thirdApi;
|
||||
|
||||
ThirdApi thirdApi;
|
||||
/**
|
||||
*查询考试,分页,搜索,资源归属,状态
|
||||
**/
|
||||
@@ -135,16 +133,10 @@ public class ExamTestApi extends ApiBaseController {
|
||||
* */
|
||||
@GetMapping("/delete")
|
||||
@AutoLog(module = "考试",action = "删除考试",info = "删除考试")
|
||||
public JsonResponse<Boolean> delete(String id, HttpServletRequest request){
|
||||
public JsonResponse<Boolean> delete(String id){
|
||||
if(StringUtil.isBlank(id)){
|
||||
return badRequest("缺少必要参数");
|
||||
}
|
||||
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
if (StringUtil.isEmpty(token)) {
|
||||
token = request.getHeader("token");
|
||||
}
|
||||
|
||||
try {
|
||||
examTestService.delete(id);
|
||||
return success(true);
|
||||
@@ -191,21 +183,4 @@ public class ExamTestApi extends ApiBaseController {
|
||||
return error("上下级失败",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 引用关系移除
|
||||
* */
|
||||
@PostMapping("/removeRel")
|
||||
public JsonResponse<Boolean> removeRel(@RequestParam List<String> ids){
|
||||
if(CollectionUtil.isEmpty(ids)){
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
try {
|
||||
examTestService.removeRel(ids);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("引用关系移除异常",e);
|
||||
return error("引用关系移除异常",e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
package com.xboe.module.exam.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 单独的考虑答卷信息
|
||||
*/
|
||||
@Data
|
||||
public class SaveExamScoreDto {
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 考试id
|
||||
*/
|
||||
private String testId;
|
||||
|
||||
// /**
|
||||
// * 考试名称
|
||||
// */
|
||||
// private String testName;
|
||||
|
||||
// /**
|
||||
// * 考试时长 分钟
|
||||
// */
|
||||
// private Integer testDuration;
|
||||
|
||||
/**
|
||||
* 试题排列 1试题乱序,2选项乱序,3全部乱序
|
||||
*/
|
||||
private Integer arrange;
|
||||
|
||||
// /**
|
||||
// * 及格线
|
||||
// */
|
||||
// private Integer passLine;
|
||||
|
||||
/**
|
||||
* 账户的代码,用于区别于同姓名的用户
|
||||
*/
|
||||
private String workNum;
|
||||
|
||||
|
||||
/**
|
||||
* 独立考试任务的id
|
||||
*/
|
||||
private String aloneId;
|
||||
|
||||
/**
|
||||
* 试卷总分
|
||||
*/
|
||||
@Column(name = "total_score")
|
||||
private Float totalScore;
|
||||
|
||||
|
||||
// /**
|
||||
// * 答卷内容
|
||||
// */
|
||||
// @Column(name = "answer_json", columnDefinition = "mediumtext")
|
||||
// private String answerJson;
|
||||
|
||||
// todo by yyk 2024-05-17 14:10:32 确定分数
|
||||
/**
|
||||
* 用户的实际得分
|
||||
*/
|
||||
private Float realScore;
|
||||
|
||||
// /**
|
||||
// * 用时秒
|
||||
// */
|
||||
// private Integer useMinute;
|
||||
|
||||
|
||||
/**
|
||||
* 最终成绩,如果是百分制,用户的实际得分会换算为百分制
|
||||
*/
|
||||
private Float score;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
|
||||
// /**
|
||||
// * 完成状态
|
||||
// */
|
||||
// private Integer status;
|
||||
|
||||
// /**
|
||||
// * 考试次数
|
||||
// */
|
||||
// private Integer times;
|
||||
|
||||
|
||||
// /**
|
||||
// * 记录最后的操作时间
|
||||
// */
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||
// private LocalDateTime lastTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -65,7 +65,6 @@ public class AloneExam extends IdBaseEntity {
|
||||
private String ucode;
|
||||
|
||||
/**关联类型*/
|
||||
/**关联类型 新增关联类型14,代表成长路径图*/
|
||||
@Column(name = "ref_type", length = 30)
|
||||
private String refType;
|
||||
|
||||
|
||||
@@ -178,14 +178,4 @@ public class ExamTest extends BaseEntity {
|
||||
|
||||
@Transient
|
||||
private String paperName;
|
||||
|
||||
/** 关联类型,1、项目 2、学习路径图 3、面授课 14、成长路径图 */
|
||||
@Column(name = "ref_type")
|
||||
private Integer refType;
|
||||
|
||||
@Column(name = "ref_id")
|
||||
private String refId;
|
||||
|
||||
@Column(name = "ref_status")
|
||||
private Integer refStatus;
|
||||
}
|
||||
|
||||
@@ -5,13 +5,11 @@ import java.util.Map;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.module.exam.dto.SaveExamScoreDto;
|
||||
import com.xboe.module.exam.dto.TestUserDto;
|
||||
import com.xboe.module.exam.dto.TestUserQuery;
|
||||
import com.xboe.module.exam.entity.AloneExam;
|
||||
import com.xboe.module.exam.entity.AloneExamAnswer;
|
||||
import com.xboe.module.exam.vo.AloneExamQuery;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 独立考试的处理。此信息无删除操作,更新也只是更新answerJson字段
|
||||
@@ -94,18 +92,10 @@ public interface IAloneExamService {
|
||||
|
||||
/**
|
||||
* 提交考试
|
||||
*
|
||||
* @param aea
|
||||
*/
|
||||
void submit(AloneExamAnswer aea, Integer scoreType);
|
||||
|
||||
/**
|
||||
* 同步考试成绩
|
||||
* @param aea
|
||||
* @param request
|
||||
*/
|
||||
void syncExamScoreToCourseSuite(AloneExamAnswer aea, HttpServletRequest request);
|
||||
|
||||
void submit(AloneExamAnswer aea,Integer scoreType);
|
||||
|
||||
/**
|
||||
* 更新答案
|
||||
* @param id
|
||||
@@ -166,7 +156,5 @@ public interface IAloneExamService {
|
||||
* @throws Exception
|
||||
*/
|
||||
PageList<TestUserDto> findTestUserAnswers(TestUserQuery params) throws Exception;
|
||||
|
||||
void examScoreBatchAdd(HttpServletRequest request, List<SaveExamScoreDto> saveExamScoreDtoList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.xboe.module.exam.service;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.module.exam.entity.ExamTest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IExamTestService {
|
||||
/**
|
||||
* 分页查,状态,搜索,资源归属
|
||||
@@ -53,5 +51,4 @@ public interface IExamTestService {
|
||||
* */
|
||||
void enabled(String id,Boolean enabled);
|
||||
|
||||
void removeRel(List<String> ids);
|
||||
}
|
||||
|
||||
@@ -1,25 +1,15 @@
|
||||
package com.xboe.module.exam.service.impl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.module.exam.dao.ExamTestDao;
|
||||
import com.xboe.module.exam.dto.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
@@ -30,40 +20,31 @@ import com.xboe.core.orm.QueryBuilder;
|
||||
import com.xboe.core.orm.UpdateBuilder;
|
||||
import com.xboe.module.exam.dao.AloneExamAnswerDao;
|
||||
import com.xboe.module.exam.dao.AloneExamDao;
|
||||
import com.xboe.module.exam.dto.TestUserAnswerDto;
|
||||
import com.xboe.module.exam.dto.TestUserDto;
|
||||
import com.xboe.module.exam.dto.TestUserQuery;
|
||||
import com.xboe.module.exam.entity.AloneExam;
|
||||
import com.xboe.module.exam.entity.AloneExamAnswer;
|
||||
import com.xboe.module.exam.entity.ExamTest;
|
||||
import com.xboe.module.exam.service.IAloneExamService;
|
||||
import com.xboe.module.exam.vo.AloneExamQuery;
|
||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||
|
||||
@Service
|
||||
public class AloneExamServiceImpl implements IAloneExamService{
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AloneExamServiceImpl.class);
|
||||
@Resource
|
||||
AloneExamAnswerDao dao;
|
||||
|
||||
@Resource
|
||||
AloneExamDao aeDao;
|
||||
|
||||
@Autowired
|
||||
private ExamTestDao examTestDao;
|
||||
|
||||
@Autowired
|
||||
private ThirdApi thirdApi;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(AloneExamAnswer aea){
|
||||
dao.save(aea);
|
||||
AloneExam ae=aeDao.findOne(FieldFilters.eq("aid", aea.getAid()),FieldFilters.eq("testId", aea.getTestId()));
|
||||
int currentTimes = ae.getTimes() != null ? ae.getTimes() : 0;
|
||||
//更新状态
|
||||
aeDao.update(UpdateBuilder.from(AloneExam.class)
|
||||
.addUpdateField("status", AloneExam.STATUS_NORMAL)
|
||||
.addUpdateField("times", currentTimes+1)
|
||||
.addFilter(FieldFilters.eq("aid", aea.getAid()))
|
||||
.addFilter(FieldFilters.eq("testId", aea.getTestId()))
|
||||
.addFilter(FieldFilters.eq("status",AloneExam.STATUS_NONE))
|
||||
@@ -72,8 +53,8 @@ public class AloneExamServiceImpl implements IAloneExamService{
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void submit(AloneExamAnswer aea, Integer scoreType){
|
||||
@Transactional
|
||||
public void submit(AloneExamAnswer aea,Integer scoreType){
|
||||
//dao.update(aea);
|
||||
aea.setStatus(AloneExamAnswer.STATUS_FINISH);
|
||||
LocalDateTime now=LocalDateTime.now();
|
||||
@@ -121,27 +102,6 @@ public class AloneExamServiceImpl implements IAloneExamService{
|
||||
// }
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void syncExamScoreToCourseSuite(AloneExamAnswer aea, HttpServletRequest request) {
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
token = request.getHeader("token");
|
||||
}
|
||||
|
||||
String finalToken = token;
|
||||
CompletableFuture.supplyAsync(() -> {
|
||||
AloneExam aloneExam = aeDao.findOne(FieldFilters.eq("aid", aea.getAid()), FieldFilters.eq("testId", aea.getTestId()));
|
||||
if (aloneExam.getRefType().equals("14")){
|
||||
thirdApi.syncExamScoreToCourseSuite(aloneExam, finalToken);
|
||||
}
|
||||
return "完成结果";
|
||||
}).exceptionally(ex -> {
|
||||
log.error("异步操作中发生错误: " + ex.getMessage(), ex);
|
||||
return "发生错误";
|
||||
}).thenAccept(result -> {
|
||||
log.info("同步考试成绩到课程项目完成:" + result);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -182,6 +142,9 @@ public class AloneExamServiceImpl implements IAloneExamService{
|
||||
if(StringUtils.isNotBlank(aea.getTestId())) {
|
||||
query.addFilter(FieldFilters.eq("testId",aea.getTestId()));
|
||||
}
|
||||
if(StringUtils.isNotBlank(aea.getTestName())) {
|
||||
query.addFilter(FieldFilters.eq("testName",aea.getTestName()));
|
||||
}
|
||||
if(StringUtils.isNotBlank(aea.getAid())) {
|
||||
query.addFilter(FieldFilters.eq("aid",aea.getAid()));
|
||||
}
|
||||
@@ -464,86 +427,4 @@ public class AloneExamServiceImpl implements IAloneExamService{
|
||||
rs.setPageSize(params.getPageSize());
|
||||
return rs;
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private PlatformTransactionManager transactionManager;
|
||||
|
||||
|
||||
@Override
|
||||
public void examScoreBatchAdd(HttpServletRequest request, List<SaveExamScoreDto> saveExamScoreDtoList) {
|
||||
List<String> workNumList = saveExamScoreDtoList.stream().map(SaveExamScoreDto::getWorkNum).collect(Collectors.toList());
|
||||
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
token = request.getHeader("token");
|
||||
}
|
||||
HashMap<String, String> userIdAndWorkNumMap = thirdApi.getUserIdByWorkNum(token, workNumList);
|
||||
|
||||
saveExamScoreDtoList.forEach(examScoreDto -> {
|
||||
TransactionStatus status = null; // 事务状态
|
||||
|
||||
try {
|
||||
// 获取事务定义
|
||||
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
|
||||
// 设置事务隔离级别
|
||||
def.setIsolationLevel(DefaultTransactionDefinition.ISOLATION_READ_COMMITTED);
|
||||
// 设置事务传播行为
|
||||
def.setPropagationBehavior(DefaultTransactionDefinition.PROPAGATION_REQUIRED);
|
||||
// 获取事务状态
|
||||
status = transactionManager.getTransaction(def);
|
||||
|
||||
AloneExamAnswer aloneExamAnswer = new AloneExamAnswer();
|
||||
BeanUtils.copyProperties(examScoreDto, aloneExamAnswer);
|
||||
|
||||
String userId = userIdAndWorkNumMap.get(examScoreDto.getWorkNum());
|
||||
aloneExamAnswer.setAid(userId);
|
||||
aloneExamAnswer.setName(examScoreDto.getUserName());
|
||||
aloneExamAnswer.setUcode(examScoreDto.getWorkNum());
|
||||
aloneExamAnswer.setStatus(AloneExamAnswer.STATUS_FINISH);
|
||||
// aloneExamAnswer.setUseSecond(examScoreDto.getUseMinute()*60);
|
||||
|
||||
ExamTest examTest = examTestDao.get(examScoreDto.getTestId());
|
||||
aloneExamAnswer.setPassLine(examTest.getPassLine());
|
||||
aloneExamAnswer.setArrange(examTest.getArrange());
|
||||
aloneExamAnswer.setTestDuration(examTest.getTestDuration());
|
||||
|
||||
// 获取考试任务ID
|
||||
AloneExam aloneExam=aeDao.findOne(FieldFilters.eq("aid", userId),FieldFilters.eq("testId", examScoreDto.getTestId()));
|
||||
aloneExamAnswer.setAloneId(aloneExam.getId());
|
||||
// 添加答卷
|
||||
dao.save(aloneExamAnswer);
|
||||
|
||||
// 更新状态,状态是未完成的,这里会有问题
|
||||
int currentTimes = aloneExam.getTimes() != null ? aloneExam.getTimes() : 0;
|
||||
if(examTest.getScoringType()!=null && examTest.getScoringType()==2) {
|
||||
//最后一次的分数为准
|
||||
aeDao.update(UpdateBuilder.from(AloneExam.class)
|
||||
.addUpdateField("status", AloneExam.STATUS_FINISH)
|
||||
.addUpdateField("score", examScoreDto.getScore())
|
||||
.addUpdateField("times", currentTimes+1)
|
||||
.addFilter(FieldFilters.eq("aid", userId))
|
||||
.addFilter(FieldFilters.eq("testId", examScoreDto.getTestId()))
|
||||
.builder());
|
||||
} else {
|
||||
if (aloneExam.getStatus() == AloneExam.STATUS_FINISH) {
|
||||
if (aloneExam.getScore() < examScoreDto.getScore()) {
|
||||
aeDao.updateMultiFieldById(aloneExam.getId(), UpdateBuilder.create("score", examScoreDto.getScore()), UpdateBuilder.create("times", currentTimes+1));
|
||||
}
|
||||
} else {
|
||||
aeDao.updateMultiFieldById(aloneExam.getId(), UpdateBuilder.create("status", AloneExam.STATUS_FINISH), UpdateBuilder.create("score", examScoreDto.getScore()), UpdateBuilder.create("times", currentTimes+1));
|
||||
}
|
||||
}
|
||||
|
||||
// 提交事务
|
||||
transactionManager.commit(status);
|
||||
} catch (Exception e) {
|
||||
// 如果发生异常,回滚事务
|
||||
if (status != null && !status.isCompleted()) {
|
||||
transactionManager.rollback(status);
|
||||
}
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,10 +122,4 @@ public class ExamTestServiceImpl implements IExamTestService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRel(List<String> ids) {
|
||||
String idsStr = String.join(",", ids);
|
||||
examTestDao.sqlUpdate("update boe_exam_test set ref_status=0 where id in (?1)",idsStr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.xboe.api.ThirdApi;
|
||||
import com.xboe.constants.CacheName;
|
||||
import com.xboe.module.course.vo.TeacherVo;
|
||||
import com.xboe.module.usergroup.service.IUserGroupService;
|
||||
import com.xboe.school.study.dao.StudyCourseDao;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
@@ -92,6 +94,7 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
|
||||
@Autowired
|
||||
StringRedisTemplate redisTemplate;
|
||||
|
||||
/**
|
||||
* 用于查询课程的学习记录
|
||||
* @param pager
|
||||
@@ -317,6 +320,7 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
token = request.getHeader("token");
|
||||
}
|
||||
//检查是否已存在
|
||||
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
|
||||
if(item!=null) {
|
||||
String studyKey = CacheName.NAME_AUTH + ":" + CacheName.STUDY_KEY + item.getCourseId()+":"+cuser.getAccountId()+":"+item.getContentId();
|
||||
|
||||
@@ -93,8 +93,8 @@ public class StudyExamApi extends ApiBaseController{
|
||||
exam.setEndTime(exam.getLastTime());
|
||||
}
|
||||
log.info( exam.getStudyId() + "_" + exam.getContentId() + ",------------试卷开始提交 " + LocalDateTime.now());
|
||||
sexamService.save(exam,token);
|
||||
//log.info( exam.getStudyId() + "_" + exam.getContentId() + ",------------试卷保存完毕 ,msg = " + msg + " , " + LocalDateTime.now());
|
||||
String msg = sexamService.save(exam,token);
|
||||
log.info( exam.getStudyId() + "_" + exam.getContentId() + ",------------试卷保存完毕 ,msg = " + msg + " , " + LocalDateTime.now());
|
||||
exam.setAnswerJson("");
|
||||
exam.setPaperJson("");
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ public class StudyHomeWorkApi extends ApiBaseController{
|
||||
return error("查询课程作业失败",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/list-study")
|
||||
public JsonResponse<List<StudyHomeWork>> listByStudyIdContentId(String studyId,String contentId){
|
||||
if(StringUtils.isBlank(studyId)) {
|
||||
|
||||
@@ -117,7 +117,7 @@ public class StudyExam extends IdEntity {
|
||||
/*
|
||||
* 开始时间
|
||||
* */
|
||||
@JsonFormat(pattern = "yyyy--MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Column(name = "start_time")
|
||||
private LocalDateTime startTime;
|
||||
/*
|
||||
|
||||
@@ -10,7 +10,7 @@ public interface IStudyExamService {
|
||||
* 保存考试信息
|
||||
* @param exam
|
||||
*/
|
||||
void save(StudyExam exam,String token);
|
||||
String save(StudyExam exam,String token);
|
||||
|
||||
|
||||
StudyExam get(String id);
|
||||
|
||||
@@ -99,5 +99,4 @@ public interface IStudyService {
|
||||
|
||||
List<StudyCourseItem> getList(String courseId, String contentId, String name, Integer status);
|
||||
|
||||
List<User> getUserNo(List<String> userIds);
|
||||
}
|
||||
|
||||
@@ -6,9 +6,6 @@ import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.school.study.entity.StudyCourse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -21,7 +18,6 @@ import com.xboe.school.study.entity.StudyAssess;
|
||||
import com.xboe.school.study.entity.StudyCourseItem;
|
||||
import com.xboe.school.study.service.IStudyAssessService;
|
||||
|
||||
|
||||
@Service
|
||||
public class StudyAssessServiceImpl implements IStudyAssessService{
|
||||
|
||||
@@ -37,7 +33,6 @@ public class StudyAssessServiceImpl implements IStudyAssessService{
|
||||
@Autowired
|
||||
StudyCourseItemDao scItemDao;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(StudyAssess assess,String token) {
|
||||
@@ -72,7 +67,7 @@ public class StudyAssessServiceImpl implements IStudyAssessService{
|
||||
assess.setStudyItemId(obj.toString());
|
||||
dao.update(assess);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,24 +1,9 @@
|
||||
package com.xboe.school.study.service.impl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.core.orm.QueryBuilder;
|
||||
import com.xboe.school.study.entity.StudyCourse;
|
||||
import com.xboe.system.user.entity.Message;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.QueryBuilder;
|
||||
import com.xboe.core.orm.UpdateBuilder;
|
||||
import com.xboe.module.course.dao.CourseContentDao;
|
||||
import com.xboe.module.course.dao.CourseExamDao;
|
||||
import com.xboe.module.course.entity.CourseExam;
|
||||
@@ -28,6 +13,17 @@ import com.xboe.school.study.dao.StudyExamDao;
|
||||
import com.xboe.school.study.entity.StudyCourseItem;
|
||||
import com.xboe.school.study.entity.StudyExam;
|
||||
import com.xboe.school.study.service.IStudyExamService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -54,7 +50,7 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(StudyExam exam,String token) {
|
||||
public String save(StudyExam exam,String token) {
|
||||
String key = exam.getStudyId() + "_" + exam.getContentId();
|
||||
// //判断是否存在redis
|
||||
// if(StringUtils.isNotEmpty(redisTemplate.opsForValue().get(key))){
|
||||
@@ -73,29 +69,31 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
||||
exam.setPassLine(0);
|
||||
}
|
||||
|
||||
int prog=exam.getScore().intValue()>=exam.getPassLine()?100:exam.getScore().intValue();
|
||||
//完成处理,判断是否已存在
|
||||
Object obj=scItemDao.findField("id", FieldFilters.eq("studyId", exam.getStudyId()), FieldFilters.eq("contentId", exam.getContentId()));
|
||||
//获取本次考试提交,学习状态与学习进度
|
||||
int status=exam.getScore()>=exam.getPassLine()?StudyCourseItem.STATUS_FINISH:StudyCourseItem.STATUS_STUDYING;
|
||||
int progress = exam.getScore().intValue() >= exam.getPassLine() ? 100 : 0;
|
||||
//计算时长
|
||||
LocalDateTime ldt=LocalDateTime.now();
|
||||
|
||||
if(obj==null) {
|
||||
StudyCourseItem sci=new StudyCourseItem();
|
||||
LocalDateTime ldt=LocalDateTime.now();
|
||||
sci.setStudyId(exam.getStudyId());
|
||||
sci.setContentId(exam.getContentId());
|
||||
sci.setContentName("考试");
|
||||
sci.setCourseId(exam.getCourseId());
|
||||
//sci.setCsectionId(homework.getCsectionId());
|
||||
sci.setProgress(prog);//直接设置为学习完成
|
||||
sci.setProgress(progress);//直接设置为学习完成
|
||||
sci.setStatus(status);//状态直接更新为已完成
|
||||
sci.setStartTime(ldt);
|
||||
sci.setStartTime(exam.getStartTime());
|
||||
sci.setAid(exam.getStudentId());
|
||||
sci.setAname(exam.getStudentName());
|
||||
sci.setFinishTime(LocalDateTime.now());
|
||||
sci.setFinishTime(ldt);
|
||||
sci.setLastStudyTime(0);//此项用户记录视频内容当前学习的时间点
|
||||
sci.setLastTime(ldt);
|
||||
if(cexam.getScoringType()==CourseExam.SCORINGTYPE_LAST) {
|
||||
sci.setScore(exam.getScore());
|
||||
}
|
||||
sci.setScore(exam.getScore());
|
||||
sci.setStudyDuration(exam.getTestDuration());
|
||||
scItemDao.save(sci);
|
||||
exam.setStudyItemId(sci.getId());
|
||||
dao.save(exam);
|
||||
@@ -108,40 +106,40 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
||||
|
||||
}else {
|
||||
exam.setStudyItemId(obj.toString());//此项就是学习条目的id
|
||||
Float maxScore = (Float) dao.findField("max(score)", FieldFilters.eq("contentId", exam.getContentId()), FieldFilters.eq("courseId", exam.getCourseId()), FieldFilters.eq("studyId", exam.getStudyId()));
|
||||
dao.save(exam);
|
||||
if(cexam.getScoringType()==CourseExam.SCORINGTYPE_LAST){
|
||||
scItemDao.updateFieldById(exam.getStudyItemId(), "score",exam.getScore());
|
||||
scItemDao.updateFieldById(exam.getStudyItemId(), "progress",prog);
|
||||
if(exam.getScore()>=exam.getPassLine()){
|
||||
scItemDao.updateFieldById(exam.getStudyId(), "progress",100);
|
||||
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
|
||||
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
|
||||
scItemDao.updateFieldById(exam.getStudyId(), "score",exam.getScore());
|
||||
//scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f);
|
||||
//最新考试分值
|
||||
if (cexam.getScoringType() == CourseExam.SCORINGTYPE_LAST) {
|
||||
scItemDao.updateMultiFieldById(exam.getStudyItemId(),
|
||||
UpdateBuilder.create("startTime", exam.getStartTime()),
|
||||
UpdateBuilder.create("finishTime", ldt),
|
||||
UpdateBuilder.create("score", exam.getScore()),
|
||||
UpdateBuilder.create("progress", progress),
|
||||
UpdateBuilder.create("status", status),
|
||||
UpdateBuilder.create("studyDuration", exam.getTestDuration())
|
||||
);
|
||||
}
|
||||
|
||||
//最高分
|
||||
if (cexam.getScoringType() == CourseExam.SCORINGTYPE_MAX) {
|
||||
if (exam.getScore() > maxScore) {
|
||||
scItemDao.updateMultiFieldById(exam.getStudyItemId(),
|
||||
UpdateBuilder.create("startTime", exam.getStartTime()),
|
||||
UpdateBuilder.create("finishTime", LocalDateTime.now()),
|
||||
UpdateBuilder.create("score", exam.getScore()),
|
||||
UpdateBuilder.create("progress", progress),
|
||||
UpdateBuilder.create("status", status)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
//1最高一次,用于最高一次的计算
|
||||
if(cexam.getScoringType()==CourseExam.SCORINGTYPE_MAX) {
|
||||
Float f=(Float)dao.findField("max(score)", FieldFilters.eq("contentId", exam.getContentId()), FieldFilters.eq("courseId", exam.getCourseId()), FieldFilters.eq("studyId", exam.getStudyId()));
|
||||
scItemDao.updateFieldById(exam.getStudyItemId(), "score", f);
|
||||
scItemDao.updateFieldById(exam.getStudyItemId(), "status", f>=exam.getPassLine()?StudyCourseItem.STATUS_FINISH:StudyCourseItem.STATUS_STUDYING);
|
||||
scItemDao.updateFieldById(exam.getStudyItemId(), "progress",f>=exam.getPassLine()?100:f.intValue());
|
||||
|
||||
if(f>=exam.getPassLine()){
|
||||
scItemDao.updateFieldById(exam.getStudyId(), "progress",100);
|
||||
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
|
||||
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
|
||||
scItemDao.updateFieldById(exam.getStudyId(), "score",exam.getScore());
|
||||
//scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f);
|
||||
}
|
||||
|
||||
}
|
||||
int totalContent = courseContentDao.getCount(exam.getCourseId());
|
||||
scDao.finishCheck(exam.getStudyId(),exam.getCourseId(),totalContent,token);
|
||||
scDao.updateFieldById(exam.getStudyId(), "last_score",exam.getScore());
|
||||
//执行完毕 清除redis记录
|
||||
// redisTemplate.delete(key);
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -64,6 +64,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
|
||||
int totalContent=courseContentDao.count(FieldFilters.eq("courseId", homework.getCourseId()),FieldFilters.eq("deleted",false));
|
||||
scDao.finishCheck(homework.getStudyId(),homework.getCourseId(),totalContent,token);
|
||||
}else {
|
||||
scItemDao.updateFieldById(obj.toString(), "finishTime", LocalDateTime.now());
|
||||
//只是保留一条作业记录,不再保存多条记录了
|
||||
//dao.save(homework);
|
||||
//设置id。然后进行悠
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.xboe.school.study.service.impl;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
@@ -98,8 +97,6 @@ public class StudyServiceImpl implements IStudyService{
|
||||
//sci.setProgress(100);//直接设置为学习完成
|
||||
sci.setLastTime(ldt);
|
||||
scItemDao.saveOrUpdate(sci);
|
||||
|
||||
dto.setStudyItemId(sci.getId());
|
||||
if (sci.getId() != null){
|
||||
dto.setStudyItemId(sci.getId());
|
||||
}else {
|
||||
@@ -186,17 +183,15 @@ public class StudyServiceImpl implements IStudyService{
|
||||
query.addFilter(FieldFilters.eq("courseId",courseId));
|
||||
}
|
||||
if(StringUtils.isNotBlank(name)) {
|
||||
query.addFilter(FieldFilters.like("aname", name));
|
||||
query.addFilter(FieldFilters.eq("aname", name));
|
||||
}
|
||||
int pageIndex2 = (pageIndex-1)*10;
|
||||
if(status!=null) {
|
||||
if(status==3) {
|
||||
query.addFilter(FieldFilters.eq("status", 2));
|
||||
query.addFilter(FieldFilters.like("aname", name));
|
||||
return scItemDao.findPage(query.builder());
|
||||
}else if(status==2){
|
||||
query.addFilter(FieldFilters.eq("status",9));
|
||||
query.addFilter(FieldFilters.like("aname", name));
|
||||
return scItemDao.findPage(query.builder());
|
||||
}else if (status == 1) {
|
||||
String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " +
|
||||
@@ -299,16 +294,11 @@ public class StudyServiceImpl implements IStudyService{
|
||||
|
||||
}
|
||||
if(StringUtils.isNotBlank(name)) {
|
||||
query.addFilter(FieldFilters.eq("aname", name));
|
||||
query.addFilter(FieldFilters.like("aname", name));
|
||||
}
|
||||
return scItemDao.findList(query.builder());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> getUserNo(List<String> userIds) {
|
||||
return userDao.findList(FieldFilters.in("id", userIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateProcess(String studyContentId,String studyId, String courseId,Integer total, Integer progress,String token) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# cloud nacos config
|
||||
spring.cloud.nacos.discovery.server-addr=10.251.129.51:8848
|
||||
spring.cloud.nacos.discovery.server-addr=10.251.113.100:8848
|
||||
|
||||
## redis
|
||||
spring.redis.database=1
|
||||
spring.redis.host=10.251.129.122
|
||||
spring.redis.host=10.251.88.213
|
||||
spring.redis.password=qwert!W588
|
||||
spring.redis.port=6379
|
||||
|
||||
@@ -16,7 +16,7 @@ spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
#spring.datasource.url=jdbc:mysql://10.251.129.129:8066/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
#spring.datasource.username=admin
|
||||
#spring.datasource.password=ocYMC>!{8G
|
||||
spring.datasource.url=jdbc:mysql://10.251.129.126:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.url=jdbc:mysql://10.251.88.216:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=admin
|
||||
spring.datasource.password=boeRds01
|
||||
|
||||
@@ -53,6 +53,7 @@ xboe.externalinterface.url.system=http://127.0.0.1:9091
|
||||
## ?????????????
|
||||
xboe.old.base.url=https://u.boe.com
|
||||
|
||||
|
||||
## ???????api??
|
||||
xboe.stat.base.url=http://127.0.0.1:9080
|
||||
xboe.server.userbasic.url=https://u.boe.com/userbasic
|
||||
@@ -63,7 +64,7 @@ jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
|
||||
# elasticsearch config
|
||||
xboe.elasticsearch.server.ip=10.251.129.21
|
||||
xboe.elasticsearch.server.ip=10.251.88.218
|
||||
xboe.elasticsearch.server.port=9200
|
||||
xboe.elasticsearch.server.user=
|
||||
xboe.elasticsearch.server.password=
|
||||
|
||||
@@ -56,7 +56,7 @@ logging.config=classpath:log/logback-@profileActive@.xml
|
||||
# config.id.generator.datacenter.num=1
|
||||
|
||||
#boe.domain=https://pretest.zcwytd.com
|
||||
boe.domain=https://u.boe.com
|
||||
boe.domain=http://127.0.0.1
|
||||
#boe.domain=http://localhost:30001
|
||||
orgTree.orgTreeList=${boe.domain}/userbasic/org/list
|
||||
# ????id????????????
|
||||
@@ -72,10 +72,7 @@ infrasApi.dict=${boe.domain}/infrasApi/dict/list
|
||||
#获取非报名课id
|
||||
manageApi.stu.offcourse=${boe.domain}/manageApi/stu/offcourse/getOffCourseId
|
||||
manageApi.editExam=${boe.domain}/manageApi/admin/project/editExam
|
||||
manageApi.getExamSycn=${boe.domain}/manageApi/stu/grow/getExamSync
|
||||
#获取离职教师id
|
||||
userBasic.getTeacherIds=${boe.domain}/userbasic/user/getTeacherInfo
|
||||
userBasic.getUserIdByWorkNum=${boe.domain}/userbasic/user/getUserIdByWorkNum
|
||||
coursesuilt.getStudyStatus=${boe.domain}/manageApi/stu/project/completeStatus
|
||||
coursesuilt.checkBanding=${boe.domain}/manageApi/stu/task/exam/checkBanding
|
||||
coursesuilt.syncExamScoreToCourseSuite=${boe.domain}/manageApi/stu/task/exam/syncExamScoreToCourseSuite
|
||||
userBasic.getUserBasicInfo=${boe.domain}/userbasic/user/getUserBasicInfo
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## redis
|
||||
spring.redis.database=3
|
||||
spring.redis.host=10.251.129.122
|
||||
spring.redis.host=10.251.88.213
|
||||
spring.redis.password=qwert!W588
|
||||
spring.redis.port=6379
|
||||
|
||||
@@ -14,7 +14,7 @@ spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
# 当前数据库 basic 对应的数据库
|
||||
spring.datasource.db1.driverClassName=com.mysql.jdbc.Driver
|
||||
spring.datasource.db1.jdbc-url=jdbc:mysql://10.251.129.126:3306/boe_basic?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db1.jdbc-url=jdbc:mysql://10.251.88.216:3306/boe_basic?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db1.username=admin
|
||||
spring.datasource.db1.password=boeRds01
|
||||
|
||||
@@ -23,7 +23,7 @@ spring.datasource.db1.password=boeRds01
|
||||
# 主数据库 all 对应的数据库
|
||||
spring.datasource.db2.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.db2.jdbc-url=jdbc:mysql://10.251.129.126:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db2.jdbc-url=jdbc:mysql://10.251.88.216:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db2.username=admin
|
||||
spring.datasource.db2.password=boeRds01
|
||||
|
||||
@@ -48,6 +48,7 @@ xboe.upload.file.http_path=https://u.boe.com/upload
|
||||
## 新系统的内部地址,可以不通过nginx调用
|
||||
xboe.inner.data.sync.baseurl=http://127.0.0.1:9090
|
||||
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.host=10.251.88.214
|
||||
spring.redis.password=qwert!W588
|
||||
spring.redis.port=6379
|
||||
|
||||
## 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==)
|
||||
spring.datasource.url=jdbc:mysql:/10.251.88.216:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=admin
|
||||
spring.datasource.password=boeRds01
|
||||
|
||||
logging.level.org.hibernate.SQL=ERROR
|
||||
# logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.host=10.251.88.214
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
@@ -8,7 +8,7 @@ spring.redis.port=6379
|
||||
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.url=jdbc:mysql://10.251.88.216:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.host=10.251.88.214
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
# cloud nacos config
|
||||
spring.cloud.nacos.discovery.server-addr=10.251.181.11:8848
|
||||
spring.cloud.nacos.discovery.server-addr=10.251.113.100:8848
|
||||
|
||||
## 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.url=jdbc:mysql://10.251.88.216:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
@@ -33,7 +33,6 @@ xboe.upload.file.http_path=http://localhost:9090/cdn/upload
|
||||
|
||||
## 外部接口调用地址 旧系统机构及用户数据接口
|
||||
xboe.externalinterface.url.system=http://localhost:9091
|
||||
|
||||
#加密盐
|
||||
#jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
|
||||
@@ -7,7 +7,7 @@ spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
# 当前数据库 basic 对应的数据库
|
||||
spring.datasource.url=jdbc:mysql://10.251.129.126:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.url=jdbc:mysql://10.251.88.216:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=admin
|
||||
spring.datasource.password=boeRds01
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
# 当前数据库 basic 对应的数据库
|
||||
spring.datasource.url=jdbc:mysql://10.251.129.126:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.url=jdbc:mysql://10.251.88.216:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=admin
|
||||
spring.datasource.password=boeRds01
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
# datasource config
|
||||
# basic数据库
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
@@ -9,7 +8,7 @@ spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
# 原数据库 old 对应的数据库
|
||||
spring.datasource.db1.driverClassName=com.mysql.jdbc.Driver
|
||||
spring.datasource.db1.jdbc-url=jdbc:mysql://10.251.129.126:3306/elearninglms?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db1.jdbc-url=jdbc:mysql://10.251.88.216:3306/elearninglms?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db1.username=admin
|
||||
spring.datasource.db1.password=boeRds01
|
||||
|
||||
@@ -18,7 +17,7 @@ spring.datasource.db1.password=boeRds01
|
||||
# 新主数据库 all 对应的数据库
|
||||
spring.datasource.db2.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.db2.jdbc-url=jdbc:mysql://10.251.129.126:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db2.jdbc-url=jdbc:mysql://10.251.88.216:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.db2.username=admin
|
||||
spring.datasource.db2.password=boeRds01
|
||||
|
||||
|
||||
Reference in New Issue
Block a user