From 5efe117950919045943bfb987ae839c20739a4bc Mon Sep 17 00:00:00 2001 From: zyy <121611808@qq.com> Date: Mon, 2 Nov 2020 14:48:36 +0800 Subject: [PATCH] up --- .../com/bsd/cases/controller/CaseUserController.java | 10 ++++++---- .../bsd/cases/service/impl/CaseUsersServiceImpl.java | 12 ++++++------ src/main/resources/application-production.yml | 5 +++++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/bsd/cases/controller/CaseUserController.java b/src/main/java/com/bsd/cases/controller/CaseUserController.java index d657056..58f4726 100644 --- a/src/main/java/com/bsd/cases/controller/CaseUserController.java +++ b/src/main/java/com/bsd/cases/controller/CaseUserController.java @@ -4,11 +4,13 @@ import com.alibaba.fastjson.JSONObject; import com.bsd.cases.model.CaseUsers; import com.bsd.cases.service.CaseUsersService; import com.bsd.cases.util.AjaxResult; +import com.bsd.cases.util.FileUtils; import com.bsd.cases.util.PageAjax; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.shiro.authz.annotation.RequiresAuthentication; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -20,8 +22,8 @@ public class CaseUserController { @Resource private CaseUsersService caseUsersService; -// @Value("${upload.path}") -// private String uploadPath; + @Value("${upload.path}") + private String uploadPath; @ApiOperation(value = "用户列表PC", notes = "用户列表PC") @ApiImplicitParams({ @@ -159,8 +161,8 @@ public class CaseUserController { String fileName = file.getOriginalFilename(); AjaxResult ajaxResult = new AjaxResult(); try { -// FileUtils.uploadFile(file.getBytes(), uploadPath, fileName); -// caseUsersService.saveUserList(uploadPath, fileName); + FileUtils.uploadFile(file.getBytes(), uploadPath, fileName); + caseUsersService.saveUserList(uploadPath, fileName); ajaxResult.setRetcode(AjaxResult.SUCCESS); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/com/bsd/cases/service/impl/CaseUsersServiceImpl.java b/src/main/java/com/bsd/cases/service/impl/CaseUsersServiceImpl.java index f9a6641..34be1b0 100644 --- a/src/main/java/com/bsd/cases/service/impl/CaseUsersServiceImpl.java +++ b/src/main/java/com/bsd/cases/service/impl/CaseUsersServiceImpl.java @@ -478,12 +478,12 @@ public class CaseUsersServiceImpl implements CaseUsersService { String storeName = row.getCell(7).getStringCellValue(); importPO.setStoreName(storeName); } - if (row.getCell(8) != null) { - - row.getCell(8).setCellType(CellType.STRING); - String areaName = row.getCell(8).getStringCellValue(); - importPO.setAreaName(areaName); - } +// if (row.getCell(8) != null) { +// +// row.getCell(8).setCellType(CellType.STRING); +// String areaName = row.getCell(8).getStringCellValue(); +// importPO.setAreaName(areaName); +// } importPOList.add(importPO); } diff --git a/src/main/resources/application-production.yml b/src/main/resources/application-production.yml index 16ccb1d..3285bab 100644 --- a/src/main/resources/application-production.yml +++ b/src/main/resources/application-production.yml @@ -50,6 +50,11 @@ pagehelper: reasonable: true support-methods-arguments: true params: count=countSql +upload: + path: /tmp/upload/ + +export: + path: /tmp/export/ wx: BASE_URI: https://api.weixin.qq.com