From b0c5d432ec041221dcbe81ca5ae3aa20fe3bddc6 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Mon, 22 Mar 2021 20:17:58 +0800 Subject: [PATCH] Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop --- zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java index a428860..e34da97 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java @@ -168,7 +168,16 @@ // TODO 赋值操作 int i = bizUserService.saveUserInfo(bizUser); + checkNeedToBeSalesman(bizUser, loginUser); + if (i == 0) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "更新失败"); + } + return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(bizUser)); + } + + + void checkNeedToBeSalesman(BizUser bizUser, BizUser loginUser) { //查询是否需要自动成为分销员 if ((loginUser.getIsSales() == null || loginUser.getIsSales() == 2) && StringUtils.isNotBlank(bizUser.getNickName())) {//目前还不是分销员 @@ -181,15 +190,16 @@ queryWrapper.eq("apply_status", ShopSalesmanApply.APPLY_STATUS_DSH); ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper); if (shopSalesmanApply == null) {//没有待审核记录 - shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(), null, null, 2); + try { + shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(), null, null, 2); + }catch (Exception e){ + LogUtil.debug(e.getMessage()); + } + } } } } - if (i == 0) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "更新失败"); - } - return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(bizUser)); } -- Gitblit v1.9.1