2024-09-15 半流程

pull/379/head
zhp 1 year ago
parent 19c50fe6d5
commit 4c8957660a

@ -37,6 +37,7 @@
<transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
<mybatis-plus.version>3.5.2</mybatis-plus.version>
<lombok.version>1.18.30</lombok.version>
<hutools.version>5.8.26</hutools.version>
</properties>
<!-- 依赖声明 -->
@ -219,7 +220,7 @@
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>
@ -228,6 +229,11 @@
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutools.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

@ -0,0 +1,55 @@
package com.ruoyi.system.api;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.system.api.factory.RemoteCustomerFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
/**
*
*
* @author ruoyi
*/
@FeignClient(contextId = "remoteCustomerService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteCustomerFallbackFactory.class)
public interface RemoteCustomerService
{
/**
*
*
* @param id
* @param source
* @return
*/
@GetMapping("/customer/{id}")
public R<Customer> getCustomerInfoById(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* MD5
*
* @param phoneMD5
* @param source
* @return
*/
@GetMapping("/customer/getByMd5")
public R<Customer> getCustomerInfoByPhoneMd5(@RequestParam("phoneMD5")String phoneMD5, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* MD5
*
* @param customer
* @return
*/
@PostMapping("/customer/updateByPhoneMd5")
public R updateByPhoneMd5(Customer customer ,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
* @return
*/
@PostMapping("/customer/addNewCustomer")
public R add(@RequestBody Customer customer,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

@ -0,0 +1,50 @@
package com.ruoyi.system.api.factory;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.RemoteCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
/**
*
*
* @author ruoyi
*/
@Component
@Slf4j
public class RemoteCustomerFallbackFactory implements FallbackFactory<RemoteCustomerService>
{
@Override
public RemoteCustomerService create(Throwable throwable)
{
log.error("用户服务调用失败:{}", throwable.getMessage());
return new RemoteCustomerService()
{
@Override
public R<Customer> getCustomerInfoById(Long id, String source)
{
return R.fail("获取用户失败:" + throwable.getMessage());
}
@Override
public R<Customer> getCustomerInfoByPhoneMd5(String phoneMD5, String source) {
log.info("查询用户失败:{}",throwable.getMessage());
return R.fail("查询用户失败:" + throwable.getMessage());
}
@Override
public R updateByPhoneMd5(Customer customer, String source) {
return R.fail("更新用户失败:" + throwable.getMessage());
}
@Override
public R add(Customer customer, String source) {
log.info("新增用户失败:{}",throwable.getMessage());
return R.fail("新增用户失败");
}
};
}
}

@ -106,7 +106,15 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
</dependencies>
</project>

@ -56,4 +56,20 @@ public class CacheConstants
* IP cache key
*/
public static final String SYS_LOGIN_BLACKIPLIST = SYS_CONFIG_KEY + "sys.login.blackIPList";
public static final String PROJET = "xymz:";
/**
* redis
*/
public static final String CHANNEL_ID = PROJET + "channel:id:";
/**
* redis
*/
public static final String CHANNEL_SIGN = PROJET + "channel:sign:";
/**
* redis
*/
public static final String MERCHANT = PROJET + "merchant:key:";
}

@ -0,0 +1,121 @@
package com.ruoyi.common.core.domain.http;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* customer
*
* @author ruoyi
* @date 2024-09-15
*/
@Data
public class Customer extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 年龄 */
@Excel(name = "年龄")
private Integer age;
/** 0 男 1 女 */
@Excel(name = "0 男 1 女")
private Integer sex;
/** 昵称 */
@Excel(name = "昵称")
private String name;
/** 真实姓名 */
@Excel(name = "真实姓名")
private String acturlName;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 手机号MD5 */
@Excel(name = "手机号MD5")
private String phoneMd5;
/** 0 未实名 1已实名 */
@Excel(name = "0 未实名 1已实名")
private Boolean isAuth;
/** 城市 */
@Excel(name = "城市")
private String city;
/** 城市编码 */
@Excel(name = "城市编码")
private Integer cityCode;
/** 首次登录时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "首次登录时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date firstLoginTime;
/** 最后登录时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastLoginTime;
/** 最后登录IP */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后登录IP", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastLoginIp;
/** 用户状态 1正常 2异常 可继续扩展 */
@Excel(name = "用户状态 1正常 2异常 可继续扩展")
private Integer status;
/** 无社保 */
@Excel(name = "社保")
private Integer socialSecurity;
/** 无车 */
@Excel(name = "车")
private Integer car;
/** 保单缴纳不满一年 */
@Excel(name = "保单")
private Integer guaranteeSlip;
/** 初中 */
@Excel(name = "学历")
private Integer education;
/** 公积金未满6个月 */
@Excel(name = "公积金")
private Integer accumulationFund;
/** 本地无房 */
@Excel(name = "房")
private Integer hourse;
/** 上班族 */
@Excel(name = "职业")
private Integer career;
/** 花呗5000以下 */
@Excel(name = "花呗")
private Integer huaBei;
/** 白条5000以下 */
@Excel(name = "白条")
private Integer baiTiao;
/** 芝麻分 */
@Excel(name = "芝麻分")
private Integer zhiMa;
}

@ -0,0 +1,504 @@
package com.ruoyi.common.core.utils;
import com.ruoyi.common.core.constant.HttpStatus;
import lombok.extern.slf4j.Slf4j;
import javax.crypto.*;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Base64;
import java.util.Objects;
import java.util.Random;
import java.util.regex.Pattern;
/**
* @author LiYu
* @ClassName SecureUtil.java
* @Description
* @createTime 20240520 11:04:00
*/
@Slf4j
public class SecureUtils {
/**
* md5
*/
public static class Md5Util {
/**
* md5
*
* @param str
* @return
*/
public static boolean isMd5(String str) {
return str.matches("^[a-f0-9]{32}$");
}
/**
* MD5
*
* @param str
* @return
*/
public static String md5ToUpperCase(String str) {
return StringUtils.hasText(str) ? isMd5(str) ? str : cn.hutool.crypto.SecureUtil.md5(str).toUpperCase() : null;
}
/**
* MD5
*
* @param str
* @return
*/
public static String md5ToLowerCase(String str) {
return StringUtils.hasText(str) ? isMd5(str) ? str : cn.hutool.crypto.SecureUtil.md5(str).toLowerCase() : null;
}
/**
* MD5
*
* @param str
* @return
*/
public static String md5(String str) {
return StringUtils.hasText(str) ? isMd5(str) ? str : cn.hutool.crypto.SecureUtil.md5(str) : null;
}
}
/**
* des
*/
public static class DesUtil {
/**
* key
*/
public static final String KEY = "_@Ks`Y*9jLb.hvho}C;GwDpw";
/**
*
*/
public static final String IV = "2%8iTpSi";
/**
*
*
* @param iv
* @param mode
* @return
*/
private static Cipher createCipher(String iv, int mode) throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, InvalidAlgorithmParameterException {
byte[] key = KEY.getBytes();
Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding");
IvParameterSpec ivParameterSpec = new IvParameterSpec(iv.getBytes());
cipher.init(mode, new SecretKeySpec(key, "DESede"), ivParameterSpec);
return cipher;
}
/**
*
*
* @param data
* @param iv
* @return
*/
public static String encrypt(String data, String iv) {
try {
Cipher cipher = createCipher(iv, Cipher.ENCRYPT_MODE);
return URLEncoder.encode(Base64.getEncoder().encodeToString(cipher.doFinal(data.getBytes())), "UTF-8");
} catch (Exception e) {
log.error("加密失败", e);
}
return null;
}
/**
*
*
* @param data
* @return
*/
public static String encrypt(String data) {
return encrypt(data, IV);
}
/**
*
*
* @param data
* @param iv
* @return
*/
public static String decrypt(String data, String iv) {
try {
Cipher cipher = createCipher(iv, Cipher.DECRYPT_MODE);
return new String(cipher.doFinal(Base64.getDecoder().decode(URLDecoder.decode(data, "UTF-8"))));
} catch (Exception e) {
log.error("解密失败", e);
}
return null;
}
/**
*
*
* @param data
* @return
*/
public static String decrypt(String data) {
return decrypt(data, IV);
}
}
/**
* AES
*/
public static class AesUtil {
/**
* ECB//
*/
public static final String AES_ECB = "AES/ECB/PKCS5Padding";
/**
* CBC//
*/
public static final String AES_CBC = "AES/CBC/PKCS5Padding";
/**
* CFB//
*/
public static final String AES_CFB = "AES/CFB/PKCS5Padding";
/**
* AES IV 16 128
*/
public static final Integer IV_LENGTH = 16;
/***
*
* @param str
*/
public static boolean isEmpty(Object str) {
return null == str || "".equals(str);
}
/***
* String byte
* @param str
*/
public static byte[] getBytes(String str) {
if (isEmpty(str)) {
return null;
}
try {
return str.getBytes(StandardCharsets.UTF_8);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/***
* IV
*/
public static String getIv() {
String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
Random random = new Random();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < IV_LENGTH; i++) {
int number = random.nextInt(str.length());
sb.append(str.charAt(number));
}
return sb.toString();
}
/***
* AES
*/
public static SecretKeySpec getSecretKeySpec(String key) {
return new SecretKeySpec(Objects.requireNonNull(getBytes(key)), "AES");
}
/**
* - ECB
*
* @param text
* @param key key
*/
public static String encrypt(String text, String key) {
if (isEmpty(text) || isEmpty(key)) {
return null;
}
try {
// 创建AES加密器
Cipher cipher = Cipher.getInstance(AES_ECB);
SecretKeySpec secretKeySpec = getSecretKeySpec(key);
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
// 加密字节数组
byte[] encryptedBytes = cipher.doFinal(Objects.requireNonNull(getBytes(text)));
// 将密文转换为 Base64 编码字符串
return Base64.getEncoder().encodeToString(encryptedBytes);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* - ECB
*
* @param text
* @param key key
*/
public static String decrypt(String text, String key) {
if (isEmpty(text) || isEmpty(key)) {
return null;
}
// 将密文转换为16字节的字节数组
byte[] textBytes = Base64.getDecoder().decode(text);
try {
// 创建AES加密器
Cipher cipher = Cipher.getInstance(AES_ECB);
SecretKeySpec secretKeySpec = getSecretKeySpec(key);
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
// 解密字节数组
byte[] decryptedBytes = cipher.doFinal(textBytes);
// 将明文转换为字符串
return new String(decryptedBytes, StandardCharsets.UTF_8);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* -
*
* @param text
* @param key key
* @param iv
* @param mode
*/
public static String encrypt(String text, String key, String iv, String mode) {
if (isEmpty(text) || isEmpty(key) || isEmpty(iv)) {
return null;
}
try {
// 创建AES加密器
Cipher cipher = Cipher.getInstance(mode);
SecretKeySpec secretKeySpec = getSecretKeySpec(key);
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, new IvParameterSpec(Objects.requireNonNull(getBytes(iv))));
// 加密字节数组
byte[] encryptedBytes = cipher.doFinal(Objects.requireNonNull(getBytes(text)));
// 将密文转换为 Base64 编码字符串
return Base64.getEncoder().encodeToString(encryptedBytes);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
*
*
* @param content
* @param password
* @return
*/
public static String AesEncode(String content, String password) {
try {
byte[] encryptResult = encryptByte(content, password);
return Base64Util.encode(encryptResult);
} catch (Exception e) {
log.error("加密出现问题!", e);
e.printStackTrace();
}
return null;
}
/**
*
*
* @param content
* @param password
* @return
*/
public static String AesDecode(String content, String password) {
try {
byte[] decryptResult = decryptByte(Base64Util.decodeToByteArray(content), password);
return new String(decryptResult, StandardCharsets.UTF_8);
} catch (Exception e) {
log.error("解密出现问题!", e);
return null;
}
}
/**
* - CBC
*
* @param text
* @param key key
* @param iv
* @return
*/
public static String encryptCbc(String text, String key, String iv) {
return encrypt(text, key, iv, AES_CBC);
}
/**
* -
*
* @param text
* @param key key
* @param iv
* @param mode
*/
public static String decrypt(String text, String key, String iv, String mode) {
if (isEmpty(text) || isEmpty(key) || isEmpty(iv)) {
return null;
}
// 将密文转换为16字节的字节数组
byte[] textBytes = Base64.getDecoder().decode(text);
try {
// 创建AES加密器
Cipher cipher = Cipher.getInstance(mode);
SecretKeySpec secretKeySpec = getSecretKeySpec(key);
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, new IvParameterSpec(Objects.requireNonNull(getBytes(iv))));
// 解密字节数组
byte[] decryptedBytes = cipher.doFinal(textBytes);
// 将明文转换为字符串
return new String(decryptedBytes, StandardCharsets.UTF_8);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
*
*
* @param content
* @param password
* @return
*/
private static byte[] decryptByte(byte[] content, String password)
throws Exception {
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
secureRandom.setSeed(password.getBytes());
keyGenerator.init(128, secureRandom);
SecretKey secretKey = keyGenerator.generateKey();
byte[] enCodeFormat = secretKey.getEncoded();
SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.DECRYPT_MODE, key);
return cipher.doFinal(content);
}
/**
*
*
* @param content
* @param password
* @return
*/
private static byte[] encryptByte(String content, String password)
throws Exception {
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
secureRandom.setSeed(password.getBytes());
keyGenerator.init(128, secureRandom);
SecretKey secretKey = keyGenerator.generateKey();
byte[] enCodeFormat = secretKey.getEncoded();
SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
Cipher cipher = Cipher.getInstance("AES");// 创建密码器
byte[] byteContent = content.getBytes(StandardCharsets.UTF_8);
cipher.init(Cipher.ENCRYPT_MODE, key);
return cipher.doFinal(byteContent);
}
/**
* - CBC
*
* @param text
* @param key key
* @param iv
* @return
*/
public static String decryptCbc(String text, String key, String iv) {
return decrypt(text, key, iv, AES_CBC);
}
}
/**
* Base64
*/
public static class Base64Util {
/**
* Base64
*
* @param input
* @return Base64
*/
public static String encode(String input) {
return Base64.getEncoder().encodeToString(input.getBytes());
}
/**
* Base64
*
* @param input Base64
* @return
*/
public static String decode(String input) {
byte[] decodedBytes = Base64.getDecoder().decode(input);
return new String(decodedBytes);
}
/**
* Base64
*
* @param input
* @return Base64
*/
public static String encode(byte[] input) {
return Base64.getEncoder().encodeToString(input);
}
/**
* Base64
*
* @param input Base64
* @return
*/
public static byte[] decodeToByteArray(String input) {
return Base64.getDecoder().decode(input);
}
/**
* Base64
*
* @param str
* @return
*/
public static boolean isBase64(String str) {
String base64Pattern = "^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$";
return Pattern.matches(base64Pattern, str);
}
}
public static void main(String[] args) {
}
}

@ -0,0 +1,9 @@
package com.ruoyi.common.core.utils.match;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class MatchQualification {
}

@ -1,6 +1,7 @@
package com.ruoyi.btc.service;
import com.ruoyi.btc.domain.ComPublicHalfDto;
import com.ruoyi.common.core.web.domain.AjaxResult;
/**
*
@ -14,18 +15,18 @@ public interface ISysPublicHalfService
*
* @param comPublicHalfDto
*/
void check(ComPublicHalfDto comPublicHalfDto);
AjaxResult check(ComPublicHalfDto comPublicHalfDto);
/**
*
* @param comPublicHalfDto
*/
void input(ComPublicHalfDto comPublicHalfDto);
AjaxResult input(ComPublicHalfDto comPublicHalfDto);
/**
*
* @param comPublicHalfDto
*/
void checkOrder(ComPublicHalfDto comPublicHalfDto);
AjaxResult checkOrder(ComPublicHalfDto comPublicHalfDto);
}

@ -1,10 +1,23 @@
package com.ruoyi.btc.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.btc.domain.ComPublicHalfDto;
import com.ruoyi.btc.domain.CustomerInfoDto;
import com.ruoyi.btc.service.ISysPublicHalfService;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.common.core.utils.SecureUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.RemoteCustomerService;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
*
*
@ -12,28 +25,104 @@ import org.springframework.stereotype.Service;
*/
@Primary
@Service
@RequiredArgsConstructor
public class SysPublicHalfServiceImpl implements ISysPublicHalfService
{
private final RemoteCustomerService remoteCustomerService;
/**
*
* @param comPublicHalfDto
*/
@Override
public void check(ComPublicHalfDto comPublicHalfDto) {
public AjaxResult check(ComPublicHalfDto comPublicHalfDto) {
//校验 IP地址是否正常 渠道标识是否存在 数据是否为空
if (StringUtils.isEmpty(comPublicHalfDto.getChannelSignature())){
return AjaxResult.error("渠道标识不能未空");
}
if (StringUtils.isEmpty(comPublicHalfDto.getData())){
return AjaxResult.error("加密数据不能为空");
}
//解密为customerInfoDto
String s = SecureUtils.AesUtil.AesDecode(comPublicHalfDto.getData(), comPublicHalfDto.getChannelSignature());
if (s==null){
return AjaxResult.error("解密异常");
}
CustomerInfoDto customerInfoDto = JSONObject.parseObject(s, CustomerInfoDto.class);
//校验数据必传参数是否未传
String checkData = checkData(customerInfoDto);
if (checkData!=null){
return AjaxResult.error(checkData);
}
//转化字段未数据库中资质字段 并保存 用户未实名状态 一并保存用户申请记录 未申请状态
Customer customer = new Customer();
BeanUtil.copyProperties(customerInfoDto,customer);
customer.setActurlName(customerInfoDto.getNameMd5());
customer.setFirstLoginTime(new Date());
customer.setLastLoginTime(new Date());
customer.setIsAuth(false);
customer.setStatus(2);
R<Customer> customerInfoByPhoneMd5 = remoteCustomerService.getCustomerInfoByPhoneMd5(customerInfoDto.getPhoneMd5(), SecurityConstants.INNER);
if (customerInfoByPhoneMd5.getCode()==200){
remoteCustomerService.updateByPhoneMd5(customer,SecurityConstants.INNER);
}else {
remoteCustomerService.add(customer,SecurityConstants.INNER);
}
//匹配资质 造轮子 返回多个符合的商户
//结束返回上游结果
return null;
}
/**
*
* @param customerInfoDto
*/
private String checkData(CustomerInfoDto customerInfoDto) {
if (customerInfoDto.getAge()==null){
return "年龄不能为空";
}
if (StringUtils.isEmpty(customerInfoDto.getPhoneMd5())){
return "手机号MD5不能为空";
}
if (StringUtils.isEmpty(customerInfoDto.getCity())){
return "城市不能为空";
}
if (customerInfoDto.getCityCode()==null){
return "城市编码不能为空";
}
if (customerInfoDto.getSocialSecurity()==null){
return "本地社保不能为空";
}
if (customerInfoDto.getAccumulationFund()==null){
return "本地公积金不能为空";
}
if (customerInfoDto.getCar()==null){
return "车产不能为空";
}
if (customerInfoDto.getHourse()==null){
return "房产不能为空";
}
if (customerInfoDto.getGuarantee()==null){
return "房产不能为空";
}
if (customerInfoDto.getZhiMa()==null){
return "芝麻分不能为空";
}
if (customerInfoDto.getCareer()==null){
return "职业不能为空";
}
if (customerInfoDto.getCreditCard()==null){
return "信用卡不能为空";
}
if (customerInfoDto.getEducation()==null){
return "学历不能为空";
}
if (customerInfoDto.getMonthlyIncome()==null){
return "月收入不能为空";
}
return null;
}
/**
@ -41,7 +130,7 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
* @param comPublicHalfDto
*/
@Override
public void input(ComPublicHalfDto comPublicHalfDto) {
public AjaxResult input(ComPublicHalfDto comPublicHalfDto) {
//校验 IP地址是否正常 渠道标识是否存在 数据是否为空
//解密为customerInfoDto
@ -57,7 +146,7 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
//返回渠道绑定的注册页拼接token
//返回上游信息
return null;
}
/**
@ -65,7 +154,7 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
* @param comPublicHalfDto
*/
@Override
public void checkOrder(ComPublicHalfDto comPublicHalfDto) {
public AjaxResult checkOrder(ComPublicHalfDto comPublicHalfDto) {
//根据手机号MD5渠道标识 查询是否成功
//失败直接失败
@ -73,5 +162,6 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
//成功抽奖 按扣量比抽
//返回是否成功
return null;
}
}

@ -71,6 +71,11 @@
<artifactId>ruoyi-common-swagger</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
</dependencies>
<build>

@ -1,21 +1,16 @@
package com.ruoyi.system.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.system.domain.Customer;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.system.service.ICustomerService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
@ -70,6 +65,40 @@ public class CustomerController extends BaseController
return success(customerService.selectCustomerById(id));
}
/**
* MD5
*
* @param phoneMD5
* @return
*/
@GetMapping("/getByMd5")
public R<Customer> getCustomerInfoByPhoneMd5(@RequestParam("phoneMD5")String phoneMD5){
return customerService.selectByPhoneMd5(phoneMD5);
}
/**
* MD5
*
* @param customer
* @return
*/
@PostMapping("/updateByPhoneMd5")
public R updateByPhoneMd5(Customer customer ,@RequestHeader(SecurityConstants.FROM_SOURCE) String source){
return customerService.updateByPhoneMd5(customer);
}
/**
*
* @return
*/
@PostMapping("/customer/addNewCustomer")
public R add(@RequestBody Customer customer,@RequestHeader(SecurityConstants.FROM_SOURCE) String source){
boolean save = customerService.save(customer);
if (save){
return R.ok();
}
return R.fail();
}
/**
*
*/

@ -1,660 +0,0 @@
package com.ruoyi.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* customer
*
* @author ruoyi
* @date 2024-09-15
*/
public class Customer extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 年龄 */
@Excel(name = "年龄")
private Long age;
/** 0 男 1 女 */
@Excel(name = "0 男 1 女")
private Long sex;
/** 昵称 */
@Excel(name = "昵称")
private String name;
/** 真实姓名 */
@Excel(name = "真实姓名")
private String acturlName;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 手机号MD5 */
@Excel(name = "手机号MD5")
private String phoneMd5;
/** 0 未实名 1已实名 */
@Excel(name = "0 未实名 1已实名")
private Long isAuth;
/** 城市 */
@Excel(name = "城市")
private String city;
/** 城市编码 */
@Excel(name = "城市编码")
private Long cityCode;
/** 首次登录时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "首次登录时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date firstLoginTime;
/** 最后登录时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastLoginTime;
/** 最后登录IP */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后登录IP", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastLoginIp;
/** 用户状态 1正常 2异常 可继续扩展 */
@Excel(name = "用户状态 1正常 2异常 可继续扩展")
private Long status;
/** 无社保 */
@Excel(name = "无社保")
private Long socialSecurityNo;
/** 社保未满6个月 */
@Excel(name = "社保未满6个月")
private Long socialSecurityLow;
/** 社保6个月以上 */
@Excel(name = "社保6个月以上")
private Long socialSecurityHigh;
/** 无车 */
@Excel(name = "无车")
private Long carNo;
/** 有车 */
@Excel(name = "有车")
private Long carHave;
/** 保单缴纳不满一年 */
@Excel(name = "保单缴纳不满一年")
private Long guaranteeSlipLow;
/** 保单缴纳一年以上 */
@Excel(name = "保单缴纳一年以上")
private Long guaranteeSlipCentre;
/** 保单缴纳2年以上 */
@Excel(name = "保单缴纳2年以上")
private Long guaranteeSlipHigh;
/** 初中 */
@Excel(name = "初中")
private Long educationMiddle;
/** 高中 */
@Excel(name = "高中")
private Long educationHighSchool;
/** 中专 */
@Excel(name = "中专")
private Long educationPolytechnic;
/** 大专 */
@Excel(name = "大专")
private Long educationJuniorCollege;
/** 本科 */
@Excel(name = "本科")
private Long educationUndergraduateCourse;
/** 研究生及以上 */
@Excel(name = "研究生及以上")
private Long educationPostgraduate;
/** 公积金未满6个月 */
@Excel(name = "公积金未满6个月")
private Long accumulationFundLow;
/** 公积金满6个月以上 */
@Excel(name = "公积金满6个月以上")
private Long accumulationFundHigh;
/** 本地无房 */
@Excel(name = "本地无房")
private Long hourseNo;
/** 本地全款房 */
@Excel(name = "本地全款房")
private Long hourseFullPayment;
/** 本地按揭 */
@Excel(name = "本地按揭")
private Long hourseMortgaging;
/** 上班族 */
@Excel(name = "上班族")
private Long officeWorker;
/** 公务员 */
@Excel(name = "公务员")
private Long civilServant;
/** 私营业主 */
@Excel(name = "私营业主")
private Long privatePropertyOwners;
/** 个体户 */
@Excel(name = "个体户")
private Long selfEmployedPerson;
/** 其他职业 */
@Excel(name = "其他职业")
private Long otherOccupations;
/** 花呗5000以下 */
@Excel(name = "花呗5000以下")
private Long huaBeiLow;
/** 花呗5000-10000 */
@Excel(name = "花呗5000-10000")
private Long huaBeiMiddle;
/** 花呗10000以上 */
@Excel(name = "花呗10000以上")
private Long huaBeiHigh;
/** 白条5000以下 */
@Excel(name = "白条5000以下")
private Long baiTiaoLow;
/** 白条5000-10000 */
@Excel(name = "白条5000-10000")
private Long baiTiaoMiddle;
/** 白条10000以上 */
@Excel(name = "白条10000以上")
private Long baiTiaoHigh;
/** 芝麻分 */
@Excel(name = "芝麻分")
private Long zhiMa;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAge(Long age)
{
this.age = age;
}
public Long getAge()
{
return age;
}
public void setSex(Long sex)
{
this.sex = sex;
}
public Long getSex()
{
return sex;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setActurlName(String acturlName)
{
this.acturlName = acturlName;
}
public String getActurlName()
{
return acturlName;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setPhoneMd5(String phoneMd5)
{
this.phoneMd5 = phoneMd5;
}
public String getPhoneMd5()
{
return phoneMd5;
}
public void setIsAuth(Long isAuth)
{
this.isAuth = isAuth;
}
public Long getIsAuth()
{
return isAuth;
}
public void setCity(String city)
{
this.city = city;
}
public String getCity()
{
return city;
}
public void setCityCode(Long cityCode)
{
this.cityCode = cityCode;
}
public Long getCityCode()
{
return cityCode;
}
public void setFirstLoginTime(Date firstLoginTime)
{
this.firstLoginTime = firstLoginTime;
}
public Date getFirstLoginTime()
{
return firstLoginTime;
}
public void setLastLoginTime(Date lastLoginTime)
{
this.lastLoginTime = lastLoginTime;
}
public Date getLastLoginTime()
{
return lastLoginTime;
}
public void setLastLoginIp(Date lastLoginIp)
{
this.lastLoginIp = lastLoginIp;
}
public Date getLastLoginIp()
{
return lastLoginIp;
}
public void setStatus(Long status)
{
this.status = status;
}
public Long getStatus()
{
return status;
}
public void setSocialSecurityNo(Long socialSecurityNo)
{
this.socialSecurityNo = socialSecurityNo;
}
public Long getSocialSecurityNo()
{
return socialSecurityNo;
}
public void setSocialSecurityLow(Long socialSecurityLow)
{
this.socialSecurityLow = socialSecurityLow;
}
public Long getSocialSecurityLow()
{
return socialSecurityLow;
}
public void setSocialSecurityHigh(Long socialSecurityHigh)
{
this.socialSecurityHigh = socialSecurityHigh;
}
public Long getSocialSecurityHigh()
{
return socialSecurityHigh;
}
public void setCarNo(Long carNo)
{
this.carNo = carNo;
}
public Long getCarNo()
{
return carNo;
}
public void setCarHave(Long carHave)
{
this.carHave = carHave;
}
public Long getCarHave()
{
return carHave;
}
public void setGuaranteeSlipLow(Long guaranteeSlipLow)
{
this.guaranteeSlipLow = guaranteeSlipLow;
}
public Long getGuaranteeSlipLow()
{
return guaranteeSlipLow;
}
public void setGuaranteeSlipCentre(Long guaranteeSlipCentre)
{
this.guaranteeSlipCentre = guaranteeSlipCentre;
}
public Long getGuaranteeSlipCentre()
{
return guaranteeSlipCentre;
}
public void setGuaranteeSlipHigh(Long guaranteeSlipHigh)
{
this.guaranteeSlipHigh = guaranteeSlipHigh;
}
public Long getGuaranteeSlipHigh()
{
return guaranteeSlipHigh;
}
public void setEducationMiddle(Long educationMiddle)
{
this.educationMiddle = educationMiddle;
}
public Long getEducationMiddle()
{
return educationMiddle;
}
public void setEducationHighSchool(Long educationHighSchool)
{
this.educationHighSchool = educationHighSchool;
}
public Long getEducationHighSchool()
{
return educationHighSchool;
}
public void setEducationPolytechnic(Long educationPolytechnic)
{
this.educationPolytechnic = educationPolytechnic;
}
public Long getEducationPolytechnic()
{
return educationPolytechnic;
}
public void setEducationJuniorCollege(Long educationJuniorCollege)
{
this.educationJuniorCollege = educationJuniorCollege;
}
public Long getEducationJuniorCollege()
{
return educationJuniorCollege;
}
public void setEducationUndergraduateCourse(Long educationUndergraduateCourse)
{
this.educationUndergraduateCourse = educationUndergraduateCourse;
}
public Long getEducationUndergraduateCourse()
{
return educationUndergraduateCourse;
}
public void setEducationPostgraduate(Long educationPostgraduate)
{
this.educationPostgraduate = educationPostgraduate;
}
public Long getEducationPostgraduate()
{
return educationPostgraduate;
}
public void setAccumulationFundLow(Long accumulationFundLow)
{
this.accumulationFundLow = accumulationFundLow;
}
public Long getAccumulationFundLow()
{
return accumulationFundLow;
}
public void setAccumulationFundHigh(Long accumulationFundHigh)
{
this.accumulationFundHigh = accumulationFundHigh;
}
public Long getAccumulationFundHigh()
{
return accumulationFundHigh;
}
public void setHourseNo(Long hourseNo)
{
this.hourseNo = hourseNo;
}
public Long getHourseNo()
{
return hourseNo;
}
public void setHourseFullPayment(Long hourseFullPayment)
{
this.hourseFullPayment = hourseFullPayment;
}
public Long getHourseFullPayment()
{
return hourseFullPayment;
}
public void setHourseMortgaging(Long hourseMortgaging)
{
this.hourseMortgaging = hourseMortgaging;
}
public Long getHourseMortgaging()
{
return hourseMortgaging;
}
public void setOfficeWorker(Long officeWorker)
{
this.officeWorker = officeWorker;
}
public Long getOfficeWorker()
{
return officeWorker;
}
public void setCivilServant(Long civilServant)
{
this.civilServant = civilServant;
}
public Long getCivilServant()
{
return civilServant;
}
public void setPrivatePropertyOwners(Long privatePropertyOwners)
{
this.privatePropertyOwners = privatePropertyOwners;
}
public Long getPrivatePropertyOwners()
{
return privatePropertyOwners;
}
public void setSelfEmployedPerson(Long selfEmployedPerson)
{
this.selfEmployedPerson = selfEmployedPerson;
}
public Long getSelfEmployedPerson()
{
return selfEmployedPerson;
}
public void setOtherOccupations(Long otherOccupations)
{
this.otherOccupations = otherOccupations;
}
public Long getOtherOccupations()
{
return otherOccupations;
}
public void setHuaBeiLow(Long huaBeiLow)
{
this.huaBeiLow = huaBeiLow;
}
public Long getHuaBeiLow()
{
return huaBeiLow;
}
public void setHuaBeiMiddle(Long huaBeiMiddle)
{
this.huaBeiMiddle = huaBeiMiddle;
}
public Long getHuaBeiMiddle()
{
return huaBeiMiddle;
}
public void setHuaBeiHigh(Long huaBeiHigh)
{
this.huaBeiHigh = huaBeiHigh;
}
public Long getHuaBeiHigh()
{
return huaBeiHigh;
}
public void setBaiTiaoLow(Long baiTiaoLow)
{
this.baiTiaoLow = baiTiaoLow;
}
public Long getBaiTiaoLow()
{
return baiTiaoLow;
}
public void setBaiTiaoMiddle(Long baiTiaoMiddle)
{
this.baiTiaoMiddle = baiTiaoMiddle;
}
public Long getBaiTiaoMiddle()
{
return baiTiaoMiddle;
}
public void setBaiTiaoHigh(Long baiTiaoHigh)
{
this.baiTiaoHigh = baiTiaoHigh;
}
public Long getBaiTiaoHigh()
{
return baiTiaoHigh;
}
public void setZhiMa(Long zhiMa)
{
this.zhiMa = zhiMa;
}
public Long getZhiMa()
{
return zhiMa;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("age", getAge())
.append("sex", getSex())
.append("name", getName())
.append("acturlName", getActurlName())
.append("phone", getPhone())
.append("phoneMd5", getPhoneMd5())
.append("isAuth", getIsAuth())
.append("city", getCity())
.append("cityCode", getCityCode())
.append("firstLoginTime", getFirstLoginTime())
.append("lastLoginTime", getLastLoginTime())
.append("lastLoginIp", getLastLoginIp())
.append("status", getStatus())
.append("socialSecurityNo", getSocialSecurityNo())
.append("socialSecurityLow", getSocialSecurityLow())
.append("socialSecurityHigh", getSocialSecurityHigh())
.append("carNo", getCarNo())
.append("carHave", getCarHave())
.append("guaranteeSlipLow", getGuaranteeSlipLow())
.append("guaranteeSlipCentre", getGuaranteeSlipCentre())
.append("guaranteeSlipHigh", getGuaranteeSlipHigh())
.append("educationMiddle", getEducationMiddle())
.append("educationHighSchool", getEducationHighSchool())
.append("educationPolytechnic", getEducationPolytechnic())
.append("educationJuniorCollege", getEducationJuniorCollege())
.append("educationUndergraduateCourse", getEducationUndergraduateCourse())
.append("educationPostgraduate", getEducationPostgraduate())
.append("accumulationFundLow", getAccumulationFundLow())
.append("accumulationFundHigh", getAccumulationFundHigh())
.append("hourseNo", getHourseNo())
.append("hourseFullPayment", getHourseFullPayment())
.append("hourseMortgaging", getHourseMortgaging())
.append("officeWorker", getOfficeWorker())
.append("civilServant", getCivilServant())
.append("privatePropertyOwners", getPrivatePropertyOwners())
.append("selfEmployedPerson", getSelfEmployedPerson())
.append("otherOccupations", getOtherOccupations())
.append("huaBeiLow", getHuaBeiLow())
.append("huaBeiMiddle", getHuaBeiMiddle())
.append("huaBeiHigh", getHuaBeiHigh())
.append("baiTiaoLow", getBaiTiaoLow())
.append("baiTiaoMiddle", getBaiTiaoMiddle())
.append("baiTiaoHigh", getBaiTiaoHigh())
.append("zhiMa", getZhiMa())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -33,7 +33,7 @@ public interface ChannelMapper
* @param channel
* @return
*/
public int insertChannel(Channel channel);
public Long insertChannel(Channel channel);
/**
*

@ -1,7 +1,9 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.http.Customer;
/**
* Mapper
@ -9,7 +11,7 @@ import com.ruoyi.system.domain.Customer;
* @author ruoyi
* @date 2024-09-15
*/
public interface CustomerMapper
public interface CustomerMapper extends BaseMapper<Customer>
{
/**
*

@ -33,7 +33,7 @@ public interface IChannelService
* @param channel
* @return
*/
public int insertChannel(Channel channel);
public Long insertChannel(Channel channel);
/**
*

@ -1,7 +1,10 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Customer;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Customer;
/**
* Service
@ -9,7 +12,7 @@ import com.ruoyi.system.domain.Customer;
* @author ruoyi
* @date 2024-09-15
*/
public interface ICustomerService
public interface ICustomerService extends IService<Customer>
{
/**
*
@ -58,4 +61,18 @@ public interface ICustomerService
* @return
*/
public int deleteCustomerById(Long id);
/**
* MD5
* @param phoneMD5
* @return
*/
R<Customer> selectByPhoneMd5(String phoneMD5);
/**
*
* @param customer
* @return
*/
R updateByPhoneMd5(Customer customer);
}

@ -1,8 +1,11 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.core.constant.CacheConstants;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.system.mapper.ChannelMapper;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,6 +26,8 @@ public class ChannelServiceImpl implements IChannelService
{
@Autowired
private ChannelMapper channelMapper;
@Autowired
private RedisService redisService;
/**
*
@ -56,13 +61,18 @@ public class ChannelServiceImpl implements IChannelService
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertChannel(Channel channel)
public Long insertChannel(Channel channel)
{
if (StringUtils.isEmpty(channel.getChannelSign())) {
channel.setChannelSign(RandomStringUtils.random(16, true, false));
}
channel.setCreateTime(DateUtils.getNowDate());
return channelMapper.insertChannel(channel);
Long i = channelMapper.insertChannel(channel);
//新增插入缓存
Channel channelById = channelMapper.selectChannelById(i);
redisService.setCacheObject(CacheConstants.CHANNEL_ID+i,channelById);
redisService.setCacheObject(CacheConstants.CHANNEL_SIGN+channel.getChannelSign(),channelById);
return i;
}
/**
@ -76,7 +86,14 @@ public class ChannelServiceImpl implements IChannelService
public int updateChannel(Channel channel)
{
channel.setUpdateTime(DateUtils.getNowDate());
return channelMapper.updateChannel(channel);
int i = channelMapper.updateChannel(channel);
Channel channelById = channelMapper.selectChannelById(channel.getId());
redisService.deleteObject(CacheConstants.CHANNEL_ID+channel.getId());
redisService.deleteObject(CacheConstants.CHANNEL_SIGN+channel.getChannelSign());
redisService.setCacheObject(CacheConstants.CHANNEL_ID+channel.getId(),channelById);
redisService.setCacheObject(CacheConstants.CHANNEL_SIGN+channel.getChannelSign(),channelById);
return i;
}
/**

@ -1,11 +1,17 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CustomerMapper;
import com.ruoyi.system.domain.Customer;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.system.service.ICustomerService;
/**
@ -15,10 +21,9 @@ import com.ruoyi.system.service.ICustomerService;
* @date 2024-09-15
*/
@Service
public class CustomerServiceImpl implements ICustomerService
{
@Autowired
private CustomerMapper customerMapper;
@RequiredArgsConstructor
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements IService<Customer>,ICustomerService {
private final CustomerMapper customerMapper;
/**
*
@ -93,4 +98,32 @@ public class CustomerServiceImpl implements ICustomerService
{
return customerMapper.deleteCustomerById(id);
}
/**
* MD5
* @param phoneMD5
* @return
*/
@Override
public R<Customer> selectByPhoneMd5(String phoneMD5) {
Customer one = getOne(new LambdaQueryWrapper<Customer>().eq(Customer::getPhoneMd5, phoneMD5));
if (one==null||one.getId()==null){
return R.fail();
}
return R.ok(one);
}
/**
*
* @param customer
* @return
*/
@Override
public R updateByPhoneMd5(Customer customer) {
int update = customerMapper.update(customer, new UpdateWrapper<Customer>().lambda().eq(Customer::getPhoneMd5, customer.getPhoneMd5()));
if (update>0){
return R.ok();
}
return R.fail();
}
}

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.CustomerMapper">
<resultMap type="com.ruoyi.system.domain.Customer" id="CustomerResult">
<resultMap type="com.ruoyi.common.core.domain.http.Customer" id="CustomerResult">
<result property="id" column="id" />
<result property="age" column="age" />
<result property="sex" column="sex" />
@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, age, sex, name, acturl_name, phone, phone_md5, is_auth, city, city_code, first_login_time, last_login_time, last_login_ip, status, social_security_no, social_security_low, social_security_high, car_no, car_have, guarantee_slip_low, guarantee_slip_centre, guarantee_slip_high, education_middle, education_high_school, education_polytechnic, education_junior_college, education_undergraduate_course, education_postgraduate, accumulation_fund_low, accumulation_fund_high, hourse_no, hourse_full_payment, hourse_mortgaging, office_worker, civil_servant, private_property_owners, self_employed_person, other_occupations, hua_bei_low, hua_bei_middle, hua_bei_high, bai_tiao_low, bai_tiao_middle, bai_tiao_high, zhi_ma, create_time, update_time from customer
</sql>
<select id="selectCustomerList" parameterType="com.ruoyi.system.domain.Customer" resultMap="CustomerResult">
<select id="selectCustomerList" parameterType="com.ruoyi.common.core.domain.http.Customer" resultMap="CustomerResult">
<include refid="selectCustomerVo"/>
<where>
<if test="age != null "> and age = #{age}</if>
@ -113,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<insert id="insertCustomer" parameterType="com.ruoyi.system.domain.Customer" useGeneratedKeys="true" keyProperty="id">
<insert id="insertCustomer" parameterType="com.ruoyi.common.core.domain.http.Customer" useGeneratedKeys="true" keyProperty="id">
insert into customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="age != null">age,</if>
@ -213,7 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateCustomer" parameterType="com.ruoyi.system.domain.Customer">
<update id="updateCustomer" parameterType="com.ruoyi.common.core.domain.http.Customer">
update customer
<trim prefix="SET" suffixOverrides=",">
<if test="age != null">age = #{age},</if>

Loading…
Cancel
Save