libo 4 年之前
父節點
當前提交
387b2401ea

+ 1 - 1
src/main/java/com/tdba/cxb/ares/api/repository/UserRelateMapper.java

@@ -39,5 +39,5 @@ public interface UserRelateMapper {
39
                                      @Param("userType") Integer userType);
39
                                      @Param("userType") Integer userType);
40
 
40
 
41
     Integer updateByUidList(@Param("userType") Integer userType,
41
     Integer updateByUidList(@Param("userType") Integer userType,
42
-                        @Param("uid_concat") String uid_concat);
42
+                        @Param("uidArray") String[] uidArray);
43
 }
43
 }

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

@@ -123,18 +123,18 @@ public class UserService {
123
                 });
123
                 });
124
             }
124
             }
125
             if(!relateList.isEmpty()){
125
             if(!relateList.isEmpty()){
126
-                userRelateMapper.insertSelectiveForeach(relateList);
126
+//                userRelateMapper.insertSelectiveForeach(relateList);
127
             }
127
             }
128
             relateList.clear();
128
             relateList.clear();
129
         });
129
         });
130
         if(!resultList.isEmpty()){
130
         if(!resultList.isEmpty()){
131
-            userCountMapper.insertSelectiveForeach(resultList);
131
+//            userCountMapper.insertSelectiveForeach(resultList);
132
         }
132
         }
133
 
133
 
134
         resolverAgent(localDate);
134
         resolverAgent(localDate);
135
-        resolverDacang(localDate);
136
-        resolverMerchant(localDate);
137
-        resolverChannel(localDate);
135
+//        resolverDacang(localDate);
136
+//        resolverMerchant(localDate);
137
+//        resolverChannel(localDate);
138
     }
138
     }
139
 
139
 
140
     /**
140
     /**
@@ -154,7 +154,7 @@ public class UserService {
154
                         .withUser_type(UserTypeEnum.DACANG.ordinal())
154
                         .withUser_type(UserTypeEnum.DACANG.ordinal())
155
                         .withCreate_time(currentTime)
155
                         .withCreate_time(currentTime)
156
                         .build());
156
                         .build());
157
-                userRelateMapper.updateByUidList(UserTypeEnum.DACANG.ordinal(), row.getUid_concat());
157
+                userRelateMapper.updateByUidList(UserTypeEnum.DACANG.ordinal(), row.getUid_concat().split(","));
158
 
158
 
159
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
159
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
160
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
160
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
@@ -199,7 +199,7 @@ public class UserService {
199
                         .withUser_type(UserTypeEnum.MERCHANT.ordinal())
199
                         .withUser_type(UserTypeEnum.MERCHANT.ordinal())
200
                         .withCreate_time(currentTime)
200
                         .withCreate_time(currentTime)
201
                         .build());
201
                         .build());
202
-                userRelateMapper.updateByUidList(UserTypeEnum.MERCHANT.ordinal(), row.getUid_concat());
202
+                userRelateMapper.updateByUidList(UserTypeEnum.MERCHANT.ordinal(), row.getUid_concat().split(","));
203
 
203
 
204
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
204
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
205
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
205
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
@@ -234,7 +234,7 @@ public class UserService {
234
                         .withUser_type(UserTypeEnum.CHANNEL.ordinal())
234
                         .withUser_type(UserTypeEnum.CHANNEL.ordinal())
235
                         .withCreate_time(currentTime)
235
                         .withCreate_time(currentTime)
236
                         .build());
236
                         .build());
237
-                userRelateMapper.updateByUidList(UserTypeEnum.CHANNEL.ordinal(), row.getUid_concat());
237
+                userRelateMapper.updateByUidList(UserTypeEnum.CHANNEL.ordinal(), row.getUid_concat().split(","));
238
 
238
 
239
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
239
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
240
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
240
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
@@ -269,7 +269,7 @@ public class UserService {
269
                         .withUser_type(UserTypeEnum.AGENT.ordinal())
269
                         .withUser_type(UserTypeEnum.AGENT.ordinal())
270
                         .withCreate_time(currentTime)
270
                         .withCreate_time(currentTime)
271
                         .build());
271
                         .build());
272
-                userRelateMapper.updateByUidList(UserTypeEnum.AGENT.ordinal(), row.getUid_concat());
272
+                userRelateMapper.updateByUidList(UserTypeEnum.AGENT.ordinal(), row.getUid_concat().split(","));
273
 
273
 
274
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
274
                 userRelateMapper.selectByUid(row.getSpread_uid()).stream().forEach(innerRow -> {
275
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
275
                     resultList.add(UserCount.UserCountBuilder.anUserCount()
@@ -329,7 +329,7 @@ public class UserService {
329
                     logger.error("循环嵌套 row.getSpread_uid() = {}, userDto.getUid() = {}", row.getSpread_uid(), userDto.getSpread_uid());
329
                     logger.error("循环嵌套 row.getSpread_uid() = {}, userDto.getUid() = {}", row.getSpread_uid(), userDto.getSpread_uid());
330
                     throw new TDBAException("循环嵌套");
330
                     throw new TDBAException("循环嵌套");
331
                 }
331
                 }
332
-                result = 1 + countOfChildren(row, list);
332
+                result += 1 + countOfChildren(row, list);
333
             }
333
             }
334
         }
334
         }
335
         return result;
335
         return result;

+ 4 - 1
src/main/resources/mapper/UserRelateMapper.xml

@@ -141,7 +141,10 @@
141
             is_agent = 1
141
             is_agent = 1
142
         </if>
142
         </if>
143
 
143
 
144
-        where uid in ( #{uid_concat} )
144
+        where uid in
145
+            <foreach collection="uidArray" item="item" open="(" separator="," close=")">
146
+                #{item}
147
+            </foreach>
145
     </select>
148
     </select>
146
 
149
 
147
     <select id="countByUid" resultType="java.lang.Integer">
150
     <select id="countByUid" resultType="java.lang.Integer">