From a164cfb37b81879f2282d3b8dae73cc9cee00c6e Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 06 三月 2019 10:24:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java | 39 +++++++++++++++++++++++++++++++-------- 1 files changed, 31 insertions(+), 8 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java index 5265f49..638fca1 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java @@ -15,7 +15,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.yeshi.utils.DateUtil; -import org.yeshi.utils.JsonUtil; import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper; import com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord; @@ -28,6 +27,7 @@ import com.yeshi.fanli.entity.common.JumpDetailV2; import com.yeshi.fanli.entity.money.UserMoneyDetail; import com.yeshi.fanli.entity.order.CommonOrder; +import com.yeshi.fanli.entity.push.PushCoupon; import com.yeshi.fanli.entity.system.SystemCoupon; import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; @@ -596,6 +596,13 @@ if (userSystemCoupon == null) { throw new UserSystemCouponException(1, "鍒告暟鎹笉姝g‘"); } + + Integer state = userSystemCoupon.getState(); + Integer stateActivated = userSystemCoupon.getStateActivated(); + if (UserSystemCoupon.STATE_CAN_USE != state || 1 != stateActivated) { + throw new UserSystemCouponException(1, "璇ュ埜涓嶈兘琚娇鐢�"); + } + Long couponUid = userSystemCoupon.getUid(); if (!uid.equals(couponUid)) { @@ -658,6 +665,12 @@ UserSystemCoupon userSystemCoupon = selectByPrimaryKey(id); if (userSystemCoupon == null) { throw new UserSystemCouponException(1, "鍒镐俊鎭笉瀛樺湪"); + } + + Integer state = userSystemCoupon.getState(); + Integer stateActivated = userSystemCoupon.getStateActivated(); + if (UserSystemCoupon.STATE_CAN_USE != state || 1 != stateActivated) { + throw new UserSystemCouponException(1, "璇ュ埜涓嶈兘琚娇鐢�"); } // 绯荤粺鍒镐俊鎭� @@ -1040,9 +1053,12 @@ return userRecordVO; } + @Transactional @Override - public void activatedWelfareFreeCoupon(Long uid) { + public void activatedWelfareFreeCoupon(Long uid, String fromNickName) { + + LogHelper.test("鍒告縺娲�:"+uid); if (uid == null) { return; } @@ -1065,9 +1081,11 @@ for (UserSystemCoupon userSystemCoupon: list) { // 婵�娲� - userSystemCoupon.setStateActivated(1); - userSystemCoupon.setUpdateTime(new Date()); - userSystemCouponMapper.updateByPrimaryKeySelective(userSystemCoupon); + UserSystemCoupon update=new UserSystemCoupon(); + update.setId(userSystemCoupon.getId()); + update.setStateActivated(1); + update.setUpdateTime(new Date()); + userSystemCouponMapper.updateByPrimaryKeySelective(update); Integer state = userSystemCoupon.getState(); if (UserSystemCoupon.STATE_OVERDUE == state) { @@ -1076,7 +1094,11 @@ // 娑堟伅鎺ㄩ�� try { - userOtherMsgNotificationService.welfareCouponActive(userSystemCoupon, new UserInfo(uid)); + UserInfo userInfo = new UserInfo(); + userInfo.setId(uid); + userInfo.setNickName(fromNickName); + + userOtherMsgNotificationService.welfareCouponActive(userSystemCoupon, userInfo); } catch(Exception e) { try { LogHelper.errorDetailInfo(e); @@ -1359,6 +1381,8 @@ // 鑾峰彇棰濆淇℃伅 UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid); + + // 宸茬粡鎶借繃濂栫殑鎴栬�呭凡缁忚繘鍏ヨ繃鎶藉椤甸潰鐨� if (userInfoExtra != null && userInfoExtra.getLotteryNewbies() != null) { return; } @@ -1451,6 +1475,5 @@ } - - } + -- Gitblit v1.8.0