wuxw преди 2 години
родител
ревизия
c791b9b91a
променени са 17 файла, в които са добавени 963 реда и са изтрити 27 реда
  1. 15 0
      java110-bean/src/main/java/com/java110/dto/payment/NotifyPaymentOrderDto.java
  2. 95 0
      java110-bean/src/main/java/com/java110/dto/paymentAdapt/PaymentAdaptDto.java
  3. 27 0
      java110-bean/src/main/java/com/java110/dto/paymentPool/PaymentPoolDto.java
  4. 11 0
      java110-bean/src/main/java/com/java110/dto/paymentPoolValue/PaymentPoolValueDto.java
  5. 82 0
      java110-bean/src/main/java/com/java110/po/paymentAdapt/PaymentAdaptPo.java
  6. 115 0
      java110-db/src/main/resources/mapper/acct/PaymentAdaptV1ServiceDaoImplMapper.xml
  7. 2 2
      java110-db/src/main/resources/mapper/acct/PaymentPoolV1ServiceDaoImplMapper.xml
  8. 68 0
      java110-interface/src/main/java/com/java110/intf/acct/IPaymentAdaptV1InnerServiceSMO.java
  9. 122 2
      service-acct/src/main/java/com/java110/acct/cmd/payment/CashierCmd.java
  10. 80 0
      service-acct/src/main/java/com/java110/acct/cmd/payment/ListPaymentAdaptCmd.java
  11. 72 0
      service-acct/src/main/java/com/java110/acct/dao/IPaymentAdaptV1ServiceDao.java
  12. 112 0
      service-acct/src/main/java/com/java110/acct/dao/impl/PaymentAdaptV1ServiceDaoImpl.java
  13. 39 10
      service-acct/src/main/java/com/java110/acct/payment/adapt/wechat/WechatPaymentFactoryAdapt.java
  14. 21 1
      service-acct/src/main/java/com/java110/acct/smo/impl/NotifyPaymentV1InnerServiceSMOImpl.java
  15. 89 0
      service-acct/src/main/java/com/java110/acct/smo/impl/PaymentAdaptV1InnerServiceSMOImpl.java
  16. 6 6
      service-api/src/main/java/com/java110/api/controller/app/payment/wechat/WechatNotifyPaymentController.java
  17. 7 6
      springboot/src/main/java/com/java110/boot/controller/app/payment/wechat/WechatNotifyPaymentController.java

+ 15 - 0
java110-bean/src/main/java/com/java110/dto/payment/NotifyPaymentOrderDto.java

@@ -10,11 +10,18 @@ public class NotifyPaymentOrderDto implements Serializable{
 
     private String communityId;
 
+    private String paymentPoolId;
     public NotifyPaymentOrderDto(String appId, String param,String communityId) {
         this.appId = appId;
         this.param = param;
         this.communityId = communityId;
     }
+    public NotifyPaymentOrderDto(String appId, String param,String communityId,String paymentPoolId) {
+        this.appId = appId;
+        this.param = param;
+        this.communityId = communityId;
+        this.paymentPoolId = paymentPoolId;
+    }
 
     public NotifyPaymentOrderDto() {
     }
@@ -42,4 +49,12 @@ public class NotifyPaymentOrderDto implements Serializable{
     public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
+
+    public String getPaymentPoolId() {
+        return paymentPoolId;
+    }
+
+    public void setPaymentPoolId(String paymentPoolId) {
+        this.paymentPoolId = paymentPoolId;
+    }
 }

+ 95 - 0
java110-bean/src/main/java/com/java110/dto/paymentAdapt/PaymentAdaptDto.java

@@ -0,0 +1,95 @@
+package com.java110.dto.paymentAdapt;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 支付厂家数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class PaymentAdaptDto extends PageDto implements Serializable {
+
+    private String adaptId;
+    private String beanJsapi;
+    private String beanQrcode;
+    private String beanNative;
+    private String name;
+    private String paymentType;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getAdaptId() {
+        return adaptId;
+    }
+
+    public void setAdaptId(String adaptId) {
+        this.adaptId = adaptId;
+    }
+
+    public String getBeanJsapi() {
+        return beanJsapi;
+    }
+
+    public void setBeanJsapi(String beanJsapi) {
+        this.beanJsapi = beanJsapi;
+    }
+
+    public String getBeanQrcode() {
+        return beanQrcode;
+    }
+
+    public void setBeanQrcode(String beanQrcode) {
+        this.beanQrcode = beanQrcode;
+    }
+
+    public String getBeanNative() {
+        return beanNative;
+    }
+
+    public void setBeanNative(String beanNative) {
+        this.beanNative = beanNative;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPaymentType() {
+        return paymentType;
+    }
+
+    public void setPaymentType(String paymentType) {
+        this.paymentType = paymentType;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 27 - 0
java110-bean/src/main/java/com/java110/dto/paymentPool/PaymentPoolDto.java

@@ -34,6 +34,9 @@ public class PaymentPoolDto extends PageDto implements Serializable {
 
     private String payType;
 
+    private String beanJsapi;
+    private String beanQrcode;
+    private String beanNative;
     private List<PaymentPoolValueDto> values;
 
     private List<PaymentPoolConfigDto> configs;
@@ -148,4 +151,28 @@ public class PaymentPoolDto extends PageDto implements Serializable {
     public void setConfigs(List<PaymentPoolConfigDto> configs) {
         this.configs = configs;
     }
+
+    public String getBeanJsapi() {
+        return beanJsapi;
+    }
+
+    public void setBeanJsapi(String beanJsapi) {
+        this.beanJsapi = beanJsapi;
+    }
+
+    public String getBeanQrcode() {
+        return beanQrcode;
+    }
+
+    public void setBeanQrcode(String beanQrcode) {
+        this.beanQrcode = beanQrcode;
+    }
+
+    public String getBeanNative() {
+        return beanNative;
+    }
+
+    public void setBeanNative(String beanNative) {
+        this.beanNative = beanNative;
+    }
 }

+ 11 - 0
java110-bean/src/main/java/com/java110/dto/paymentPoolValue/PaymentPoolValueDto.java

@@ -4,6 +4,7 @@ import com.java110.dto.PageDto;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * @ClassName FloorDto
@@ -29,6 +30,16 @@ public class PaymentPoolValueDto extends PageDto implements Serializable {
 
     private String statusCd = "0";
 
+    public static String getValue(List<PaymentPoolValueDto> paymentPoolValueDtos, String columnKey) {
+
+        for (PaymentPoolValueDto paymentPoolValueDto : paymentPoolValueDtos) {
+            if (paymentPoolValueDto.getColumnKey().equals(columnKey)) {
+                return paymentPoolValueDto.getColumnValue();
+            }
+        }
+        return "";
+    }
+
 
     public String getValueId() {
         return valueId;

+ 82 - 0
java110-bean/src/main/java/com/java110/po/paymentAdapt/PaymentAdaptPo.java

@@ -0,0 +1,82 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.po.paymentAdapt;
+
+import java.io.Serializable;
+import java.util.Date;
+/**
+ * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
+ * add by 吴学文 at 2023-10-26 10:50:22 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public class PaymentAdaptPo implements Serializable {
+
+    private String adaptId;
+private String beanJsapi;
+private String beanQrcode;
+private String beanNative;
+private String name;
+private String statusCd = "0";
+private String paymentType;
+public String getAdaptId() {
+        return adaptId;
+    }
+public void setAdaptId(String adaptId) {
+        this.adaptId = adaptId;
+    }
+public String getBeanJsapi() {
+        return beanJsapi;
+    }
+public void setBeanJsapi(String beanJsapi) {
+        this.beanJsapi = beanJsapi;
+    }
+public String getBeanQrcode() {
+        return beanQrcode;
+    }
+public void setBeanQrcode(String beanQrcode) {
+        this.beanQrcode = beanQrcode;
+    }
+public String getBeanNative() {
+        return beanNative;
+    }
+public void setBeanNative(String beanNative) {
+        this.beanNative = beanNative;
+    }
+public String getName() {
+        return name;
+    }
+public void setName(String name) {
+        this.name = name;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getPaymentType() {
+        return paymentType;
+    }
+public void setPaymentType(String paymentType) {
+        this.paymentType = paymentType;
+    }
+
+
+
+}

+ 115 - 0
java110-db/src/main/resources/mapper/acct/PaymentAdaptV1ServiceDaoImplMapper.xml

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="paymentAdaptV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存支付厂家信息 add by wuxw 2018-07-03 -->
+    <insert id="savePaymentAdaptInfo" parameterType="Map">
+        insert into payment_adapt(
+adapt_id,bean_jsapi,bean_qrcode,bean_native,name,payment_type
+) values (
+#{adaptId},#{beanJsapi},#{beanQrcode},#{beanNative},#{name},#{paymentType}
+)
+    </insert>
+
+
+
+    <!-- 查询支付厂家信息 add by wuxw 2018-07-03 -->
+    <select id="getPaymentAdaptInfo" parameterType="Map" resultType="Map">
+        select  t.adapt_id,t.adapt_id adaptId,t.bean_jsapi,t.bean_jsapi beanJsapi,t.bean_qrcode,t.bean_qrcode beanQrcode,t.bean_native,t.bean_native beanNative,t.name,t.status_cd,t.status_cd statusCd,t.payment_type,t.payment_type paymentType 
+from payment_adapt t 
+where 1 =1 
+<if test="adaptId !=null and adaptId != ''">
+   and t.adapt_id= #{adaptId}
+</if> 
+<if test="beanJsapi !=null and beanJsapi != ''">
+   and t.bean_jsapi= #{beanJsapi}
+</if> 
+<if test="beanQrcode !=null and beanQrcode != ''">
+   and t.bean_qrcode= #{beanQrcode}
+</if> 
+<if test="beanNative !=null and beanNative != ''">
+   and t.bean_native= #{beanNative}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="paymentType !=null and paymentType != ''">
+   and t.payment_type= #{paymentType}
+</if> 
+order by t.create_time desc
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改支付厂家信息 add by wuxw 2018-07-03 -->
+    <update id="updatePaymentAdaptInfo" parameterType="Map">
+        update  payment_adapt t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="beanJsapi !=null and beanJsapi != ''">
+, t.bean_jsapi= #{beanJsapi}
+</if> 
+<if test="beanQrcode !=null and beanQrcode != ''">
+, t.bean_qrcode= #{beanQrcode}
+</if> 
+<if test="beanNative !=null and beanNative != ''">
+, t.bean_native= #{beanNative}
+</if> 
+<if test="name !=null and name != ''">
+, t.name= #{name}
+</if> 
+<if test="paymentType !=null and paymentType != ''">
+, t.payment_type= #{paymentType}
+</if> 
+ where 1=1 <if test="adaptId !=null and adaptId != ''">
+and t.adapt_id= #{adaptId}
+</if> 
+
+    </update>
+
+    <!-- 查询支付厂家数量 add by wuxw 2018-07-03 -->
+     <select id="queryPaymentAdaptsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from payment_adapt t 
+where 1 =1 
+<if test="adaptId !=null and adaptId != ''">
+   and t.adapt_id= #{adaptId}
+</if> 
+<if test="beanJsapi !=null and beanJsapi != ''">
+   and t.bean_jsapi= #{beanJsapi}
+</if> 
+<if test="beanQrcode !=null and beanQrcode != ''">
+   and t.bean_qrcode= #{beanQrcode}
+</if> 
+<if test="beanNative !=null and beanNative != ''">
+   and t.bean_native= #{beanNative}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="paymentType !=null and paymentType != ''">
+   and t.payment_type= #{paymentType}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 2 - 2
java110-db/src/main/resources/mapper/acct/PaymentPoolV1ServiceDaoImplMapper.xml

@@ -20,9 +20,9 @@
         select t.cert_path,t.cert_path certPath,t.status_cd,t.status_cd
         statusCd,t.remark,t.state,t.community_id,t.community_id communityId,t.payment_name,t.payment_name
         paymentName,t.pp_id,t.pp_id ppId,t.payment_type,t.payment_type paymentType,t.create_time createTime,
-        td.name paymentTypeName,t.pay_type payType
+        t.pay_type payType, pa.name paymentTypeName,pa.bean_jsapi beanJsapi,pa.bean_qrcode beanQrcode,pa.bean_native beanNative
         from payment_pool t
-        left join t_dict td on t.payment_type = td.status_cd and td.table_name = 'payment_key' and td.table_columns = 'payment_type'
+        left join payment_adapt pa on t.payment_type = pa.payment_type and pa.status_cd = '0'
         where 1 =1
         <if test="certPath !=null and certPath != ''">
             and t.cert_path= #{certPath}

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/acct/IPaymentAdaptV1InnerServiceSMO.java

@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.acct;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.paymentAdapt.PaymentAdaptDto;
+import com.java110.po.paymentAdapt.PaymentAdaptPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2023-10-26 10:50:22 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "acct-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/paymentAdaptV1Api")
+public interface IPaymentAdaptV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/savePaymentAdapt", method = RequestMethod.POST)
+    public int savePaymentAdapt(@RequestBody  PaymentAdaptPo paymentAdaptPo);
+
+    @RequestMapping(value = "/updatePaymentAdapt", method = RequestMethod.POST)
+    public int updatePaymentAdapt(@RequestBody  PaymentAdaptPo paymentAdaptPo);
+
+    @RequestMapping(value = "/deletePaymentAdapt", method = RequestMethod.POST)
+    public int deletePaymentAdapt(@RequestBody  PaymentAdaptPo paymentAdaptPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param paymentAdaptDto 数据对象分享
+     * @return PaymentAdaptDto 对象数据
+     */
+    @RequestMapping(value = "/queryPaymentAdapts", method = RequestMethod.POST)
+    List<PaymentAdaptDto> queryPaymentAdapts(@RequestBody PaymentAdaptDto paymentAdaptDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param paymentAdaptDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryPaymentAdaptsCount", method = RequestMethod.POST)
+    int queryPaymentAdaptsCount(@RequestBody PaymentAdaptDto paymentAdaptDto);
+}

+ 122 - 2
service-acct/src/main/java/com/java110/acct/cmd/payment/CashierCmd.java

@@ -9,7 +9,14 @@ import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.log.LoggerFactory;
 import com.java110.doc.annotation.*;
+import com.java110.dto.fee.FeeDto;
+import com.java110.dto.fee.PayFeeDto;
 import com.java110.dto.payment.PaymentOrderDto;
+import com.java110.dto.paymentPool.PaymentPoolDto;
+import com.java110.dto.paymentPoolConfig.PaymentPoolConfigDto;
+import com.java110.intf.acct.IPaymentPoolConfigV1InnerServiceSMO;
+import com.java110.intf.acct.IPaymentPoolV1InnerServiceSMO;
+import com.java110.intf.fee.IPayFeeV1InnerServiceSMO;
 import com.java110.utils.cache.CommonCache;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.MappingConstant;
@@ -19,10 +26,12 @@ import com.java110.utils.factory.ApplicationContextFactory;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.StringUtil;
 import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 
 import java.text.ParseException;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -36,6 +45,15 @@ public class CashierCmd extends Cmd {
 
     protected static final String DEFAULT_PAYMENT_ADAPT = "wechatPaymentFactory";// 默认微信通用支付
 
+    @Autowired
+    private IPaymentPoolConfigV1InnerServiceSMO paymentPoolConfigV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IPaymentPoolV1InnerServiceSMO paymentPoolV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IPayFeeV1InnerServiceSMO payFeeV1InnerServiceSMOImpl;
+
     /**
      * 校验
      *
@@ -51,6 +69,7 @@ public class CashierCmd extends Cmd {
         Assert.hasKeyAndValue(reqJson, "business", "未包含业务");
         Assert.hasKeyAndValue(reqJson, "cashierUserId", "未包含收银人员");
         Assert.hasKeyAndValue(reqJson, "openId", "未包含openId");
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区ID");
 
         context.getReqHeaders().put("user-id", reqJson.getString("cashierUserId"));
     }
@@ -101,8 +120,9 @@ public class CashierCmd extends Cmd {
             return;
         }
 
-        // 3.0 寻找当前支付适配器
-        String payAdapt = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAYMENT_ADAPT);
+        // todo 3.0 寻找当前支付适配器
+        String payAdapt = computeAdapt(reqJson.getString("business"), reqJson);
+        //MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAYMENT_ADAPT);
         payAdapt = StringUtil.isEmpty(payAdapt) ? DEFAULT_PAYMENT_ADAPT : payAdapt;
 
         if (reqJson.containsKey("payAdapt") && !StringUtil.isEmpty(reqJson.getString("payAdapt"))) {
@@ -128,4 +148,104 @@ public class CashierCmd extends Cmd {
         // redis 中 保存 请求参数
         CommonCache.setValue("unifiedPayment_" + paymentOrderDto.getOrderId(), reqJson.toJSONString(), CommonCache.PAY_DEFAULT_EXPIRE_TIME);
     }
+
+    /**
+     * 计算适配器
+     *
+     * @param business
+     * @param reqJson
+     * @return
+     */
+    private String computeAdapt(String business, JSONObject reqJson) {
+
+        String communityId = reqJson.getString("communityId");
+        //todo 如果是单个费用缴费
+        PaymentPoolDto paymentPoolDto = ifPayFeeBusiness(business, reqJson);
+        if (paymentPoolDto != null) {
+            reqJson.put("paymentPoolId", paymentPoolDto.getPpId());
+            return paymentPoolDto.getBeanJsapi();
+        }
+
+        //todo 如果是临时车
+        paymentPoolDto = ifTempCarFeeBusiness(business, communityId);
+        if (paymentPoolDto != null) {
+            reqJson.put("paymentPoolId", paymentPoolDto.getPpId());
+            return paymentPoolDto.getBeanJsapi();
+        }
+
+        //todo 按小区查询 支付信息
+        paymentPoolDto = new PaymentPoolDto();
+        paymentPoolDto.setCommunityId(communityId);
+        paymentPoolDto.setPayType(PaymentPoolDto.PAY_TYPE_COMMUNITY);
+        List<PaymentPoolDto> paymentPoolDtos = paymentPoolV1InnerServiceSMOImpl.queryPaymentPools(paymentPoolDto);
+        if (paymentPoolDtos == null || paymentPoolDtos.isEmpty()) {
+            throw new IllegalArgumentException("小区未配置支付信息");
+        }
+
+        reqJson.put("paymentPoolId", paymentPoolDtos.get(0).getPpId());
+        return paymentPoolDtos.get(0).getBeanJsapi();
+    }
+
+    /**
+     * 临时车场景处理
+     *
+     * @param business
+     * @param communityId
+     * @return
+     */
+    private PaymentPoolDto ifTempCarFeeBusiness(String business, String communityId) {
+        if (!"tempCarFee".equals(business)) {
+            return null;
+        }
+        //todo 按小区查询 支付信息
+        PaymentPoolDto paymentPoolDto = new PaymentPoolDto();
+        paymentPoolDto.setCommunityId(communityId);
+        paymentPoolDto.setPayType(PaymentPoolDto.PAY_TYPE_TEMP_CAT);
+        List<PaymentPoolDto> paymentPoolDtos = paymentPoolV1InnerServiceSMOImpl.queryPaymentPools(paymentPoolDto);
+        if (paymentPoolDtos == null || paymentPoolDtos.isEmpty()) {
+            return null;
+        }
+
+        return paymentPoolDtos.get(0);
+    }
+
+    private PaymentPoolDto ifPayFeeBusiness(String business, JSONObject reqJson) {
+        String feeId = "";
+        if (!"payFee".equals(business) || !reqJson.containsKey("feeId")) {
+            return null;
+        }
+
+        feeId = reqJson.getString("feeId");
+        if (StringUtil.isNumber(feeId)) {
+            return null;
+        }
+
+        PayFeeDto feeDto = new PayFeeDto();
+        feeDto.setFeeId(feeId);
+        feeDto.setCommunityId(reqJson.getString("communityId"));
+        List<PayFeeDto> feeDtos = payFeeV1InnerServiceSMOImpl.queryPayFees(feeDto);
+
+        if (feeDtos == null || feeDtos.isEmpty()) {
+            return null;
+        }
+
+        PaymentPoolConfigDto paymentPoolConfigDto = new PaymentPoolConfigDto();
+        paymentPoolConfigDto.setConfigId(feeDtos.get(0).getConfigId());
+        paymentPoolConfigDto.setCommunityId(feeDtos.get(0).getCommunityId());
+        List<PaymentPoolConfigDto> paymentPoolConfigDtos = paymentPoolConfigV1InnerServiceSMOImpl.queryPaymentPoolConfigs(paymentPoolConfigDto);
+        if (paymentPoolConfigDtos == null || paymentPoolConfigDtos.isEmpty()) {
+            return null;
+        }
+
+        PaymentPoolDto paymentPoolDto = new PaymentPoolDto();
+        paymentPoolDto.setPpId(paymentPoolConfigDtos.get(0).getPpId());
+        paymentPoolDto.setCommunityId(paymentPoolConfigDtos.get(0).getCommunityId());
+        paymentPoolDto.setPayType(PaymentPoolDto.PAY_TYPE_FEE_CONFIG);
+        List<PaymentPoolDto> paymentPoolDtos = paymentPoolV1InnerServiceSMOImpl.queryPaymentPools(paymentPoolDto);
+        if (paymentPoolDtos == null || paymentPoolDtos.isEmpty()) {
+            return null;
+        }
+
+        return paymentPoolDtos.get(0);
+    }
 }

+ 80 - 0
service-acct/src/main/java/com/java110/acct/cmd/payment/ListPaymentAdaptCmd.java

@@ -0,0 +1,80 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.acct.cmd.payment;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.acct.IPaymentAdaptV1InnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.java110.dto.paymentAdapt.PaymentAdaptDto;
+import java.util.List;
+import java.util.ArrayList;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.HttpStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:paymentAdapt.listPaymentAdapt
+ * 请求路劲:/app/paymentAdapt.ListPaymentAdapt
+ * add by 吴学文 at 2023-10-26 10:50:22 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "payment.listPaymentAdapt")
+public class ListPaymentAdaptCmd extends Cmd {
+
+  private static Logger logger = LoggerFactory.getLogger(ListPaymentAdaptCmd.class);
+    @Autowired
+    private IPaymentAdaptV1InnerServiceSMO paymentAdaptV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+           PaymentAdaptDto paymentAdaptDto = BeanConvertUtil.covertBean(reqJson, PaymentAdaptDto.class);
+
+           int count = paymentAdaptV1InnerServiceSMOImpl.queryPaymentAdaptsCount(paymentAdaptDto);
+
+           List<PaymentAdaptDto> paymentAdaptDtos = null;
+
+           if (count > 0) {
+               paymentAdaptDtos = paymentAdaptV1InnerServiceSMOImpl.queryPaymentAdapts(paymentAdaptDto);
+           } else {
+               paymentAdaptDtos = new ArrayList<>();
+           }
+
+           ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, paymentAdaptDtos);
+
+           ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+           cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 72 - 0
service-acct/src/main/java/com/java110/acct/dao/IPaymentAdaptV1ServiceDao.java

@@ -0,0 +1,72 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.acct.dao;
+
+
+import com.java110.utils.exception.DAOException;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2023-10-26 10:50:22 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public interface IPaymentAdaptV1ServiceDao {
+
+
+    /**
+     * 保存 支付厂家信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int savePaymentAdaptInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询支付厂家信息(instance过程)
+     * 根据bId 查询支付厂家信息
+     * @param info bId 信息
+     * @return 支付厂家信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getPaymentAdaptInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改支付厂家信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updatePaymentAdaptInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询支付厂家总数
+     *
+     * @param info 支付厂家信息
+     * @return 支付厂家数量
+     */
+    int queryPaymentAdaptsCount(Map info);
+
+}

+ 112 - 0
service-acct/src/main/java/com/java110/acct/dao/impl/PaymentAdaptV1ServiceDaoImpl.java

@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.acct.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.acct.dao.IPaymentAdaptV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2023-10-26 10:50:22 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Service("paymentAdaptV1ServiceDaoImpl")
+public class PaymentAdaptV1ServiceDaoImpl extends BaseServiceDao implements IPaymentAdaptV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(PaymentAdaptV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存支付厂家信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int savePaymentAdaptInfo(Map info) throws DAOException {
+        logger.debug("保存 savePaymentAdaptInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("paymentAdaptV1ServiceDaoImpl.savePaymentAdaptInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询支付厂家信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getPaymentAdaptInfo(Map info) throws DAOException {
+        logger.debug("查询 getPaymentAdaptInfo 入参 info : {}",info);
+
+        List<Map> businessPaymentAdaptInfos = sqlSessionTemplate.selectList("paymentAdaptV1ServiceDaoImpl.getPaymentAdaptInfo",info);
+
+        return businessPaymentAdaptInfos;
+    }
+
+
+    /**
+     * 修改支付厂家信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updatePaymentAdaptInfo(Map info) throws DAOException {
+        logger.debug("修改 updatePaymentAdaptInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("paymentAdaptV1ServiceDaoImpl.updatePaymentAdaptInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询支付厂家数量
+     * @param info 支付厂家信息
+     * @return 支付厂家数量
+     */
+    @Override
+    public int queryPaymentAdaptsCount(Map info) {
+        logger.debug("查询 queryPaymentAdaptsCount 入参 info : {}",info);
+
+        List<Map> businessPaymentAdaptInfos = sqlSessionTemplate.selectList("paymentAdaptV1ServiceDaoImpl.queryPaymentAdaptsCount", info);
+        if (businessPaymentAdaptInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessPaymentAdaptInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 39 - 10
service-acct/src/main/java/com/java110/acct/payment/adapt/wechat/WechatPaymentFactoryAdapt.java

@@ -8,12 +8,14 @@ import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.core.factory.WechatFactory;
 import com.java110.core.log.LoggerFactory;
 import com.java110.dto.app.AppDto;
+import com.java110.dto.paymentPoolValue.PaymentPoolValueDto;
 import com.java110.dto.wechat.OnlinePayDto;
 import com.java110.dto.owner.OwnerAppUserDto;
 import com.java110.dto.payment.NotifyPaymentOrderDto;
 import com.java110.dto.payment.PaymentOrderDto;
 import com.java110.dto.wechat.SmallWeChatDto;
 import com.java110.intf.acct.IOnlinePayV1InnerServiceSMO;
+import com.java110.intf.acct.IPaymentPoolValueV1InnerServiceSMO;
 import com.java110.intf.store.ISmallWechatV1InnerServiceSMO;
 import com.java110.intf.user.IOwnerAppUserInnerServiceSMO;
 import com.java110.po.wechat.OnlinePayPo;
@@ -21,6 +23,7 @@ import com.java110.utils.cache.MappingCache;
 import com.java110.utils.cache.UrlCache;
 import com.java110.utils.constant.MappingConstant;
 import com.java110.utils.constant.WechatConstant;
+import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.PayUtil;
 import com.java110.utils.util.StringUtil;
@@ -78,6 +81,9 @@ public class WechatPaymentFactoryAdapt implements IPaymentFactoryAdapt {
     @Autowired
     private IOnlinePayV1InnerServiceSMO onlinePayV1InnerServiceSMOImpl;
 
+    @Autowired
+    private IPaymentPoolValueV1InnerServiceSMO paymentPoolValueV1InnerServiceSMOImpl;
+
     @Autowired
     private RestTemplate outRestTemplate;
 
@@ -87,11 +93,13 @@ public class WechatPaymentFactoryAdapt implements IPaymentFactoryAdapt {
 
         SmallWeChatDto smallWeChatDto = getSmallWechat(reqJson);
 
+        String paymentPoolId = reqJson.getString("paymentPoolId");
+
 
         String appId = context.getReqHeaders().get("app-id");
         String userId = context.getReqHeaders().get("user-id");
         String tradeType = reqJson.getString("tradeType");
-        String notifyUrl = UrlCache.getOwnerUrl() + "/app/payment/notify/wechat/992020011134400001/" + smallWeChatDto.getObjId();
+        String notifyUrl = UrlCache.getOwnerUrl() + "/app/payment/notify/wechat/992020011134400001/"+paymentPoolId;
 
         String openId = reqJson.getString("openId");
 
@@ -130,6 +138,7 @@ public class WechatPaymentFactoryAdapt implements IPaymentFactoryAdapt {
                 payAmount,
                 openId,
                 smallWeChatDto,
+                paymentPoolId,
                 notifyUrl
         );
 
@@ -169,17 +178,30 @@ public class WechatPaymentFactoryAdapt implements IPaymentFactoryAdapt {
 
     private Map<String, String> java110UnifieldOrder(String feeName, String orderNum,
                                                      String tradeType, double payAmount, String openid,
-                                                     SmallWeChatDto smallWeChatDto, String notifyUrl) throws Exception {
+                                                     SmallWeChatDto smallWeChatDto,
+                                                     String paymentPoolId,
+                                                     String notifyUrl) throws Exception {
 
         //String systemName = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAY_GOOD_NAME);
 
+        PaymentPoolValueDto paymentPoolValueDto = new PaymentPoolValueDto();
+        paymentPoolValueDto.setPpId(paymentPoolId);
+        List<PaymentPoolValueDto> paymentPoolValueDtos = paymentPoolValueV1InnerServiceSMOImpl.queryPaymentPoolValues(paymentPoolValueDto);
+
+        if (paymentPoolValueDtos == null || paymentPoolValueDtos.isEmpty()) {
+            throw new IllegalArgumentException("配置错误,未配置参数");
+        }
+
+        String mchId = PaymentPoolValueDto.getValue(paymentPoolValueDtos, "WECHAT_MCHID");
+        String key = PaymentPoolValueDto.getValue(paymentPoolValueDtos, "WECHAT_KEY");
+
         if (feeName.length() > 127) {
             feeName = feeName.substring(0, 126);
         }
 
         SortedMap<String, String> paramMap = new TreeMap<String, String>();
         paramMap.put("appid", smallWeChatDto.getAppId());
-        paramMap.put("mch_id", smallWeChatDto.getMchId());
+        paramMap.put("mch_id", mchId);
         paramMap.put("nonce_str", PayUtil.makeUUID(32));
         paramMap.put("body", feeName);
         paramMap.put("out_trade_no", orderNum);
@@ -198,7 +220,7 @@ public class WechatPaymentFactoryAdapt implements IPaymentFactoryAdapt {
             paramMap.put("sub_openid", openid);
             paramMap.remove("openid");
         }
-        paramMap.put("sign", PayUtil.createSign(paramMap, smallWeChatDto.getPayPassword()));
+        paramMap.put("sign", PayUtil.createSign(paramMap, key));
 //转换为xml
         String xmlData = PayUtil.mapToXml(paramMap);
 
@@ -273,13 +295,20 @@ public class WechatPaymentFactoryAdapt implements IPaymentFactoryAdapt {
             }
             paramMap.put(key, map.get(key).toString());
         }
-        //String appId = WechatFactory.getAppId(wId);
-        JSONObject paramIn = new JSONObject();
-        paramIn.put("appId", appId);
-        paramIn.put("communityId", notifyPaymentOrderDto.getCommunityId());
-        SmallWeChatDto smallWeChatDto = getSmallWechat(paramIn);
 
-        String sign = PayUtil.createSign(paramMap, smallWeChatDto.getPayPassword());
+        PaymentPoolValueDto paymentPoolValueDto = new PaymentPoolValueDto();
+        paymentPoolValueDto.setPpId(notifyPaymentOrderDto.getPaymentPoolId());
+        paymentPoolValueDto.setCommunityId(notifyPaymentOrderDto.getCommunityId());
+        List<PaymentPoolValueDto> paymentPoolValueDtos = paymentPoolValueV1InnerServiceSMOImpl.queryPaymentPoolValues(paymentPoolValueDto);
+
+        if (paymentPoolValueDtos == null || paymentPoolValueDtos.isEmpty()) {
+            throw new IllegalArgumentException("配置错误,未配置参数");
+        }
+
+       // String mchId = PaymentPoolValueDto.getValue(paymentPoolValueDtos, "WECHAT_MCHID");
+        String key = PaymentPoolValueDto.getValue(paymentPoolValueDtos, "WECHAT_KEY");
+
+        String sign = PayUtil.createSign(paramMap, key);
 
         if (!sign.equals(map.get("sign"))) {
             throw new IllegalArgumentException("鉴权失败");

+ 21 - 1
service-acct/src/main/java/com/java110/acct/smo/impl/NotifyPaymentV1InnerServiceSMOImpl.java

@@ -23,7 +23,9 @@ import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.core.log.LoggerFactory;
 import com.java110.dto.payment.NotifyPaymentOrderDto;
 import com.java110.dto.payment.PaymentOrderDto;
+import com.java110.dto.paymentPool.PaymentPoolDto;
 import com.java110.intf.acct.INotifyPaymentV1InnerServiceSMO;
+import com.java110.intf.acct.IPaymentPoolV1InnerServiceSMO;
 import com.java110.utils.cache.CommonCache;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.WechatConstant;
@@ -31,10 +33,13 @@ import com.java110.utils.exception.CmdException;
 import com.java110.utils.factory.ApplicationContextFactory;
 import com.java110.utils.util.StringUtil;
 import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
  * add by 吴学文 at 2021-12-21 13:05:25 mail: 928255095@qq.com
@@ -51,6 +56,8 @@ public class NotifyPaymentV1InnerServiceSMOImpl extends BaseServiceSMO implement
     private static final String DEFAULT_PAYMENT_NOTIFY_ADAPT = "wechatPaymentFactory";// 默认微信通用支付
 
     protected static final String DEFAULT_NATIVE_QRCODE_PAYMENT_ADAPT = "wechatNativeQrcodePaymentFactory";// 默认微信通用支付
+    @Autowired
+    private IPaymentPoolV1InnerServiceSMO paymentPoolV1InnerServiceSMOImpl;
 
     /**
      * 通知类
@@ -62,7 +69,8 @@ public class NotifyPaymentV1InnerServiceSMOImpl extends BaseServiceSMO implement
     public ResponseEntity<String> notifyPayment(@RequestBody NotifyPaymentOrderDto notifyPaymentOrderDto) {
 
         try {
-            String payNotifyAdapt = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAYMENT_ADAPT);
+            String payNotifyAdapt = computeNotifyAdapt(notifyPaymentOrderDto);
+            //MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAYMENT_ADAPT);
             payNotifyAdapt = StringUtil.isEmpty(payNotifyAdapt) ? DEFAULT_PAYMENT_NOTIFY_ADAPT : payNotifyAdapt;
 //支付适配器IPayNotifyAdapt
             logger.debug("适配器:" + payNotifyAdapt);
@@ -101,6 +109,18 @@ public class NotifyPaymentV1InnerServiceSMOImpl extends BaseServiceSMO implement
         }
     }
 
+    private String computeNotifyAdapt(NotifyPaymentOrderDto notifyPaymentOrderDto) {
+
+        PaymentPoolDto paymentPoolDto = new PaymentPoolDto();
+        paymentPoolDto.setPpId(notifyPaymentOrderDto.getPaymentPoolId());
+        paymentPoolDto.setCommunityId(notifyPaymentOrderDto.getCommunityId());
+        List<PaymentPoolDto> paymentPoolDtos = paymentPoolV1InnerServiceSMOImpl.queryPaymentPools(paymentPoolDto);
+        if (paymentPoolDtos == null || paymentPoolDtos.isEmpty()) {
+            throw new IllegalArgumentException(notifyPaymentOrderDto.getPaymentPoolId() + "支付信息不存在");
+        }
+        return paymentPoolDtos.get(0).getBeanJsapi();
+    }
+
     @Override
     public ResponseEntity<String> nativeNotifyPayment(@RequestBody NotifyPaymentOrderDto notifyPaymentOrderDto) {
 

+ 89 - 0
service-acct/src/main/java/com/java110/acct/smo/impl/PaymentAdaptV1InnerServiceSMOImpl.java

@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.acct.smo.impl;
+
+
+import com.java110.acct.dao.IPaymentAdaptV1ServiceDao;
+import com.java110.intf.acct.IPaymentAdaptV1InnerServiceSMO;
+import com.java110.dto.paymentAdapt.PaymentAdaptDto;
+import com.java110.po.paymentAdapt.PaymentAdaptPo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2023-10-26 10:50:22 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@RestController
+public class PaymentAdaptV1InnerServiceSMOImpl extends BaseServiceSMO implements IPaymentAdaptV1InnerServiceSMO {
+
+    @Autowired
+    private IPaymentAdaptV1ServiceDao paymentAdaptV1ServiceDaoImpl;
+
+
+    @Override
+    public int savePaymentAdapt(@RequestBody  PaymentAdaptPo paymentAdaptPo) {
+        int saveFlag = paymentAdaptV1ServiceDaoImpl.savePaymentAdaptInfo(BeanConvertUtil.beanCovertMap(paymentAdaptPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updatePaymentAdapt(@RequestBody  PaymentAdaptPo paymentAdaptPo) {
+        int saveFlag = paymentAdaptV1ServiceDaoImpl.updatePaymentAdaptInfo(BeanConvertUtil.beanCovertMap(paymentAdaptPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deletePaymentAdapt(@RequestBody  PaymentAdaptPo paymentAdaptPo) {
+       paymentAdaptPo.setStatusCd("1");
+       int saveFlag = paymentAdaptV1ServiceDaoImpl.updatePaymentAdaptInfo(BeanConvertUtil.beanCovertMap(paymentAdaptPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<PaymentAdaptDto> queryPaymentAdapts(@RequestBody  PaymentAdaptDto paymentAdaptDto) {
+
+        //校验是否传了 分页信息
+
+        int page = paymentAdaptDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            paymentAdaptDto.setPage((page - 1) * paymentAdaptDto.getRow());
+        }
+
+        List<PaymentAdaptDto> paymentAdapts = BeanConvertUtil.covertBeanList(paymentAdaptV1ServiceDaoImpl.getPaymentAdaptInfo(BeanConvertUtil.beanCovertMap(paymentAdaptDto)), PaymentAdaptDto.class);
+
+        return paymentAdapts;
+    }
+
+
+    @Override
+    public int queryPaymentAdaptsCount(@RequestBody PaymentAdaptDto paymentAdaptDto) {
+        return paymentAdaptV1ServiceDaoImpl.queryPaymentAdaptsCount(BeanConvertUtil.beanCovertMap(paymentAdaptDto));    }
+
+}

+ 6 - 6
service-api/src/main/java/com/java110/api/controller/app/payment/wechat/WechatNotifyPaymentController.java

@@ -26,12 +26,12 @@ public class WechatNotifyPaymentController {
      * @param request
      * @throws Exception
      */
-    @RequestMapping(path = "/wechat/{appId}/{communityId}", method = RequestMethod.POST)
-    public ResponseEntity<String> notify(@RequestBody String postInfo, @PathVariable String appId,@PathVariable String communityId, HttpServletRequest request) {
+    @RequestMapping(path = "/wechat/{appId}/{paymentPoolId}", method = RequestMethod.POST)
+    public ResponseEntity<String> notify(@RequestBody String postInfo, @PathVariable String appId, @PathVariable String paymentPoolId, HttpServletRequest request) {
 
         logger.debug("微信支付回调报文" + postInfo);
 
-        return notifyPaymentV1InnerServiceSMOImpl.notifyPayment(new NotifyPaymentOrderDto(appId,postInfo,communityId));
+        return notifyPaymentV1InnerServiceSMOImpl.notifyPayment(new NotifyPaymentOrderDto(appId, postInfo, "", paymentPoolId));
 
     }
 
@@ -41,12 +41,12 @@ public class WechatNotifyPaymentController {
      * @param request
      * @throws Exception
      */
-    @RequestMapping(path = "/nativeWechat/{appId}/{communityId}", method = RequestMethod.POST)
-    public ResponseEntity<String> nativeNotify(@RequestBody String postInfo, @PathVariable String appId,@PathVariable String communityId, HttpServletRequest request) {
+    @RequestMapping(path = "/nativeWechat/{appId}/{paymentPoolId}", method = RequestMethod.POST)
+    public ResponseEntity<String> nativeNotify(@RequestBody String postInfo, @PathVariable String appId, @PathVariable String paymentPoolId, HttpServletRequest request) {
 
         logger.debug("微信支付回调报文" + postInfo);
 
-        return notifyPaymentV1InnerServiceSMOImpl.nativeNotifyPayment(new NotifyPaymentOrderDto(appId,postInfo,communityId));
+        return notifyPaymentV1InnerServiceSMOImpl.nativeNotifyPayment(new NotifyPaymentOrderDto(appId, postInfo, "", paymentPoolId));
 
     }
 }

+ 7 - 6
springboot/src/main/java/com/java110/boot/controller/app/payment/wechat/WechatNotifyPaymentController.java

@@ -25,12 +25,13 @@ public class WechatNotifyPaymentController {
      * @param request
      * @throws Exception
      */
-    @RequestMapping(path = "/wechat/{appId}/{communityId}", method = RequestMethod.POST)
-    public ResponseEntity<String> notify(@RequestBody String postInfo, @PathVariable String appId,@PathVariable String communityId, HttpServletRequest request) {
+    @RequestMapping(path = "/wechat/{appId}/{paymentPoolId}", method = RequestMethod.POST)
+    public ResponseEntity<String> notify(@RequestBody String postInfo, @PathVariable String appId,
+                                         @PathVariable String paymentPoolId,HttpServletRequest request) {
 
         logger.debug("微信支付回调报文" + postInfo);
 
-        return notifyPaymentV1InnerServiceSMOImpl.notifyPayment(new NotifyPaymentOrderDto(appId,postInfo,communityId));
+        return notifyPaymentV1InnerServiceSMOImpl.notifyPayment(new NotifyPaymentOrderDto(appId,postInfo,"",paymentPoolId));
 
     }
 
@@ -40,12 +41,12 @@ public class WechatNotifyPaymentController {
      * @param request
      * @throws Exception
      */
-    @RequestMapping(path = "/nativeWechat/{appId}/{communityId}", method = RequestMethod.POST)
-    public ResponseEntity<String> nativeNotify(@RequestBody String postInfo, @PathVariable String appId,@PathVariable String communityId, HttpServletRequest request) {
+    @RequestMapping(path = "/nativeWechat/{appId}/{paymentPoolId}", method = RequestMethod.POST)
+    public ResponseEntity<String> nativeNotify(@RequestBody String postInfo, @PathVariable String appId,@PathVariable String paymentPoolId, HttpServletRequest request) {
 
         logger.debug("微信支付回调报文" + postInfo);
 
-        return notifyPaymentV1InnerServiceSMOImpl.nativeNotifyPayment(new NotifyPaymentOrderDto(appId,postInfo,communityId));
+        return notifyPaymentV1InnerServiceSMOImpl.nativeNotifyPayment(new NotifyPaymentOrderDto(appId,postInfo,"",paymentPoolId));
 
     }
 }