cc 2 months ago
parent
commit
f772ec64c4

+ 5 - 1
src/main/java/com/qingjian/module/graph/service/GraphService.java

@@ -10,6 +10,7 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.qingjian.common.cache.CaseDataCache;
 import com.qingjian.common.constants.PathConst;
+import com.qingjian.common.exception.ServerException;
 import com.qingjian.common.model.call.entity.CallRecord;
 import com.qingjian.common.model.govern.query.ConditionQuery;
 import com.qingjian.common.model.govern.query.Conditions;
@@ -107,6 +108,9 @@ public class GraphService {
         }*/
         System.out.println(sql);
         List<RelEdgeDTO> edgeList = graphMapper.graphView(sql);
+        if (edgeList.size() > 10000) {
+            throw new ServerException("当前数据量过大,请根据条件缩数据范围!");
+        }
         Map<String, Object> map = Maps.newHashMap();
         map.put("edgeList", edgeList);
 
@@ -527,7 +531,7 @@ public class GraphService {
                     sum(num::DECIMAL) AS num,
                     any_value(fx) AS fx,
                     any_value(lx) AS lx
-                FROM final_rel_edge group by node1,node2,clazz;
+                FROM final_rel_edge group by node1,node2,clazz limit 10005;
                 """;
     }
 

+ 3 - 0
src/main/java/com/qingjian/module/person/service/DataProfileService.java

@@ -168,6 +168,9 @@ public class DataProfileService {
      */
     public Page<TransOftenTop10DTO> transOfPersons(TransOftenTop10Query query) {
         query.setTableName(governConfService.getTransTableName());
+        if ("交易次数".equals(query.getDimension())) {
+            query.setOrderKey("transCount");
+        }
         return transRecordMapper.transOfPersons(Page.of(query.getPage(), query.getLimit()), query);
     }
 

+ 1 - 1
src/main/resources/mappers/call/CallRecordMapper.xml

@@ -189,7 +189,7 @@
             and callDate &lt;= #{query.endDate}
         </if>
         GROUP BY COALESCE(otherPhone, '未知卡号')
-        ORDER BY callCount, otherPhone DESC
+        ORDER BY callCount DESC
     </select>
 
     <select id="callStatStation" resultType="com.qingjian.common.model.person.dto.CallStatStationDTO">