|
@@ -38,6 +38,7 @@ import java.math.BigDecimal;
|
|
|
import java.sql.SQLException;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.time.LocalTime;
|
|
|
import java.util.*;
|
|
|
import java.io.IOException;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -106,6 +107,29 @@ public class IotOpeationFillController {
|
|
|
logDO.add(deviceRunLogDO);
|
|
|
}
|
|
|
iotOpeationFillService.updateFill(createReqVO.get(0));
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断设备状态是否都为填写
|
|
|
+ * 1、是 更新填写工单为已填写
|
|
|
+ * 2、否 更新填写工单为待填写
|
|
|
+ * 3、部分填写 更新填写工单为填写中
|
|
|
+ */
|
|
|
+ IotOpeationFillRespVO respVO = new IotOpeationFillRespVO();
|
|
|
+ respVO.setUserId(createReqVO.get(0).getUserId());
|
|
|
+ respVO.setCreateTime(createReqVO.get(0).getCreateTime());
|
|
|
+ List<IotOpeationFillRespVO> fillList1 = iotOpeationFillService.getFillList(respVO);
|
|
|
+
|
|
|
+ boolean result = fillList1.stream().allMatch(e->e.getIsFill()==1);
|
|
|
+ boolean result1 = fillList1.stream().allMatch(e->e.getIsFill()==0);
|
|
|
+
|
|
|
+ if(result){
|
|
|
+
|
|
|
+ }else if(result1){
|
|
|
+
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
return success(iotOpeationFillService.insertLog(logDO));
|
|
|
}
|
|
|
|
|
@@ -138,7 +162,7 @@ public class IotOpeationFillController {
|
|
|
@GetMapping("/page")
|
|
|
@Operation(summary = "获得运行记录填报分页")
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-opeation-fill:query')")
|
|
|
- public CommonResult<List<IotOpeationFillDO>> getIotOpeationFillPage(@Valid IotOpeationFillPageReqVO pageReqVO) {
|
|
|
+ public CommonResult<List<IotOpeationFillDO>> getIotOpeationFillPage(@Valid IotOpeationFillRespVO pageReqVO) {
|
|
|
List<IotOpeationFillDO> fillList = new ArrayList<>();
|
|
|
List<IotOpeationFillDO> deviceList = iotOpeationFillService.deviceList(pageReqVO);
|
|
|
if(deviceList.size()==0){
|
|
@@ -197,12 +221,15 @@ public class IotOpeationFillController {
|
|
|
if(!StringUtils.isEmpty(deviceVO)){
|
|
|
attrsDO.setFillContent(
|
|
|
String.valueOf(Double.parseDouble(deviceVO.getLatestData())-Double.parseDouble(deviceVO.getEarliestData())));
|
|
|
+ attrsDO.setTotalRunTime(BigDecimal.valueOf(Double.parseDouble(deviceVO.getLatestData())));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
IotDeviceRunLogDO logDO1 = new IotDeviceRunLogDO();
|
|
|
logDO1.setDeviceId(vo.getDeviceId());
|
|
|
+ LocalTime localTime = LocalTime.of(12, 0);
|
|
|
+ logDO1.setCreateTime(LocalDateTime.of(vo.getCreateTime(),localTime));
|
|
|
List<IotDeviceRunLogDO> logList = iotOpeationFillService.getDeivceFillInfo(logDO1);
|
|
|
if(logList.size()>0){
|
|
|
for (IotDeviceRunLogDO log:logList) {
|