mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-26 11:51:55 +08:00
2024-09-24 生产配置
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ruoyi.system.api;
|
|||||||
|
|
||||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
||||||
|
import com.ruoyi.common.core.domain.GetSumDto;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.core.domain.http.CustomerApplyLog;
|
import com.ruoyi.common.core.domain.http.CustomerApplyLog;
|
||||||
import com.ruoyi.common.core.domain.http.Merchant;
|
import com.ruoyi.common.core.domain.http.Merchant;
|
||||||
@@ -24,12 +25,12 @@ public interface RemoteCustomerApplyLogService
|
|||||||
* 获取商户今日已申请数
|
* 获取商户今日已申请数
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param merchantId
|
* @param getSumDto
|
||||||
* @param source 请求来源
|
* @param source 请求来源
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("/log/sum")
|
@PostMapping("/log/sum")
|
||||||
public R<Integer> sum(@PathVariable("merchantId") Long merchantId,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
public R<Integer> sum(@RequestBody GetSumDto getSumDto, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户今日是否是否已申请
|
* 获取用户今日是否是否已申请
|
||||||
|
|||||||
@@ -55,8 +55,9 @@ public interface RemoteCustomerService
|
|||||||
/**
|
/**
|
||||||
* 获取用户token
|
* 获取用户token
|
||||||
* @param phone
|
* @param phone
|
||||||
|
* @param channelId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/customer/getCustomerToken")
|
@GetMapping("/customer/getCustomerToken")
|
||||||
public String getCustomerToken(@RequestParam("phone") String phone);
|
public String getCustomerToken(@RequestParam("phone") String phone,@RequestParam("channelId")Long channelId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.system.api.factory;
|
package com.ruoyi.system.api.factory;
|
||||||
|
|
||||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
|
import com.ruoyi.common.core.domain.GetSumDto;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.core.domain.http.CustomerApplyLog;
|
import com.ruoyi.common.core.domain.http.CustomerApplyLog;
|
||||||
import com.ruoyi.common.core.domain.http.Merchant;
|
import com.ruoyi.common.core.domain.http.Merchant;
|
||||||
@@ -32,7 +33,7 @@ public class RemoteCustomerApplyLogFallbackFactory implements FallbackFactory<Re
|
|||||||
return new RemoteCustomerApplyLogService()
|
return new RemoteCustomerApplyLogService()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public R<Integer> sum(@PathVariable("merchantId") Long merchantId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source)
|
public R<Integer> sum(GetSumDto getSumDto, @RequestHeader(SecurityConstants.FROM_SOURCE) String source)
|
||||||
{
|
{
|
||||||
return R.fail("获取商户已申请数失败:" + throwable.getMessage());
|
return R.fail("获取商户已申请数失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class RemoteCustomerFallbackFactory implements FallbackFactory<RemoteCust
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getCustomerToken(String phone) {
|
public String getCustomerToken(String phone, Long channelId) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GetSumDto {
|
||||||
|
|
||||||
|
private Long merchantId;
|
||||||
|
}
|
||||||
@@ -14,12 +14,12 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
@@ -30,12 +30,12 @@ spring:
|
|||||||
eager: true
|
eager: true
|
||||||
transport:
|
transport:
|
||||||
# 控制台地址
|
# 控制台地址
|
||||||
dashboard: 47.109.135.151:8718
|
dashboard: 124.222.144.55:8718
|
||||||
# nacos配置持久化
|
# nacos配置持久化
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
dataId: sentinel-ruoyi-gateway
|
dataId: sentinel-ruoyi-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.btc.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ConfigurationProperties(prefix = "system")
|
||||||
|
@Data
|
||||||
|
public class Config {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加密密钥
|
||||||
|
*/
|
||||||
|
private String AESkey;
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import com.ruoyi.btc.domain.CustomerInfoDto;
|
|||||||
import com.ruoyi.btc.service.ISysPublicAllService;
|
import com.ruoyi.btc.service.ISysPublicAllService;
|
||||||
import com.ruoyi.common.core.constant.CacheConstants;
|
import com.ruoyi.common.core.constant.CacheConstants;
|
||||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
|
import com.ruoyi.common.core.domain.GetSumDto;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.core.domain.http.Channel;
|
import com.ruoyi.common.core.domain.http.Channel;
|
||||||
import com.ruoyi.common.core.domain.http.Customer;
|
import com.ruoyi.common.core.domain.http.Customer;
|
||||||
@@ -108,7 +109,9 @@ public class SysPublicAllServiceImpl implements ISysPublicAllService
|
|||||||
List<Merchant> merchants = new ArrayList<>();
|
List<Merchant> merchants = new ArrayList<>();
|
||||||
for (Merchant merchant:listR.getData()) {
|
for (Merchant merchant:listR.getData()) {
|
||||||
//限量判定
|
//限量判定
|
||||||
R<Integer> sum = remoteCustomerApplyLogService.sum(merchant.getId(), SecurityConstants.INNER);
|
GetSumDto dto = new GetSumDto();
|
||||||
|
dto.setMerchantId(merchant.getId());
|
||||||
|
R<Integer> sum = remoteCustomerApplyLogService.sum(dto, SecurityConstants.INNER);
|
||||||
if (merchant.getLimitType()==1&&merchant.getLimitNum()<=sum.getData()){
|
if (merchant.getLimitType()==1&&merchant.getLimitNum()<=sum.getData()){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,17 +3,18 @@ package com.ruoyi.btc.service.impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.ruoyi.btc.config.Config;
|
||||||
import com.ruoyi.btc.domain.ComPublicHalfDto;
|
import com.ruoyi.btc.domain.ComPublicHalfDto;
|
||||||
import com.ruoyi.btc.domain.CustomerInfoDto;
|
import com.ruoyi.btc.domain.CustomerInfoDto;
|
||||||
import com.ruoyi.btc.service.ISysPublicHalfService;
|
import com.ruoyi.btc.service.ISysPublicHalfService;
|
||||||
import com.ruoyi.common.core.constant.CacheConstants;
|
import com.ruoyi.common.core.constant.CacheConstants;
|
||||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
|
import com.ruoyi.common.core.domain.GetSumDto;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.core.domain.http.Channel;
|
import com.ruoyi.common.core.domain.http.Channel;
|
||||||
import com.ruoyi.common.core.domain.http.Customer;
|
import com.ruoyi.common.core.domain.http.Customer;
|
||||||
import com.ruoyi.common.core.domain.http.CustomerApplyLog;
|
|
||||||
import com.ruoyi.common.core.domain.http.Merchant;
|
import com.ruoyi.common.core.domain.http.Merchant;
|
||||||
import com.ruoyi.common.core.utils.LocalDateTimeUtils;
|
import com.ruoyi.common.core.utils.EncryptUtil;
|
||||||
import com.ruoyi.common.core.utils.ProbitUtil;
|
import com.ruoyi.common.core.utils.ProbitUtil;
|
||||||
import com.ruoyi.common.core.utils.SecureUtils;
|
import com.ruoyi.common.core.utils.SecureUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
@@ -24,7 +25,6 @@ import com.ruoyi.system.api.RemoteCustomerService;
|
|||||||
import com.ruoyi.system.api.RemoteMerchantService;
|
import com.ruoyi.system.api.RemoteMerchantService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -42,6 +42,7 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
|
|||||||
private final RemoteMerchantService remoteMerchantService;
|
private final RemoteMerchantService remoteMerchantService;
|
||||||
private final RemoteCustomerApplyLogService remoteCustomerApplyLogService;
|
private final RemoteCustomerApplyLogService remoteCustomerApplyLogService;
|
||||||
private final RedisService redisService;
|
private final RedisService redisService;
|
||||||
|
private final Config config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 半流程通用撞库
|
* 半流程通用撞库
|
||||||
@@ -81,6 +82,7 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
|
|||||||
customer.setLastLoginTime(new Date());
|
customer.setLastLoginTime(new Date());
|
||||||
customer.setIsAuth(false);
|
customer.setIsAuth(false);
|
||||||
customer.setStatus(2);
|
customer.setStatus(2);
|
||||||
|
customer.setPhoneMd5(customerInfoDto.getPhoneMd5());
|
||||||
R<Customer> customerInfoByPhoneMd5 = remoteCustomerService.getCustomerInfoByPhoneMd5(customerInfoDto.getPhoneMd5(), SecurityConstants.INNER);
|
R<Customer> customerInfoByPhoneMd5 = remoteCustomerService.getCustomerInfoByPhoneMd5(customerInfoDto.getPhoneMd5(), SecurityConstants.INNER);
|
||||||
if (customerInfoByPhoneMd5.getCode()==200){
|
if (customerInfoByPhoneMd5.getCode()==200){
|
||||||
remoteCustomerService.updateByPhoneMd5(customer,SecurityConstants.INNER);
|
remoteCustomerService.updateByPhoneMd5(customer,SecurityConstants.INNER);
|
||||||
@@ -111,7 +113,9 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
|
|||||||
List<Merchant> merchants = new ArrayList<>();
|
List<Merchant> merchants = new ArrayList<>();
|
||||||
for (Merchant merchant:listR.getData()) {
|
for (Merchant merchant:listR.getData()) {
|
||||||
//限量判定
|
//限量判定
|
||||||
R<Integer> sum = remoteCustomerApplyLogService.sum(merchant.getId(), SecurityConstants.INNER);
|
GetSumDto dto = new GetSumDto();
|
||||||
|
dto.setMerchantId(merchant.getId());
|
||||||
|
R<Integer> sum = remoteCustomerApplyLogService.sum(dto, SecurityConstants.INNER);
|
||||||
if (merchant.getLimitType()==1&&merchant.getLimitNum()<=sum.getData()){
|
if (merchant.getLimitType()==1&&merchant.getLimitNum()<=sum.getData()){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -224,6 +228,9 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
|
|||||||
customer.setStatus(1);
|
customer.setStatus(1);
|
||||||
R<Customer> customerInfoByPhoneMd5 = remoteCustomerService.getCustomerInfoByPhoneMd5(customerInfoDto.getPhoneMd5(), SecurityConstants.INNER);
|
R<Customer> customerInfoByPhoneMd5 = remoteCustomerService.getCustomerInfoByPhoneMd5(customerInfoDto.getPhoneMd5(), SecurityConstants.INNER);
|
||||||
if (customerInfoByPhoneMd5.getCode()==200){
|
if (customerInfoByPhoneMd5.getCode()==200){
|
||||||
|
customer.setPhone(EncryptUtil.AESencode(customer.getPhone(), config.getAESkey()));
|
||||||
|
customer.setIdCard(EncryptUtil.AESencode(customer.getIdCard(),config.getAESkey()));
|
||||||
|
customer.setActurlName(EncryptUtil.AESencode(customer.getActurlName(),config.getAESkey()));
|
||||||
remoteCustomerService.updateByPhoneMd5(customer,SecurityConstants.INNER);
|
remoteCustomerService.updateByPhoneMd5(customer,SecurityConstants.INNER);
|
||||||
}else {
|
}else {
|
||||||
remoteCustomerService.add(customer,SecurityConstants.INNER);
|
remoteCustomerService.add(customer,SecurityConstants.INNER);
|
||||||
@@ -240,7 +247,7 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
|
|||||||
result.put("data",map);
|
result.put("data",map);
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
String url = channel.getHtmlLocation() + "?token="+remoteCustomerService.getCustomerToken(customer.getPhone());
|
String url = channel.getHtmlLocation()+"?sign="+channel.getChannelSign() + "&token="+remoteCustomerService.getCustomerToken(customer.getPhone(),channel.getId() );
|
||||||
map.put("url",url);
|
map.put("url",url);
|
||||||
map.put("regist",true);
|
map.put("regist",true);
|
||||||
result.put("data",map);
|
result.put("data",map);
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.file.service;
|
package com.ruoyi.file.service;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -13,6 +14,7 @@ import com.ruoyi.file.utils.FileUploadUtils;
|
|||||||
*/
|
*/
|
||||||
@Primary
|
@Primary
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class LocalSysFileServiceImpl implements ISysFileService
|
public class LocalSysFileServiceImpl implements ISysFileService
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
|
import com.ruoyi.common.core.domain.GetSumDto;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.system.domain.dto.ApplyCallback;
|
import com.ruoyi.system.domain.dto.ApplyCallback;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -47,13 +48,13 @@ public class CustomerApplyLogController extends BaseController
|
|||||||
* 获取商户今日已申请数
|
* 获取商户今日已申请数
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param merchantId
|
* @param getSumDto
|
||||||
* @param source 请求来源
|
* @param source 请求来源
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("/sum")
|
@PostMapping("/sum")
|
||||||
public R<Integer> sum(@PathVariable("merchantId") Long merchantId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source){
|
public R<Integer> sum(@RequestBody GetSumDto getSumDto, @RequestHeader(SecurityConstants.FROM_SOURCE) String source){
|
||||||
return R.ok(customerApplyLogService.getApplySum(merchantId));
|
return R.ok(customerApplyLogService.getApplySum(getSumDto.getMerchantId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class CustomerController extends BaseController
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/updateByPhoneMd5")
|
@PostMapping("/updateByPhoneMd5")
|
||||||
public R updateByPhoneMd5(Customer customer ,@RequestHeader(SecurityConstants.FROM_SOURCE) String source){
|
public R updateByPhoneMd5(@RequestBody Customer customer ,@RequestHeader(SecurityConstants.FROM_SOURCE) String source){
|
||||||
return customerService.updateByPhoneMd5(customer);
|
return customerService.updateByPhoneMd5(customer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ public class CustomerController extends BaseController
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getCustomerToken")
|
@GetMapping("/getCustomerToken")
|
||||||
public String getCustomerToken(@RequestParam("phone") String phone) {
|
public String getCustomerToken(@RequestParam("phone") String phone,@RequestParam("channelId")Long channelId) {
|
||||||
return customerService.getCustomerToken(phone);
|
return customerService.getCustomerToken(phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ import lombok.Data;
|
|||||||
public class MerchantListDto {
|
public class MerchantListDto {
|
||||||
|
|
||||||
//商户名
|
//商户名
|
||||||
String merchantName;
|
private String merchantName;
|
||||||
|
|
||||||
//商户跳转地址
|
//商户跳转地址
|
||||||
String merchantUrl;
|
private String merchantUrl;
|
||||||
|
|
||||||
//商户描述
|
//商户描述
|
||||||
String merchantDescribe;
|
private String merchantDescribe;
|
||||||
|
|
||||||
|
//商户ID
|
||||||
|
private Long merchantId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,13 @@ public interface ICustomerService extends IService<Customer>
|
|||||||
*/
|
*/
|
||||||
String getCustomerToken(String phone);
|
String getCustomerToken(String phone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册并返回token
|
||||||
|
* @param phone
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String registAndretrunToken(String phone,Long channelId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* h5用户登录
|
* h5用户登录
|
||||||
* @param phone
|
* @param phone
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ public class ChannelServiceImpl implements IChannelService
|
|||||||
log.info("初始化渠道数据开始");
|
log.info("初始化渠道数据开始");
|
||||||
List<Channel> channels = channelMapper.selectList(new LambdaQueryWrapper<Channel>());
|
List<Channel> channels = channelMapper.selectList(new LambdaQueryWrapper<Channel>());
|
||||||
for (Channel channel:channels) {
|
for (Channel channel:channels) {
|
||||||
|
redisService.deleteObject(CacheConstants.CHANNEL_ID+channel.getId());
|
||||||
redisService.setCacheObject(CacheConstants.CHANNEL_ID+channel.getId(),channel);
|
redisService.setCacheObject(CacheConstants.CHANNEL_ID+channel.getId(),channel);
|
||||||
|
redisService.deleteObject(CacheConstants.CHANNEL_SIGN+channel.getChannelSign());
|
||||||
redisService.setCacheObject(CacheConstants.CHANNEL_SIGN+channel.getChannelSign(),channel);
|
redisService.setCacheObject(CacheConstants.CHANNEL_SIGN+channel.getChannelSign(),channel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,8 +149,8 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getCustomerToken(String phone) {
|
public String getCustomerToken(String phone) {
|
||||||
log.info("获取用户token,手机号:{},加密结果:{}", phone, EncryptUtil.AESencode(phone, systemConfig.getAESkey()));
|
log.info("获取用户token,手机号:{}", phone);
|
||||||
Customer customer = this.getOne(new LambdaQueryWrapper<Customer>().eq(Customer::getPhone, EncryptUtil.AESencode(phone, systemConfig.getAESkey())));
|
Customer customer = this.getOne(new LambdaQueryWrapper<Customer>().eq(Customer::getPhone, phone));
|
||||||
log.info("获取用户token,用户信息:{}", customer);
|
log.info("获取用户token,用户信息:{}", customer);
|
||||||
//获取到用户登陆的token
|
//获取到用户登陆的token
|
||||||
String token = customerTokenService.getToken(customer.getId());
|
String token = customerTokenService.getToken(customer.getId());
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
|
|||||||
merchantListDto.setMerchantName(merchant.getMerchantName());
|
merchantListDto.setMerchantName(merchant.getMerchantName());
|
||||||
merchantListDto.setMerchantDescribe(merchant.getMerchantDescribe());
|
merchantListDto.setMerchantDescribe(merchant.getMerchantDescribe());
|
||||||
merchantListDto.setMerchantUrl(merchant.getHitUrl());
|
merchantListDto.setMerchantUrl(merchant.getHitUrl());
|
||||||
|
merchantListDto.setMerchantId(merchant.getId());
|
||||||
merchantListDtos.add(merchantListDto);
|
merchantListDtos.add(merchantListDto);
|
||||||
}
|
}
|
||||||
return AjaxResult.success(merchantListDtos);
|
return AjaxResult.success(merchantListDtos);
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
namespace: b8ad3fd2-18ea-4cdf-a82c-4ce483392b1a
|
namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 47.109.135.151:8848
|
server-addr: 124.222.144.55:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
Reference in New Issue
Block a user