Prechádzať zdrojové kódy

pms 瑞恒日报 更新设备状态

zhangcl 3 týždňov pred
rodič
commit
f57a3b65e8

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/IotDeviceMapper.java

@@ -77,7 +77,7 @@ public interface IotDeviceMapper extends BaseMapperX<IotDeviceDO> {
 
     default List<IotDeviceDO> selectList(IotDevicePageReqVO reqVO) {
         return selectList(new LambdaQueryWrapperX<IotDeviceDO>()
-                .inIfPresent(IotDeviceDO::getDeptId, reqVO.getDeviceIds())
+                .inIfPresent(IotDeviceDO::getId, reqVO.getDeviceIds())
                 .likeIfPresent(IotDeviceDO::getDeviceCode, reqVO.getDeviceCode())
                 .likeIfPresent(IotDeviceDO::getDeviceName, reqVO.getDeviceName())
                 .eqIfPresent(IotDeviceDO::getBrand, reqVO.getBrand())

+ 5 - 4
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrhdailyreport/IotRhDailyReportServiceImpl.java

@@ -81,7 +81,7 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
                 iotRhDailyReport.setProjectId(task.getProjectId());
                 iotRhDailyReport.setTaskId(task.getId());
                 taskId = task.getId();
-                // 根据日报状态 查 日报所属任务的状态
+                // 根据日报状态 查 日报所属任务的状态
                 if (ObjUtil.isNotEmpty(createReqVO.getConstructionStatus())) {
                     task.setStatus(createReqVO.getConstructionStatus());
                     // 更新任务状态
@@ -121,9 +121,9 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
                         if (ObjUtil.isNotEmpty(createReqVO.getDailyGasInjection()) && (capacity.get().compareTo(BigDecimal.ZERO)>0)) {
                             // 将当日注气量单位 换算成 万方
                             // 将当日注气量单位由"方"换算成"万方"
-                            BigDecimal dailyGasInjectionInTenThousand = createReqVO.getDailyGasInjection()
-                                    .divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP);
-                            iotRhDailyReport.setTransitTime(dailyGasInjectionInTenThousand.divide(capacity.get(), 2, RoundingMode.HALF_UP));
+                            /* BigDecimal dailyGasInjectionInTenThousand = createReqVO.getDailyGasInjection()
+                                    .divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP); */
+                            iotRhDailyReport.setTransitTime(createReqVO.getDailyGasInjection().divide(capacity.get(), 2, RoundingMode.HALF_UP));
                         }
                     }
                 }
@@ -168,6 +168,7 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
                     devices.forEach(device -> {
                         device.setDeviceStatus(deviceNewStatus.get());
                     });
+                    iotDeviceMapper.updateBatch(devices);
                 }
             }