Browse Source

收益概览-分页查询 日期筛选

tanbin 1 year ago
parent
commit
1aeb00dbbe

+ 6 - 3
device-api-service-merc-mini/src/main/java/com/xy/controller/MercFeeCountController.java

@@ -58,9 +58,12 @@ public class MercFeeCountController {
     public R applySettle(@RequestBody @Validated MercFeeSettleDto.ApplyDTO dto) {
         Long mercId = MercAuthUtils.getMercId();
         dto.setMercId(mercId);
-        //验证结算金额是否在可结算金额范围内
+        // 验证结算金额是否在可结算金额范围内
         Integer settleMoney = dto.getSettleMoney();
-        //可结算金额查看
+        if (settleMoney.intValue() <= 0) {
+            throw new CommRuntimeException("申请结算金额填写有误,必须大于0");
+        }
+        // 可结算金额查看
         MercFeeStatisticDto.InFoVO inFoVO = R.feignCheckData(mercFeeStatisticService.info(mercId));
         Integer unSettleMoney = inFoVO.getUnSettleMoney();
         if (settleMoney > unSettleMoney) {
@@ -69,7 +72,7 @@ public class MercFeeCountController {
 
         Boolean b = R.feignCheckData(mercFeeSettleService.applySettle(dto));
         if (BooleanUtil.isTrue(b)) {
-            //成功申请,统计表中的可结算佣金扣除申请结算金额
+            // 成功申请,统计表中的可结算佣金扣除申请结算金额
             unSettleMoney = unSettleMoney - settleMoney;
             MercFeeStatistic mercFeeStatistic = new MercFeeStatistic();
             mercFeeStatistic.setMercId(mercId);

+ 7 - 6
device-api-service/src/main/java/com/xy/service/MercFeeCountMonthServiceImpl.java

@@ -89,10 +89,11 @@ public class MercFeeCountMonthServiceImpl extends ServiceImpl<MercFeeCountMonthM
                 .orderByDesc(MercFeeCountMonth::getDateValue);
 
         if (StrUtil.isNotEmpty(start) && StrUtil.isNotEmpty(end)) {
+            // 2024-04-03
             String startDate = start.replaceAll("-", "");
             String endDate = end.replaceAll("-", "");
-            int s = Integer.valueOf(startDate).intValue();
-            int e = Integer.valueOf(endDate).intValue();
+            int s = Integer.parseInt(startDate.substring(0, 4) + startDate.substring(5, 7));
+            int e = Integer.parseInt(endDate.substring(0, 4) + endDate.substring(5, 7));
             lambdaQueryWrapper.between(MercFeeCountMonth::getDateValue, s, e);
         }
         IPage<MercFeeCountMonth> iPage = page(toIPage(pageBean), lambdaQueryWrapper);
@@ -104,7 +105,7 @@ public class MercFeeCountMonthServiceImpl extends ServiceImpl<MercFeeCountMonthM
             Map<Long, String> mercMap = mercList.stream().collect(Collectors.toMap(MercDto.Vo::getId, MercDto.Vo::getName));
             for (MercFeeCountMonthDto.Vo record : records) {
                 Long mercId = record.getMercId();
-                //反显商户名称
+                // 反显商户名称
                 String mercName = mercMap.get(mercId);
                 record.setMercName(mercName);
             }
@@ -127,13 +128,13 @@ public class MercFeeCountMonthServiceImpl extends ServiceImpl<MercFeeCountMonthM
                 .eq(MercFeeCountMonth::getId, id)
         );
         if (countMonth != null) {
-            //确认
+            // 确认
             countMonth.setVerify(true);
             countMonth.setVerifyTime(LocalDateTime.now());
             updateById(countMonth);
-            //确认后,更新统计表
+            // 确认后,更新统计表
             MercFeeStatistic mercFeeStatistic = mercFeeStatisticService.getByMercId(parentMercId);
-            //更新确认金额,可结算金额
+            // 更新确认金额,可结算金额
             mercFeeStatistic.setVerifyMoney(mercFeeStatistic.getVerifyMoney() + countMonth.getBrokerage());
             mercFeeStatistic.setUnSettleMoney(mercFeeStatistic.getUnSettleMoney() + countMonth.getBrokerage());
             mercFeeStatisticService.updateById(mercFeeStatistic);