From e6788aeddd8554647a52ea28a6991576831bacc5 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 26 十一月 2025 21:10:18 +0800
Subject: [PATCH] update

---
 ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java |  118 ++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 80 insertions(+), 38 deletions(-)

diff --git a/ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java b/ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java
index 1ba2351..65102cc 100644
--- a/ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java
+++ b/ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java
@@ -4,13 +4,13 @@
 import com.baomidou.mybatisplus.plugins.Page;
 import com.stylefeng.guns.core.base.controller.BaseController;
 import com.stylefeng.guns.core.common.constant.factory.PageFactory;
+import com.stylefeng.guns.core.log.LogObjectHolder;
 import com.stylefeng.guns.core.shiro.ShiroKit;
 import com.stylefeng.guns.core.shiro.ShiroUser;
-import com.stylefeng.guns.core.util.ExcelUtil;
-import com.stylefeng.guns.core.util.SinataUtil;
-import com.stylefeng.guns.core.util.ToolUtil;
+import com.stylefeng.guns.core.util.*;
 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.LineShiftDriverMapper;
 import com.stylefeng.guns.modular.system.dao.OrderCancelMapper;
@@ -23,14 +23,13 @@
 import com.unionpay.upyzt.resp.AllocationResp;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.stylefeng.guns.core.log.LogObjectHolder;
+import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
@@ -38,7 +37,10 @@
 import java.math.BigDecimal;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 快车改派管理控制器
@@ -688,20 +690,31 @@
      */
     @RequestMapping(value = "/opt")
     @ResponseBody
-    public Object opt(@RequestParam Integer tReassignId,@RequestParam Integer optType) {
+    public Object opt(@RequestParam Integer tReassignId,@RequestParam Integer optType) throws Exception {
         ShiroUser user = ShiroKit.getUser();
         TReassign tReassign = tReassignService.selectById(tReassignId);
         if (1 == optType){
             Integer originalDriverId = tReassign.getOriginalDriverId();
-            String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney());
-            if("error".equals(allocationReq)){
-                return ResultUtil.error("该司机未进件");
-            }
-            if(!"ok".equals(allocationReq)){
-                return ResultUtil.error(allocationReq);
-            }
+
+
+//            String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney());
+//            if("error".equals(allocationReq)){
+//                return ResultUtil.error("该司机未进件");
+//            }
+//            if(!"ok".equals(allocationReq)){
+//                return ResultUtil.error(allocationReq);
+//            }
 
             TDriver driver = itDriverService.selectById(originalDriverId);
+
+            UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1"));
+            if(null == userWithdrawal){
+                return ResultUtil.error("该司机未进件");
+            }
+
+            FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId());
+
+
             driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney())));
             driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue());
             itDriverService.updateById(driver);
@@ -823,15 +836,25 @@
 
 
                 Integer originalDriverId = tReassign.getOriginalDriverId();
-                String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney());
-                if("error".equals(allocationReq)){
-                    return ResultUtil.error("该司机未进件");
-                }
-                if(!"ok".equals(allocationReq)){
-                    return ResultUtil.error(allocationReq);
-                }
+//                String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney());
+//                if("error".equals(allocationReq)){
+//                    return ResultUtil.error("该司机未进件");
+//                }
+//                if(!"ok".equals(allocationReq)){
+//                    return ResultUtil.error(allocationReq);
+//                }
 
                 TDriver driver = itDriverService.selectById(originalDriverId);
+
+
+                UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1"));
+                if(null == userWithdrawal){
+                    return ResultUtil.error("该司机未进件");
+                }
+
+                FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId());
+
+
                 driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney())));
                 driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue());
                 itDriverService.updateById(driver);
@@ -992,15 +1015,24 @@
             TReassign tReassign = tReassignService.selectById(tReassignId);
             if (1 == optType){
                 Integer originalDriverId = tReassign.getOriginalDriverId();
-                String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney());
-                if("error".equals(allocationReq)){
-                    return ResultUtil.error("该司机未进件");
-                }
-                if(!"ok".equals(allocationReq)){
-                    return ResultUtil.error(allocationReq);
-                }
+//                String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney());
+//                if("error".equals(allocationReq)){
+//                    return ResultUtil.error("该司机未进件");
+//                }
+//                if(!"ok".equals(allocationReq)){
+//                    return ResultUtil.error(allocationReq);
+//                }
 
                 TDriver driver = itDriverService.selectById(originalDriverId);
+
+
+                UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1"));
+                if(null == userWithdrawal){
+                    return ResultUtil.error("该司机未进件");
+                }
+
+                FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId());
+
                 driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney())));
                 driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue());
                 itDriverService.updateById(driver);
@@ -1123,21 +1155,31 @@
      */
     @RequestMapping(value = "/optTaxi")
     @ResponseBody
-    public Object optTaxi(@RequestParam Integer tReassignId,@RequestParam Integer optType) {
+    public Object optTaxi(@RequestParam Integer tReassignId,@RequestParam Integer optType) throws Exception {
         ShiroUser user = ShiroKit.getUser();
         TReassign tReassign = tReassignService.selectById(tReassignId);
         if (1 == optType){
 
             Integer originalDriverId = tReassign.getOriginalDriverId();
-            String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney());
-            if("error".equals(allocationReq)){
-                return ResultUtil.error("该司机未进件");
-            }
-            if(!"ok".equals(allocationReq)){
-                return ResultUtil.error(allocationReq);
-            }
+//            String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney());
+//            if("error".equals(allocationReq)){
+//                return ResultUtil.error("该司机未进件");
+//            }
+//            if(!"ok".equals(allocationReq)){
+//                return ResultUtil.error(allocationReq);
+//            }
 
             TDriver driver = itDriverService.selectById(originalDriverId);
+
+
+            UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1"));
+            if(null == userWithdrawal){
+                return ResultUtil.error("该司机未进件");
+            }
+
+            FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId());
+
+
             driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney())));
             driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue());
             itDriverService.updateById(driver);

--
Gitblit v1.7.1