Commit c8bdb3898533e1f8a07a5ec519edc47dc1acbd6a
1 parent
42fad2dd
修复bug
Showing
8 changed files
with
103 additions
and
115 deletions
trash-quartz/src/main/java/com/trash/quartz/task/DriverTask.java
| @@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletResponse; | @@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletResponse; | ||
| 17 | import com.trash.casefile.domain.KafkaCompensation; | 17 | import com.trash.casefile.domain.KafkaCompensation; |
| 18 | import com.trash.casefile.kafka.Consumer; | 18 | import com.trash.casefile.kafka.Consumer; |
| 19 | import com.trash.casefile.mapper.KafkaCompensationMapper; | 19 | import com.trash.casefile.mapper.KafkaCompensationMapper; |
| 20 | +import com.trash.common.core.redis.RedisCache; | ||
| 20 | import org.springframework.beans.BeansException; | 21 | import org.springframework.beans.BeansException; |
| 21 | import org.springframework.beans.factory.annotation.Autowired; | 22 | import org.springframework.beans.factory.annotation.Autowired; |
| 22 | import org.springframework.stereotype.Component; | 23 | import org.springframework.stereotype.Component; |
| @@ -56,6 +57,9 @@ public class DriverTask | @@ -56,6 +57,9 @@ public class DriverTask | ||
| 56 | @Autowired | 57 | @Autowired |
| 57 | private trashConfig trashConfig; | 58 | private trashConfig trashConfig; |
| 58 | 59 | ||
| 60 | + @Autowired | ||
| 61 | + private RedisCache redisCache; | ||
| 62 | + | ||
| 59 | public void checkCredit(){ | 63 | public void checkCredit(){ |
| 60 | 64 | ||
| 61 | if(RemoteServerUtils.remote == null){ | 65 | if(RemoteServerUtils.remote == null){ |
| @@ -257,6 +261,10 @@ public class DriverTask | @@ -257,6 +261,10 @@ public class DriverTask | ||
| 257 | 261 | ||
| 258 | } | 262 | } |
| 259 | 263 | ||
| 264 | + /** | ||
| 265 | + * kafka补偿机制,每半小时一次 | ||
| 266 | + * @throws InterruptedException | ||
| 267 | + */ | ||
| 260 | public void kafkaCompensation() throws InterruptedException { | 268 | public void kafkaCompensation() throws InterruptedException { |
| 261 | KafkaCompensation kafkaCompensation = new KafkaCompensation(); | 269 | KafkaCompensation kafkaCompensation = new KafkaCompensation(); |
| 262 | kafkaCompensation.setStatus(0); | 270 | kafkaCompensation.setStatus(0); |
| @@ -265,5 +273,60 @@ public class DriverTask | @@ -265,5 +273,60 @@ public class DriverTask | ||
| 265 | SpringUtils.getBean(Consumer.class).autoViolationWarning(k.getData(),k.getId().toString()); | 273 | SpringUtils.getBean(Consumer.class).autoViolationWarning(k.getData(),k.getId().toString()); |
| 266 | } | 274 | } |
| 267 | } | 275 | } |
| 268 | - | 276 | + |
| 277 | + /** | ||
| 278 | + * 每分钟更新一次公司列表 | ||
| 279 | + */ | ||
| 280 | + public void getCompanyList(){ | ||
| 281 | + if(RemoteServerUtils.remote == null){ | ||
| 282 | + RemoteServerUtils.remote = trashConfig.getRemotePath(); | ||
| 283 | + } | ||
| 284 | + Map<String, Object> map = new HashMap<>(); | ||
| 285 | + map.put("size",9999); | ||
| 286 | + map.put("page",1); | ||
| 287 | + JSONArray jsonArray = RemoteServerUtils.getCompanyList(map, trashConfig.getToken()); | ||
| 288 | + redisCache.setCacheObject("companyList",jsonArray); | ||
| 289 | + } | ||
| 290 | + | ||
| 291 | + /** | ||
| 292 | + * 每分钟更新一次工地列表 | ||
| 293 | + */ | ||
| 294 | + public void getConstructionList(){ | ||
| 295 | + if(RemoteServerUtils.remote == null){ | ||
| 296 | + RemoteServerUtils.remote = trashConfig.getRemotePath(); | ||
| 297 | + } | ||
| 298 | + Map<String, Object> map = new HashMap<>(); | ||
| 299 | + map.put("size",999); | ||
| 300 | + map.put("page",1); | ||
| 301 | + JSONArray jsonArray = RemoteServerUtils.getConstructionList(map,trashConfig.getToken()); | ||
| 302 | + redisCache.setCacheObject("constructionList",jsonArray); | ||
| 303 | + } | ||
| 304 | + | ||
| 305 | + /** | ||
| 306 | + * 每分钟更新一次消纳场列表 | ||
| 307 | + */ | ||
| 308 | + public void getEarthSitesList(){ | ||
| 309 | + if(RemoteServerUtils.remote == null){ | ||
| 310 | + RemoteServerUtils.remote = trashConfig.getRemotePath(); | ||
| 311 | + } | ||
| 312 | + Map<String, Object> map = new HashMap<>(); | ||
| 313 | + map.put("size",999); | ||
| 314 | + map.put("page",1); | ||
| 315 | + JSONArray jsonArray = RemoteServerUtils.getEarthSitesList(map,trashConfig.getToken()); | ||
| 316 | + redisCache.setCacheObject("earthSitesList",jsonArray); | ||
| 317 | + } | ||
| 318 | + | ||
| 319 | + /** | ||
| 320 | + * 每分钟更新一次区域列表 | ||
| 321 | + */ | ||
| 322 | + public void getAreaList(){ | ||
| 323 | + if(RemoteServerUtils.remote == null){ | ||
| 324 | + RemoteServerUtils.remote = trashConfig.getRemotePath(); | ||
| 325 | + } | ||
| 326 | + Map<String, Object> map = new HashMap<>(); | ||
| 327 | + map.put("size",999); | ||
| 328 | + map.put("page",1); | ||
| 329 | + JSONArray jsonArray = RemoteServerUtils.getAreas(trashConfig.getToken()); | ||
| 330 | + redisCache.setCacheObject("areaList",jsonArray); | ||
| 331 | + } | ||
| 269 | } | 332 | } |
trash-ui/src/api/dict.js
| @@ -148,10 +148,10 @@ export function getDict(params) { | @@ -148,10 +148,10 @@ export function getDict(params) { | ||
| 148 | }); | 148 | }); |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | -export function getSupervision(data) { | 151 | +export function getSupervision(params) { |
| 152 | return requestRemote({ | 152 | return requestRemote({ |
| 153 | - url: '/api/gpsservice/cs/supervision/ledger/list', | ||
| 154 | - method: 'post', | ||
| 155 | - data: data | 153 | + url: '/api/gpsservice/cs/supervision/detail', |
| 154 | + method: 'get', | ||
| 155 | + params: params | ||
| 156 | }); | 156 | }); |
| 157 | } | 157 | } |
trash-ui/src/views/activiti/task/index.vue
| @@ -681,14 +681,15 @@ export default { | @@ -681,14 +681,15 @@ export default { | ||
| 681 | if(this.definitionKey.indexOf("supervision")>-1){ | 681 | if(this.definitionKey.indexOf("supervision")>-1){ |
| 682 | console.log(row) | 682 | console.log(row) |
| 683 | const params = { | 683 | const params = { |
| 684 | - id: "1fee149a03a3482ba45367745fea6669", | ||
| 685 | - type:1, | ||
| 686 | - page:1, | ||
| 687 | - size:1 | 684 | + id: row.businessKey.split(":")[1], |
| 688 | } | 685 | } |
| 689 | getSupervision(params).then(res=>{ | 686 | getSupervision(params).then(res=>{ |
| 690 | console.log(res) | 687 | console.log(res) |
| 691 | - this.supervisionData = res.result.list[0]; | 688 | + if(res.result==null){ |
| 689 | + this.$message.error("获取纪检督察详情失败!请重试") | ||
| 690 | + return; | ||
| 691 | + } | ||
| 692 | + this.supervisionData = res.result; | ||
| 692 | this.supervisionOpen = true; | 693 | this.supervisionOpen = true; |
| 693 | }) | 694 | }) |
| 694 | return; | 695 | return; |
trash-ui/src/views/casefile/violationCaseFile/index.vue
| 1 | <template> | 1 | <template> |
| 2 | <div class="app-container"> | 2 | <div class="app-container"> |
| 3 | - <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> | 3 | + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="105px"> |
| 4 | 4 | ||
| 5 | <el-form-item label="所属区域" prop="owningRegion"> | 5 | <el-form-item label="所属区域" prop="owningRegion"> |
| 6 | <el-select v-model="queryParams.owningRegion" placeholder="请选择违规类型" size="small"> | 6 | <el-select v-model="queryParams.owningRegion" placeholder="请选择违规类型" size="small"> |
| @@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
| 54 | size="mini" | 54 | size="mini" |
| 55 | @click="handleAdd" | 55 | @click="handleAdd" |
| 56 | v-hasPermi="['casefile:violationCaseFile:add']" | 56 | v-hasPermi="['casefile:violationCaseFile:add']" |
| 57 | - >新增</el-button> | 57 | + >违规案卷录入</el-button> |
| 58 | </el-col> | 58 | </el-col> |
| 59 | <!-- <el-col :span="1.5">--> | 59 | <!-- <el-col :span="1.5">--> |
| 60 | <!-- <el-button--> | 60 | <!-- <el-button--> |
| @@ -140,7 +140,7 @@ | @@ -140,7 +140,7 @@ | ||
| 140 | </el-col> | 140 | </el-col> |
| 141 | <el-col :span="11"> | 141 | <el-col :span="11"> |
| 142 | <el-form-item label="违规对象类型" prop="violationObjectType"> | 142 | <el-form-item label="违规对象类型" prop="violationObjectType"> |
| 143 | - <el-select v-model="form.violationObjectType" placeholder="请选择违规对象类型" size="small"> | 143 | + <el-select v-model="form.violationObjectType" placeholder="请选择违规对象类型" size="small" style="width: 100%"> |
| 144 | <el-option label="工地" value="0" /> | 144 | <el-option label="工地" value="0" /> |
| 145 | <el-option label="消纳场" value="1" /> | 145 | <el-option label="消纳场" value="1" /> |
| 146 | <el-option label="企业" value="2" /> | 146 | <el-option label="企业" value="2" /> |
| @@ -186,8 +186,8 @@ | @@ -186,8 +186,8 @@ | ||
| 186 | <el-row :gutter="2"> | 186 | <el-row :gutter="2"> |
| 187 | <el-col :span="11"> | 187 | <el-col :span="11"> |
| 188 | <el-form-item label="公司" prop="violationGrade"> | 188 | <el-form-item label="公司" prop="violationGrade"> |
| 189 | - <el-select v-model="form.companyName" placeholder="请选择公司" style="width: 100%;"> | ||
| 190 | - <el-option v-for="item in companyList" :label="item.name" :value="item.name" /> | 189 | + <el-select v-model="form.companyName" :filterable="true" :remote-method="companyLoadOptions" :loading="isLoadingCompany" placeholder="请输入项目名称" style="width: 100%;"> |
| 190 | + <el-option v-for="item in companyList" :key="item.name" :label="item.name" :value="item.name"></el-option> | ||
| 191 | </el-select> | 191 | </el-select> |
| 192 | </el-form-item> | 192 | </el-form-item> |
| 193 | </el-col> | 193 | </el-col> |
trash-ui/src/views/casefile/violationWarningInformation/index.vue
| @@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
| 46 | size="mini" | 46 | size="mini" |
| 47 | @click="handleAdd" | 47 | @click="handleAdd" |
| 48 | v-hasPermi="['casefile:violationWarningInformation:add']" | 48 | v-hasPermi="['casefile:violationWarningInformation:add']" |
| 49 | - >新增</el-button> | 49 | + >预警信息录入</el-button> |
| 50 | </el-col> | 50 | </el-col> |
| 51 | <!-- <el-col :span="1.5">--> | 51 | <!-- <el-col :span="1.5">--> |
| 52 | <!-- <el-button--> | 52 | <!-- <el-button--> |
trash-workFlow/src/main/java/com/trash/casefile/controller/RemoteServerController.java
| @@ -29,27 +29,8 @@ public class RemoteServerController { | @@ -29,27 +29,8 @@ public class RemoteServerController { | ||
| 29 | @PostMapping("/getConstructionList") | 29 | @PostMapping("/getConstructionList") |
| 30 | public AjaxResult getConstructionList(){ | 30 | public AjaxResult getConstructionList(){ |
| 31 | JSONArray jsonArray = redisCache.getCacheObject("constructionList"); | 31 | JSONArray jsonArray = redisCache.getCacheObject("constructionList"); |
| 32 | - int i = 0; | ||
| 33 | - if(jsonArray==null||jsonArray.size()==0){ | ||
| 34 | - Map<String, Object> map = new HashMap<>(); | ||
| 35 | - map.put("size",999); | ||
| 36 | - map.put("page",1); | ||
| 37 | - while (true){ | ||
| 38 | - i++; | ||
| 39 | - jsonArray = RemoteServerUtils.getConstructionList(map,trashConfig.getToken()); | ||
| 40 | - if(jsonArray!=null&&jsonArray.size()>0) { | ||
| 41 | - break; | ||
| 42 | - } | ||
| 43 | - if(i==3){ | ||
| 44 | - return AjaxResult.error("获取工地列表失败!!!"); | ||
| 45 | - } | ||
| 46 | - sleep(500); | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - if(jsonArray!=null&&jsonArray.size()>0){ | ||
| 50 | - redisCache.setCacheObject("constructionList",jsonArray,1, TimeUnit.HOURS); | ||
| 51 | - } | ||
| 52 | - | 32 | + if(jsonArray==null){ |
| 33 | + return AjaxResult.error("获取工地列表失败!请稍后重试或联系管理员"); | ||
| 53 | } | 34 | } |
| 54 | return AjaxResult.success(jsonArray); | 35 | return AjaxResult.success(jsonArray); |
| 55 | } | 36 | } |
| @@ -57,27 +38,8 @@ public class RemoteServerController { | @@ -57,27 +38,8 @@ public class RemoteServerController { | ||
| 57 | @PostMapping("/getEarthSitesList") | 38 | @PostMapping("/getEarthSitesList") |
| 58 | public AjaxResult getEarthSitesList(){ | 39 | public AjaxResult getEarthSitesList(){ |
| 59 | JSONArray jsonArray = redisCache.getCacheObject("earthSitesList"); | 40 | JSONArray jsonArray = redisCache.getCacheObject("earthSitesList"); |
| 60 | - int i = 0; | ||
| 61 | - if(jsonArray==null||jsonArray.size()==0){ | ||
| 62 | - Map<String, Object> map = new HashMap<>(); | ||
| 63 | - map.put("size",999); | ||
| 64 | - map.put("page",1); | ||
| 65 | - while (true){ | ||
| 66 | - i++; | ||
| 67 | - jsonArray = RemoteServerUtils.getEarthSitesList(map,trashConfig.getToken()); | ||
| 68 | - if(jsonArray!=null&&jsonArray.size()>0) { | ||
| 69 | - break; | ||
| 70 | - } | ||
| 71 | - if(i==3){ | ||
| 72 | - return AjaxResult.error("获取消纳场列表失败!!!"); | ||
| 73 | - } | ||
| 74 | - sleep(500); | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | - if(jsonArray!=null&&jsonArray.size()>0) { | ||
| 78 | - redisCache.setCacheObject("earthSitesList",jsonArray,1, TimeUnit.HOURS); | ||
| 79 | - } | ||
| 80 | - | 41 | + if(jsonArray==null){ |
| 42 | + return AjaxResult.error("获取消纳场列表失败!请稍后重试或联系管理员"); | ||
| 81 | } | 43 | } |
| 82 | return AjaxResult.success(jsonArray); | 44 | return AjaxResult.success(jsonArray); |
| 83 | } | 45 | } |
| @@ -85,23 +47,8 @@ public class RemoteServerController { | @@ -85,23 +47,8 @@ public class RemoteServerController { | ||
| 85 | @PostMapping("/getAreaList") | 47 | @PostMapping("/getAreaList") |
| 86 | public AjaxResult getAreaList(){ | 48 | public AjaxResult getAreaList(){ |
| 87 | JSONArray jsonArray = redisCache.getCacheObject("areaList"); | 49 | JSONArray jsonArray = redisCache.getCacheObject("areaList"); |
| 88 | - int i = 1; | ||
| 89 | - if(jsonArray==null||jsonArray.size()==0){ | ||
| 90 | - while (true){ | ||
| 91 | - i++; | ||
| 92 | - jsonArray = RemoteServerUtils.getAreas(trashConfig.getToken()); | ||
| 93 | - if(jsonArray!=null&&jsonArray.size()>0) { | ||
| 94 | - break; | ||
| 95 | - } | ||
| 96 | - if(i==3){ | ||
| 97 | - return AjaxResult.error("获取区域列表失败!!!"); | ||
| 98 | - } | ||
| 99 | - sleep(500); | ||
| 100 | - } | ||
| 101 | - | ||
| 102 | - if(jsonArray!=null&&jsonArray.size()>0) { | ||
| 103 | - redisCache.setCacheObject("areaList", jsonArray, 1, TimeUnit.HOURS); | ||
| 104 | - } | 50 | + if(jsonArray==null){ |
| 51 | + return AjaxResult.error("获取区域列表失败!请稍后重试或联系管理员"); | ||
| 105 | } | 52 | } |
| 106 | return AjaxResult.success(jsonArray); | 53 | return AjaxResult.success(jsonArray); |
| 107 | } | 54 | } |
| @@ -109,25 +56,8 @@ public class RemoteServerController { | @@ -109,25 +56,8 @@ public class RemoteServerController { | ||
| 109 | @PostMapping("/getCompanyList") | 56 | @PostMapping("/getCompanyList") |
| 110 | public AjaxResult getCompanyList(){ | 57 | public AjaxResult getCompanyList(){ |
| 111 | JSONArray jsonArray = redisCache.getCacheObject("companyList"); | 58 | JSONArray jsonArray = redisCache.getCacheObject("companyList"); |
| 112 | - int i = 1; | ||
| 113 | - if(jsonArray==null||jsonArray.size()==0){ | ||
| 114 | - Map<String, Object> map = new HashMap<>(); | ||
| 115 | - map.put("size",999); | ||
| 116 | - map.put("page",1); | ||
| 117 | - while (true){ | ||
| 118 | - i++; | ||
| 119 | - jsonArray = RemoteServerUtils.getCompanyList(map,trashConfig.getToken()); | ||
| 120 | - if(jsonArray!=null&&jsonArray.size()>0) { | ||
| 121 | - break; | ||
| 122 | - } | ||
| 123 | - if(i==3){ | ||
| 124 | - return AjaxResult.error("获取公司列表失败!!!"); | ||
| 125 | - } | ||
| 126 | - sleep(500); | ||
| 127 | - } | ||
| 128 | - if(jsonArray!=null&&jsonArray.size()>0) { | ||
| 129 | - redisCache.setCacheObject("companyList", jsonArray, 1, TimeUnit.HOURS); | ||
| 130 | - } | 59 | + if(jsonArray==null){ |
| 60 | + return AjaxResult.error("获取公司列表失败!请稍后重试或联系管理员"); | ||
| 131 | } | 61 | } |
| 132 | return AjaxResult.success(jsonArray); | 62 | return AjaxResult.success(jsonArray); |
| 133 | } | 63 | } |
trash-workFlow/src/main/java/com/trash/casefile/kafka/Consumer.java
| @@ -83,23 +83,7 @@ public class Consumer { | @@ -83,23 +83,7 @@ public class Consumer { | ||
| 83 | JSONArray company1 = redisCache.getCacheObject("companyList"); | 83 | JSONArray company1 = redisCache.getCacheObject("companyList"); |
| 84 | JSONObject basevehicleInfo = RemoteServerUtils.getBasevehicleInfo(jsonObject.getString("vehicleId"),trashConfig.getToken()); | 84 | JSONObject basevehicleInfo = RemoteServerUtils.getBasevehicleInfo(jsonObject.getString("vehicleId"),trashConfig.getToken()); |
| 85 | if(company1==null){ | 85 | if(company1==null){ |
| 86 | - int i = 0; | ||
| 87 | - Map map = new HashMap<>(); | ||
| 88 | - map.put("size",9999); | ||
| 89 | - map.put("page",1); | ||
| 90 | - while (true){ | ||
| 91 | - company1 = RemoteServerUtils.getCompanyList(map, trashConfig.getToken()); | ||
| 92 | - if(company1!=null){ | ||
| 93 | - break; | ||
| 94 | - } | ||
| 95 | - i++; | ||
| 96 | - if(i==5){ | ||
| 97 | - throw new RuntimeException("获取公司列表失败5次!!!"); | ||
| 98 | - } | ||
| 99 | - Thread.sleep(500); | ||
| 100 | - } | ||
| 101 | - | ||
| 102 | - redisCache.setCacheObject("companyList",company1,1, TimeUnit.HOURS); | 86 | + throw new RuntimeException("获取公司列表失败!!!"); |
| 103 | } | 87 | } |
| 104 | 88 | ||
| 105 | //这两种类型无需累加 | 89 | //这两种类型无需累加 |
trash-workFlow/src/main/java/com/trash/workflow/listener/SupervisionListener.java
| @@ -23,13 +23,23 @@ public class SupervisionListener implements ExecutionListener { | @@ -23,13 +23,23 @@ public class SupervisionListener implements ExecutionListener { | ||
| 23 | 23 | ||
| 24 | @Override | 24 | @Override |
| 25 | public void notify(DelegateExecution delegateExecution) { | 25 | public void notify(DelegateExecution delegateExecution) { |
| 26 | - | 26 | + |
| 27 | List<Map> maps = new ArrayList<Map>(); | 27 | List<Map> maps = new ArrayList<Map>(); |
| 28 | - | ||
| 29 | - Map map = new HashMap(); | 28 | + |
| 29 | + Map<String,Object> map = new HashMap<>(); | ||
| 30 | 30 | ||
| 31 | map.put("id", delegateExecution.getProcessInstanceBusinessKey().split(":")[1]); | 31 | map.put("id", delegateExecution.getProcessInstanceBusinessKey().split(":")[1]); |
| 32 | - map.put("supervisionResult", state.getValue(delegateExecution).toString()); | 32 | + map.put("supervisionResult", 2); |
| 33 | + if(delegateExecution.getProcessDefinitionId().contains("gongdi")){ | ||
| 34 | + map.put("type",0); | ||
| 35 | + }else if(delegateExecution.getProcessInstanceBusinessKey().contains("xnc")){ | ||
| 36 | + map.put("type",1); | ||
| 37 | + }else if (delegateExecution.getProcessInstanceBusinessKey().contains("anjuan")){//案卷暂时不用 | ||
| 38 | + map.put("type",3); | ||
| 39 | + }else{ | ||
| 40 | + map.put("type",2); | ||
| 41 | + } | ||
| 42 | + | ||
| 33 | maps.add(map); | 43 | maps.add(map); |
| 34 | 44 | ||
| 35 | RemoteServerUtils.UpdateSupervisionStatus(maps); | 45 | RemoteServerUtils.UpdateSupervisionStatus(maps); |