From e863d3485d077c90988c81a756b37ef21cf4962e Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期五, 17 十一月 2023 20:16:01 +0800
Subject: [PATCH] 后台bug修改

---
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/TOperatorUserServiceImpl.java |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/TOperatorUserServiceImpl.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/TOperatorUserServiceImpl.java
index 50405ea..0808124 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/TOperatorUserServiceImpl.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/TOperatorUserServiceImpl.java
@@ -1,17 +1,30 @@
 package com.dsh.guns.modular.system.service.impl;
 
+import com.alipay.api.domain.Shop;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dsh.course.dto.StudentSearch;
 import com.dsh.course.dto.TStudentDto;
 import com.dsh.course.feignClient.account.AppUserClient;
+import com.dsh.course.mapper.TOperatorAuthMapper;
+import com.dsh.course.mapper.TOperatorMapper;
 import com.dsh.course.mapper.TOperatorUserMapper;
 import com.dsh.course.mapper.TSiteMapper;
-import com.dsh.guns.modular.system.model.OperatorUser;
-import com.dsh.guns.modular.system.model.TSite;
-import com.dsh.guns.modular.system.model.TStudent;
+import com.dsh.course.util.UUIDUtil;
+import com.dsh.guns.core.exception.ServiceException;
+import com.dsh.guns.modular.system.model.*;
+import com.dsh.guns.modular.system.service.IOperatorAuthService;
 import com.dsh.guns.modular.system.service.IOperatorUserService;
 import com.dsh.guns.modular.system.service.ITStudentService;
+import com.dsh.guns.modular.system.util.WeChatUtil;
+import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsResult;
+import com.github.binarywang.wxpay.service.EcommerceService;
+import com.github.binarywang.wxpay.service.WxPayService;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cloud.commons.util.IdUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -29,8 +42,41 @@
 @Service
 public class TOperatorUserServiceImpl extends ServiceImpl<TOperatorUserMapper, OperatorUser> implements IOperatorUserService {
 
+    @Autowired
+    private IOperatorAuthService operatorAuthService;
+    @Autowired
+    private TOperatorMapper operatorMapper;
+    @Autowired
+    private WeChatUtil weChatUtil;
+
     @Override
-    public List<Map<String, Object>> listAll(Page<Map<String, Object>> page, String province, String city, String userName, String phone, Integer platform, Integer type, Integer state) {
-        return this.baseMapper.listAll(page,province,city,userName,phone,platform,type,state);
+    public void mgtShopAuth(MgtShopAuthDto mgtShopAuthDto) {
+
+        OperatorAuth shopAuthentication = new OperatorAuth();
+
+        if(mgtShopAuthDto.getBlBusinessFoeverFlag()!=null&&mgtShopAuthDto.getBlBusinessFoeverFlag()==1){
+            mgtShopAuthDto.setBlBusinessDeanline("长期");
+        }
+        if(mgtShopAuthDto.getLpIcForeverFlag()!=null&&mgtShopAuthDto.getLpIcForeverFlag()==1){
+            mgtShopAuthDto.setLpIcEndDate("长期");
+        }
+        BeanUtils.copyProperties(mgtShopAuthDto , shopAuthentication);
+        TOperator operator = operatorMapper.selectById(shopAuthentication.getOperatorId());
+        String applyNumber = UUIDUtil.getNativeUUID().replace("-","");
+        shopAuthentication.setOutBizNo(applyNumber);
+        ApplymentsResult applymentsResult;
+        try {
+            applymentsResult = weChatUtil.ecommerceApply(shopAuthentication,applyNumber,operator);
+        } catch (Exception e) {
+            throw new ServiceException(e.getMessage());
+        }
+        shopAuthentication.setOrderStatus("AUDITING");
+        shopAuthentication.setOrderNo(applymentsResult.getApplymentId());
+        operatorAuthService.saveOrUpdate(shopAuthentication);
+    }
+
+    @Override
+    public List<OperatorUserVO> listAll(String province, String city, String userName, String phone, Integer platform, Integer type, Integer state) {
+        return this.baseMapper.listAll(province,city,userName,phone,platform,type,state);
     }
 }

--
Gitblit v1.7.1