Commit c9abcb960329215b70519c888be91e52daf4c9a2

Authored by youxiw2000
2 parents 7e7dcdfc 2a8e1fbe

Merge branch 'dev' of 192.168.168.245:youxiw20000/trash into dev

trash-common/src/main/java/com/trash/common/utils/RemoteServerUtils.java
@@ -47,6 +47,8 @@ public class RemoteServerUtils { @@ -47,6 +47,8 @@ public class RemoteServerUtils {
47 47
48 public static String UpdateConstruction= "/api/siteservice/cs/constructionsites/status"; 48 public static String UpdateConstruction= "/api/siteservice/cs/constructionsites/status";
49 49
  50 + public static String UpdateSupervision= "/api/gpsservice/cs/supervision/status/update";
  51 +
50 52
51 public static String CompanyListRequestPath = "/api/gpsservice/cs/companies/ledger/list"; 53 public static String CompanyListRequestPath = "/api/gpsservice/cs/companies/ledger/list";
52 54
@@ -70,6 +72,18 @@ public class RemoteServerUtils { @@ -70,6 +72,18 @@ public class RemoteServerUtils {
70 return list; 72 return list;
71 } 73 }
72 74
  75 + public static JSONArray getEarthSitesList(Map map,String token){
  76 + JSONArray list=null;
  77 + Object object = post(EarthSitesList,map,token);
  78 +
  79 + if(object != null){
  80 + JSONObject jsonObject = JSON.parseObject(object.toString());
  81 + list = jsonObject.getJSONArray("list");
  82 + }
  83 +
  84 + return list;
  85 + }
  86 +
73 public static JSONArray getConstructionList(Map map){ 87 public static JSONArray getConstructionList(Map map){
74 JSONArray list=null; 88 JSONArray list=null;
75 Object object = post(ConstructionList,map); 89 Object object = post(ConstructionList,map);
@@ -82,6 +96,18 @@ public class RemoteServerUtils { @@ -82,6 +96,18 @@ public class RemoteServerUtils {
82 return list; 96 return list;
83 } 97 }
84 98
  99 + public static JSONArray getConstructionList(Map map,String token){
  100 + JSONArray list=null;
  101 + Object object = post(ConstructionList,map,token);
  102 +
  103 + if(object != null){
  104 + JSONObject jsonObject = JSON.parseObject(object.toString());
  105 + list = jsonObject.getJSONArray("list");
  106 + }
  107 +
  108 + return list;
  109 + }
  110 +
85 public static JSONArray getTruckOnline(Map map){ 111 public static JSONArray getTruckOnline(Map map){
86 JSONArray turckList=null; 112 JSONArray turckList=null;
87 Object object = post(TruckStatusListRequestPath,map); 113 Object object = post(TruckStatusListRequestPath,map);
@@ -100,6 +126,12 @@ public class RemoteServerUtils { @@ -100,6 +126,12 @@ public class RemoteServerUtils {
100 126
101 return object; 127 return object;
102 } 128 }
  129 +
  130 + public static Object UpdateSupervisionStatus(List<Map> map){
  131 + Object object = post(UpdateSupervision,map);
  132 +
  133 + return object;
  134 + }
103 135
104 public static Object updateEarthSitesCreditAndStatus(List<Map> map){ 136 public static Object updateEarthSitesCreditAndStatus(List<Map> map){
105 JSONArray turckList=null; 137 JSONArray turckList=null;
trash-ui/src/views/business/threestep/threestepInfo.vue
@@ -64,7 +64,6 @@ @@ -64,7 +64,6 @@
64 <el-col :span="12"> 64 <el-col :span="12">
65 <el-form-item label="联系电话"> 65 <el-form-item label="联系电话">
66 <el-input v-model="infoData.phone" :maxlength="11" show-word-limit disabled /> 66 <el-input v-model="infoData.phone" :maxlength="11" show-word-limit disabled />
67 - </el-select>  
68 </el-form-item> 67 </el-form-item>
69 </el-col> 68 </el-col>
70 </el-row> 69 </el-row>
trash-ui/src/views/casefile/violationCaseFile/index.vue
@@ -662,6 +662,7 @@ export default { @@ -662,6 +662,7 @@ export default {
662 message: '上传文件大小不得超过20M!', 662 message: '上传文件大小不得超过20M!',
663 type: 'warning' 663 type: 'warning'
664 }); 664 });
  665 + fileList = fileList.splice(fileList.length - 1, 1);
665 } else { 666 } else {
666 //符合条件后进行添加 667 //符合条件后进行添加
667 this.fileEntityList = fileList 668 this.fileEntityList = fileList
trash-ui/src/views/casefile/violationWarningInformation/index.vue
@@ -624,6 +624,7 @@ export default { @@ -624,6 +624,7 @@ export default {
624 message: '上传文件大小不得超过20M!', 624 message: '上传文件大小不得超过20M!',
625 type: 'warning' 625 type: 'warning'
626 }); 626 });
  627 + fileList = fileList.splice(fileList.length - 1, 1);
627 } else { 628 } else {
628 //符合条件后进行添加 629 //符合条件后进行添加
629 this.fileEntityList = fileList 630 this.fileEntityList = fileList
trash-ui/src/views/casefile/violationWarningInformation/violationWarningInformationInfo.vue
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
83 <el-row> 83 <el-row>
84 <el-col :span="22"> 84 <el-col :span="22">
85 <el-form-item label="违规描述" prop="describe"> 85 <el-form-item label="违规描述" prop="describe">
86 - <el-input v-model="form.describe" type="textarea" placeholder="请输入内容" :rows="5" :disabled="true"/> 86 + <el-input v-model="form.describe" type="textarea" placeholder="请输入内容" :rows="5" :disabled="true"style="white-space: pre-line"/>
87 </el-form-item> 87 </el-form-item>
88 </el-col> 88 </el-col>
89 </el-row> 89 </el-row>
trash-ui/src/views/h5/leaveApplication/index.vue
@@ -509,6 +509,7 @@ export default { @@ -509,6 +509,7 @@ export default {
509 message: '上传文件大小不得超过5M!', 509 message: '上传文件大小不得超过5M!',
510 type: 'warning' 510 type: 'warning'
511 }); 511 });
  512 + fileList = fileList.splice(fileList.length - 1, 1);
512 } else { 513 } else {
513 //符合条件后进行添加 514 //符合条件后进行添加
514 this.fileEntityList = fileList 515 this.fileEntityList = fileList
trash-ui/src/views/h5/violationCaseFile/index.vue
@@ -627,6 +627,7 @@ export default { @@ -627,6 +627,7 @@ export default {
627 message: '上传文件大小不得超过20M!', 627 message: '上传文件大小不得超过20M!',
628 type: 'warning' 628 type: 'warning'
629 }); 629 });
  630 + fileList = fileList.splice(fileList.length - 1, 1);
630 } else { 631 } else {
631 //符合条件后进行添加 632 //符合条件后进行添加
632 this.fileEntityList = fileList 633 this.fileEntityList = fileList
trash-ui/src/views/h5/violationWarningInformation/index.vue
@@ -565,6 +565,7 @@ export default { @@ -565,6 +565,7 @@ export default {
565 message: '上传文件大小不得超过20M!', 565 message: '上传文件大小不得超过20M!',
566 type: 'warning' 566 type: 'warning'
567 }); 567 });
  568 + fileList = fileList.splice(fileList.length - 1, 1);
568 } else { 569 } else {
569 //符合条件后进行添加 570 //符合条件后进行添加
570 this.fileEntityList = fileList 571 this.fileEntityList = fileList
trash-ui/src/views/office/handle/index.vue
@@ -110,18 +110,18 @@ @@ -110,18 +110,18 @@
110 </template> 110 </template>
111 </el-table-column> 111 </el-table-column>
112 <el-table-column label="公文类" align="center"> 112 <el-table-column label="公文类" align="center">
113 - <el-table-column label="来文单位" align="center" prop="company" show-overflow-tooltip="true"/> 113 + <el-table-column label="来文单位" align="center" prop="company" :show-overflow-tooltip="true"/>
114 <el-table-column label="收文时间" align="center" prop="receiveTime" width="180"> 114 <el-table-column label="收文时间" align="center" prop="receiveTime" width="180">
115 <template slot-scope="scope"> 115 <template slot-scope="scope">
116 <span>{{ parseTime(scope.row.receiveTime, '{y}-{m}-{d}') }}</span> 116 <span>{{ parseTime(scope.row.receiveTime, '{y}-{m}-{d}') }}</span>
117 </template> 117 </template>
118 </el-table-column> 118 </el-table-column>
119 - <el-table-column label="文件标题" align="center" prop="title" show-overflow-tooltip="true"/> 119 + <el-table-column label="文件标题" align="center" prop="title" :show-overflow-tooltip="true"/>
120 </el-table-column> 120 </el-table-column>
121 <el-table-column label="信访类" align="center"> 121 <el-table-column label="信访类" align="center">
122 - <el-table-column label="信访单位(人)" align="center" prop="sendPerson" show-overflow-tooltip="true"/> 122 + <el-table-column label="信访单位(人)" align="center" prop="sendPerson" :show-overflow-tooltip="true"/>
123 <el-table-column label="信访日期" align="center" prop="sendDate" /> 123 <el-table-column label="信访日期" align="center" prop="sendDate" />
124 - <el-table-column label="诉求" align="center" prop="appeal" show-overflow-tooltip="true"/> 124 + <el-table-column label="诉求" align="center" prop="appeal" :show-overflow-tooltip="true"/>
125 </el-table-column> 125 </el-table-column>
126 <el-table-column label="审批状态" align="center" prop="status"> 126 <el-table-column label="审批状态" align="center" prop="status">
127 <template slot-scope="scope"> 127 <template slot-scope="scope">
@@ -406,8 +406,6 @@ export default { @@ -406,8 +406,6 @@ export default {
406 this.idInfo = row.id+""; 406 this.idInfo = row.id+"";
407 this.openInfo = true; 407 this.openInfo = true;
408 this.title = "办文办事详情"; 408 this.title = "办文办事详情";
409 -  
410 - console.log(row.type);  
411 if(row.type==0){ 409 if(row.type==0){
412 this.businessKey = 'yuelanxuexi1'; 410 this.businessKey = 'yuelanxuexi1';
413 }else if(row.type==1){ 411 }else if(row.type==1){
@@ -501,6 +499,7 @@ export default { @@ -501,6 +499,7 @@ export default {
501 * 大小不超过5M 499 * 大小不超过5M
502 * */ 500 * */
503 fileChange(file, fileList) { 501 fileChange(file, fileList) {
  502 + console.log(fileList)
504 let count = 0; 503 let count = 0;
505 for (let i = 0; i < fileList.length; i++) { 504 for (let i = 0; i < fileList.length; i++) {
506 // console.log(fileList.length) 505 // console.log(fileList.length)
@@ -532,6 +531,7 @@ export default { @@ -532,6 +531,7 @@ export default {
532 message: '上传文件大小不得超过5M!', 531 message: '上传文件大小不得超过5M!',
533 type: 'warning' 532 type: 'warning'
534 }); 533 });
  534 + fileList = fileList.splice(fileList.length - 1, 1);
535 } else { 535 } else {
536 //符合条件后进行添加 536 //符合条件后进行添加
537 this.fileEntityList = fileList 537 this.fileEntityList = fileList
trash-ui/src/views/office/handleAffairsCommon/index.vue
@@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
5 <el-input 5 <el-input
6 v-model="queryParams.company" 6 v-model="queryParams.company"
7 placeholder="请输入来文单位" 7 placeholder="请输入来文单位"
8 - 8 +
9 size="small" 9 size="small"
10 - 10 +
11 /> 11 />
12 </el-form-item> 12 </el-form-item>
13 <el-form-item label="收文时间" prop="receiveTime"> 13 <el-form-item label="收文时间" prop="receiveTime">
@@ -445,6 +445,7 @@ export default { @@ -445,6 +445,7 @@ export default {
445 message: '上传文件大小不得超过5M!', 445 message: '上传文件大小不得超过5M!',
446 type: 'warning' 446 type: 'warning'
447 }); 447 });
  448 + fileList = fileList.splice(fileList.length - 1, 1);
448 } else { 449 } else {
449 //符合条件后进行添加 450 //符合条件后进行添加
450 this.fileEntityList = fileList 451 this.fileEntityList = fileList
trash-ui/src/views/office/handleAffairsXF/index.vue
@@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
5 <el-input 5 <el-input
6 v-model="queryParams.company" 6 v-model="queryParams.company"
7 placeholder="请输入信访单位(人)" 7 placeholder="请输入信访单位(人)"
8 - 8 +
9 size="small" 9 size="small"
10 - 10 +
11 /> 11 />
12 </el-form-item> 12 </el-form-item>
13 <el-form-item label="信访日期" prop="receiveDate"> 13 <el-form-item label="信访日期" prop="receiveDate">
@@ -439,6 +439,7 @@ export default { @@ -439,6 +439,7 @@ export default {
439 message: '上传文件大小不得超过5M!', 439 message: '上传文件大小不得超过5M!',
440 type: 'warning' 440 type: 'warning'
441 }); 441 });
  442 + fileList = fileList.splice(fileList.length - 1, 1);
442 } else { 443 } else {
443 //符合条件后进行添加 444 //符合条件后进行添加
444 this.fileEntityList = fileList 445 this.fileEntityList = fileList
trash-ui/src/views/office/leaveApplication/index.vue
@@ -518,6 +518,7 @@ export default { @@ -518,6 +518,7 @@ export default {
518 message: '上传文件大小不得超过5M!', 518 message: '上传文件大小不得超过5M!',
519 type: 'warning' 519 type: 'warning'
520 }); 520 });
  521 + fileList = fileList.splice(fileList.length - 1, 1);
521 } else { 522 } else {
522 //符合条件后进行添加 523 //符合条件后进行添加
523 this.fileEntityList = fileList 524 this.fileEntityList = fileList
trash-ui/src/views/office/management/index.vue
@@ -559,6 +559,7 @@ export default { @@ -559,6 +559,7 @@ export default {
559 message: '上传文件大小不得超过5M!', 559 message: '上传文件大小不得超过5M!',
560 type: 'warning' 560 type: 'warning'
561 }); 561 });
  562 + fileList = fileList.splice(fileList.length - 1, 1);
562 } else { 563 } else {
563 //符合条件后进行添加 564 //符合条件后进行添加
564 this.fileEntityList = fileList 565 this.fileEntityList = fileList
trash-workFlow/src/main/java/com/trash/casefile/controller/RemoteServerController.java
1 package com.trash.casefile.controller; 1 package com.trash.casefile.controller;
2 2
3 import com.alibaba.fastjson.JSONArray; 3 import com.alibaba.fastjson.JSONArray;
  4 +import com.trash.common.config.trashConfig;
4 import com.trash.common.core.domain.AjaxResult; 5 import com.trash.common.core.domain.AjaxResult;
5 import com.trash.common.core.redis.RedisCache; 6 import com.trash.common.core.redis.RedisCache;
6 import com.trash.common.utils.RemoteServerUtils; 7 import com.trash.common.utils.RemoteServerUtils;
@@ -13,6 +14,8 @@ import java.util.HashMap; @@ -13,6 +14,8 @@ import java.util.HashMap;
13 import java.util.Map; 14 import java.util.Map;
14 import java.util.concurrent.TimeUnit; 15 import java.util.concurrent.TimeUnit;
15 16
  17 +import static com.trash.common.utils.Threads.sleep;
  18 +
16 @RestController 19 @RestController
17 @RequestMapping("/remoteServer") 20 @RequestMapping("/remoteServer")
18 public class RemoteServerController { 21 public class RemoteServerController {
@@ -20,14 +23,29 @@ public class RemoteServerController { @@ -20,14 +23,29 @@ public class RemoteServerController {
20 @Autowired 23 @Autowired
21 RedisCache redisCache; 24 RedisCache redisCache;
22 25
  26 + @Autowired
  27 + trashConfig trashConfig;
  28 +
23 @PostMapping("/getConstructionList") 29 @PostMapping("/getConstructionList")
24 public AjaxResult getConstructionList(){ 30 public AjaxResult getConstructionList(){
25 JSONArray jsonArray = redisCache.getCacheObject("constructionList"); 31 JSONArray jsonArray = redisCache.getCacheObject("constructionList");
  32 + int i = 0;
26 if(jsonArray==null||jsonArray.size()==0){ 33 if(jsonArray==null||jsonArray.size()==0){
27 Map<String, Object> map = new HashMap<>(); 34 Map<String, Object> map = new HashMap<>();
28 map.put("size",999); 35 map.put("size",999);
29 map.put("page",1); 36 map.put("page",1);
30 - jsonArray = RemoteServerUtils.getConstructionList(map); 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 +
31 if(jsonArray!=null&&jsonArray.size()>0){ 49 if(jsonArray!=null&&jsonArray.size()>0){
32 redisCache.setCacheObject("constructionList",jsonArray,1, TimeUnit.HOURS); 50 redisCache.setCacheObject("constructionList",jsonArray,1, TimeUnit.HOURS);
33 } 51 }
@@ -39,11 +57,23 @@ public class RemoteServerController { @@ -39,11 +57,23 @@ public class RemoteServerController {
39 @PostMapping("/getEarthSitesList") 57 @PostMapping("/getEarthSitesList")
40 public AjaxResult getEarthSitesList(){ 58 public AjaxResult getEarthSitesList(){
41 JSONArray jsonArray = redisCache.getCacheObject("earthSitesList"); 59 JSONArray jsonArray = redisCache.getCacheObject("earthSitesList");
  60 + int i = 0;
42 if(jsonArray==null||jsonArray.size()==0){ 61 if(jsonArray==null||jsonArray.size()==0){
43 Map<String, Object> map = new HashMap<>(); 62 Map<String, Object> map = new HashMap<>();
44 map.put("size",999); 63 map.put("size",999);
45 map.put("page",1); 64 map.put("page",1);
46 - jsonArray = RemoteServerUtils.getEarthSitesList(map); 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 +
47 if(jsonArray!=null&&jsonArray.size()>0) { 77 if(jsonArray!=null&&jsonArray.size()>0) {
48 redisCache.setCacheObject("earthSitesList",jsonArray,1, TimeUnit.HOURS); 78 redisCache.setCacheObject("earthSitesList",jsonArray,1, TimeUnit.HOURS);
49 } 79 }
@@ -55,8 +85,20 @@ public class RemoteServerController { @@ -55,8 +85,20 @@ public class RemoteServerController {
55 @PostMapping("/getAreaList") 85 @PostMapping("/getAreaList")
56 public AjaxResult getAreaList(){ 86 public AjaxResult getAreaList(){
57 JSONArray jsonArray = redisCache.getCacheObject("areaList"); 87 JSONArray jsonArray = redisCache.getCacheObject("areaList");
  88 + int i = 1;
58 if(jsonArray==null||jsonArray.size()==0){ 89 if(jsonArray==null||jsonArray.size()==0){
59 - jsonArray = RemoteServerUtils.getAreas(); 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 +
60 if(jsonArray!=null&&jsonArray.size()>0) { 102 if(jsonArray!=null&&jsonArray.size()>0) {
61 redisCache.setCacheObject("areaList", jsonArray, 1, TimeUnit.HOURS); 103 redisCache.setCacheObject("areaList", jsonArray, 1, TimeUnit.HOURS);
62 } 104 }
@@ -67,11 +109,22 @@ public class RemoteServerController { @@ -67,11 +109,22 @@ public class RemoteServerController {
67 @PostMapping("/getCompanyList") 109 @PostMapping("/getCompanyList")
68 public AjaxResult getCompanyList(){ 110 public AjaxResult getCompanyList(){
69 JSONArray jsonArray = redisCache.getCacheObject("companyList"); 111 JSONArray jsonArray = redisCache.getCacheObject("companyList");
  112 + int i = 1;
70 if(jsonArray==null||jsonArray.size()==0){ 113 if(jsonArray==null||jsonArray.size()==0){
71 Map<String, Object> map = new HashMap<>(); 114 Map<String, Object> map = new HashMap<>();
72 map.put("size",999); 115 map.put("size",999);
73 map.put("page",1); 116 map.put("page",1);
74 - jsonArray = RemoteServerUtils.getCompanyList(map); 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 + }
75 if(jsonArray!=null&&jsonArray.size()>0) { 128 if(jsonArray!=null&&jsonArray.size()>0) {
76 redisCache.setCacheObject("companyList", jsonArray, 1, TimeUnit.HOURS); 129 redisCache.setCacheObject("companyList", jsonArray, 1, TimeUnit.HOURS);
77 } 130 }
trash-workFlow/src/main/java/com/trash/casefile/kafka/Consumer.java
@@ -34,7 +34,7 @@ public class Consumer { @@ -34,7 +34,7 @@ public class Consumer {
34 private IViolationWarningInformationService violationWarningInformationService; 34 private IViolationWarningInformationService violationWarningInformationService;
35 35
36 @KafkaListener(topics = "record_process_alarm") 36 @KafkaListener(topics = "record_process_alarm")
37 - public void consume(@Payload String data) { 37 + public void consume(@Payload String data) throws InterruptedException {
38 log.info("kafka消费数据成功,data:" + data); 38 log.info("kafka消费数据成功,data:" + data);
39 autoViolationWarning(data); 39 autoViolationWarning(data);
40 } 40 }
@@ -48,14 +48,26 @@ public class Consumer { @@ -48,14 +48,26 @@ public class Consumer {
48 @Autowired 48 @Autowired
49 RedisCache redisCache; 49 RedisCache redisCache;
50 50
51 - public void autoViolationWarning(String data) { 51 + public void autoViolationWarning(String data) throws InterruptedException {
52 String[] code = {"44030020=工地预警-未报开工作业", "44030021=工地预警-视频设备离线超时报警", "44030022=工地预警-三无车辆进入工地", "44030023=工地预警未按时间作业", 52 String[] code = {"44030020=工地预警-未报开工作业", "44030021=工地预警-视频设备离线超时报警", "44030022=工地预警-三无车辆进入工地", "44030023=工地预警未按时间作业",
53 "44030024=消纳场预警-未报开工作业", "44030025=消纳场预警-视频设备离线超时报警", "44030026=消纳场预警-三无车辆进入消纳场", "44030027=消纳场预警-未到指定的消纳场作业", 53 "44030024=消纳场预警-未报开工作业", "44030025=消纳场预警-视频设备离线超时报警", "44030026=消纳场预警-三无车辆进入消纳场", "44030027=消纳场预警-未到指定的消纳场作业",
54 "44030028=离线运输报警(工)", "44030029=离线运输报警(消)", "44030030=未激活车辆作业", "44030031=未核准作业车辆作业", "44030032=未按线路行驶", 54 "44030028=离线运输报警(工)", "44030029=离线运输报警(消)", "44030030=未激活车辆作业", "44030031=未核准作业车辆作业", "44030032=未按线路行驶",
55 "44030033=闯禁行驶", "44030034=失信车辆作业"}; 55 "44030033=闯禁行驶", "44030034=失信车辆作业"};
56 JSONObject jsonObject = JSONObject.parseObject(data); 56 JSONObject jsonObject = JSONObject.parseObject(data);
57 - String nowDate = DateFormatUtils.format(new Date(), "yyyy-MM-dd");  
58 - String tomorrowDate = DateFormatUtils.format(DateUtils.addDays(new Date(), 1), "yyyy-MM-dd"); 57 + //q:获取当前时间
  58 + String nowHour = DateFormatUtils.format(new Date(), "HH");
  59 + String nowDate = null;
  60 + String tomorrowDate = null;
  61 + if(Integer.valueOf(nowHour)<8){
  62 + nowDate = DateFormatUtils.format(DateUtils.addDays(new Date(), -1), "yyyy-MM-dd");
  63 + tomorrowDate = DateFormatUtils.format(new Date(), "yyyy-MM-dd");
  64 + }else{
  65 + nowDate = DateFormatUtils.format(new Date(), "yyyy-MM-dd");
  66 + tomorrowDate = DateFormatUtils.format(DateUtils.addDays(new Date(), 1), "yyyy-MM-dd");
  67 + }
  68 +
  69 +
  70 +
59 String violationType = jsonObject.getString("alarmName"); 71 String violationType = jsonObject.getString("alarmName");
60 if(RemoteServerUtils.remote==null){ 72 if(RemoteServerUtils.remote==null){
61 //登录 73 //登录
@@ -66,10 +78,22 @@ public class Consumer { @@ -66,10 +78,22 @@ public class Consumer {
66 JSONArray company1 = redisCache.getCacheObject("companyList"); 78 JSONArray company1 = redisCache.getCacheObject("companyList");
67 JSONObject basevehicleInfo = RemoteServerUtils.getBasevehicleInfo(jsonObject.getString("vehicleId"),trashConfig.getToken()); 79 JSONObject basevehicleInfo = RemoteServerUtils.getBasevehicleInfo(jsonObject.getString("vehicleId"),trashConfig.getToken());
68 if(company1==null){ 80 if(company1==null){
  81 + int i = 0;
69 Map map = new HashMap<>(); 82 Map map = new HashMap<>();
70 map.put("size",9999); 83 map.put("size",9999);
71 map.put("page",1); 84 map.put("page",1);
72 - company1 = RemoteServerUtils.getCompanyList(map, trashConfig.getToken()); 85 + while (true){
  86 + company1 = RemoteServerUtils.getCompanyList(map, trashConfig.getToken());
  87 + if(company1!=null){
  88 + break;
  89 + }
  90 + i++;
  91 + if(i==5){
  92 + throw new RuntimeException("获取公司列表失败5次!!!");
  93 + }
  94 + Thread.sleep(500);
  95 + }
  96 +
73 redisCache.setCacheObject("companyList",company1,1, TimeUnit.HOURS); 97 redisCache.setCacheObject("companyList",company1,1, TimeUnit.HOURS);
74 } 98 }
75 99
trash-workFlow/src/main/java/com/trash/workflow/listener/SupervisionListener.java 0 → 100644
  1 +package com.trash.workflow.listener;
  2 +
  3 +import com.trash.common.utils.RemoteServerUtils;
  4 +import com.trash.workflow.service.IWorkflowService;
  5 +import org.activiti.engine.delegate.DelegateExecution;
  6 +import org.activiti.engine.delegate.ExecutionListener;
  7 +import org.activiti.engine.delegate.Expression;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +
  10 +import java.util.ArrayList;
  11 +import java.util.HashMap;
  12 +import java.util.List;
  13 +import java.util.Map;
  14 +
  15 +
  16 +public class SupervisionListener implements ExecutionListener {
  17 +
  18 + private Expression state;
  19 +
  20 + @Autowired
  21 + IWorkflowService workflowService;
  22 +
  23 +
  24 + @Override
  25 + public void notify(DelegateExecution delegateExecution) {
  26 +
  27 + List<Map> maps = new ArrayList<Map>();
  28 +
  29 + Map map = new HashMap();
  30 +
  31 + map.put("id", delegateExecution.getProcessInstanceBusinessKey().split(":")[1]);
  32 + map.put("supervisionResult", state.getValue(delegateExecution).toString());
  33 + maps.add(map);
  34 +
  35 + RemoteServerUtils.UpdateSupervisionStatus(maps);
  36 +
  37 + workflowUtils.sendDataToHisTory(delegateExecution, state);
  38 +
  39 +
  40 + System.out.println("纪检督察流程状态更新 更新ID:" + delegateExecution.getProcessInstanceBusinessKey() + "状态:" + state.getValue(delegateExecution).toString());
  41 + }
  42 +
  43 +
  44 +
  45 +}