升级创客
This commit is contained in:
@@ -400,7 +400,7 @@ public interface UserAppService extends IService<UserApp> {
|
||||
UserApp getUserAppByPhone(String phone, UserApp userApp);
|
||||
|
||||
|
||||
void applyMarker(UserApp userApp);
|
||||
void applyMarker(UserApp userApp,String code) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1923,8 +1923,43 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
|
||||
@Autowired
|
||||
@Lazy
|
||||
UserPromotionMapper userPromotionMapper;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void applyMarker(UserApp userApp) {
|
||||
public void applyMarker(UserApp userApp,String code) throws Exception{
|
||||
UserInfo userInfo=new UserInfo();
|
||||
userInfo.setId(userApp.getUserId());
|
||||
UserInfo userInfos= userInfoService.queryUserInfo(userInfo);
|
||||
if(ObjectUtil.isEmpty(userInfos)){
|
||||
MsgException.checkNull(null,"用户信息不存在");
|
||||
}
|
||||
|
||||
PhoneValidateCode phoneValidateCode = new PhoneValidateCode();
|
||||
phoneValidateCode.setPhone(userInfos.getPhone());
|
||||
phoneValidateCode = phoneValidateCodeService.queryPhoneValidateCode(phoneValidateCode);
|
||||
|
||||
if (phoneValidateCode == null) {
|
||||
throw new MsgException("无效的验证码!");
|
||||
}
|
||||
|
||||
if (!phoneValidateCode.getCode().equalsIgnoreCase(code)) {
|
||||
throw new MsgException("无效的验证码!");
|
||||
}
|
||||
|
||||
MerchantBaseInfo baseInfo= merchantBaseInfoService.getMerchantBaseInfoByUserId(userInfos.getId().toString());
|
||||
if(ObjectUtil.isEmpty(baseInfo)){
|
||||
MsgException.checkNull(null,"商户信息不存在");
|
||||
}
|
||||
|
||||
if(!"1".equals(baseInfo.getMerchantType())){
|
||||
MsgException.checkNull(null,"非小微不允许升级创客");
|
||||
}
|
||||
|
||||
|
||||
|
||||
UserMarker marker= userMarkerMapper.selectById(userApp.getUserId());
|
||||
if(ObjectUtil.isNotEmpty(marker)){
|
||||
|
||||
Reference in New Issue
Block a user