From 01e773cf27e572b8fb83538d85f31130930d93d1 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期四, 15 八月 2019 15:57:23 +0800 Subject: [PATCH] 券赠送 --- fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeRecordServiceImpl.java | 19 +++++++------------ 1 files changed, 7 insertions(+), 12 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeRecordServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeRecordServiceImpl.java index c878197..6fd8a39 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeRecordServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeRecordServiceImpl.java @@ -1,19 +1,16 @@ package com.yeshi.fanli.service.impl.integral; -import java.util.ArrayList; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; -import org.yeshi.utils.JsonUtil; import com.yeshi.fanli.dao.mybatis.integral.IntegralExchangeRecordMapper; import com.yeshi.fanli.entity.integral.IntegralExchange; import com.yeshi.fanli.service.inter.integral.IntegralExchangeRecordService; import com.yeshi.fanli.service.inter.integral.IntegralExchangeService; import com.yeshi.fanli.util.StringUtil; -import com.yeshi.fanli.vo.user.UserInfoExtraVO; @Service public class IntegralExchangeRecordServiceImpl implements IntegralExchangeRecordService { @@ -31,24 +28,22 @@ return listValid; } - List<Long> listId = new ArrayList<Long>(); - for(IntegralExchange integralExchange: listValid) { - listId.add(integralExchange.getId()); - } - - List<Long> listRecord = integralExchangeRecordMapper.listRecordByExchangeIds(listId); for(IntegralExchange integralExchange: listValid) { String progress = integralExchange.getProgress(); if (StringUtil.isNullOrEmpty(progress)) continue; - int exchange = 0; - if (listRecord != null && listRecord.size() >0 && listRecord.contains(integralExchange.getId())) - exchange = 1; + // 浠婃棩鍏戞崲鎯呭喌 + long exchange = integralExchangeRecordMapper.countRecordByUid(integralExchange.getId(), uid); progress = progress.replace("{宸插厬鎹", exchange + "").replace("{涓婇檺鏁皚", integralExchange.getUpperLimit() + ""); integralExchange.setProgress(progress); } return listValid; } + + @Override + public long countRecordByUid(long exchangeid, Long uid){ + return integralExchangeRecordMapper.countRecordByUid(exchangeid, uid); + } } -- Gitblit v1.8.0