|
|
@@ -1,18 +1,24 @@
|
|
|
package com.fdkankan.scene.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
+import com.fdkankan.common.constant.TbStatus;
|
|
|
import com.fdkankan.common.constant.UploadFilePath;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
+import com.fdkankan.common.response.ResultData;
|
|
|
import com.fdkankan.common.user.SSOLoginHelper;
|
|
|
import com.fdkankan.common.user.SSOUser;
|
|
|
import com.fdkankan.common.util.BASE64DecodedMultipartFile;
|
|
|
import com.fdkankan.common.util.FileUtil;
|
|
|
import com.fdkankan.fyun.oss.UploadToOssUtil;
|
|
|
+import com.fdkankan.scene.entity.ScenePro;
|
|
|
import com.fdkankan.scene.entity.SceneUpload;
|
|
|
import com.fdkankan.scene.mapper.ISceneUploadMapper;
|
|
|
+import com.fdkankan.scene.service.ISceneProService;
|
|
|
import com.fdkankan.scene.service.ISceneUploadService;
|
|
|
+import com.fdkankan.scene.vo.DeleteFileParamVO;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
@@ -73,6 +79,22 @@ public class SceneUploadServiceImpl extends ServiceImpl<ISceneUploadMapper, Scen
|
|
|
return this.uploadFiles(fileName,blzType,multipartFiles,sceneCode,type,userId);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ResultData delete(DeleteFileParamVO param) throws Exception {
|
|
|
+
|
|
|
+ String key = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum()) + param.getFileName();
|
|
|
+ uploadToOssUtil.delete(key);
|
|
|
+
|
|
|
+ this.update(new LambdaUpdateWrapper<SceneUpload>()
|
|
|
+ .set(SceneUpload::getTbStatus, TbStatus.DELETE.code())
|
|
|
+ .eq(SceneUpload::getNum, param.getNum())
|
|
|
+ .eq(SceneUpload::getBizType, param.getBizType())
|
|
|
+ .eq(SceneUpload::getFilePath, key)
|
|
|
+ .eq(SceneUpload::getTbStatus, TbStatus.VALID.code()));
|
|
|
+
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
+
|
|
|
public String uploadFiles(String sendFileName,String bizType,List<MultipartFile> files, String sceneCode, Integer type,Long userId) throws Exception{
|
|
|
if (StringUtils.isEmpty(sceneCode) || files == null || files.size() <= 0 || StringUtils.isEmpty(bizType)) {
|
|
|
throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
|