修改考核成绩导出

hehai
rong.liu 4 years ago
parent b1d580117d
commit 5e070ab9f9
  1. 2
      src/main/java/com/msdw/tms/TmsApplication.java
  2. 2
      src/main/java/com/msdw/tms/api/AchievementManagementApi.java
  3. 4
      src/main/java/com/msdw/tms/controller/AchievementManagementController.java
  4. 5
      src/main/java/com/msdw/tms/dao/AchievementManagementDao.java
  5. 40
      src/main/java/com/msdw/tms/entity/request/ImportAssessmentRequest.java
  6. 2
      src/main/java/com/msdw/tms/service/AchievementManagementService.java
  7. 29
      src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java
  8. BIN
      src/main/resources/excel-template/川大成绩管理实验记录导出模板 (2).xlsx
  9. 24
      src/main/resources/mapper/tms/AchievementManagementDao.xml

@ -6,7 +6,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling//定时任务 //@EnableScheduling//定时任务
@SpringBootApplication @SpringBootApplication
public class TmsApplication extends SpringBootServletInitializer { public class TmsApplication extends SpringBootServletInitializer {

@ -64,7 +64,7 @@ public interface AchievementManagementApi {
@ApiParam(value = "每页显示数据量", required = true) Integer size); @ApiParam(value = "每页显示数据量", required = true) Integer size);
@ApiOperation(value = "班级实验成绩导出", notes = "班级实验成绩导出") @ApiOperation(value = "班级实验成绩导出", notes = "班级实验成绩导出")
void exportAchievement(HttpServletResponse response, @ApiParam(value = "实验记录集合recordId(此处为ids字符串(1,2,3))") String ids) throws Exception; void exportAchievement(HttpServletResponse response, @ApiParam(value = "实验记录集合recordId(此处为ids字符串(1,2,3))") String ids, @ApiParam(value = "来源(1.练习2.考核)") Integer source) throws Exception;
@ApiOperation(value = "成绩管理列表", notes = "成绩管理列表筛选查询") @ApiOperation(value = "成绩管理列表", notes = "成绩管理列表筛选查询")
R queryAchievement(@ApiParam(value = "平台id", required = false) Integer systemId, R queryAchievement(@ApiParam(value = "平台id", required = false) Integer systemId,

@ -229,8 +229,8 @@ public class AchievementManagementController implements AchievementManagementApi
*/ */
@Override @Override
@GetMapping("/exportAchievement") @GetMapping("/exportAchievement")
public void exportAchievement(HttpServletResponse response, @RequestParam String ids) throws Exception { public void exportAchievement(HttpServletResponse response, @RequestParam String ids, @RequestParam Integer source) throws Exception {
service.exportAchievement(response, ids);//SearchAchievementVo vo service.exportAchievement(response, ids,source);//SearchAchievementVo vo
} }
//成绩管理列表 //成绩管理列表

@ -8,6 +8,7 @@ import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.ReportEntity; import com.msdw.tms.entity.ReportEntity;
import com.msdw.tms.entity.ResultsEntity; import com.msdw.tms.entity.ResultsEntity;
import com.msdw.tms.entity.request.AchievementImportRequest; import com.msdw.tms.entity.request.AchievementImportRequest;
import com.msdw.tms.entity.request.ImportAssessmentRequest;
import com.msdw.tms.entity.vo.AchievementManagementVO; import com.msdw.tms.entity.vo.AchievementManagementVO;
import com.msdw.tms.entity.vo.JudgmentPointsRuleVO; import com.msdw.tms.entity.vo.JudgmentPointsRuleVO;
import com.msdw.tms.entity.vo.ResultsVo; import com.msdw.tms.entity.vo.ResultsVo;
@ -51,8 +52,12 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
IPage<AchievementManagementVO> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId); IPage<AchievementManagementVO> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId);
//导出练习
List<AchievementImportRequest> queryAchievement(@Param("ids") List<Integer> ids); List<AchievementImportRequest> queryAchievement(@Param("ids") List<Integer> ids);
//导出考核
List<ImportAssessmentRequest> queryAchievementByAssessment(Integer id);
List<AchievementManagementVO> queryFictitiousRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month, List<Integer> projectIds); List<AchievementManagementVO> queryFictitiousRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month, List<Integer> projectIds);
List<AchievementManagementVO> queryEducationRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month, List<Integer> projectIds); List<AchievementManagementVO> queryEducationRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month, List<Integer> projectIds);

@ -0,0 +1,40 @@
package com.msdw.tms.entity.request;
import com.msdw.tms.common.utils.poi.ExcelAttribute;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 班级实验成绩导出模板数据
*/
@Data
@Accessors(chain = true)
public class ImportAssessmentRequest {
//学校
@ExcelAttribute(sort = 0)
private String schoolName;
//考核名称
@ExcelAttribute(sort = 1)
private String experimentalName;
//学生姓名
@ExcelAttribute(sort = 2)
private String userName;
//学号
@ExcelAttribute(sort = 3)
private String workNumber;
//分数
@ExcelAttribute(sort = 4)
private String score;
//提交时间
@ExcelAttribute(sort = 5)
private String submitTime;
}

@ -36,7 +36,7 @@ public interface AchievementManagementService extends IService<ExperimentalRepor
R queryEvaluationReport(String searchContant, Integer projectId, Integer page, Integer size); R queryEvaluationReport(String searchContant, Integer projectId, Integer page, Integer size);
void exportAchievement(HttpServletResponse response, String vo) throws Exception; void exportAchievement(HttpServletResponse response, String vo, Integer source) throws Exception;
R queryAchievement(Integer systemId, Integer projectPermissions, String searchContant, String startingtime, String endtime, Integer month); R queryAchievement(Integer systemId, Integer projectPermissions, String searchContant, String startingtime, String endtime, Integer month);

@ -13,6 +13,7 @@ import com.msdw.tms.dao.ProjectRecordDao;
import com.msdw.tms.dao.UserInfoDao; import com.msdw.tms.dao.UserInfoDao;
import com.msdw.tms.entity.*; import com.msdw.tms.entity.*;
import com.msdw.tms.entity.request.AchievementImportRequest; import com.msdw.tms.entity.request.AchievementImportRequest;
import com.msdw.tms.entity.request.ImportAssessmentRequest;
import com.msdw.tms.entity.vo.AchievementManagementVO; import com.msdw.tms.entity.vo.AchievementManagementVO;
import com.msdw.tms.entity.vo.JudgmentPointsRuleVO; import com.msdw.tms.entity.vo.JudgmentPointsRuleVO;
import com.msdw.tms.entity.vo.ResultsVo; import com.msdw.tms.entity.vo.ResultsVo;
@ -209,23 +210,43 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
} }
@Override @Override
public void exportAchievement(HttpServletResponse response, String ids) throws Exception { public void exportAchievement(HttpServletResponse response, String ids, Integer source) throws Exception {
//1.获取数据
List<Integer> list = new ArrayList<>(); List<Integer> list = new ArrayList<>();
String[] split = ids.split(","); String[] split = ids.split(",");
for (int i = 0; i < split.length; i++) { for (int i = 0; i < split.length; i++) {
list.add(Integer.parseInt(split[i])); list.add(Integer.parseInt(split[i]));
} }
switch (source) {
case 1:
//1.获取数据
List<AchievementImportRequest> achievement = achievementManagementDao.queryAchievement(list); List<AchievementImportRequest> achievement = achievementManagementDao.queryAchievement(list);
//2.加载模板流数据 //2.加载模板流数据
ClassPathResource resource = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板 (1).xlsx"); ClassPathResource resource = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板 (1).xlsx");
InputStream inputStream = resource.getInputStream(); InputStream inputStream = resource.getInputStream();
//3、通过工具类下载文件 //3、通过工具类下载文件
new ExcelExportUtil(AchievementImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). new ExcelExportUtil(AchievementImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX).
export(response, inputStream, achievement, "班级实验成绩.xlsx"); export(response, inputStream, achievement, "班级实验成绩.xlsx");
break;
case 2:
//1.获取数据
Integer id = Integer.valueOf(list.get(0));
List<ImportAssessmentRequest> assessment = achievementManagementDao.queryAchievementByAssessment(id);
//2.加载模板流数据
ClassPathResource resource1 = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板 (2).xlsx");
InputStream inputStream1 = resource1.getInputStream();
//3、通过工具类下载文件
new ExcelExportUtil(ImportAssessmentRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX).
export(response, inputStream1, assessment, "班级实验成绩.xlsx");
break;
default:
return;
}
} }
@Override @Override

@ -236,6 +236,30 @@
tcr.reportId tcr.reportId
ORDER BY tpr.submitTime DESC ORDER BY tpr.submitTime DESC
</select> </select>
<select id="queryAchievementByAssessment" resultType="com.msdw.tms.entity.request.ImportAssessmentRequest"
parameterType="java.lang.Integer">
SELECT schoolName,
experimental_class_name,
userName,
workNumber,
r.score,
r.recordId,
report.reportId,
r.submitTime,
stu.studentId,
t.id AS projectId,
experimental_name AS experimentalName
FROM tms_experimental_teaching t
INNER JOIN tms_experimental_report report ON report.projectId = t.id
INNER JOIN tms_project_record r ON r.recordId = report.eventId
INNER JOIN hr_user_info u ON u.userId = r.userId
INNER JOIN school s ON s.schoolId = u.schoolId
INNER JOIN student stu ON stu.userId = u.userId
WHERE t.id = #{id}
AND report.isdel = 0
</select>
<select id="queryFictitiousRecord" resultType="com.msdw.tms.entity.vo.AchievementManagementVO"> <select id="queryFictitiousRecord" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT SELECT
hpm.projectName, hpm.projectName,

Loading…
Cancel
Save