|
@@ -10,6 +10,7 @@ import java.util.*;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
+import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
@@ -27,6 +28,7 @@ import com.fs.common.utils.ip.IpUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
|
+import com.fs.core.config.WxMaConfiguration;
|
|
|
import com.fs.core.config.WxPayProperties;
|
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
|
import com.fs.his.config.FsSysConfig;
|
|
@@ -50,6 +52,8 @@ import com.fs.huifuPay.domain.HuiFuCreateOrder;
|
|
|
import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
|
import com.fs.system.domain.SysConfig;
|
|
|
+import com.fs.system.oss.CloudStorageService;
|
|
|
+import com.fs.system.oss.OSSFactory;
|
|
|
import com.fs.ybPay.domain.CreateWxOrderResult;
|
|
|
import com.fs.ybPay.domain.OrderResult;
|
|
|
import com.fs.ybPay.dto.OrderQueryDTO;
|
|
@@ -70,6 +74,7 @@ import com.github.binarywang.wxpay.exception.WxPayException;
|
|
|
import com.github.binarywang.wxpay.service.WxPayService;
|
|
|
import com.google.common.reflect.TypeToken;
|
|
|
import com.google.gson.Gson;
|
|
|
+import me.chanjar.weixin.common.error.WxErrorException;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -1536,4 +1541,42 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
|
|
|
return R.error("创建失败");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R getWxaCodePackageOrderUnLimit(Long orderId) {
|
|
|
+ FsSysConfig sysConfig = configUtil.getSysConfig();
|
|
|
+
|
|
|
+ final WxMaService wxMaService = WxMaConfiguration.getMaService(sysConfig.getAppid());
|
|
|
+ String scene="orderId="+ orderId ;
|
|
|
+ byte[] file;
|
|
|
+ try {
|
|
|
+ file = wxMaService.getQrcodeService().createWxaCodeUnlimitBytes(
|
|
|
+ scene,
|
|
|
+ "pages_order/packagePayment",
|
|
|
+ true,
|
|
|
+ "release",
|
|
|
+ 430,
|
|
|
+ true,
|
|
|
+ null,
|
|
|
+ false);
|
|
|
+
|
|
|
+ // 上传图片到存储桶
|
|
|
+ String suffix = ".png";
|
|
|
+ CloudStorageService storage = OSSFactory.build();
|
|
|
+ String url;
|
|
|
+ try {
|
|
|
+ url = storage.uploadSuffix(file, suffix);
|
|
|
+ } catch (Exception e) {
|
|
|
+ // 记录错误日志
|
|
|
+ logger.error("生成图片失败:{}",e.getMessage(),e);
|
|
|
+ return R.error("生成图片失败");
|
|
|
+ }
|
|
|
+ // 返回成功信息
|
|
|
+ return R.ok().put("url",url);
|
|
|
+
|
|
|
+ } catch (WxErrorException e) {
|
|
|
+ logger.error(e.getMessage(), e);
|
|
|
+ return R.error("微信接口调用失败: " + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|