| | |
| | | import com.yeshi.fanli.entity.system.SystemCoupon;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.exception.user.UserSystemCouponException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | |
| | | @Resource
|
| | | private UserOtherMsgNotificationService userOtherMsgNotificationService;
|
| | |
|
| | | @Lazy
|
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | |
|
| | |
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | @Lazy
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | |
|
| | |
| | |
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | // 添加一条消息
|
| | | if (userInfoExtra != null) {
|
| | | if (userInfoExtra.getCouponNews() == null) {
|
| | | userInfoExtra.setCouponNews(1);
|
| | | public void run() { // 福利中心红点
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (extra != null) {
|
| | | UserInfoExtra updateExtra = new UserInfoExtra();
|
| | | updateExtra.setId(extra.getId());
|
| | | if (extra.getCouponNews() == null) {
|
| | | updateExtra.setCouponNews(1);
|
| | | } else {
|
| | | userInfoExtra.setCouponNews(userInfoExtra.getCouponNews() + 1);
|
| | | updateExtra.setCouponNews(extra.getCouponNews() + 1);
|
| | | }
|
| | |
|
| | | try {
|
| | | userInfoExtraService.saveUserInfoExtra(userInfoExtra);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | userInfoExtraService.updateByPrimaryKeySelective(updateExtra);
|
| | | }
|
| | |
|
| | | }
|
| | | });
|
| | |
|
| | |
| | |
|
| | | return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public long countGiveFreeCoupon(Long uid) {
|
| | | if (uid == null)
|
| | | return 0;
|
| | |
|
| | | List<SystemCoupon> couponList = systemCouponService.getGiveFreeCouponList();
|
| | | if (couponList == null || couponList.size() == 0)
|
| | | return 0;
|
| | |
|
| | | List<Long> listCouponId = new ArrayList<Long>();
|
| | | for (SystemCoupon systemCoupon : couponList) {
|
| | | listCouponId.add(systemCoupon.getId());
|
| | | }
|
| | |
|
| | | return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | public long countUsableRewardCoupon(Long uid) {
|
| | |
| | | if (userInfoExtra == null) {
|
| | | return;
|
| | | }
|
| | | |
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | Integer couponNews = userInfoExtra.getCouponNews();
|
| | | if (couponNews == null) {
|
| | | userInfoExtra.setCouponNews(num);
|
| | | extra.setCouponNews(num);
|
| | | } else {
|
| | | userInfoExtra.setCouponNews(couponNews + num);
|
| | | extra.setCouponNews(couponNews + num);
|
| | | }
|
| | | userInfoExtraService.saveUserInfoExtra(userInfoExtra);
|
| | | userInfoExtraService.saveUserInfoExtra(extra);
|
| | | }
|
| | |
|
| | | @Override
|