|
|
@@ -31,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import com.sckw.slope.detection.dao.tdengine.InsTablesMapper;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -114,7 +115,7 @@ public class BackTrackService {
|
|
|
return HttpResult.ok(devices);
|
|
|
}
|
|
|
|
|
|
- public HttpResult getDeviceChart(String devicesId,String snCode, String parts, String dateStart,String dateEnd,Integer original) {
|
|
|
+ public HttpResult getDeviceChart(String devicesId,String snCode, String parts, String dateStart,String dateEnd,Integer original) throws ParseException {
|
|
|
//先查询设备
|
|
|
KwsDevice deviceHas = deviceMapper.selectOne(new LambdaQueryWrapper<KwsDevice>()
|
|
|
.eq(KwsDevice::getSnCode, snCode));
|
|
|
@@ -130,10 +131,13 @@ public class BackTrackService {
|
|
|
return HttpResult.ok(Collections.emptyList());
|
|
|
}
|
|
|
List<SlopeData> selectedData = slopeDataMapper.selectLineListByArray(snCode, arr, dateStart, dateEnd);
|
|
|
+ Map<String,List<Object>> map = new HashMap<>();
|
|
|
+
|
|
|
if (CollectionUtils.isEmpty(selectedData)) {
|
|
|
- return HttpResult.ok(Collections.emptyList());
|
|
|
+ map = commonService.getDateByNull(dateStart,dateEnd,arr);
|
|
|
+ return HttpResult.ok(map);
|
|
|
}
|
|
|
- Map<String,List<Object>> map = new HashMap<>();
|
|
|
+
|
|
|
for(SlopeData slop : selectedData){
|
|
|
if(slop.getLine().equals(DictItemEnum.getData(slop.getLine()).getValue())){
|
|
|
List<Object> list = new ArrayList<>();
|