mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
完善
This commit is contained in:
@@ -4,7 +4,6 @@ import cn.lihongjie.coal.base.dto.CommonQuery;
|
||||
import cn.lihongjie.coal.base.dto.IdRequest;
|
||||
import cn.lihongjie.coal.base.service.BaseService;
|
||||
import cn.lihongjie.coal.common.Ctx;
|
||||
import cn.lihongjie.coal.common.FreeMakerUtils;
|
||||
import cn.lihongjie.coal.common.JpaUtils;
|
||||
import cn.lihongjie.coal.dataCollector.service.DataCollectorService;
|
||||
import cn.lihongjie.coal.dataCollectorLog.service.DataCollectorLogService;
|
||||
@@ -89,45 +88,17 @@ public class WeightDeviceDataService
|
||||
@SneakyThrows
|
||||
public List<Map> checkLocalData(CheckLocalDataRequest requst) {
|
||||
|
||||
TypedQuery<String> query =
|
||||
List<WeightDeviceEntity> devices =
|
||||
em.createQuery(
|
||||
FreeMakerUtils.render(
|
||||
"""
|
||||
select distinct d.device.dataCollector.appKey
|
||||
|
||||
from WeightDeviceDataEntity d where 1=1
|
||||
|
||||
|
||||
<#if start??>
|
||||
|
||||
and d.minTime >= :start
|
||||
|
||||
</#if>
|
||||
|
||||
<#if end??>
|
||||
|
||||
and d.minTime <= :end
|
||||
|
||||
</#if>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
""",
|
||||
requst),
|
||||
String.class);
|
||||
|
||||
JpaUtils.setQueryParameter(query, requst);
|
||||
|
||||
var datas = query.getResultList();
|
||||
" from WeightDeviceEntity d where d.organizationId = :organizationId",
|
||||
WeightDeviceEntity.class)
|
||||
.setParameter("organizationId", Ctx.currentUser().getOrganizationId())
|
||||
.getResultList();
|
||||
|
||||
List<Map> result = new ArrayList<>();
|
||||
for (var device : devices) {
|
||||
|
||||
for (var appKey : datas) {
|
||||
|
||||
WeightDeviceEntity device = weightDeviceService.getDeviceByAppKey(appKey);
|
||||
|
||||
var appKey = device.getDataCollector().getAppKey();
|
||||
TypedQuery<Tuple> sysSum =
|
||||
em.createQuery(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user