From 7eb80121a1ae5d9af9ad864d86ed6f374455a862 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Thu, 15 May 2025 08:57:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=81=E7=BA=A7=E5=B9=B3=E5=8F=B0=E5=9C=A8?= =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E6=A3=80=E6=B5=8B=E6=97=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=B8=A9=E5=BA=A6=E3=80=81=E7=9B=B8=E5=AF=B9=E6=B9=BF=E5=BA=A6?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detection/handler/SocketDevResponseService.java | 2 +- .../gather/detection/pojo/param/PreDetectionParam.java | 10 ++++++++++ .../service/impl/PreDetectionServiceImpl.java | 2 +- .../java/com/njcn/gather/device/pojo/po/PqDev.java | 10 ++++++++++ .../com/njcn/gather/device/service/IPqDevService.java | 4 +++- .../gather/device/service/impl/PqDevServiceImpl.java | 7 ++++++- .../gather/report/pojo/enums/BaseReportKeyEnum.java | 4 +++- .../report/service/impl/PqReportServiceImpl.java | 2 ++ 8 files changed, 36 insertions(+), 5 deletions(-) diff --git a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java index 51483934..bbdf5544 100644 --- a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java +++ b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java @@ -1202,7 +1202,7 @@ public class SocketDevResponseService { checkDataParam.setIsValueTypeName(false); List valueType = iPqScriptCheckDataService.getValueType(checkDataParam); - iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(), param.getUserId()); + iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(), param.getUserId(), param.getTemperature(), param.getHumidity()); CnSocketUtil.quitSend(param); } successComm.clear(); diff --git a/detection/src/main/java/com/njcn/gather/detection/pojo/param/PreDetectionParam.java b/detection/src/main/java/com/njcn/gather/detection/pojo/param/PreDetectionParam.java index 51a8f4ec..1e8c3649 100644 --- a/detection/src/main/java/com/njcn/gather/detection/pojo/param/PreDetectionParam.java +++ b/detection/src/main/java/com/njcn/gather/detection/pojo/param/PreDetectionParam.java @@ -65,4 +65,14 @@ public class PreDetectionParam { private Boolean sendWebMsg; private String userId; + + /** + * 温度 + */ + private Float temperature; + + /** + * 相对湿度 + */ + private Float humidity; } diff --git a/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java b/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java index f77f2f76..4bf62670 100644 --- a/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java @@ -198,7 +198,7 @@ public class PreDetectionServiceImpl implements PreDetectionService { checkDataParam.setIsValueTypeName(false); List valueType = iPqScriptCheckDataService.getValueType(checkDataParam); - iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(),param.getUserId()); + iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(), param.getUserId(), param.getTemperature(), param.getHumidity()); CnSocketUtil.quitSend(param); } diff --git a/detection/src/main/java/com/njcn/gather/device/pojo/po/PqDev.java b/detection/src/main/java/com/njcn/gather/device/pojo/po/PqDev.java index 8b137ff4..66a5c6a4 100644 --- a/detection/src/main/java/com/njcn/gather/device/pojo/po/PqDev.java +++ b/detection/src/main/java/com/njcn/gather/device/pojo/po/PqDev.java @@ -201,5 +201,15 @@ public class PqDev extends BaseEntity implements Serializable { @TableField("Preinvestment_Plan") private String preinvestmentPlan; + /** + * 温度 + */ + private Float temperature; + + /** + * 相对湿度 + */ + private Float humidity; + } diff --git a/detection/src/main/java/com/njcn/gather/device/service/IPqDevService.java b/detection/src/main/java/com/njcn/gather/device/service/IPqDevService.java index 6f2f5063..615c999d 100644 --- a/detection/src/main/java/com/njcn/gather/device/service/IPqDevService.java +++ b/detection/src/main/java/com/njcn/gather/device/service/IPqDevService.java @@ -152,9 +152,11 @@ public interface IPqDevService extends IService { * @param valueType * @param code * @param userId + * @param temperature + * @param humidity * @return */ - boolean updateResult(List ids, List valueType, String code,String userId); + boolean updateResult(List ids, List valueType, String code, String userId, Float temperature, Float humidity); void updatePqDevReportState(String devId, int i); diff --git a/detection/src/main/java/com/njcn/gather/device/service/impl/PqDevServiceImpl.java b/detection/src/main/java/com/njcn/gather/device/service/impl/PqDevServiceImpl.java index 07636523..078541b7 100644 --- a/detection/src/main/java/com/njcn/gather/device/service/impl/PqDevServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/device/service/impl/PqDevServiceImpl.java @@ -521,7 +521,7 @@ public class PqDevServiceImpl extends ServiceImpl implements } @Override - public boolean updateResult(List ids, List valueType, String code, String userId) { + public boolean updateResult(List ids, List valueType, String code, String userId, Float temperature, Float humidity) { if (CollUtil.isNotEmpty(ids)) { SysTestConfig config = sysTestConfigService.getOneConfig(); Map result = detectionDataDealService.devResult(ids, valueType, code); @@ -536,6 +536,11 @@ public class PqDevServiceImpl extends ServiceImpl implements .set(PqDev::getCheckBy, userId) .set(PqDev::getCheckTime, LocalDateTime.now()) .eq(PqDev::getId, pqDev.getId()); + String currrentScene = sysTestConfigService.getCurrrentScene(); + if (SceneEnum.PROVINCE_PLATFORM.getValue().equals(currrentScene)) { + wrapper.set(ObjectUtil.isNotNull(temperature), PqDev::getTemperature, temperature) + .set(ObjectUtil.isNotNull(humidity), PqDev::getHumidity, humidity); + } if (pqDev.getReCheckNum() >= config.getMaxTime()) { // 装置报告生成 todo... //this.baseMapper.updateReportState(pqDev.getId()); diff --git a/detection/src/main/java/com/njcn/gather/report/pojo/enums/BaseReportKeyEnum.java b/detection/src/main/java/com/njcn/gather/report/pojo/enums/BaseReportKeyEnum.java index 25a0b829..5e3c00f1 100644 --- a/detection/src/main/java/com/njcn/gather/report/pojo/enums/BaseReportKeyEnum.java +++ b/detection/src/main/java/com/njcn/gather/report/pojo/enums/BaseReportKeyEnum.java @@ -29,7 +29,9 @@ public enum BaseReportKeyEnum { YEAR("year","年份"), MONTH("month","月份"), DAY("day","日"), - YEAR_MONTH_DAY("year-month-day","年-月-日"); + YEAR_MONTH_DAY("year-month-day","年-月-日"), + TEMPERATURE("temperature","温度"), + HUMIDITY("humidity","相对湿度"); private String key; diff --git a/detection/src/main/java/com/njcn/gather/report/service/impl/PqReportServiceImpl.java b/detection/src/main/java/com/njcn/gather/report/service/impl/PqReportServiceImpl.java index fc4372db..e0a1df97 100644 --- a/detection/src/main/java/com/njcn/gather/report/service/impl/PqReportServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/report/service/impl/PqReportServiceImpl.java @@ -1099,6 +1099,8 @@ public class PqReportServiceImpl extends ServiceImpl i baseModelMap.put(prefix + BaseReportKeyEnum.ARRIVED_DATE.getKey() + suffix, Objects.isNull(pqDevVO.getArrivedDate()) ? StrPool.TAB : String.valueOf(pqDevVO.getArrivedDate())); // 检测日期 baseModelMap.put(prefix + BaseReportKeyEnum.TEST_DATE.getKey() + suffix, Objects.isNull(pqDevVO.getCheckTime()) ? StrPool.TAB : String.valueOf(pqDevVO.getCheckTime()).substring(0, 10)); + baseModelMap.put(prefix + BaseReportKeyEnum.TEMPERATURE.getKey() + suffix, Objects.isNull(pqDevVO.getTemperature()) ? StrPool.TAB : pqDevVO.getTemperature().toString()); + baseModelMap.put(prefix + BaseReportKeyEnum.HUMIDITY.getKey() + suffix, Objects.isNull(pqDevVO.getHumidity()) ? StrPool.TAB : pqDevVO.getHumidity().toString()); baseModelMap.put(prefix + BaseReportKeyEnum.YEAR.getKey() + suffix, DateUtil.format(new Date(), DatePattern.NORM_YEAR_PATTERN)); baseModelMap.put(prefix + BaseReportKeyEnum.MONTH.getKey() + suffix, DateUtil.format(new Date(), DatePattern.SIMPLE_MONTH_PATTERN).substring(4)); baseModelMap.put(prefix + BaseReportKeyEnum.DAY.getKey() + suffix, DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN).substring(6));