Quellcode durchsuchen

环测化学品演示参数调整(报警时长,报警间隔等)

hanzhiwei vor 2 Jahren
Ursprung
Commit
4cd847d29e

+ 5 - 6
zd-modules/zd-chemical/src/main/java/com/zd/chemical/service/impl/HxpStockServiceImpl.java

@@ -1033,8 +1033,6 @@ public class HxpStockServiceImpl implements IHxpStockService {
      * @Param []
      * @Return void
      **/
-//    @Scheduled(cron = "0 0 0 * * ?")
-//    @Scheduled(cron = "0 0/5 * * * ?")
     public void hxpTimeOut() {
         logger.info("化学品超时未归还定时任务!");
         // 查询配置
@@ -1053,10 +1051,11 @@ public class HxpStockServiceImpl implements IHxpStockService {
                 HxpStock hxpStock = hxpStockMapper.selectHxpStockById(hxpUserecord.getStockId());
                 HxpChemicalJoinCabinet hxpChemicalJoinCabinet = hxpChemicalJoinCabinetMapper.selectHxpChemicalJoinCabinetById(hxpStock.getJoinId());
                 HxpChemical hxpChemical = hxpChemicalService.selectHxpChemicalById(hxpChemicalJoinCabinet.getChemicalId());
-                Integer collectHour = hxpChemical.getCollectHour();
+//                Integer collectHour = hxpChemical.getCollectHour();
                 Integer collectMinute = hxpChemical.getCollectMinute();
-                Integer minute = (collectHour != null?collectHour:0) * 60 + (collectMinute != null?collectMinute:0);
-                DateTime dateTime = DateUtil.offsetMinute(hxpUserecord.getCollectTime(), minute);
+//                Integer minute = (collectHour != null?collectHour:0) * 60 + (collectMinute != null?collectMinute:0);
+                Integer minute = collectMinute != null?collectMinute:0;
+                DateTime dateTime = DateUtil.offsetSecond(hxpUserecord.getCollectTime(), minute);
 
                 //过期时间在提醒天数内 并且在一天之内
                 WarningNoticeLogDto warningNoticeLogDto = new WarningNoticeLogDto();
@@ -1207,7 +1206,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
                         logger.info("执行用户电话通知!");
                         DateTime date = DateUtil.date();
                         for (HxpAlarmConfig hxpAlarmConfig : hxpAlarmConfigList) {
-                            date = DateUtil.offsetMinute(date, Optional.ofNullable(hxpAlarmConfig.getTimeInterval()).orElse(1));
+                            date = DateUtil.offsetSecond(date, Optional.ofNullable(hxpAlarmConfig.getTimeInterval()).orElse(1));
                             HxpAlarmRecord hxpAlarmRecord = new HxpAlarmRecord();
                             hxpAlarmRecord.setAlarmContent(text);
                             hxpAlarmRecord.setAlarmType(2);

+ 6 - 3
zd-modules/zd-chemical/src/main/resources/mapper/chemical/HxpUserecordMapper.xml

@@ -77,7 +77,10 @@
                (select chemical_name from hxp_stock where id = t.stock_id) chemicalName,
                ((select sub_id from hxp_chemical_join_cabinet where id =
                 (select join_id from hxp_stock where id = t.stock_id))) subId,
-               (select ifnull(collect_hour, 0) * 60 + ifnull(collect_minute, 0) from hxp_chemical where id =
+<!--               (select ifnull(collect_hour, 0) * 60 + ifnull(collect_minute, 0) from hxp_chemical where id =-->
+<!--               (select chemical_id from hxp_chemical_join_cabinet where id =-->
+<!--               (select join_id from hxp_stock where id = t.stock_id))) as collectMinute-->
+               (select ifnull(collect_minute, 0) from hxp_chemical where id =
                (select chemical_id from hxp_chemical_join_cabinet where id =
                (select join_id from hxp_stock where id = t.stock_id))) as collectMinute
         from hxp_userecord as t
@@ -231,8 +234,8 @@
         select * from
           (<include refid="selectHxpUserecordListVo"/> ) a
         where a.use_status = 1 and a.collectMinute > 0
-        and TIMESTAMPDIFF(MINUTE, a.collect_time, now()) > a.collectMinute
-
+<!--        and TIMESTAMPDIFF(MINUTE, a.collect_time, now()) > a.collectMinute-->
+        and TIMESTAMPDIFF(SECOND, a.collect_time, now()) > a.collectMinute
     </select>
 
     <resultMap type="com.zd.chemical.domain.vo.HxpUserecordDetailVo" id="HxpUserecordDetailResult">