Browse Source

分红只显示和发放当前周期

dos 8 tháng trước cách đây
mục cha
commit
84046ffd8f

+ 9 - 0
game-business/src/main/java/com/game/business/service/impl/AppUserCountDividendServiceImpl.java

@@ -146,6 +146,15 @@ public class AppUserCountDividendServiceImpl extends ServiceImpl<AppUserCountDiv
 
     @Override
     public List<AppUserCountDividend> selectUserDividendList(Long pid,Long userId,String dateNum,Integer status) {
+        //需求变动  只展示和发放上一周期数据
+        String day = DateUtil.format(DateUtil.date(),"dd");
+        if(Integer.parseInt(day) > 15){
+            //下半月上一周期是15号
+            dateNum = DateUtil.format(DateUtil.date(),"yyyy-MM").concat("-15");
+        }else{
+            //上半月上一周期为上个月月底
+            dateNum = DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),-1)),"yyyy-MM-dd");
+        }
         List<AppUserCountDividend> dividendList = appUserCountDividendMapper.selectUserDividendList(pid,userId,dateNum,status);
         if(null != dividendList && dividendList.size()>0){
             List<Long> ids = dividendList.stream().map(AppUserCountDividend::getUserId).collect(Collectors.toList());