Browse Source

日志保存优化

cr 2 days ago
parent
commit
2e077571e1

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ContractLogClientImpl.java

@@ -211,7 +211,7 @@ public class ContractLogClientImpl implements ContractLogClient {
 
     @Override
     public List<ContractLog> queryContractLogByIds1(String theLogIds) {
-        List<Long> ids = Func.toLongList(theLogIds);
+        Func.toLongList(theLogIds)
         return this.contractLogService.list(Wrappers.<ContractLog>lambdaQuery().in(ContractLog::getId, ids));
     }
 

+ 7 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -3505,13 +3505,14 @@ public class ExcelTabController extends BladeController {
     public R<List<Map<String, Object>>> getTheLogBusinessData(
             String theLogId, String nodePrimaryKeyId, String recordTime, String contractId) {
         List<Map<String, Object>> resultMapList = new ArrayList<>();
-        if (StringUtils.isEmpty(theLogId)) {
-            return R.data(resultMapList);
+        List<ContractLog> contractLogs;
+        if(StringUtils.isEmpty(theLogId)){
+            contractLogs= this.contractLogClient.queryContractLogByPrimaryKeyIdAndRecordTimeList(nodePrimaryKeyId, recordTime, contractId,null);
+        }else {
+            // ========================= 1. 批量获取 dataId(替代逐个查询 ContractLog)=========================
+            // 批量查询 ContractLog,避免循环调用客户端
+            contractLogs = this.contractLogClient.queryContractLogByIds1(theLogId);
         }
-
-        // ========================= 1. 批量获取 dataId(替代逐个查询 ContractLog)=========================
-        // 批量查询 ContractLog,避免循环调用客户端
-        List<ContractLog> contractLogs = this.contractLogClient.queryContractLogByIds1(theLogId);
         if (CollUtil.isEmpty(contractLogs)) {
             return R.data(resultMapList);
         }