fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java
@@ -65,4 +65,21 @@ */ List<UserSystemCoupon> getCouponByTypeAndNotActivated(@Param("uid") Long uid, @Param("couponId") Long couponId); // /** // * 查询兑换的券 // * @param uid // * @param source // * @return // */ // List<UserSystemCoupon> countIncludeExchange(@Param("uid") Long uid, @Param("source") String source); // // // /** // * 查询排出兑换的券 // * @param uid // * @param source // * @return // */ // List<UserSystemCoupon> countNotIncludeExchange(@Param("uid") Long uid, @Param("source") String source); // } fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskClassServiceImpl.java
@@ -139,6 +139,8 @@ if (taskClass == null || taskClass.getState() == null || taskClass.getState() != 1) return null; DailySignVO dailySignVO = new DailySignVO(); Long cid = taskClass.getId(); List<IntegralTaskRecord> listRecord = integralTaskRecordService.getSignDaysRecord(uid, cid); if (listRecord != null && listRecord.size() > 0) { @@ -149,6 +151,7 @@ signDateVO.setGoldCoin("+" + taskRecord.getGoldCoin()); if(i == 0) { signDateVO.setDate("今日"); dailySignVO.setGoldCoin(taskRecord.getGoldCoin()); } else { String before = format.format(taskRecord.getCreateTime()); if (before.startsWith("0")) @@ -159,7 +162,7 @@ } } DailySignVO dailySignVO = new DailySignVO(); dailySignVO.setDays(listSign.size()); if (listSign.size() < 7) { fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -287,6 +287,35 @@ } @Override public void couponUsingFreeSheet(UserSystemCoupon coupon, String orderId, BigDecimal money, MsgTypeOtherTypeEnum type) { if (coupon == null || coupon.getUid() == null) return; MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponUsing(orderId, money, coupon.getStartTime(), coupon.getEndTime()); try { msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), coupon.getId(), dto, type, "实付款-返利=0元购(免单)")); } catch (MsgOtherDetailException e) { e.printStackTrace(); } } @Override public void couponUsedFreeSheet(UserSystemCoupon coupon, String orderId, MsgTypeOtherTypeEnum type) { if (coupon == null || coupon.getUid() == null) return; MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponUsed(orderId, "实付款-返利=0元购(免单)", coupon.getStartTime(), coupon.getEndTime()); try { msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), coupon.getId(), dto, type, "参与其他活动可获得更多免单券")); } catch (MsgOtherDetailException e) { e.printStackTrace(); } } @Override public void couponDrawBack(UserSystemCoupon coupon, String orderId, MsgTypeOtherTypeEnum type) { if (coupon == null || coupon.getUid() == null) fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -597,7 +597,8 @@ signList.add(PIC_REWARD); // 加入奖励成功图片 } else if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType) || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) { || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType) || CouponTypeEnum.freeCouponBuy.name().equals(systemCouponType)) { if (UserSystemCouponRecord.STATE_FREE_ON == state) { // 免单中 @@ -1171,7 +1172,8 @@ String systemCouponType = couponRecord.getCouponType(); Integer couponState = couponRecord.getState(); if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType) || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) { || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType) || CouponTypeEnum.freeCouponBuy.name().equals(systemCouponType)) { if (UserSystemCouponRecord.STATE_SUCCESS == couponState) { // 免单成功 order.setOtherState(2); @@ -1188,7 +1190,8 @@ String systemCouponType = couponRecord.getCouponType(); Integer couponState = couponRecord.getState(); if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType) || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) { || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType) || CouponTypeEnum.freeCouponBuy.name().equals(systemCouponType)) { if (UserSystemCouponRecord.STATE_SUCCESS == couponState) { // 免单成功 order.setOtherState(2); @@ -1205,7 +1208,8 @@ String systemCouponType = couponRecord.getCouponType(); Integer couponState = couponRecord.getState(); if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType) || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) { || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType) || CouponTypeEnum.freeCouponBuy.name().equals(systemCouponType)) { if (UserSystemCouponRecord.STATE_SUCCESS == couponState) { // 免单成功 order.setOtherState(2); fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponRecordServiceImpl.java
@@ -65,7 +65,8 @@ List<UserSystemCouponRecord> list = getRecordByOrderNoList(source, orderList); for (UserSystemCouponRecord record : list) { if (record.getCouponType().equalsIgnoreCase(CouponTypeEnum.freeCoupon.name()) || record.getCouponType().equalsIgnoreCase(CouponTypeEnum.welfareFreeCoupon.name())) { || record.getCouponType().equalsIgnoreCase(CouponTypeEnum.welfareFreeCoupon.name()) || record.getCouponType().equalsIgnoreCase(CouponTypeEnum.freeCouponBuy.name())) { if (record.getState() == UserSystemCouponRecord.STATE_FREE_ON || record.getState() == UserSystemCouponRecord.STATE_SUCCESS) return true; fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -199,7 +199,8 @@ } SystemCoupon coupon = null; if (couponType.equals(CouponTypeEnum.welfareFreeCoupon.name()) || couponType.equals(CouponTypeEnum.freeCoupon.name())) { if (couponType.equals(CouponTypeEnum.welfareFreeCoupon.name()) || couponType.equals(CouponTypeEnum.freeCoupon.name()) | couponType.equals(CouponTypeEnum.freeCouponBuy.name())) { // 免单券 coupon = systemCouponService.getCouponByType(couponType); } else if (couponType.equals(CouponTypeEnum.rebatePercentCoupon.name())) { @@ -483,11 +484,16 @@ } String source = userCouponVO.getSource(); if (source != null && "奖励券天天抽".equals(source)) { source = "天天抽"; } userCouponVO.setSource("来源:" + source); userCouponVO.setCouponName(systemCoupon.getName()); userCouponVO.setCouponEffect(systemCoupon.getEffect()); userCouponVO.setCouponRule(systemCoupon.getRule()); userCouponVO.setCouponRuleLink(systemCoupon.getRuleLink()); userCouponVO.setCouponPicture(systemCoupon.getPicture()); userCouponVO.setCouponPictureInvalid(systemCoupon.getPictureInvalid()); int differentDays = 0; @@ -504,7 +510,6 @@ differentDays = 0; } } userCouponVO.setCouponTerm(couponTerm); // 剩余天数 @@ -517,12 +522,9 @@ userCouponVO.setState(0); userCouponVO.setCouponEffect("待激活"); userCouponVO.setCouponPicture(systemCoupon.getPictureInvalid()); remainDaysFontColor = "#CCCCCC"; } else { userCouponVO.setCouponPicture(systemCoupon.getPicture()); remainDaysFontColor = "#F14242"; } @@ -533,6 +535,7 @@ return listVO; } /** * 是否存在奖励券 * @@ -600,12 +603,11 @@ } List<UserSystemCouponVO> list = getEnableListByCouponId(uid, null, couponList); // 获取商品详情 TaoBaoGoodsBrief taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(auctionId); if (taoBaoGoodsBrief != null) { BigDecimal quanPrice = TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief); // 券后价 大于10元 不能免单 if (quanPrice.compareTo(new BigDecimal(10)) > 0) { if (list != null && list.size() > 0) { @@ -619,7 +621,6 @@ map.put("fontColor", "#CCCCCC"); } userCouponVO.setRemainDays(map); } } } @@ -667,7 +668,8 @@ } if (baseCoupon.getType() != CouponTypeEnum.freeCoupon && baseCoupon.getType() != CouponTypeEnum.welfareFreeCoupon) { && baseCoupon.getType() != CouponTypeEnum.welfareFreeCoupon && baseCoupon.getType() != CouponTypeEnum.freeCouponBuy) { throw new UserSystemCouponException(1, "券类型不匹配"); } @@ -1207,6 +1209,8 @@ userOtherMsgNotificationService.welfareCouponUsed(record.getUserSystemCoupon(), orderNo); } else if (CouponTypeEnum.freeCoupon.name().equals(record.getCouponType())) { userOtherMsgNotificationService.freeSheetCouponUsed(record.getUserSystemCoupon(), orderNo); } else if (CouponTypeEnum.freeCouponBuy.name().equals(record.getCouponType())) { userOtherMsgNotificationService.couponUsedFreeSheet(record.getUserSystemCoupon(), orderNo, MsgTypeOtherTypeEnum.freeCouponBuy); } } @@ -1354,6 +1358,8 @@ userOtherMsgNotificationService.welfareCouponUsing(userSystemCoupon, orderNo, payment); } else if (CouponTypeEnum.freeCoupon.name().equals(couponType)) { userOtherMsgNotificationService.freeSheetCouponUsing(userSystemCoupon, orderNo, payment); } else if (CouponTypeEnum.freeCouponBuy.name().equals(couponType)) { userOtherMsgNotificationService.couponUsingFreeSheet(userSystemCoupon, orderNo, payment, MsgTypeOtherTypeEnum.freeCouponBuy); } } } @@ -2127,5 +2133,19 @@ userOtherMsgNotificationService.tokenGiveMsg(record.getGiveUid(), beiZhu, msgOther); } } // @Override // public boolean countIncludeExchange(Long uid) { // // // } // // // @Override // public boolean countNotIncludeExchange(Long uid) { // // // } } fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java
@@ -213,4 +213,15 @@ */ public void outOfDate(UserSystemCoupon coupon, MsgTypeOtherTypeEnum type); /** * 免单券正在使用 * * @param source * @param startTime * @param endTime */ public void couponUsingFreeSheet(UserSystemCoupon coupon,String orderId,BigDecimal money, MsgTypeOtherTypeEnum type); public void couponUsedFreeSheet(UserSystemCoupon coupon, String orderId, MsgTypeOtherTypeEnum type); }