From 2cde53516c1689efab451aef72c1db5e13b825a3 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 15 四月 2020 16:42:03 +0800 Subject: [PATCH] 团队订单金额消息加入补贴 --- fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java | 48 ++++++++---------------------------------------- 1 files changed, 8 insertions(+), 40 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java index daa1f7a..dba80bb 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java @@ -2,7 +2,6 @@ import java.math.BigDecimal; import java.util.ArrayList; -import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -322,8 +321,7 @@ @Transactional(rollbackFor = Exception.class) @Override - public void shareSettleTB(Long uid) throws OrderMoneySettleException { - Date maxPregetTime = new Date(); + public void shareSettleTB(Long uid,Date maxPregetTime) throws OrderMoneySettleException { /** * 澶勭悊鍒嗕韩璧� */ @@ -369,8 +367,7 @@ @Transactional(rollbackFor = Exception.class) @Override - public void shareSettleJD(Long uid) throws OrderMoneySettleException { - Date maxPregetTime = new Date(); + public void shareSettleJD(Long uid,Date maxPregetTime) throws OrderMoneySettleException { /** * 澶勭悊鍒嗕韩璧� */ @@ -411,8 +408,7 @@ @Transactional(rollbackFor = Exception.class) @Override - public void shareSettlePDD(Long uid) throws OrderMoneySettleException { - Date maxPregetTime = new Date(); + public void shareSettlePDD(Long uid,Date maxPregetTime) throws OrderMoneySettleException { /** * 澶勭悊鍒嗕韩璧� */ @@ -710,22 +706,8 @@ if (sharemoney.compareTo(new BigDecimal(0)) > 0) { // 娣诲姞鏂扮増璇︽儏璁板綍 try { - // 璁$畻鏈湀鐨勬湁鏁堣鍗曪紝澶辨晥璁㈠崟锛岀淮鏉冭鍗� - Calendar ca = Calendar.getInstance(); - - Date maxDate = new Date(TimeUtil - .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M")); - ca.add(Calendar.MONTH, -1); - - Date minDate = new Date(TimeUtil - .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M")); - long validCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_JS, - minDate, maxDate, Constant.SOURCE_TYPE_TAOBAO); - long weiQuanCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_WQ, - minDate, maxDate, Constant.SOURCE_TYPE_TAOBAO); - UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, Constant.SOURCE_TYPE_TAOBAO, - (int) validCount, (int) weiQuanCount, sharemoney, new Date()); + sharemoney, new Date()); // 娣诲姞璧勯噾 userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail); @@ -809,22 +791,8 @@ if (sharemoney.compareTo(new BigDecimal(0)) > 0) { // 娣诲姞鏂扮増璇︽儏璁板綍 try { - // 璁$畻鏈湀鐨勬湁鏁堣鍗曪紝澶辨晥璁㈠崟锛岀淮鏉冭鍗� - Calendar ca = Calendar.getInstance(); - - Date maxDate = new Date(TimeUtil - .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M")); - ca.add(Calendar.MONTH, -1); - - Date minDate = new Date(TimeUtil - .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M")); - long validCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_JS, - minDate, maxDate, sourceType); - long weiQuanCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_WQ, - minDate, maxDate, sourceType); - - UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, sourceType, (int) validCount, - (int) weiQuanCount, sharemoney, new Date()); + UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, sourceType, sharemoney, + new Date()); // 娣诲姞璧勯噾 userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail); @@ -868,9 +836,9 @@ */ @Transactional(rollbackFor = Exception.class) @Override - public void inviteSubsidySettle(Long uid, String taskKey,Date maxPreGetTime) + public void inviteSubsidySettle(Long uid, String taskKey, Date maxPreGetTime) throws OrderMoneySettleException, TeamEincomeRecordException, ParamsException { - teamSubsidyManager.addToTeamEincome(uid, taskKey,maxPreGetTime); + teamSubsidyManager.addToTeamEincome(uid, taskKey, maxPreGetTime); } private String getTaskKey(Long uid) { -- Gitblit v1.8.0