linxk 3 недель назад
Родитель
Сommit
621c21ab28

+ 3 - 0
cif-service/src/main/java/com/txz/cif/web/bo/UserDetailBo.java

@@ -58,6 +58,9 @@ public class UserDetailBo {
     @ApiModelProperty(value="可参团数")
     private Integer groupNum;
 
+    @ApiModelProperty(value="当日已参团数")
+    private Integer openGroupNum;
+
     @ApiModelProperty(value="总收益")
     private BigDecimal totalEarnings;
 

+ 27 - 1
cif-service/src/main/java/com/txz/cif/web/mng/UserController.java

@@ -171,7 +171,16 @@ public class UserController extends AbstractApiController {
         c  = new Condition(Flow.class);
         c.createCriteria().andIn("bizType", CollUtil.newArrayList(BizTypeEnum.OPEN_GROUP_PAY.getKey(),BizTypeEnum.JOIN_GROUP_PAY.getKey()));
         Integer payNum = flowService.countByCondition(c);
-        bo.setSuccessGroupNum(payNum);
+        if (payNum == null){
+            payNum = 0;
+        }
+        c  = new Condition(Flow.class);
+        c.createCriteria().andEqualTo("bizType", BizTypeEnum.FAIL_GROUP_REFUND.getKey());
+        Integer unpayNum = flowService.countByCondition(c);
+        if (unpayNum == null){
+            unpayNum = 0;
+        }
+        bo.setSuccessGroupNum(payNum-unpayNum);
         //钱包余额
         Account wallet = accountService.getAccount(u.getId(), 1);
         bo.setWalletBalance(wallet.getBalance());
@@ -183,6 +192,23 @@ public class UserController extends AbstractApiController {
         bo.setGroupNum(member.getJoinedGroupsNo());
         BigDecimal totalEarnings  = redEnvelopeService.sumWithDay(null, u.getId(), 3);
         bo.setTotalEarnings(totalEarnings);
+
+        c  = new Condition(Flow.class);
+        c.createCriteria().andGreaterThanOrEqualTo("createTime",DateUtil.today())
+                .andIn("bizType", CollUtil.newArrayList(BizTypeEnum.OPEN_GROUP_PAY.getKey(),BizTypeEnum.JOIN_GROUP_PAY.getKey()));
+        Integer payNumToday = flowService.countByCondition(c);
+        if (payNumToday == null){
+            payNumToday = 0;
+        }
+        c  = new Condition(Flow.class);
+        c.createCriteria().andEqualTo("bizType", BizTypeEnum.FAIL_GROUP_REFUND.getKey())
+                .andGreaterThanOrEqualTo("createTime",DateUtil.today())
+        ;
+        Integer unpayNumToday = flowService.countByCondition(c);
+        if (unpayNumToday == null){
+            unpayNumToday = 0;
+        }
+        bo.setOpenGroupNum(payNumToday-unpayNumToday);
         //已结算金额
         bo.setSettledEarnings(earnings.getTotalInamount());
         //充值总金额