升级创客
This commit is contained in:
@@ -1773,10 +1773,15 @@ public class UserAppController {
|
|||||||
* 申请
|
* 申请
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/applyMarker")
|
@GetMapping(value = "/applyMarker")
|
||||||
public Result<Object> applyMarker(){
|
public Result<Object> applyMarker(@RequestParam("code") String code){
|
||||||
UserApp userApp = userAppService.checkApiToken();
|
UserApp userApp = userAppService.checkApiToken();
|
||||||
userAppService.applyMarker(userApp);
|
try {
|
||||||
return ResultGenerator.genSuccessResult("申请成功");
|
userAppService.applyMarker(userApp,code);
|
||||||
|
return ResultGenerator.genSuccessResult();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return ResultGenerator.genFailResult("申请失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ public interface UserAppService extends IService<UserApp> {
|
|||||||
UserApp getUserAppByPhone(String phone, UserApp 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
|
@Autowired
|
||||||
@Lazy
|
@Lazy
|
||||||
UserPromotionMapper userPromotionMapper;
|
UserPromotionMapper userPromotionMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
MerchantBaseInfoService merchantBaseInfoService;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@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());
|
UserMarker marker= userMarkerMapper.selectById(userApp.getUserId());
|
||||||
if(ObjectUtil.isNotEmpty(marker)){
|
if(ObjectUtil.isNotEmpty(marker)){
|
||||||
|
|||||||
Reference in New Issue
Block a user