Browse Source

fixed 会员升级卡券发放问题

fushengqian 1 năm trước cách đây
mục cha
commit
4276f1d61a

+ 1 - 1
fuint-application/src/main/java/com/fuint/common/service/OpenGiftService.java

@@ -69,5 +69,5 @@ public interface OpenGiftService {
      * @throws BusinessCheckException
      * @return
      * */
-    boolean openGift(Integer userId, Integer gradeId, boolean isNewMember) throws BusinessCheckException;
+    Boolean openGift(Integer userId, Integer gradeId, boolean isNewMember) throws BusinessCheckException;
 }

+ 1 - 1
fuint-application/src/main/java/com/fuint/common/service/impl/CouponServiceImpl.java

@@ -701,7 +701,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
                     weixinService.sendSubscribeMessage(userInfo.getMerchantId(), userInfo.getId(), userInfo.getOpenId(), WxMessageEnum.COUPON_ARRIVAL.getKey(), "pages/user/index", params, sendTime);
                 }
             } catch (Exception e) {
-                // empty
+                throw new BusinessCheckException("卡券发放失败.");
             }
         }
     }

+ 5 - 4
fuint-application/src/main/java/com/fuint/common/service/impl/OpenGiftServiceImpl.java

@@ -226,7 +226,7 @@ public class OpenGiftServiceImpl extends ServiceImpl<MtOpenGiftMapper, MtOpenGif
      * @return
      * */
     @Override
-    public boolean openGift(Integer userId, Integer gradeId, boolean isNewMember) throws BusinessCheckException {
+    public Boolean openGift(Integer userId, Integer gradeId, boolean isNewMember) throws BusinessCheckException {
         if (gradeId == null || gradeId.compareTo(0) <= 0) {
             return false;
         }
@@ -288,11 +288,12 @@ public class OpenGiftServiceImpl extends ServiceImpl<MtOpenGiftMapper, MtOpenGif
                            param.setCouponId(item.getCouponId());
                            param.setUserId(userId);
                            param.setNum(item.getCouponNum() == null ? 1 : item.getCouponNum());
-                           userCouponService.receiveCoupon(param);
+                           String uuid = UUID.randomUUID().toString().replaceAll("-", "");
+                           couponService.sendCoupon(item.getCouponId(), userId, param.getNum(), true, uuid, "");
                            totalAmount = totalAmount.add(mtCoupon.getAmount());
                        }
-                   } catch (BusinessCheckException e) {
-                       // empty
+                   } catch (Exception e) {
+                       throw new BusinessCheckException(e.getMessage());
                    }
                }
             }

+ 1 - 1
fuint-application/src/main/java/com/fuint/common/service/impl/UserCouponServiceImpl.java

@@ -236,7 +236,7 @@ public class UserCouponServiceImpl extends ServiceImpl<MtUserCouponMapper, MtUse
              if (userCouponId > 0) {
                  userCoupon = mtUserCouponMapper.selectById(userCouponId);
              }
-
+             userCoupon.setMerchantId(userInfo.getMerchantId());
              userCoupon.setCouponId(couponInfo.getId());
              userCoupon.setType(couponInfo.getType());
              userCoupon.setAmount(couponInfo.getAmount());