| | |
| | | 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;
|
| | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void insertUserCoupon(Long uid, String couponType, String source)throws UserSystemCouponException,Exception{
|
| | | public void insertUserCoupon(Long uid, String couponType, String source)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
|
| | | if (couponType == null || uid == null) {
|
| | | throw new UserSystemCouponException(1, "参数不正确");
|
| | |
| | | userInfoExtra.setCouponNews(userInfoExtra.getCouponNews() + 1);
|
| | | }
|
| | |
|
| | | |
| | | try {
|
| | | userInfoExtraService.saveUserInfoExtra(userInfoExtra);
|
| | | } catch (UserInfoExtraException e) {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | |
| | |
|
| | | jumpBtn = new HashMap<String, Object>();
|
| | |
|
| | | |
| | | // 邀请队员界面
|
| | | /*
|
| | | * Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | *UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | * if (userInfoExtra != null && userInfoExtra.getInviteCode() != null &&
|
| | | * userInfoExtra.getInviteCode().trim().length() > 0) { // 邀请激活成功界面
|
| | | * jumpLink.put("url", configService.get("invite_activation_success_url") +
|
| | | * UserInfoExtra userInfoExtra =
|
| | | * userInfoExtraService.getUserInfoExtra(uid); if (userInfoExtra
|
| | | * != null && userInfoExtra.getInviteCode() != null &&
|
| | | * userInfoExtra.getInviteCode().trim().length() > 0) { //
|
| | | * 邀请激活成功界面 jumpLink.put("url",
|
| | | * configService.get("invite_activation_success_url") +
|
| | | * "?alert=true"); } else { // 激活邀请码界面 jumpLink.put("url",
|
| | | * configService.get("invite_activation_url")); }
|
| | | * jumpBtn.put("params", jumpLink);
|
| | |
| | | userCouponVO.setCouponRule(systemCoupon.getRule());
|
| | | userCouponVO.setCouponPictureInvalid(systemCoupon.getPictureInvalid());
|
| | |
|
| | |
|
| | | int differentDays = 0;
|
| | | String couponTerm = "有效期:";
|
| | | Date startTime = userCouponVO.getStartTime();
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public List<UserSystemCouponVO> getGoodsCouponList(Long uid, Long auctionId) throws UserSystemCouponException, Exception {
|
| | | public List<UserSystemCouponVO> getGoodsCouponList(Long uid, Long auctionId)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
|
| | | if (uid == null) {
|
| | | throw new UserSystemCouponException(1, "用户未登录");
|
| | |
| | | throw new UserSystemCouponException(1, "券数据不正确");
|
| | | }
|
| | |
|
| | | if (userSystemCoupon.getUid().longValue() != uid) {
|
| | | throw new UserSystemCouponException(1, "不属于该用户的券");
|
| | | }
|
| | |
|
| | | 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)) {
|
| | |
| | | throw new UserSystemCouponException(1, "券信息不存在");
|
| | | }
|
| | |
|
| | | if (userSystemCoupon.getUid().longValue() != uid) {
|
| | | throw new UserSystemCouponException(1, "不属于该用户的券");
|
| | | }
|
| | |
|
| | | Integer state = userSystemCoupon.getState();
|
| | | Integer stateActivated = userSystemCoupon.getStateActivated();
|
| | | if (UserSystemCoupon.STATE_CAN_USE != state || 1 != stateActivated) {
|
| | |
| | | throw new UserSystemCouponException(1, "券类型不匹配");
|
| | | }
|
| | |
|
| | | |
| | | if (orderNo == null || orderNo.trim().length() == 0) {
|
| | | throw new UserSystemCouponException(1, "订单号不存在");
|
| | | }
|
| | |
| | | if (orderVO == null) {
|
| | | throw new UserSystemCouponException(1, "订单信息获取失败");
|
| | | }
|
| | |
|
| | |
|
| | | BigDecimal hongBao = orderVO.getHongBao();
|
| | | // 红包状态
|
| | |
| | |
|
| | | Long uid = userSystemCoupon.getUid();
|
| | |
|
| | | CommonOrderVO commonOrderVO= commonOrderService.getCommonOrderByOrderNo(userSystemCoupon.getUid(),
|
| | | orderNo, CommonOrder.STATE_JS);
|
| | | CommonOrderVO commonOrderVO = commonOrderService.getCommonOrderByOrderNo(userSystemCoupon.getUid(), orderNo,
|
| | | CommonOrder.STATE_JS);
|
| | |
|
| | | if (commonOrderVO == null) {
|
| | | throw new UserSystemCouponException(1, "订单信息获取失败");
|
| | |
| | |
|
| | | return userRecordVO;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public UserSystemCouponRecordVO getFreeCouponRecord(String orderNo) throws UserSystemCouponException, Exception {
|
| | |
| | | return userRecordVO;
|
| | | }
|
| | |
|
| | | |
| | | @Transactional
|
| | | @Override
|
| | | public void activatedWelfareFreeCoupon(Long uid, String fromNickName) {
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public boolean updateCouponRecordUsed(Long uid, String orderNo, BigDecimal payment,
|
| | | Long auctionId) throws Exception{
|
| | | public boolean updateCouponRecordUsed(Long uid, String orderNo, BigDecimal payment, Long auctionId)
|
| | | throws Exception {
|
| | |
|
| | | boolean isfree = false;
|
| | |
|
| | | if (uid == null || payment == null || auctionId == null || orderNo == null || |
| | | orderNo.trim().length() == 0 ) {
|
| | | if (uid == null || payment == null || auctionId == null || orderNo == null || orderNo.trim().length() == 0) {
|
| | | throw new Exception("传递参数不能为空");
|
| | | }
|
| | |
|
| | | // 查询等待匹配的券记录
|
| | | List<UserSystemCouponRecord> list = userSystemCouponRecordService.getRecordByState(uid, UserSystemCouponRecord.STATE_WAIT);
|
| | | List<UserSystemCouponRecord> list = userSystemCouponRecordService.getRecordByState(uid,
|
| | | UserSystemCouponRecord.STATE_WAIT);
|
| | | if (list == null || list.size() == 0) {
|
| | | return isfree;
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 退回券 初始数据
|
| | | * |
| | | * @param userSystemCoupon
|
| | | */
|
| | | public void sendBackCoupon(UserSystemCoupon userSystemCoupon, UserSystemCouponRecord record) throws Exception{
|
| | |
| | |
|
| | | userSystemCouponMapper.updateByPrimaryKey(userSystemCoupon);
|
| | |
|
| | | |
| | | if (CouponTypeEnum.welfareFreeCoupon.name().equals(record.getCouponType())) {
|
| | | userOtherMsgNotificationService.welfareCouponDrawBack(userSystemCoupon, record.getOrderNo());
|
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(record.getCouponType())) {
|
| | | userOtherMsgNotificationService.freeSheetCouponDrawBack(userSystemCoupon, record.getOrderNo());
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | |
| | | }
|
| | |
|
| | | }
|
| | | |