Commit 982959cf1f44262c7dec82f7995d61752cd11d9b

Authored by youxiw2000
1 parent b507aac8

m

trash-framework/src/main/java/com/trash/framework/web/service/SysLoginService.java
... ... @@ -221,7 +221,9 @@ public class SysLoginService
221 221 JSONObject con = (JSONObject) obj;
222 222  
223 223 if(con.getString("abbreviation").equals(user.getUserName().replace("公司", ""))){
224   - user.setCompanyName(con.getString("name"));;
  224 + user.setCompanyName(con.getString("name"));
  225 + user.setUserName(con.getString("abbreviation"));
  226 + user.setNickName(con.getString("abbreviation"));
225 227 break;
226 228 }
227 229  
... ...
trash-quartz/src/main/java/com/trash/quartz/task/DriverTask.java
... ... @@ -43,79 +43,72 @@ import com.trash.workflow.service.IWorkflowService;
43 43 * @author trash
44 44 */
45 45 @Component("DriverTask")
46   -public class DriverTask
47   -{
  46 +public class DriverTask {
48 47  
49 48 String TOKEN;
50 49  
51   - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
52   - /** 系统基础配置 */
53   - @Autowired
54   - private trashConfig trashConfig;
  50 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  51 + /** 系统基础配置 */
  52 + @Autowired
  53 + private trashConfig trashConfig;
55 54  
56 55 @Autowired
57 56 private RedisCache redisCache;
58 57  
59   - public void checkCredit(){
  58 + public void checkCredit() {
60 59  
61   - if(RemoteServerUtils.remote == null){
62   - RemoteServerUtils.remote = trashConfig.getRemotePath();
63   - }
64   - if(TOKEN == null){
65   - TOKEN = trashConfig.getToken();
66   - }
  60 + if (RemoteServerUtils.remote == null) {
  61 + RemoteServerUtils.remote = trashConfig.getRemotePath();
  62 + }
  63 + if (TOKEN == null) {
  64 + TOKEN = trashConfig.getToken();
  65 + }
67 66  
68   - LogUtils.getBlock("=================== checkCredit 定时器执行 当前时间: " + simpleDateFormat.format(new Date()));
69   -
70   -
  67 + LogUtils.getBlock("=================== checkCredit 定时器执行 当前时间: " + simpleDateFormat.format(new Date()));
71 68  
72   - try {
73   - checkTruckActive();
  69 + try {
  70 + checkTruckActive();
74 71 } catch (Exception e) {
75 72 e.printStackTrace();
76 73 }
77   -
78   - }
79   -
80 74  
81   - @SuppressWarnings("deprecation")
  75 + }
  76 +
  77 + @SuppressWarnings("deprecation")
82 78 private void checkTruckActive() {
83   - if(TOKEN == null){
84   - TOKEN = trashConfig.getToken();
85   - }
86   - try {
87   - SpringUtils.getBean(ISupervisionThreestepService.class).checkDataToActiveTruck(TOKEN);
  79 + if (TOKEN == null) {
  80 + TOKEN = trashConfig.getToken();
  81 + }
  82 + try {
  83 + SpringUtils.getBean(ISupervisionThreestepService.class).checkDataToActiveTruck(TOKEN);
88 84 } catch (Exception e) {
89 85 // TODO: handle exception
90 86 }
91   -
92 87  
93 88 }
94 89  
95   -
96   -
97 90 private void checkDriverCredit() {
98 91  
99 92 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
100   - if(RemoteServerUtils.remote == null){
101   - RemoteServerUtils.remote = trashConfig.getRemotePath();
102   - }
103   - if(TOKEN == null){
104   - TOKEN = trashConfig.getToken();
105   - }
106   -
107   - JSONArray drivers = RemoteServerUtils.getDriverList(TOKEN);
108   -
109   -
110   - for(Object object :drivers){
111   -
112   - JSONObject json = (JSONObject)object;
113   -
  93 + if (RemoteServerUtils.remote == null) {
  94 + RemoteServerUtils.remote = trashConfig.getRemotePath();
  95 + }
  96 + if (TOKEN == null) {
  97 + TOKEN = trashConfig.getToken();
  98 + }
  99 +
  100 + JSONArray drivers = RemoteServerUtils.getDriverList(TOKEN);
  101 +
  102 + for (Object object : drivers) {
  103 +
  104 + JSONObject json = (JSONObject) object;
  105 +
114 106 try {
115   - if(sdf.parse(json.getString("endAt")).getTime() < sdf.parse(sdf.format(new Date())).getTime() ||
116   - sdf.parse(json.getString("qualificationCertValidEndAt")).getTime() < sdf.parse(sdf.format(new Date())).getTime()){
  107 + if (sdf.parse(json.getString("endAt")).getTime() < sdf.parse(sdf.format(new Date())).getTime()
  108 + || sdf.parse(json.getString("qualificationCertValidEndAt")).getTime() < sdf
  109 + .parse(sdf.format(new Date())).getTime()) {
117 110 DriverCredit driver = new DriverCredit();
118   -
  111 +
119 112 driver.setIdNumber(json.getString("identityNo"));
120 113 driver.setName(json.getString("name"));
121 114 driver.setCreateBy("长沙市建筑垃圾智慧监管平台");
... ... @@ -123,7 +116,6 @@ public class DriverTask
123 116 driver.setTime(new Date());
124 117 driver.setStatus(0L);
125 118 driver.setObjectId(json.getString("id"));
126   -
127 119  
128 120 SpringUtils.getBean(IDriverCreditService.class).insertDriverCredit(driver);
129 121 }
... ... @@ -131,51 +123,52 @@ public class DriverTask
131 123 // TODO Auto-generated catch block
132 124 e.printStackTrace();
133 125 }
134   -
135   - }
136   -
137   - }
138   -
139 126  
  127 + }
  128 +
  129 + }
140 130  
141 131 @SuppressWarnings({ "unchecked", "rawtypes" })
142 132 private void checkTruckCredit() {
143 133  
144 134 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
145 135 Map map = new HashMap<>();
146   - map.put("size",9999);
147   - map.put("valid",0);
148   - map.put("page",1);
149   -
150   - JSONArray trucks = RemoteServerUtils.getTruckList(map,TOKEN);
151   -
152   - List<Map> listParam = new ArrayList<Map>();
153   -
154   - if(trucks!=null){
155   - for(Object jsonObject:trucks){
156   - JSONObject truck = (JSONObject)jsonObject;
157   -
158   - try {
159   - if(sdf.parse(truck.getString("transportCertValid")).getTime() < sdf.parse(sdf.format(new Date())).getTime() ||
160   - sdf.parse(truck.getString("licenseValid")).getTime() < sdf.parse(sdf.format(new Date())).getTime()){
161   -
  136 + map.put("size", 9999);
  137 + map.put("valid", 0);
  138 + map.put("page", 1);
  139 +
  140 + JSONArray trucks = RemoteServerUtils.getTruckList(map, TOKEN);
  141 +
  142 + List<Map> listParam = new ArrayList<Map>();
  143 +
  144 + if (trucks != null) {
  145 + for (Object jsonObject : trucks) {
  146 + JSONObject truck = (JSONObject) jsonObject;
  147 +
  148 + try {
  149 + if (sdf.parse(truck.getString("transportCertValid")).getTime() < sdf.parse(sdf.format(new Date()))
  150 + .getTime()
  151 + || sdf.parse(truck.getString("licenseValid")).getTime() < sdf.parse(sdf.format(new Date()))
  152 + .getTime()) {
  153 +
162 154 TruckCredit truckCredit = new TruckCredit();
163 155 truckCredit.setTime(new Date());
164 156 truckCredit.setCreateBy("长沙市建筑垃圾智慧监管平台");
165   - truckCredit.setReason("道路运输证有效期:"+truck.getString("transportCertValid") + " 行驶证有效期:" + truck.getString("licenseValid") + ",证件过期");
  157 + truckCredit.setReason("道路运输证有效期:" + truck.getString("transportCertValid") + " 行驶证有效期:"
  158 + + truck.getString("licenseValid") + ",证件过期");
166 159 truckCredit.setLostCredit(1L);
167 160 truckCredit.setObjectId(truck.getString("id"));
168 161 truckCredit.setLicensePlate(truck.getString("licenseplateNo"));
169 162 truckCredit.setCompanyId(truck.getString("companyName"));
170 163 truckCredit.setStatus(0L);
171   -
  164 +
172 165 Map param = new HashMap<>();
173   -
  166 +
174 167 param.put("id", truck.getString("id"));
175 168 param.put("creditStatus", 1);
176   -
  169 +
177 170 listParam.add(param);
178   -
  171 +
179 172 SpringUtils.getBean(ITruckCreditService.class).insertTruckCredit(truckCredit);
180 173 }
181 174 } catch (BeansException e) {
... ... @@ -188,182 +181,200 @@ public class DriverTask
188 181 // TODO Auto-generated catch block
189 182 e.printStackTrace();
190 183 }
191   - }
192   -
193   - if(listParam.size() > 0)
194   - RemoteServerUtils.updateTruckList(listParam,TOKEN);
195   -
196   - }
197   -
198   - }
199   -
  184 + }
  185 +
  186 + if (listParam.size() > 0)
  187 + RemoteServerUtils.updateTruckList(listParam, TOKEN);
  188 +
  189 + }
  190 +
  191 + }
  192 +
200 193 public void checkCompanyCredit() {
201   - try {
202   - checkTruckCredit();
  194 + try {
  195 + checkTruckCredit();
203 196 } catch (Exception e) {
204 197 e.printStackTrace();
205 198 }
206   -
207   - try {
208   - checkDriverCredit(); //检查驾驶员信用
  199 +
  200 + try {
  201 + checkDriverCredit(); // 检查驾驶员信用
209 202 } catch (Exception e) {
210 203 e.printStackTrace();
211   - }
  204 + }
212 205  
213 206 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
214   -
215   - Map map = new HashMap<>();
216   - map.put("size",9999);
217   - map.put("page",1);
218   -
219   - JSONArray companys = RemoteServerUtils.getCompanyList(map,TOKEN);
220   - if(companys != null){
221   - for(Object jsonObject:companys){
222   - JSONObject company = (JSONObject)jsonObject;
223   - try {
224   - if(sdf.parse(company.getString("registrationValidTime")).getTime() < sdf.parse(sdf.format(new Date())).getTime()
225   - || sdf.parse(company.getString("businessLicenseValidTime")).getTime() < sdf.parse(sdf.format(new Date())).getTime()){
226   - CompanyCredit companyCredit = new CompanyCredit();
227   - companyCredit.setTime(new Date());
228   - companyCredit.setCreateBy("长沙市建筑垃圾智慧监管平台");
229   - companyCredit.setReason("企业道路运输经营许可证有效期:" + company.getString("businessLicenseValidTime") + " 企业营业执照有效期:" + company.getString("registrationValidTime") + ",证件过期");
230   - companyCredit.setLostCredit(1L);
231   - companyCredit.setObjectId(company.getString("id"));
232   - companyCredit.setName(company.getString("name"));
233   - companyCredit.setPlace(company.getString("areaName"));
234   - companyCredit.setStatus(0L);
235   - SpringUtils.getBean(ICompanyCreditService.class).insertCompanyCredit(companyCredit,TOKEN);
236   - }
  207 +
  208 + Map map = new HashMap<>();
  209 + map.put("size", 9999);
  210 + map.put("page", 1);
  211 +
  212 + JSONArray companys = RemoteServerUtils.getCompanyList(map, TOKEN);
  213 + if (companys != null) {
  214 + for (Object jsonObject : companys) {
  215 + JSONObject company = (JSONObject) jsonObject;
  216 + try {
  217 + if (sdf.parse(company.getString("registrationValidTime")).getTime() < sdf
  218 + .parse(sdf.format(new Date())).getTime()
  219 + || sdf.parse(company.getString("businessLicenseValidTime")).getTime() < sdf
  220 + .parse(sdf.format(new Date())).getTime()) {
  221 + CompanyCredit companyCredit = new CompanyCredit();
  222 + companyCredit.setTime(new Date());
  223 + companyCredit.setCreateBy("长沙市建筑垃圾智慧监管平台");
  224 + companyCredit.setReason("企业道路运输经营许可证有效期:" + company.getString("businessLicenseValidTime")
  225 + + " 企业营业执照有效期:" + company.getString("registrationValidTime") + ",证件过期");
  226 + companyCredit.setLostCredit(1L);
  227 + companyCredit.setObjectId(company.getString("id"));
  228 + companyCredit.setName(company.getString("name"));
  229 + companyCredit.setPlace(company.getString("areaName"));
  230 + companyCredit.setStatus(0L);
  231 + SpringUtils.getBean(ICompanyCreditService.class).insertCompanyCredit(companyCredit, TOKEN);
  232 + }
237 233 } catch (Exception e) {
238 234 e.printStackTrace();
239 235 }
240   -
241   - }
242   - }
243   -
244   - CompanyCredit companyCredit = new CompanyCredit();
245   - companyCredit.setLostCredit(1L);
246   - companyCredit.setStatus(0L);
247   -
248   - List<CompanyCredit> companyList = SpringUtils.getBean(CompanyCreditMapper.class).selectCompanyCreditList(companyCredit);
249   -
250   - for(CompanyCredit c:companyList){
251   - SpringUtils.getBean(ICompanyCreditService.class).updateRemoteCompanyAndTruck(c,TOKEN);
252   - }
  236 +
  237 + }
  238 + }
  239 +
  240 + CompanyCredit companyCredit = new CompanyCredit();
  241 + companyCredit.setLostCredit(1L);
  242 + companyCredit.setStatus(0L);
  243 +
  244 + List<CompanyCredit> companyList = SpringUtils.getBean(CompanyCreditMapper.class)
  245 + .selectCompanyCreditList(companyCredit);
  246 +
  247 + for (CompanyCredit c : companyList) {
  248 + SpringUtils.getBean(ICompanyCreditService.class).updateRemoteCompanyAndTruck(c, TOKEN);
  249 + }
253 250 }
254 251  
255   - public void checkAllTask()
256   - {
257   - LogUtils.getBlock("=================== 删除超时报工数据 定时器执行 当前时间: " + simpleDateFormat.format(new Date()));
258   -
259   - if(TOKEN == null){
260   - TOKEN = trashConfig.getToken();
261   - }
262   - SpringUtils.getBean(ISupervisionThreestepService.class).updateTodayData(TOKEN);
263   -
264   - SpringUtils.getBean(IActTaskService.class).endAllThreesteptask("workflow_threestep");
265   -
266   - SpringUtils.getBean(IWorkflowService.class).deleteWorkflowByName("workflow_threestep");
267   -
268   - SpringUtils.getBean(ITruckActivateService.class).endAllTruckUnActive();
269   -
270   -
271   - }
  252 + public void checkAllTask() {
  253 + LogUtils.getBlock("=================== 删除超时报工数据 定时器执行 当前时间: " + simpleDateFormat.format(new Date()));
  254 +
  255 + if (TOKEN == null) {
  256 + TOKEN = trashConfig.getToken();
  257 + }
  258 + try {
  259 + SpringUtils.getBean(ISupervisionThreestepService.class).updateTodayData(TOKEN);
  260 + } catch (Exception e) {
  261 + e.printStackTrace();
  262 + }
  263 + try {
  264 + SpringUtils.getBean(IActTaskService.class).endAllThreesteptask("workflow_threestep");
  265 + } catch (Exception e) {
  266 + e.printStackTrace();
  267 + }
  268 + try {
  269 + SpringUtils.getBean(IWorkflowService.class).deleteWorkflowByName("workflow_threestep");
  270 + } catch (Exception e) {
  271 + e.printStackTrace();
  272 + }
  273 + try {
  274 + SpringUtils.getBean(ITruckActivateService.class).endAllTruckUnActive();
  275 + } catch (Exception e) {
  276 + e.printStackTrace();
  277 + }
  278 +
  279 + }
272 280  
273 281 /**
274 282 * kafka补偿机制,每半小时一次
  283 + *
275 284 * @throws InterruptedException
276 285 */
277 286 public void kafkaCompensation() throws InterruptedException, IOException {
278 287 KafkaCompensation kafkaCompensation = new KafkaCompensation();
279 288 kafkaCompensation.setStatus(0);
280   - List<KafkaCompensation> kafkaCompensationList = SpringUtils.getBean(KafkaCompensationMapper.class).selectKafkaCompensationList(kafkaCompensation);
281   - for(KafkaCompensation k:kafkaCompensationList){
282   - SpringUtils.getBean(Consumer.class).autoViolationWarning(k.getData(),k.getId().toString());
  289 + List<KafkaCompensation> kafkaCompensationList = SpringUtils.getBean(KafkaCompensationMapper.class)
  290 + .selectKafkaCompensationList(kafkaCompensation);
  291 + for (KafkaCompensation k : kafkaCompensationList) {
  292 + SpringUtils.getBean(Consumer.class).autoViolationWarning(k.getData(), k.getId().toString());
283 293 }
284 294 }
285 295  
286 296 /**
287 297 * 每分钟更新一次公司列表
288 298 */
289   - public void getCompanyList(){
290   - if(RemoteServerUtils.remote == null){
  299 + public void getCompanyList() {
  300 + if (RemoteServerUtils.remote == null) {
291 301 RemoteServerUtils.remote = trashConfig.getRemotePath();
292 302 }
293 303 Map<String, Object> map = new HashMap<>();
294   - map.put("size",99999);
295   - map.put("page",1);
  304 + map.put("size", 99999);
  305 + map.put("page", 1);
296 306 JSONArray jsonArray = RemoteServerUtils.getCompanyList(map, trashConfig.getToken());
297   - redisCache.setCacheObject("companyList",jsonArray);
  307 + redisCache.setCacheObject("companyList", jsonArray);
298 308 }
299   -
300   - public void getContractList(){
301   - if(RemoteServerUtils.remote == null){
  309 +
  310 + public void getContractList() {
  311 + if (RemoteServerUtils.remote == null) {
302 312 RemoteServerUtils.remote = trashConfig.getRemotePath();
303 313 }
304 314 Map<String, Object> map = new HashMap<>();
305   - map.put("size",99999);
306   - map.put("page",1);
  315 + map.put("size", 99999);
  316 + map.put("page", 1);
307 317 map.put("contractStatus", 1);
308 318 map.put("auditStatus", 1);
309 319 JSONArray jsonArray = RemoteServerUtils.getContractList(map, trashConfig.getToken());
310   - redisCache.setCacheObject("contractList",jsonArray);
  320 + redisCache.setCacheObject("contractList", jsonArray);
311 321 }
312 322  
313 323 /**
314 324 * 每分钟更新一次工地列表
315 325 */
316   - public void getConstructionList(){
317   - if(RemoteServerUtils.remote == null){
  326 + public void getConstructionList() {
  327 + if (RemoteServerUtils.remote == null) {
318 328 RemoteServerUtils.remote = trashConfig.getRemotePath();
319 329 }
320 330 Map<String, Object> map = new HashMap<>();
321   - map.put("size",99999);
322   - map.put("page",1);
323   - JSONArray jsonArray = RemoteServerUtils.getConstructionList(map,trashConfig.getToken());
324   - redisCache.setCacheObject("constructionList",jsonArray);
  331 + map.put("size", 99999);
  332 + map.put("page", 1);
  333 + JSONArray jsonArray = RemoteServerUtils.getConstructionList(map, trashConfig.getToken());
  334 + redisCache.setCacheObject("constructionList", jsonArray);
325 335 }
326 336  
327 337 /**
328 338 * 每分钟更新一次消纳场列表
329 339 */
330   - public void getEarthSitesList(){
331   - if(RemoteServerUtils.remote == null){
  340 + public void getEarthSitesList() {
  341 + if (RemoteServerUtils.remote == null) {
332 342 RemoteServerUtils.remote = trashConfig.getRemotePath();
333 343 }
334 344 Map<String, Object> map = new HashMap<>();
335   - map.put("size",99999);
336   - map.put("page",1);
337   - JSONArray jsonArray = RemoteServerUtils.getEarthSitesList(map,trashConfig.getToken());
338   - redisCache.setCacheObject("earthSitesList",jsonArray);
  345 + map.put("size", 99999);
  346 + map.put("page", 1);
  347 + JSONArray jsonArray = RemoteServerUtils.getEarthSitesList(map, trashConfig.getToken());
  348 + redisCache.setCacheObject("earthSitesList", jsonArray);
339 349 }
340 350  
341 351 /**
342 352 * 每分钟更新一次区域列表
343 353 */
344   - public void getTruckList(){
345   - if(RemoteServerUtils.remote == null){
  354 + public void getTruckList() {
  355 + if (RemoteServerUtils.remote == null) {
346 356 RemoteServerUtils.remote = trashConfig.getRemotePath();
347 357 }
348 358 Map<String, Object> map = new HashMap<>();
349   - map.put("size",99999);
350   - map.put("valid",0);
351   - map.put("page",1);
352   -
353   - JSONArray jsonArray = RemoteServerUtils.getTruckList(map,trashConfig.getToken());
354   - redisCache.setCacheObject("truckList",jsonArray);
  359 + map.put("size", 99999);
  360 + map.put("valid", 0);
  361 + map.put("page", 1);
  362 +
  363 + JSONArray jsonArray = RemoteServerUtils.getTruckList(map, trashConfig.getToken());
  364 + redisCache.setCacheObject("truckList", jsonArray);
355 365 }
  366 +
356 367 /**
357 368 * 每分钟更新一次区域列表
358 369 */
359   - public void getAreaList(){
360   - if(RemoteServerUtils.remote == null){
  370 + public void getAreaList() {
  371 + if (RemoteServerUtils.remote == null) {
361 372 RemoteServerUtils.remote = trashConfig.getRemotePath();
362 373 }
363 374 Map<String, Object> map = new HashMap<>();
364   - map.put("size",99999);
365   - map.put("page",1);
  375 + map.put("size", 99999);
  376 + map.put("page", 1);
366 377 JSONArray jsonArray = RemoteServerUtils.getAreas(trashConfig.getToken());
367   - redisCache.setCacheObject("areaList",jsonArray);
  378 + redisCache.setCacheObject("areaList", jsonArray);
368 379 }
369 380 }
... ...
trash-ui/dist.zip
No preview for this file type
trash-workFlow/src/main/java/com/trash/business/service/impl/SupervisionThreestepServiceImpl.java
... ... @@ -1003,7 +1003,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
1003 1003 redisCache.setCacheObject("contractList", contracts);
1004 1004 }
1005 1005  
1006   - if (list.size() > 0) {
  1006 + if (list.size() > 0 && contracts != null) {
1007 1007  
1008 1008 for (SupervisionThreestep s : list) {
1009 1009 String cid = "";
... ...
trash-workFlow/src/main/java/com/trash/casefile/kafka/Consumer.java
... ... @@ -348,6 +348,7 @@ public class Consumer {
348 348 break;
349 349  
350 350 case "44030034"://失信车辆作业
  351 + case "44030035"://失信车辆作业
351 352 violationWarningInformation.setViolationObjectType("2");
352 353 violationWarningInformation.setSendObject("运输企业");
353 354 describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
... ...