linxk пре 3 недеља
родитељ
комит
aa27ef29a1
1 измењених фајлова са 17 додато и 2 уклоњено
  1. 17 2
      cif-service/src/main/java/com/txz/cif/web/mng/UserController.java

+ 17 - 2
cif-service/src/main/java/com/txz/cif/web/mng/UserController.java

@@ -138,10 +138,25 @@ public class UserController extends AbstractApiController {
                 Integer inviteNextNum = userService.countByCondition(c);
                 bo.setTeamNum(inviteNum + inviteNextNum);
                 // 付款过的订单
+//                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);
+
                 c = new Condition(Flow.class);
-                c.createCriteria().andIn("bizType", CollUtil.newArrayList(BizTypeEnum.OPEN_GROUP_PAY.getKey(), BizTypeEnum.JOIN_GROUP_PAY.getKey()));
+                c.createCriteria().andEqualTo("userId", u.getId()).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("userId", u.getId()).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());