|
@@ -16,6 +16,7 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.iotrhdailyreport.IotRhDailyRep
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.IotDeviceMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotprojecttask.IotProjectTaskMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotrhdailyreport.IotRhDailyReportMapper;
|
|
|
+import cn.iocoder.yudao.module.pms.service.iotdevicerunlog.IotDeviceRunLogService;
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO;
|
|
|
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
|
@@ -92,6 +93,19 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
deviceIds = task.getDeviceIds();
|
|
|
}
|
|
|
|
|
|
+ // 查询当前任务下关联的所有设备 查询这些设备的当日注气量 进而计算累计注气量
|
|
|
+ IotDevicePageReqVO deptDeviceReqVO = new IotDevicePageReqVO();
|
|
|
+ deptDeviceReqVO.setDeptId(createReqVO.getDeptId());
|
|
|
+ List<IotDeviceDO> deptDevices = iotDeviceMapper.selectList(deptDeviceReqVO);
|
|
|
+ Set<String> deviceCodes = new HashSet<>();
|
|
|
+ if (CollUtil.isNotEmpty(deptDevices)) {
|
|
|
+ deptDevices.forEach(device -> {
|
|
|
+ deviceCodes.add(device.getDeviceCode());
|
|
|
+ });
|
|
|
+ // 查询运行记录填报结果表中的 当日注气量 累计计算当年的 累计注气量
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// 找到当前小队下的 电驱增压机 分类下设备的产能 计算 运行时效
|
|
|
DictTypeDO dictType = dictTypeService.getDictType("rq_iot_charger_device_category");
|
|
|
AtomicReference<BigDecimal> capacity = new AtomicReference<>(BigDecimal.ZERO);
|
|
@@ -132,9 +146,9 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
|
|
|
// todo 根据当日注气量 计算累计注气量
|
|
|
|
|
|
- // 查询当前日报所属任务关联的设备
|
|
|
+ // 查询当前日报所属任务关联的设备 更新设备状态
|
|
|
if (CollUtil.isNotEmpty(deviceIds)) {
|
|
|
- // 查询当前小队下所有设备
|
|
|
+ // 查询当前任务下关联的所有设备
|
|
|
IotDevicePageReqVO deviceReqVO = new IotDevicePageReqVO();
|
|
|
// deviceReqVO.setDeptId(createReqVO.getDeptId());
|
|
|
deviceReqVO.setDeviceIds(new ArrayList<>(deviceIds));
|