互动讨论、实验实训

main
@t2652009480 3 months ago
parent 8d6e82477f
commit c07fbd5b12

@ -16,10 +16,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
@ -52,7 +49,7 @@ public class StuAcademicRecordController {
}
@ApiOperation("项目成绩导出")
@PostMapping("/export")
@GetMapping("/export")
@AnonymousAccess
public void export(HttpServletResponse response,
@ApiParam("用户ID") String userId) {

@ -1,6 +1,7 @@
package com.sztzjy.trade.controller.stu;
import com.sztzjy.trade.annotation.AnonymousAccess;
import com.sztzjy.trade.entity.StuServerResourcesInfo;
import com.sztzjy.trade.entity.dto.UserSelectThreeDTO;
import com.sztzjy.trade.service.StuCloudComputingTrainingService;
import com.sztzjy.trade.util.ResultEntity;
@ -33,4 +34,12 @@ public class StuCloudComputingTrainingController {
stuCloudComputingTrainingService.userSelect(userSelectThreeDTOS);
return new ResultEntity<>(HttpStatus.OK,"成功");
}
@ApiOperation("一、软件安装部署阶段--服务器资源列表查看")
@PostMapping("/serverResourcesView")
@AnonymousAccess
public ResultEntity<List<StuServerResourcesInfo>> serverResourcesView(String userId){
List<StuServerResourcesInfo> stuSiteResourcesInfos=stuCloudComputingTrainingService.serverResourcesView(userId);
return new ResultEntity<>(HttpStatus.OK,"成功",stuSiteResourcesInfos);
}
}

@ -3,6 +3,7 @@ package com.sztzjy.trade.controller.stu;
import com.alibaba.fastjson.JSONObject;
import com.sztzjy.trade.annotation.AnonymousAccess;
import com.sztzjy.trade.entity.StuHashSignatureResource;
import com.sztzjy.trade.entity.StuScoreDetails;
import com.sztzjy.trade.entity.dto.StuHashOnlineCalculationDTO;
import com.sztzjy.trade.service.StuConceptHashTrainingService;
import com.sztzjy.trade.util.ResultDataEntity;
@ -117,4 +118,13 @@ public class StuConceptHashTrainingController {
return new ResultDataEntity<>(HttpStatus.OK,"删除失败",delete);
}
}
@PostMapping("/HashTrainingOnlineCalculation")
@ApiOperation("哈希函数加密在线计算")
public ResultDataEntity<StuScoreDetails> HashTrainingOnlineCalculation(@RequestBody JSONObject jsonObject) {
StuHashOnlineCalculationDTO onlineCalculation = jsonObject.getObject("StuHashOnlineCalculationDTO", StuHashOnlineCalculationDTO.class);
StuHashOnlineCalculationDTO stuHashOnlineCalculationDTO = stuConceptHashTrainingService.HashTrainingOnlineCalculation(onlineCalculation);
return new ResultDataEntity(HttpStatus.OK,stuHashOnlineCalculationDTO);
}
}

@ -128,6 +128,17 @@ public class StuDTFController {
}
@ApiOperation("跨境货币转换申请查看")
@PostMapping("/getCurrencyConversion")
@AnonymousAccess
public ResultEntity getCurrencyConversion(String userId) {
return new ResultEntity<>(HttpStatus.OK,"成功",dtfService.getCurrencyConversion(userId));
}
@ApiOperation("发起申请")
@PostMapping("/initiateApply")
@AnonymousAccess
@ -140,6 +151,17 @@ public class StuDTFController {
}
@ApiOperation("跨境货币多边桥业务查看")
@PostMapping("/getMultilateralBridgeBusiness")
@AnonymousAccess
public ResultEntity getMultilateralBridgeBusiness(String userId) {
return new ResultEntity<>(HttpStatus.OK,"成功",dtfService.getMultilateralBridgeBusiness(userId));
}
@ApiOperation("步骤一:接收/注销/反馈")
@PostMapping("/operation")
@AnonymousAccess

@ -1,16 +1,17 @@
package com.sztzjy.trade.controller.stu;
import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.annotation.AnonymousAccess;
import com.sztzjy.trade.entity.StuAchievementInfo;
import com.sztzjy.trade.entity.TchHomeworkManage;
import com.sztzjy.trade.entity.dto.StuAchievementInfoDTO;
import com.sztzjy.trade.entity.dto.SubmitExamPapersDTO;
import com.sztzjy.trade.mapper.StuAchievementInfoMapper;
import com.sztzjy.trade.service.StuHomeworkExamService;
import com.sztzjy.trade.util.ResultEntity;
import com.sztzjy.trade.util.file.IFileUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.*;
import io.swagger.v3.oas.annotations.media.Schema;
import org.checkerframework.checker.units.qual.A;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
@ -40,10 +41,10 @@ public class StuHomeworkExamController {
@ApiOperation("查询作业列表")
@PostMapping("/getHomeworks")
@AnonymousAccess
public ResultEntity getHomeworks(@ApiParam("用户ID") String userId,
@ApiParam("作业类型") String homeworkType) {
public ResultEntity<PageInfo<StuAchievementInfoDTO>> getHomeworks(@ApiParam("用户ID") String userId,
@ApiParam("作业类型") String homeworkType, Integer index, Integer size) {
return new ResultEntity<>(HttpStatus.OK,"成功",homeworkExamService.getHomeworks(userId,homeworkType));
return new ResultEntity<>(homeworkExamService.getHomeworks(userId,homeworkType,index,size));
}

@ -3,7 +3,10 @@ package com.sztzjy.trade.entity;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
/**
*
*
@ -60,9 +63,13 @@ public class StuAchievementInfo {
private String homeworkAnnex;
@ApiModelProperty(notes = "作业起始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date startingTime;
@ApiModelProperty(notes = "作业终止时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date endTime;
@ApiModelProperty(notes = "教师评语")

@ -0,0 +1,82 @@
package com.sztzjy.trade.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author tz
* @date 2025/1/3 11:48
*/
@Data
public class StuAchievementInfoDTO {
@ApiModelProperty(notes = "成绩ID")
private String id;
@ApiModelProperty(notes = "姓名")
private String name;
@ApiModelProperty(notes = "学号")
private String studentId;
@ApiModelProperty(notes = "班级名称")
private String className;
@ApiModelProperty(notes = "得分")
private BigDecimal score;
@ApiModelProperty(notes = "完成用时")
private String completionTime;
@ApiModelProperty(notes = "答对数量")
private Integer answerNumber;
@ApiModelProperty(notes = "答错数量")
private Integer answerIncorrectlyNumber;
@ApiModelProperty(notes = "正确率")
private String accuracy;
@ApiModelProperty(notes = "成绩来源(考试/作业名称)")
private String scoreGrades;
@ApiModelProperty(notes = "用户ID")
private String userId;
@ApiModelProperty(notes = "作业/考试ID")
private String taskId;
@ApiModelProperty(notes = "平均得分")
private BigDecimal averageScore;
@ApiModelProperty(notes = "状态")
private String state;
@ApiModelProperty(notes = "及格率")
private BigDecimal passRate;
@ApiModelProperty(notes = "作业附件URL")
private String homeworkAnnex;
@ApiModelProperty(notes = "作业起始时间")
private Date startingTime;
@ApiModelProperty(notes = "作业终止时间")
private Date endTime;
@ApiModelProperty(notes = "教师评语")
private String teacherComments;
@ApiModelProperty(notes = "本次作答次数")
private Integer numberOfAnswer;
@ApiModelProperty(notes = "题数总量")
private Integer totalQuestions;
@ApiModelProperty(notes = "学生提交作业附件URL")
private String stuHomeworkAnnex;
}

@ -1,5 +1,6 @@
package com.sztzjy.trade.service;
import com.sztzjy.trade.entity.StuServerResourcesInfo;
import com.sztzjy.trade.entity.dto.UserSelectThreeDTO;
import java.util.List;
@ -10,4 +11,6 @@ import java.util.List;
*/
public interface StuCloudComputingTrainingService {
void userSelect(List<UserSelectThreeDTO> userSelectThreeDTOS);
List<StuServerResourcesInfo> serverResourcesView(String userId);
}

@ -62,4 +62,7 @@ public interface StuDTFService {
void initiateTransfer(String amountCollected, String userId,String type);
List<StuCrossBorderConversion> getCurrencyConversion(String userId);
List<StuMultilateralBridge> getMultilateralBridgeBusiness(String userId);
}

@ -1,11 +1,9 @@
package com.sztzjy.trade.service;
import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.entity.StuAchievementInfo;
import com.sztzjy.trade.entity.StuScoreDetailsInfo;
import com.sztzjy.trade.entity.dto.AttachmentHomeworkDTO;
import com.sztzjy.trade.entity.dto.StuScoreDetailsInfoDTO;
import com.sztzjy.trade.entity.dto.StuTopicDTO;
import com.sztzjy.trade.entity.dto.SubmitExamPapersDTO;
import com.sztzjy.trade.entity.dto.*;
import java.util.List;
@ -14,7 +12,7 @@ import java.util.List;
* @date 2024/9/10 15:18
*/
public interface StuHomeworkExamService {
List<StuAchievementInfo> getHomeworks(String userId,String homeworkType);
PageInfo<StuAchievementInfoDTO> getHomeworks(String userId, String homeworkType, Integer index, Integer size);
List<StuTopicDTO> getTopics(String id);

@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.UUID;
/**
* @author tz
@ -196,4 +197,71 @@ public class StuCloudComputingTrainingServiceImpl implements StuCloudComputingTr
}
}
}
@Override
public List<StuServerResourcesInfo> serverResourcesView(String userId) {
StuServerResourcesInfoExample example=new StuServerResourcesInfoExample();
example.createCriteria().andUserIdEqualTo(userId);
List<StuServerResourcesInfo> stuServerResourcesInfos = stuServerResourcesInfoMapper.selectByExample(example);
if(stuServerResourcesInfos.isEmpty()){
StuServerResourcesInfoExample stuServerResourcesInfoExample=new StuServerResourcesInfoExample();
stuServerResourcesInfoExample.createCriteria().andUserIdIsNull();
List<StuServerResourcesInfo> stuServerResourcesInfoList = stuServerResourcesInfoMapper.selectByExample(stuServerResourcesInfoExample);
int a=0;
for (int i = 0; i < stuServerResourcesInfoList.size(); i++) {
if(stuServerResourcesInfoList.get(i).getServerAffiliation().equals("云部署")){
if(stuServerResourcesInfoList.get(i).getId()==4){
stuServerResourcesInfoList.get(i).setDataOrder(1);
}
if(stuServerResourcesInfoList.get(i).getId()==5){
stuServerResourcesInfoList.get(i).setDataOrder(2);
}
if(stuServerResourcesInfoList.get(i).getId()==6){
stuServerResourcesInfoList.get(i).setDataOrder(3);
}
}
Integer uuid = UUID.randomUUID().toString().replaceAll("-", "").hashCode();
uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空
stuServerResourcesInfoList.get(i).setId(uuid);
stuServerResourcesInfoList.get(i).setUserId(userId);
stuServerResourcesInfoList.get(i).setUserSelected(0);
stuServerResourcesInfoList.get(i).setPaymentMode(0);
//添加用户数据
stuServerResourcesInfoMapper.insert(stuServerResourcesInfoList.get(i));
stuServerResourcesInfos.add(stuServerResourcesInfoList.get(i));
}
}
// PriceDTO priceDTO=null;
// List<StuServerResourcesInfoDTO> list=new ArrayList<>();;
// for (int i = 0; i < stuServerResourcesInfoDTOS.size(); i++) {
// priceDTO=new PriceDTO();
// StuServerResourcesInfoDTO stuServerResourcesInfoDTO = stuServerResourcesInfoDTOS.get(i);
// if(stuServerResourcesInfoDTO.getServerAffiliation().equals("本地部署")){
// list.add(stuServerResourcesInfoDTO);
// }else {
// String price = stuServerResourcesInfoDTO.getPrice();
// String[] split = price.split(",");
// for (int j = 0; j < split.length; j++) {
// if(Pattern.compile("时").matcher(split[j]).find()){ //价格是按时付费
// priceDTO.setMoneyHour(split[j]);
// }
// if(Pattern.compile("月").matcher(split[j]).find()){ //价格是按月付费
// priceDTO.setMoneyMonthly(split[j]);
// }
// if(Pattern.compile("一年").matcher(split[j]).find()){ //价格是按一年付费
// priceDTO.setMoneyYear(split[j]);
// }
// if(Pattern.compile("三年").matcher(split[j]).find()){ //价格是按三年付费
// priceDTO.setMoneyThreeYears(split[j]);
// }
// }
// stuServerResourcesInfoDTO.setPriceDTO(priceDTO);
// stuServerResourcesInfoDTO.setPrice(null);
// list.add(stuServerResourcesInfoDTO);
// }
// }
return stuServerResourcesInfos;
}
}

@ -119,7 +119,7 @@ public class StuDTFServiceImpl implements StuDTFService {
// 获取一个数字格式化实例
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
String formattedNumber = numberFormat.format(replace);
String formattedNumber = numberFormat.format(Integer.valueOf(replace));
stuCommercialBank.setExchangeAmount(formattedNumber);
stuCommercialBank.setApplicationTime(new Date());
@ -208,8 +208,8 @@ public class StuDTFServiceImpl implements StuDTFService {
// 获取一个数字格式化实例
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
String walletBalance = numberFormat.format(add);
String accountBalance = numberFormat.format(sub);
String walletBalance = numberFormat.format(Integer.valueOf(add.toString()));
String accountBalance = numberFormat.format(Integer.valueOf(sub.toString()));
enterprises.setWalletBalance(walletBalance);
enterprises.setAccountBalance(accountBalance);
@ -239,7 +239,8 @@ public class StuDTFServiceImpl implements StuDTFService {
throw new ServiceException(HttpStatus.ACCEPTED,"收款企业错误");
}
String trim = collectionAccount.trim();
if(!trim.equals("6222020200001234567")){
String replace1 = trim.replace(" ", "");
if(!replace1.equals("6222020200001234567")){
throw new ServiceException(HttpStatus.ACCEPTED,"收款账号错误");
}
@ -263,7 +264,7 @@ public class StuDTFServiceImpl implements StuDTFService {
// 获取一个数字格式化实例
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
String formattedNumber = numberFormat.format(replace);
String formattedNumber = numberFormat.format(Integer.valueOf(replace));
borderConversion.setTransferAmount(formattedNumber);
borderConversion.setReceivingBank(receivingBank);
@ -787,6 +788,20 @@ public class StuDTFServiceImpl implements StuDTFService {
}
@Override
public List<StuCrossBorderConversion> getCurrencyConversion(String userId) {
StuCrossBorderConversionExample example=new StuCrossBorderConversionExample();
example.createCriteria().andUserIdEqualTo(userId);
return crossBorderConversionMapper.selectByExample(example);
}
@Override
public List<StuMultilateralBridge> getMultilateralBridgeBusiness(String userId) {
StuMultilateralBridgeExample example=new StuMultilateralBridgeExample();
example.createCriteria().andUserIdEqualTo(userId);
return multilateralBridgeMapper.selectByExample(example);
}
}

@ -1,21 +1,21 @@
package com.sztzjy.trade.service.impl;
import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.config.exception.handler.ServiceException;
import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.entity.dto.AttachmentHomeworkDTO;
import com.sztzjy.trade.entity.dto.StuScoreDetailsInfoDTO;
import com.sztzjy.trade.entity.dto.StuTopicDTO;
import com.sztzjy.trade.entity.dto.SubmitExamPapersDTO;
import com.sztzjy.trade.entity.dto.*;
import com.sztzjy.trade.mapper.*;
import com.sztzjy.trade.service.StuHomeworkExamService;
import com.sztzjy.trade.util.BigDecimalUtils;
import com.sztzjy.trade.util.ConvertUtil;
import com.sztzjy.trade.util.PageUtil;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
@ -44,7 +44,7 @@ public class StuHomeworkExamServiceImpl implements StuHomeworkExamService {
@Resource
BigDecimalUtils bigDecimalUtils;
@Override
public List<StuAchievementInfo> getHomeworks(String userId,String homeworkType) {
public PageInfo getHomeworks(String userId, String homeworkType, Integer index, Integer size) {
//查询学生班级
StuUser stuUser = stuUserMapper.selectByPrimaryKey(userId);
@ -59,8 +59,7 @@ public class StuHomeworkExamServiceImpl implements StuHomeworkExamService {
//再循环得出该学生本次作业是否已有记录
List<StuAchievementInfo> list=new ArrayList<>();
for (TchHomeworkManage tchHomeworkManage : tchHomeworkManages) {
//取到本次作业的题目总量
String[] split = tchHomeworkManage.getTopicId().split(",");
StuAchievementInfoExample achievementInfoExample=new StuAchievementInfoExample();
@ -83,7 +82,13 @@ public class StuHomeworkExamServiceImpl implements StuHomeworkExamService {
achievementInfo.setStartingTime(tchHomeworkManage.getStartingTime());
achievementInfo.setEndTime(tchHomeworkManage.getEndTime());
achievementInfo.setNumberOfAnswer(0);
achievementInfo.setTotalQuestions(split.length);
//取到本次作业的题目总量
if (!tchHomeworkManage.getHomeworkType().equals("附件作业")){
String[] split = tchHomeworkManage.getTopicId().split(",");
achievementInfo.setTotalQuestions(split.length);
}
achievementInfoMapper.insert(achievementInfo);
@ -92,8 +97,9 @@ public class StuHomeworkExamServiceImpl implements StuHomeworkExamService {
list.add(stuAchievementInfos.get(0));
}
}
List<StuAchievementInfoDTO> stuAchievementInfoDTOS = convertUtil.entityToDTOList(list, StuAchievementInfoDTO.class);
return list;
return PageUtil.pageHelper(stuAchievementInfoDTOS,index,size);
}
@Override
@ -106,16 +112,17 @@ public class StuHomeworkExamServiceImpl implements StuHomeworkExamService {
Date startingTime = achievementInfo.getStartingTime();
Date endTime = achievementInfo.getEndTime();
// 定义时间格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime parse = LocalDateTime.parse(startingTime.toString(), formatter);
LocalDateTime parse1 = LocalDateTime.parse(endTime.toString(), formatter);
// 将 Date 转换为 LocalDateTime
LocalDateTime startLocalDateTime = LocalDateTime.ofInstant(startingTime.toInstant(), ZoneId.systemDefault());
LocalDateTime endLocalDateTime = LocalDateTime.ofInstant(endTime.toInstant(), ZoneId.systemDefault());
//判断本次作业是否已过期
//获取当前时间
// 判断本次作业是否已过期
// 获取当前时间
LocalDateTime now = LocalDateTime.now();
if(!now.isAfter(parse) && now.isBefore(parse1)){
throw new ServiceException(HttpStatus.ACCEPTED,"当前时间不在题目操作的时间段!");
// 检查当前时间是否在作业时间段内
if (now.isBefore(startLocalDateTime) || now.isAfter(endLocalDateTime)) {
throw new ServiceException(HttpStatus.ACCEPTED, "当前时间不在题目操作的时间段!");
}
//判断是否已达到最大做题次数

@ -295,7 +295,7 @@ public class TchInteractionImpl implements TchInteractionService {
public List<StuUser> getStuList(String className) {
StuUserExample userExample=new StuUserExample();
StuUserExample.Criteria criteria = userExample.createCriteria();
if(!className.isEmpty()){
if(className!=null){
criteria.andClassNameEqualTo(className);
}
return stuUserMapper.selectByExample(userExample);

@ -569,7 +569,7 @@
</select>
<select id="selectTopicsById" resultType="com.sztzjy.trade.entity.StuLearningAssessment" resultMap="BaseResultMap">
select * from stu_learning_assessment
WHERE id IN
WHERE topic_id IN
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>

Loading…
Cancel
Save