xiaoyong931011
2021-05-25 d3b5456d99922d8aab850c5378ba0a96a3ae99e6
20210525  申诉
2 files added
3 files modified
70 ■■■■■ changed files
src/main/java/com/xcong/excoin/common/system/controller/CommonController.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/dto/Base64UploadFilesDto.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/vo/Base64UploadFilesVo.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/otc/dto/OrderApealDto.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java 7 ●●●● patch | view | raw | blame | history
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;
src/main/java/com/xcong/excoin/common/system/dto/Base64UploadFilesDto.java
New file
@@ -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;
}
src/main/java/com/xcong/excoin/common/system/vo/Base64UploadFilesVo.java
New file
@@ -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;
}
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;
}
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("成功");