From 02373d1178f3d96f119f9652c168a1d595f700c7 Mon Sep 17 00:00:00 2001 From: hu177768073 <177768073@qq.com> Date: Thu, 7 Nov 2024 17:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hfkj/config/AuthConfig.java | 1 + .../hfkj/controller/BsUserAuthController.java | 80 ++++++++++ .../com/hfkj/controller/BsUserController.java | 137 ++++++++++++++++-- .../java/com/hfkj/common/QRCodeGenerator.java | 2 +- .../com/hfkj/common/alipay/AlipayUtils.java | 10 +- .../com/hfkj/platform/alipay/AlipayUtils.java | 49 +++++++ .../impl/BsUserInviteCodeServiceImpl.java | 2 +- .../BsUserPlatformAuthorizeServiceImpl.java | 5 +- 8 files changed, 267 insertions(+), 19 deletions(-) create mode 100644 bweb/src/main/java/com/hfkj/controller/BsUserAuthController.java create mode 100644 service/src/main/java/com/hfkj/platform/alipay/AlipayUtils.java diff --git a/bweb/src/main/java/com/hfkj/config/AuthConfig.java b/bweb/src/main/java/com/hfkj/config/AuthConfig.java index d32876b..34b638c 100644 --- a/bweb/src/main/java/com/hfkj/config/AuthConfig.java +++ b/bweb/src/main/java/com/hfkj/config/AuthConfig.java @@ -91,6 +91,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/cornucopia/*") .excludePathPatterns("/partner/*") .excludePathPatterns("/userCount/*") + .excludePathPatterns("/userAuth/*") ; } diff --git a/bweb/src/main/java/com/hfkj/controller/BsUserAuthController.java b/bweb/src/main/java/com/hfkj/controller/BsUserAuthController.java new file mode 100644 index 0000000..8eb1ea4 --- /dev/null +++ b/bweb/src/main/java/com/hfkj/controller/BsUserAuthController.java @@ -0,0 +1,80 @@ +package com.hfkj.controller; + +import com.alibaba.fastjson.JSONObject; +import com.alipay.api.request.AlipaySystemOauthTokenRequest; +import com.alipay.api.request.AlipayUserInfoShareRequest; +import com.alipay.api.response.AlipaySystemOauthTokenResponse; +import com.alipay.api.response.AlipayUserInfoShareResponse; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.alipay.AlipayUtils; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsUser; +import com.hfkj.entity.BsUserParentRel; +import com.hfkj.model.ResponseData; +import com.hfkj.service.user.BsUserGradeService; +import com.hfkj.service.user.BsUserParentRelService; +import com.hfkj.service.user.BsUserPlatformAuthorizeService; +import com.hfkj.service.user.BsUserService; +import com.hfkj.sysenum.user.UserGradeEnum; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @className: CmsController + * @author: HuRui + * @date: 2024/9/24 + **/ +@Controller +@RequestMapping(value = "/userAuth") +@Api(value = "用户管理") +public class BsUserAuthController { + private static Logger log = LoggerFactory.getLogger(BsUserAuthController.class); + @Resource + private BsUserService userService; + @Resource + private BsUserGradeService userGradeService; + @Resource + private BsUserParentRelService userParentRelService; + @Resource + private BsUserPlatformAuthorizeService userPlatformAuthorizeService; + + @RequestMapping(value="/alipay",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "支付宝授权") + public ResponseData alipay(@RequestBody JSONObject body) { + try { + if (body == null || StringUtils.isBlank(body.getString("code"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + }/* + AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest(); + request.setGrantType("authorization_code"); + request.setCode(body.getString("code")); + AlipaySystemOauthTokenResponse response = AlipayUtils.initClient().certificateExecute(request); + if(response.isSuccess()){ + return ResponseMsgUtil.success(response); + }*/ + AlipayUserInfoShareRequest request = new AlipayUserInfoShareRequest(); + AlipayUserInfoShareResponse response = AlipayUtils.initClient().certificateExecute(request,body.getString("code")); + if(response.isSuccess()){ + return ResponseMsgUtil.success(response); + } + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取失败"); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/hfkj/controller/BsUserController.java b/bweb/src/main/java/com/hfkj/controller/BsUserController.java index f7f2284..1ff31ba 100644 --- a/bweb/src/main/java/com/hfkj/controller/BsUserController.java +++ b/bweb/src/main/java/com/hfkj/controller/BsUserController.java @@ -10,22 +10,20 @@ import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsUser; import com.hfkj.entity.BsUserParentRel; import com.hfkj.model.ResponseData; -import com.hfkj.service.user.BsUserGradeService; -import com.hfkj.service.user.BsUserParentRelService; -import com.hfkj.service.user.BsUserPlatformAuthorizeService; -import com.hfkj.service.user.BsUserService; +import com.hfkj.service.user.*; +import com.hfkj.sysenum.user.UserAccountRecordSourceTypeEnum; import com.hfkj.sysenum.user.UserGradeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; +import java.math.BigDecimal; +import java.util.*; /** * @className: CmsController @@ -44,6 +42,8 @@ public class BsUserController { @Resource private BsUserParentRelService userParentRelService; @Resource + private BsUserAccountService userAccountService; + @Resource private BsUserPlatformAuthorizeService userPlatformAuthorizeService; @RequestMapping(value="/gradeAdjust",method = RequestMethod.POST) @@ -113,17 +113,132 @@ public class BsUserController { Map param = new HashMap<>(); param.put("user", user); // 授权 - param.put("platform_authorize", userPlatformAuthorizeService.getUserAuth(userId)); + param.put("platformAuthorize", userPlatformAuthorizeService.getUserAuth(userId)); // 邀请人 param.put("inviteUser", user.getInviteUserId()!=null?userService.getUser(user.getInviteUserId()):null); + // 账户 + param.put("account", userAccountService.getAccount(userId)); // 贡献关系 - Map contribute = new HashMap<>(); - param.put("contribute", contribute); + List contribute = new LinkedList<>(); if (user.getInviteUserId() != null) { // 查询用户上级 - BsUserParentRel parent = userParentRelService.getDetailByUserId(userId); + BsUserParentRel parentRel = userParentRelService.getDetailByUserId(userId); + if (parentRel != null && parentRel.getParentUserId() != null) { + + if (UserGradeEnum.grade4.getCode().equals(parentRel.getParentUserGrade())) { + contribute.add(userService.getUser(parentRel.getParentUserId())); + + if (!UserGradeEnum.grade4.getCode().equals(user.getGrade())) { + // 递归判断找到渠道 + BsUserParentRel channel = userParentRelService.getParent(Arrays.asList(UserGradeEnum.grade4), parentRel.getParentUserId()); + if (channel != null) { + contribute.add(userService.getUser(channel.getParentUserId())); + } + } + + } else if (UserGradeEnum.grade3.getCode().equals(parentRel.getParentUserGrade())) { + contribute.add(userService.getUser(parentRel.getParentUserId())); + + if (UserGradeEnum.grade1.getCode().equals(user.getGrade()) || UserGradeEnum.grade2.getCode().equals(user.getGrade())) { + // 递归判断找到团长或渠道 + BsUserParentRel userParentRel = userParentRelService.getParent( + Arrays.asList(UserGradeEnum.grade4, UserGradeEnum.grade3), + parentRel.getParentUserId() + ); + // 团长或渠道 + if (userParentRel != null) { + if (UserGradeEnum.grade3.getCode().equals(userParentRel.getParentUserGrade())) { + contribute.add(userService.getUser(userParentRel.getUserId())); + // 递归判断找到渠道 + userParentRel = userParentRelService.getParent(Arrays.asList(UserGradeEnum.grade4), parentRel.getParentUserId()); + if (userParentRel != null) { + contribute.add(userService.getUser(userParentRel.getParentUserId())); + } + } else if (UserGradeEnum.grade4.getCode().equals(userParentRel.getParentUserGrade())) { + contribute.add(userService.getUser(userParentRel.getParentUserId())); + // 递归判断找到渠道 + BsUserParentRel channel = userParentRelService.getParent(Arrays.asList(UserGradeEnum.grade4), userParentRel.getParentUserId()); + if (channel != null) { + contribute.add(userService.getUser(channel.getParentUserId())); + } + } + } + } else if (UserGradeEnum.grade3.getCode().equals(user.getGrade())) { + // 递归判断找到渠道 + BsUserParentRel userParentRel = userParentRelService.getParent(Arrays.asList(UserGradeEnum.grade4),parentRel.getParentUserId()); + if (userParentRel != null) { + contribute.add(userService.getUser(userParentRel.getUserId())); + + // 递归判断找到渠道 + BsUserParentRel channel = userParentRelService.getParent(Arrays.asList(UserGradeEnum.grade4), userParentRel.getParentUserId()); + if (channel != null) { + contribute.add(userService.getUser(channel.getParentUserId())); + } + } + } + + } else if (UserGradeEnum.grade2.getCode().equals(parentRel.getParentUserGrade())) { + contribute.add(userService.getUser(parentRel.getParentUserId())); + // 递归判断找到团长或渠道 + BsUserParentRel userParentRel = userParentRelService.getParent( + Arrays.asList(UserGradeEnum.grade4, UserGradeEnum.grade3), + parentRel.getParentUserId() + ); + // 团长或渠道 + if (userParentRel != null) { + // 团长 + if (UserGradeEnum.grade3.getCode().equals(userParentRel.getParentUserGrade())) { + contribute.add(userService.getUser(userParentRel.getUserId())); + + // 递归判断找到渠道 + BsUserParentRel channel = userParentRelService.getParent(Arrays.asList(UserGradeEnum.grade4), userParentRel.getParentUserId()); + if (channel != null) { + contribute.add(userService.getUser(channel.getParentUserId())); + } + + // 渠道 + } else if (UserGradeEnum.grade4.getCode().equals(userParentRel.getParentUserGrade())) { + contribute.add(userService.getUser(userParentRel.getUserId())); + + // 递归判断渠道 + BsUserParentRel channel = userParentRelService.getParent(Arrays.asList(UserGradeEnum.grade4), parentRel.getParentUserId()); + if (channel != null) { + contribute.add(userService.getUser(channel.getParentUserId())); + } + } + } + } else if (UserGradeEnum.grade1.getCode().equals(parentRel.getParentUserGrade())) { + // 见习会员 + contribute.add(userService.getUser(parentRel.getParentUserId())); + // 递归判断找到团长或渠道 + BsUserParentRel userParentRel = userParentRelService.getParent( + Arrays.asList(UserGradeEnum.grade4, UserGradeEnum.grade3), + parentRel.getParentUserId()); + // 团长或渠道 + if (userParentRel != null) { + // 团长 + if (UserGradeEnum.grade3.getCode().equals(userParentRel.getParentUserGrade())) { + contribute.add(userService.getUser(userParentRel.getUserId())); + // 递归判断找到渠道 + BsUserParentRel channel = userParentRelService.getParent(Arrays.asList(UserGradeEnum.grade4), userParentRel.getParentUserId()); + if (channel != null) { + contribute.add(userService.getUser(channel.getParentUserId())); + } + // 渠道 + } else if (UserGradeEnum.grade4.getCode().equals(userParentRel.getParentUserGrade())) { + contribute.add(userService.getUser(userParentRel.getUserId())); + // 递归判断找到渠道 + BsUserParentRel channel = userParentRelService.getParent(Arrays.asList(UserGradeEnum.grade4), userParentRel.getParentUserId()); + if (channel != null) { + contribute.add(userService.getUser(channel.getParentUserId())); + } + } + } + } + } } + param.put("contribute", contribute); return ResponseMsgUtil.success(param); diff --git a/service/src/main/java/com/hfkj/common/QRCodeGenerator.java b/service/src/main/java/com/hfkj/common/QRCodeGenerator.java index 1b96a29..34f8884 100644 --- a/service/src/main/java/com/hfkj/common/QRCodeGenerator.java +++ b/service/src/main/java/com/hfkj/common/QRCodeGenerator.java @@ -63,7 +63,7 @@ public class QRCodeGenerator { public static String overlapImage(String path ,String number) { try { // 创建BufferedImage对象 - int width = 115; + int width = 130; int height = 45; BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); diff --git a/service/src/main/java/com/hfkj/common/alipay/AlipayUtils.java b/service/src/main/java/com/hfkj/common/alipay/AlipayUtils.java index 4440cf9..1bcdcd2 100644 --- a/service/src/main/java/com/hfkj/common/alipay/AlipayUtils.java +++ b/service/src/main/java/com/hfkj/common/alipay/AlipayUtils.java @@ -12,11 +12,11 @@ import com.alipay.api.DefaultAlipayClient; **/ public class AlipayUtils { private final static String serverUrl = "https://openapi.alipay.com/gateway.do"; - private final static String appId = "2021004149636316"; - private final static String APP_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCBObA50oioZE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XXJS13Vm74IxGOtP1ZarGwSXAtfH8/NFyT3wQ0+6GK1GY5nPmsd/2f+otd58LImJdKB5kfNUaJboT9aoqVxDYQnEP4aruIbgDfPbN/tQXes0PGgf9AZT/55zVkwpQKBgFD9kkbctKADuHYrU28fOHAe5rcaZA3yNHncZt5kSPsMJC6kS9xE3FERfJ7ZwWi6Edmi7QwgZwhlN2rFzpgkFl15cQnYNH7izT2kq9GK18+BqRswOyh8nMj3KCpnhfo8vI8mUZehZf196kfRPlaooNVkKQN6nc9J2OU68A9s6JTtAoGBAOTabPjBoxWeNQwF2pR4E5SfXaMBKC7a6/+AMn9oUb9lvTPZtxXkIZkvn5iRz2UmrygLw4UCWKC3T7ujFIO0lHWktzVv2qPbINbfW10p0S/ioFvNxzP+ZDfSFrN03Zoh05H+0NXj1e4REMtIrbx5R+sJn6CVftpYfFcQd/lXy8MR"; - private final static String APP_CERT_PATH = "/home/project/oil/cert/alipay/appCertPublicKey_2021004149636316.crt"; - private final static String ALIPAY_CERT_PATH = "/home/project/oil/cert/alipay/alipayCertPublicKey_RSA2.crt"; - private final static String ALIPAY_ROOT_CERT_PATH = "/home/project/oil/cert/alipay/alipayRootCert.crt"; + private final static String appId = "2021004176645906"; + private final static String APP_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCWaLQdwl6E5QVo2RUWquJ1Et4oLRsbfLULQyYT3o6Fs+2ZWOHjjMf6Jg5yVuM3rPa1GNB4+6cBU84gaLQ8WZl9tdQAOhQlnvjOsJA0twb+Lq1Luaa+cOOgp3t3+PuD0nRP9vuPAW3aqrFyjTeDx0vOAzulrWWwS+zLWkUmv96Db5MjlR8gK/pLOszQsk+K3uu06KoyLrCn0K/AIrhJClcEvy/umDfC/P8PnYEgTppNgZ/IBkKp5P9JZzyYEgR7rgD/Z8aWKQ5a8bO0VxC/7FDpCcWNRPdwcHEN8A0ltoO5MNuleZz2q9hrW627qiQNEoaDyqbh/PNFXXLC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OWIWkElc3q8E7DP7bJ19fEkn1XUJZ2wjgX3DuFTXAgSkRws2dwM+3PryyqUKdrHMZR5xCU+0636SWb7vBLAp8W5nSc8eghgMYyRVd6ssaBcA6FyPzCloBOeZ6NgJaWF+UoafBIhSsFu9KMt0LEHUm3/rjnj82DV43M0fL7hs="; + private final static String APP_CERT_PATH = "/home/project/youtao/cert/alipay/appCertPublicKey_2021004176645906.crt"; + private final static String ALIPAY_CERT_PATH = "/home/project/youtao/cert/alipay/alipayCertPublicKey_RSA2.crt"; + private final static String ALIPAY_ROOT_CERT_PATH = "/home/project/youtao/cert/alipay/alipayRootCert.crt"; /** * 初始化客户端请求 diff --git a/service/src/main/java/com/hfkj/platform/alipay/AlipayUtils.java b/service/src/main/java/com/hfkj/platform/alipay/AlipayUtils.java new file mode 100644 index 0000000..f56ffb7 --- /dev/null +++ b/service/src/main/java/com/hfkj/platform/alipay/AlipayUtils.java @@ -0,0 +1,49 @@ +package com.hfkj.platform.alipay; + +import com.alipay.api.AlipayClient; +import com.alipay.api.AlipayConfig; +import com.alipay.api.DefaultAlipayClient; + +/** + * 支付宝配置 + * @className: AlipayConfig + * @author: HuRui + * @date: 2023/2/13 + **/ +public class AlipayUtils { + private final static String serverUrl = "https://openapi.alipay.com/gateway.do"; + private final static String appId = "2021004149636316"; + private final static String APP_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCBObA50oioZEmUGTsSPJghAUf/lRT+TC+9HNyu0To3bSkLZSlEide2kszQnJk32+60QM26OudBaUnUCHkzv0++232hKPzSXHVVUykvu74itAtH66YxO2RqLt/OuTRBnFpiYPs0lXEoNeAsUQ92I6TOCrS8db/76Tvuye0nSH5lAJ6mwq8Hgo/+RQNRvIq3RFvWQOMD5lTp2lWsZ7x4FONtSmPCXd4fdYbKd1QrBHMZCQjBAn12YA+X+lmSNlnFo/xOu5rvKwMGJgvFLYxFdNHXgZUZfrjzOKA+sqq8lRfyVo4YHqR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6JTtAoGBAOTabPjBoxWeNQwF2pR4E5SfXaMBKC7a6/+AMn9oUb9lvTPZtxXkIZkvn5iRz2UmrygLw4UCWKC3T7ujFIO0lHWktzVv2qPbINbfW10p0S/ioFvNxzP+ZDfSFrN03Zoh05H+0NXj1e4REMtIrbx5R+sJn6CVftpYfFcQd/lXy8MR"; + private final static String APP_CERT_PATH = "/home/project/oil/cert/alipay/appCertPublicKey_2021004149636316.crt"; + private final static String ALIPAY_CERT_PATH = "/home/project/oil/cert/alipay/alipayCertPublicKey_RSA2.crt"; + private final static String ALIPAY_ROOT_CERT_PATH = "/home/project/oil/cert/alipay/alipayRootCert.crt"; + + /** + * 初始化客户端请求 + * @return + */ + public static AlipayClient initClient() throws Exception { + AlipayConfig alipayConfig = new AlipayConfig(); + // 设置网关地址 + alipayConfig.setServerUrl(serverUrl); + // 设置应用APPID + alipayConfig.setAppId(appId); + // 设置应用私钥 + alipayConfig.setPrivateKey(APP_PRIVATE_KEY); + // 设置应用公钥证书路径 + alipayConfig.setAppCertPath(APP_CERT_PATH); + // 设置支付宝公钥证书路径 + alipayConfig.setAlipayPublicCertPath(ALIPAY_CERT_PATH); + // 设置支付宝根证书路径 + alipayConfig.setRootCertPath(ALIPAY_ROOT_CERT_PATH); + // 设置请求格式,固定值json + alipayConfig.setFormat("json"); + // 设置字符集 + alipayConfig.setCharset("utf-8"); + // 设置签名类型 + alipayConfig.setSignType("RSA2"); + return new DefaultAlipayClient(alipayConfig); + } + + +} diff --git a/service/src/main/java/com/hfkj/service/user/impl/BsUserInviteCodeServiceImpl.java b/service/src/main/java/com/hfkj/service/user/impl/BsUserInviteCodeServiceImpl.java index 4aba879..7df6969 100644 --- a/service/src/main/java/com/hfkj/service/user/impl/BsUserInviteCodeServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/user/impl/BsUserInviteCodeServiceImpl.java @@ -61,7 +61,7 @@ public class BsUserInviteCodeServiceImpl implements BsUserInviteCodeService { // 生成二维码 String fileUrl = "/userInviteCode/"+data.getUserId()+"_"+System.currentTimeMillis()+".png"; QRCodeGenerator.generateQRCodeImage( - ""+data.getUserId(), + CommonSysConst.getSysConfig().getDomain()+"/"+data.getUserId(), 180, 180, commonSysConfig.getFilesystem() + fileUrl diff --git a/service/src/main/java/com/hfkj/service/user/impl/BsUserPlatformAuthorizeServiceImpl.java b/service/src/main/java/com/hfkj/service/user/impl/BsUserPlatformAuthorizeServiceImpl.java index e290e5b..77fd8e6 100644 --- a/service/src/main/java/com/hfkj/service/user/impl/BsUserPlatformAuthorizeServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/user/impl/BsUserPlatformAuthorizeServiceImpl.java @@ -2,6 +2,7 @@ package com.hfkj.service.user.impl; import com.hfkj.dao.BsUserPlatformAuthorizeMapper; import com.hfkj.entity.BsUserPlatformAuthorize; +import com.hfkj.entity.BsUserPlatformAuthorizeExample; import com.hfkj.service.user.BsUserPlatformAuthorizeService; import org.springframework.stereotype.Service; @@ -33,6 +34,8 @@ public class BsUserPlatformAuthorizeServiceImpl implements BsUserPlatformAuthori @Override public List getUserAuth(Long userId) { - return null; + BsUserPlatformAuthorizeExample example = new BsUserPlatformAuthorizeExample(); + example.createCriteria().andUserIdEqualTo(userId).andStatusNotEqualTo(0); + return userPlatformAuthorizeMapper.selectByExample(example); } }