| | |
| | |
|
| | | // 查询记录
|
| | | UserSystemCouponRecord record = userSystemCouponRecordService.getRecordByOrderNo(orderNo,
|
| | | UserSystemCouponRecord.STATE_SUCCESS);
|
| | | sourceType, UserSystemCouponRecord.STATE_SUCCESS);
|
| | | if (record == null) {
|
| | | throw new UserSystemCouponException(1, "没有使用券记录");
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | // 查询记录
|
| | | UserSystemCouponRecord record = userSystemCouponRecordService.getRecordByOrderNo(orderNo, null);
|
| | | UserSystemCouponRecord record = userSystemCouponRecordService.getRecordByOrderNo(orderNo,sourceType, null);
|
| | | if (record == null) {
|
| | | throw new UserSystemCouponException(1, "没有使用券记录");
|
| | | }
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void updateStateByDrawback(String orderNo) throws Exception {
|
| | | public void updateStateByDrawback(String orderNo, Integer sourceType) throws Exception {
|
| | |
|
| | | if (orderNo == null || orderNo.trim().length() == 0) {
|
| | | return;
|
| | | }
|
| | |
|
| | | UserSystemCouponRecord record = userSystemCouponRecordService.getRecordByOrderNo(orderNo, null);
|
| | | UserSystemCouponRecord record = userSystemCouponRecordService.getRecordByOrderNo(orderNo,sourceType, null);
|
| | | if (record == null) {
|
| | | return;
|
| | | }
|
| | |
|
| | | record.setOrderNo(orderNo);
|
| | | record.setUpdateTime(new Date());
|
| | | record.setState(UserSystemCouponRecord.STATE_FAIL_DRAWBACK);
|
| | | userSystemCouponRecordService.updateByPrimaryKeySelective(record);
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void updateStateByArrivalAccount(String orderNo) throws Exception {
|
| | |
|
| | | public void updateStateByArrivalAccount(String orderNo, Integer sourceType) throws Exception {
|
| | | if (orderNo == null || orderNo.trim().length() == 0) {
|
| | | return;
|
| | | }
|
| | |
|
| | | UserSystemCouponRecord record = userSystemCouponRecordService.getRecordByOrderNo(orderNo, 2);
|
| | | UserSystemCouponRecord record = userSystemCouponRecordService.getRecordByOrderNo(orderNo,sourceType, 2);
|
| | | if (record == null) {
|
| | | return;
|
| | | }
|
| | |
|
| | | record.setOrderNo(orderNo);
|
| | | record.setUpdateTime(new Date());
|
| | | record.setState(UserSystemCouponRecord.STATE_SUCCESS);
|
| | | userSystemCouponRecordService.updateByPrimaryKeySelective(record);
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public boolean updateCouponRecordUsed(Long uid, String orderNo, BigDecimal payment, Long auctionId)
|
| | | public boolean updateCouponRecordUsed(Long uid, String orderNo, BigDecimal payment, Long gId,Integer sourceType)
|
| | | throws Exception {
|
| | |
|
| | | boolean isfree = false;
|
| | |
|
| | | if (uid == null || payment == null || auctionId == null || orderNo == null || orderNo.trim().length() == 0) {
|
| | | if (uid == null || payment == null || gId == null || orderNo == null || orderNo.trim().length() == 0) {
|
| | | throw new Exception("传递参数不能为空");
|
| | | }
|
| | |
|
| | | |
| | | boolean isfree = false;
|
| | | // 查询等待匹配的券记录
|
| | | List<UserSystemCouponRecord> list = userSystemCouponRecordService.getRecordByState(uid,
|
| | | UserSystemCouponRecord.STATE_WAIT);
|
| | |
| | |
|
| | | for (UserSystemCouponRecord userSystemCouponRecord : list) {
|
| | | Long goodId = userSystemCouponRecord.getGoodId();
|
| | | if (auctionId.equals(goodId)) {
|
| | | Integer goodSource = userSystemCouponRecord.getGoodSource();
|
| | | if (goodSource == null)
|
| | | continue;
|
| | | |
| | | if (gId.equals(goodId) && goodSource == sourceType) {
|
| | | matching = true; // 匹配成功
|
| | | record = userSystemCouponRecord;
|
| | | break;
|
| | |
| | |
|
| | | // 商品匹配成功
|
| | | if (matching) {
|
| | |
|
| | | record.setGoodSource(sourceType);
|
| | | record.setOrderNo(orderNo);
|
| | | record.setUpdateTime(new Date());
|
| | |
|