GasTimer.java 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. package com.huimv.admin.timer;
  2. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  3. import com.huimv.admin.common.utils.NumberUtils;
  4. import com.huimv.admin.entity.GasData;
  5. import com.huimv.admin.entity.GasThreshold;
  6. import com.huimv.admin.entity.GasWarningInfo;
  7. import com.huimv.admin.mapper.GasDataMapper;
  8. import com.huimv.admin.mapper.GasThresholdMapper;
  9. import com.huimv.admin.mapper.GasWarningInfoMapper;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.context.annotation.Configuration;
  12. import org.springframework.scheduling.annotation.EnableScheduling;
  13. import org.springframework.scheduling.annotation.Scheduled;
  14. import java.util.Date;
  15. @Configuration
  16. @EnableScheduling
  17. public class GasTimer {
  18. @Autowired
  19. private GasDataMapper gasDataMapper;
  20. @Autowired
  21. private GasWarningInfoMapper warningInfoMapper;
  22. @Autowired
  23. private GasThresholdMapper thresholdMapper;
  24. @Scheduled(cron = "0 0 */1 * * ? ")
  25. private void getShenChan() throws Exception {
  26. String type = NumberUtils.getNum(1, 5, 0);//loc_type
  27. for (int i = 1; i < 5; i++) {
  28. String nh3n = NumberUtils.getNumFloat(0.0, 10.5);//NH3N
  29. String jlm = NumberUtils.getNumFloat(0.0, 10.5);//jlm
  30. String elht = NumberUtils.getNumFloat(0.0, 10.5);//elht
  31. String ejel = NumberUtils.getNumFloat(0.0, 10.5);//ejel
  32. String h2s = NumberUtils.getNumFloat(0.0, 10.5);//h2s
  33. String byx = NumberUtils.getNumFloat(0.0, 20.5);//byx
  34. String ch3 = NumberUtils.getNumFloat(0.0, 10.5);//ch3
  35. String sja = NumberUtils.getNumFloat(0.0,10.5);//sja
  36. GasData gasData = new GasData();
  37. gasData.setLoctionType(i);
  38. gasData.setNh3N(nh3n);
  39. gasData.setJlm(jlm);
  40. gasData.setElht(elht);
  41. gasData.setEjel(ejel);
  42. gasData.setH2s(h2s);
  43. gasData.setByx(byx);
  44. gasData.setCh3sh(ch3);
  45. gasData.setSja(sja);
  46. gasData.setFarmId(21);
  47. gasData.setCreateTime(new Date());
  48. QueryWrapper<GasThreshold> queryWrapper = new QueryWrapper<>();
  49. GasWarningInfo warningInfo = new GasWarningInfo();
  50. if (i==1) {
  51. String cq = NumberUtils.getNumFloat(0.0, 1000.5);//cq
  52. gasData.setCq(cq);
  53. queryWrapper.eq("farm_id", 21).eq("gas_type", 1);
  54. GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
  55. if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
  56. warningInfo.setWarningContent("NH3N为"+nh3n + "超过阈值,系统预警提醒");
  57. warningInfo.setWarningType(0);
  58. warningInfo.setBuildLocation("屋顶");
  59. warningInfo.setDate(new Date());
  60. warningInfo.setFarmId(gasThreshold.getFarmId());
  61. warningInfo.setUserIds(gasThreshold.getUserIds());
  62. warningInfoMapper.insert(warningInfo);
  63. }
  64. if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
  65. warningInfo.setWarningContent("甲硫醚为"+jlm + "超过阈值,系统预警提醒");
  66. warningInfo.setWarningType(1);
  67. warningInfo.setBuildLocation("屋顶");
  68. warningInfo.setDate(new Date());
  69. warningInfo.setFarmId(gasThreshold.getFarmId());
  70. warningInfo.setUserIds(gasThreshold.getUserIds());
  71. warningInfoMapper.insert(warningInfo);
  72. }
  73. if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
  74. warningInfo.setWarningContent("二硫化碳为"+elht + "超过阈值,系统预警提醒");
  75. warningInfo.setWarningType(2);
  76. warningInfo.setBuildLocation("屋顶");
  77. warningInfo.setDate(new Date());
  78. warningInfo.setFarmId(gasThreshold.getFarmId());
  79. warningInfo.setUserIds(gasThreshold.getUserIds());
  80. warningInfoMapper.insert(warningInfo);
  81. }
  82. if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
  83. warningInfo.setWarningContent("二甲二硫为"+ejel + "超过阈值,系统预警提醒");
  84. warningInfo.setWarningType(3);
  85. warningInfo.setBuildLocation("屋顶");
  86. warningInfo.setDate(new Date());
  87. warningInfo.setFarmId(gasThreshold.getFarmId());
  88. warningInfo.setUserIds(gasThreshold.getUserIds());
  89. warningInfoMapper.insert(warningInfo);
  90. }
  91. if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
  92. warningInfo.setWarningContent("H2S为"+h2s + "超过阈值,系统预警提醒");
  93. warningInfo.setWarningType(4);
  94. warningInfo.setBuildLocation("屋顶");
  95. warningInfo.setDate(new Date());
  96. warningInfo.setFarmId(gasThreshold.getFarmId());
  97. warningInfo.setUserIds(gasThreshold.getUserIds());
  98. warningInfoMapper.insert(warningInfo);
  99. }
  100. if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
  101. warningInfo.setWarningContent("苯乙烯为"+byx + "超过阈值,系统预警提醒");
  102. warningInfo.setWarningType(5);
  103. warningInfo.setBuildLocation("屋顶");
  104. warningInfo.setDate(new Date());
  105. warningInfo.setFarmId(gasThreshold.getFarmId());
  106. warningInfo.setUserIds(gasThreshold.getUserIds());
  107. warningInfoMapper.insert(warningInfo);
  108. }
  109. if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
  110. warningInfo.setWarningContent("CH3SH为"+ch3 + "超过阈值,系统预警提醒");
  111. warningInfo.setWarningType(6);
  112. warningInfo.setBuildLocation("屋顶");
  113. warningInfo.setDate(new Date());
  114. warningInfo.setFarmId(gasThreshold.getFarmId());
  115. warningInfo.setUserIds(gasThreshold.getUserIds());
  116. warningInfoMapper.insert(warningInfo);
  117. }
  118. if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
  119. warningInfo.setWarningContent("三甲胺为"+sja + "超过阈值,系统预警提醒");
  120. warningInfo.setWarningType(7);
  121. warningInfo.setBuildLocation("屋顶");
  122. warningInfo.setDate(new Date());
  123. warningInfo.setFarmId(gasThreshold.getFarmId());
  124. warningInfo.setUserIds(gasThreshold.getUserIds());
  125. warningInfoMapper.insert(warningInfo);
  126. }
  127. if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
  128. warningInfo.setWarningContent("臭气为"+cq + "超过阈值,系统预警提醒");
  129. warningInfo.setWarningType(8);
  130. warningInfo.setBuildLocation("屋顶");
  131. warningInfo.setDate(new Date());
  132. warningInfo.setFarmId(gasThreshold.getFarmId());
  133. warningInfo.setUserIds(gasThreshold.getUserIds());
  134. warningInfoMapper.insert(warningInfo);
  135. }
  136. } else if (i==2) {
  137. String cq = NumberUtils.getNumFloat(0.0, 5000.5);//cq
  138. gasData.setCq(cq);
  139. queryWrapper.eq("farm_id", 21).eq("gas_type", 2);
  140. GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
  141. if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
  142. warningInfo.setWarningContent("NH3N为"+nh3n + "超过阈值,系统预警提醒");
  143. warningInfo.setWarningType(0);
  144. warningInfo.setBuildLocation("厂界上");
  145. warningInfo.setDate(new Date());
  146. warningInfo.setFarmId(gasThreshold.getFarmId());
  147. warningInfo.setUserIds(gasThreshold.getUserIds());
  148. warningInfoMapper.insert(warningInfo);
  149. }
  150. if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
  151. warningInfo.setWarningContent("甲硫醚为"+jlm + "超过阈值,系统预警提醒");
  152. warningInfo.setWarningType(1);
  153. warningInfo.setBuildLocation("厂界上");
  154. warningInfo.setDate(new Date());
  155. warningInfo.setFarmId(gasThreshold.getFarmId());
  156. warningInfo.setUserIds(gasThreshold.getUserIds());
  157. warningInfoMapper.insert(warningInfo);
  158. }
  159. if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
  160. warningInfo.setWarningContent("二硫化碳为"+elht + "超过阈值,系统预警提醒");
  161. warningInfo.setWarningType(2);
  162. warningInfo.setBuildLocation("厂界上");
  163. warningInfo.setDate(new Date());
  164. warningInfo.setFarmId(gasThreshold.getFarmId());
  165. warningInfo.setUserIds(gasThreshold.getUserIds());
  166. warningInfoMapper.insert(warningInfo);
  167. }
  168. if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
  169. warningInfo.setWarningContent("二甲二硫为"+ejel + "超过阈值,系统预警提醒");
  170. warningInfo.setWarningType(3);
  171. warningInfo.setBuildLocation("厂界上");
  172. warningInfo.setDate(new Date());
  173. warningInfo.setFarmId(gasThreshold.getFarmId());
  174. warningInfo.setUserIds(gasThreshold.getUserIds());
  175. warningInfoMapper.insert(warningInfo);
  176. }
  177. if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
  178. warningInfo.setWarningContent("H2S为"+h2s + "超过阈值,系统预警提醒");
  179. warningInfo.setWarningType(4);
  180. warningInfo.setBuildLocation("厂界上");
  181. warningInfo.setDate(new Date());
  182. warningInfo.setFarmId(gasThreshold.getFarmId());
  183. warningInfo.setUserIds(gasThreshold.getUserIds());
  184. warningInfoMapper.insert(warningInfo);
  185. }
  186. if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
  187. warningInfo.setWarningContent("苯乙烯为"+byx + "超过阈值,系统预警提醒");
  188. warningInfo.setWarningType(5);
  189. warningInfo.setBuildLocation("厂界上");
  190. warningInfo.setDate(new Date());
  191. warningInfo.setFarmId(gasThreshold.getFarmId());
  192. warningInfo.setUserIds(gasThreshold.getUserIds());
  193. warningInfoMapper.insert(warningInfo);
  194. }
  195. if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
  196. warningInfo.setWarningContent("CH3SH为"+ch3 + "超过阈值,系统预警提醒");
  197. warningInfo.setWarningType(6);
  198. warningInfo.setBuildLocation("厂界上");
  199. warningInfo.setDate(new Date());
  200. warningInfo.setFarmId(gasThreshold.getFarmId());
  201. warningInfo.setUserIds(gasThreshold.getUserIds());
  202. warningInfoMapper.insert(warningInfo);
  203. }
  204. if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
  205. warningInfo.setWarningContent("三甲胺为"+sja + "超过阈值,系统预警提醒");
  206. warningInfo.setWarningType(7);
  207. warningInfo.setBuildLocation("厂界上");
  208. warningInfo.setDate(new Date());
  209. warningInfo.setFarmId(gasThreshold.getFarmId());
  210. warningInfo.setUserIds(gasThreshold.getUserIds());
  211. warningInfoMapper.insert(warningInfo);
  212. }
  213. if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
  214. warningInfo.setWarningContent("臭气为"+cq + "超过阈值,系统预警提醒");
  215. warningInfo.setWarningType(8);
  216. warningInfo.setBuildLocation("厂界上");
  217. warningInfo.setDate(new Date());
  218. warningInfo.setFarmId(gasThreshold.getFarmId());
  219. warningInfo.setUserIds(gasThreshold.getUserIds());
  220. warningInfoMapper.insert(warningInfo);
  221. }
  222. } else if (i==3) {
  223. String cq = NumberUtils.getNumFloat(0.0, 1000.5);//cq
  224. gasData.setCq(cq);
  225. queryWrapper.eq("farm_id", 21).eq("gas_type", 3);
  226. GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
  227. if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
  228. warningInfo.setWarningContent("NH3N为"+nh3n + "超过阈值,系统预警提醒");
  229. warningInfo.setWarningType(0);
  230. warningInfo.setBuildLocation("厂界下");
  231. warningInfo.setDate(new Date());
  232. warningInfo.setFarmId(gasThreshold.getFarmId());
  233. warningInfo.setUserIds(gasThreshold.getUserIds());
  234. warningInfoMapper.insert(warningInfo);
  235. }
  236. if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
  237. warningInfo.setWarningContent("甲硫醚为"+jlm + "超过阈值,系统预警提醒");
  238. warningInfo.setWarningType(1);
  239. warningInfo.setBuildLocation("厂界下");
  240. warningInfo.setDate(new Date());
  241. warningInfo.setFarmId(gasThreshold.getFarmId());
  242. warningInfo.setUserIds(gasThreshold.getUserIds());
  243. warningInfoMapper.insert(warningInfo);
  244. }
  245. if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
  246. warningInfo.setWarningContent("二硫化碳为"+elht + "超过阈值,系统预警提醒");
  247. warningInfo.setWarningType(2);
  248. warningInfo.setBuildLocation("厂界下");
  249. warningInfo.setDate(new Date());
  250. warningInfo.setFarmId(gasThreshold.getFarmId());
  251. warningInfo.setUserIds(gasThreshold.getUserIds());
  252. warningInfoMapper.insert(warningInfo);
  253. }
  254. if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
  255. warningInfo.setWarningContent("二甲二硫为"+ejel + "超过阈值,系统预警提醒");
  256. warningInfo.setWarningType(3);
  257. warningInfo.setBuildLocation("厂界下");
  258. warningInfo.setDate(new Date());
  259. warningInfo.setFarmId(gasThreshold.getFarmId());
  260. warningInfo.setUserIds(gasThreshold.getUserIds());
  261. warningInfoMapper.insert(warningInfo);
  262. }
  263. if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
  264. warningInfo.setWarningContent("H2S为"+h2s + "超过阈值,系统预警提醒");
  265. warningInfo.setWarningType(4);
  266. warningInfo.setBuildLocation("厂界下");
  267. warningInfo.setDate(new Date());
  268. warningInfo.setFarmId(gasThreshold.getFarmId());
  269. warningInfo.setUserIds(gasThreshold.getUserIds());
  270. warningInfoMapper.insert(warningInfo);
  271. }
  272. if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
  273. warningInfo.setWarningContent("苯乙烯为"+byx + "超过阈值,系统预警提醒");
  274. warningInfo.setWarningType(5);
  275. warningInfo.setBuildLocation("厂界下");
  276. warningInfo.setDate(new Date());
  277. warningInfo.setFarmId(gasThreshold.getFarmId());
  278. warningInfo.setUserIds(gasThreshold.getUserIds());
  279. warningInfoMapper.insert(warningInfo);
  280. }
  281. if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
  282. warningInfo.setWarningContent("CH3SH为"+ch3 + "超过阈值,系统预警提醒");
  283. warningInfo.setWarningType(6);
  284. warningInfo.setBuildLocation("厂界下");
  285. warningInfo.setDate(new Date());
  286. warningInfo.setFarmId(gasThreshold.getFarmId());
  287. warningInfo.setUserIds(gasThreshold.getUserIds());
  288. warningInfoMapper.insert(warningInfo);
  289. }
  290. if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
  291. warningInfo.setWarningContent("三甲胺为"+sja + "超过阈值,系统预警提醒");
  292. warningInfo.setWarningType(7);
  293. warningInfo.setBuildLocation("厂界下");
  294. warningInfo.setDate(new Date());
  295. warningInfo.setFarmId(gasThreshold.getFarmId());
  296. warningInfo.setUserIds(gasThreshold.getUserIds());
  297. warningInfoMapper.insert(warningInfo);
  298. }
  299. if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
  300. warningInfo.setWarningContent("臭气为"+cq + "超过阈值,系统预警提醒");
  301. warningInfo.setWarningType(8);
  302. warningInfo.setBuildLocation("厂界下");
  303. warningInfo.setDate(new Date());
  304. warningInfo.setFarmId(gasThreshold.getFarmId());
  305. warningInfo.setUserIds(gasThreshold.getUserIds());
  306. warningInfoMapper.insert(warningInfo);
  307. }
  308. } else if (i==4) {
  309. String cq = NumberUtils.getNumFloat(0.0, 10000.5);//cq
  310. gasData.setCq(cq);
  311. queryWrapper.eq("farm_id", 21).eq("gas_type", 4);
  312. GasThreshold gasThreshold = thresholdMapper.selectOne(queryWrapper);
  313. if (Double.parseDouble(nh3n) > Double.parseDouble(gasThreshold.getNh3N())) {
  314. warningInfo.setWarningContent("NH3N为"+nh3n + "超过阈值,系统预警提醒");
  315. warningInfo.setWarningType(0);
  316. warningInfo.setBuildLocation("厂界居民");
  317. warningInfo.setDate(new Date());
  318. warningInfo.setFarmId(gasThreshold.getFarmId());
  319. warningInfo.setUserIds(gasThreshold.getUserIds());
  320. warningInfoMapper.insert(warningInfo);
  321. }
  322. if (Double.parseDouble(jlm) > Double.parseDouble(gasThreshold.getJlm())) {
  323. warningInfo.setWarningContent("甲硫醚为"+jlm + "超过阈值,系统预警提醒");
  324. warningInfo.setWarningType(1);
  325. warningInfo.setBuildLocation("厂界居民");
  326. warningInfo.setDate(new Date());
  327. warningInfo.setFarmId(gasThreshold.getFarmId());
  328. warningInfo.setUserIds(gasThreshold.getUserIds());
  329. warningInfoMapper.insert(warningInfo);
  330. }
  331. if (Double.parseDouble(elht) > Double.parseDouble(gasThreshold.getElht())) {
  332. warningInfo.setWarningContent("二硫化碳为"+elht + "超过阈值,系统预警提醒");
  333. warningInfo.setWarningType(2);
  334. warningInfo.setBuildLocation("厂界居民");
  335. warningInfo.setDate(new Date());
  336. warningInfo.setFarmId(gasThreshold.getFarmId());
  337. warningInfo.setUserIds(gasThreshold.getUserIds());
  338. warningInfoMapper.insert(warningInfo);
  339. }
  340. if (Double.parseDouble(ejel) > Double.parseDouble(gasThreshold.getEjel())) {
  341. warningInfo.setWarningContent("二甲二硫为"+ejel + "超过阈值,系统预警提醒");
  342. warningInfo.setWarningType(3);
  343. warningInfo.setBuildLocation("厂界居民");
  344. warningInfo.setDate(new Date());
  345. warningInfo.setFarmId(gasThreshold.getFarmId());
  346. warningInfo.setUserIds(gasThreshold.getUserIds());
  347. warningInfoMapper.insert(warningInfo);
  348. }
  349. if (Double.parseDouble(h2s) > Double.parseDouble(gasThreshold.getH2s())) {
  350. warningInfo.setWarningContent("H2S为"+h2s + "超过阈值,系统预警提醒");
  351. warningInfo.setWarningType(4);
  352. warningInfo.setBuildLocation("厂界居民");
  353. warningInfo.setDate(new Date());
  354. warningInfo.setFarmId(gasThreshold.getFarmId());
  355. warningInfo.setUserIds(gasThreshold.getUserIds());
  356. warningInfoMapper.insert(warningInfo);
  357. }
  358. if (Double.parseDouble(byx) > Double.parseDouble(gasThreshold.getByx())) {
  359. warningInfo.setWarningContent("苯乙烯为"+byx + "超过阈值,系统预警提醒");
  360. warningInfo.setWarningType(5);
  361. warningInfo.setBuildLocation("厂界居民");
  362. warningInfo.setDate(new Date());
  363. warningInfo.setFarmId(gasThreshold.getFarmId());
  364. warningInfo.setUserIds(gasThreshold.getUserIds());
  365. warningInfoMapper.insert(warningInfo);
  366. }
  367. if (Double.parseDouble(ch3) > Double.parseDouble(gasThreshold.getCh3sh())) {
  368. warningInfo.setWarningContent("CH3SH为"+ch3 + "超过阈值,系统预警提醒");
  369. warningInfo.setWarningType(6);
  370. warningInfo.setBuildLocation("厂界居民");
  371. warningInfo.setDate(new Date());
  372. warningInfo.setFarmId(gasThreshold.getFarmId());
  373. warningInfo.setUserIds(gasThreshold.getUserIds());
  374. warningInfoMapper.insert(warningInfo);
  375. }
  376. if (Double.parseDouble(sja) > Double.parseDouble(gasThreshold.getSja())) {
  377. warningInfo.setWarningContent("三甲胺为"+sja + "超过阈值,系统预警提醒");
  378. warningInfo.setWarningType(7);
  379. warningInfo.setBuildLocation("厂界居民");
  380. warningInfo.setDate(new Date());
  381. warningInfo.setFarmId(gasThreshold.getFarmId());
  382. warningInfo.setUserIds(gasThreshold.getUserIds());
  383. warningInfoMapper.insert(warningInfo);
  384. }
  385. if (Double.parseDouble(cq) > Double.parseDouble(gasThreshold.getCq())) {
  386. warningInfo.setWarningContent("臭气为"+cq + "超过阈值,系统预警提醒");
  387. warningInfo.setWarningType(8);
  388. warningInfo.setBuildLocation("厂界居民");
  389. warningInfo.setDate(new Date());
  390. warningInfo.setFarmId(gasThreshold.getFarmId());
  391. warningInfo.setUserIds(gasThreshold.getUserIds());
  392. warningInfoMapper.insert(warningInfo);
  393. }
  394. }
  395. gasDataMapper.insert(gasData);
  396. }
  397. }
  398. }