From 24a8d17e007545f7426c48352109aa1a9c6587ee Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 06 五月 2020 12:02:09 +0800 Subject: [PATCH] IOS上线隐藏我的界面的banner与超级会员升级信息 --- fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDetailServiceImpl.java | 58 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 45 insertions(+), 13 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDetailServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDetailServiceImpl.java index 4f10898..d5ddcad 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDetailServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDetailServiceImpl.java @@ -39,16 +39,19 @@ } @Override - public List<UserMoneyDetailHistoryVO> listUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Date maxTime) { + public List<UserMoneyDetailHistoryVO> listUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Integer type, + Date maxTime) { List<UserMoneyDetailHistoryVO> finalList = new ArrayList<>(); List<UserMoneyDetail> list = null; if (userMoneyDetailId == null) {// 棣栨璇锋眰 if (maxTime == null)// 娌℃湁绛涢�夋椂闂� { - list = userMoneyDetailMapper.selectByMaxCreateTime(uid, - new Date(System.currentTimeMillis() + 1000 * 60 * 60L), 20); + Date date = new Date(System.currentTimeMillis() + 1000 * 60 * 60L); + list = userMoneyDetailMapper.selectByMaxCreateTime(uid, date, 20, type); + System.out.println("maxTime == null"); } else {// 绛涢�変簡鏃堕棿 - list = userMoneyDetailMapper.selectByMaxCreateTime(uid, maxTime, 20); + System.out.println("maxTime != null"); + list = userMoneyDetailMapper.selectByMaxCreateTime(uid, maxTime, 20, type); } if (list != null && list.size() > 0) { @@ -72,7 +75,8 @@ } else {// 浜屾璇锋眰 int size = 21; - List<UserMoneyDetail> tempList = userMoneyDetailMapper.selectByUidWithIndexId(uid, userMoneyDetailId, size); + List<UserMoneyDetail> tempList = userMoneyDetailMapper.selectByUidWithIndexId(uid, userMoneyDetailId, size, + type); Set<Date> dateSet = new HashSet<>();// 鐢ㄤ簬鍌ㄥ瓨鏄惁鍦ㄥ悓涓�鏃堕棿涓婇潰锛堢簿纭埌绉掞級 if (tempList.size() > 0) { for (UserMoneyDetail umd : tempList) { @@ -83,7 +87,7 @@ while (dateSet.size() == 1 && tempList2.size() != tempList.size() && size < 40) {// 鍙湁涓�涓椂闂寸偣鐨勬暟鎹� tempList = tempList2; size += 10; - tempList2 = userMoneyDetailMapper.selectByUidWithIndexId(uid, userMoneyDetailId, size); + tempList2 = userMoneyDetailMapper.selectByUidWithIndexId(uid, userMoneyDetailId, size, type); dateSet.clear(); for (UserMoneyDetail umd : tempList2) { dateSet.add(umd.getCreateTime()); @@ -185,24 +189,26 @@ inType = true; break; } - if (inType) + if (inType) { detail.setTitle(detail.getTitle() + "銆�" + Constant.getSourceName(detail.getOrderType()) + "銆�"); + } return detail; } @Override - public long countUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Date maxTime) { + public long countUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Integer type, Date maxTime) { + // TODO 澧炲姞type绛涢�� long monthCount = 0L; long detailCount = 0L; // 鏈�氳繃鏃堕棿绛涢�夛紝鏌ヨ鎵�鏈� if (maxTime == null) { - detailCount = userMoneyDetailMapper.selectCountByUid(uid); + detailCount = userMoneyDetailMapper.selectCountByUid(uid, type); // 鐢ㄤ簬琛ㄧず褰撳墠鎵�鏈� monthCount = userMoneyDetailMapper.selectMonthCountByUid(uid, - new Date(System.currentTimeMillis() + 1000 * 60 * 60L)); + new Date(System.currentTimeMillis() + 1000 * 60 * 60L), type); } else {// 閫氳繃鏃堕棿绛涢�変簡鐨勶紝闇�瑕佹煡璇㈡墍鏈� - detailCount = userMoneyDetailMapper.selectCountByUidAndMaxCreateTime(uid, maxTime); - monthCount = userMoneyDetailMapper.selectMonthCountByUid(uid, maxTime); + detailCount = userMoneyDetailMapper.selectCountByUidAndMaxCreateTime(uid, maxTime, type); + monthCount = userMoneyDetailMapper.selectMonthCountByUid(uid, maxTime, type); } return monthCount + detailCount; @@ -226,7 +232,19 @@ for (UserMoneyDetailTypeEnum type : typeList) { list.add(type.name()); } - BigDecimal money = userMoneyDetailMapper.getTotalMoneyByTypeAndUidWithDate(uid, list, minDate, maxDate); + BigDecimal money = userMoneyDetailMapper.getTotalMoneyByTypeAndUidWithDate(uid, list, minDate, maxDate, null); + return money == null ? new BigDecimal(0) : money; + } + + @Override + public BigDecimal statisticUserTypeMoneyWithDate(Long uid, List<UserMoneyDetailTypeEnum> typeList, Date minDate, + Date maxDate, Integer show) { + List<String> list = new ArrayList<>(); + if (typeList != null) + for (UserMoneyDetailTypeEnum type : typeList) { + list.add(type.name()); + } + BigDecimal money = userMoneyDetailMapper.getTotalMoneyByTypeAndUidWithDate(uid, list, minDate, maxDate, show); return money == null ? new BigDecimal(0) : money; } @@ -236,4 +254,18 @@ return userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(type, uid, sourceIdentifyId); } + @Override + public List<UserMoneyDetail> listQuery(int page, int pageSize, String key, Integer keyType) { + return userMoneyDetailMapper.listQuery((page - 1) * pageSize, pageSize, key, keyType); + } + + @Override + public long countQuery(String key, Integer keyType) { + Long count = userMoneyDetailMapper.countQuery(key, keyType); + if (count == null) { + count = 0L; + } + return count; + } + } -- Gitblit v1.8.0