|
|
|
@@ -10,6 +10,8 @@ import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.WxCouponPasswordMapper; |
|
|
|
import com.iformall.service.WxCouponPasswordService; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
@@ -20,6 +22,7 @@ import java.util.Random; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { |
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCouponPasswordMapper wxCouponPasswordMapper; |
|
|
|
@@ -55,8 +58,10 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { |
|
|
|
} |
|
|
|
if (password == null) { |
|
|
|
if (errCode.equals(EnumCouponPasswordStatus.USED.getCode())) { |
|
|
|
logger.error("卡券已使用"); |
|
|
|
throw new MallinkException(ErrorCode.CARD_PASSWORD_HAD_USED); |
|
|
|
} else { |
|
|
|
logger.error("卡券已过期或已作废"); |
|
|
|
throw new MallinkException(ErrorCode.CARD_PASSWORD_IS_CANCELED); |
|
|
|
} |
|
|
|
} |
|
|
|
|