nickchange
2023-10-11 66425a710e124c1a03c4061cb327d38e13c0cfc5
10.11
3个文件已修改
252 ■■■■ 已修改文件
.idea/workspace.xml 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/pom.xml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/util/PayMoneyUtil.java 194 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/workspace.xml
@@ -27,6 +27,7 @@
  <component name="ChangeListManager">
    <list default="true" id="cb08d02f-fd4f-4fa2-85fe-abd508fa83ac" name="Default Changelist" comment="10.12">
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/cloud-server-account/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-account/pom.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/cloud-server-account/src/main/java/com/dsh/account/util/PayMoneyUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-account/src/main/java/com/dsh/account/util/PayMoneyUtil.java" afterDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
@@ -69,6 +70,9 @@
  <component name="ProblemsViewState">
    <option name="selectedTabId" value="ProjectErrors" />
  </component>
  <component name="ProjectColorInfo"><![CDATA[{
  "associatedIndex": 3
}]]></component>
  <component name="ProjectId" id="2T0poWYlZShlnPso29uxjn4gQQo" />
  <component name="ProjectLevelVcsManager" settingsEditedManually="true">
    <ConfirmationsSetting value="2" id="Add" />
@@ -79,8 +83,16 @@
  </component>
  <component name="PropertiesComponent"><![CDATA[{
  "keyToString": {
    "RequestMappingsPanelOrder0": "0",
    "RequestMappingsPanelOrder1": "1",
    "RequestMappingsPanelWidth0": "75",
    "RequestMappingsPanelWidth1": "75",
    "WebServerToolWindowFactoryState": "false",
    "git-widget-placeholder": "master",
    "node.js.selected.package.tslint": "(autodetect)"
    "node.js.detected.package.eslint": "true",
    "node.js.selected.package.eslint": "(autodetect)",
    "node.js.selected.package.tslint": "(autodetect)",
    "vue.rearranger.settings.migration": "true"
  }
}]]></component>
  <component name="ReactorSettings">
@@ -270,7 +282,7 @@
      </serviceView>
    </option>
  </component>
  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="false" />
  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
  <component name="SvnConfiguration">
    <configuration>C:\Users\luo\AppData\Roaming\Subversion</configuration>
  </component>
@@ -335,6 +347,7 @@
      <workItem from="1696917635013" duration="5121000" />
      <workItem from="1696847977356" duration="7435000" />
      <workItem from="1696898972818" duration="19012000" />
      <workItem from="1696992350781" duration="1182000" />
    </task>
    <task id="LOCAL-00001" summary="后台代码删除">
      <created>1690249807612</created>
@@ -659,16 +672,19 @@
      <option name="project" value="LOCAL" />
      <updated>1696989564532</updated>
    </task>
    <option name="localTasksCounter" value="43" />
    <task id="LOCAL-00043" summary="10.12">
      <option name="closed" value="true" />
      <created>1696990659189</created>
      <option name="number" value="00043" />
      <option name="presentableId" value="LOCAL-00043" />
      <option name="project" value="LOCAL" />
      <updated>1696990659189</updated>
    </task>
    <option name="localTasksCounter" value="44" />
    <servers />
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="exactExcludedFiles">
      <list>
        <option value="$PROJECT_DIR$/cloud-server-management/node_modules/zrender/index.js" />
        <option value="$PROJECT_DIR$/cloud-server-management/node_modules/zrender/index.d.ts" />
      </list>
    </option>
    <option name="version" value="3" />
  </component>
  <component name="Vcs.Log.Tabs.Properties">
    <option name="TAB_STATES">
@@ -744,7 +760,7 @@
        </line-breakpoint>
        <line-breakpoint enabled="true" type="java-line">
          <url>file://$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/DataStatisticsController.java</url>
          <line>251</line>
          <line>261</line>
          <option name="timeStamp" value="50" />
        </line-breakpoint>
      </breakpoints>
cloud-server-account/pom.xml
@@ -16,17 +16,17 @@
    <dependencies>
        <!--日志处理-->
        <dependency>
            <groupId>com.github.binarywang</groupId>
            <artifactId>wx-java-pay-spring-boot-starter</artifactId>
            <version>4.4.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>guava</artifactId>
                    <groupId>com.google.guava</groupId>
                </exclusion>
            </exclusions>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>com.github.binarywang</groupId>-->
<!--            <artifactId>wx-java-pay-spring-boot-starter</artifactId>-->
<!--            <version>4.4.0</version>-->
<!--            <exclusions>-->
<!--                <exclusion>-->
<!--                    <artifactId>guava</artifactId>-->
<!--                    <groupId>com.google.guava</groupId>-->
<!--                </exclusion>-->
<!--            </exclusions>-->
<!--        </dependency>-->
        <dependency>
            <groupId>cn.mb.cloud</groupId>
cloud-server-account/src/main/java/com/dsh/account/util/PayMoneyUtil.java
@@ -20,10 +20,10 @@
import com.dsh.account.feignclient.other.model.SiteBooking;
import com.dsh.account.mapper.RechargeRecordsMapper;
import com.dsh.account.util.httpClinet.HttpClientUtil;
import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingReceiver;
import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingRequest;
import com.github.binarywang.wxpay.service.ProfitSharingV3Service;
import com.github.binarywang.wxpay.service.WxPayService;
//import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingReceiver;
//import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingRequest;
//import com.github.binarywang.wxpay.service.ProfitSharingV3Service;
//import com.github.binarywang.wxpay.service.WxPayService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
@@ -501,107 +501,107 @@
    @Resource
    private SiteClient siteClient;
    @Autowired
    private WxPayService wxPayService;
//    @Autowired
//    private WxPayService wxPayService;
    //分账
    public ResultUtil order(String code) throws Exception {
                  Integer    coursePackagePayments = coursePackageClient.queryByCode(code);
                  Integer paymentCompetitions = competitionsClient.queryByCode(code);
                  Integer siteBookings = siteClient.queryByCode(code);
        List<Integer> stores = new ArrayList<>();
                stores.add(coursePackagePayments);
                stores.add(paymentCompetitions);
                stores.add(siteBookings);
                OperatorUser operatorUser = siteClient.queryOperator(stores);
        WxPayService myWxPayService = wxPayService.switchoverTo("mch_id");
        ProfitSharingV3Service profitSharingV3Service = myWxPayService.getProfitSharingV3Service();
        String nonceStr = RandomUtil.randomString(32);
        String appId = "您的appid";
        //添加分账方
//    public ResultUtil order(String code) throws Exception {
//
//
//
//                  Integer    coursePackagePayments = coursePackageClient.queryByCode(code);
//                  Integer paymentCompetitions = competitionsClient.queryByCode(code);
//                  Integer siteBookings = siteClient.queryByCode(code);
//        List<Integer> stores = new ArrayList<>();
//                stores.add(coursePackagePayments);
//                stores.add(paymentCompetitions);
//                stores.add(siteBookings);
//
//                OperatorUser operatorUser = siteClient.queryOperator(stores);
//
//
////        WxPayService myWxPayService = wxPayService.switchoverTo("mch_id");
////
////        ProfitSharingV3Service profitSharingV3Service = myWxPayService.getProfitSharingV3Service();
//
//        String nonceStr = RandomUtil.randomString(32);
//        String appId = "您的appid";
//
//
//        //添加分账方
//
////        ProfitSharingReceiver profitSharingReceiver = new ProfitSharingReceiver();
////        profitSharingReceiver.setAccount("appid对应的openId");
////        profitSharingReceiver.setAmount(1l);
////        profitSharingReceiver.setAppid(appId);
////        profitSharingReceiver.setType("PERSONAL_OPENID");
////        profitSharingReceiver.setRelationType("PARTNER");
////        profitSharingV3Service.addProfitSharingReceiver(profitSharingReceiver);
//
//        //分账
//        ProfitSharingRequest profitSharingRequest = new ProfitSharingRequest();
//        profitSharingRequest.setAppid(appId);
//        profitSharingRequest.setTransactionId("微信支付订单号");
//        profitSharingRequest.setOutOrderNo("业务系统唯一编号");
//        //分账完成后,剩余金额自动解冻并返回给商户账号,默认false
//        profitSharingRequest.setUnfreezeUnsplit(true);
//        //待分账金额1元
//        Long money = 1L;
//        List<ProfitSharingReceiver> profitSharingReceivers = new ArrayList<>();
//        ProfitSharingReceiver profitSharingReceiver = new ProfitSharingReceiver();
//        profitSharingReceiver.setAccount("appid对应的openId");
//        profitSharingReceiver.setAmount(1l);
//        profitSharingReceiver.setAccount("appid对应的openId,分账用户1");
//
//
//        //分账百分之5
//        profitSharingReceiver.setAmount(money * 100 / 5);
//        profitSharingReceiver.setAppid(appId);
//        profitSharingReceiver.setType("PERSONAL_OPENID");
//        profitSharingReceiver.setRelationType("PARTNER");
//        profitSharingV3Service.addProfitSharingReceiver(profitSharingReceiver);
        //分账
        ProfitSharingRequest profitSharingRequest = new ProfitSharingRequest();
        profitSharingRequest.setAppid(appId);
        profitSharingRequest.setTransactionId("微信支付订单号");
        profitSharingRequest.setOutOrderNo("业务系统唯一编号");
        //分账完成后,剩余金额自动解冻并返回给商户账号,默认false
        profitSharingRequest.setUnfreezeUnsplit(true);
        //待分账金额1元
        Long money = 1L;
        List<ProfitSharingReceiver> profitSharingReceivers = new ArrayList<>();
        ProfitSharingReceiver profitSharingReceiver = new ProfitSharingReceiver();
        profitSharingReceiver.setAccount("appid对应的openId,分账用户1");
        //分账百分之5
        profitSharingReceiver.setAmount(money * 100 / 5);
        profitSharingReceiver.setAppid(appId);
        profitSharingReceiver.setType("PERSONAL_OPENID");
        profitSharingReceiver.setRelationType("PARTNER");
        profitSharingReceiver.setDescription("test01");
        profitSharingReceivers.add(profitSharingReceiver);
        ProfitSharingReceiver receiver = new ProfitSharingReceiver();
        receiver.setAccount("appid对应的openId,分账用户2");
        //百分之10
        receiver.setAmount(money * 100 / 10);
        receiver.setAppid(appId);
        receiver.setType("PERSONAL_OPENID");
        receiver.setRelationType("PARTNER");
        receiver.setDescription("test02");
        profitSharingReceivers.add(receiver);
        profitSharingRequest.setReceivers(profitSharingReceivers);
        profitSharingV3Service.profitSharing(profitSharingRequest);
//                    Map<String,String> headers = new HashMap<>();
//                    headers.put("Authorization",map.get("sign"));
//                    headers.put("Accept","application/json");
//                    headers.put("Wechatpay-Serial",certPath);
//        profitSharingReceiver.setDescription("test01");
//        profitSharingReceivers.add(profitSharingReceiver);
//
//                    List<Receivers> receivers = new ArrayList<>();
//        ProfitSharingReceiver receiver = new ProfitSharingReceiver();
//        receiver.setAccount("appid对应的openId,分账用户2");
//        //百分之10
//        receiver.setAmount(money * 100 / 10);
//        receiver.setAppid(appId);
//        receiver.setType("PERSONAL_OPENID");
//        receiver.setRelationType("PARTNER");
//        receiver.setDescription("test02");
//        profitSharingReceivers.add(receiver);
//
//                    Map<String,Object> body = new HashMap<>();
//                    body.put("appid",appid);
//                    body.put("transaction_id",map.get("transaction_id"));
//                    body.put("out_order_no",map.get("out_trade_no"));
//                    body.put("receivers",receivers);
//                    body.put("unfreeze_unsplit",true);
                    //支付分账
//                    String url ="https://api.mch.weixin.qq.com/v3/profitsharing/orders";
//                    CloseableHttpResponse closeableHttpResponse = HttpClientUtil.setPostHttpRequset(url, body, headers, "application/json");
//
            return  null;
    }
//        profitSharingRequest.setReceivers(profitSharingReceivers);
//
//        profitSharingV3Service.profitSharing(profitSharingRequest);
//
//
//
//
////                    Map<String,String> headers = new HashMap<>();
////                    headers.put("Authorization",map.get("sign"));
////                    headers.put("Accept","application/json");
////                    headers.put("Wechatpay-Serial",certPath);
////
////                    List<Receivers> receivers = new ArrayList<>();
////
////                    Map<String,Object> body = new HashMap<>();
////                    body.put("appid",appid);
////                    body.put("transaction_id",map.get("transaction_id"));
////                    body.put("out_order_no",map.get("out_trade_no"));
////                    body.put("receivers",receivers);
////                    body.put("unfreeze_unsplit",true);
//
//                    //支付分账
////                    String url ="https://api.mch.weixin.qq.com/v3/profitsharing/orders";
////                    CloseableHttpResponse closeableHttpResponse = HttpClientUtil.setPostHttpRequset(url, body, headers, "application/json");
////
//
//            return  null;
//
//
//
//
//    }
    /**
     * 微信扫码收款