From 7cb90b47c42b4ee5944964ad62ae89e7e6a2f9ca Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期五, 17 十一月 2023 09:03:36 +0800
Subject: [PATCH] 后台bug修改

---
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/OperatorController.java |   66 +++++++++++++++++++++++++++++++-
 1 files changed, 63 insertions(+), 3 deletions(-)

diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/OperatorController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/OperatorController.java
index 96ac725..9afcddf 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/OperatorController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/OperatorController.java
@@ -153,11 +153,32 @@
         List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
         model.addAttribute("provinceList",list);
         model.addAttribute("data",data);
+        OperatorAuth info = operatorAuthService.getOne(new QueryWrapper<OperatorAuth>().eq("operatorId", id));
+        model.addAttribute("item",info);
+        if (info==null){
+            OperatorAuth operatorAuth = new OperatorAuth();
+            model.addAttribute("item",operatorAuth);
+            model.addAttribute("bodyType",0);
+            model.addAttribute("code",null);
+            model.addAttribute("reasons",null);
+
+        }else{
+            model.addAttribute("code",info.getQrCode());
+            model.addAttribute("item",info);
+            model.addAttribute("bodyType",info.getBodyType());
+            if (info.getRefuseReason()!=null && (!info.getRefuseReason().equals(""))){
+                model.addAttribute("reasons",info.getRefuseReason());
+            }else{
+                model.addAttribute("reasons",null);
+            }
+
+
+        }
         return PREFIX + "OperatorUser_proportionAuth.html";
     }
 
     /**
-     * 商户认证提交
+     * 支付宝商户认证提交
      */
     @RequestMapping(value = "/auth")
     @ResponseBody
@@ -170,8 +191,32 @@
                        String beneficiaryNumber,String beneficiaryAddress,String beneficiaryTerm,String beneficiaryFront,String beneficiaryBack,
                        String remark) {
         UUID uuid = UUID.randomUUID();
-        String numericUUID = uuid.toString().replaceAll("-", "");
+        OperatorAuth data = operatorAuthService.getOne(new QueryWrapper<OperatorAuth>().eq("operatorId", operatorId));
         OperatorAuth operatorAuth = new OperatorAuth();
+        if (data!=null){
+            operatorAuth.setId(data.getId());
+            if(businessPicture==null || businessPicture.equals("")){
+                operatorAuth.setBusinessPicture(data.getBusinessPicture());
+                businessPicture = data.getBusinessPicture();
+            }
+            if(legalFront==null || legalFront.equals("")){
+                legalFront = data.getLegalFront();
+                operatorAuth.setLegalFront(data.getLegalFront());
+            }
+            if(legalBack==null || legalBack.equals("")){
+                legalBack = data.getLegalBack();
+                operatorAuth.setLegalBack(data.getLegalBack());
+            }
+            if(beneficiaryFront==null || beneficiaryFront.equals("")){
+                beneficiaryFront = data.getBeneficiaryFront();
+                operatorAuth.setBeneficiaryFront(data.getBeneficiaryFront());
+            }
+            if(beneficiaryBack==null || beneficiaryBack.equals("")){
+                beneficiaryBack = data.getBeneficiaryBack();
+                operatorAuth.setBeneficiaryBack(data.getBeneficiaryBack());
+            }
+        }
+        String numericUUID = uuid.toString().replaceAll("-", "");
         operatorAuth.setName(name);
         operatorAuth.setPhone(phone);
         operatorAuth.setNumber(number);
@@ -312,7 +357,18 @@
 //            String orderStatus = r.getString("order_status");
             operatorAuth.setOrderNo(order_no);
             operatorAuth.setOrderStatus(order_status);
-            operatorAuthService.save(operatorAuth);
+            operatorAuthService.saveOrUpdate(operatorAuth);
+            // 通过运营商id找到用户id
+            TOperator byId = operatorService.getById(operatorId);
+            if (byId!=null){
+                Integer userId = byId.getUserId();
+                OperatorUser userId1 = operatorUserService.getOne(new QueryWrapper<OperatorUser>().eq("userId", userId));
+                if (userId1!=null){
+                    // 设置为审核中状态
+                    userId1.setAlipayAudit(1);
+                    userId1.setWechatAudit(1);
+                }
+            }
         } else {
             System.out.println("调用失败");
         }
@@ -468,6 +524,9 @@
         operatorUser.setAlipayType(3);
         operatorUser.setWechatType(3);
         operatorUser.setOperatorId(data.getId());
+        // 添加运营商商户认证
+        operatorUser.setAlipayProportion("未设置");
+        operatorUser.setWechatProportion("未设置");
         operatorUserService.save(operatorUser);
         user.setObjectId(data.getId());
         userService.updateById(user);
@@ -513,6 +572,7 @@
             }
         }
 
+
         return ResultUtil.success("添加成功");
     }
     /**

--
Gitblit v1.7.1