liuguijing 2 years ago
commit fba6b5f0ff

@ -25,7 +25,7 @@ public class UploadUtils
public static String upload(MultipartFile file,String path) throws IOException {
String fileName = file.getOriginalFilename();
String newName = UUID.randomUUID().toString()+fileName.substring(fileName.indexOf("."));
File saveFile = new File(path+newName);
File saveFile = new File(path,newName);
if(!saveFile.getParentFile().exists()){
saveFile.getParentFile().mkdirs();
}

@ -1,11 +1,15 @@
package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.TerminalApkInfoDto;
import com.shxy.xymanager_common.entity.TerminalUpload;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.LineListModel;
import com.shxy.xymanager_common.model.TerminalApkInfoListModel;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.page.PageUtils;
@ -24,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.swing.text.html.parser.Entity;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -79,6 +84,13 @@ public class UploadServiceImpl implements UploadService {
int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize);
List<TerminalApkInfoDto> apkInfoDtoList = uploadDao.selectAll();
boolean empty = CollectionUtil.isEmpty(apkInfoDtoList);
if (empty) {
model.setList(new ArrayList<>());
} else {
List<TerminalApkInfoListModel.ApkBean> beans = BeanUtil.copyToList(apkInfoDtoList, TerminalApkInfoListModel.ApkBean.class, CopyOptions.create().ignoreCase());
model.setList(beans);
}
PageInfo pageData = PageUtils.getPageData(apkInfoDtoList);
int currentpage = pageData.getPageNum();
model.setCurrentpage(currentpage);

Loading…
Cancel
Save