|
|
@@ -19,13 +19,16 @@ import com.yingyangfly.common.utils.DateUtils;
|
|
|
import com.yingyangfly.core.api.ImApi;
|
|
|
import com.yingyangfly.core.domain.*;
|
|
|
import com.yingyangfly.core.dto.*;
|
|
|
+import com.yingyangfly.core.enums.MsgTemplateEnums;
|
|
|
import com.yingyangfly.core.enums.StatusEnums;
|
|
|
import com.yingyangfly.core.mapper.*;
|
|
|
import com.yingyangfly.core.recommend.RecommendFacade;
|
|
|
import com.yingyangfly.core.security.util.TokenUtil;
|
|
|
import com.yingyangfly.core.service.*;
|
|
|
import com.yingyangfly.core.util.AmountUtils;
|
|
|
+import com.yingyangfly.core.util.EntityConverter;
|
|
|
import com.yingyangfly.core.util.Sm4Util;
|
|
|
+import com.yingyangfly.core.util.SmgUtil;
|
|
|
import com.yingyangfly.redis.client.RedisClient;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.assertj.core.util.Sets;
|
|
|
@@ -307,12 +310,12 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
|
}
|
|
|
|
|
|
//将套餐信息置空
|
|
|
- appUser.setPadNo("");
|
|
|
- appUser.setPackageId(null);
|
|
|
- appUser.setPackageName("");
|
|
|
- appUser.setEquipmentPledge(null);
|
|
|
- appUser.setOrderStartTime("");
|
|
|
- appUser.setOrderEndTime("");
|
|
|
+// appUser.setPadNo("");
|
|
|
+// appUser.setPackageId(null);
|
|
|
+// appUser.setPackageName("");
|
|
|
+// appUser.setEquipmentPledge(null);
|
|
|
+// appUser.setOrderStartTime("");
|
|
|
+// appUser.setOrderEndTime("");
|
|
|
|
|
|
if (appUser.getId() == null) {
|
|
|
appUser.setStatus("0");
|
|
|
@@ -339,6 +342,7 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
|
recommendFacade.recommendGameUserJobByAppUser(appUser.getId());
|
|
|
return ResultResponse.success(appUser.getId());
|
|
|
}else{
|
|
|
+ AppUser appUserUpdate = EntityConverter.convertToTarget(appUser, AppUser.class);
|
|
|
AppUser appUserDb = appUserMapper.selectById(appUser.getId());
|
|
|
String decryptMobile = Sm4Util.decrypt(appUserDb.getMobile());
|
|
|
if(!decryptMobile.equals(appUser.getMobile())){
|
|
|
@@ -347,12 +351,12 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
|
return ResultResponse.fail("手机号已经存在");
|
|
|
}
|
|
|
}
|
|
|
- appUser.setUpdateBy(currentUser.getUsername());
|
|
|
- appUser.setUpdateTime(new Date());
|
|
|
+ appUserUpdate.setUpdateBy(currentUser.getUsername());
|
|
|
+ appUserUpdate.setUpdateTime(new Date());
|
|
|
cacheUserService.delAppUser(Sm4Util.decrypt(appUserDb.getMobile()));
|
|
|
cacheUserService.delAppUser(appUser.getMobile());
|
|
|
-
|
|
|
- appUserMapper.updateById(appUser);
|
|
|
+ System.out.println(appUserUpdate);
|
|
|
+ appUserMapper.updateById(appUserUpdate);
|
|
|
return ResultResponse.success(appUserDb.getId());
|
|
|
}
|
|
|
|
|
|
@@ -615,13 +619,13 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
|
if (LocalDate.parse(appUser.getOrderEndTime()).isBefore(LocalDate.now())){
|
|
|
return ResultResponse.success(false);
|
|
|
}
|
|
|
-// Random rand = new Random();
|
|
|
-// int randomNumber = rand.nextInt(1000000);
|
|
|
-// String random = String.format("%06d", randomNumber);
|
|
|
+ Random rand = new Random();
|
|
|
+ int randomNumber = rand.nextInt(1000000);
|
|
|
+ String random = String.format("%06d", randomNumber);
|
|
|
//6位随机数
|
|
|
-// Boolean isSuccess = SmgUtil.sendCheckCode(mobile, MsgTemplateEnums.GET_CHECK_CODE.getTempalteCode(), random);
|
|
|
- String random = "123456";
|
|
|
- Boolean isSuccess = true;
|
|
|
+ Boolean isSuccess = SmgUtil.sendCheckCode(mobile, MsgTemplateEnums.GET_CHECK_CODE.getTempalteCode(), random);
|
|
|
+// String random = "123456";
|
|
|
+// Boolean isSuccess = true;
|
|
|
if (isSuccess) {
|
|
|
// 防机器
|
|
|
redisClient.set("hcp:sms:mobile:"+mobile,random,60);
|