同步会员新增user_longin信息
This commit is contained in:
parent
f8ca35d20c
commit
50872500b3
@ -467,6 +467,11 @@ public class AccountController {
|
||||
return accountUserBaseService.saveBatchAccountInfo(accountUserInfoList);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/saveBatchAccountUserLogin", method = RequestMethod.POST)
|
||||
public ThirdApiRes saveBatchAccountUserLogin(@RequestBody List<AccountUserLogin> accountUserLoginList) {
|
||||
return accountUserBaseService.saveBatchAccountUserLogin(accountUserLoginList);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/findOneAccountUserBase", method = RequestMethod.POST)
|
||||
public AccountUserBase findOneAccountUserBase(@RequestBody AccountUserBase accountUserBase) {
|
||||
|
||||
@ -4,6 +4,7 @@ import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.domain.UserDto;
|
||||
import com.suisung.mall.common.modules.account.AccountUserBase;
|
||||
import com.suisung.mall.common.modules.account.AccountUserInfo;
|
||||
import com.suisung.mall.common.modules.account.AccountUserLogin;
|
||||
import com.suisung.mall.common.pojo.req.WxUserInfoReq;
|
||||
import com.suisung.mall.common.pojo.res.ThirdApiRes;
|
||||
import com.suisung.mall.core.web.service.IBaseService;
|
||||
@ -304,4 +305,11 @@ public interface AccountUserBaseService extends IBaseService<AccountUserBase> {
|
||||
* @return Pair<Boolean, String> 第一个元素表示是否成功,第二个元素表示提示信息
|
||||
*/
|
||||
Pair<Boolean, String> merchantInnerRegister(String mobile);
|
||||
|
||||
/**
|
||||
* 批量保存accountInfo
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ThirdApiRes saveBatchAccountUserLogin(List<AccountUserLogin> accountUserLoginList);
|
||||
}
|
||||
|
||||
@ -3849,6 +3849,23 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
return new ThirdApiRes().fail(250, "保存异常");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThirdApiRes saveBatchAccountUserLogin(List<AccountUserLogin> accountUserLoginList) {
|
||||
boolean result = false;
|
||||
if (!accountUserLoginList.isEmpty()) {
|
||||
try {
|
||||
result = accountUserLoginService.saveBatch(accountUserLoginList, accountUserLoginList.size());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("保存AccountUserLogin报错:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
if (result) {
|
||||
return new ThirdApiRes().success("成功");
|
||||
}
|
||||
return new ThirdApiRes().fail(250, "保存异常");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查并修复商户店铺信息
|
||||
* 重要(补偿机制),检查修复商户入驻店铺信息(商家账号关联入驻店铺Id,给商家账户创立公司员工账号和权限)
|
||||
|
||||
@ -280,6 +280,15 @@ public interface AccountService {
|
||||
@PostMapping(value = "/admin/account/accountController/saveBatchAccountInfo")
|
||||
ThirdApiRes saveBatchAccountInfo(@RequestBody List<AccountUserInfo> accountUserInfoList);
|
||||
|
||||
/**
|
||||
* 批量保存accountUserLogin
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/admin/account/accountController/saveBatchAccountUserLogin")
|
||||
ThirdApiRes saveBatchAccountUserLogin(@RequestBody List<AccountUserLogin> accountUserLoginList);
|
||||
|
||||
|
||||
/**
|
||||
* 批量保存accountInfo
|
||||
*
|
||||
|
||||
@ -22,6 +22,7 @@ import com.suisung.mall.common.feignService.AccountService;
|
||||
import com.suisung.mall.common.feignService.PayService;
|
||||
import com.suisung.mall.common.modules.account.AccountUserBase;
|
||||
import com.suisung.mall.common.modules.account.AccountUserInfo;
|
||||
import com.suisung.mall.common.modules.account.AccountUserLogin;
|
||||
import com.suisung.mall.common.modules.base.ShopBaseProductBrand;
|
||||
import com.suisung.mall.common.modules.base.ShopBaseProductCategory;
|
||||
import com.suisung.mall.common.modules.base.ShopBaseProductSpec;
|
||||
@ -608,6 +609,8 @@ public abstract class SyncBaseThirdSxAbstract{
|
||||
List<AccountUserBase> addAccountUserBases=new ArrayList<>();
|
||||
List<AccountUserInfo> addAcountUserInfo=new ArrayList<>();
|
||||
List<PayUserResource> addPayUserResource=new ArrayList<>();
|
||||
List<AccountUserLogin> accountUserLogins=new ArrayList<>();
|
||||
Date today=new Date();
|
||||
for (int i = 0; i < accountBaseIds.size(); i++) {
|
||||
// account_user_base
|
||||
SyncThirdMemberReq syncThirdMemberReq=addMemberList.get(i);
|
||||
@ -648,6 +651,14 @@ public abstract class SyncBaseThirdSxAbstract{
|
||||
accountUserInfo.setUser_birthday(DateTimeUtils.parseDate(syncThirdMemberReq.getUser_birthday(), "yyyy-MM-dd"));
|
||||
}
|
||||
addAcountUserInfo.add(accountUserInfo);
|
||||
|
||||
//account
|
||||
AccountUserLogin accountUserLogin = new AccountUserLogin();
|
||||
accountUserLogin.setUser_id(userId);
|
||||
accountUserLogin.setUser_active_time(today);
|
||||
accountUserLogin.setUser_reg_date(today);
|
||||
accountUserLogin.setUser_reg_time(today.getTime());
|
||||
accountUserLogins.add(accountUserLogin);
|
||||
if (syncThirdMemberReq.getUser_money() != null || syncThirdMemberReq.getUser_points() != null) {
|
||||
// pay_user_resource 用户支付资源,积分,余额
|
||||
PayUserResource payUserResource = new PayUserResource();
|
||||
@ -673,13 +684,18 @@ public abstract class SyncBaseThirdSxAbstract{
|
||||
throw new ApiException(ResultCode.FAILED,"addAcountUserInfo保存异常");
|
||||
}
|
||||
}
|
||||
|
||||
if(!addPayUserResource.isEmpty()){
|
||||
ThirdApiRes thirdApiRes= payService.saveBatchPayUserResources(addPayUserResource);
|
||||
if(thirdApiRes.getError_code()!=0){
|
||||
throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
}
|
||||
if(!accountUserLogins.isEmpty()){
|
||||
ThirdApiRes thirdApiRes= accountService.saveBatchAccountUserLogin(accountUserLogins);
|
||||
if(thirdApiRes.getError_code()!=0){
|
||||
throw new ApiException(ResultCode.FAILED,"accountUserLogin保存异常");
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user