libo 4 anni fa
parent
commit
5a52cc1497

+ 4 - 0
src/main/java/com/tdba/cxb/ares/api/controller/UserController.java

@@ -136,4 +136,8 @@ public class UserController {
136 136
         return buildSuccess("退出成功");
137 137
     }
138 138
 
139
+    public static void main(String[] args) {
140
+        System.out.println(LocalDateTime.of(2022, 06, 10, 00, 00, 00).toEpochSecond(ZoneOffset.ofHours(8)));
141
+        System.out.println(LocalDateTime.of(2022, 06, 10, 23, 59, 59).toEpochSecond(ZoneOffset.ofHours(8)));
142
+    }
139 143
 }

+ 7 - 7
src/main/java/com/tdba/cxb/ares/api/service/UserService.java

@@ -199,7 +199,7 @@ public class UserService {
199 199
                         .withUser_type(UserTypeEnum.MERCHANT.ordinal())
200 200
                         .withCreate_time(currentTime)
201 201
                         .build());
202
-                userRelateMapper.updateByUid(UserTypeEnum.MERCHANT.ordinal(), row.getSpread_uid());
202
+                userRelateMapper.updateByUidList(UserTypeEnum.MERCHANT.ordinal(), row.getUid_concat());
203 203
 
204 204
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
205 205
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
@@ -234,7 +234,7 @@ public class UserService {
234 234
                         .withUser_type(UserTypeEnum.CHANNEL.ordinal())
235 235
                         .withCreate_time(currentTime)
236 236
                         .build());
237
-                userRelateMapper.updateByUid(UserTypeEnum.CHANNEL.ordinal(), row.getSpread_uid());
237
+                userRelateMapper.updateByUidList(UserTypeEnum.CHANNEL.ordinal(), row.getUid_concat());
238 238
 
239 239
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
240 240
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
@@ -269,7 +269,7 @@ public class UserService {
269 269
                         .withUser_type(UserTypeEnum.AGENT.ordinal())
270 270
                         .withCreate_time(currentTime)
271 271
                         .build());
272
-                userRelateMapper.updateByUid(UserTypeEnum.AGENT.ordinal(), row.getSpread_uid());
272
+                userRelateMapper.updateByUidList(UserTypeEnum.AGENT.ordinal(), row.getUid_concat());
273 273
 
274 274
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
275 275
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
@@ -311,7 +311,7 @@ public class UserService {
311 311
 
312 312
     private Integer countOfChildren(UserDto userDto, List<UserDto> list){
313 313
 
314
-        if(userDto == null || CollectionUtils.isEmpty(list) || userDto.getSpread_uid().equals(0)){
314
+        if(userDto == null || CollectionUtils.isEmpty(list)){
315 315
             return 0;
316 316
         }
317 317
 
@@ -401,9 +401,9 @@ public class UserService {
401 401
         UserVo userVo = userMapper.selectByAccountForSimple(param.getPhone());
402 402
         Objects.requireNonNull(userVo, "该手机号未在【储蓄宝App】内注册,请先注册后再绑定");
403 403
 
404
-        if(userVo.getId().equals(baseUser.getId())){
405
-            throw new TDBAException("运营商不可添加自身为团队成员");
406
-        }
404
+//        if(userVo.getId().equals(baseUser.getId())){
405
+//            throw new TDBAException("运营商不可添加自身为团队成员");
406
+//        }
407 407
 
408 408
         UserBind oldUserBind = userBindMapper.selectByUid(userVo.getId());
409 409
         if(oldUserBind != null){

+ 4 - 3
src/main/resources/application-dev.yml

@@ -1,14 +1,15 @@
1 1
 spring:
2 2
   datasource:
3
-    url: jdbc:mysql://10.28.5.46:3306/renrenxiang?autoReconnect=true&failOverReadOnly=false&serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
3
+    url: jdbc:mysql://10.28.5.47:3306/renrenxiang?autoReconnect=true&failOverReadOnly=false&serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
4 4
     driver-class-name: com.mysql.cj.jdbc.Driver
5
-    password: Zm#T2ZW4#IwENBY
6
-    username: root
5
+    password: bjtdba.com
6
+    username: readonly
7 7
     hikari:
8 8
       maximum-pool-size: 16
9 9
       minimum-idle: 2
10 10
       idle-timeout: 10000
11 11
 
12
+
12 13
   redis:
13 14
     host: 10.28.5.46
14 15
     port: 6379

+ 6 - 3
src/main/resources/mapper/UserMapper.xml

@@ -35,7 +35,8 @@
35 35
     <select id="selectMerchant" resultType="com.tdba.cxb.ares.api.model.UserDto">
36 36
         select
37 37
             count(1) 'num',
38
-            u.spread_uid
38
+            u.spread_uid,
39
+            group_concat(u.uid) 'uid_concat'
39 40
         from
40 41
             rrx_merchant_admin da
41 42
             left join
@@ -52,7 +53,8 @@
52 53
     <select id="selectChannel" resultType="com.tdba.cxb.ares.api.model.UserDto">
53 54
         select
54 55
             count(1) 'num',
55
-            u.spread_uid
56
+            u.spread_uid,
57
+            group_concat(u.uid) 'uid_concat'
56 58
         from
57 59
             rrx_channel_user da
58 60
         left join
@@ -69,7 +71,8 @@
69 71
     <select id="selectAgent" resultType="com.tdba.cxb.ares.api.model.UserDto">
70 72
         select
71 73
             count(1) 'num',
72
-            u.spread_uid
74
+            u.spread_uid,
75
+            group_concat(u.uid) 'uid_concat'
73 76
         from
74 77
             rrx_user_agent da
75 78
             left join