Commit cb23428a2ba5ab4fcde3e0f26088bb88f22cd8fe
1 parent
32cd2a02
修复bug
Showing
1 changed file
with
20 additions
and
20 deletions
trash-workFlow/src/main/java/com/trash/casefile/kafka/Consumer.java
| @@ -148,21 +148,21 @@ public class Consumer { | @@ -148,21 +148,21 @@ public class Consumer { | ||
| 148 | count = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020")==null?1:Integer.parseInt(redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020").toString())+1; | 148 | count = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020")==null?1:Integer.parseInt(redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020").toString())+1; |
| 149 | //获取累计报警描述 | 149 | //获取累计报警描述 |
| 150 | describe = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe")==null?"":redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe").toString(); | 150 | describe = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe")==null?"":redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe").toString(); |
| 151 | - | 151 | + if(!StringUtils.isEmpty(describe)){ |
| 152 | + describe = describe + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " " | ||
| 153 | + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" + | ||
| 154 | + jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType(); | ||
| 155 | + }else{ | ||
| 156 | + describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " " | ||
| 157 | + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" + | ||
| 158 | + jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType(); | ||
| 159 | + } | ||
| 152 | //报警次数等于5推送案卷 | 160 | //报警次数等于5推送案卷 |
| 153 | if(count==5){ | 161 | if(count==5){ |
| 154 | violationWarningInformation.setViolationObjectType("0"); | 162 | violationWarningInformation.setViolationObjectType("0"); |
| 155 | violationWarningInformation.setSendObject("区管理部门"); | 163 | violationWarningInformation.setSendObject("区管理部门"); |
| 156 | violationWarningInformation.setProjectName(jsonObject.getString("siteName")); | 164 | violationWarningInformation.setProjectName(jsonObject.getString("siteName")); |
| 157 | - if(!StringUtils.isEmpty(describe)){ | ||
| 158 | - describe = describe + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " " | ||
| 159 | - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" + | ||
| 160 | - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType(); | ||
| 161 | - }else{ | ||
| 162 | - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " " | ||
| 163 | - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" + | ||
| 164 | - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType(); | ||
| 165 | - } | 165 | + |
| 166 | 166 | ||
| 167 | violationWarningInformation.setCreateTime(alarmTime); | 167 | violationWarningInformation.setCreateTime(alarmTime); |
| 168 | violationWarningInformation.setDescribe(describe); | 168 | violationWarningInformation.setDescribe(describe); |
| @@ -278,21 +278,21 @@ public class Consumer { | @@ -278,21 +278,21 @@ public class Consumer { | ||
| 278 | count = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024")==null?1:Integer.parseInt(redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024").toString())+1; | 278 | count = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024")==null?1:Integer.parseInt(redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024").toString())+1; |
| 279 | //获取累计报警描述 | 279 | //获取累计报警描述 |
| 280 | describe = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe")==null?"":redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe").toString(); | 280 | describe = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe")==null?"":redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe").toString(); |
| 281 | - | 281 | + if(!StringUtils.isEmpty(describe)){ |
| 282 | + describe = describe + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " " | ||
| 283 | + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" + | ||
| 284 | + jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType(); | ||
| 285 | + }else{ | ||
| 286 | + describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " " | ||
| 287 | + + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" + | ||
| 288 | + jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType(); | ||
| 289 | + } | ||
| 282 | //报警次数等于5推送案卷 | 290 | //报警次数等于5推送案卷 |
| 283 | if(count==5){ | 291 | if(count==5){ |
| 284 | violationWarningInformation.setViolationObjectType("1"); | 292 | violationWarningInformation.setViolationObjectType("1"); |
| 285 | violationWarningInformation.setSendObject("区管理部门"); | 293 | violationWarningInformation.setSendObject("区管理部门"); |
| 286 | violationWarningInformation.setProjectName(jsonObject.getString("siteName")); | 294 | violationWarningInformation.setProjectName(jsonObject.getString("siteName")); |
| 287 | - if(!StringUtils.isEmpty(describe)){ | ||
| 288 | - describe = describe + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " " | ||
| 289 | - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" + | ||
| 290 | - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType(); | ||
| 291 | - }else{ | ||
| 292 | - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " " | ||
| 293 | - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" + | ||
| 294 | - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType(); | ||
| 295 | - } | 295 | + |
| 296 | violationWarningInformation.setCreateTime(alarmTime); | 296 | violationWarningInformation.setCreateTime(alarmTime); |
| 297 | violationWarningInformation.setDescribe(describe); | 297 | violationWarningInformation.setDescribe(describe); |
| 298 | // 业务逻辑 | 298 | // 业务逻辑 |