|
@@ -99,12 +99,21 @@ public class IotOpeationFillController {
|
|
|
deviceRunLogDO.setCreateTime(LocalDateTime.of(fill.getCreateTime(),localTime));
|
|
|
deviceRunLogDO.setPointName(fill.getPointName());
|
|
|
if(logList.size()>0){
|
|
|
- BigDecimal num1 = logList.get(0).getTotalRunTime();
|
|
|
- BigDecimal num2 = new BigDecimal(fill.getFillContent());
|
|
|
- deviceRunLogDO.setTotalRunTime(num1.add(num2));
|
|
|
+ if(createReqVO.get(0).getIsCollection()==1){
|
|
|
+ deviceRunLogDO.setTotalRunTime(createReqVO.get(0).getTotalRunTime());
|
|
|
+ }else{
|
|
|
+ BigDecimal num1 = logList.get(0).getTotalRunTime();
|
|
|
+ BigDecimal num2 = new BigDecimal(fill.getFillContent());
|
|
|
+ deviceRunLogDO.setTotalRunTime(num1.add(num2));
|
|
|
+ }
|
|
|
}else{
|
|
|
- BigDecimal num2 = new BigDecimal(fill.getFillContent());
|
|
|
- deviceRunLogDO.setTotalRunTime(num2);
|
|
|
+ if(createReqVO.get(0).getIsCollection()==1){
|
|
|
+ deviceRunLogDO.setTotalRunTime(createReqVO.get(0).getTotalRunTime());
|
|
|
+ }else{
|
|
|
+ BigDecimal num2 = new BigDecimal(fill.getFillContent());
|
|
|
+ deviceRunLogDO.setTotalRunTime(num2);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
logDO.add(deviceRunLogDO);
|
|
@@ -221,10 +230,7 @@ public class IotOpeationFillController {
|
|
|
@Operation(summary = "获得运行记录填报分页")
|
|
|
public CommonResult<PageResult<IotOpeationFillOrderDO>> getFillRecords(@Valid IotOpeationFillPageReqVO pageReqVO) {
|
|
|
|
|
|
- List<IotOpeationFillOrderDO> list = iotOpeationFillService.fillRecords(pageReqVO);
|
|
|
- PageResult<IotOpeationFillOrderDO> fillList = new PageResult(list,Long.valueOf(list.size()));
|
|
|
-
|
|
|
- return success(BeanUtils.toBean(fillList, IotOpeationFillOrderDO.class));
|
|
|
+ return success(BeanUtils.toBean( iotOpeationFillService.fillRecords(pageReqVO), IotOpeationFillOrderDO.class));
|
|
|
}
|
|
|
|
|
|
|