From 75b9f225c0fb0bbd429d542d4e20337f3c0e13f1 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 21 八月 2019 18:39:41 +0800 Subject: [PATCH] 金币获取服务修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeRecordServiceImpl.java | 29 +++++++++++++++++++++-------- 1 files changed, 21 insertions(+), 8 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 6e87300..2130fc3 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 @@ -13,6 +13,7 @@ import com.yeshi.fanli.entity.integral.IntegralExchange.ExchangeTypeEnum; import com.yeshi.fanli.entity.integral.IntegralExchangeRecord; import com.yeshi.fanli.log.LogHelper; +import com.yeshi.fanli.service.inter.integral.CodePublishRecordService; import com.yeshi.fanli.service.inter.integral.IntegralExchangeRecordService; import com.yeshi.fanli.service.inter.integral.IntegralExchangeService; import com.yeshi.fanli.service.inter.user.UserInfoExtraService; @@ -29,6 +30,11 @@ @Resource private UserInfoExtraService userInfoExtraService; + + @Resource + private CodePublishRecordService codePublishRecordService; + + @Override public List<IntegralExchange> listExchange(long start, int count, Long uid){ @@ -60,7 +66,7 @@ Long id = exchange.getId(); if (type == ExchangeTypeEnum.freeCouponBuy) { // 娉細鍥犺嚜璐厤鍗曞埜锛屼竴涓敤鎴峰彧鑳藉厬鎹竴娆★紝鍒欏綋鍓嶇敤鎴蜂竴鏃﹀厬鎹㈡垚鍔燂紝鑷喘鍏嶅崟鍒稿厬鎹㈠叆鍙f案涔呭湪褰撳墠鐢ㄦ埛閲戝竵鍏戞崲鍒楄〃涓秷澶便�� - long num = integralExchangeRecordMapper.countRecordByUid(id, uid); + long num = integralExchangeRecordMapper.countRecordByUid(id, uid, null); if (num >= 1) { listValid.remove(i); i --; @@ -76,10 +82,17 @@ } // 閭�璇风爜鍙戝竷鍗★紝鍏戞崲椤癸紝濡傛灉褰撳墠鐢ㄦ埛鏈縺娲婚個璇峰姛鑳斤紝鍒欎笉闇�瑕佹樉绀鸿鍏戞崲椤广�� - if (type == ExchangeTypeEnum.inviteCodePublish && !hasCode) { - listValid.remove(i); - i --; - continue; + if (type == ExchangeTypeEnum.inviteCodePublish) { + if (!hasCode) { + listValid.remove(i); + i --; + continue; + } + + if(codePublishRecordService.countValidRecord(uid) > 0) { + exchange.setBtnName("鍘绘煡鐪�"); + exchange.setNeedJump(true); + } } String progress = exchange.getProgress(); @@ -87,7 +100,7 @@ continue; // 浠婃棩鍏戞崲鎯呭喌 - long num = integralExchangeRecordMapper.countRecordByUid(id, uid); + long num = integralExchangeRecordMapper.countRecordByUid(id, uid, null); Integer upperLimit = exchange.getUpperLimit(); if (upperLimit == null) { progress = progress.replace("{宸插厬鎹", num + "").replace("/{涓婇檺鏁皚", ""); @@ -100,8 +113,8 @@ } @Override - public long countRecordByUid(long exchangeid, Long uid){ - return integralExchangeRecordMapper.countRecordByUid(exchangeid, uid); + public long countRecordByUid(long exchangeid, Long uid, Integer today){ + return integralExchangeRecordMapper.countRecordByUid(exchangeid, uid, today); } @Override -- Gitblit v1.8.0