diff --git a/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBindConnectService.java b/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBindConnectService.java index 39d42f6d..245274b0 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBindConnectService.java +++ b/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBindConnectService.java @@ -38,6 +38,9 @@ public interface AccountUserBindConnectService extends IBaseService queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("bind_id", bind_id) + .eq("bind_type", bind_type) + .eq("user_type", user_type) + .eq("user_id", user_id) + .eq("bind_active", CommonConstant.Enable); + return findOne(queryWrapper); + } + + @Override + public boolean checkBind(String bind_id, int bind_type, Integer user_id, Integer user_type, AccountUserBindConnect accountUserBindConnect) { // 如果是手机号码,则进行转换带 +86 的手机号码 bind_id = bind_type == BindCode.MOBILE ? PhoneNumberUtils.convZhPhoneNumber(bind_id) : bind_id; - AccountUserBindConnect currAccountUserBindConnect = get(bind_id); - if (currAccountUserBindConnect != null && CheckUtil.isNotEmpty(currAccountUserBindConnect.getUser_id())) { - // 验证通过, 登录成功. - Integer bind_user_id = currAccountUserBindConnect.getUser_id(); - if (CheckUtil.isNotEmpty(user_id) && ObjectUtil.equal(user_id, bind_user_id)) { - throw new ApiException(I18nUtil._("非法请求,已经登录用户不应该访问到此页面-重复绑定")); - } else if (CheckUtil.isEmpty(user_id) && ObjectUtil.equal(user_id, bind_user_id)) { - throw new ApiException(I18nUtil._("非法请求,错误绑定数据")); - } - } else if (currAccountUserBindConnect != null && CheckUtil.isEmpty(currAccountUserBindConnect.getUser_id())) { - - user_info_row.setUser_id(user_id); - user_info_row.setBind_id(bind_id); - user_info_row.setUser_type(user_type); + // AccountUserBindConnect currAccountUserBindConnect = get(bind_id); + AccountUserBindConnect currAccountUserBindConnect = getBindByBindId(bind_id, bind_type, user_id, user_type); + if (currAccountUserBindConnect == null) { + accountUserBindConnect.setBind_id(bind_id); + accountUserBindConnect.setBind_type(bind_type); + accountUserBindConnect.setUser_id(user_id); + accountUserBindConnect.setUser_type(user_type); // (重要)新增或更新用户绑定关系 - if (!saveOrUpdate(user_info_row)) { - throw new ApiException(ResultCode.FAILED); - } - } else if (currAccountUserBindConnect == null) { - // todo 头像会变动, 需要本地缓存, 生成新网址. - user_info_row.setBind_id(bind_id); - user_info_row.setBind_type(bind_type); - user_info_row.setUser_id(user_id); - user_info_row.setUser_type(user_type); - - // (重要)新增或更新用户绑定关系 - if (!saveOrUpdate(user_info_row)) { + if (!saveOrUpdate(accountUserBindConnect)) { throw new ApiException(ResultCode.FAILED); } } +// else { +// +// if (CheckUtil.isNotEmpty(currAccountUserBindConnect.getUser_id())) { +// // 验证通过, 登录成功. +// Integer bind_user_id = currAccountUserBindConnect.getUser_id(); +// if (CheckUtil.isNotEmpty(user_id) && ObjectUtil.equal(user_id, bind_user_id)) { +// throw new ApiException(I18nUtil._("非法请求,已经登录用户不应该访问到此页面-重复绑定")); +// } else if (CheckUtil.isEmpty(user_id) && ObjectUtil.equal(user_id, bind_user_id)) { +// throw new ApiException(I18nUtil._("非法请求,错误绑定数据")); +// } +// } else { +// accountUserBindConnect.setUser_id(user_id); +// accountUserBindConnect.setBind_id(bind_id); +// accountUserBindConnect.setUser_type(user_type); +// accountUserBindConnect.setBind_type(bind_type); +// +// // (重要)新增或更新用户绑定关系 +// if (!saveOrUpdate(accountUserBindConnect)) { +// throw new ApiException(ResultCode.FAILED); +// } +// } +// } return true; } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/mobile/ShopMerchEntryController.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/mobile/ShopMerchEntryController.java index 16047d3b..7f6d8e32 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/mobile/ShopMerchEntryController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/mobile/ShopMerchEntryController.java @@ -85,11 +85,15 @@ public class ShopMerchEntryController extends BaseControllerImpl { result.put("id", 0L); result.put("approval_status", 4); result.put("approval_remark", ""); + result.put("signed_status", -1); + result.put("store_status", 2); result.put("approval_invalid_col", "[]"); } else { result.put("id", record.getId()); result.put("approval_status", record.getApproval_status()); result.put("approval_remark", record.getApproval_remark()); + result.put("signed_status", record.getSigned_status()); + result.put("store_status", record.getStore_status()); result.put("approval_invalid_col", record.getApproval_invalid_col()); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java index 063e3f1d..880bc269 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java @@ -586,7 +586,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("login_mobile", loginMobile) - .select("id", "approval_status", "approval_remark", "login_mobile", "approval_invalid_col", "signed_status", "contract_download_url") + .select("id", "approval_status", "approval_remark", "login_mobile", "approval_invalid_col", "signed_status", "contract_download_url", "store_status") .orderByAsc("id"); List recordList = list(queryWrapper);