补偿机制 fix bug
This commit is contained in:
parent
830bbe8183
commit
4f62b2aa2f
@ -2362,7 +2362,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
//根据手机号查询bind表中是否已存在记录
|
||||
if (accountUserBindConnect != null) {
|
||||
//同一个用户,不做操作
|
||||
if (accountUserBindConnect.getUser_id().equals(currentUser.getId())) {
|
||||
if (Objects.equals(accountUserBindConnect.getUser_id(), currentUser.getId())) {
|
||||
// 如果bind表中存在记录,判断info表中是否存在
|
||||
AccountUserInfo userInfo = accountUserInfoService.get(currentUser.getId());
|
||||
if (StrUtil.isBlank(userInfo.getUser_intl()) || StrUtil.isBlank(userInfo.getUser_mobile())) {
|
||||
@ -3151,7 +3151,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
// accountUserBase == null 的情况
|
||||
// 是否绑定手机号了?
|
||||
AccountUserBindConnect accountUserBindConnect = accountUserBindConnectService.getBindByBindId(mobile, BindCode.MOBILE, CommonConstant.USER_TYPE_NORMAL);
|
||||
if (accountUserBindConnect == null || !accountUserBase.getUser_id().equals(accountUserBindConnect.getUser_id())) {
|
||||
if (accountUserBindConnect == null || !Objects.equals(accountUserBase.getUser_id(), accountUserBindConnect.getUser_id())) {
|
||||
// 先绑定手机号
|
||||
if (accountUserBindConnectService.bindMobileAndOpenId(wxUserInfoReq, accountUserBase.getUser_id(), accountUserBase.getUser_is_admin()) == null) {
|
||||
return CommonResult.failed(_("账号绑定失败!"));
|
||||
|
||||
@ -1426,20 +1426,20 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
||||
return JSONUtil.createObj().put("code", "FAIL").put("message", "更新状态失败");
|
||||
}
|
||||
|
||||
|
||||
Long mchId = lklLedgerMerReceiverBind.getMch_id();
|
||||
|
||||
// 7. 成功后更新商户绑定状态为已绑定
|
||||
shopMchEntryService.updateMulStatus(mchId, merCupNo, 0, 0, 0, 0, 0, 1, CommonConstant.MCH_APPR_STA_PASS);
|
||||
|
||||
|
||||
// 创建店铺,并初始化
|
||||
// 新建一个正式的已审核通过的店铺,不要抛异常,使用补偿机制,可以独立初始化店铺
|
||||
// 重要:包含了更改 merchEntryInfo 的状态, 使用法人、小微个人的手机号注册商家账号,作为店铺的管理员
|
||||
Pair<Integer, String> retPair = shopStoreBaseService.covMerchEntryInfo2StoreInfo(mchId, false);
|
||||
if (retPair.getFirst() <= 0) {
|
||||
shopMchEntryService.updateMerchEntryApprovalByMchId(mchId, null, "创建并初始化店铺失败:" + retPair.getSecond());
|
||||
shopMchEntryService.updateMerchEntryApprovalByMchId(mchId, null, "创建初始化店铺失败:" + retPair.getSecond());
|
||||
log.error("进件成功,但初始化店铺失败: mchId={}, reason={}", mchId, retPair.getSecond());
|
||||
} else {
|
||||
shopMchEntryService.updateMulStatus(mchId, merCupNo, 0, 0, 1, 0, 0, 0, 0);
|
||||
log.debug("进件成功,创建并初始化店铺成功!mchId={}", mchId);
|
||||
}
|
||||
|
||||
|
||||
@ -3115,11 +3115,6 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
return Pair.of(0, "入驻信息不能为空");
|
||||
}
|
||||
|
||||
// 校验店铺状态,
|
||||
// if (CommonConstant.Enable.equals(shopMchEntry.getStore_status())) {
|
||||
// return Pair.of(0, "操作失败,检查店铺已创建完成?");
|
||||
// }
|
||||
|
||||
// 如果 还没有签署入网电子合同且没有进件成功,则提示前置条件未满足
|
||||
if (!CommonConstant.Enable.equals(shopMchEntry.getHas_ec_signed())
|
||||
&& !CommonConstant.Enable.equals(shopMchEntry.getHas_apply_mer())) {
|
||||
@ -3139,7 +3134,8 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
ShopStoreBase shopStoreBase = findOneByStoreName(shopMchEntry.getStore_name());
|
||||
if (shopStoreBase != null
|
||||
&& StrUtil.isNotBlank(shopStoreBase.getLkl_merchant_no())
|
||||
&& !shopStoreBase.getStore_id().equals(shopMchEntry.getStore_id())) {
|
||||
&& StrUtil.isNotBlank(shopStoreBase.getLkl_term_no())
|
||||
&& !shopStoreBase.getStore_id().toString().equals(shopMchEntry.getStore_id())) {
|
||||
// 如果店铺名称已存在,且店铺已经进件,且不等于当前入驻商家的店铺Id,提示店铺名称已存在
|
||||
logger.error("生成店铺:店铺名称已存在");
|
||||
return Pair.of(0, "店铺名称已存在,请使用另一名称");
|
||||
@ -3177,19 +3173,21 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
shopStoreBase.setStore_is_selfsupport(0);
|
||||
shopStoreBase.setStore_o2o_flag(0);
|
||||
shopStoreBase.setSubsite_id(0);
|
||||
|
||||
// 拉卡拉外部商户号
|
||||
shopStoreBase.setLkl_merchant_no(shopMchEntry.getLkl_mer_cup_no());
|
||||
// 拉卡拉分配的终端号
|
||||
shopStoreBase.setLkl_term_no(shopMchEntry.getLkl_term_no());
|
||||
|
||||
shopStoreBase.setStore_state_id(StateCode.STORE_STATE_YES);//店铺资料信息状态(ENUM):3210-待完善资料; 3220-等待审核 ; 3230-资料审核没有通过;3240-资料审核通过,待付款
|
||||
shopStoreBase.setStore_time(DateUtil.date());
|
||||
shopStoreBase.setStore_end_time(System.currentTimeMillis() + 1000L * 60 * 60 * 24 * 365 * 5); // 5年
|
||||
if (!save(shopStoreBase)) {
|
||||
logger.error("生成店铺:新增店铺基本信息失败");
|
||||
logger.error("生成店铺:新增或更改店铺基本信息失败");
|
||||
if (allowThrown) {
|
||||
throw new ApiException(I18nUtil._("新增店铺基础信息失败"));
|
||||
throw new ApiException(I18nUtil._("新增或更改店铺基本信息失败"));
|
||||
}
|
||||
return Pair.of(0, "新增店铺基础信息失败");
|
||||
return Pair.of(0, "新增或更改店铺基础信息失败");
|
||||
}
|
||||
|
||||
// 保存后店铺Id
|
||||
|
||||
Loading…
Reference in New Issue
Block a user