解决考核导出问题

hehai
rong.liu 4 years ago
parent 35f9322bb6
commit e6f8720f12
  1. 2
      src/main/java/com/msdw/tms/dao/AchievementManagementDao.java
  2. 9
      src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java
  3. 45
      src/main/resources/mapper/tms/AchievementManagementDao.xml

@ -56,7 +56,7 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
List<AchievementImportRequest> queryAchievement(@Param("ids") List<Integer> ids); List<AchievementImportRequest> queryAchievement(@Param("ids") List<Integer> ids);
//导出考核 //导出考核
List<ImportAssessmentRequest> queryAchievementByAssessment(Integer id); List<ImportAssessmentRequest> queryAchievementByAssessment(@Param("ids") List<Integer> ids);
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);

@ -247,6 +247,7 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
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]));
} }
//source 1.练习 2考核
switch (source) { switch (source) {
case 1: case 1:
//1.获取数据 //1.获取数据
@ -261,8 +262,12 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
case 2: case 2:
//1.获取数据 //1.获取数据
Integer id = Integer.valueOf(list.get(0)); /*List<ImportAssessmentRequest> assessment = null;
List<ImportAssessmentRequest> assessment = achievementManagementDao.queryAchievementByAssessment(id); for (Integer id : list) {
assessment = achievementManagementDao.queryAchievementByAssessment(id);
}*/
//Integer id = Integer.valueOf(list.get(0));
List<ImportAssessmentRequest> assessment = achievementManagementDao.queryAchievementByAssessment(list);
//2.加载模板流数据 //2.加载模板流数据
ClassPathResource resource1 = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板 (2).xlsx"); ClassPathResource resource1 = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板 (2).xlsx");

@ -239,27 +239,34 @@
</select> </select>
<select id="queryAchievementByAssessment" resultType="com.msdw.tms.entity.request.ImportAssessmentRequest" <select id="queryAchievementByAssessment" resultType="com.msdw.tms.entity.request.ImportAssessmentRequest">
parameterType="java.lang.Integer">
SELECT schoolName, SELECT schoolName,
experimental_class_name, experimental_class_name,
userName, userName,
workNumber, workNumber,
r.score, r.score,
r.recordId, r.recordId,
report.reportId, report.reportId,
r.submitTime, r.submitTime,
stu.studentId, stu.studentId,
t.id AS projectId, t.id AS projectId,
experimental_name AS experimentalName experimental_name AS experimentalName
FROM tms_experimental_teaching t FROM tms_experimental_teaching t
INNER JOIN tms_experimental_report report ON report.projectId = t.id INNER JOIN tms_experimental_report report ON report.projectId = t.id
INNER JOIN tms_project_record r ON r.recordId = report.eventId INNER JOIN tms_project_record r ON r.recordId = report.eventId
INNER JOIN hr_user_info u ON u.userId = r.userId INNER JOIN hr_user_info u ON u.userId = r.userId
INNER JOIN school s ON s.schoolId = u.schoolId INNER JOIN school s ON s.schoolId = u.schoolId
INNER JOIN student stu ON stu.userId = u.userId INNER JOIN student stu ON stu.userId = u.userId
WHERE t.id = #{id} WHERE
AND report.isdel = 0 <if test="ids.size()>0">
r.recordId IN (
<foreach collection="ids" separator="," item="recordId">
#{recordId}
</foreach>
)
</if>
AND report.isdel = 0
</select> </select>
<select id="queryFictitiousRecord" resultType="com.msdw.tms.entity.vo.AchievementManagementVO"> <select id="queryFictitiousRecord" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT SELECT

Loading…
Cancel
Save