导入优化
This commit is contained in:
parent
1a8cda96af
commit
d6f12f429c
|
|
@ -5,13 +5,13 @@ import com.bonus.digitalSignage.annotation.LogAnnotation;
|
||||||
import com.bonus.digitalSignage.basic.service.TbTowerService;
|
import com.bonus.digitalSignage.basic.service.TbTowerService;
|
||||||
import com.bonus.digitalSignage.basic.vo.TbTowerVo;
|
import com.bonus.digitalSignage.basic.vo.TbTowerVo;
|
||||||
import com.bonus.digitalSignage.system.vo.EncryptedReq;
|
import com.bonus.digitalSignage.system.vo.EncryptedReq;
|
||||||
|
import com.bonus.digitalSignage.system.vo.dto.FileStorageDto;
|
||||||
import com.bonus.digitalSignage.utils.ExcelUtil;
|
import com.bonus.digitalSignage.utils.ExcelUtil;
|
||||||
|
import com.bonus.digitalSignage.utils.FastJsonHelper;
|
||||||
import com.bonus.digitalSignage.utils.ServerResponse;
|
import com.bonus.digitalSignage.utils.ServerResponse;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -134,9 +134,8 @@ public class TbTowerController {
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/tbTowerImport")
|
@PostMapping(value = "/tbTowerImport")
|
||||||
@DecryptAndVerify(decryptedClass = TbTowerVo.class)
|
|
||||||
@LogAnnotation(operModul = "杆塔管理-导入", operation = "导入", operDesc = "系统级事件",operType="导入")
|
@LogAnnotation(operModul = "杆塔管理-导入", operation = "导入", operDesc = "系统级事件",operType="导入")
|
||||||
public ServerResponse tbTowerExport(MultipartFile file, TbTowerVo tbTowerVo) throws IOException {
|
public ServerResponse tbTowerExport(@RequestPart(value = "file") MultipartFile file, @RequestParam(value = "params")String params) throws IOException {
|
||||||
String fileName = file.getOriginalFilename();
|
String fileName = file.getOriginalFilename();
|
||||||
if (fileName != null) {
|
if (fileName != null) {
|
||||||
String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
|
String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||||
|
|
@ -154,6 +153,7 @@ public class TbTowerController {
|
||||||
if (tbTowerVoList.size()>3000){
|
if (tbTowerVoList.size()>3000){
|
||||||
return ServerResponse.createErroe("文件条数超过3000");
|
return ServerResponse.createErroe("文件条数超过3000");
|
||||||
}
|
}
|
||||||
|
TbTowerVo tbTowerVo = FastJsonHelper.jsonStrToBean(params, TbTowerVo.class);
|
||||||
String message = tbTowerService.tbTowerExport(tbTowerVoList, tbTowerVo);
|
String message = tbTowerService.tbTowerExport(tbTowerVoList, tbTowerVo);
|
||||||
return ServerResponse.createSuccess(message);
|
return ServerResponse.createSuccess(message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue