|
@@ -802,16 +802,16 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
}
|
|
}
|
|
|
|
|
|
public AjaxJson purchaserLogin(LoginDto dto) {
|
|
public AjaxJson purchaserLogin(LoginDto dto) {
|
|
- String phone= dto.getPhone();
|
|
|
|
- if (StrUtil.isEmpty(phone)) {
|
|
|
|
- return AjaxJson.getError("手机号不正确");
|
|
|
|
- }
|
|
|
|
- String pwd= dto.getPassword();
|
|
|
|
|
|
+ String phone = dto.getPhone();
|
|
|
|
+ if (StrUtil.isEmpty(phone)) {
|
|
|
|
+ return AjaxJson.getError("手机号不正确");
|
|
|
|
+ }
|
|
|
|
+ String pwd = dto.getPassword();
|
|
if (StrUtil.isEmpty(pwd)) {
|
|
if (StrUtil.isEmpty(pwd)) {
|
|
return AjaxJson.getError("请输入密码");
|
|
return AjaxJson.getError("请输入密码");
|
|
}
|
|
}
|
|
AppUser appUser = findByPhone(phone);
|
|
AppUser appUser = findByPhone(phone);
|
|
- if (appUser == null|| !Objects.equals(appUser.getUserType(),UserType.USER_TYPE_PURCHASER.getCode())) {
|
|
|
|
|
|
+ if (appUser == null || !Objects.equals(appUser.getUserType(), UserType.USER_TYPE_PURCHASER.getCode())) {
|
|
return AjaxJson.getError("账号不存在");
|
|
return AjaxJson.getError("账号不存在");
|
|
}
|
|
}
|
|
if (!passwordEncoder.matches(pwd, appUser.getPassword())) {
|
|
if (!passwordEncoder.matches(pwd, appUser.getPassword())) {
|
|
@@ -820,11 +820,11 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
if (appUser.getStatus().equals("0")) {
|
|
if (appUser.getStatus().equals("0")) {
|
|
return AjaxJson.getError("该账户 " + appUser.getPhone() + " 已停用!");
|
|
return AjaxJson.getError("该账户 " + appUser.getPhone() + " 已停用!");
|
|
}
|
|
}
|
|
- PurchaserDto purchaserDto= FeignFactory.levelTwoServerInterface.getByPurchaserId(appUser.getFkId());
|
|
|
|
- if (purchaserDto==null){
|
|
|
|
|
|
+ PurchaserDto purchaserDto = FeignFactory.levelTwoServerInterface.getByPurchaserId(appUser.getFkId());
|
|
|
|
+ if (purchaserDto == null) {
|
|
return AjaxJson.getError("商户不存在或未认证");
|
|
return AjaxJson.getError("商户不存在或未认证");
|
|
}
|
|
}
|
|
- if (purchaserDto.getJudgeStatus()==0){
|
|
|
|
|
|
+ if (purchaserDto.getJudgeStatus() == 0) {
|
|
return AjaxJson.getError("商户未审核");
|
|
return AjaxJson.getError("商户未审核");
|
|
}
|
|
}
|
|
//开始执行登录
|
|
//开始执行登录
|
|
@@ -844,4 +844,13 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
|
|
map.put("companyInfo", companyInfo);
|
|
map.put("companyInfo", companyInfo);
|
|
return AjaxJson.getSuccessData(map);
|
|
return AjaxJson.getSuccessData(map);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean bindFkId(Long appUserId, Long fkId) {
|
|
|
|
+ AppUser appUser = this.getById(appUserId);
|
|
|
|
+ if (appUser == null) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ appUser.setFkId(fkId);
|
|
|
|
+ return this.updateById(appUser);
|
|
|
|
+ }
|
|
}
|
|
}
|