From 69bee82b81626b82b7f39f0e459e4f56b1699b51 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 13 三月 2019 12:02:16 +0800 Subject: [PATCH] 正式数据库修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponRecordServiceImpl.java | 32 +++++++++++++++++++++++++++----- 1 files changed, 27 insertions(+), 5 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponRecordServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponRecordServiceImpl.java index 5d17d67..971ef8c 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponRecordServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponRecordServiceImpl.java @@ -1,5 +1,6 @@ package com.yeshi.fanli.service.impl.user; +import java.util.ArrayList; import java.util.List; import javax.annotation.Resource; @@ -8,15 +9,15 @@ import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponRecordMapper; import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord; +import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum; import com.yeshi.fanli.service.inter.user.UserSystemCouponRecordService; @Service public class UserSystemCouponRecordServiceImpl implements UserSystemCouponRecordService { - + @Resource private UserSystemCouponRecordMapper userSystemCouponRecordMapper; - @Override public int insertSelective(UserSystemCouponRecord record) { return userSystemCouponRecordMapper.insertSelective(record); @@ -38,7 +39,12 @@ } @Override - public UserSystemCouponRecord getRecordByOrderNo(String orderNo, Integer state) { + public List<UserSystemCouponRecord> getRecordByState(Long uid, Integer state) { + return userSystemCouponRecordMapper.getRecordByState(uid, state); + } + + @Override + public UserSystemCouponRecord getRecordByOrderNo(String orderNo, Integer state) { return userSystemCouponRecordMapper.getRecordByOrderNo(orderNo, state); } @@ -46,10 +52,26 @@ public List<UserSystemCouponRecord> getRecordByOrderNoList(List<String> list) { return userSystemCouponRecordMapper.getRecordByOrderNoList(list); } - + @Override - public List<UserSystemCouponRecord> getCouponByUsingTimeOut(Long uid, long seconds) { + public List<UserSystemCouponRecord> getCouponByUsingTimeOut(Long uid, Long seconds) { return userSystemCouponRecordMapper.getCouponByUsingTimeOut(uid, seconds); } + @Override + public boolean isSuccessMianDan(String orderId) { + List<String> orderList = new ArrayList<>(); + orderList.add(orderId); + List<UserSystemCouponRecord> list = getRecordByOrderNoList(orderList); + for (UserSystemCouponRecord record : list) { + if (record.getCouponType().equalsIgnoreCase(CouponTypeEnum.freeCoupon.name()) + || record.getCouponType().equalsIgnoreCase(CouponTypeEnum.welfareFreeCoupon.name())) { + if (record.getState() == UserSystemCouponRecord.STATE_FREE_ON + || record.getState() == UserSystemCouponRecord.STATE_SUCCESS) + return true; + } + } + return false; + } + } -- Gitblit v1.8.0