KKSU
2024-05-15 d35d562b6e743f4eff9480f7a1ecbee890deb438
测试环境
2 files modified
50 ■■■■ changed files
src/main/java/cc/mrbird/febs/mall/controller/AdminMallOrderController.java 8 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/pay/service/impl/XcxPayServiceImpl.java 42 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/controller/AdminMallOrderController.java
@@ -38,6 +38,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -541,6 +542,11 @@
        return null;
    }
    // 文件保存目录URL
    @Value("${static.resource.path}")
    private String resourcePath;
    @PostMapping(value = "/importDeliver")
    @ControllerEndpoint(operation = "导入发货", exceptionMessage = "导入失败")
    public FebsResponse importDeliver(@RequestBody MultipartFile file) throws IOException {
@@ -549,7 +555,7 @@
        }
        String fileName = file.getOriginalFilename();
        String dirPath = "/home/javaweb/webresource/blnka/";
        String dirPath = resourcePath;
        File saveFile = new File(new File(dirPath).getAbsolutePath() + File.separator + fileName);
        if (!saveFile.exists()) {
src/main/java/cc/mrbird/febs/pay/service/impl/XcxPayServiceImpl.java
@@ -33,6 +33,7 @@
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@@ -51,21 +52,17 @@
@RequiredArgsConstructor
public class XcxPayServiceImpl implements IXcxPayService {
    @Autowired
    private MallOrderInfoMapper mallOrderInfoMapper;
    @Autowired
    private MallMemberMapper mallMemberMapper;
    @Autowired
    WeixinServiceUtil weixinServiceUtil;
    @Autowired
    private DataDictionaryCustomMapper dataDictionaryCustomMapper;
    @Autowired
    private MallMoneyFlowMapper mallMoneyFlowMapper;
    @Autowired
    private MallMemberWithdrawMapper mallMemberWithdrawMapper;
    private final MallOrderInfoMapper mallOrderInfoMapper;
    private final MallMemberMapper mallMemberMapper;
    private final WeixinServiceUtil weixinServiceUtil;
    private final DataDictionaryCustomMapper dataDictionaryCustomMapper;
    private final MallMoneyFlowMapper mallMoneyFlowMapper;
    private final MallMemberWithdrawMapper mallMemberWithdrawMapper;
    private final IMallMoneyFlowService mallMoneyFlowService;
    @Autowired
    RedisUtils redisUtils;
    private final MallGoodsMapper mallGoodsMapper;
    private final MallTeamLeaderMapper mallTeamLeaderMapper;
    private final RedisUtils redisUtils;
    private final SpringContextHolder springContextHolder;
@@ -290,11 +287,6 @@
        return wxTemplates;
    }
    @Autowired
    private MallGoodsMapper mallGoodsMapper;
    @Autowired
    private MallTeamLeaderMapper mallTeamLeaderMapper;
    @Override
    public FebsResponse generateQrCode(WxGenerateQrCodeDto wxGenerateQrCodeDto) {
        Integer type = wxGenerateQrCodeDto.getType();
@@ -411,11 +403,15 @@
     * @param imgName  图片唯一名称
     * @return
     */
    //图片上传路径
    public  static  final String IMG_UPLOAD_PATH="/mnt/sdc/webresource/blnka/wxcode";
    // 文件保存目录路径
    @Value("${static.resource.url}")
    private String resourceUrl;
    // 文件保存目录URL
    @Value("${static.resource.path}")
    private String resourcePath;
    public  String generateAcode(String scene,String path,String imgName,String width, Integer type){
        String urlPrefix="https://file.blnka.cn/blnka/wxcode";
        String imgPath=IMG_UPLOAD_PATH+imgName;
        String urlPrefix = resourceUrl + "/wxcode";
        String imgPath=resourcePath +"/wxcode"+imgName;
        if(!FileUtil.exist(imgPath)){
            cn.hutool.json.JSONObject obj = JSONUtil.createObj();