From 90bbad55c88041f09395587317d06d6d99481e4f Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期六, 22 十一月 2025 18:08:19 +0800
Subject: [PATCH] 提现修改

---
 ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderLogisticsController.java |   55 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderLogisticsController.java b/ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderLogisticsController.java
index b9056dc..7bc71db 100644
--- a/ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderLogisticsController.java
+++ b/ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderLogisticsController.java
@@ -2,14 +2,18 @@
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.plugins.Page;
+import com.mysql.cj.log.Log;
 import com.stylefeng.guns.core.base.controller.BaseController;
 import com.stylefeng.guns.core.common.constant.factory.PageFactory;
 import com.stylefeng.guns.core.shiro.ShiroKit;
 import com.stylefeng.guns.core.shiro.ShiroUser;
+import com.stylefeng.guns.core.util.DateUtil;
+import com.stylefeng.guns.core.util.RequestSeqUtil;
 import com.stylefeng.guns.core.util.SinataUtil;
 import com.stylefeng.guns.core.util.ToolUtil;
 import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample;
 import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq;
+import com.stylefeng.guns.modular.huifu.biz.FenZhangUtil;
 import com.stylefeng.guns.modular.system.controller.util.Base64Util;
 import com.stylefeng.guns.modular.system.dao.OrderCancelMapper;
 import com.stylefeng.guns.modular.system.model.*;
@@ -17,6 +21,7 @@
 import com.stylefeng.guns.modular.system.util.*;
 import com.unionpay.upyzt.exception.UpyztException;
 import com.unionpay.upyzt.resp.AllocationResp;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
@@ -39,6 +44,7 @@
  * @author fengshuonan
  * @Date 2020-09-24 14:20:41
  */
+@Slf4j
 @Controller
 @RequestMapping("/tOrderLogistics")
 public class TOrderLogisticsController extends BaseController {
@@ -304,7 +310,7 @@
         }
 
     }
-    public String createAllocationReqUser(Integer companyId,Integer userId,int type,double money){
+    public String createAllocationReqUser(Integer companyId,Integer userId,int type,double money) throws Exception {
         List<TEnterpriseWithdrawal> tEnterpriseWithdrawals = tEnterpriseWithdrawalService.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", companyId));
         TUser tUser = userService.selectById(userId);
         List<UserWithdrawal> userWithdrawals = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>().eq("phone", tUser.getPhone()));
@@ -313,32 +319,39 @@
         }
         AllocationReq allocationReq= new AllocationReq();
         allocationReq.setOutOrderNo(ToolUtil.getRandomString(32));
+        Map<String, Object> result;
         if(type==1){
 
-            allocationReq.setPayBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId());
-            allocationReq.setRecvBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId());
-
-            allocationReq.setPassword(Base64Util.decode(tEnterpriseWithdrawals.get(0).getTransactionAuthorizationCode()));
+            //allocationReq.setPayBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId());
+            //allocationReq.setRecvBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId());
+            //
+            //allocationReq.setPassword(Base64Util.decode(tEnterpriseWithdrawals.get(0).getTransactionAuthorizationCode()));
+            result = FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.formatDate(new Date(), "yyyyMMdd"), String.valueOf(money), userWithdrawals.get(0).getHuiFuId());
         }else {
-            allocationReq.setRecvBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId());
-            allocationReq.setPayBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId());
-            allocationReq.setPassword(Base64Util.decode(userWithdrawals.get(0).getTransactionAuthorizationCode()));
+            //allocationReq.setRecvBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId());
+            //allocationReq.setPayBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId());
+            //allocationReq.setPassword(Base64Util.decode(userWithdrawals.get(0).getTransactionAuthorizationCode()));
+            result = FenZhangUtil.payFromUser(RequestSeqUtil.generate("TK"), DateUtil.formatDate(new Date(), "yyyyMMdd"), String.valueOf(money), userWithdrawals.get(0).getHuiFuId());
         }
-        money=money*100;
-        allocationReq.setAmount((int)money);
-        allocationReq.setProductName("分账");
-        allocationReq.setProductCount(1);
-        allocationReq.setOrderNo(ToolUtil.getRandomString(32));
-        allocationReq.setOrderAmount(1l);
-        try {
-            AllocationResp allocationResp = AllocationExample.create(allocationReq);
-            System.out.println(allocationResp);
+        if ("00000000".equals(result.get("respCode").toString())) {
             return "ok";
-        } catch (UpyztException e) {
-            e.printStackTrace();
-            return e.getMessage();
+        } else {
+            return result.get("respDesc").toString();
         }
-
+        //money=money*100;
+        //allocationReq.setAmount((int)money);
+        //allocationReq.setProductName("分账");
+        //allocationReq.setProductCount(1);
+        //allocationReq.setOrderNo(ToolUtil.getRandomString(32));
+        //allocationReq.setOrderAmount(1l);
+        //try {
+        //    AllocationResp allocationResp = AllocationExample.create(allocationReq);
+        //    System.out.println(allocationResp);
+        //    return "ok";
+        //} catch (UpyztException e) {
+        //    e.printStackTrace();
+        //    return e.getMessage();
+        //}
     }
 
     /**

--
Gitblit v1.7.1