Commit 3bbe8915 authored by 后端-谢晨辉's avatar 后端-谢晨辉

[修复] 数据修复增加支付资金账户

parent 7914d5cc
package com.ssy.lingxi.member.merchant.controller.web;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.RoleManageVO;
import com.ssy.lingxi.member.merchant.service.web.IMemberOAuth2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* Description:白名单修复数据后门接口
*
* @Author xiechenhui
* @Date:2021/9/22 16:35
*/
@RestController
@RequestMapping("/member/test")
public class TestController {
@Autowired
private IMemberOAuth2Service memberOAuth2Service;
@RequestMapping(value = "/createMemberAssetAccount", method = RequestMethod.GET)
public Wrapper<Void> createMemberAssetAccount(Long memberId){
memberOAuth2Service.createMemberAssetAccount(memberId);
return Wrapper.success();
}
}
......@@ -67,4 +67,10 @@ public interface IMemberOAuth2Service {
* @return
*/
HttpResponse getLuFileStream(String url) throws UnsupportedEncodingException;
/**
* 增加支付资金账户
* @param memberId
*/
void createMemberAssetAccount(Long memberId);
}
package com.ssy.lingxi.member.merchant.serviceimpl.web;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONArray;
......@@ -11,10 +12,14 @@ import com.ssy.lingxi.common.exception.BusinessException;
import com.ssy.lingxi.common.response.ResponseCode;
import com.ssy.lingxi.member.merchant.api.model.vo.inner.response.MemberFeignUserProjectsVO;
import com.ssy.lingxi.member.merchant.config.LuOAuth2Config;
import com.ssy.lingxi.member.merchant.entity.MemberRelationDO;
import com.ssy.lingxi.member.merchant.model.vo.oauth2.request.MemberOAuth2VO;
import com.ssy.lingxi.member.merchant.model.vo.oauth2.response.MemberEnterpriseInfoVO;
import com.ssy.lingxi.member.merchant.model.vo.oauth2.response.MemberUserProjectsVO;
import com.ssy.lingxi.member.merchant.model.vo.oauth2.response.MemberUserRelatedInfoVO;
import com.ssy.lingxi.member.merchant.repository.MemberRelationAuthRepository;
import com.ssy.lingxi.member.merchant.repository.MemberRelationRepository;
import com.ssy.lingxi.member.merchant.service.feign.IPayFeignService;
import com.ssy.lingxi.member.merchant.service.web.IMemberOAuth2Service;
import com.ssy.lingxi.member.merchant.utils.HttpClientUtil;
import lombok.AllArgsConstructor;
......@@ -24,6 +29,7 @@ import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.*;
......@@ -42,6 +48,12 @@ public class MemberOAuth2ServiceImpl implements IMemberOAuth2Service {
@Autowired
private LuOAuth2Config oAuth2Config;
@Resource
private IPayFeignService payFeignService;
@Autowired
private MemberRelationRepository memberRelationRepository;
/**
* 根据授权码获取accessToken
* @param oAuth2VO 参数
......@@ -232,4 +244,19 @@ public class MemberOAuth2ServiceImpl implements IMemberOAuth2Service {
HttpResponse response = request.execute();
return response;
}
/**
* 增加支付资金账户
* @param memberId
*/
@Override
public void createMemberAssetAccount(Long memberId) {
List<MemberRelationDO> relationDOList = memberRelationRepository.findBySubMemberId(memberId);
if(CollectionUtil.isNotEmpty(relationDOList)){
for (MemberRelationDO relationDO : relationDOList) {
payFeignService.notifyAfterValidatePass(relationDO.getMemberId(), relationDO.getRoleId(), relationDO.getSubMemberId(), relationDO.getSubRoleId());
payFeignService.notifyMemberAssetAccount(relationDO.getMemberId(), relationDO.getMember().getName(), relationDO.getRoleId(), relationDO.getRole().getRoleName(), relationDO.getSubMemberId(), relationDO.getSubMember().getName(), relationDO.getSubRoleId(), relationDO.getSubRoleName(), relationDO.getSubMemberLevelTypeEnum(), relationDO.getSubRole().getMemberType().getTypeEnum(), relationDO.getStatus());
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment