@t2652009480 2 months ago
commit d2b64c8244

@ -13,24 +13,7 @@
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>tz_digital_marketing</name> <name>tz_digital_marketing</name>
<description>数字贸易</description> <description>数字贸易</description>
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<id>bce</id>
<organization>Baidu Cloud</organization>
<organizationUrl>https://cloud.baidu.com/</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/baidubce/bce-qianfan-sdk.git</connection>
<developerConnection>scm:git:ssh://github.com:baidubce/bce-qianfan-sdk.git</developerConnection>
<url>https://github.com/baidubce/bce-qianfan-sdk/tree/master</url>
</scm>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<jjwt.version>0.10.8</jjwt.version> <jjwt.version>0.10.8</jjwt.version>
@ -38,16 +21,6 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.15-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.15-beta2</version>
</dependency>
<dependency> <dependency>
@ -58,94 +31,65 @@
<!-- Commons Math 来计算各种统计量--> <!-- Commons Math 来计算各种统计量-->
<dependency> <!-- <dependency>-->
<groupId>org.apache.commons</groupId> <!-- <groupId>org.apache.commons</groupId>-->
<artifactId>commons-math3</artifactId> <!-- <artifactId>commons-math3</artifactId>-->
<version>3.6.1</version> <!-- <version>3.6.1</version>-->
</dependency> <!-- </dependency>-->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.12.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/ws.schild/jave-all-deps -->
<dependency> <dependency>
<groupId>org.bytedeco</groupId> <groupId>ws.schild</groupId>
<artifactId>javacv-platform</artifactId> <artifactId>jave-all-deps</artifactId>
<version>1.5.5</version> <!-- 请使用最新版本 --> <version>2.5.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId> <artifactId>spring-boot-starter-validation</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.3</version>
</dependency>
<!-- 词频分析-->
<!-- <dependency>-->
<!-- <groupId>com.hankcs.hanlp.restful</groupId>-->
<!-- <artifactId>hanlp-restful</artifactId>-->
<!-- <version>0.0.12</version>-->
<!-- </dependency>-->
<!-- 情感分析-->
<dependency>
<groupId>com.hankcs</groupId>
<artifactId>hanlp</artifactId>
<version>portable-1.8.4</version>
</dependency>
<dependency> <dependency>
<groupId>com.hankcs.hanlp.restful</groupId> <groupId>com.hankcs.hanlp.restful</groupId>
<artifactId>hanlp-restful</artifactId> <artifactId>hanlp-restful</artifactId>
<version>0.0.12</version> <version>0.0.12</version>
</dependency> </dependency>
<!-- Apriori算法-->
<!-- <dependency>-->
<!-- <groupId>org.paukov</groupId>-->
<!-- <artifactId>combinatoricsLib</artifactId>-->
<!-- <version>1.0</version>-->
<!-- </dependency>-->
<!-- logistic逻辑回归算法--> <!-- logistic逻辑回归算法-->
<!-- 用于矩阵运算 --> <!-- 用于矩阵运算 -->
<dependency> <!-- <dependency>-->
<groupId>org.ujmp</groupId> <!-- <groupId>org.ujmp</groupId>-->
<artifactId>ujmp-core</artifactId> <!-- <artifactId>ujmp-core</artifactId>-->
<version>0.3.0</version> <!-- <version>0.3.0</version>-->
</dependency> <!-- </dependency>-->
<!-- 用于显示散点图--> <!-- &lt;!&ndash; 用于显示散点图&ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>org.jfree</groupId> <!-- <groupId>org.jfree</groupId>-->
<artifactId>jfreechart</artifactId> <!-- <artifactId>jfreechart</artifactId>-->
<version>1.5.0</version> <!-- <version>1.5.0</version>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>com.hankcs</groupId> <!-- <groupId>com.hankcs</groupId>-->
<artifactId>hanlp</artifactId> <!-- <artifactId>hanlp</artifactId>-->
<version>portable-1.8.0</version> <!-- <version>portable-1.8.0</version>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>com.opencsv</groupId> <!-- <groupId>com.opencsv</groupId>-->
<artifactId>opencsv</artifactId> <!-- <artifactId>opencsv</artifactId>-->
<version>5.7.0</version> <!-- <version>5.7.0</version>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
@ -368,12 +312,12 @@
</dependency> </dependency>
<!-- AI--> <!--&lt;!&ndash; AI&ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>com.squareup.okhttp3</groupId> <!-- <groupId>com.squareup.okhttp3</groupId>-->
<artifactId>okhttp</artifactId> <!-- <artifactId>okhttp</artifactId>-->
<version>4.9.3</version> <!-- 使用最新版本 --> <!-- <version>4.9.3</version> &lt;!&ndash; 使用最新版本 &ndash;&gt;-->
</dependency> <!-- </dependency>-->
<!-- ip地址--> <!-- ip地址-->
<dependency> <dependency>
@ -419,13 +363,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

@ -36,7 +36,11 @@ public class Constant {
public static final String BROWSE_NUMBER="被浏览数"; public static final String BROWSE_NUMBER="被浏览数";
public static final String ZSGY_TCHMODULE = "知识概要";
public static final String ZYXX_TCHMODULE = "资源学习";
public static final String XXCP_TCHMODULE = "学习测评";
public static final String SYSX_TCHMODULE = "实验实训";
public static final String SYBG_TCHMODULE = "实验报告";
public static final String PRO_XXMB="学习目标"; public static final String PRO_XXMB="学习目标";

@ -11,7 +11,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.ujmp.core.util.R;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List; import java.util.List;

@ -6,13 +6,14 @@ import cn.hutool.core.util.HashUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.digest.DigestUtil; import cn.hutool.crypto.digest.DigestUtil;
import com.alibaba.fastjson.JSONObject;
import com.sztzjy.trade.annotation.AnonymousAccess; import com.sztzjy.trade.annotation.AnonymousAccess;
import com.sztzjy.trade.entity.StuAchievementInfo; import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.entity.StuCodeInfoDTO;
import com.sztzjy.trade.entity.StuTaskPracticeRecord;
import com.sztzjy.trade.entity.dto.StuCodeCertificateInfoDTO; import com.sztzjy.trade.entity.dto.StuCodeCertificateInfoDTO;
import com.sztzjy.trade.entity.dto.StuExpermentSubmitDTO; import com.sztzjy.trade.entity.dto.StuExpermentSubmitDTO;
import com.sztzjy.trade.entity.dto.StuScoreDetailsDTO;
import com.sztzjy.trade.service.StuExpermentTrainingService; import com.sztzjy.trade.service.StuExpermentTrainingService;
import com.sztzjy.trade.util.ResultDataEntity;
import com.sztzjy.trade.util.ResultEntity; import com.sztzjy.trade.util.ResultEntity;
import com.sztzjy.trade.util.file.IFileUtil; import com.sztzjy.trade.util.file.IFileUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -29,6 +30,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Random; import java.util.Random;
@ -186,21 +188,36 @@ public class StuExpermentTrainingController {
@PostMapping("/getAcademicRecord")
@AnonymousAccess
@ApiOperation("学习成绩查询")
public ResultDataEntity<List<StuScoreDetails>> getAcademicRecord(String userId, String module){
List<StuScoreDetails> scoreDetailsList=service.getAcademicRecord(userId,module);
return new ResultDataEntity<>(HttpStatus.OK,scoreDetailsList);
}
@AnonymousAccess
@ApiOperation("哈希函数知识概要分数")
@PostMapping("/hashReadingScore")
public ResultDataEntity<StuKnowledgeSummary> hashReadingScore(@RequestBody JSONObject jsonObject) {
StuScoreDetailsDTO stuScoreDetailsDTO = jsonObject.getObject("stuScoreDetailsDTO", StuScoreDetailsDTO.class);
service.hashReadingScore(stuScoreDetailsDTO);
return new ResultDataEntity<>(HttpStatus.OK);
}
public static void main(String[] args) {
Date date = new Date();
//new SimpleDateFormat("yyyy年MM月dd日HH::mm::ss").format(date);
@AnonymousAccess
@ApiOperation("哈希函数资源学习分数统计")
@PostMapping("/hashWatchScore")
public ResultDataEntity<StuScoreDetails> hashWatchScore(@RequestBody JSONObject jsonObject) {
StuScoreDetailsDTO stuScoreDetailsDTO = jsonObject.getObject("stuScoreDetailsDTO", StuScoreDetailsDTO.class);
service.hashWatchScore(stuScoreDetailsDTO);
return new ResultDataEntity<>(HttpStatus.OK);
}
System.out.println( );
}
} }

@ -31,7 +31,7 @@ import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.ujmp.core.util.R;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;

@ -41,11 +41,11 @@ public class TaskController {
long timeDifference = currentTime - newTime; // 计算时间差 long timeDifference = currentTime - newTime; // 计算时间差
//long time = 20 * 60 * 1000; //long time = 20 * 60 * 1000;
long time = 60 * 60 * 1000; long time = 20 * 60 * 1000;
// 判断时间差是否大于 20 分钟20 分钟 = 20 * 60 * 1000 毫秒) // 判断时间差是否大于 20 分钟20 分钟 = 20 * 60 * 1000 毫秒)
if (timeDifference > time) { if (timeDifference > time) {
//大于20分钟未操作 表明用户已经离线 在线时长+20分钟 //大于20分钟未操作 表明用户已经离线 在线时长+20分钟
System.out.println(key+"-->60分钟未操作,已强制离线"); System.out.println(key+"-->20分钟未操作,已强制离线");
String userId = key.split(itemName+"-userId:")[1]; String userId = key.split(itemName+"-userId:")[1];
//String userId = key.split("userId:").toString(); //String userId = key.split("userId:").toString();

@ -17,7 +17,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.ujmp.core.util.R;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;

@ -0,0 +1,75 @@
package com.sztzjy.trade.entity;
import java.util.Date;
public class StuKnowledgeSummary {
private String summaryId;
private String directoryId;
private String directoryName;
private String parentId;
private String summaryContent;
private String module;
private Date readingTime;
public String getSummaryId() {
return summaryId;
}
public void setSummaryId(String summaryId) {
this.summaryId = summaryId == null ? null : summaryId.trim();
}
public String getDirectoryId() {
return directoryId;
}
public void setDirectoryId(String directoryId) {
this.directoryId = directoryId == null ? null : directoryId.trim();
}
public String getDirectoryName() {
return directoryName;
}
public void setDirectoryName(String directoryName) {
this.directoryName = directoryName == null ? null : directoryName.trim();
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId == null ? null : parentId.trim();
}
public String getSummaryContent() {
return summaryContent;
}
public void setSummaryContent(String summaryContent) {
this.summaryContent = summaryContent == null ? null : summaryContent.trim();
}
public String getModule() {
return module;
}
public void setModule(String module) {
this.module = module == null ? null : module.trim();
}
public Date getReadingTime() {
return readingTime;
}
public void setReadingTime(Date readingTime) {
this.readingTime = readingTime;
}
}

@ -0,0 +1,22 @@
package com.sztzjy.trade.entity;/*
*@title StuKnowledgeSummaryChildrenVo
*@description
*@author 17803
*@version 1.0
*@create 2023/8/31 15:05
*/
import lombok.Data;
@Data
public class StuKnowledgeSummaryChildrenDto {
private String id;
private String childrenId;
private String childrenName;
private String childrenSummaryContent;
}

@ -0,0 +1,680 @@
package com.sztzjy.trade.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class StuKnowledgeSummaryExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StuKnowledgeSummaryExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andSummaryIdIsNull() {
addCriterion("summary_id is null");
return (Criteria) this;
}
public Criteria andSummaryIdIsNotNull() {
addCriterion("summary_id is not null");
return (Criteria) this;
}
public Criteria andSummaryIdEqualTo(String value) {
addCriterion("summary_id =", value, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdNotEqualTo(String value) {
addCriterion("summary_id <>", value, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdGreaterThan(String value) {
addCriterion("summary_id >", value, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdGreaterThanOrEqualTo(String value) {
addCriterion("summary_id >=", value, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdLessThan(String value) {
addCriterion("summary_id <", value, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdLessThanOrEqualTo(String value) {
addCriterion("summary_id <=", value, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdLike(String value) {
addCriterion("summary_id like", value, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdNotLike(String value) {
addCriterion("summary_id not like", value, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdIn(List<String> values) {
addCriterion("summary_id in", values, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdNotIn(List<String> values) {
addCriterion("summary_id not in", values, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdBetween(String value1, String value2) {
addCriterion("summary_id between", value1, value2, "summaryId");
return (Criteria) this;
}
public Criteria andSummaryIdNotBetween(String value1, String value2) {
addCriterion("summary_id not between", value1, value2, "summaryId");
return (Criteria) this;
}
public Criteria andDirectoryIdIsNull() {
addCriterion("directory_id is null");
return (Criteria) this;
}
public Criteria andDirectoryIdIsNotNull() {
addCriterion("directory_id is not null");
return (Criteria) this;
}
public Criteria andDirectoryIdEqualTo(String value) {
addCriterion("directory_id =", value, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdNotEqualTo(String value) {
addCriterion("directory_id <>", value, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdGreaterThan(String value) {
addCriterion("directory_id >", value, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdGreaterThanOrEqualTo(String value) {
addCriterion("directory_id >=", value, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdLessThan(String value) {
addCriterion("directory_id <", value, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdLessThanOrEqualTo(String value) {
addCriterion("directory_id <=", value, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdLike(String value) {
addCriterion("directory_id like", value, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdNotLike(String value) {
addCriterion("directory_id not like", value, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdIn(List<String> values) {
addCriterion("directory_id in", values, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdNotIn(List<String> values) {
addCriterion("directory_id not in", values, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdBetween(String value1, String value2) {
addCriterion("directory_id between", value1, value2, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryIdNotBetween(String value1, String value2) {
addCriterion("directory_id not between", value1, value2, "directoryId");
return (Criteria) this;
}
public Criteria andDirectoryNameIsNull() {
addCriterion("directory_name is null");
return (Criteria) this;
}
public Criteria andDirectoryNameIsNotNull() {
addCriterion("directory_name is not null");
return (Criteria) this;
}
public Criteria andDirectoryNameEqualTo(String value) {
addCriterion("directory_name =", value, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameNotEqualTo(String value) {
addCriterion("directory_name <>", value, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameGreaterThan(String value) {
addCriterion("directory_name >", value, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameGreaterThanOrEqualTo(String value) {
addCriterion("directory_name >=", value, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameLessThan(String value) {
addCriterion("directory_name <", value, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameLessThanOrEqualTo(String value) {
addCriterion("directory_name <=", value, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameLike(String value) {
addCriterion("directory_name like", value, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameNotLike(String value) {
addCriterion("directory_name not like", value, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameIn(List<String> values) {
addCriterion("directory_name in", values, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameNotIn(List<String> values) {
addCriterion("directory_name not in", values, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameBetween(String value1, String value2) {
addCriterion("directory_name between", value1, value2, "directoryName");
return (Criteria) this;
}
public Criteria andDirectoryNameNotBetween(String value1, String value2) {
addCriterion("directory_name not between", value1, value2, "directoryName");
return (Criteria) this;
}
public Criteria andParentIdIsNull() {
addCriterion("parent_id is null");
return (Criteria) this;
}
public Criteria andParentIdIsNotNull() {
addCriterion("parent_id is not null");
return (Criteria) this;
}
public Criteria andParentIdEqualTo(String value) {
addCriterion("parent_id =", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotEqualTo(String value) {
addCriterion("parent_id <>", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThan(String value) {
addCriterion("parent_id >", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThanOrEqualTo(String value) {
addCriterion("parent_id >=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThan(String value) {
addCriterion("parent_id <", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThanOrEqualTo(String value) {
addCriterion("parent_id <=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLike(String value) {
addCriterion("parent_id like", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotLike(String value) {
addCriterion("parent_id not like", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdIn(List<String> values) {
addCriterion("parent_id in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotIn(List<String> values) {
addCriterion("parent_id not in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdBetween(String value1, String value2) {
addCriterion("parent_id between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotBetween(String value1, String value2) {
addCriterion("parent_id not between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andSummaryContentIsNull() {
addCriterion("summary_content is null");
return (Criteria) this;
}
public Criteria andSummaryContentIsNotNull() {
addCriterion("summary_content is not null");
return (Criteria) this;
}
public Criteria andSummaryContentEqualTo(String value) {
addCriterion("summary_content =", value, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentNotEqualTo(String value) {
addCriterion("summary_content <>", value, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentGreaterThan(String value) {
addCriterion("summary_content >", value, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentGreaterThanOrEqualTo(String value) {
addCriterion("summary_content >=", value, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentLessThan(String value) {
addCriterion("summary_content <", value, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentLessThanOrEqualTo(String value) {
addCriterion("summary_content <=", value, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentLike(String value) {
addCriterion("summary_content like", value, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentNotLike(String value) {
addCriterion("summary_content not like", value, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentIn(List<String> values) {
addCriterion("summary_content in", values, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentNotIn(List<String> values) {
addCriterion("summary_content not in", values, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentBetween(String value1, String value2) {
addCriterion("summary_content between", value1, value2, "summaryContent");
return (Criteria) this;
}
public Criteria andSummaryContentNotBetween(String value1, String value2) {
addCriterion("summary_content not between", value1, value2, "summaryContent");
return (Criteria) this;
}
public Criteria andModuleIsNull() {
addCriterion("module is null");
return (Criteria) this;
}
public Criteria andModuleIsNotNull() {
addCriterion("module is not null");
return (Criteria) this;
}
public Criteria andModuleEqualTo(String value) {
addCriterion("module =", value, "module");
return (Criteria) this;
}
public Criteria andModuleNotEqualTo(String value) {
addCriterion("module <>", value, "module");
return (Criteria) this;
}
public Criteria andModuleGreaterThan(String value) {
addCriterion("module >", value, "module");
return (Criteria) this;
}
public Criteria andModuleGreaterThanOrEqualTo(String value) {
addCriterion("module >=", value, "module");
return (Criteria) this;
}
public Criteria andModuleLessThan(String value) {
addCriterion("module <", value, "module");
return (Criteria) this;
}
public Criteria andModuleLessThanOrEqualTo(String value) {
addCriterion("module <=", value, "module");
return (Criteria) this;
}
public Criteria andModuleLike(String value) {
addCriterion("module like", value, "module");
return (Criteria) this;
}
public Criteria andModuleNotLike(String value) {
addCriterion("module not like", value, "module");
return (Criteria) this;
}
public Criteria andModuleIn(List<String> values) {
addCriterion("module in", values, "module");
return (Criteria) this;
}
public Criteria andModuleNotIn(List<String> values) {
addCriterion("module not in", values, "module");
return (Criteria) this;
}
public Criteria andModuleBetween(String value1, String value2) {
addCriterion("module between", value1, value2, "module");
return (Criteria) this;
}
public Criteria andModuleNotBetween(String value1, String value2) {
addCriterion("module not between", value1, value2, "module");
return (Criteria) this;
}
public Criteria andReadingTimeIsNull() {
addCriterion("reading_time is null");
return (Criteria) this;
}
public Criteria andReadingTimeIsNotNull() {
addCriterion("reading_time is not null");
return (Criteria) this;
}
public Criteria andReadingTimeEqualTo(Date value) {
addCriterion("reading_time =", value, "readingTime");
return (Criteria) this;
}
public Criteria andReadingTimeNotEqualTo(Date value) {
addCriterion("reading_time <>", value, "readingTime");
return (Criteria) this;
}
public Criteria andReadingTimeGreaterThan(Date value) {
addCriterion("reading_time >", value, "readingTime");
return (Criteria) this;
}
public Criteria andReadingTimeGreaterThanOrEqualTo(Date value) {
addCriterion("reading_time >=", value, "readingTime");
return (Criteria) this;
}
public Criteria andReadingTimeLessThan(Date value) {
addCriterion("reading_time <", value, "readingTime");
return (Criteria) this;
}
public Criteria andReadingTimeLessThanOrEqualTo(Date value) {
addCriterion("reading_time <=", value, "readingTime");
return (Criteria) this;
}
public Criteria andReadingTimeIn(List<Date> values) {
addCriterion("reading_time in", values, "readingTime");
return (Criteria) this;
}
public Criteria andReadingTimeNotIn(List<Date> values) {
addCriterion("reading_time not in", values, "readingTime");
return (Criteria) this;
}
public Criteria andReadingTimeBetween(Date value1, Date value2) {
addCriterion("reading_time between", value1, value2, "readingTime");
return (Criteria) this;
}
public Criteria andReadingTimeNotBetween(Date value1, Date value2) {
addCriterion("reading_time not between", value1, value2, "readingTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,26 @@
package com.sztzjy.trade.entity;/*
*@title StuKnowledgeSummaryParentVo
*@description
*@author 17803
*@version 1.0
*@create 2023/8/31 15:03
*/
import lombok.Data;
import java.util.List;
@Data
public class StuKnowledgeSummaryParentDto {
private String uid;
private Integer parentId;
private String parentName;
private String parentSummaryContent;
// 子分类
private List<StuKnowledgeSummaryChildrenDto> childrenVoList;
}

@ -48,7 +48,7 @@ public class TchDigitalTradeWeight {
private BigDecimal scoringCriteriaForStudyEvaluation; private BigDecimal scoringCriteriaForStudyEvaluation;
@ApiModelProperty(notes = "实验实训得分标准") @ApiModelProperty(notes = "实验实训得分标准")
private BigDecimal scoringCriteriaForExperimentalTraining; private BigDecimal scoringCriteriaForExperimentalTraining;
@ApiModelProperty(notes = "学习时长权重") @ApiModelProperty(notes = "学习时长权重")
private BigDecimal weightStudyTime; private BigDecimal weightStudyTime;

@ -21,4 +21,25 @@ public class StuScoreDetailsDTO {
private BigDecimal weight; private BigDecimal weight;
@ApiModelProperty(notes = "加权后得分") @ApiModelProperty(notes = "加权后得分")
private double weightedScore; private double weightedScore;
private String id;
private String learningProjects; //学习项目
private String assessmentItems; //考核项目
private String scoringCriteria; //计分标准
private Double scoreWeight; //成绩权重
private int viewingTime;
private Double scoreProject; //项目得分
private String module; //归属模块
private String userId; //用户id
private String completionStatus; //完成情况
} }

@ -12,7 +12,7 @@ public class StuVideoInfoDTO {
@ApiModelProperty(notes = "视频时长 单位秒") @ApiModelProperty(notes = "视频时长 单位秒")
private Integer videoDuration; private Long videoDuration;
@ApiModelProperty(notes = "视频链接") @ApiModelProperty(notes = "视频链接")

@ -0,0 +1,37 @@
package com.sztzjy.trade.mapper;
import com.sztzjy.trade.entity.StuKnowledgeSummary;
import com.sztzjy.trade.entity.StuKnowledgeSummaryExample;
import com.sztzjy.trade.entity.StuKnowledgeSummaryParentDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface StuKnowledgeSummaryMapper {
long countByExample(StuKnowledgeSummaryExample example);
int deleteByExample(StuKnowledgeSummaryExample example);
int deleteByPrimaryKey(String summaryId);
int insert(StuKnowledgeSummary record);
int insertSelective(StuKnowledgeSummary record);
List<StuKnowledgeSummary> selectByExample(StuKnowledgeSummaryExample example);
StuKnowledgeSummary selectByPrimaryKey(String summaryId);
int updateByExampleSelective(@Param("record") StuKnowledgeSummary record, @Param("example") StuKnowledgeSummaryExample example);
int updateByExample(@Param("record") StuKnowledgeSummary record, @Param("example") StuKnowledgeSummaryExample example);
int updateByPrimaryKeySelective(StuKnowledgeSummary record);
int updateByPrimaryKey(StuKnowledgeSummary record);
List<StuKnowledgeSummaryParentDto> queryDirAndContext(String module);
}

@ -1,10 +1,14 @@
package com.sztzjy.trade.service; package com.sztzjy.trade.service;
import com.sztzjy.trade.entity.StuScoreDetails;
import com.sztzjy.trade.entity.StuTaskPracticeRecord; import com.sztzjy.trade.entity.StuTaskPracticeRecord;
import com.sztzjy.trade.entity.dto.StuExpermentSubmitDTO; import com.sztzjy.trade.entity.dto.StuExpermentSubmitDTO;
import com.sztzjy.trade.entity.dto.StuScoreDetailsDTO;
import com.sztzjy.trade.util.ResultEntity; import com.sztzjy.trade.util.ResultEntity;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/** /**
* @author 17803 * @author 17803
* @date 2024-09-04 10:17 * @date 2024-09-04 10:17
@ -66,4 +70,11 @@ public interface StuExpermentTrainingService {
ResultEntity keyGeneration(); ResultEntity keyGeneration();
List<StuScoreDetails> getAcademicRecord(String userId, String module);
void hashReadingScore(StuScoreDetailsDTO stuScoreDetailsDTO);
//哈希函数资源学习分数统计
void hashWatchScore(StuScoreDetailsDTO stuScoreDetailsDTO);
} }

@ -12,7 +12,7 @@ import com.sztzjy.trade.service.StuAcademicRecordService;
import com.sztzjy.trade.util.BigDecimalUtils; import com.sztzjy.trade.util.BigDecimalUtils;
import com.sztzjy.trade.util.ConvertUtil; import com.sztzjy.trade.util.ConvertUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.ujmp.core.util.R;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;

@ -5,14 +5,15 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.config.Constant;
import com.sztzjy.trade.entity.*; import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.entity.dto.StuExpermentSubmitDTO; import com.sztzjy.trade.entity.dto.StuExpermentSubmitDTO;
import com.sztzjy.trade.entity.dto.StuScoreDetailsDTO;
import com.sztzjy.trade.entity.dto.StuTaskDetailDTO; import com.sztzjy.trade.entity.dto.StuTaskDetailDTO;
import com.sztzjy.trade.mapper.*; import com.sztzjy.trade.mapper.*;
import com.sztzjy.trade.service.StuExpermentTrainingService; import com.sztzjy.trade.service.StuExpermentTrainingService;
import com.sztzjy.trade.util.RedisUtil; import com.sztzjy.trade.util.*;
import com.sztzjy.trade.util.ResultEntity; import com.sztzjy.trade.util.compute.ScoringUtil;
import com.sztzjy.trade.util.RsaUtil;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -63,6 +64,8 @@ public class StuExpermentTrainingServiceImpl implements StuExpermentTrainingServ
@Value("${file.url}") @Value("${file.url}")
public String url; public String url;
@Autowired
private StuUserMapper stuUserMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -99,7 +102,7 @@ public class StuExpermentTrainingServiceImpl implements StuExpermentTrainingServ
//更新 //更新
stuTaskPracticeRecord.setId(practiceRecord.getId()); stuTaskPracticeRecord.setId(practiceRecord.getId());
stuTaskPracticeRecordMapper.updateByPrimaryKeySelective(stuTaskPracticeRecord); stuTaskPracticeRecordMapper.updateByPrimaryKeySelective(stuTaskPracticeRecord);
taskPracticeRecordList.forEach(item->{ taskPracticeRecordList.forEach(item -> {
if (practiceRecord.getId() == item.getId()) { if (practiceRecord.getId() == item.getId()) {
item.setSubState(1); item.setSubState(1);
} }
@ -128,7 +131,7 @@ public class StuExpermentTrainingServiceImpl implements StuExpermentTrainingServ
try { try {
RsaUtil.RsaKeyPair rsaKeyPair = RsaUtil.generateKeyPair(); RsaUtil.RsaKeyPair rsaKeyPair = RsaUtil.generateKeyPair();
return new ResultEntity(HttpStatus.OK,"生成密钥",rsaKeyPair); return new ResultEntity(HttpStatus.OK, "生成密钥", rsaKeyPair);
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@ -498,14 +501,14 @@ public class StuExpermentTrainingServiceImpl implements StuExpermentTrainingServ
uploadExperment.setModule(module); uploadExperment.setModule(module);
uploadExperment.setUserId(userId); uploadExperment.setUserId(userId);
stuUploadExpermentMapper.insertSelective(uploadExperment); stuUploadExpermentMapper.insertSelective(uploadExperment);
return new ResultEntity<>(HttpStatus.OK, "上传成功!",url+filePath); return new ResultEntity<>(HttpStatus.OK, "上传成功!", url + filePath);
} else { } else {
StuUploadExperment uploadExperment = stuUploadExpermentList.get(0); StuUploadExperment uploadExperment = stuUploadExpermentList.get(0);
uploadExperment.setUpdateTime(new Date()); uploadExperment.setUpdateTime(new Date());
uploadExperment.setFilePath(filePath); uploadExperment.setFilePath(filePath);
stuUploadExpermentMapper.updateByPrimaryKeySelective(uploadExperment); stuUploadExpermentMapper.updateByPrimaryKeySelective(uploadExperment);
return new ResultEntity<>(HttpStatus.OK, "上传成功!",url+filePath); return new ResultEntity<>(HttpStatus.OK, "上传成功!", url + filePath);
} }
@ -527,7 +530,7 @@ public class StuExpermentTrainingServiceImpl implements StuExpermentTrainingServ
} }
// private synchronized void subQuestionRanking(String schoolId, String module, String classId, List<StuTaskDetailDTO> taskList, int state) { // private synchronized void subQuestionRanking(String schoolId, String module, String classId, List<StuTaskDetailDTO> taskList, int state) {
// //
// StuWrongQuestionRankingExample example = new StuWrongQuestionRankingExample(); // StuWrongQuestionRankingExample example = new StuWrongQuestionRankingExample();
// example.createCriteria().andSchoolIdEqualTo(schoolId).andModuleEqualTo(module); // example.createCriteria().andSchoolIdEqualTo(schoolId).andModuleEqualTo(module);
@ -570,6 +573,494 @@ public class StuExpermentTrainingServiceImpl implements StuExpermentTrainingServ
// } // }
// } // }
// } // }
@Resource
ScoringUtil scoringUtil;
@Resource
BigDecimalUtils bigDecimalUtils;
@Override
public List<StuScoreDetails> getAcademicRecord(String userId, String module) {
StuUserExample stuUserExample = new StuUserExample();
stuUserExample.createCriteria().andUserIdEqualTo(userId);
List<StuUser> stuUsers = stuUserMapper.selectByExample(stuUserExample);
String schoolId = stuUsers.get(0).getSchoolId();
TchDigitalTradeWeight tchConceptualTechnologyWeights = getWeight(schoolId);
// if(tchConceptualTechnologyWeights.size()==0){
// TchConceptualTechnologyWeight tchConceptualTechnologyWeight = new TchConceptualTechnologyWeight(schoolId,module);
// tchConceptualTechnologyWeightMapper.insert(tchConceptualTechnologyWeight);
// tchConceptualTechnologyWeights.add(tchConceptualTechnologyWeight);
// }
//取到知识概要计分标准和权重
BigDecimal knowledgeScore = tchConceptualTechnologyWeights.getScoringCriteriaForLearningDuration();
BigDecimal summaryOfKnowledgeWeight = tchConceptualTechnologyWeights.getWeightStudyTime();
//取到资源学习计分标准和权重
BigDecimal resourceLearningScore = tchConceptualTechnologyWeights.getScoringCriteriaForStudyResource();
BigDecimal resourceLearningWeight = tchConceptualTechnologyWeights.getWeightStudyResource();
//取到学习测评计分标准和权重
BigDecimal learningAssessmentScore = tchConceptualTechnologyWeights.getScoringCriteriaForStudyEvaluation();
BigDecimal learningAssessmentWeight = tchConceptualTechnologyWeights.getWeightStudyEvaluation();
//取到实验实训计分标准和权重
BigDecimal experimentalTrainingScore = tchConceptualTechnologyWeights.getScoringCriteriaForExperimentalTraining();
BigDecimal experimentalTrainingWeight = tchConceptualTechnologyWeights.getWeightExperimentalTraining();
//取到实验报告权重
BigDecimal reportWeight = tchConceptualTechnologyWeights.getWeightExperimentalReport();
//查询成绩表
StuScoreDetailsExample example = new StuScoreDetailsExample();
example.createCriteria().andUserIdEqualTo(userId).andProjectEqualTo(module);
example.setOrderByClause("serial_number ASC");
List<StuScoreDetails> scoreDetailsList = stuScoreDetailsMapper.selectByExample(example);
double score = 0;
int a=0;int b=0;int c=0;int d=0;int e=0;
for (int i = 0; i <scoreDetailsList.size(); i++) {
//根据所属模块更新计分标准和权重,并重新计算得分
if (scoreDetailsList.get(i).getSerialNumber()==1){
scoreDetailsList.get(i).setScoringCriteria(String.valueOf(knowledgeScore));
scoreDetailsList.get(i).setScoreWeight(Double.parseDouble(String.valueOf(summaryOfKnowledgeWeight)));
String completionStatus = scoreDetailsList.get(i).getCompletionStatus();
double stuKnowledgeSummaryScoring = scoringUtil.getStuKnowledgeSummaryScoring(Double.parseDouble(completionStatus), Double.parseDouble(String.valueOf(knowledgeScore)));
scoreDetailsList.get(i).setScoreProject(stuKnowledgeSummaryScoring);
Double info = 100 / Convert.toDouble(knowledgeScore);
Double complement = Convert.toDouble(completionStatus) / info ;
if (complement>=1)
{
//设置完成状态
scoreDetailsList.get(i).setSchedule(100.0);
}else {
info = Math.round(complement * 100.0) / 100.0;
//设置完成状态
scoreDetailsList.get(i).setSchedule(info*100);
}
a++;
}
if(scoreDetailsList.get(i).getSerialNumber()==2){
scoreDetailsList.get(i).setScoringCriteria(String.valueOf(resourceLearningScore));
scoreDetailsList.get(i).setScoreWeight(Double.parseDouble(String.valueOf(resourceLearningWeight)));
String completionStatus = scoreDetailsList.get(i).getCompletionStatus();
double stuResourcesScoring = scoringUtil.getStuResourcesScoring(Double.parseDouble(completionStatus), Double.parseDouble(String.valueOf(resourceLearningScore)));
scoreDetailsList.get(i).setScoreProject(stuResourcesScoring);
Double info = 100 / Convert.toDouble(resourceLearningScore);
Double complement = Convert.toDouble(completionStatus) / info ;
if (complement>=1)
{
//设置完成状态
scoreDetailsList.get(i).setSchedule(100.0);
}else {
info = Math.round(complement * 100.0) / 100.0;
//设置完成状态
scoreDetailsList.get(i).setSchedule(info*100);
}
b++;
}
if(scoreDetailsList.get(i).getSerialNumber()==3){
scoreDetailsList.get(i).setScoringCriteria(String.valueOf(learningAssessmentScore));
scoreDetailsList.get(i).setScoreWeight(Double.parseDouble(String.valueOf(learningAssessmentWeight)));
String completionStatus = scoreDetailsList.get(i).getCompletionStatus();
double stuLearningAssessmentScoring = scoringUtil.getStuLearningAssessmentScoring(Integer.parseInt(completionStatus), Double.parseDouble(String.valueOf(learningAssessmentScore)));
scoreDetailsList.get(i).setScoreProject(stuLearningAssessmentScoring);
//设置完成状态
scoreDetailsList.get(i).setSchedule(100.0);
c++;
}
if(scoreDetailsList.get(i).getSerialNumber()==4){
scoreDetailsList.get(i).setScoringCriteria(String.valueOf(experimentalTrainingScore));
scoreDetailsList.get(i).setScoreWeight(Double.parseDouble(String.valueOf(experimentalTrainingWeight)));
Double completionStatus = scoreDetailsList.get(i).getSchedule();
// double stuLearningAssessmentScoring = scoringUtil.getStuLearningAssessmentScoring(Convert.toInt(completionStatus), Double.parseDouble(String.valueOf(experimentalTrainingScore)));
scoreDetailsList.get(i).setScoreProject(scoreDetailsList.get(i).getScoreProject());
// //判断该模块的实训任务是否已全部提交 全部提交则计算该模块的实训任务分数
// StuModuleDetailsExample stuModuleDetailsExample=new StuModuleDetailsExample();
// stuModuleDetailsExample.createCriteria().andModuleEqualTo(module);
// List<StuModuleDetails> stuModuleDetailsList = stuModuleDetailsMapper.selectByExample(stuModuleDetailsExample);
// if(stuModuleDetailsList.isEmpty()){ //设置默认数据
// StuModuleDetails stuModuleDetails=new StuModuleDetails(module);
// stuModuleDetailsMapper.insert(stuModuleDetails);
// stuModuleDetailsList.add(stuModuleDetails);
// }
// StuModuleDetails stuModuleDetails = stuModuleDetailsList.get(0);
//
// //总次数
// Integer taskNumber = stuModuleDetails.getTaskNumber();
//
// //查询该用户提交实训任务的次数
// StuTrainingTaskSubmissionDetailsExample stuTrainingTaskSubmissionDetailsExample1=new StuTrainingTaskSubmissionDetailsExample();
// stuTrainingTaskSubmissionDetailsExample1.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module);
// List<StuTrainingTaskSubmissionDetails> stuTrainingTaskSubmissionDetails1 = stuTrainingTaskSubmissionDetailsMapper.selectByExample(stuTrainingTaskSubmissionDetailsExample1);
// if (stuTrainingTaskSubmissionDetails1.isEmpty())
// {
// scoreDetailsList.get(i).setSchedule(0.0);
// }else {
//
//
//
// Double info = (double) stuTrainingTaskSubmissionDetails1.size() / taskNumber;
// info = Math.round(info * 100.0) / 100.0;
// scoreDetailsList.get(i).setSchedule(info*100);
// }
d++;
}
if(scoreDetailsList.get(i).getSerialNumber()==5){
scoreDetailsList.get(i).setScoreWeight(Double.parseDouble(String.valueOf(reportWeight)));
scoreDetailsList.get(i).setSchedule(100.0);
e++;
}
stuScoreDetailsMapper.updateByPrimaryKey(scoreDetailsList.get(i));
//根据权重计算所属总模块得分
Double scoreWeight = scoreDetailsList.get(i).getScoreWeight();
if(scoreDetailsList.get(i).getScoreProject()!=null){
Double scoreProject = scoreDetailsList.get(i).getScoreProject();
Double mul = bigDecimalUtils.mul(scoreWeight, scoreProject);
score += mul;
}
}
if(a==0){
StuScoreDetails stuScoreDetails=new StuScoreDetails();
stuScoreDetails.setLearningProjects("知识概要");
stuScoreDetails.setAssessmentItems("阅读知识");
stuScoreDetails.setScoringCriteria(String.valueOf(knowledgeScore));
stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(summaryOfKnowledgeWeight)));
stuScoreDetails.setModule(module);
stuScoreDetails.setSerialNumber(1);
stuScoreDetails.setSchedule(0.0);
scoreDetailsList.add(stuScoreDetails);
}
if(b==0){
StuScoreDetails stuScoreDetails=new StuScoreDetails();
stuScoreDetails.setLearningProjects("资源学习");
stuScoreDetails.setAssessmentItems("观看资源");
stuScoreDetails.setScoringCriteria(String.valueOf(resourceLearningScore));
stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(resourceLearningWeight)));
stuScoreDetails.setModule(module);
stuScoreDetails.setSerialNumber(2);
stuScoreDetails.setSchedule(0.0);
scoreDetailsList.add(stuScoreDetails);
}
if(c==0){
StuScoreDetails stuScoreDetails=new StuScoreDetails();
stuScoreDetails.setLearningProjects("学习测评");
stuScoreDetails.setAssessmentItems("客观题测试");
stuScoreDetails.setScoringCriteria(String.valueOf(learningAssessmentScore));
stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(learningAssessmentWeight)));
stuScoreDetails.setModule(module);
stuScoreDetails.setSerialNumber(3);
stuScoreDetails.setSchedule(0.0);
scoreDetailsList.add(stuScoreDetails);
}
if(d==0){
StuScoreDetails stuScoreDetails=new StuScoreDetails();
stuScoreDetails.setLearningProjects("实验实训");
stuScoreDetails.setAssessmentItems("输错/选错次数");
stuScoreDetails.setScoringCriteria(String.valueOf(experimentalTrainingScore));
stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(experimentalTrainingWeight)));
stuScoreDetails.setModule(module);
stuScoreDetails.setSerialNumber(4);
stuScoreDetails.setSchedule(0.0);
scoreDetailsList.add(stuScoreDetails);
}
if(e==0){
StuScoreDetails stuScoreDetails=new StuScoreDetails();
stuScoreDetails.setLearningProjects("实训报告");
stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(reportWeight)));
stuScoreDetails.setModule(module);
stuScoreDetails.setSerialNumber(5);
stuScoreDetails.setCompletionStatus("未提交");
stuScoreDetails.setSchedule(0.0);
scoreDetailsList.add(stuScoreDetails);
}
//将成绩添加到学生信息
this.personalScoreEntry(userId,module);
return scoreDetailsList;
}
@Resource
ConvertUtil convertUtil;
/**
*
*
* @param stuScoreDetailsDTO DTO
*/
@Override
public void hashReadingScore(StuScoreDetailsDTO stuScoreDetailsDTO) {
StuUserExample stuUserExample = new StuUserExample();
stuUserExample.createCriteria().andUserIdEqualTo(stuScoreDetailsDTO.getUserId());
List<StuUser> stuUsers = stuUserMapper.selectByExample(stuUserExample);
StuUser stuUser = stuUsers.get(0);
TchDigitalTradeWeight weight = getWeight(stuUser.getSchoolId());
//将时间转换为分钟
double i = (double) stuScoreDetailsDTO.getViewingTime() / 60;
Double floor = Math.floor(i);
BigDecimal knowledgeScore = weight.getScoringCriteriaForLearningDuration();
double stuKnowledgeSummaryScoring = scoringUtil.getStuKnowledgeSummaryScoring(floor, Double.parseDouble(String.valueOf(knowledgeScore)));
//封装到实体类
stuScoreDetailsDTO.setScoringCriteria(String.valueOf(knowledgeScore));
stuScoreDetailsDTO.setScoreWeight(Double.parseDouble(String.valueOf(weight.getWeightStudyTime())));
StuScoreDetails stuScoreDetails = convertUtil.DTOToEntity(stuScoreDetailsDTO, StuScoreDetails.class);
stuScoreDetails.setScoreProject(stuKnowledgeSummaryScoring);
floor = floor >= 1 ? 1 : floor;
stuScoreDetails.setCompletionStatus(String.valueOf(floor));
stuScoreDetails.setSerialNumber(1);
stuScoreDetails.setLearningProjects("知识概要");
stuScoreDetails.setAssessmentItems("阅读知识");
stuScoreDetails.setProject(stuScoreDetailsDTO.getModule());
//查询有无数据
StuScoreDetailsExample example1 = new StuScoreDetailsExample();
StuScoreDetailsExample.Criteria criteria = example1.createCriteria();
criteria.andModuleEqualTo(stuScoreDetails.getModule())
.andLearningProjectsEqualTo(stuScoreDetails.getLearningProjects())
.andUserIdEqualTo(stuScoreDetails.getUserId());
List<StuScoreDetails> scoreDetailsList = stuScoreDetailsMapper.selectByExample(example1);
if (scoreDetailsList.size() == 0) {
stuScoreDetails.setId(UUID.randomUUID().toString());
stuScoreDetailsMapper.insert(stuScoreDetails);
} else {
//分数累加
Double scoreProject = scoreDetailsList.get(0).getScoreProject();
Double scoreProject1 = stuScoreDetails.getScoreProject();
BigDecimal add = bigDecimalUtils.add(scoreProject.toString(), scoreProject1.toString());
if(add.compareTo(BigDecimal.valueOf(100))==1){
add=BigDecimal.valueOf(100);
}
//时间累加
String completionStatus = String.valueOf(scoreDetailsList.get(0).getCompletionStatus());
String completionStatus1 = String.valueOf(stuScoreDetails.getCompletionStatus());
BigDecimal add1 = bigDecimalUtils.add(completionStatus, completionStatus1);
stuScoreDetails.setScoreProject(Double.parseDouble(add.toString()));
stuScoreDetails.setCompletionStatus(add1.toString());
stuScoreDetailsMapper.updateByExampleSelective(stuScoreDetails, example1);
}
//将分数统计到学生表中
this.personalScoreEntry(stuScoreDetailsDTO.getUserId(),stuScoreDetailsDTO.getModule());
}
/**
*
*
* @param stuScoreDetailsDTO DTO
*/
@Override
public void hashWatchScore(StuScoreDetailsDTO stuScoreDetailsDTO) {
StuUserExample stuUserExample = new StuUserExample();
stuUserExample.createCriteria().andUserIdEqualTo(stuScoreDetailsDTO.getUserId());
List<StuUser> stuUsers = stuUserMapper.selectByExample(stuUserExample);
StuUser stuUser = stuUsers.get(0);
TchDigitalTradeWeight weight = getWeight(stuUser.getSchoolId());
//时间转换成分钟
double i = (double) stuScoreDetailsDTO.getViewingTime() / 60;
double floor = Math.floor(i);
double stuResourcesScoring = scoringUtil.getStuResourcesScoring(floor, Double.parseDouble(String.valueOf(weight.getScoringCriteriaForStudyResource())));
stuScoreDetailsDTO.setScoringCriteria(String.valueOf(weight.getScoringCriteriaForStudyResource()));
stuScoreDetailsDTO.setScoreWeight(Double.parseDouble(String.valueOf(weight.getWeightStudyResource())));
//将DTO转为Entity
StuScoreDetails stuScoreDetails = convertUtil.DTOToEntity(stuScoreDetailsDTO, StuScoreDetails.class);
stuScoreDetails.setScoreProject(stuResourcesScoring);
stuScoreDetails.setCompletionStatus(String.valueOf(floor));
stuScoreDetails.setSerialNumber(2);
stuScoreDetails.setLearningProjects("资源学习");
stuScoreDetails.setAssessmentItems("观看资源");
//判断数据是否存在
StuScoreDetailsExample example1 = new StuScoreDetailsExample();
StuScoreDetailsExample.Criteria criteria1 = example1.createCriteria();
criteria1.andUserIdEqualTo(stuScoreDetailsDTO.getUserId())
.andModuleEqualTo(stuScoreDetailsDTO.getModule())
.andLearningProjectsEqualTo(stuScoreDetails.getLearningProjects());
List<StuScoreDetails> scoreDetailsList1 = stuScoreDetailsMapper.selectByExample(example1);
if (scoreDetailsList1.size() == 0) {
//不存在则添加数据
stuScoreDetails.setId(UUID.randomUUID().toString());
stuScoreDetailsMapper.insert(stuScoreDetails);
} else {
//分数累加
Double scoreProject = scoreDetailsList1.get(0).getScoreProject();
Double scoreProject1 = stuScoreDetails.getScoreProject();
BigDecimal add = bigDecimalUtils.add(scoreProject.toString(), scoreProject1.toString());
//时间累加
String completionStatus = scoreDetailsList1.get(0).getCompletionStatus();
String completionStatus1 = stuScoreDetails.getCompletionStatus();
BigDecimal add1 = bigDecimalUtils.add(completionStatus, completionStatus1);
stuScoreDetails.setScoreProject(Double.parseDouble(add.toString()));
stuScoreDetails.setCompletionStatus(add1.toString());
stuScoreDetailsMapper.updateByExampleSelective(stuScoreDetails, example1);
}
//将分数统计到学生表中
this.personalScoreEntry(stuScoreDetailsDTO.getUserId(),stuScoreDetailsDTO.getModule());
}
public void personalScoreEntry(String userId,String module){
// StuUserExample stuUserExample=new StuUserExample();
// stuUserExample.createCriteria().andUserIdEqualTo(userId);
// List<StuUser> stuUsers = stuUserMapper.selectByExample(stuUserExample);
// String schoolId = stuUsers.get(0).getSchoolId();
// TchDigitalTradeWeight weight = getWeight(schoolId);
// //取到知识概要计分标准和权重
// BigDecimal knowledgeScore = weight.getScoringCriteriaForLearningDuration();
// BigDecimal summaryOfKnowledgeWeight = weight.getWeightStudyTime();
// //取到资源学习计分标准和权重
// BigDecimal resourceLearningScore = weight.getScoringCriteriaForStudyResource();
// BigDecimal resourceLearningWeight = weight.getWeightStudyResource();
// //取到学习测评计分标准和权重
// BigDecimal learningAssessmentScore = weight.getScoringCriteriaForStudyEvaluation();
// BigDecimal learningAssessmentWeight = weight.getWeightStudyEvaluation();
// //取到实验实训计分标准和权重
// BigDecimal experimentalTrainingScore = weight.getScoringCriteriaForExperimentalTraining();
// BigDecimal experimentalTrainingWeight = weight.getWeightExperimentalTraining();
// //取到实验报告权重
// BigDecimal reportWeight = weight.getWeightExperimentalReport();
StuScoreDetailsExample stuScoreDetailsExample=new StuScoreDetailsExample();
stuScoreDetailsExample.createCriteria().andUserIdEqualTo(userId).andProjectEqualTo(module);
stuScoreDetailsExample.setOrderByClause("serial_number ASC");
List<StuScoreDetails> scoreDetailsList = stuScoreDetailsMapper.selectByExample(stuScoreDetailsExample);
double score=0;
for (int i = 0; i < scoreDetailsList.size(); i++) {
// StuScoreDetails stuScoreDetails = scoreDetailsList.get(i);
// if(stuScoreDetails.getLearningProjects().equals(Constant.ZSGY_TCHMODULE)){
// stuScoreDetails.setScoringCriteria(String.valueOf(knowledgeScore));
// stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(summaryOfKnowledgeWeight)));
// }
// if(stuScoreDetails.getLearningProjects().equals(Constant.ZYXX_TCHMODULE)){
// stuScoreDetails.setScoringCriteria(String.valueOf(resourceLearningScore));
// stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(resourceLearningWeight)));
// }
// if(stuScoreDetails.getLearningProjects().equals(Constant.XXCP_TCHMODULE)){
// stuScoreDetails.setScoringCriteria(String.valueOf(learningAssessmentScore));
// stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(learningAssessmentWeight)));
// }
// if(stuScoreDetails.getLearningProjects().equals(Constant.SYSX_TCHMODULE)){
// stuScoreDetails.setScoringCriteria(String.valueOf(experimentalTrainingScore));
// stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(experimentalTrainingWeight)));
// }
// if(stuScoreDetails.getLearningProjects().equals(Constant.SYBG_TCHMODULE)){
// stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(reportWeight)));
// }
// stuScoreDetailsMapper.updateByPrimaryKey(stuScoreDetails);
Double scoreProject = scoreDetailsList.get(i).getScoreProject();
if (scoreProject==null)
{
scoreProject=0.0;
}
Double scoreWeight = scoreDetailsList.get(i).getScoreWeight();
Double mul = bigDecimalUtils.mul(scoreProject, scoreWeight);
score+=mul;
}
//将所属模块总成绩添加到学生表
StuUser stuUser = stuUserMapper.selectByPrimaryKey(userId);
// if (module.equals(Constant.five_G)) {
// stuUser.setFiveScore(BigDecimal.valueOf(score));
// }
// if (module.equals(Constant.ARTIFICIAL_INTELLIGENCE)) {
// stuUser.setArtificialIntelligenceScore(BigDecimal.valueOf(score));
// }
// if (module.equals(Constant.BIG_DATA)) {
// stuUser.setBigDataScore(BigDecimal.valueOf(score));
// }
// if (module.equals(Constant.CLOUD_COMPUTING)) {
// stuUser.setCloudComputeScore(BigDecimal.valueOf(score));
// }
// if (module.equals(Constant.INTERNET_OF_THINGS)) {
// stuUser.setInternetOfThingsSocre(BigDecimal.valueOf(score));
// }
// if (module.equals(Constant.VIRTUAL_REALITY)) {
// stuUser.setVirtualRealitySocre(BigDecimal.valueOf(score));
// }
// if (module.equals(Constant.INDUSTRIAL_INTERNET)) {
// stuUser.setIndustrialInternetSocre(BigDecimal.valueOf(score));
// }
// if (module.equals(Constant.DIGITAL_TRADE)) {
// stuUser.setDigitalTradeScore(BigDecimal.valueOf(score));
// }
// if (module.equals(Constant.DIGITAL_FINANCE)) {
// stuUser.setDigitalFinanceScore(BigDecimal.valueOf(score));
// }
// if (module.equals("碳金融")) {
// stuUser.setDigitalGoverSocre(BigDecimal.valueOf(score));
// }
if (score!=0) {
stuUser.setResultsOfPracticalCaseStudies(BigDecimal.valueOf(score));
}
stuUserMapper.updateByPrimaryKey(stuUser);
// //更新数据价值化和数字产业化成绩和产业数字化和数字治理化成绩
// Double mul;
// StuUser stuUser1 = stuUserMapper.selectByPrimaryKey(userId);
// if(module.equals(Constant.DIGITAL_TRADE)||module.equals(Constant.DIGITAL_FINANCE)){
// BigDecimal digitalTradeScore = stuUser1.getDigitalTradeScore();
// BigDecimal digitalFinanceScore = stuUser1.getDigitalFinanceScore();
//
// String mul1 = bigDecimalUtils.mul(String.valueOf(digitalTradeScore),String.valueOf(0.5),2);
// String mul2 = bigDecimalUtils.mul(String.valueOf(digitalFinanceScore), String.valueOf(0.5),2);
// mul=Double.parseDouble(mul1)+Double.parseDouble(mul2);
// stuUser1.setIndustryDigitalScore(BigDecimal.valueOf(mul));
//
// }
// if(module.equals(Constant.five_G)||module.equals(Constant.ARTIFICIAL_INTELLIGENCE)||module.equals(Constant.BIG_DATA)||
// module.equals(Constant.CLOUD_COMPUTING)|| module.equals(Constant.INTERNET_OF_THINGS)||
// module.equals(Constant.VIRTUAL_REALITY)||module.equals(Constant.INDUSTRIAL_INTERNET)) {
// BigDecimal fiveScore = stuUser1.getFiveScore();
// BigDecimal artificialIntelligenceScore = stuUser1.getArtificialIntelligenceScore();
// BigDecimal bigDataScore = stuUser1.getBigDataScore();
// BigDecimal cloudComputeScore = stuUser1.getCloudComputeScore();
// BigDecimal internetOfThingsSocre = stuUser1.getInternetOfThingsSocre();
// BigDecimal virtualRealitySocre = stuUser1.getVirtualRealitySocre();
// BigDecimal industrialInternetSocre = stuUser1.getIndustrialInternetSocre();
// String mul1 = bigDecimalUtils.mul(String.valueOf(fiveScore),String.valueOf(0.1),2);
// String mul2 = bigDecimalUtils.mul(String.valueOf(artificialIntelligenceScore), String.valueOf(0.3),2);
// String mul3 = bigDecimalUtils.mul(String.valueOf(bigDataScore),String.valueOf(0.2),2);
// String mul4 = bigDecimalUtils.mul(String.valueOf(cloudComputeScore), String.valueOf(0.1),2);
// String mul5 = bigDecimalUtils.mul(String.valueOf(internetOfThingsSocre),String.valueOf(0.1),2);
// String mul6 = bigDecimalUtils.mul(String.valueOf(virtualRealitySocre),String.valueOf(0.1),2);
// String mul7 = bigDecimalUtils.mul(String.valueOf(industrialInternetSocre),String.valueOf(0.1),2);
// mul=Double.parseDouble(mul1)+Double.parseDouble(mul2)+Double.parseDouble(mul3)+Double.parseDouble(mul4)+
// Double.parseDouble(mul5)+Double.parseDouble(mul6)+Double.parseDouble(mul7);
// stuUser1.setDigitalIndustryScore(BigDecimal.valueOf(mul));
// }
// stuUserMapper.updateByPrimaryKey(stuUser1);
}
} }

@ -14,8 +14,9 @@ import com.sztzjy.trade.util.ResultEntity;
import com.sztzjy.trade.util.file.IFileUtil; import com.sztzjy.trade.util.file.IFileUtil;
import org.apache.tomcat.util.http.fileupload.FileUpload; import org.apache.tomcat.util.http.fileupload.FileUpload;
import org.bouncycastle.pqc.math.linearalgebra.RandUtils; import org.bouncycastle.pqc.math.linearalgebra.RandUtils;
import org.bytedeco.ffmpeg.global.avutil;
import org.bytedeco.javacv.FFmpegFrameGrabber; //import org.bytedeco.ffmpeg.global.avutil;
//import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -23,8 +24,11 @@ import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import ws.schild.jave.MultimediaInfo;
import ws.schild.jave.MultimediaObject;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -594,8 +598,10 @@ public class StuGoodsTradingOrderServiceImpl implements StuGoodsTradingOrderServ
//文件大小 //文件大小
long size = file.getSize(); long size = file.getSize();
//视频时长 //视频时长
Integer duration = testJavaCV(filePath + upload); Long duration = getVedioTime(new File(filePath + upload));
// //
StuVideoInfoDTO stuVideoInfoDTO = new StuVideoInfoDTO(); StuVideoInfoDTO stuVideoInfoDTO = new StuVideoInfoDTO();
@ -811,17 +817,22 @@ public class StuGoodsTradingOrderServiceImpl implements StuGoodsTradingOrderServ
// } // }
//使用JavaCV获取 /**
public Integer testJavaCV(String path) throws Exception { *
// 读取视频文件 *
FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(path); * @param file
grabber.start(); * @return
// 获取视频长度(单位:秒) */
int duration = (int) (grabber.getLengthInTime() / avutil.AV_TIME_BASE); public static Long getVedioTime(File file) {
System.out.println("Video duration: " + duration + " seconds"); try {
grabber.stop(); MultimediaObject instance = new MultimediaObject(file);
MultimediaInfo result = instance.getInfo();
return duration; long ls = result.getDuration() / 1000;
return ls;
} catch (Exception e) {
e.printStackTrace();
}
return 0l;
} }
// 递归查找评论及其回复并返回所有回复的列表 // 递归查找评论及其回复并返回所有回复的列表

@ -21,7 +21,7 @@ import com.sztzjy.trade.util.ConvertUtil;
import com.sztzjy.trade.util.PageUtil; import com.sztzjy.trade.util.PageUtil;
import com.sztzjy.trade.util.ResultEntity; import com.sztzjy.trade.util.ResultEntity;
import com.sztzjy.trade.util.file.IFileUtil; import com.sztzjy.trade.util.file.IFileUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;

@ -14,7 +14,7 @@ import com.sztzjy.trade.util.PageUtil;
import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSession;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.ujmp.core.util.R;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;

@ -1,7 +1,7 @@
package com.sztzjy.trade.util; package com.sztzjy.trade.util;
import com.hankcs.hanlp.collection.sequence.SString;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.Cursor; import org.springframework.data.redis.core.Cursor;

@ -11,9 +11,9 @@ spring:
# 文件存储 # 文件存储
file: file:
type: local type: local
path: D:\home\trade path: /usr/local/tianzeProject/digitalTrade/uploadFile
url: "http://localhost:99" url: "http://118.31.7.2:218/file"
# path: /usr/local/tianzeProject/blockFinance/uploadFile
item: item:
name: trade name: trade

@ -0,0 +1,266 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.trade.mapper.StuKnowledgeSummaryMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.StuKnowledgeSummary">
<id column="summary_id" jdbcType="VARCHAR" property="summaryId" />
<result column="directory_id" jdbcType="VARCHAR" property="directoryId" />
<result column="directory_name" jdbcType="VARCHAR" property="directoryName" />
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
<result column="summary_content" jdbcType="VARCHAR" property="summaryContent" />
<result column="module" jdbcType="VARCHAR" property="module" />
<result column="reading_time" jdbcType="TIMESTAMP" property="readingTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
summary_id, directory_id, directory_name, parent_id, summary_content, module, reading_time
</sql>
<select id="selectByExample" parameterType="com.sztzjy.trade.entity.StuKnowledgeSummaryExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_knowledge_summary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from stu_knowledge_summary
where summary_id = #{summaryId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from stu_knowledge_summary
where summary_id = #{summaryId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.StuKnowledgeSummaryExample">
delete from stu_knowledge_summary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuKnowledgeSummary">
insert into stu_knowledge_summary (summary_id, directory_id, directory_name,
parent_id, summary_content, module,
reading_time)
values (#{summaryId,jdbcType=VARCHAR}, #{directoryId,jdbcType=VARCHAR}, #{directoryName,jdbcType=VARCHAR},
#{parentId,jdbcType=VARCHAR}, #{summaryContent,jdbcType=VARCHAR}, #{module,jdbcType=VARCHAR},
#{readingTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuKnowledgeSummary">
insert into stu_knowledge_summary
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="summaryId != null">
summary_id,
</if>
<if test="directoryId != null">
directory_id,
</if>
<if test="directoryName != null">
directory_name,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="summaryContent != null">
summary_content,
</if>
<if test="module != null">
module,
</if>
<if test="readingTime != null">
reading_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="summaryId != null">
#{summaryId,jdbcType=VARCHAR},
</if>
<if test="directoryId != null">
#{directoryId,jdbcType=VARCHAR},
</if>
<if test="directoryName != null">
#{directoryName,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=VARCHAR},
</if>
<if test="summaryContent != null">
#{summaryContent,jdbcType=VARCHAR},
</if>
<if test="module != null">
#{module,jdbcType=VARCHAR},
</if>
<if test="readingTime != null">
#{readingTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuKnowledgeSummaryExample" resultType="java.lang.Long">
select count(*) from stu_knowledge_summary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_knowledge_summary
<set>
<if test="record.summaryId != null">
summary_id = #{record.summaryId,jdbcType=VARCHAR},
</if>
<if test="record.directoryId != null">
directory_id = #{record.directoryId,jdbcType=VARCHAR},
</if>
<if test="record.directoryName != null">
directory_name = #{record.directoryName,jdbcType=VARCHAR},
</if>
<if test="record.parentId != null">
parent_id = #{record.parentId,jdbcType=VARCHAR},
</if>
<if test="record.summaryContent != null">
summary_content = #{record.summaryContent,jdbcType=VARCHAR},
</if>
<if test="record.module != null">
module = #{record.module,jdbcType=VARCHAR},
</if>
<if test="record.readingTime != null">
reading_time = #{record.readingTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_knowledge_summary
set summary_id = #{record.summaryId,jdbcType=VARCHAR},
directory_id = #{record.directoryId,jdbcType=VARCHAR},
directory_name = #{record.directoryName,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=VARCHAR},
summary_content = #{record.summaryContent,jdbcType=VARCHAR},
module = #{record.module,jdbcType=VARCHAR},
reading_time = #{record.readingTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.StuKnowledgeSummary">
update stu_knowledge_summary
<set>
<if test="directoryId != null">
directory_id = #{directoryId,jdbcType=VARCHAR},
</if>
<if test="directoryName != null">
directory_name = #{directoryName,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=VARCHAR},
</if>
<if test="summaryContent != null">
summary_content = #{summaryContent,jdbcType=VARCHAR},
</if>
<if test="module != null">
module = #{module,jdbcType=VARCHAR},
</if>
<if test="readingTime != null">
reading_time = #{readingTime,jdbcType=TIMESTAMP},
</if>
</set>
where summary_id = #{summaryId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.StuKnowledgeSummary">
update stu_knowledge_summary
set directory_id = #{directoryId,jdbcType=VARCHAR},
directory_name = #{directoryName,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=VARCHAR},
summary_content = #{summaryContent,jdbcType=VARCHAR},
module = #{module,jdbcType=VARCHAR},
reading_time = #{readingTime,jdbcType=TIMESTAMP}
where summary_id = #{summaryId,jdbcType=VARCHAR}
</update>
<resultMap id="KnowledgeSummaryMap" type="com.sztzjy.trade.entity.StuKnowledgeSummaryParentDto">
<id column="uid" property="uid" />
<result property="parentId" column="parentId" />
<result property="parentName" column="parentName"/>
<result property="parentSummaryContent" column="parentSummaryContent"/>
<collection property="childrenVoList" ofType="com.sztzjy.trade.entity.StuKnowledgeSummaryChildrenDto" javaType="list" >
<id column="id" property="id" />
<result property="childrenId" column="childrenId"/>
<result property="childrenName" column="childrenName"/>
<result property="childrenSummaryContent" column="childrenSummaryContent"/>
</collection>
</resultMap>
<select id="queryDirAndContext" resultMap="KnowledgeSummaryMap">
SELECT x.summary_id as uid , x.directory_id as parentId , x.directory_name as parentName, x.summary_content as parentSummaryContent
,y.summary_id as id, y.parent_id as childrenId ,y.directory_name as childrenName, y.summary_content as childrenSummaryContent
FROM stu_knowledge_summary AS x
LEFT JOIN stu_knowledge_summary AS y
ON y.parent_id = x.directory_id
WHERE x.module = #{module}
</select>
</mapper>

@ -1,25 +0,0 @@
package com.sztzjy;/**
* @author 17803
* @date 2024-08-09 8:52
*/
import org.junit.jupiter.api.Test;
/**
* @projectName: digital_trade
* @package: com.sztzjy
* @className: Tset
* @author: WangHaoBo
* @description: TODO
* @date: 2024/8/9 8:52
*/
public class Tset {
@Test
public void test(){
}
}
Loading…
Cancel
Save