项目集成华为obs查看波形文件
This commit is contained in:
@@ -22,5 +22,15 @@ public interface OssPath {
|
|||||||
*/
|
*/
|
||||||
String HARMONIC_EXCEL_TEMPLATE="harmonic/excel/template";
|
String HARMONIC_EXCEL_TEMPLATE="harmonic/excel/template";
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 算法模块的上传路径
|
||||||
|
*/
|
||||||
|
String ALGORITHM="algorithm/";
|
||||||
|
|
||||||
|
/***
|
||||||
|
* process模块中干扰源入网报告的上传路径
|
||||||
|
*/
|
||||||
|
String LOAD_TYPE_USER="loadTypeUser/";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -536,7 +536,7 @@ public class MinIoUtils {
|
|||||||
* @author exe.wangtaotao
|
* @author exe.wangtaotao
|
||||||
* @date 2020/10/21 15:07
|
* @date 2020/10/21 15:07
|
||||||
*/
|
*/
|
||||||
private String minFileName(String originalFileName) {
|
public String minFileName(String originalFileName) {
|
||||||
String suffix = originalFileName;
|
String suffix = originalFileName;
|
||||||
if (originalFileName.contains(SEPARATOR_DOT)) {
|
if (originalFileName.contains(SEPARATOR_DOT)) {
|
||||||
suffix = originalFileName.substring(originalFileName.lastIndexOf(SEPARATOR_DOT));
|
suffix = originalFileName.substring(originalFileName.lastIndexOf(SEPARATOR_DOT));
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.njcn.harmonic.controller.algorithm;
|
package com.njcn.harmonic.controller.algorithm;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.njcn.common.config.GeneralInfo;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.GeneralConstant;
|
||||||
|
import com.njcn.common.pojo.constant.OssPath;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
@@ -13,6 +16,7 @@ import com.njcn.harmonic.pojo.param.RStatFileVO;
|
|||||||
import com.njcn.harmonic.pojo.po.RStatFile;
|
import com.njcn.harmonic.pojo.po.RStatFile;
|
||||||
import com.njcn.harmonic.pojo.vo.PwRStatOrgVO;
|
import com.njcn.harmonic.pojo.vo.PwRStatOrgVO;
|
||||||
import com.njcn.harmonic.service.algorithm.RStatFileService;
|
import com.njcn.harmonic.service.algorithm.RStatFileService;
|
||||||
|
import com.njcn.huawei.obs.util.OBSUtil;
|
||||||
import com.njcn.minio.bo.MinIoUploadResDTO;
|
import com.njcn.minio.bo.MinIoUploadResDTO;
|
||||||
import com.njcn.minio.config.MinIoProperties;
|
import com.njcn.minio.config.MinIoProperties;
|
||||||
import com.njcn.minio.utils.MinIoUtils;
|
import com.njcn.minio.utils.MinIoUtils;
|
||||||
@@ -42,6 +46,12 @@ public class AlgorithmController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private MinIoProperties minIoProperties;
|
private MinIoProperties minIoProperties;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private GeneralInfo generalInfo;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OBSUtil obsUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 算法保存
|
* 算法保存
|
||||||
*
|
*
|
||||||
@@ -79,16 +89,19 @@ public class AlgorithmController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/common/upload")
|
@PostMapping("/common/upload")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public HttpResult<MinIoUploadResDTO> uploadFile(MultipartFile file)
|
public HttpResult<String> uploadFile(MultipartFile file) {
|
||||||
{
|
try {
|
||||||
try
|
//为2则为:华为OBS
|
||||||
{
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
|
String fileName = file.getOriginalFilename();
|
||||||
|
fileName = OssPath.ALGORITHM + minIoUtils.minFileName(fileName);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, obsUtil.multiFileUpload(file, fileName), null);
|
||||||
|
} else {
|
||||||
//把名称存入数据
|
//把名称存入数据
|
||||||
MinIoUploadResDTO upload = minIoUtils.upload(file, minIoProperties.getBucket(), "algorithm/");
|
MinIoUploadResDTO upload = minIoUtils.upload(file, minIoProperties.getBucket(), OssPath.ALGORITHM);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, upload, null);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, upload.getMinFileUrl(), null);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
} catch (Exception e) {
|
||||||
{
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, null);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import cn.hutool.json.JSONObject;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.njcn.common.config.GeneralInfo;
|
import com.njcn.common.config.GeneralInfo;
|
||||||
|
import com.njcn.common.pojo.constant.GeneralConstant;
|
||||||
|
import com.njcn.common.pojo.constant.OssPath;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
||||||
@@ -26,6 +28,7 @@ import com.njcn.harmonic.pojo.vo.ReportTemplateVO;
|
|||||||
import com.njcn.harmonic.pojo.vo.ReportTreeVO;
|
import com.njcn.harmonic.pojo.vo.ReportTreeVO;
|
||||||
import com.njcn.harmonic.pojo.vo.SysDeptTempVO;
|
import com.njcn.harmonic.pojo.vo.SysDeptTempVO;
|
||||||
import com.njcn.harmonic.service.CustomReportService;
|
import com.njcn.harmonic.service.CustomReportService;
|
||||||
|
import com.njcn.huawei.obs.util.OBSUtil;
|
||||||
import com.njcn.influxdb.config.InfluxDbConfig;
|
import com.njcn.influxdb.config.InfluxDbConfig;
|
||||||
import com.njcn.influxdb.param.InfluxDBSqlConstant;
|
import com.njcn.influxdb.param.InfluxDBSqlConstant;
|
||||||
import com.njcn.influxdb.param.InfluxDBTableConstant;
|
import com.njcn.influxdb.param.InfluxDBTableConstant;
|
||||||
@@ -98,21 +101,35 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
@Resource
|
@Resource
|
||||||
private InfluxDbConfig influxDbConfig;
|
private InfluxDbConfig influxDbConfig;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OBSUtil obsUtil;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addCustomReportTemplate(ReportTemplateParam reportTemplateParam) {
|
public boolean addCustomReportTemplate(ReportTemplateParam reportTemplateParam) {
|
||||||
checkName(reportTemplateParam, false);
|
checkName(reportTemplateParam, false);
|
||||||
|
MultipartFile fileContent = reportTemplateParam.getFileContent();
|
||||||
|
String fileName = fileContent.getName();
|
||||||
//检验模板json数据规范
|
//检验模板json数据规范
|
||||||
try {
|
try {
|
||||||
String content = MultipartFileToString(reportTemplateParam.getFileContent());
|
String content = MultipartFileToString(fileContent);
|
||||||
new JSONArray(content);
|
new JSONArray(content);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
|
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//为2则为:华为OBS
|
||||||
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
|
fileName = OssPath.HARMONIC_EXCEL_TEMPLATE + minIoUtils.minFileName(fileName);
|
||||||
|
obsUtil.multiFileUpload(fileContent,fileName);
|
||||||
|
reportTemplateParam.setContent(fileName);
|
||||||
|
} else {
|
||||||
|
//否则认为是minioss
|
||||||
//文件上传到Minio服务器,存入文件名
|
//文件上传到Minio服务器,存入文件名
|
||||||
MinIoUploadResDTO minIoUploadResDTO = contentToMinio(reportTemplateParam.getFileContent());
|
MinIoUploadResDTO minIoUploadResDTO = contentToMinio(reportTemplateParam.getFileContent(), OssPath.HARMONIC_EXCEL_TEMPLATE);
|
||||||
reportTemplateParam.setContent(minIoUploadResDTO.getMinFileName());
|
reportTemplateParam.setContent(minIoUploadResDTO.getMinFileName());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//新增模板表
|
//新增模板表
|
||||||
ExcelRptTemp excelRptTemp = new ExcelRptTemp();
|
ExcelRptTemp excelRptTemp = new ExcelRptTemp();
|
||||||
@@ -137,10 +154,11 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateCustomReportTemplate(ReportTemplateParam.UpdateReportTemplateParam reportTemplateParam) {
|
public boolean updateCustomReportTemplate(ReportTemplateParam.UpdateReportTemplateParam reportTemplateParam) {
|
||||||
checkName(reportTemplateParam, true);
|
checkName(reportTemplateParam, true);
|
||||||
|
MultipartFile fileContent = reportTemplateParam.getFileContent();
|
||||||
|
String fileName = fileContent.getName();
|
||||||
//检验模板json数据规范
|
//检验模板json数据规范
|
||||||
try {
|
try {
|
||||||
String content = MultipartFileToString(reportTemplateParam.getFileContent());
|
String content = MultipartFileToString(fileContent);
|
||||||
new JSONArray(content);
|
new JSONArray(content);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
|
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
|
||||||
@@ -148,12 +166,18 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
|
|
||||||
//删除之前的文件
|
//删除之前的文件
|
||||||
ExcelRptTemp excelRptTempOld = excelRptTempMapper.selectById(reportTemplateParam.getId());
|
ExcelRptTemp excelRptTempOld = excelRptTempMapper.selectById(reportTemplateParam.getId());
|
||||||
|
//为2则为:华为OBS
|
||||||
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
|
obsUtil.delete(excelRptTempOld.getContent());
|
||||||
|
fileName = OssPath.HARMONIC_EXCEL_TEMPLATE + minIoUtils.minFileName(fileName);
|
||||||
|
obsUtil.multiFileUpload(fileContent,fileName);
|
||||||
|
reportTemplateParam.setContent(fileName);
|
||||||
|
}else{
|
||||||
minIoUtils.removeObject(minIoProperties.getBucket(), excelRptTempOld.getContent());
|
minIoUtils.removeObject(minIoProperties.getBucket(), excelRptTempOld.getContent());
|
||||||
|
|
||||||
//文件上传到Minio服务器,存入文件名
|
//文件上传到Minio服务器,存入文件名
|
||||||
MinIoUploadResDTO minIoUploadResDTO = contentToMinio(reportTemplateParam.getFileContent());
|
MinIoUploadResDTO minIoUploadResDTO = contentToMinio(reportTemplateParam.getFileContent(), OssPath.HARMONIC_EXCEL_TEMPLATE);
|
||||||
reportTemplateParam.setContent(minIoUploadResDTO.getMinFileName());
|
reportTemplateParam.setContent(minIoUploadResDTO.getMinFileName());
|
||||||
|
}
|
||||||
//修改模板数据
|
//修改模板数据
|
||||||
ExcelRptTemp excelRptTemp = new ExcelRptTemp();
|
ExcelRptTemp excelRptTemp = new ExcelRptTemp();
|
||||||
BeanUtils.copyProperties(reportTemplateParam, excelRptTemp);
|
BeanUtils.copyProperties(reportTemplateParam, excelRptTemp);
|
||||||
@@ -462,11 +486,22 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//文件上传到Minio服务器,存入文件名
|
String newContent;
|
||||||
File newFile = stringToFile(jsonArray.toString());
|
File newFile = stringToFile(jsonArray.toString());
|
||||||
MultipartFile newMultipartFile = getMultipartFile(newFile);
|
MultipartFile newMultipartFile = getMultipartFile(newFile);
|
||||||
MinIoUploadResDTO minIoUploadResDTO = contentToMinio(newMultipartFile);
|
//为2则为:华为OBS
|
||||||
String newContent = minIoUploadResDTO.getMinFileName();
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
|
newContent = newMultipartFile.getName();
|
||||||
|
newContent = OssPath.HARMONIC_EXCEL_REPORT + minIoUtils.minFileName(newContent);
|
||||||
|
obsUtil.multiFileUpload(newMultipartFile,newContent);
|
||||||
|
}else{
|
||||||
|
//否则认为是minioss
|
||||||
|
//文件上传到Minio服务器,存入文件名
|
||||||
|
MinIoUploadResDTO minIoUploadResDTO = contentToMinio(newMultipartFile,OssPath.HARMONIC_EXCEL_REPORT);
|
||||||
|
newContent = minIoUploadResDTO.getMinFileName();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//存入报表库
|
//存入报表库
|
||||||
ExcelRpt excelRpt = new ExcelRpt();
|
ExcelRpt excelRpt = new ExcelRpt();
|
||||||
@@ -545,10 +580,10 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
* @param file 文件
|
* @param file 文件
|
||||||
* @return 成功标记
|
* @return 成功标记
|
||||||
*/
|
*/
|
||||||
private MinIoUploadResDTO contentToMinio(MultipartFile file) {
|
private MinIoUploadResDTO contentToMinio(MultipartFile file, String dir) {
|
||||||
try {
|
try {
|
||||||
//把名称存入数据
|
//把名称存入数据
|
||||||
MinIoUploadResDTO upload = minIoUtils.upload(file, minIoProperties.getBucket(), "report/");
|
MinIoUploadResDTO upload = minIoUtils.upload(file, minIoProperties.getBucket(), dir);
|
||||||
return upload;
|
return upload;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_FILE);
|
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_FILE);
|
||||||
@@ -584,7 +619,9 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
String businessTempPath = generalInfo.getBusinessTempPath();
|
String businessTempPath = generalInfo.getBusinessTempPath();
|
||||||
File distFile = new File(businessTempPath + File.separator + "temp.json");
|
File distFile = new File(businessTempPath + File.separator + "temp.json");
|
||||||
try {
|
try {
|
||||||
if (!distFile.getParentFile().exists()) distFile.getParentFile().mkdirs();
|
if (!distFile.getParentFile().exists()){
|
||||||
|
distFile.getParentFile().mkdirs();
|
||||||
|
}
|
||||||
bufferedReader = new BufferedReader(new StringReader(res));
|
bufferedReader = new BufferedReader(new StringReader(res));
|
||||||
bufferedWriter = new BufferedWriter(new FileWriter(distFile));
|
bufferedWriter = new BufferedWriter(new FileWriter(distFile));
|
||||||
bufferedWriter.write("");
|
bufferedWriter.write("");
|
||||||
|
|||||||
@@ -114,6 +114,12 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!--华为obs工具包-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>huawei-obs-springboot-starter</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -4,8 +4,12 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.config.GeneralInfo;
|
||||||
|
import com.njcn.common.pojo.constant.GeneralConstant;
|
||||||
|
import com.njcn.common.pojo.constant.OssPath;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.device.pms.api.DistributionMonitorClient;
|
import com.njcn.device.pms.api.DistributionMonitorClient;
|
||||||
|
import com.njcn.huawei.obs.util.OBSUtil;
|
||||||
import com.njcn.minio.bo.MinIoUploadResDTO;
|
import com.njcn.minio.bo.MinIoUploadResDTO;
|
||||||
import com.njcn.minio.config.MinIoProperties;
|
import com.njcn.minio.config.MinIoProperties;
|
||||||
import com.njcn.minio.utils.MinIoUtils;
|
import com.njcn.minio.utils.MinIoUtils;
|
||||||
@@ -60,11 +64,17 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
@Resource
|
@Resource
|
||||||
private MinIoUtils minIoUtils;
|
private MinIoUtils minIoUtils;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private GeneralInfo generalInfo;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OBSUtil obsUtil;
|
||||||
@Resource
|
@Resource
|
||||||
private MinIoProperties minIoProperties;
|
private MinIoProperties minIoProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 干扰源用户分页查询
|
* 干扰源用户分页查询
|
||||||
|
*
|
||||||
* @param loadTypeUserSearchParam
|
* @param loadTypeUserSearchParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -90,6 +100,7 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询干扰源用户
|
* 根据id查询干扰源用户
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -112,6 +123,7 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增干扰源用户
|
* 新增干扰源用户
|
||||||
|
*
|
||||||
* @param loadTypeUserParam
|
* @param loadTypeUserParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -130,6 +142,7 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传干扰源用户入网报告
|
* 上传干扰源用户入网报告
|
||||||
|
*
|
||||||
* @param loadTypeUserIUploadParam
|
* @param loadTypeUserIUploadParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -138,11 +151,17 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
RLoadTypeUserManage rLoadTypeUserManage = new RLoadTypeUserManage();
|
RLoadTypeUserManage rLoadTypeUserManage = new RLoadTypeUserManage();
|
||||||
BeanUtils.copyProperties(loadTypeUserIUploadParam, rLoadTypeUserManage);
|
BeanUtils.copyProperties(loadTypeUserIUploadParam, rLoadTypeUserManage);
|
||||||
|
MultipartFile multipartFile = loadTypeUserIUploadParam.getFile();
|
||||||
//文件上传到Minio服务器,存入文件名
|
//文件上传到Minio服务器,存入文件名
|
||||||
if(loadTypeUserIUploadParam.getFile() != null){
|
if (Objects.nonNull(multipartFile)) {
|
||||||
MinIoUploadResDTO minIoUploadResDTO = fileToMinio(loadTypeUserIUploadParam.getFile());
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
|
String fileName = OssPath.LOAD_TYPE_USER + minIoUtils.minFileName(multipartFile.getOriginalFilename());
|
||||||
|
obsUtil.multiFileUpload(multipartFile, fileName);
|
||||||
|
rLoadTypeUserManage.setIFilePath(fileName);
|
||||||
|
} else {
|
||||||
|
MinIoUploadResDTO minIoUploadResDTO = fileToMinio(loadTypeUserIUploadParam.getFile(), OssPath.LOAD_TYPE_USER);
|
||||||
rLoadTypeUserManage.setIFilePath(minIoUploadResDTO.getMinFileName());
|
rLoadTypeUserManage.setIFilePath(minIoUploadResDTO.getMinFileName());
|
||||||
|
}
|
||||||
rLoadTypeUserManage.setIUploadTime(new Date());
|
rLoadTypeUserManage.setIUploadTime(new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,6 +181,7 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联营销用户
|
* 关联营销用户
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -176,6 +196,7 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有干扰源用户(与营销系统关联)
|
* 查询所有干扰源用户(与营销系统关联)
|
||||||
|
*
|
||||||
* @param loadTypeUserSearchParam
|
* @param loadTypeUserSearchParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -205,10 +226,10 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
* @param file 文件
|
* @param file 文件
|
||||||
* @return 成功标记
|
* @return 成功标记
|
||||||
*/
|
*/
|
||||||
private MinIoUploadResDTO fileToMinio(MultipartFile file) {
|
private MinIoUploadResDTO fileToMinio(MultipartFile file, String dir) {
|
||||||
try {
|
try {
|
||||||
//把名称存入数据
|
//把名称存入数据
|
||||||
MinIoUploadResDTO upload = minIoUtils.upload(file, minIoProperties.getBucket(), "loadTypeUser/");
|
MinIoUploadResDTO upload = minIoUtils.upload(file, minIoProperties.getBucket(), dir);
|
||||||
return upload;
|
return upload;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(ProcessResponseEnum.UPLOAD_FILE_ERROR);
|
throw new BusinessException(ProcessResponseEnum.UPLOAD_FILE_ERROR);
|
||||||
@@ -217,6 +238,7 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传干扰源用户入网报告
|
* 上传干扰源用户入网报告
|
||||||
|
*
|
||||||
* @param loadTypeUserAUploadParam
|
* @param loadTypeUserAUploadParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -225,11 +247,17 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
RLoadTypeUserManage rLoadTypeUserManage = new RLoadTypeUserManage();
|
RLoadTypeUserManage rLoadTypeUserManage = new RLoadTypeUserManage();
|
||||||
BeanUtils.copyProperties(loadTypeUserAUploadParam, rLoadTypeUserManage);
|
BeanUtils.copyProperties(loadTypeUserAUploadParam, rLoadTypeUserManage);
|
||||||
|
MultipartFile multipartFile = loadTypeUserAUploadParam.getFile();
|
||||||
//文件上传到Minio服务器,存入文件名
|
//文件上传到文件服务器,存入文件名
|
||||||
if(loadTypeUserAUploadParam.getFile() != null){
|
if (Objects.nonNull(multipartFile)) {
|
||||||
MinIoUploadResDTO minIoUploadResDTO = fileToMinio(loadTypeUserAUploadParam.getFile());
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
|
String fileName = OssPath.LOAD_TYPE_USER + minIoUtils.minFileName(multipartFile.getOriginalFilename());
|
||||||
|
obsUtil.multiFileUpload(multipartFile, fileName);
|
||||||
|
rLoadTypeUserManage.setIFilePath(fileName);
|
||||||
|
} else {
|
||||||
|
MinIoUploadResDTO minIoUploadResDTO = fileToMinio(loadTypeUserAUploadParam.getFile(), OssPath.LOAD_TYPE_USER);
|
||||||
rLoadTypeUserManage.setAFilePath(minIoUploadResDTO.getMinFileName());
|
rLoadTypeUserManage.setAFilePath(minIoUploadResDTO.getMinFileName());
|
||||||
|
}
|
||||||
rLoadTypeUserManage.setAUploadTime(new Date());
|
rLoadTypeUserManage.setAUploadTime(new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,6 +276,7 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出未建档干扰源用户管理信息
|
* 导出未建档干扰源用户管理信息
|
||||||
|
*
|
||||||
* @param list
|
* @param list
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -300,6 +329,7 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出干扰源用户常态化管理信息
|
* 导出干扰源用户常态化管理信息
|
||||||
|
*
|
||||||
* @param list
|
* @param list
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user