From 7438064a85a63d46e210ce37e63c4ca823d52f63 Mon Sep 17 00:00:00 2001
From: swb <jpy123456>
Date: Thu, 04 Jul 2024 09:50:02 +0800
Subject: [PATCH] fix:补充提交
---
screen-api/src/main/java/com/moral/api/service/impl/DustldServiceImpl.java | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/screen-api/src/main/java/com/moral/api/service/impl/DustldServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/DustldServiceImpl.java
index 0cbe0c8..cab12c7 100644
--- a/screen-api/src/main/java/com/moral/api/service/impl/DustldServiceImpl.java
+++ b/screen-api/src/main/java/com/moral/api/service/impl/DustldServiceImpl.java
@@ -1,7 +1,9 @@
package com.moral.api.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.moral.api.config.Interceptor.UserHelper;
+import com.moral.api.entity.SecondCruiserSort;
import com.moral.api.entity.SysDictData;
import com.moral.api.exception.BusinessException;
import com.moral.api.mapper.*;
@@ -51,6 +53,9 @@
@Autowired
private DustldMapper dustldMapper;
+
+ @Autowired
+ private SecondCruiserSortMapper secondCruiserSortMapper;
/**
* ������������������
@@ -459,6 +464,39 @@
return dustlds;
}
+ /**
+ * ������������
+ * @param mac
+ * @param startTime
+ * @param endTime
+ * @return
+ */
+ @Override
+ public List<SecondCruiserSort> sort(String mac, String startTime, String endTime) {
+ SysDictData list = sysDictTypeService.listOne(SysDictTypeEnum.SYS_SECOND_CRUISER.getValue(),"dustld");
+ String s = DateUtils.stringToDateString(startTime, "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd 00:00:00");
+ LambdaQueryWrapper<SecondCruiserSort> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(SecondCruiserSort::getMac,mac);
+ wrapper.eq(SecondCruiserSort::getTime,s);
+ wrapper.orderByDesc(SecondCruiserSort::getValue);
+ List<SecondCruiserSort> secondCruiserSorts = secondCruiserSortMapper.selectList(wrapper);
+ //���������������
+ if (!ObjectUtils.isEmpty(secondCruiserSorts)){
+ for (SecondCruiserSort secondCruiserSort : secondCruiserSorts) {
+ if(list.getDataValue().contains(",")){
+ List<String> resultStr = Arrays.asList(list.getDataValue().split(","));
+ if(resultStr.size() % 2 ==0){
+ secondCruiserSort.setValue(numAvg(resultStr,BigDecimal.valueOf(secondCruiserSort.getValue())).doubleValue());
+ }
+ }else {
+ BigDecimal dataValue = Objects.nonNull(list.getDataValue())?BigDecimal.valueOf(Double.parseDouble(list.getDataValue())):BigDecimal.ZERO;
+ secondCruiserSort.setValue(BigDecimal.valueOf(secondCruiserSort.getValue()).add(dataValue).doubleValue());
+ }
+ }
+ }
+ return secondCruiserSorts;
+ }
+
//������������������
private String getList(String path, List<MultipartFile> files1) {
--
Gitblit v1.8.0