Pārlūkot izejas kodu

微信支付基础

wangwl 2 nedēļas atpakaļ
vecāks
revīzija
e3f8b7f3ba
19 mainītis faili ar 224 papildinājumiem un 48 dzēšanām
  1. 16 0
      leromro-admin/src/main/java/com/leromro/web/controller/system/SysLoginController.java
  2. 1 1
      leromro-admin/src/main/java/com/leromro/web/controller/system/SysUserController.java
  3. 0 0
      leromro-admin/src/main/resources/apiclient_cert.p12
  4. 21 9
      leromro-admin/src/main/resources/application.yml
  5. 6 1
      leromro-common/pom.xml
  6. 30 0
      leromro-common/src/main/java/com/leromro/common/core/domain/entity/SysUser.java
  7. 3 3
      leromro-core/src/main/java/com/leromro/core/controller/OrdersController.java
  8. 33 0
      leromro-core/src/main/java/com/leromro/core/domain/vo/OrderPaymentVO.java
  9. 1 1
      leromro-core/src/main/java/com/leromro/core/mapper/VolunteerInfoMapper.java
  10. 3 1
      leromro-core/src/main/java/com/leromro/core/service/IMainOrderService.java
  11. 10 3
      leromro-core/src/main/java/com/leromro/core/service/impl/MainOrderServiceImpl.java
  12. 1 1
      leromro-core/src/main/java/com/leromro/core/service/impl/VolunteerInfoServiceImpl.java
  13. 7 18
      leromro-core/src/main/resources/mapper/core/VolunteerInfoMapper.xml
  14. 55 0
      leromro-framework/src/main/java/com/leromro/framework/config/WxPayConfig.java
  15. 3 4
      leromro-common/src/main/java/com/leromro/common/config/WeiXinConfig.java
  16. 21 0
      leromro-framework/src/main/java/com/leromro/framework/config/properties/WxPayProperties.java
  17. 1 1
      leromro-framework/src/main/java/com/leromro/framework/interceptor/ListPermissionInterceptor.java
  18. 5 5
      leromro-framework/src/main/java/com/leromro/framework/web/service/SysLoginService.java
  19. 7 0
      pom.xml

+ 16 - 0
leromro-admin/src/main/java/com/leromro/web/controller/system/SysLoginController.java

@@ -3,9 +3,12 @@ package com.leromro.web.controller.system;
 import java.util.List;
 import java.util.Set;
 
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.leromro.core.service.IClientAccountService;
 import com.leromro.core.service.IVolunteerAccountService;
 import com.leromro.system.service.ISysUserService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -28,6 +31,7 @@ import com.leromro.system.service.ISysMenuService;
  * @author ruoyi
  */
 @Slf4j
+@Api(tags = "登录验证")
 @RestController
 public class SysLoginController
 {
@@ -134,4 +138,16 @@ public class SysLoginController
         }
         return AjaxResult.success();
     }
+
+    /**
+     * 修改当前用户定位
+     */
+    @ApiOperation("修改当前用户定位")
+    @PostMapping("/setUserLocation")
+    public AjaxResult setUserOrWorker(@RequestBody SysUser user){
+        Long userId = SecurityUtils.getUserId();
+        user.setUserId(userId);
+        userService.updateById(user);
+        return AjaxResult.success();
+    }
 }

+ 1 - 1
leromro-admin/src/main/java/com/leromro/web/controller/system/SysUserController.java

@@ -62,7 +62,7 @@ public class SysUserController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/list")
-    public TableDataInfo list(SysUser user)
+    public TableDataInfo<SysUser> list(SysUser user)
     {
         startPage();
         List<SysUser> list = userService.selectUserList(user);

+ 0 - 0
leromro-admin/src/main/resources/apiclient_cert.p12


+ 21 - 9
leromro-admin/src/main/resources/application.yml

@@ -151,13 +151,25 @@ xss:
   excludes: /system/notice
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*
+
 wx:
-  url: https://api.weixin.qq.com
-#  app-id: wxf8cc1f7fffc41354
-#  secret: 36a6c5c2148e1c16a33a59279fed0378
-  # 乐融融
-  app-id: wxe8a05852410396cf
-  secret: ea6531db3d1a1d816343c41604642fea
-# 建均
-#  app-id: wxed3f482559db6196
-#  secret: 998ba63b56683bbabf52c0b9f8433a1a
+  #微信开发者配置
+  dev:
+    url: https://api.weixin.qq.com
+    app-id: wxe8a05852410396cf
+    secret: ea6531db3d1a1d816343c41604642fea
+  #微信支付配置
+  pay:
+    #微信开放平台申请的移动应用ID
+    app-id: wxe8a05852410396cf
+    #商户id
+    mch-id: 1715022116
+    #商户商户APIv2密钥
+    mch-key: ff353bc0f3d64584be5bfac9203b7777
+    tradeType: JSAPI
+    #商户证书,用于退款
+    key-path: classpath:apiclient_cert.p12
+    #支付回调通知地址。必填项 这里真是域名地址即可
+    notify-url: http://3ef93dfa.r10.vip.cpolar.cn/pay/payNotify
+    #退款回调通知地址
+    refundNotifyUrl: http://3ef93dfa.r10.vip.cpolar.cn/pay/refundNotify

+ 6 - 1
leromro-common/pom.xml

@@ -157,7 +157,6 @@
             <artifactId>aliyun-sdk-oss</artifactId>
         </dependency>
 
-
         <dependency>
             <groupId>io.minio</groupId>
             <artifactId>minio</artifactId>
@@ -173,6 +172,12 @@
             <artifactId>tea-openapi</artifactId>
         </dependency>
 
+        <!--        微信支付工具-->
+        <dependency>
+            <groupId>com.github.binarywang</groupId>
+            <artifactId>weixin-java-pay</artifactId>
+        </dependency>
+
 
 
     </dependencies>

+ 30 - 0
leromro-common/src/main/java/com/leromro/common/core/domain/entity/SysUser.java

@@ -4,7 +4,10 @@ import java.util.Date;
 import java.util.List;
 import javax.validation.constraints.*;
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -20,12 +23,14 @@ import com.leromro.common.xss.Xss;
  *
  * @author ruoyi
  */
+@TableName("sys_user")
 public class SysUser extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
     /** 用户ID */
     @Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号")
+    @TableId(value = "user_id", type = IdType.AUTO)
     private Long userId;
 
     /** 用户OpenID */
@@ -135,6 +140,31 @@ public class SysUser extends BaseEntity
     @ApiModelProperty("区级名称")
     private String districtName;
 
+    @TableField("longitude")
+    @ApiModelProperty("经度")
+    private String longitude;
+
+    /** 详细地址 */
+    @TableField("latitude")
+    @ApiModelProperty("纬度")
+    private String latitude;
+
+    public String getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+
     public String getProvinceCode() {
         return provinceCode;
     }

+ 3 - 3
leromro-core/src/main/java/com/leromro/core/controller/OrdersController.java

@@ -107,9 +107,9 @@ public class OrdersController extends BaseController {
     @ApiOperation("用户创建订单")
     @Log(title = "创建订单", businessType = BusinessType.INSERT)
     @PostMapping("/createOrder")
-    public AjaxResult createOrder(@RequestBody OrderRequestDTO orderRequest) {
-        mainOrderService.createOrders(orderRequest);
-        return AjaxResult.success();
+    public R<OrderPaymentVO> createOrder(@RequestBody OrderRequestDTO orderRequest) {
+
+        return mainOrderService.createOrders(orderRequest);
     }
 
     /**

+ 33 - 0
leromro-core/src/main/java/com/leromro/core/domain/vo/OrderPaymentVO.java

@@ -0,0 +1,33 @@
+package com.leromro.core.domain.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class OrderPaymentVO implements Serializable {
+
+    @ApiModelProperty("随机字符串")
+    private String nonceStr; //随机字符串
+    @ApiModelProperty("签名")
+    private String paySign; //签名
+    @ApiModelProperty("时间戳")
+    private String timeStamp; //时间戳
+    @ApiModelProperty("签名算法")
+    private String signType; //签名算法
+    @ApiModelProperty("统一下单接口返回的")
+    private String packageValue; //统一下单接口返回的 prepay_id 参数值
+    @ApiModelProperty("订单id")
+    private Long mainOrderId;
+
+
+}

+ 1 - 1
leromro-core/src/main/java/com/leromro/core/mapper/VolunteerInfoMapper.java

@@ -24,7 +24,7 @@ public interface VolunteerInfoMapper extends BaseMapper<VolunteerInfo> {
 
     List<VolunteerInfo> webList(VolunteerInfoDTO dto);
 
-    List<VolunteerInfoVO> selectVolunteerInfoSimple(VolunteerInfo volunteerInfo);
+    List<VolunteerInfoVO> selectVolunteerInfoSimple(ListPermission listPermission,@Param("info") VolunteerInfo volunteerInfo);
 
     VolunteerInfo selectLVolunteerInfoByVolunteerId(@Param("volunteerId") Long volunteerId,@Param("serviceCategory") Long serviceCategory);
 

+ 3 - 1
leromro-core/src/main/java/com/leromro/core/service/IMainOrderService.java

@@ -1,11 +1,13 @@
 package com.leromro.core.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.leromro.common.core.domain.R;
 import com.leromro.core.domain.MainOrders;
 import com.leromro.core.domain.SecondOrder;
 import com.leromro.core.domain.VolunteerWorkDate;
 import com.leromro.core.domain.dto.OrderRequestDTO;
 import com.leromro.core.domain.vo.MainOrdersVO;
+import com.leromro.core.domain.vo.OrderPaymentVO;
 import com.leromro.core.domain.vo.WebMainOrdersInfoVO;
 import com.leromro.core.domain.vo.webMainOrderListVO;
 
@@ -15,7 +17,7 @@ import java.util.List;
 public interface IMainOrderService extends IService<MainOrders> {
     List<MainOrdersVO> selectByUserId(String orderStatus, Long userId);
 
-    void createOrders(OrderRequestDTO orderRequest);
+    R<OrderPaymentVO> createOrders(OrderRequestDTO orderRequest);
 
 
     List<webMainOrderListVO> webMainOrderList(MainOrdersVO mainOrdersVO);

+ 10 - 3
leromro-core/src/main/java/com/leromro/core/service/impl/MainOrderServiceImpl.java

@@ -3,10 +3,12 @@ package com.leromro.core.service.impl;
 import cn.hutool.core.lang.Snowflake;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.leromro.common.core.domain.R;
 import com.leromro.common.utils.SecurityUtils;
 import com.leromro.core.domain.*;
 import com.leromro.core.domain.dto.OrderRequestDTO;
 import com.leromro.core.domain.vo.MainOrdersVO;
+import com.leromro.core.domain.vo.OrderPaymentVO;
 import com.leromro.core.domain.vo.WebMainOrdersInfoVO;
 import com.leromro.core.domain.vo.webMainOrderListVO;
 import com.leromro.core.mapper.*;
@@ -62,13 +64,16 @@ public class MainOrderServiceImpl extends ServiceImpl<MainOrdersMapper, MainOrde
      * @param orderRequest
      */
     @Override
-    @Transactional
-    /*@Transactional*/
-    public void createOrders(OrderRequestDTO orderRequest) {
+    @Transactional(rollbackFor = Exception.class)
+    public R<OrderPaymentVO> createOrders(OrderRequestDTO orderRequest) {
+        //响应数据
+        OrderPaymentVO vo = new OrderPaymentVO();
+        //订单信息
         MainOrders orders = orderRequest.getOrders();
         List<VolunteerWorkDate> workDateList = orderRequest.getWorkDateList();
         Long userId = SecurityUtils.getUserId();
         long orderId = snowflake.nextId();
+        vo.setMainOrderId(orderId);
 
 
         //获取志愿者信息,同时服务时长和价格也都在志愿者id中进行获取
@@ -212,8 +217,10 @@ public class MainOrderServiceImpl extends ServiceImpl<MainOrdersMapper, MainOrde
       //修改志愿者排班日期表
         workDateMapper.updateVolunteerWorkDatebyVolunteerId(volunteerWorkDates);
 
+        return R.ok(vo);
     }
 
+
     @Override
     public List<webMainOrderListVO> webMainOrderList(MainOrdersVO mainOrdersVO) {
         List<webMainOrderListVO> vos = baseMapper.webMainOrderList(mainOrdersVO);

+ 1 - 1
leromro-core/src/main/java/com/leromro/core/service/impl/VolunteerInfoServiceImpl.java

@@ -146,7 +146,7 @@ public class VolunteerInfoServiceImpl extends ServiceImpl<VolunteerInfoMapper, V
     @Override
     public List<VolunteerInfoVO> selectVolunteerInfoList(VolunteerInfo volunteerInfo) {
         //查询出志愿者信息
-        List<VolunteerInfoVO> infos = volunteerInfoMapper.selectVolunteerInfoSimple(volunteerInfo);
+        List<VolunteerInfoVO> infos = volunteerInfoMapper.selectVolunteerInfoSimple(new ListPermission(SecondOrder.class, CommonConstants.CHECK_PROVINCE_CITY_DISTRICT),volunteerInfo);
         //查询出所有服务名称
         Map<Long, String> idMapTierName = businessManagementService.list().stream().collect(Collectors.toMap(BusinessManagement::getBusinessManagementId, BusinessManagement::getBusinessTierName));
         if (ObjectUtil.isNotEmpty(infos)){

+ 7 - 18
leromro-core/src/main/resources/mapper/core/VolunteerInfoMapper.xml

@@ -95,29 +95,18 @@
         where volunteer_id = #{volunteerId} and service_category = #{serviceCategory}
     </select>
     <select id="selectVolunteerInfoSimple" resultType="com.leromro.core.domain.vo.VolunteerInfoVO">
-<!--  select volunteer_id, skill_describe,age ,service_category,name,volunteer_picture,score,lvi.business_management_id-->
-<!--        from l_volunteer_info lvi left join l_business_management lbm on lvi.business_management_id = lbm.business_management_id-->
-<!--        where app_status = 2-->
-<!--        <if test="name != null  and name != ''"> and lvi.name like concat('%', #{name}, '%')</if>-->
-<!--        <if test="score != null "> and lvi.score = #{score}</if>-->
-<!--        <if test="serviceCategory != null and serviceCategory != ''"> and lvi.service_category = #{serviceCategory}</if>-->
-<!--        <if test="skillDescribe != null  and skillDescribe != ''"> and lvi.skill_describe = #{skillDescribe}</if>-->
-<!--        <if test="city != null  and city != ''"> and lvi.city = #{city}</if>-->
-<!--        <if test="address != null  and address != ''"> and lvi.address = #{address}</if>-->
-<!--        <if test="businessManagementId != null and businessManagementId != '' ">and lvi.business_management_id in (select lbm.business_management_id from l_business_management where find_in_set(#{businessManagementId},lbm.ancestors) ) or lvi.business_management_id = 28 </if>-->
-
         select volunteer_id, skill_describe,age ,service_category,name,volunteer_picture,score,business_management_id
         from l_volunteer_info lvi
         where app_status = 2
         and lvi.business_management_id in (select lbm.business_management_id from l_business_management lbm
-            where find_in_set(#{businessManagementId},lbm.ancestors) or lbm.business_management_id = #{businessManagementId})
+            where find_in_set(#{info.businessManagementId},lbm.ancestors) or lbm.business_management_id = #{info.businessManagementId})
 
-        <if test="name != null  and name != ''"> and lvi.name like concat('%', #{name}, '%')</if>
-        <if test="score != null "> and lvi.score = #{score}</if>
-        <if test="serviceCategory != null and serviceCategory != ''"> and lvi.service_category = #{serviceCategory}</if>
-        <if test="skillDescribe != null  and skillDescribe != ''"> and lvi.skill_describe = #{skillDescribe}</if>
-        <if test="city != null  and city != ''"> and lvi.city = #{city}</if>
-        <if test="address != null  and address != ''"> and lvi.address = #{address}</if>
+        <if test="info.name != null  and info.name != ''"> and lvi.name like concat('%', #{info.name}, '%')</if>
+        <if test="info.score != null "> and lvi.score = #{info.score}</if>
+        <if test="info.serviceCategory != null and info.serviceCategory != ''"> and lvi.service_category = #{info.serviceCategory}</if>
+        <if test="info.skillDescribe != null  and info.skillDescribe != ''"> and lvi.skill_describe = #{info.skillDescribe}</if>
+        <if test="info.city != null  and info.city != ''"> and lvi.city = #{info.city}</if>
+        <if test="info.address != null  and info.address != ''"> and lvi.address = #{info.address}</if>
 
 
     </select>

+ 55 - 0
leromro-framework/src/main/java/com/leromro/framework/config/WxPayConfig.java

@@ -0,0 +1,55 @@
+package com.leromro.framework.config;
+
+import com.github.binarywang.wxpay.service.WxPayService;
+import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
+import com.leromro.framework.config.properties.WxPayProperties;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @author Binary Wang
+ */
+@Configuration
+@ConditionalOnClass(WxPayService.class)
+public class WxPayConfig {
+
+
+  @Bean(name = "wxMiniPayService")
+  public WxPayService getWxMiniPayService(WxPayProperties properties) {
+    com.github.binarywang.wxpay.config.WxPayConfig payConfig = new com.github.binarywang.wxpay.config.WxPayConfig();
+    payConfig.setAppId(StringUtils.trimToNull(properties.getAppId()));
+    payConfig.setMchId(StringUtils.trimToNull(properties.getMchId()));
+    payConfig.setMchKey(StringUtils.trimToNull(properties.getMchKey()));
+    payConfig.setNotifyUrl(StringUtils.trimToNull(properties.getNotifyUrl()));
+    payConfig.setTradeType(StringUtils.trimToNull(properties.getTradeType()));
+    payConfig.setKeyPath(StringUtils.trimToNull(properties.getKeyPath()));
+
+    // 可以指定是否使用沙箱环境
+    payConfig.setUseSandboxEnv(false);
+
+    WxPayService wxPayService = new WxPayServiceImpl();
+    wxPayService.setConfig(payConfig);
+    return wxPayService;
+  }
+
+  @Bean(name = "wxMiniPayRefundService")
+  public WxPayService getWxMiniPayRefundService(WxPayProperties properties) {
+    com.github.binarywang.wxpay.config.WxPayConfig payConfig = new com.github.binarywang.wxpay.config.WxPayConfig();
+    payConfig.setAppId(StringUtils.trimToNull(properties.getAppId()));
+    payConfig.setMchId(StringUtils.trimToNull(properties.getMchId()));
+    payConfig.setMchKey(StringUtils.trimToNull(properties.getMchKey()));
+    payConfig.setNotifyUrl(StringUtils.trimToNull(properties.getRefundNotifyUrl()));
+    payConfig.setTradeType(StringUtils.trimToNull(properties.getTradeType()));
+    payConfig.setKeyPath(StringUtils.trimToNull(properties.getKeyPath()));
+
+    // 可以指定是否使用沙箱环境
+    payConfig.setUseSandboxEnv(false);
+
+    WxPayService wxPayService = new WxPayServiceImpl();
+    wxPayService.setConfig(payConfig);
+    return wxPayService;
+  }
+
+}

+ 3 - 4
leromro-common/src/main/java/com/leromro/common/config/WeiXinConfig.java

@@ -1,14 +1,13 @@
-package com.leromro.common.config;
+package com.leromro.framework.config.properties;
 
 import lombok.Data;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
 
 @Data
 @Configuration
-@ConfigurationProperties(prefix = "wx")
-public class WeiXinConfig {
+@ConfigurationProperties(prefix = "wx.dev")
+public class WxDevProperties {
 
     private String url;
     private String appId;

+ 21 - 0
leromro-framework/src/main/java/com/leromro/framework/config/properties/WxPayProperties.java

@@ -0,0 +1,21 @@
+package com.leromro.framework.config.properties;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+@Data
+@Configuration
+@ConfigurationProperties(prefix = "wx.pay")
+public class WxPayProperties {
+
+    private String appId;
+    private String appSecret;
+    private String mchId;
+    private String mchKey;
+    private String tradeType;
+    private String notifyUrl;
+    private String keyPath;
+    private String refundNotifyUrl;
+
+}

+ 1 - 1
leromro-framework/src/main/java/com/leromro/framework/interceptor/ListPermissionInterceptor.java

@@ -74,7 +74,7 @@ public class ListPermissionInterceptor implements InnerInterceptor {
                 .collect(Collectors.toList());
         SysUser user = SecurityUtils.getLoginUser().getUser();
         //如果是超级管理员,则跳过拦截器
-        if (user.getDeptId() == 100) return;
+        if (ObjectUtil.isNotNull(user.getDeptId()) && user.getDeptId() == 100) return;
         //获取权限实体所有字段
         List<Field> fields = FieldUtils.getAllFieldsList(permission.getAClass());
         //获取表主键名称

+ 5 - 5
leromro-framework/src/main/java/com/leromro/framework/web/service/SysLoginService.java

@@ -10,9 +10,9 @@ import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
-import com.leromro.common.config.WeiXinConfig;
 import com.leromro.common.core.domain.AjaxResult;
 import com.leromro.common.utils.SecurityUtils;
+import com.leromro.framework.config.properties.WxDevProperties;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.authentication.AuthenticationManager;
@@ -70,7 +70,7 @@ public class SysLoginService
     private ISysConfigService configService;
 
     @Autowired
-    private WeiXinConfig weiXinConfig;
+    private WxDevProperties devProperties;
 
     /**
      * 登录验证
@@ -84,9 +84,9 @@ public class SysLoginService
         //拼接请求参数,获取唯一用户标识openid
         Map<String, Object> result = new HashMap<>();
         String url = StrUtil.format("{}/sns/jscode2session?appid={}&secret={}&js_code={}&grant_type=authorization_code",
-                this.weiXinConfig.getUrl(),
-                this.weiXinConfig.getAppId(),
-                this.weiXinConfig.getSecret(),
+                this.devProperties.getUrl(),
+                this.devProperties.getAppId(),
+                this.devProperties.getSecret(),
                 code);
 
         //请求微信服务端获取openid

+ 7 - 0
pom.xml

@@ -292,6 +292,13 @@
                 <version>3.16.1</version>
             </dependency>
 
+            <!--        微信支付工具-->
+            <dependency>
+                <groupId>com.github.binarywang</groupId>
+                <artifactId>weixin-java-pay</artifactId>
+                <version>4.7.0</version>
+            </dependency>
+
 
 
         </dependencies>