|
@@ -4,10 +4,13 @@ import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.io.FileUtils;
|
|
|
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportExcelRespVO;
|
|
|
import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportExcelVO;
|
|
|
+import cn.iocoder.yudao.module.as.dal.dataobject.financialaidretirementlist.FinancialAidRetirementListDO;
|
|
|
import cn.iocoder.yudao.module.as.service.aidingstudentsimportlist.AidingStudentsImportListService;
|
|
|
import cn.iocoder.yudao.module.as.service.aidingstudentsimportlist.AidingStudentsImportListServiceImpl;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import org.apache.tomcat.util.http.fileupload.FileItem;
|
|
|
import org.apache.tomcat.util.http.fileupload.IOUtils;
|
|
|
import org.apache.tomcat.util.http.fileupload.disk.DiskFileItemFactory;
|
|
@@ -57,79 +60,6 @@ public class AidingStudentsManageServiceImpl implements AidingStudentsManageServ
|
|
|
aidingStudentsManageMapper.insert(aidingStudentsManage);
|
|
|
//改变状态
|
|
|
aidingStudentsManage.setDiStatus(0);
|
|
|
-
|
|
|
- //解析excel
|
|
|
-
|
|
|
- //创建temp.xlsx
|
|
|
- /*String path = this.getClass().getResource("").getPath();//注意getResource("")里面是空字符串
|
|
|
- String path1=path+"importexcel";
|
|
|
- try {
|
|
|
- File dir = new File(path1);
|
|
|
- if(!dir.exists()){
|
|
|
- dir.mkdirs();//创建目录
|
|
|
- }
|
|
|
- File f = new File(path1,"temp.xlsx");
|
|
|
- f.deleteOnExit();
|
|
|
- if(!f.exists()){
|
|
|
- f.createNewFile();
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //从url读取出文件到已创建的文件中
|
|
|
- /*URL website = null;
|
|
|
- ReadableByteChannel rbc = null;
|
|
|
- FileOutputStream fos = null;
|
|
|
- try {
|
|
|
- website = new URL(aidingStudentsManage.getDiImportListFile());
|
|
|
- rbc = Channels.newChannel(website.openStream());
|
|
|
- fos = new FileOutputStream(path1+"/temp.xlsx");//本地要存储的文件地址 例如:test.txt
|
|
|
- fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }finally{
|
|
|
- if(fos!=null){
|
|
|
- try {
|
|
|
- fos.close();
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- if(rbc!=null){
|
|
|
- try {
|
|
|
- rbc.close();
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //导入名单
|
|
|
- /*File file = new File(path1+"/temp.xlsx");
|
|
|
- AidingStudentsImportExcelRespVO aidingStudentsImportExcelRespVO=null;
|
|
|
- try {
|
|
|
- MultipartFile cMultiFile = new MockMultipartFile("file", file.getName(), null, new FileInputStream(file));
|
|
|
- List<AidingStudentsImportExcelVO> list = ExcelUtils.read(cMultiFile, AidingStudentsImportExcelVO.class);
|
|
|
- aidingStudentsImportExcelRespVO = aidingStudentsImportListService.aidingStudentsImportExcelListFromCloud(aidingStudentsManage.getId(), list);
|
|
|
-
|
|
|
- } catch (IOException e) {
|
|
|
- throw exception(AIDING_STUDENTS_IMPORT_LIST_FILE_IMPORT_ERROR);
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // 删除excel文件
|
|
|
- //file.deleteOnExit();
|
|
|
-
|
|
|
-
|
|
|
// 返回
|
|
|
return excelResolver(aidingStudentsManage.getDiImportListFile(), aidingStudentsManage.getId());
|
|
|
}
|
|
@@ -262,4 +192,11 @@ public class AidingStudentsManageServiceImpl implements AidingStudentsManageServ
|
|
|
}
|
|
|
return aidingStudentsManageMapper.selectBatchIds(ids);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<AidingStudentsManageDO> getAllManagetList() {
|
|
|
+ return aidingStudentsManageMapper.selectList(
|
|
|
+ new LambdaQueryWrapperX<AidingStudentsManageDO>().orderByDesc(AidingStudentsManageDO::getCreateTime)
|
|
|
+ ) ;
|
|
|
+ }
|
|
|
}
|