From d3b5456d99922d8aab850c5378ba0a96a3ae99e6 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Tue, 25 May 2021 16:31:33 +0800 Subject: [PATCH] 20210525 申诉 --- src/main/java/com/xcong/excoin/common/system/dto/Base64UploadFilesDto.java | 18 +++++++++ src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java | 7 +-- src/main/java/com/xcong/excoin/modules/otc/dto/OrderApealDto.java | 6 ++- src/main/java/com/xcong/excoin/common/system/controller/CommonController.java | 25 ++++++++++++ src/main/java/com/xcong/excoin/common/system/vo/Base64UploadFilesVo.java | 14 +++++++ 5 files changed, 63 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/xcong/excoin/common/system/controller/CommonController.java b/src/main/java/com/xcong/excoin/common/system/controller/CommonController.java index 04f19af..bca5a3c 100644 --- a/src/main/java/com/xcong/excoin/common/system/controller/CommonController.java +++ b/src/main/java/com/xcong/excoin/common/system/controller/CommonController.java @@ -1,12 +1,15 @@ package com.xcong.excoin.common.system.controller; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.xcong.excoin.common.contants.AppContants; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.common.system.bean.SysExceptionDetailEntity; import com.xcong.excoin.common.system.dto.Base64UploadDto; +import com.xcong.excoin.common.system.dto.Base64UploadFilesDto; import com.xcong.excoin.common.system.service.CommonService; +import com.xcong.excoin.common.system.vo.Base64UploadFilesVo; import com.xcong.excoin.configurations.properties.AliOssProperties; import com.xcong.excoin.modules.blackchain.service.TrxUsdtUpdateService; import com.xcong.excoin.modules.platform.dao.SysExceptionDetailDao; @@ -31,6 +34,7 @@ import javax.annotation.Resource; import java.math.BigDecimal; import java.math.BigInteger; +import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -116,6 +120,27 @@ return Result.fail(MessageSourceUtils.getString("uploadFile_controller_0001")); } + @ApiOperation(value = "多文件上次接口", notes = "多文件上次接口") + @PostMapping(value = "/uploadFilesBase64") + public Result uploadFilesBase64(@RequestBody @Validated Base64UploadFilesDto uploadDtos) { + Base64UploadFilesVo base64UploadFilesVo = new Base64UploadFilesVo(); + ArrayList<String> urls = new ArrayList<>(); + if(CollUtil.isNotEmpty(uploadDtos.getBase64Str())){ + for(String uploadDto : uploadDtos.getBase64Str()){ + String imageName = "uploadeFile/image/" + System.currentTimeMillis() + IdUtil.simpleUUID() + AppContants.UPLOAD_IMAGE_SUFFIX; + boolean flag = OssUtils.uploadFileWithBase64(uploadDto, imageName); + if (flag) { + String url = aliOssProperties.getBucketName() + "/" + imageName; + urls.add(url); + }else{ + return Result.fail(MessageSourceUtils.getString("uploadFile_controller_0001")); + } + } + base64UploadFilesVo.setUrls(urls); + } + return Result.ok(MessageSourceUtils.getString("result_success_msg"), base64UploadFilesVo); + } + @Autowired private TrxUsdtUpdateService trxUsdtUpdateService; diff --git a/src/main/java/com/xcong/excoin/common/system/dto/Base64UploadFilesDto.java b/src/main/java/com/xcong/excoin/common/system/dto/Base64UploadFilesDto.java new file mode 100644 index 0000000..d8b3021 --- /dev/null +++ b/src/main/java/com/xcong/excoin/common/system/dto/Base64UploadFilesDto.java @@ -0,0 +1,18 @@ +package com.xcong.excoin.common.system.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.List; + +@Data +@ApiModel(value = "Base64UploadFilesDto", description = "base64文件上传参数类") +public class Base64UploadFilesDto { + + @NotBlank + @ApiModelProperty(value = "base64字符串") + public List<String> base64Str; + +} diff --git a/src/main/java/com/xcong/excoin/common/system/vo/Base64UploadFilesVo.java b/src/main/java/com/xcong/excoin/common/system/vo/Base64UploadFilesVo.java new file mode 100644 index 0000000..7750f97 --- /dev/null +++ b/src/main/java/com/xcong/excoin/common/system/vo/Base64UploadFilesVo.java @@ -0,0 +1,14 @@ +package com.xcong.excoin.common.system.vo; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.util.List; + +@Data +@ApiModel(value = "Base64UploadFilesVo", description = "返回类") +public class Base64UploadFilesVo { + + private List<String> urls; + +} diff --git a/src/main/java/com/xcong/excoin/modules/otc/dto/OrderApealDto.java b/src/main/java/com/xcong/excoin/modules/otc/dto/OrderApealDto.java index c936f05..3db3ba1 100644 --- a/src/main/java/com/xcong/excoin/modules/otc/dto/OrderApealDto.java +++ b/src/main/java/com/xcong/excoin/modules/otc/dto/OrderApealDto.java @@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + @Data @ApiModel(value = "OrderApealDto", description = "参数接收类") public class OrderApealDto { @@ -20,7 +22,7 @@ /** * 申诉内容 */ - @ApiModelProperty(value = "申诉内容", example = "1") - private String content; + @ApiModelProperty(value = "申诉图片", example = "1") + private List<String> content; } diff --git a/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java b/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java index c422f84..6ba701d 100644 --- a/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java @@ -416,15 +416,12 @@ if(StrUtil.isEmpty(reason)){ return Result.fail("请填写申诉原因"); } - String content = orderApealDto.getContent(); - if(StrUtil.isEmpty(content)){ - return Result.fail("请填写申诉内容"); - } + List<String> content = orderApealDto.getContent(); OtcOrderAppeal otcOrderAppeal = new OtcOrderAppeal(); otcOrderAppeal.setMemberId(memberId); otcOrderAppeal.setOrderId(orderId); otcOrderAppeal.setReason(reason); - otcOrderAppeal.setContent(content); + otcOrderAppeal.setContent(content.toString()); otcOrderAppeal.setStatus(OtcOrderAppeal.STATUS_ONE); otcOrderAppealDao.insert(otcOrderAppeal); return Result.ok("成功"); -- Gitblit v1.9.1