From 534ab68bd29b6c6aea32093163286fc3da68e59b Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 12 六月 2023 09:59:45 +0800
Subject: [PATCH] 修改提现bug。

---
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java |   64 ++++++++++++++++----------------
 1 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java
index 11fe076..ed05390 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java
@@ -63,7 +63,7 @@
  * @Date 2023-02-20 09:18:08
  */
 @Controller
-@RequestMapping("/tAgent")
+@RequestMapping("")
 public class TAgentController extends BaseController {
 
     private String PREFIX = "/system/tAgent/";
@@ -96,7 +96,7 @@
     /**
      * 跳转到首页
      */
-    @RequestMapping("")
+    @RequestMapping("/tAgent")
     public String index(Model model) {
         model.addAttribute("userType", Objects.requireNonNull(ShiroKit.getUser()).getRoleType());
         return PREFIX + "tAgent.html";
@@ -105,7 +105,7 @@
     /**
      * 跳转到添加
      */
-    @RequestMapping("/tAgent_add")
+    @RequestMapping("/tAgent/tAgent_add")
     public String tAgentAdd() {
         return PREFIX + "tAgent_add.html";
     }
@@ -113,7 +113,7 @@
     /**
      * 跳转到修改
      */
-    @RequestMapping("/tAgent_update/{tAgentId}")
+    @RequestMapping("/tAgent/tAgent_update/{tAgentId}")
     public String tAgentUpdate(@PathVariable Integer tAgentId, Model model) {
         TAgent tAgent = tAgentService.selectById(tAgentId);
         model.addAttribute("item",tAgent);
@@ -124,7 +124,7 @@
     /**
      * 跳转详情页面
      */
-    @RequestMapping("/agentDetail")
+    @RequestMapping("/tAgent/agentDetail")
     public String agentDetail(Integer agentId, Model model) {
         tAgentService.detail(agentId,model);
         return PREFIX + "tAgentDetail.html";
@@ -133,7 +133,7 @@
     /**
      * 跳转区域页面
      */
-    @RequestMapping("/areaDetail")
+    @RequestMapping("/tAgent/areaDetail")
     public String areaDetail(String area,String areaId,Model model) {
 //        String[] split1 = areaId.split("/");
 //        List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0));
@@ -211,7 +211,7 @@
     /**
      * 获取列表
      */
-    @RequestMapping(value = "/list")
+    @RequestMapping(value = "/tAgent/list")
     @ResponseBody
     public Object list(String principal,String principalPhone,String createTime,Integer status) {
         EntityWrapper<TAgent> wrapper = tAgentService.getAgentWrapper(principal,principalPhone,createTime,status);
@@ -223,7 +223,7 @@
     /**
      * 获取列表
      */
-    @RequestMapping(value = "/list-back")
+    @RequestMapping(value = "/tAgent/list-back")
     @ResponseBody
     public Object listBack(String condition) {
         return tAgentService.selectList(null);
@@ -232,7 +232,7 @@
     /**
      * 新增
      */
-    @RequestMapping(value = "/add")
+    @RequestMapping(value = "/tAgent/add")
     @ResponseBody
     @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW)
     public Object add(TAgent tAgent) {
@@ -309,7 +309,7 @@
             registerVO.setUserType("0");
             registerVO.setUserName(tAgent.getMerchantName());
             registerVO.setCertId(tAgent.getMerchantIDCode());
-            registerVO.setNotifyUrl(callbackPath + "/tAgent/microenterpriseCallback");
+            registerVO.setNotifyUrl(callbackPath + "/base/tAgent/microenterpriseCallback");
             TrhRequest<Register> request = new TrhRequest();
             InterfaceResponse execute = request.execute(registerVO, Register.SERVICE_CODE);
             if("0000".equals(execute.getCode())){
@@ -383,7 +383,7 @@
             registerVO.setProvCode(tAgent.getProvCodeEnterprise());
             registerVO.setAreaCode(tAgent.getAreaCodeEnterprise());
             registerVO.setFileNo(tAgent.getFileNo());
-            registerVO.setNotifyUrl(callbackPath + "/tAgent/microenterpriseCallback");
+            registerVO.setNotifyUrl(callbackPath + "/base/tAgent/microenterpriseCallback");
             registerVO.setParameter1(tAgent.getId().toString());
 
             TrhRequest<Register> request = new TrhRequest();
@@ -455,7 +455,7 @@
      * 注册商户回调
      */
     @ResponseBody
-    @PostMapping("/microenterpriseCallback")
+    @PostMapping("/base/tAgent/microenterpriseCallback")
     public void microenterpriseCallback(@RequestBody InterfaceResponse interfaceResponse, HttpServletResponse response){
         try {
             if("0000".equals(interfaceResponse.getCode())) {
@@ -532,7 +532,7 @@
     /**
      * 删除
      */
-    @RequestMapping(value = "/delete")
+    @RequestMapping(value = "/tAgent/delete")
     @ResponseBody
     public Object delete(@RequestParam Integer tAgentId) {
         tAgentService.deleteById(tAgentId);
@@ -542,7 +542,7 @@
     /**
      * 修改用户状态
      */
-    @RequestMapping(value = "/update-status")
+    @RequestMapping(value = "/tAgent/update-status")
     @ResponseBody
     public Object updateStatus(Integer id,Integer status) {
         TAgent tAgent = tAgentService.selectById(id);
@@ -586,7 +586,7 @@
     /**
      * 修改
      */
-    @RequestMapping(value = "/update")
+    @RequestMapping(value = "/tAgent/update")
     @ResponseBody
     public Object update(TAgent tAgent) {
         tAgent.setPrincipal(tAgent.getPrincipal().replace(" ",""));
@@ -597,7 +597,7 @@
     /**
      * 详情
      */
-    @RequestMapping(value = "/detail/{tAgentId}")
+    @RequestMapping(value = "/tAgent/detail/{tAgentId}")
     @ResponseBody
     public Object detail(@PathVariable("tAgentId") Integer tAgentId) {
         return tAgentService.selectById(tAgentId);
@@ -605,21 +605,21 @@
 
 
     @ApiOperation(value = "省市区查询",notes="省市区查询")
-    @RequestMapping(value = "/area")
+    @RequestMapping(value = "/tAgent/area")
     @ResponseBody
     public Object area() {
         return tRegionService.getAreaList();
     }
 
     @ApiOperation(value = "省查询",notes="省查询")
-    @RequestMapping(value = "/areaProvince")
+    @RequestMapping(value = "/tAgent/areaProvince")
     @ResponseBody
     public Object areaProvince(Model model) {
         return tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0));
     }
 
     @ApiOperation(value = "市区查询",notes="市区查询")
-    @RequestMapping(value = "/areaCity")
+    @RequestMapping(value = "/tAgent/areaCity")
     @ResponseBody
     public Object areaCity(Integer parentId) {
         return tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id",parentId));
@@ -627,7 +627,7 @@
 
 
     @ApiOperation(value = "导出代理商列表",notes="导出代理商列表")
-    @RequestMapping(value = "/export")
+    @RequestMapping(value = "/tAgent/export")
     @ResponseBody
     public void export(String principal,String principalPhone,Integer status,String createTime, HttpServletResponse response) {
         try {
@@ -681,7 +681,7 @@
 
 
     @ResponseBody
-    @RequestMapping(value = "/uploadFile")
+    @RequestMapping(value = "/tAgent/uploadFile")
     public String uploadFile(MultipartFile file){
         File srcFile = null;
         String originalFilename = file.getOriginalFilename();
@@ -744,7 +744,7 @@
      * 跳转到企业信息页
      * @return
      */
-    @GetMapping("/showEnterprisePage")
+    @GetMapping("/tAgent/showEnterprisePage")
     public String showEnterprisePage(Model model){
         ShiroUser user = ShiroKit.getUser();
         Integer objectId = user.getObjectId();
@@ -794,7 +794,7 @@
      * @return
      */
     @ResponseBody
-    @PostMapping("/withdrawCash")
+    @PostMapping("/tAgent/withdrawCash")
     public ResultUtil withdrawCash(){
         ShiroUser user = ShiroKit.getUser();
         Integer objectId = user.getObjectId();
@@ -816,7 +816,7 @@
         InterfaceResponse execute = request.execute(queryBalance, QueryBalance.SERVICE_CODE);
         if("0000".equals(execute.getCode())){
             JSONObject jsonObject = JSON.parseObject(execute.getResult());
-            double settledAmount = jsonObject.getDoubleValue("settledAmount");
+            Integer settledAmount = jsonObject.getInteger("settledAmount");
             if(0 == settledAmount){
                 return ResultUtil.error("余额不足");
             }
@@ -825,17 +825,17 @@
             if(roleType == 3){
                 settlementRecord.setObjectId(tAgent.getId());
             }
-            settlementRecord.setAmount(settledAmount);
+            settlementRecord.setAmount(Double.valueOf(settledAmount) / 100);
             settlementRecord.setInsertTime(new Date());
             settlementRecordService.insert(settlementRecord);
 
 
             Withdraw withdraw = new Withdraw();
             withdraw.setUserId(tAgent.getMerchantNumber());
-            withdraw.setAmount(settledAmount + "");
+            withdraw.setAmount(String.valueOf(settledAmount));
             withdraw.setOrderName("账户余额提现");
             withdraw.setRemark("账户余额提现");
-            withdraw.setNotifyUrl(callbackPath + "/tAgent/withdrawCashCallback");
+            withdraw.setNotifyUrl(callbackPath + "/base/tAgent/withdrawCashCallback");
             withdraw.setParameter1(settlementRecord.getId().toString());
             TrhRequest<Withdraw> request1 = new TrhRequest();
             InterfaceResponse execute1 = request1.execute(withdraw, Withdraw.SERVICE_CODE);//结算(提现)
@@ -871,7 +871,7 @@
      * @param interfaceResponse
      */
     @ResponseBody
-    @PostMapping("/withdrawCashCallback")
+    @PostMapping("/base/tAgent/withdrawCashCallback")
     public void withdrawCashCallback(@RequestBody InterfaceResponse interfaceResponse, HttpServletResponse response) {
         try {
             if("0000".equals(interfaceResponse.getCode())){
@@ -908,7 +908,7 @@
      * @return
      */
     @ResponseBody
-    @PostMapping("/accountRecharge")
+    @PostMapping("/tAgent/accountRecharge")
     public ResultUtil accountRecharge(Double amount){
         try {
             SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
@@ -927,8 +927,8 @@
             deposit.setOrderName("补贴充值");
             deposit.setPayType("ALI_CB");
             deposit.setTerminalIp(InetAddress.getLocalHost().getHostAddress());
-            deposit.setFrontUrl(callbackPath + "/tAgent/accountRechargeCallback");
-            deposit.setNotifyUrl(callbackPath + "/tAgent/accountRechargeCallback");
+            deposit.setFrontUrl(callbackPath + "/base/tAgent/accountRechargeCallback");
+            deposit.setNotifyUrl(callbackPath + "/base/tAgent/accountRechargeCallback");
             deposit.setParameter1(rechargeRecord.getId().toString());
             TrhRequest<Deposit> request = new TrhRequest();
             InterfaceResponse execute = request.execute(deposit, Deposit.SERVICE_CODE);
@@ -1009,7 +1009,7 @@
      * @param interfaceResponse
      */
     @ResponseBody
-    @PostMapping("/accountRechargeCallback")
+    @PostMapping("/base/tAgent/accountRechargeCallback")
     public void accountRechargeCallback(@RequestBody InterfaceResponse interfaceResponse, HttpServletResponse response){
         try {
             if("0000".equals(interfaceResponse.getCode())){

--
Gitblit v1.7.1