@t2652009480 7 months ago
commit 9e603657eb

@ -3,12 +3,14 @@ package com.sztzjy.marketing.controller.tch;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageInfo;
import com.sztzjy.marketing.annotation.AnonymousAccess;
import com.sztzjy.marketing.entity.TchModuleWeith;
import com.sztzjy.marketing.entity.TchModuleWeithExample;
import com.sztzjy.marketing.config.security.TokenProvider;
import com.sztzjy.marketing.entity.*;
import com.sztzjy.marketing.entity.dto.StuUserDto;
import com.sztzjy.marketing.entity.tchdto.TchGeneralViewInfoDTO;
import com.sztzjy.marketing.entity.tchdto.TchGeneralViewWeightDTO;
import com.sztzjy.marketing.entity.tchdto.tchScoreViewShowDTO;
import com.sztzjy.marketing.mapper.StuPracticalTrainingReportMapper;
import com.sztzjy.marketing.mapper.StuScoreDetailsMapper;
import com.sztzjy.marketing.mapper.TchModuleWeithMapper;
import com.sztzjy.marketing.service.TchUserService;
import com.sztzjy.marketing.util.ResultEntity;
@ -38,6 +40,11 @@ public class SummaryOfGradesController {
private TchUserService userService;
@Autowired
private TchModuleWeithMapper stuModuleWeithMapper;
@Autowired
private StuPracticalTrainingReportMapper stuPracticalTrainingReportMapper;
@Autowired
private StuScoreDetailsMapper stuScoreDetailsMapper;
@PostMapping("/getGeneralViewList")
@ApiOperation("成绩总览展示 (条件查询)")
@ -51,6 +58,7 @@ public class SummaryOfGradesController {
@ApiOperation("成绩总览导出")
@GetMapping("/generalViewExport")
//@AnonymousAccess
@ -126,13 +134,25 @@ public class SummaryOfGradesController {
return new ResultEntity<>(userService.getCurrencyScoreReport(schoolId, index, size, module, name, studentId, className,keyWord));
}
@AnonymousAccess
@GetMapping("/getClassNameBySchoolId")
@ApiOperation("班级下拉框")
public ResultEntity<List<String>> getClassNameBySchoolId(@RequestParam String schoolId) {
return new ResultEntity<List<String>>(userService.getClassNameBySchoolId(schoolId));
}
/*
* @Date 2023/10/11
* *
*/
@GetMapping("/download")
@ApiOperation("下载报告")
public void download(@RequestParam Integer id, String TOKEN, HttpServletResponse response) {
TokenProvider.getJWTUser(TOKEN);
userService.download(id, response);
}
public TchModuleWeith selectBySchoolId(String schoolId) {
@ -153,5 +173,29 @@ public class SummaryOfGradesController {
}
/*
* @author xcj
* @Date 2023/10/11
*
* ID
*/
@PostMapping("/ratingAndComment")
@ApiOperation("老师输入评语和打分")
public void ratingAndComment(@RequestBody StuPracticalTrainingReport practicalTrainingReport) {
stuPracticalTrainingReportMapper.updateByPrimaryKeySelective(practicalTrainingReport);
if (practicalTrainingReport.getRating() != null) {
StuScoreDetailsExample stuScoreDetailsExample =new StuScoreDetailsExample();
stuScoreDetailsExample.createCriteria().andUserIdEqualTo(practicalTrainingReport.getUserid()).andSerialNumberEqualTo(5);
List<StuScoreDetails> stuScoreDetails = stuScoreDetailsMapper.selectByExample(stuScoreDetailsExample);
if (!stuScoreDetails.isEmpty()){
StuScoreDetails stuScoreDetails1 = stuScoreDetails.get(0);
stuScoreDetails1.setScoreProject(practicalTrainingReport.getRating());
stuScoreDetailsMapper.updateByPrimaryKey(stuScoreDetails1);
}
}
}
}

@ -1,11 +1,10 @@
package com.sztzjy.marketing.entity.dto;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
public class StuUserDto {
private String id;
private String userId;
private String name;
@ -16,13 +15,10 @@ public class StuUserDto {
private String className;
// private String schoolId;
private String reportUrl;
private Integer reportId;
private Double rating;
// private Integer reportStatus;
}

@ -2,6 +2,7 @@ package com.sztzjy.marketing.mapper;
import com.sztzjy.marketing.entity.StuPracticalTrainingReport;
import com.sztzjy.marketing.entity.StuPracticalTrainingReportExample;
import com.sztzjy.marketing.entity.dto.TchrePortPresentationDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -30,4 +31,6 @@ public interface StuPracticalTrainingReportMapper {
int updateByPrimaryKey(StuPracticalTrainingReport record);
List<String> selectReport(String userId, String schoolId);
List<TchrePortPresentationDTO> selectInfoBySchoolId(String schoolId);
}

@ -2,12 +2,12 @@ package com.sztzjy.marketing.mapper;
import com.sztzjy.marketing.entity.StuUser;
import com.sztzjy.marketing.entity.StuUserExample;
import java.util.List;
import com.sztzjy.marketing.entity.dto.StuUserDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface StuUserMapper {
long countByExample(StuUserExample example);
@ -34,6 +34,22 @@ public interface StuUserMapper {
@Select("select school_id from stu_user group by school_id")
List<String> selectSchool();
// @Select(" SELECT\n" +
// " u.user_id AS userId,\n" +
// " u.name AS name,\n" +
// " u.student_id AS studentId,\n" +
// " r.module AS module,\n" +
// " u.class_name AS className,\n" +
// " r.url AS reportUrl,\n" +
// " r.id AS reportId,\n" +
// " r.rating AS rating\n" +
// " FROM\n" +
// " stu_user u\n" +
// " JOIN\n" +
// " stu_practical_training_report r\n" +
// " ON u.user_id = r.userId \n" +
// " WHERE\n" +
// " u.school_id = #{schoolId}")
List<StuUserDto> selectByCondition(String name, String studentId, String className, String module, String keyWord, String schoolId);
List<String> getClassNameBySchoolId(String schoolId);

@ -7,6 +7,7 @@ import com.sztzjy.marketing.entity.tchdto.TchGeneralViewWeightDTO;
import com.sztzjy.marketing.entity.tchdto.tchScoreViewShowDTO;
import com.sztzjy.marketing.util.ResultEntity;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -34,4 +35,6 @@ public interface TchUserService {
PageInfo<StuUserDto> getCurrencyScoreReport(String schoolId, Integer index, Integer size, String module, String name, String studentId, String className, String keyWord);
List<String> getClassNameBySchoolId(String schoolId);
void download(Integer id, HttpServletResponse response);
}

@ -3,37 +3,33 @@ package com.sztzjy.marketing.service.impl;/**
* @date 2024-08-05 10:41
*/
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.marketing.config.ThreadPoolConfig;
import com.sztzjy.marketing.entity.*;
import com.sztzjy.marketing.entity.dto.StuUserDto;
import com.sztzjy.marketing.entity.dto.TchrePortPresentationDTO;
import com.sztzjy.marketing.entity.tchdto.TchGeneralViewInfoDTO;
import com.sztzjy.marketing.entity.tchdto.TchGeneralViewWeightDTO;
import com.sztzjy.marketing.entity.tchdto.tchScoreViewShowDTO;
import com.sztzjy.marketing.mapper.StuPracticalTrainingReportMapper;
import com.sztzjy.marketing.mapper.StuUploadImgAiMapper;
import com.sztzjy.marketing.mapper.StuUserMapper;
import com.sztzjy.marketing.mapper.TchModuleWeithMapper;
import com.sztzjy.marketing.service.TchUserService;
import com.sztzjy.marketing.util.PageUtil;
import com.sztzjy.marketing.util.ResultEntity;
import com.sztzjy.marketing.util.file.IFileUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.Assert;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@Service
public class TchUserServiceImpl implements TchUserService {
@ -44,12 +40,15 @@ public class TchUserServiceImpl implements TchUserService {
private StuUserMapper stuUserMapper;
@Autowired
ThreadPoolConfig threadPoolConfig;
private IFileUtil fileUtil;
@Autowired
private StuUploadImgAiMapper stuUploadImgAiMapper;
@Autowired
private StuPracticalTrainingReportMapper stuPracticalTrainingReportMapper;
// 成绩总览展示 (条件查询)
@Override
public PageInfo<TchGeneralViewInfoDTO> selectGeneralViewList(tchScoreViewShowDTO viewShowDTO) {
@ -135,13 +134,12 @@ public class TchUserServiceImpl implements TchUserService {
// // 更新totalRank值
for (int i = 0; i < list.size(); i++) {
list.get(i).setTotalRank(i + 1);
stuUserMapper.updateByPrimaryKeySelective(list.get(i));
}
}
/**
@ -155,8 +153,10 @@ public class TchUserServiceImpl implements TchUserService {
PageHelper.startPage(page,size);
List<TchrePortPresentationDTO> tchrePortPresentationDTOList
= stuUploadImgAiMapper.selectInfoBySchoolId(schoolId);
List<TchrePortPresentationDTO> tchrePortPresentationDTOList = stuPracticalTrainingReportMapper.selectInfoBySchoolId(schoolId);
PageInfo<TchrePortPresentationDTO> tchrePortPresentationDTOPageInfo = new PageInfo<>(tchrePortPresentationDTOList);
@ -193,4 +193,18 @@ public class TchUserServiceImpl implements TchUserService {
public List<String> getClassNameBySchoolId(String schoolId) {
return stuUserMapper.getClassNameBySchoolId(schoolId);
}
/*
* @author xcj
* @Date 2023/10/11
*
*
*/
@Override
public void download(Integer id, HttpServletResponse response) {
StuPracticalTrainingReport stuPracticalTrainingReport = stuPracticalTrainingReportMapper.selectByPrimaryKey(id);
Assert.isTrue(stuPracticalTrainingReport != null && stuPracticalTrainingReport.getUrl() != null, "报告不存在");
fileUtil.download(response, stuPracticalTrainingReport.getReportName(), stuPracticalTrainingReport.getUrl());
}
}

@ -346,4 +346,18 @@
and
school_id = #{schoolId}
</select>
<select id="selectInfoBySchoolId" resultType="com.sztzjy.marketing.entity.dto.TchrePortPresentationDTO">
select s.name as name , s.student_id as studentId, s.class_name as className,
i.module as module ,i.report_name as fileName ,i.upload_time as createTime ,i.size as fileSize,i.ascription as ascription
from stu_practical_training_report i
join
stu_user s
on
i.userId = s.user_id
where
s.school_id = #{schoolId}
order by
i.module asc
</select>
</mapper>

@ -410,15 +410,17 @@
u.student_id AS studentId,
r.module AS module,
u.class_name AS className,
r.file_path AS reportUrl,
r.url AS reportUrl,
r.id AS reportId,
r.tch_score AS rating
r.rating AS rating,
r.id as id
FROM
stu_user u
JOIN
stu_upload_img_ai r ON u.user_id = r.user_id
stu_practical_training_report r
ON u.user_id = r.userId
<where>
AND u.school_id = #{schoolId}
u.school_id = #{schoolId}
<if test="module != null">
AND r.module = #{module}
</if>
@ -436,7 +438,7 @@
</if>
</where>
ORDER BY
r.tch_score DESC
r.rating DESC
</select>
<select id="getClassNameBySchoolId" resultType="java.lang.String">
select class_name from stu_user

Loading…
Cancel
Save