From 2de49198c4d76cf4cbbadd52ec7328f4cde32736 Mon Sep 17 00:00:00 2001 From: hupeng Date: Thu, 28 Mar 2019 14:04:25 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=9C=80=E6=B1=82][=E6=96=B0=E5=A2=9E]:?= =?UTF-8?q?=E9=9C=80=E6=B1=821000358=E5=A2=9E=E5=8A=A0=E7=99=BB=E9=99=86?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=BF=94=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/controller/WxUserGrantController.java | 10 ++++++---- .../main/java/com/iformall/service/WxCUserService.java | 2 +- .../com/iformall/service/impl/WxCUserServiceImpl.java | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java index 7cc4221cc..52425f6cc 100755 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java @@ -144,7 +144,7 @@ public class WxUserGrantController extends BaseController { user.setTenantId(wxAppinfo.getTenantId()); user.setAppId(appId); user.setOpenId(openId); - + int score = 0; try { WxCUser user1 = wxCUserService.getByOpenId(user); if (user1 != null) { @@ -172,8 +172,9 @@ public class WxUserGrantController extends BaseController { user1.setLoginCount(user1.getLoginCount()+1); wxCUserService.saveOrUpdate(user1); // 成长值 + try { - wxCUserService.scoreCalculate(user1, false); + score = wxCUserService.scoreCalculate(user1, false); } catch (Exception e) { logger.error(e.getMessage()); } @@ -204,8 +205,9 @@ public class WxUserGrantController extends BaseController { request.setAttribute(Constant.LOGIN_USER_KEY, user.getId()); request.setAttribute(Constant.TENANT_ID, user.getTenantId()); // 成长值 + try { - wxCUserService.scoreCalculate(user, true); + score = wxCUserService.scoreCalculate(user, true); } catch (Exception e) { logger.error(e.getMessage()); } @@ -218,7 +220,7 @@ public class WxUserGrantController extends BaseController { } - + resultMap.put("score",score); return new ResultData(resultMap); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserService.java index 98137dde9..a76958f4c 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCUserService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserService.java @@ -78,5 +78,5 @@ public interface WxCUserService { /** * 计算当前用户成长值 */ - void scoreCalculate(WxCUser user, boolean isNew); + int scoreCalculate(WxCUser user, boolean isNew); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java index b9c962173..2327b3c72 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java @@ -133,8 +133,8 @@ public class WxCUserServiceImpl implements WxCUserService { } @Override - public void scoreCalculate(WxCUser user, boolean isNew) { - wxScoreRulesService.addScore(EnumScoreType.LOGIN,user); + public int scoreCalculate(WxCUser user, boolean isNew) { + return wxScoreRulesService.addScore(EnumScoreType.LOGIN,user); }