|
@@ -86,13 +86,18 @@ public class SaleClueInfoServiceImpl implements ISaleClueInfoService {
|
|
|
* Return com.ruixuan.common.core.domain.ResultResponse
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResultResponse importSaleExcelOrCsv(MultipartFile file, int salesLeadsType, Long uploadDate, Long createUserId) throws Exception{
|
|
|
+ public ResultResponse importSaleExcelOrCsv(MultipartFile file, int salesLeadsType, Long uploadDate, Long createUserId){
|
|
|
|
|
|
List<Map<String,String>> dataList = new ArrayList<>();
|
|
|
|
|
|
//文件类型
|
|
|
String fileType = FileTypeUtils.gerFileTypeXlsOrCsv(file);
|
|
|
|
|
|
+ try {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (StringUtils.equals("excel",fileType)){
|
|
|
//读取Excel
|
|
|
EasyExcel.read(file.getInputStream(),null,
|
|
@@ -114,6 +119,16 @@ public class SaleClueInfoServiceImpl implements ISaleClueInfoService {
|
|
|
ImportExcelListener.importDataList.clear();
|
|
|
ImportExcelListener.importHeadList.clear();
|
|
|
|
|
|
+ }catch (Exception e){
|
|
|
+ //excel 清除监听数据
|
|
|
+ ImportExcelListener.importDataList.clear();
|
|
|
+ ImportExcelListener.importHeadList.clear();
|
|
|
+ e.printStackTrace();
|
|
|
+ log.error("上传文件出现了问题。",e.toString());
|
|
|
+ return ResultResponse.error(e.toString());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
return ResultResponse.successMsg("保存成功",null);
|
|
|
}
|
|
|
|