|
|
|
@ -8,6 +8,7 @@ import com.msdw.tms.common.utils.PageUtils; |
|
|
|
|
import com.msdw.tms.common.utils.R; |
|
|
|
|
import com.msdw.tms.common.utils.poi.ExcelExportUtil; |
|
|
|
|
import com.msdw.tms.dao.ProjectRecordDao; |
|
|
|
|
import com.msdw.tms.dao.StudentDao; |
|
|
|
|
import com.msdw.tms.entity.ExperimentalReportEntity; |
|
|
|
|
import com.msdw.tms.entity.ProjectRecordEntity; |
|
|
|
|
import com.msdw.tms.entity.request.ExperimentProjectRecordImportRequest; |
|
|
|
@ -15,6 +16,7 @@ import com.msdw.tms.entity.request.ProjectRecordImportRequest; |
|
|
|
|
import com.msdw.tms.entity.resp.GetByUserRecordResp; |
|
|
|
|
import com.msdw.tms.entity.vo.ProjectRecordExportVo; |
|
|
|
|
import com.msdw.tms.entity.vo.ProjectRecordVo; |
|
|
|
|
import com.msdw.tms.entity.vo.StudentVo; |
|
|
|
|
import com.msdw.tms.service.ProjectRecordService; |
|
|
|
|
import org.apache.poi.ss.formula.functions.T; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
@ -38,6 +40,9 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj |
|
|
|
|
@Autowired |
|
|
|
|
private ProjectRecordDao baseMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private StudentDao studentDao; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public PageUtils getByKDUserRecord(Integer page, Integer size, Integer userId, Integer projectPermissions, Integer systemId) { |
|
|
|
@ -168,6 +173,8 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj |
|
|
|
|
List<ProjectRecordExportVo> projectRecordVos = this.baseMapper.getByRecordImport(projectRecord); |
|
|
|
|
// List<ProjectRecordExportVo> projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord);
|
|
|
|
|
|
|
|
|
|
StudentVo studentVo = studentDao.queryStudentDetails(userId); |
|
|
|
|
|
|
|
|
|
List<ProjectRecordImportRequest> importRequests = projectRecordVos.stream().map(project -> { |
|
|
|
|
ProjectRecordImportRequest request = new ProjectRecordImportRequest(); |
|
|
|
|
BeanUtils.copyProperties(project, request); |
|
|
|
@ -183,8 +190,8 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//3、通过工具类下载文件
|
|
|
|
|
new ExcelExportUtil(ProjectRecordImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). |
|
|
|
|
export(response, inputStream, importRequests, "练习记录.xlsx"); |
|
|
|
|
new ExcelExportUtil(ProjectRecordImportRequest.class, Constant.ROW_INDEX_REPORT, Constant.STYLE_INDEX). |
|
|
|
|
exportExpand(response, inputStream, importRequests, studentVo,"练习记录.xlsx"); |
|
|
|
|
// new ExcelExportUtil(ProjectRecordImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX).
|
|
|
|
|
// export(response, fis, importRequests, "实验报告导出.xlsx");
|
|
|
|
|
} |
|
|
|
@ -199,6 +206,8 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj |
|
|
|
|
|
|
|
|
|
List<ProjectRecordExportVo> projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord); |
|
|
|
|
|
|
|
|
|
StudentVo studentVo = studentDao.queryStudentDetails(userId); |
|
|
|
|
|
|
|
|
|
List<ExperimentProjectRecordImportRequest> importRequests = projectRecordVos.stream().map(project -> { |
|
|
|
|
ExperimentProjectRecordImportRequest request = new ExperimentProjectRecordImportRequest(); |
|
|
|
|
BeanUtils.copyProperties(project, request); |
|
|
|
@ -211,8 +220,8 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//3、通过工具类下载文件
|
|
|
|
|
new ExcelExportUtil(ExperimentProjectRecordImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). |
|
|
|
|
export(response, inputStream, importRequests, "考核记录.xlsx"); |
|
|
|
|
new ExcelExportUtil(ExperimentProjectRecordImportRequest.class, Constant.ROW_INDEX_REPORT, Constant.STYLE_INDEX). |
|
|
|
|
exportExpand(response, inputStream, importRequests,studentVo, "考核记录.xlsx"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|