Browse Source

修复分红发放

dos 1 month ago
parent
commit
ae4e553afd

+ 8 - 6
game-business/src/main/java/com/game/business/controller/AppUserCountDividendController.java

@@ -96,9 +96,9 @@ public class AppUserCountDividendController extends BaseController
         String userId = dto.getUserId();
         String dateNo = dto.getDateNum();
         Long curUserId = SecurityUtils.getUserId();
-        if(null == userId && StringUtils.isBlank(dateNo)){
+        /*if(null == userId && StringUtils.isBlank(dateNo)){
             return HttpRet.fail("发放失败,参数为空");
-        }
+        }*/
         List<AppUserCountDividend> dividendList = appUserCountDividendService.selectUserDividendList(SecurityUtils.getUserId(), org.apache.commons.lang3.StringUtils.isBlank(userId)?null:Long.parseLong(userId),dateNo);
         if(null == dividendList || dividendList.size() < 1){
             return HttpRet.fail("发放失败,不存在或已发放");
@@ -120,7 +120,7 @@ public class AppUserCountDividendController extends BaseController
                 Long errUserId = countDividend.getUserId();
                 try {
                     List<FinTranRecord> tranRecordList = new ArrayList<>();
-                    AppUser appUser = userMap.get(countDividend.getUserId());
+                    AppUser appUser = userMap.get(String.valueOf(countDividend.getUserId()));
                     AppUser curUser = appUserService.selectAppUserByUserid(curUserId);
                     if(!curUserId.equals(appUser.getPid())){
                         throw new ServiceException("只能给直属团队成员发放");
@@ -148,7 +148,8 @@ public class AppUserCountDividendController extends BaseController
                         curTran.setCurrencyType(TranCurrencyType.Balance.getType());
                         curTran.setRemarks(countDividend.getDateNo() + " 发放团队分红奖励");
                         curTran.setFromUid(curUserId);
-                        tranRecordList.add(curTran);
+//                        tranRecordList.add(curTran);
+                        appUserService.updateUserAmount(curTran);
 
                         //受益用户
                         /*updateAppUser.setDiamondCoin(appUser.getDiamondCoin() + e.getDiamondCoin());
@@ -183,7 +184,8 @@ public class AppUserCountDividendController extends BaseController
                         curTran.setCurrencyType(TranCurrencyType.Coin.getType());
                         curTran.setRemarks(countDividend.getDateNo() + " 发放团队分红奖励");
                         curTran.setFromUid(curUserId);
-                        tranRecordList.add(curTran);
+//                        tranRecordList.add(curTran);
+                        appUserService.updateUserAmount(curTran);
 
                         //                    updateAppUser.setCoin(appUser.getDiamondCoin() + e.getDiamondCoin());
                         //流水 余额
@@ -219,7 +221,7 @@ public class AppUserCountDividendController extends BaseController
                     userCountDividend.setStatus(1);
                     appUserCountDividendService.updateAppUserCountDividend(userCountDividend);
                 }catch (Exception ex){
-                    errMsg = "发放失败:".concat(ex.getMessage());
+                    errMsg = "发放失败:" + ex.getMessage();
                     logger.info("{}发放失败:{}",errUserId,ex.getMessage());
                     break;
                 }