Commit 04d317096134f1f5e03f53e0cd6ea6bfa60ef3c5

Authored by youxiw2000
1 parent 8fb9f115

m

Showing 60 changed files with 2837 additions and 2209 deletions
trash-common/src/main/java/com/trash/common/core/domain/entity/SysUser.java
1 package com.trash.common.core.domain.entity; 1 package com.trash.common.core.domain.entity;
2 2
  3 +import java.util.ArrayList;
3 import java.util.Date; 4 import java.util.Date;
4 import java.util.List; 5 import java.util.List;
5 import javax.validation.constraints.Email; 6 import javax.validation.constraints.Email;
@@ -92,8 +93,84 @@ public class SysUser extends BaseEntity @@ -92,8 +93,84 @@ public class SysUser extends BaseEntity
92 93
93 /** 岗位组 */ 94 /** 岗位组 */
94 private List<String> postIds; 95 private List<String> postIds;
  96 +
  97 + private String companyName;
  98 +
  99 + private String areaCode;
  100 +
  101 + List<String> companyIds = new ArrayList<String>();
  102 + List<String> conList = new ArrayList<String>();
  103 + List<String> earthList = new ArrayList<String>();
  104 + List<String> conAreas = new ArrayList<String>();
  105 + List<String> earthAreas = new ArrayList<String>();
  106 + List<String> truckList = new ArrayList<String>();
  107 +
  108 +
  109 + public List<String> getTruckList() {
  110 + return truckList;
  111 + }
95 112
96 - public SysUser() 113 + public void setTruckList(List<String> truckList) {
  114 + this.truckList = truckList;
  115 + }
  116 +
  117 + public List<String> getCompanyIds() {
  118 + return companyIds;
  119 + }
  120 +
  121 + public void setCompanyIds(List<String> companyIds) {
  122 + this.companyIds = companyIds;
  123 + }
  124 +
  125 + public List<String> getConList() {
  126 + return conList;
  127 + }
  128 +
  129 + public void setConList(List<String> conList) {
  130 + this.conList = conList;
  131 + }
  132 +
  133 + public List<String> getEarthList() {
  134 + return earthList;
  135 + }
  136 +
  137 + public void setEarthList(List<String> earthList) {
  138 + this.earthList = earthList;
  139 + }
  140 +
  141 + public List<String> getConAreas() {
  142 + return conAreas;
  143 + }
  144 +
  145 + public void setConAreas(List<String> conAreas) {
  146 + this.conAreas = conAreas;
  147 + }
  148 +
  149 + public List<String> getEarthAreas() {
  150 + return earthAreas;
  151 + }
  152 +
  153 + public void setEarthAreas(List<String> earthAreas) {
  154 + this.earthAreas = earthAreas;
  155 + }
  156 +
  157 + public String getAreaCode() {
  158 + return areaCode;
  159 + }
  160 +
  161 + public void setAreaCode(String areaCode) {
  162 + this.areaCode = areaCode;
  163 + }
  164 +
  165 + public String getCompanyName() {
  166 + return companyName;
  167 + }
  168 +
  169 + public void setCompanyName(String companyName) {
  170 + this.companyName = companyName;
  171 + }
  172 +
  173 + public SysUser()
97 { 174 {
98 175
99 } 176 }
@@ -326,4 +403,5 @@ public class SysUser extends BaseEntity @@ -326,4 +403,5 @@ public class SysUser extends BaseEntity
326 .append("dept", getDept()) 403 .append("dept", getDept())
327 .toString(); 404 .toString();
328 } 405 }
  406 +
329 } 407 }
trash-common/src/main/java/com/trash/common/utils/RemoteServerUtils.java
@@ -48,8 +48,8 @@ public class RemoteServerUtils { @@ -48,8 +48,8 @@ public class RemoteServerUtils {
48 48
49 public static String ConstructionInfo = "/api/siteservice/cs/constructionsites/"; 49 public static String ConstructionInfo = "/api/siteservice/cs/constructionsites/";
50 50
51 -  
52 - public static String constructionLicenseById = "/api/siteservice/cs/constructionsites/license/"; 51 + //license/ 留一下...
  52 + public static String constructionLicenseById = "/api/siteservice/cs/constructionsites/";
53 53
54 public static String ConstructionList = "/api/siteservice/cs/constructionsites/search"; 54 public static String ConstructionList = "/api/siteservice/cs/constructionsites/search";
55 55
@@ -81,6 +81,9 @@ public class RemoteServerUtils { @@ -81,6 +81,9 @@ public class RemoteServerUtils {
81 public static String Unitetransport = "/api/siteservice/cs/unitetransport/bysite/"; 81 public static String Unitetransport = "/api/siteservice/cs/unitetransport/bysite/";
82 82
83 83
  84 + public static String GETAUTH = "/api/gpsservice/cs/authority";
  85 +
  86 +
84 public static JSONArray getUnitetransport(String id){ 87 public static JSONArray getUnitetransport(String id){
85 JSONArray list = null; 88 JSONArray list = null;
86 try { 89 try {
@@ -754,5 +757,10 @@ public class RemoteServerUtils { @@ -754,5 +757,10 @@ public class RemoteServerUtils {
754 } 757 }
755 } 758 }
756 759
  760 + public static Object getAuth(String token) {
  761 +
  762 + return get(GETAUTH, null,token.replace("Bearer ", ""));
  763 + }
  764 +
757 765
758 } 766 }
trash-framework/src/main/java/com/trash/framework/web/service/SysLoginService.java
1 package com.trash.framework.web.service; 1 package com.trash.framework.web.service;
2 2
3 import java.util.ArrayList; 3 import java.util.ArrayList;
  4 +import java.util.HashMap;
4 import java.util.HashSet; 5 import java.util.HashSet;
5 import java.util.List; 6 import java.util.List;
  7 +import java.util.Map;
6 import java.util.Set; 8 import java.util.Set;
7 import java.util.concurrent.TimeUnit; 9 import java.util.concurrent.TimeUnit;
8 10
@@ -19,6 +21,7 @@ import org.springframework.security.core.userdetails.UserDetailsService; @@ -19,6 +21,7 @@ import org.springframework.security.core.userdetails.UserDetailsService;
19 import org.springframework.stereotype.Component; 21 import org.springframework.stereotype.Component;
20 22
21 import com.alibaba.fastjson.JSON; 23 import com.alibaba.fastjson.JSON;
  24 +import com.alibaba.fastjson.JSONArray;
22 import com.alibaba.fastjson.JSONObject; 25 import com.alibaba.fastjson.JSONObject;
23 import com.trash.common.config.trashConfig; 26 import com.trash.common.config.trashConfig;
24 import com.trash.common.constant.Constants; 27 import com.trash.common.constant.Constants;
@@ -171,6 +174,14 @@ public class SysLoginService @@ -171,6 +174,14 @@ public class SysLoginService
171 user.setPassword(userJson.getString("id")); 174 user.setPassword(userJson.getString("id"));
172 SysDept dept = new SysDept(); 175 SysDept dept = new SysDept();
173 176
  177 + JSONArray depts = redisCache.getCacheObject("CSUserDepartmentType");
  178 +
  179 + if(depts == null){
  180 + Map<String, String> map = new HashMap<String, String>();
  181 + map.put("type", "CSUserDepartmentType");
  182 + depts = RemoteServerUtils.getDict(map);
  183 + redisCache.setCacheObject("CSUserDepartmentType", depts);
  184 + }
174 185
175 if(userJson.getJSONArray("userIdentityList")!=null){ 186 if(userJson.getJSONArray("userIdentityList")!=null){
176 187
@@ -183,11 +194,27 @@ public class SysLoginService @@ -183,11 +194,27 @@ public class SysLoginService
183 for(Object obj:userJson.getJSONArray("userIdentityList")){ 194 for(Object obj:userJson.getJSONArray("userIdentityList")){
184 195
185 JSONObject uId = (JSONObject)obj; 196 JSONObject uId = (JSONObject)obj;
186 -  
187 - poStrings.add(uId.getString("postType"));  
188 -  
189 - rolStrings.add(uId.getString("departmentType"));  
190 - 197 +
  198 + poStrings.add(uId.getString("postType"));
  199 +
  200 + rolStrings.add(uId.getString("departmentType"));
  201 +
  202 + if(user.getCompanyName() == null){
  203 + for(Object object :depts){
  204 + JSONObject depart = (JSONObject) object;
  205 +
  206 + if(depart.getString("code").equals(uId.getString("departmentType"))){
  207 + if(depart.getString("name").equals("事务中心")){
  208 + user.setCompanyName("事务中心");
  209 + break;
  210 + }
  211 + if(depart.getString("name").contains("渣土办")){
  212 + user.setCompanyName("渣土办");
  213 + user.setAreaCode(depart.getString("code"));
  214 + }
  215 + }
  216 + }
  217 + }
191 } 218 }
192 219
193 user.setPostIds(poStrings); 220 user.setPostIds(poStrings);
@@ -195,7 +222,6 @@ public class SysLoginService @@ -195,7 +222,6 @@ public class SysLoginService
195 user.setRoleIds(rolStrings); 222 user.setRoleIds(rolStrings);
196 223
197 224
198 -  
199 } catch (Exception e) { 225 } catch (Exception e) {
200 // TODO: handle exception 226 // TODO: handle exception
201 } 227 }
@@ -205,8 +231,55 @@ public class SysLoginService @@ -205,8 +231,55 @@ public class SysLoginService
205 } 231 }
206 232
207 233
  234 + if(user.getCompanyName() == null){
  235 + JSONArray compnayList = redisCache.getCacheObject("companyList");
  236 + for(Object obj:compnayList){
  237 + JSONObject con = (JSONObject) obj;
  238 +
  239 + if(con.getString("abbreviation").equals(user.getUserName().replace("公司", ""))){
  240 + user.setCompanyName(con.getString("name"));;
  241 + break;
  242 + }
  243 +
  244 + }
  245 +
  246 + }
208 247
209 - 248 + JSONArray jsonArray = (JSONArray)RemoteServerUtils.getAuth(token);
  249 + if(jsonArray != null){
  250 + for(Object obj:jsonArray){
  251 + JSONObject json = (JSONObject)obj;
  252 + if(json.getInteger("sourceType") == 2){
  253 + if(json.getJSONArray("sourceIds") != null){
  254 + List<String> tIds = json.getJSONArray("sourceIds").toJavaList(String.class);
  255 + user.setTruckList(tIds);
  256 + }
  257 + if(json.getJSONArray("companyIds") != null){
  258 + List<String> companyIds = json.getJSONArray("companyIds").toJavaList(String.class);
  259 + user.setCompanyIds(companyIds);
  260 + }
  261 + }else if(json.getInteger("sourceType") == 3){
  262 + if(json.getJSONArray("sourceIds") != null){
  263 + List<String> companyIds = json.getJSONArray("sourceIds").toJavaList(String.class);
  264 + user.setConList(companyIds);
  265 + }
  266 + if(json.getJSONArray("adCodes") != null){
  267 + List<String> areas = json.getJSONArray("adCodes").toJavaList(String.class);
  268 + user.setConAreas(areas);
  269 + }
  270 + }else if(json.getInteger("sourceType") == 4){
  271 + if(json.getJSONArray("sourceIds") != null){
  272 + List<String> companyIds = json.getJSONArray("sourceIds").toJavaList(String.class);
  273 + user.setEarthList(companyIds);
  274 + }
  275 + if(json.getJSONArray("adCodes") != null){
  276 + List<String> areas = json.getJSONArray("adCodes").toJavaList(String.class);
  277 + user.setEarthAreas(areas);
  278 + }
  279 + }
  280 + }
  281 + }
  282 +
210 283
211 284
212 dept.setDeptName(userJson.getString("orgName")); 285 dept.setDeptName(userJson.getString("orgName"));
trash-quartz/src/main/java/com/trash/quartz/task/DriverTask.java
@@ -273,12 +273,12 @@ public class DriverTask @@ -273,12 +273,12 @@ public class DriverTask
273 * @throws InterruptedException 273 * @throws InterruptedException
274 */ 274 */
275 public void kafkaCompensation() throws InterruptedException, IOException { 275 public void kafkaCompensation() throws InterruptedException, IOException {
276 - KafkaCompensation kafkaCompensation = new KafkaCompensation();  
277 - kafkaCompensation.setStatus(0);  
278 - List<KafkaCompensation> kafkaCompensationList = SpringUtils.getBean(KafkaCompensationMapper.class).selectKafkaCompensationList(kafkaCompensation);  
279 - for(KafkaCompensation k:kafkaCompensationList){  
280 - SpringUtils.getBean(Consumer.class).autoViolationWarning(k.getData(),k.getId().toString());  
281 - } 276 +// KafkaCompensation kafkaCompensation = new KafkaCompensation();
  277 +// kafkaCompensation.setStatus(0);
  278 +// List<KafkaCompensation> kafkaCompensationList = SpringUtils.getBean(KafkaCompensationMapper.class).selectKafkaCompensationList(kafkaCompensation);
  279 +// for(KafkaCompensation k:kafkaCompensationList){
  280 +// SpringUtils.getBean(Consumer.class).autoViolationWarning(k.getData(),k.getId().toString());
  281 +// }
282 } 282 }
283 283
284 /** 284 /**
@@ -289,7 +289,7 @@ public class DriverTask @@ -289,7 +289,7 @@ public class DriverTask
289 RemoteServerUtils.remote = trashConfig.getRemotePath(); 289 RemoteServerUtils.remote = trashConfig.getRemotePath();
290 } 290 }
291 Map<String, Object> map = new HashMap<>(); 291 Map<String, Object> map = new HashMap<>();
292 - map.put("size",9999); 292 + map.put("size",99999);
293 map.put("page",1); 293 map.put("page",1);
294 JSONArray jsonArray = RemoteServerUtils.getCompanyList(map, trashConfig.getToken()); 294 JSONArray jsonArray = RemoteServerUtils.getCompanyList(map, trashConfig.getToken());
295 redisCache.setCacheObject("companyList",jsonArray); 295 redisCache.setCacheObject("companyList",jsonArray);
@@ -300,7 +300,7 @@ public class DriverTask @@ -300,7 +300,7 @@ public class DriverTask
300 RemoteServerUtils.remote = trashConfig.getRemotePath(); 300 RemoteServerUtils.remote = trashConfig.getRemotePath();
301 } 301 }
302 Map<String, Object> map = new HashMap<>(); 302 Map<String, Object> map = new HashMap<>();
303 - map.put("size",9999); 303 + map.put("size",99999);
304 map.put("page",1); 304 map.put("page",1);
305 map.put("contractStatus", 1); 305 map.put("contractStatus", 1);
306 map.put("auditStatus", 1); 306 map.put("auditStatus", 1);
@@ -316,7 +316,7 @@ public class DriverTask @@ -316,7 +316,7 @@ public class DriverTask
316 RemoteServerUtils.remote = trashConfig.getRemotePath(); 316 RemoteServerUtils.remote = trashConfig.getRemotePath();
317 } 317 }
318 Map<String, Object> map = new HashMap<>(); 318 Map<String, Object> map = new HashMap<>();
319 - map.put("size",9999); 319 + map.put("size",99999);
320 map.put("page",1); 320 map.put("page",1);
321 JSONArray jsonArray = RemoteServerUtils.getConstructionList(map,trashConfig.getToken()); 321 JSONArray jsonArray = RemoteServerUtils.getConstructionList(map,trashConfig.getToken());
322 redisCache.setCacheObject("constructionList",jsonArray); 322 redisCache.setCacheObject("constructionList",jsonArray);
@@ -330,7 +330,7 @@ public class DriverTask @@ -330,7 +330,7 @@ public class DriverTask
330 RemoteServerUtils.remote = trashConfig.getRemotePath(); 330 RemoteServerUtils.remote = trashConfig.getRemotePath();
331 } 331 }
332 Map<String, Object> map = new HashMap<>(); 332 Map<String, Object> map = new HashMap<>();
333 - map.put("size",9999); 333 + map.put("size",99999);
334 map.put("page",1); 334 map.put("page",1);
335 JSONArray jsonArray = RemoteServerUtils.getEarthSitesList(map,trashConfig.getToken()); 335 JSONArray jsonArray = RemoteServerUtils.getEarthSitesList(map,trashConfig.getToken());
336 redisCache.setCacheObject("earthSitesList",jsonArray); 336 redisCache.setCacheObject("earthSitesList",jsonArray);
@@ -344,7 +344,7 @@ public class DriverTask @@ -344,7 +344,7 @@ public class DriverTask
344 RemoteServerUtils.remote = trashConfig.getRemotePath(); 344 RemoteServerUtils.remote = trashConfig.getRemotePath();
345 } 345 }
346 Map<String, Object> map = new HashMap<>(); 346 Map<String, Object> map = new HashMap<>();
347 - map.put("size",9999); 347 + map.put("size",99999);
348 map.put("page",1); 348 map.put("page",1);
349 JSONArray jsonArray = RemoteServerUtils.getAreas(trashConfig.getToken()); 349 JSONArray jsonArray = RemoteServerUtils.getAreas(trashConfig.getToken());
350 redisCache.setCacheObject("areaList",jsonArray); 350 redisCache.setCacheObject("areaList",jsonArray);
trash-ui/src/api/caseoffline.js
@@ -106,9 +106,6 @@ export default { @@ -106,9 +106,6 @@ export default {
106 }; 106 };
107 }, 107 },
108 created() { 108 created() {
109 -  
110 -  
111 -  
112 this.getList(); 109 this.getList();
113 110
114 if(window.location.search){ 111 if(window.location.search){
@@ -166,23 +163,29 @@ export default { @@ -166,23 +163,29 @@ export default {
166 } 163 }
167 }); 164 });
168 } 165 }
169 -  
170 166
171 - 167 +
  168 +
172 169
173 }, 170 },
174 /** 查询线下交办案卷列表 */ 171 /** 查询线下交办案卷列表 */
175 getList() { 172 getList() {
176 this.loading = true; 173 this.loading = true;
177 - let query = {};  
178 174
179 - for(var i in this.queryParams){  
180 - query[i] = this.queryParams[i];  
181 - }  
182 -  
183 - query.createTime = null;  
184 -  
185 - listCaseOffline(this.query).then(response => { 175 + if(this.queryParams.createTime){
  176 + this.queryParams.startTime = this.queryParams.createTime[0];
  177 + this.queryParams.endTime = this.queryParams.createTime[1];
  178 + }
  179 +
  180 + let query = {};
  181 +
  182 + for(var i in this.queryParams){
  183 + query[i] = this.queryParams[i];
  184 + }
  185 +
  186 + query.createTime = null;
  187 +
  188 + listCaseOffline(query).then(response => {
186 this.caseOfflineList = response.rows; 189 this.caseOfflineList = response.rows;
187 190
188 for(let i in this.caseOfflineList){ 191 for(let i in this.caseOfflineList){
trash-ui/src/api/dict.js
@@ -7,10 +7,10 @@ export function getTruckList(params) { @@ -7,10 +7,10 @@ export function getTruckList(params) {
7 params:params 7 params:params
8 }); 8 });
9 } 9 }
10 - 10 +//license/ 先留一下免得又改
11 export function constructionLicenseById(id) { 11 export function constructionLicenseById(id) {
12 return requestRemote({ 12 return requestRemote({
13 - url: '/api/siteservice/cs/constructionsites/license/'+id, 13 + url: '/api/siteservice/cs/constructionsites/'+id,
14 method: 'get', 14 method: 'get',
15 }); 15 });
16 } 16 }
@@ -179,7 +179,15 @@ export function getUsers(data){ @@ -179,7 +179,15 @@ export function getUsers(data){
179 method: 'post', 179 method: 'post',
180 data:data 180 data:data
181 }) 181 })
182 -} 182 +}
  183 +
  184 +export function getAuth() {
  185 + return requestRemote({
  186 + url: '/api/gpsservice/cs/authority',
  187 + method: 'get',
  188 + });
  189 +}
  190 +
183 191
184 192
185 export function getDict(params) { 193 export function getDict(params) {
trash-ui/src/api/three_step.js
@@ -31,7 +31,8 @@ import { @@ -31,7 +31,8 @@ import {
31 getConstructionTruck, 31 getConstructionTruck,
32 constructionById, 32 constructionById,
33 earthsitesById, 33 earthsitesById,
34 - getTruckList, 34 + getTruckList,
  35 + getAuth,
35 } from "@/api/dict"; 36 } from "@/api/dict";
36 37
37 export default { 38 export default {
@@ -176,7 +177,14 @@ export default { @@ -176,7 +177,14 @@ export default {
176 info2: false, 177 info2: false,
177 slides: [], 178 slides: [],
178 slidesArys: [], 179 slidesArys: [],
179 - videos:[], 180 + videos:[],
  181 + authEarth:[],
  182 + authEarthArea:[],
  183 + authCon:[],
  184 + authConArea:[],
  185 + typeLock:false,
  186 + areaLock:false,
  187 + nameLock:false,
180 }; 188 };
181 }, 189 },
182 created() { 190 created() {
@@ -201,7 +209,32 @@ export default { @@ -201,7 +209,32 @@ export default {
201 this.getList(this.queryParams.pageStatus); 209 this.getList(this.queryParams.pageStatus);
202 210
203 }, 211 },
204 - methods: { 212 + methods: {
  213 + checkAuth(){
  214 +
  215 + this.authEarth = this.$store.getters.user.earthList;
  216 + this.authEarthArea = this.$store.getters.user.earthAreas;
  217 + this.authCon = this.$store.getters.user.conList;
  218 + this.authConArea = this.$store.getters.user.conAreas;
  219 +
  220 + if(this.authEarth.length == 0 && authCon.length > 0){
  221 + this.form.type = "0";
  222 + this.typeLock = true;
  223 + if(authCon.length == 1){
  224 + this.nameLock = true;
  225 + this.areaLock = true;
  226 + this.getRemoteDataById(authCon[0]);
  227 + }
  228 + }else if(this.authEarth.length > 0 && authCon.length == 0){
  229 + this.form.type = "1";
  230 + this.typeLock = true;
  231 + if(this.authEarth.length == 1){
  232 + this.nameLock = true;
  233 + this.areaLock = true;
  234 + this.getRemoteDataById(this.authEarth[0]);
  235 + }
  236 + }
  237 + },
205 conractCheck(value) { 238 conractCheck(value) {
206 let item 239 let item
207 for (let i in this.contractList) { 240 for (let i in this.contractList) {
@@ -286,6 +319,25 @@ export default { @@ -286,6 +319,25 @@ export default {
286 this.getRemoteData(); 319 this.getRemoteData();
287 320
288 }, 321 },
  322 + getRemoteDataById(id){
  323 + if (this.form.type == "0") {
  324 + constructionById(id).then(res => {
  325 + let item = res.result;
  326 + this.form.objectId = item.id;
  327 + this.form.place = Number(item.areaCode);
  328 + this.form.name = item.name;
  329 + this.getCompanyTrucks(item.id);
  330 +
  331 + });
  332 + } else {
  333 + earthsitesById(id).then(res => {
  334 + let item = res.result;
  335 + this.form.objectId = item.id;
  336 + this.form.name = item.site.name;
  337 + this.form.place = Number(item.site.areaCode);
  338 + });
  339 + }
  340 + },
289 getRemoteData(){ 341 getRemoteData(){
290 if(this.form.type){ 342 if(this.form.type){
291 if (this.form.type == "0") { 343 if (this.form.type == "0") {
@@ -330,8 +382,7 @@ export default { @@ -330,8 +382,7 @@ export default {
330 } 382 }
331 } 383 }
332 }, 384 },
333 - getObjId(value) {  
334 - console.log(value); 385 + getObjId(value) {
335 let item; 386 let item;
336 387
337 this.remoteQueryData.name = value; 388 this.remoteQueryData.name = value;
@@ -635,7 +686,25 @@ export default { @@ -635,7 +686,25 @@ export default {
635 handleAdd() { 686 handleAdd() {
636 this.reset(); 687 this.reset();
637 this.open = true; 688 this.open = true;
638 - this.title = "报工自查"; 689 + this.title = "报工自查";
  690 +
  691 +
  692 + if(this.$store.getters.user.companyName){
  693 + if(this.$store.getters.user.companyName == "渣土办"){
  694 + this.areaLock = true;
  695 + this.areaCode = this.$store.getters.user.areaCode;
  696 + this.form.place = Number(this.areaCode);
  697 + this.remoteQueryData.areaCode = this.areaCode;
  698 + }else if(this.$store.getters.user.companyName == "事务中心"){
  699 +
  700 + }else{
  701 + this.checkAuth();
  702 + }
  703 + }else{
  704 + this.checkAuth();
  705 + }
  706 +
  707 +
639 }, 708 },
640 /** 修改按钮操作 */ 709 /** 修改按钮操作 */
641 handleUpdate(row, idx) { 710 handleUpdate(row, idx) {
@@ -831,7 +900,7 @@ export default { @@ -831,7 +900,7 @@ export default {
831 900
832 if (this.form.id != null) { 901 if (this.form.id != null) {
833 if (this.queryParams.pageStatus == 1) { 902 if (this.queryParams.pageStatus == 1) {
834 - 903 +
835 this.form.companys = this.form.companys + ""; 904 this.form.companys = this.form.companys + "";
836 this.form.companyTrucks = this.form.companyTrucks + ""; 905 this.form.companyTrucks = this.form.companyTrucks + "";
837 updateThreestep(this.form).then(response => { 906 updateThreestep(this.form).then(response => {
trash-ui/src/api/truck_active.js
@@ -112,7 +112,6 @@ export default { @@ -112,7 +112,6 @@ export default {
112 }, 112 },
113 created() { 113 created() {
114 114
115 -  
116 if(window.location.search){ 115 if(window.location.search){
117 let params = window.location.search.replace("?",""); 116 let params = window.location.search.replace("?","");
118 let arr = params.split("&"); 117 let arr = params.split("&");
@@ -125,51 +124,18 @@ export default { @@ -125,51 +124,18 @@ export default {
125 } 124 }
126 } 125 }
127 } 126 }
128 -  
129 -  
130 - let dep = {type: "CSUserDepartmentType"};  
131 -  
132 - getDict(dep).then(res => {  
133 - this.depts = res.result;  
134 - let need = true;  
135 - for(let i in res.result){  
136 - for(let j in this.$store.getters.roleIds){  
137 - if(this.$store.getters.roleIds[j] == res.result[i].code && (res.result[i].name.indexOf("渣土办") > -1 || res.result[i].name.indexOf("事务中心") > -1)){  
138 - need = false;  
139 - break;  
140 - }  
141 - }  
142 - if(!need){  
143 - break;  
144 - }  
145 - }  
146 -  
147 -  
148 -  
149 - let name = this.$store.getters.name.replace("公司", "")  
150 -  
151 - let query = {  
152 - page:1,  
153 - size:99999  
154 - }  
155 -  
156 - companyList(query).then(res=>{  
157 - this.remoteCompanys = res.result.list;  
158 - if(need){  
159 - for(let i in res.result.list){  
160 - if(res.result.list[i].abbreviation == name){  
161 - this.simpleName = res.result.list[i].name;  
162 - break;  
163 - }  
164 - }  
165 - }  
166 - });  
167 -  
168 - this.getList(0); 127 +
  128 + let query = {
  129 + page:1,
  130 + size:99999
  131 + }
  132 +
  133 + companyList(query).then(res=>{
  134 + this.remoteCompanys = res.result.list;
  135 +
169 }); 136 });
170 -  
171 -  
172 - 137 +
  138 + this.getList(0);
173 }, 139 },
174 methods: { 140 methods: {
175 getInfo(row){ 141 getInfo(row){
@@ -198,10 +164,6 @@ export default { @@ -198,10 +164,6 @@ export default {
198 } 164 }
199 } 165 }
200 } 166 }
201 -  
202 -  
203 -  
204 -  
205 }, 167 },
206 /** 查询车辆激活列表 */ 168 /** 查询车辆激活列表 */
207 getList(index) { 169 getList(index) {
@@ -245,7 +207,7 @@ export default { @@ -245,7 +207,7 @@ export default {
245 207
246 208
247 constructionById(item.objectId).then(res => { 209 constructionById(item.objectId).then(res => {
248 - 210 + debugger;
249 for(let i in this.remoteCompanys){ 211 for(let i in this.remoteCompanys){
250 if(this.remoteCompanys[i].id == res.result.transportCompanyId){ 212 if(this.remoteCompanys[i].id == res.result.transportCompanyId){
251 if(this.remoteCompanys[i].auditStatus != 1){ 213 if(this.remoteCompanys[i].auditStatus != 1){
@@ -315,13 +277,14 @@ export default { @@ -315,13 +277,14 @@ export default {
315 let list = tres.result.list; 277 let list = tres.result.list;
316 278
317 let qr = { 279 let qr = {
318 - constructionId:item.objectId 280 + constructionId:item.objectId,
  281 + status:0
319 } 282 }
320 283
321 listTruckActivate(qr).then(response => { 284 listTruckActivate(qr).then(response => {
322 let taList = response.rows; 285 let taList = response.rows;
323 for(let i = 0;i< list.length;i++){ 286 for(let i = 0;i< list.length;i++){
324 - 287 +
325 let count = 0; 288 let count = 0;
326 for(let j in taList){ 289 for(let j in taList){
327 if(taList[j].objectId == list[i].id){ 290 if(taList[j].objectId == list[i].id){
@@ -340,10 +303,7 @@ export default { @@ -340,10 +303,7 @@ export default {
340 creditStatus:list[i].creditStatus, 303 creditStatus:list[i].creditStatus,
341 createCount:count}); 304 createCount:count});
342 } 305 }
343 -  
344 }); 306 });
345 -  
346 -  
347 }) 307 })
348 }); 308 });
349 309
@@ -398,7 +358,11 @@ export default { @@ -398,7 +358,11 @@ export default {
398 handleAdd() { 358 handleAdd() {
399 this.reset(); 359 this.reset();
400 this.open = true; 360 this.open = true;
401 - this.title = "添加车辆激活"; 361 + this.title = "添加车辆激活";
  362 + if(this.$store.getters.user.companyName && this.$store.getters.user.companyName != "渣土办" && this.$store.getters.user.companyName != "事务中心"){
  363 + this.simpleName = this.$store.getters.user.companyName;
  364 + this.form.company = this.simpleName;
  365 + }
402 }, 366 },
403 /** 修改按钮操作 */ 367 /** 修改按钮操作 */
404 handleUpdate(row) { 368 handleUpdate(row) {
trash-ui/src/api/vio_casefile.js
@@ -89,14 +89,14 @@ export default { @@ -89,14 +89,14 @@ export default {
89 {code: 7, name: "雾炮机是否正常开启"}, 89 {code: 7, name: "雾炮机是否正常开启"},
90 {code: 8, name: "使用非专用车运输"}, 90 {code: 8, name: "使用非专用车运输"},
91 {code: 9, name: "监控点位未对准"}, 91 {code: 9, name: "监控点位未对准"},
92 - {code: 10, name: "未报开工作业"},  
93 - {code: 11, name: "视频设备离线超时报警"},  
94 - {code: 12, name: "三无车辆进入工地"},  
95 - {code: 13, name: "未按时间作业"},  
96 - {code: 14, name: "未报开工作业"},  
97 - {code: 15, name: "视频设备离线超时报警"},  
98 - {code: 16, name: "三无车辆进入处理场所"},  
99 - {code: 17, name: "未到指定的处理场所作业"}, 92 + {code: 10, name: "工地预警-未报开工作业"},
  93 + {code: 11, name: "工地预警-视频设备离线超时报警"},
  94 + {code: 12, name: "工地预警-三无车辆进入工地"},
  95 + {code: 13, name: "工地预警-未按时间作业"},
  96 + {code: 14, name: "处理场所预警-未报开工作业"},
  97 + {code: 15, name: "处理场所预警-视频设备离线超时报警"},
  98 + {code: 16, name: "处理场所预警-三无车辆进入处理场所"},
  99 + {code: 17, name: "处理场所预警-未到指定的处理场所作业"},
100 {code: 18, name: "离线运输报警(工)"}, 100 {code: 18, name: "离线运输报警(工)"},
101 {code: 19, name: "离线运输报警(消)"}, 101 {code: 19, name: "离线运输报警(消)"},
102 {code: 20, name: "未激活车辆作业"}, 102 {code: 20, name: "未激活车辆作业"},
trash-ui/src/layout/index.vue
1 <template> 1 <template>
2 - <div :class="classObj" class="app-wrapper">  
3 - <sidebar class="sidebar-container"/>  
4 - <div :class="{hasTagsView:needTagsView}" class="main-container">  
5 - <tags-view v-if="needTagsView"/>  
6 - <app-main/>  
7 -  
8 - </div>  
9 - </div> 2 + <app-main />
10 </template> 3 </template>
11 4
12 <script> 5 <script>
13 import RightPanel from '@/components/RightPanel' 6 import RightPanel from '@/components/RightPanel'
14 -import {AppMain, Navbar, Settings, Sidebar, TagsView} from './components' 7 +import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
15 import ResizeMixin from './mixin/ResizeHandler' 8 import ResizeMixin from './mixin/ResizeHandler'
16 -import {mapState} from 'vuex' 9 +import { mapState } from 'vuex'
17 10
18 export default { 11 export default {
19 name: 'Layout', 12 name: 'Layout',
@@ -45,63 +38,52 @@ export default { @@ -45,63 +38,52 @@ export default {
45 }, 38 },
46 methods: { 39 methods: {
47 handleClickOutside() { 40 handleClickOutside() {
48 - this.$store.dispatch('app/closeSideBar', {withoutAnimation: false}) 41 + this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
49 } 42 }
50 } 43 }
51 } 44 }
52 </script> 45 </script>
53 46
54 <style lang="scss" scoped> 47 <style lang="scss" scoped>
55 -@import "~@/assets/styles/mixin.scss";  
56 -@import "~@/assets/styles/variables.scss"; 48 + @import "~@/assets/styles/mixin.scss";
  49 + @import "~@/assets/styles/variables.scss";
57 50
58 -.app-wrapper {  
59 - @include clearfix;  
60 - position: relative;  
61 - height: 100%;  
62 - width: 100%; 51 + .app-wrapper {
  52 + @include clearfix;
  53 + position: relative;
  54 + height: 100%;
  55 + width: 100%;
63 56
64 - &.mobile.openSidebar {  
65 - position: fixed;  
66 - top: 0; 57 + &.mobile.openSidebar {
  58 + position: fixed;
  59 + top: 0;
  60 + }
67 } 61 }
68 -}  
69 62
70 -.drawer-bg {  
71 - background: #000;  
72 - opacity: 0.3;  
73 - width: 100%;  
74 - top: 0;  
75 - height: 100%;  
76 - position: absolute;  
77 - z-index: 999;  
78 -}  
79 -  
80 -.fixed-header {  
81 - position: fixed;  
82 - top: 0;  
83 - right: 0;  
84 - z-index: 9;  
85 - width: calc(100% - #{$sideBarWidth});  
86 - transition: width 0.28s;  
87 -}  
88 -  
89 -.hideSidebar .fixed-header {  
90 - width: calc(100% - 54px)  
91 -} 63 + .drawer-bg {
  64 + background: #000;
  65 + opacity: 0.3;
  66 + width: 100%;
  67 + top: 0;
  68 + height: 100%;
  69 + position: absolute;
  70 + z-index: 999;
  71 + }
92 72
93 -.mobile .fixed-header {  
94 - width: 100%;  
95 -} 73 + .fixed-header {
  74 + position: fixed;
  75 + top: 0;
  76 + right: 0;
  77 + z-index: 9;
  78 + width: calc(100% - #{$sideBarWidth});
  79 + transition: width 0.28s;
  80 + }
96 81
97 -.preview figure {  
98 - float: left;  
99 - width: 30%;  
100 - height:calc(30vw - 0px);  
101 - margin: 1.5%;  
102 -} 82 + .hideSidebar .fixed-header {
  83 + width: calc(100% - 54px)
  84 + }
103 85
104 -.preview figure img {  
105 - width: 400px;  
106 -} 86 + .mobile .fixed-header {
  87 + width: 100%;
  88 + }
107 </style> 89 </style>
trash-ui/src/layout/index4.vue renamed to trash-ui/src/layout/index55.vue
1 -<template>  
2 - <app-main />  
3 -</template>  
4 -  
5 -<script>  
6 -import RightPanel from '@/components/RightPanel'  
7 -import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'  
8 -import ResizeMixin from './mixin/ResizeHandler'  
9 -import { mapState } from 'vuex'  
10 -  
11 -export default {  
12 - name: 'Layout',  
13 - components: {  
14 - AppMain,  
15 - Navbar,  
16 - RightPanel,  
17 - Settings,  
18 - Sidebar,  
19 - TagsView  
20 - },  
21 - mixins: [ResizeMixin],  
22 - computed: {  
23 - ...mapState({  
24 - sidebar: state => state.app.sidebar,  
25 - device: state => state.app.device,  
26 - showSettings: state => state.settings.showSettings,  
27 - needTagsView: state => state.settings.tagsView,  
28 - fixedHeader: state => state.settings.fixedHeader  
29 - }),  
30 - classObj() {  
31 - return {  
32 - hideSidebar: !this.sidebar.opened,  
33 - openSidebar: this.sidebar.opened,  
34 - withoutAnimation: this.sidebar.withoutAnimation,  
35 - mobile: this.device === 'mobile'  
36 - }  
37 - }  
38 - },  
39 - methods: {  
40 - handleClickOutside() {  
41 - this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })  
42 - }  
43 - }  
44 -}  
45 -</script>  
46 -  
47 -<style lang="scss" scoped>  
48 - @import "~@/assets/styles/mixin.scss";  
49 - @import "~@/assets/styles/variables.scss";  
50 -  
51 - .app-wrapper {  
52 - @include clearfix;  
53 - position: relative;  
54 - height: 100%;  
55 - width: 100%;  
56 -  
57 - &.mobile.openSidebar {  
58 - position: fixed;  
59 - top: 0;  
60 - }  
61 - }  
62 -  
63 - .drawer-bg {  
64 - background: #000;  
65 - opacity: 0.3;  
66 - width: 100%;  
67 - top: 0;  
68 - height: 100%;  
69 - position: absolute;  
70 - z-index: 999;  
71 - }  
72 -  
73 - .fixed-header {  
74 - position: fixed;  
75 - top: 0;  
76 - right: 0;  
77 - z-index: 9;  
78 - width: calc(100% - #{$sideBarWidth});  
79 - transition: width 0.28s;  
80 - }  
81 -  
82 - .hideSidebar .fixed-header {  
83 - width: calc(100% - 54px)  
84 - }  
85 -  
86 - .mobile .fixed-header {  
87 - width: 100%;  
88 - }  
89 -</style> 1 +<template>
  2 + <div :class="classObj" class="app-wrapper">
  3 + <sidebar class="sidebar-container"/>
  4 + <div :class="{hasTagsView:needTagsView}" class="main-container">
  5 + <tags-view v-if="needTagsView"/>
  6 + <app-main/>
  7 +
  8 + </div>
  9 + </div>
  10 +</template>
  11 +
  12 +<script>
  13 +import RightPanel from '@/components/RightPanel'
  14 +import {AppMain, Navbar, Settings, Sidebar, TagsView} from './components'
  15 +import ResizeMixin from './mixin/ResizeHandler'
  16 +import {mapState} from 'vuex'
  17 +
  18 +export default {
  19 + name: 'Layout',
  20 + components: {
  21 + AppMain,
  22 + Navbar,
  23 + RightPanel,
  24 + Settings,
  25 + Sidebar,
  26 + TagsView
  27 + },
  28 + mixins: [ResizeMixin],
  29 + computed: {
  30 + ...mapState({
  31 + sidebar: state => state.app.sidebar,
  32 + device: state => state.app.device,
  33 + showSettings: state => state.settings.showSettings,
  34 + needTagsView: state => state.settings.tagsView,
  35 + fixedHeader: state => state.settings.fixedHeader
  36 + }),
  37 + classObj() {
  38 + return {
  39 + hideSidebar: !this.sidebar.opened,
  40 + openSidebar: this.sidebar.opened,
  41 + withoutAnimation: this.sidebar.withoutAnimation,
  42 + mobile: this.device === 'mobile'
  43 + }
  44 + }
  45 + },
  46 + methods: {
  47 + handleClickOutside() {
  48 + this.$store.dispatch('app/closeSideBar', {withoutAnimation: false})
  49 + }
  50 + }
  51 +}
  52 +</script>
  53 +
  54 +<style lang="scss" scoped>
  55 +@import "~@/assets/styles/mixin.scss";
  56 +@import "~@/assets/styles/variables.scss";
  57 +
  58 +.app-wrapper {
  59 + @include clearfix;
  60 + position: relative;
  61 + height: 100%;
  62 + width: 100%;
  63 +
  64 + &.mobile.openSidebar {
  65 + position: fixed;
  66 + top: 0;
  67 + }
  68 +}
  69 +
  70 +.drawer-bg {
  71 + background: #000;
  72 + opacity: 0.3;
  73 + width: 100%;
  74 + top: 0;
  75 + height: 100%;
  76 + position: absolute;
  77 + z-index: 999;
  78 +}
  79 +
  80 +.fixed-header {
  81 + position: fixed;
  82 + top: 0;
  83 + right: 0;
  84 + z-index: 9;
  85 + width: calc(100% - #{$sideBarWidth});
  86 + transition: width 0.28s;
  87 +}
  88 +
  89 +.hideSidebar .fixed-header {
  90 + width: calc(100% - 54px)
  91 +}
  92 +
  93 +.mobile .fixed-header {
  94 + width: 100%;
  95 +}
  96 +
  97 +.preview figure {
  98 + float: left;
  99 + width: 30%;
  100 + height:calc(30vw - 0px);
  101 + margin: 1.5%;
  102 +}
  103 +
  104 +.preview figure img {
  105 + width: 400px;
  106 +}
  107 +</style>
trash-ui/src/permission.js
@@ -27,7 +27,6 @@ router.beforeEach((to, from, next) =&gt; { @@ -27,7 +27,6 @@ router.beforeEach((to, from, next) =&gt; {
27 loginByToken(to.query.token).then(res=>{ 27 loginByToken(to.query.token).then(res=>{
28 setToken(res.token); 28 setToken(res.token);
29 if (store.getters.roles.length === 0) { 29 if (store.getters.roles.length === 0) {
30 -  
31 const user = res.user; 30 const user = res.user;
32 const roles = res.roles; 31 const roles = res.roles;
33 const avatar = require("@/assets/image/profile.jpg"); 32 const avatar = require("@/assets/image/profile.jpg");
trash-ui/src/store/modules/user.js
@@ -10,13 +10,29 @@ const user = { @@ -10,13 +10,29 @@ const user = {
10 avatar: '', 10 avatar: '',
11 roles: [], 11 roles: [],
12 roleIds: [], 12 roleIds: [],
13 - permissions: [] 13 + permissions: [],
  14 + companyName:null,
  15 + areaCode:null,
  16 + companyIds:[],
  17 + conList:[],
  18 + earthList:[],
  19 + conAreas:[],
  20 + earthAreas:[]
14 }, 21 },
15 22
16 mutations: { 23 mutations: {
17 - SET_USER: (state, user) => {  
18 - state.user = user  
19 - }, 24 + SET_AUTH: (state, obj) => {
  25 + state.companyName = obj.companyName;
  26 + state.companyIds = obj.companyIds;
  27 + state.areaCode = obj.areaCode;
  28 + state.conList = obj.conList;
  29 + state.conAreas = obj.conAreas;
  30 + state.earthList = obj.earthList;
  31 + state.earthAreas = obj.earthAreas;
  32 + },
  33 + SET_USER: (state, user) => {
  34 + state.user = user
  35 + },
20 SET_TOKEN: (state, token) => { 36 SET_TOKEN: (state, token) => {
21 state.token = token 37 state.token = token
22 }, 38 },
@@ -63,6 +79,7 @@ const user = { @@ -63,6 +79,7 @@ const user = {
63 return new Promise((resolve, reject) => { 79 return new Promise((resolve, reject) => {
64 getInfo(state.token).then(res => { 80 getInfo(state.token).then(res => {
65 const user = res.user 81 const user = res.user
  82 + commit('SET_AUTH', user)
66 const avatar = res.user.avatar; 83 const avatar = res.user.avatar;
67 if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 84 if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
68 commit('SET_ROLES', res.roles) 85 commit('SET_ROLES', res.roles)
trash-ui/src/views/business/threestep/index.vue
@@ -29,13 +29,15 @@ @@ -29,13 +29,15 @@
29 </el-form-item> 29 </el-form-item>
30 30
31 <el-form-item label="开始时间" prop="workStartTime" v-if="this.queryParams.status==1"> 31 <el-form-item label="开始时间" prop="workStartTime" v-if="this.queryParams.status==1">
32 - <el-date-picker size="small" style="width: 200px" v-model="queryParams.workStartTime" type="date"  
33 - value-format="yyyy-MM-dd" placeholder="开始时间"> 32 + <el-date-picker size="small" style="width: 200px" v-model="queryParams.workStartTime" type="datetime"
  33 + format="yyyy-MM-dd HH:mm:ss"
  34 + value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间">
34 </el-date-picker> 35 </el-date-picker>
35 </el-form-item> 36 </el-form-item>
36 <el-form-item label="结束时间" prop="workEndTime" v-if="this.queryParams.status==1"> 37 <el-form-item label="结束时间" prop="workEndTime" v-if="this.queryParams.status==1">
37 - <el-date-picker size="small" style="width: 200px" v-model="queryParams.workEndTime" type="date"  
38 - value-format="yyyy-MM-dd" placeholder="开始时间"> 38 + <el-date-picker size="small" style="width: 200px" v-model="queryParams.workEndTime" type="datetime"
  39 + format="yyyy-MM-dd HH:mm:ss"
  40 + value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间">
39 </el-date-picker> 41 </el-date-picker>
40 </el-form-item> 42 </el-form-item>
41 43
@@ -110,7 +112,7 @@ @@ -110,7 +112,7 @@
110 <el-row type="flex" justify="center"> 112 <el-row type="flex" justify="center">
111 <el-col :span="12"> 113 <el-col :span="12">
112 <el-form-item label="项目类型" prop="type"> 114 <el-form-item label="项目类型" prop="type">
113 - <el-select v-model="form.type" placeholder="请选择项目类型" @change="selectType"> 115 + <el-select v-model="form.type" placeholder="请选择项目类型" @change="selectType" :disabled="typeLock">
114 <el-option label="工地" value="0" /> 116 <el-option label="工地" value="0" />
115 <el-option label="处理场所" value="1" /> 117 <el-option label="处理场所" value="1" />
116 </el-select> 118 </el-select>
@@ -118,8 +120,8 @@ @@ -118,8 +120,8 @@
118 </el-col> 120 </el-col>
119 <el-col :span="12"> 121 <el-col :span="12">
120 <el-form-item label="所属区域" prop="place"> 122 <el-form-item label="所属区域" prop="place">
121 - <el-select v-model="form.place" placeholder="请选择所属区域" filterable reserve-keyword @clear="areaClear" @change="selectArea">  
122 - <el-option v-for="item in areas" :label="item.name" :value="item.code" > 123 + <el-select v-model="form.place" placeholder="请选择所属区域" filterable reserve-keyword @clear="areaClear" @change="selectArea" :disabled="areaLock">
  124 + <el-option v-for="item in areas" :label="item.name" :value="item.code">
123 </el-option> 125 </el-option>
124 </el-select> 126 </el-select>
125 </el-form-item> 127 </el-form-item>
@@ -128,7 +130,7 @@ @@ -128,7 +130,7 @@
128 <el-row type="flex" justify="center" v-if="form.type != null"> 130 <el-row type="flex" justify="center" v-if="form.type != null">
129 <el-col > 131 <el-col >
130 <el-form-item :label="labelName" prop="name"> 132 <el-form-item :label="labelName" prop="name">
131 - <el-select v-model="form.name" filterable reserve-keyword @change="getObjId" :filter-method="getObjId"> 133 + <el-select v-model="form.name" filterable reserve-keyword @change="getObjId" :filter-method="getObjId" :disabled="nameLock">
132 <el-option v-for="item in remoteData" :label="item.name" 134 <el-option v-for="item in remoteData" :label="item.name"
133 :value="item.name" v-if="(!form.place || item.areaCode == form.place) && (item.auditStatus > 0 && item.auditStatus != 2)"> 135 :value="item.name" v-if="(!form.place || item.areaCode == form.place) && (item.auditStatus > 0 && item.auditStatus != 2)">
134 </el-option> 136 </el-option>
trash-ui/src/views/business/truckActivate/index.vue
@@ -37,8 +37,9 @@ @@ -37,8 +37,9 @@
37 <el-form-item label="激活时间" prop="activateDate" v-if="openActivateTime"> 37 <el-form-item label="激活时间" prop="activateDate" v-if="openActivateTime">
38 <el-date-picker size="small" style="width: 200px" 38 <el-date-picker size="small" style="width: 200px"
39 v-model="queryParams.activateDate" 39 v-model="queryParams.activateDate"
40 - type="date"  
41 - value-format="yyyy-MM-dd" 40 + type="datetime"
  41 + format="yyyy-MM-dd HH:mm:ss"
  42 + value-format="yyyy-MM-dd HH:mm:ss"
42 placeholder="选择激活时间"> 43 placeholder="选择激活时间">
43 </el-date-picker> 44 </el-date-picker>
44 </el-form-item> 45 </el-form-item>
trash-ui/src/views/business/truckActivate/truckActivateInfo.vue
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 <el-col :span="24" class="title">施工地址</el-col> 10 <el-col :span="24" class="title">施工地址</el-col>
11 </el-row> 11 </el-row>
12 <el-row > 12 <el-row >
13 - <el-col :span="24" class="content">{{construction.address}}</el-col> 13 + <el-col :span="24" class="content">{{truckObj.address}}</el-col>
14 </el-row> 14 </el-row>
15 <el-row > 15 <el-row >
16 <el-col :span="24" class="title">运输车辆</el-col> 16 <el-col :span="24" class="title">运输车辆</el-col>
@@ -30,35 +30,35 @@ @@ -30,35 +30,35 @@
30 <el-col :span="24" class="title">证照有效期起</el-col> 30 <el-col :span="24" class="title">证照有效期起</el-col>
31 </el-row> 31 </el-row>
32 <el-row > 32 <el-row >
33 - <el-col :span="24" class="content">{{construction.effectiveFrom}}</el-col> 33 + <el-col :span="24" class="content">{{truckObj.effectiveFrom}}</el-col>
34 </el-row> 34 </el-row>
35 <el-row > 35 <el-row >
36 <el-col :span="24" class="title" >证照有效期止</el-col> 36 <el-col :span="24" class="title" >证照有效期止</el-col>
37 </el-row> 37 </el-row>
38 <el-row > 38 <el-row >
39 - <el-col :span="24" class="content">{{construction.effectiveEnd}}</el-col> 39 + <el-col :span="24" class="content">{{truckObj.effectiveEnd}}</el-col>
40 </el-row> 40 </el-row>
41 41
42 <el-row > 42 <el-row >
43 <el-col :span="24" class="title">运输开始时间</el-col> </el-row> 43 <el-col :span="24" class="title">运输开始时间</el-col> </el-row>
44 <el-row > 44 <el-row >
45 - <el-col :span="24" class="content">{{construction.transportStartTime}}</el-col> </el-row> 45 + <el-col :span="24" class="content">{{truckObj.transportStartTime}}</el-col> </el-row>
46 <el-row > 46 <el-row >
47 <el-col :span="24" class="title" >运输结束时间</el-col> </el-row> 47 <el-col :span="24" class="title" >运输结束时间</el-col> </el-row>
48 <el-row > 48 <el-row >
49 - <el-col :span="24" class="content">{{construction.transportEndTime}}</el-col> 49 + <el-col :span="24" class="content">{{truckObj.transportEndTime}}</el-col>
50 </el-row> 50 </el-row>
51 <el-row > 51 <el-row >
52 <el-col :span="24" class="title">路线描述</el-col> 52 <el-col :span="24" class="title">路线描述</el-col>
53 </el-row> 53 </el-row>
54 <el-row > 54 <el-row >
55 - <el-col :span="24" class="content" >{{construction.routeName}}</el-col> 55 + <el-col :span="24" class="content" ><span v-if="scope.row.activateTime != null">{{truckObj.routeName}}</span></el-col>
56 </el-row> 56 </el-row>
57 <el-row > 57 <el-row >
58 <el-col :span="24" class="title">卸区描述</el-col> 58 <el-col :span="24" class="title">卸区描述</el-col>
59 </el-row> 59 </el-row>
60 <el-row > 60 <el-row >
61 - <el-col :span="24" class="content" >{{construction.earthName}}</el-col> 61 + <el-col :span="24" class="content"><span v-if="scope.row.activateTime != null">{{truckObj.earthName}}</span></el-col>
62 </el-row> 62 </el-row>
63 63
64 64
@@ -92,10 +92,6 @@ import { @@ -92,10 +92,6 @@ import {
92 }, 92 },
93 created() { 93 created() {
94 94
95 - constructionLicenseById(this.truckObj.constructionId).then(res=>{  
96 - this.construction = res.result;  
97 - });  
98 -  
99 let query = { 95 let query = {
100 name:this.truckObj.company 96 name:this.truckObj.company
101 }; 97 };
trash-ui/src/views/casefile/violationCaseFile/violationCaseTable.vue
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 <el-form-item label="日期" prop="createTime"> 9 <el-form-item label="日期" prop="createTime">
10 <el-date-picker 10 <el-date-picker
11 v-model="createTime" 11 v-model="createTime"
12 - type="daterange" 12 + type="datetimerange"
13 :picker-options="pickerOptions" 13 :picker-options="pickerOptions"
14 range-separator="至" 14 range-separator="至"
15 start-placeholder="开始日期" 15 start-placeholder="开始日期"
trash-ui/src/views/casefile/violationWarningInformation/violationWarningInformationTable.vue
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 <el-form-item label="日期" prop="createTime"> 9 <el-form-item label="日期" prop="createTime">
10 <el-date-picker 10 <el-date-picker
11 v-model="createTime" 11 v-model="createTime"
12 - type="daterange" 12 + type="datetimerange"
13 :picker-options="pickerOptions" 13 :picker-options="pickerOptions"
14 range-separator="至" 14 range-separator="至"
15 start-placeholder="开始日期" 15 start-placeholder="开始日期"
trash-ui/src/views/h5/threestep/index.vue
@@ -17,11 +17,18 @@ @@ -17,11 +17,18 @@
17 </el-select> 17 </el-select>
18 </el-form-item> 18 </el-form-item>
19 <el-form-item label="开始时间" prop="workStartTime" v-if="this.queryParams.status==1"> 19 <el-form-item label="开始时间" prop="workStartTime" v-if="this.queryParams.status==1">
20 - <el-date-picker size="small" style="width: 200px" v-model="queryParams.workStartTime" type="date" value-format="yyyy-MM-dd" placeholder="开始时间"> 20 + <el-date-picker size="small" style="width: 200px" v-model="queryParams.workStartTime"
  21 + type="datetime"
  22 + format="yyyy-MM-dd HH:mm:ss"
  23 + value-format="yyyy-MM-dd HH:mm:ss"
  24 + placeholder="开始时间">
21 </el-date-picker> 25 </el-date-picker>
22 </el-form-item> 26 </el-form-item>
23 <el-form-item label="结束时间" prop="workEndTime" v-if="this.queryParams.status==1"> 27 <el-form-item label="结束时间" prop="workEndTime" v-if="this.queryParams.status==1">
24 - <el-date-picker size="small" style="width: 200px" v-model="queryParams.workEndTime" type="date" value-format="yyyy-MM-dd" placeholder="开始时间"> 28 + <el-date-picker size="small" style="width: 200px" v-model="queryParams.workEndTime"
  29 + type="datetime"
  30 + format="yyyy-MM-dd HH:mm:ss"
  31 + value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束时间">
25 </el-date-picker> 32 </el-date-picker>
26 </el-form-item> 33 </el-form-item>
27 34
@@ -51,7 +58,7 @@ @@ -51,7 +58,7 @@
51 <span >{{item.place}}</span> 58 <span >{{item.place}}</span>
52 </el-col> 59 </el-col>
53 </el-row> 60 </el-row>
54 - 61 +
55 <el-row class="card_row" style="margin-top: 5px;"> 62 <el-row class="card_row" style="margin-top: 5px;">
56 <el-col :span="24"> 63 <el-col :span="24">
57 <div>自查时间:{{item.selfCheckTime}}</div> 64 <div>自查时间:{{item.selfCheckTime}}</div>
@@ -69,8 +76,8 @@ @@ -69,8 +76,8 @@
69 76
70 <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(item,0)" v-hasPermi="['business:threestep:edit']" v-if="queryParams.pageStatus==1 && item.status==1 && item.checkEndTime == null">抽查</el-button> 77 <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(item,0)" v-hasPermi="['business:threestep:edit']" v-if="queryParams.pageStatus==1 && item.status==1 && item.checkEndTime == null">抽查</el-button>
71 <el-button size="mini" type="text" icon="el-icon-edit" @click="reSub(item)" v-hasPermi="['business:threestep:add']" v-if="item.status==2">被驳回</el-button> 78 <el-button size="mini" type="text" icon="el-icon-edit" @click="reSub(item)" v-hasPermi="['business:threestep:add']" v-if="item.status==2">被驳回</el-button>
72 -  
73 - 79 +
  80 +
74 <el-button size="mini" type="text" @click="handleUpdate(item,1)" v-hasPermi="['business:threestep:edit']">查看详情</el-button> 81 <el-button size="mini" type="text" @click="handleUpdate(item,1)" v-hasPermi="['business:threestep:edit']">查看详情</el-button>
75 82
76 </el-card> 83 </el-card>
@@ -82,14 +89,14 @@ @@ -82,14 +89,14 @@
82 <el-form ref="form" :model="form" :rules="rules" label-width="100px" v-if="open"> 89 <el-form ref="form" :model="form" :rules="rules" label-width="100px" v-if="open">
83 90
84 <el-form-item label="项目类型" prop="type"> 91 <el-form-item label="项目类型" prop="type">
85 - <el-select v-model="form.type" placeholder="请选择项目类型" @change="selectType"> 92 + <el-select v-model="form.type" placeholder="请选择项目类型" @change="selectType" :disabled="typeLock">
86 <el-option label="工地" value="0" /> 93 <el-option label="工地" value="0" />
87 <el-option label="处理场所" value="1" /> 94 <el-option label="处理场所" value="1" />
88 </el-select> 95 </el-select>
89 </el-form-item> 96 </el-form-item>
90 97
91 <el-form-item :label="labelName" prop="name" v-if="form.type!=null"> 98 <el-form-item :label="labelName" prop="name" v-if="form.type!=null">
92 - <el-select v-model="form.name" filterable reserve-keyword @change="getObjId" :filter-method="getObjId"> 99 + <el-select v-model="form.name" filterable reserve-keyword @change="getObjId" :filter-method="getObjId" :disabled="nameLock">
93 <el-option v-for="item in remoteData" :label="item.name" :title="item.name" 100 <el-option v-for="item in remoteData" :label="item.name" :title="item.name"
94 :value="item.name" :key="item.id" v-if="(!form.place || item.areaCode == form.place)&& (item.auditStatus > 0 && item.auditStatus != 2)" > 101 :value="item.name" :key="item.id" v-if="(!form.place || item.areaCode == form.place)&& (item.auditStatus > 0 && item.auditStatus != 2)" >
95 </el-option> 102 </el-option>
@@ -97,7 +104,7 @@ @@ -97,7 +104,7 @@
97 </el-form-item> 104 </el-form-item>
98 105
99 <el-form-item label="所属区域" prop="place" > 106 <el-form-item label="所属区域" prop="place" >
100 - <el-select v-model="form.place" placeholder="请选择所属区域" filterable reserve-keyword @clear="areaClear" @change="selectArea"> 107 + <el-select v-model="form.place" placeholder="请选择所属区域" filterable reserve-keyword @clear="areaClear" @change="selectArea" :disabled="areaLock">
101 <el-option v-for="item in areas" :label="item.name" :value="item.code" :key="item.code"> 108 <el-option v-for="item in areas" :label="item.name" :value="item.code" :key="item.code">
102 </el-option> 109 </el-option>
103 </el-select> 110 </el-select>
trash-ui/src/views/h5/truckActivate/index.vue
@@ -36,8 +36,9 @@ @@ -36,8 +36,9 @@
36 <el-form-item label="激活时间" prop="activateDate" v-if="openActivateTime"> 36 <el-form-item label="激活时间" prop="activateDate" v-if="openActivateTime">
37 <el-date-picker size="small" style="width: 200px" 37 <el-date-picker size="small" style="width: 200px"
38 v-model="queryParams.activateDate" 38 v-model="queryParams.activateDate"
39 - type="date"  
40 - value-format="yyyy-MM-dd" 39 + type="datetime"
  40 + format="yyyy-MM-dd HH:mm:ss"
  41 + value-format="yyyy-MM-dd HH:mm:ss"
41 placeholder="选择激活时间"> 42 placeholder="选择激活时间">
42 </el-date-picker> 43 </el-date-picker>
43 </el-form-item> 44 </el-form-item>
trash-workFlow/src/main/java/com/trash/business/controller/CompanyCreditController.java
@@ -20,6 +20,7 @@ import com.trash.common.core.domain.AjaxResult; @@ -20,6 +20,7 @@ import com.trash.common.core.domain.AjaxResult;
20 import com.trash.common.enums.BusinessType; 20 import com.trash.common.enums.BusinessType;
21 import com.trash.business.domain.CompanyCredit; 21 import com.trash.business.domain.CompanyCredit;
22 import com.trash.business.service.ICompanyCreditService; 22 import com.trash.business.service.ICompanyCreditService;
  23 +import com.trash.common.utils.SecurityUtils;
23 import com.trash.common.utils.poi.ExcelUtil; 24 import com.trash.common.utils.poi.ExcelUtil;
24 import com.trash.common.core.page.TableDataInfo; 25 import com.trash.common.core.page.TableDataInfo;
25 26
@@ -31,123 +32,110 @@ import com.trash.common.core.page.TableDataInfo; @@ -31,123 +32,110 @@ import com.trash.common.core.page.TableDataInfo;
31 */ 32 */
32 @RestController 33 @RestController
33 @RequestMapping("/business/companyCredit") 34 @RequestMapping("/business/companyCredit")
34 -public class CompanyCreditController extends BaseController  
35 -{  
36 - @Autowired  
37 - private ICompanyCreditService companyCreditService;  
38 -  
39 - /**  
40 - * 查询企业失信列表  
41 - */  
42 - @GetMapping("/list")  
43 - public TableDataInfo list(CompanyCredit companyCredit)  
44 - {  
45 - startPage();  
46 - List<CompanyCredit> list = companyCreditService.selectCompanyCreditList(companyCredit);  
47 - return getDataTable(list);  
48 - }  
49 -  
50 - @GetMapping("/historyCredit")  
51 - public TableDataInfo historyCredit(CompanyCredit companyCredit)  
52 - {  
53 - startPage();  
54 - List<CompanyCredit> list = companyCreditService.selectCompanyCreditHistory(companyCredit);  
55 - return getDataTable(list);  
56 - }  
57 -  
58 - @GetMapping("/names")  
59 - public List<String> getNames(CompanyCredit credit)  
60 - {  
61 - if(credit.getStatus() == 1){  
62 - credit.setStatus(null);  
63 - }  
64 - return companyCreditService.getNames(credit);  
65 - }  
66 - @GetMapping("/places")  
67 - public List<String> getPlaces(CompanyCredit credit)  
68 - {  
69 - if(credit.getStatus() == 1){  
70 - credit.setStatus(null);  
71 - }  
72 - return companyCreditService.getPlaces(credit);  
73 - }  
74 - /**  
75 - * 导出企业失信列表  
76 - */  
77 - @Log(title = "企业失信", businessType = BusinessType.EXPORT)  
78 - @GetMapping("/export")  
79 - public AjaxResult export(CompanyCredit companyCredit)  
80 - {  
81 - List<CompanyCredit> list = null;  
82 -  
83 - List<String> withOut = new ArrayList<String>();  
84 -  
85 - String tag = "企业失信";  
86 -  
87 - if(companyCredit.getStatus() == 1){  
88 - withOut.add("time");  
89 - tag = "企业历史失信";  
90 - list = companyCreditService.selectCompanyCreditHistory(companyCredit);  
91 - }else{  
92 - list = companyCreditService.selectCompanyCreditList(companyCredit);  
93 - }  
94 -  
95 - for(int i = 0;i<list.size();i++){  
96 - list.get(i).setId((long)i+1);  
97 - }  
98 -  
99 - ExcelUtil<CompanyCredit> util = new ExcelUtil<CompanyCredit>(CompanyCredit.class);  
100 -  
101 -  
102 -  
103 -  
104 - return util.exportExcel(list, tag,withOut);  
105 - }  
106 -  
107 - /**  
108 - * 获取企业失信详细信息  
109 - */  
110 - @GetMapping(value = "/{id}")  
111 - public AjaxResult getInfo(@PathVariable("id") Long id)  
112 - {  
113 - return AjaxResult.success(companyCreditService.selectCompanyCreditById(id));  
114 - }  
115 -  
116 - /**  
117 - * 新增企业失信  
118 - */  
119 - @Log(title = "企业失信", businessType = BusinessType.INSERT)  
120 - @PostMapping  
121 - public AjaxResult add(@RequestBody CompanyCredit companyCredit)  
122 - {  
123 - try { 35 +public class CompanyCreditController extends BaseController {
  36 + @Autowired
  37 + private ICompanyCreditService companyCreditService;
  38 +
  39 + /**
  40 + * 查询企业失信列表
  41 + */
  42 + @GetMapping("/list")
  43 + public TableDataInfo list(CompanyCredit companyCredit) {
  44 + startPage();
  45 + return getDataTable(companyCreditService.selectCompanyCreditList(companyCredit));
  46 + }
  47 +
  48 + @GetMapping("/historyCredit")
  49 + public TableDataInfo historyCredit(CompanyCredit companyCredit) {
  50 + startPage();
  51 + return getDataTable(companyCreditService.selectCompanyCreditHistory(companyCredit));
  52 + }
  53 +
  54 + @GetMapping("/names")
  55 + public List<String> getNames(CompanyCredit credit) {
  56 + if (credit.getStatus() == 1) {
  57 + credit.setStatus(null);
  58 + }
  59 + return companyCreditService.getNames(credit);
  60 + }
  61 +
  62 + @GetMapping("/places")
  63 + public List<String> getPlaces(CompanyCredit credit) {
  64 + if (credit.getStatus() == 1) {
  65 + credit.setStatus(null);
  66 + }
  67 + return companyCreditService.getPlaces(credit);
  68 + }
  69 +
  70 + /**
  71 + * 导出企业失信列表
  72 + */
  73 + @Log(title = "企业失信", businessType = BusinessType.EXPORT)
  74 + @GetMapping("/export")
  75 + public AjaxResult export(CompanyCredit companyCredit) {
  76 + List<CompanyCredit> list = null;
  77 +
  78 + List<String> withOut = new ArrayList<String>();
  79 +
  80 + String tag = "企业失信";
  81 +
  82 + if (companyCredit.getStatus() == 1) {
  83 + withOut.add("time");
  84 + tag = "企业历史失信";
  85 + list = companyCreditService.selectCompanyCreditHistory(companyCredit);
  86 + } else {
  87 + list = companyCreditService.selectCompanyCreditList(companyCredit);
  88 + }
  89 +
  90 + for (int i = 0; i < list.size(); i++) {
  91 + list.get(i).setId((long) i + 1);
  92 + }
  93 +
  94 + ExcelUtil<CompanyCredit> util = new ExcelUtil<CompanyCredit>(CompanyCredit.class);
  95 +
  96 + return util.exportExcel(list, tag, withOut);
  97 + }
  98 +
  99 + /**
  100 + * 获取企业失信详细信息
  101 + */
  102 + @GetMapping(value = "/{id}")
  103 + public AjaxResult getInfo(@PathVariable("id") Long id) {
  104 + return AjaxResult.success(companyCreditService.selectCompanyCreditById(id));
  105 + }
  106 +
  107 + /**
  108 + * 新增企业失信
  109 + */
  110 + @Log(title = "企业失信", businessType = BusinessType.INSERT)
  111 + @PostMapping
  112 + public AjaxResult add(@RequestBody CompanyCredit companyCredit) {
  113 + try {
124 return toAjax(companyCreditService.insertCompanyCredit(companyCredit)); 114 return toAjax(companyCreditService.insertCompanyCredit(companyCredit));
125 } catch (Exception e) { 115 } catch (Exception e) {
126 - return AjaxResult.error(e.getMessage()); 116 + return AjaxResult.error(e.getMessage());
127 } 117 }
128 - }  
129 -  
130 - /**  
131 - * 修改企业失信  
132 - */  
133 - @Log(title = "企业失信", businessType = BusinessType.UPDATE)  
134 - @PutMapping  
135 - public AjaxResult edit(@RequestBody CompanyCredit companyCredit)  
136 - {  
137 - try { 118 + }
  119 +
  120 + /**
  121 + * 修改企业失信
  122 + */
  123 + @Log(title = "企业失信", businessType = BusinessType.UPDATE)
  124 + @PutMapping
  125 + public AjaxResult edit(@RequestBody CompanyCredit companyCredit) {
  126 + try {
138 return toAjax(companyCreditService.updateCompanyCredit(companyCredit)); 127 return toAjax(companyCreditService.updateCompanyCredit(companyCredit));
139 } catch (Exception e) { 128 } catch (Exception e) {
140 - return AjaxResult.error(e.getMessage()); 129 + return AjaxResult.error(e.getMessage());
141 } 130 }
142 - }  
143 -  
144 - /**  
145 - * 删除企业失信  
146 - */  
147 - @Log(title = "企业失信", businessType = BusinessType.DELETE)  
148 - @DeleteMapping("/{ids}")  
149 - public AjaxResult remove(@PathVariable Long[] ids)  
150 - {  
151 - return toAjax(companyCreditService.deleteCompanyCreditByIds(ids));  
152 - } 131 + }
  132 +
  133 + /**
  134 + * 删除企业失信
  135 + */
  136 + @Log(title = "企业失信", businessType = BusinessType.DELETE)
  137 + @DeleteMapping("/{ids}")
  138 + public AjaxResult remove(@PathVariable Long[] ids) {
  139 + return toAjax(companyCreditService.deleteCompanyCreditByIds(ids));
  140 + }
153 } 141 }
154 \ No newline at end of file 142 \ No newline at end of file
trash-workFlow/src/main/java/com/trash/business/controller/ConstructionCreditController.java
@@ -14,13 +14,18 @@ import org.springframework.web.bind.annotation.RequestBody; @@ -14,13 +14,18 @@ import org.springframework.web.bind.annotation.RequestBody;
14 import org.springframework.web.bind.annotation.RequestMapping; 14 import org.springframework.web.bind.annotation.RequestMapping;
15 import org.springframework.web.bind.annotation.RestController; 15 import org.springframework.web.bind.annotation.RestController;
16 16
  17 +import com.alibaba.fastjson.JSONArray;
  18 +import com.alibaba.fastjson.JSONObject;
  19 +import com.trash.business.domain.CompanyCredit;
17 import com.trash.business.domain.ConstructionCredit; 20 import com.trash.business.domain.ConstructionCredit;
18 import com.trash.business.service.IConstructionCreditService; 21 import com.trash.business.service.IConstructionCreditService;
19 import com.trash.common.annotation.Log; 22 import com.trash.common.annotation.Log;
20 import com.trash.common.core.controller.BaseController; 23 import com.trash.common.core.controller.BaseController;
21 import com.trash.common.core.domain.AjaxResult; 24 import com.trash.common.core.domain.AjaxResult;
22 import com.trash.common.core.page.TableDataInfo; 25 import com.trash.common.core.page.TableDataInfo;
  26 +import com.trash.common.core.redis.RedisCache;
23 import com.trash.common.enums.BusinessType; 27 import com.trash.common.enums.BusinessType;
  28 +import com.trash.common.utils.SecurityUtils;
24 import com.trash.common.utils.poi.ExcelUtil; 29 import com.trash.common.utils.poi.ExcelUtil;
25 30
26 /** 31 /**
@@ -35,6 +40,7 @@ public class ConstructionCreditController extends BaseController @@ -35,6 +40,7 @@ public class ConstructionCreditController extends BaseController
35 { 40 {
36 @Autowired 41 @Autowired
37 private IConstructionCreditService constructionCreditService; 42 private IConstructionCreditService constructionCreditService;
  43 +
38 44
39 /** 45 /**
40 * 查询工地失信列表 46 * 查询工地失信列表
@@ -43,16 +49,17 @@ public class ConstructionCreditController extends BaseController @@ -43,16 +49,17 @@ public class ConstructionCreditController extends BaseController
43 public TableDataInfo list(ConstructionCredit constructionCredit) 49 public TableDataInfo list(ConstructionCredit constructionCredit)
44 { 50 {
45 startPage(); 51 startPage();
46 - List<ConstructionCredit> list = constructionCreditService.selectConstructionCreditList(constructionCredit);  
47 - return getDataTable(list); 52 +
  53 + return getDataTable(constructionCreditService.selectConstructionCreditList(constructionCredit));
48 } 54 }
49 55
50 @GetMapping("/historyCredit") 56 @GetMapping("/historyCredit")
51 public TableDataInfo historyCredit(ConstructionCredit constructionCredit) 57 public TableDataInfo historyCredit(ConstructionCredit constructionCredit)
52 { 58 {
53 startPage(); 59 startPage();
54 - List<ConstructionCredit> list = constructionCreditService.selectConstructionCreditHistory(constructionCredit);  
55 - return getDataTable(list); 60 +
  61 +
  62 + return getDataTable(constructionCreditService.selectConstructionCreditHistory(constructionCredit));
56 } 63 }
57 64
58 65
trash-workFlow/src/main/java/com/trash/business/controller/EarthsitesCreditController.java
@@ -3,6 +3,8 @@ package com.trash.business.controller; @@ -3,6 +3,8 @@ package com.trash.business.controller;
3 import java.util.ArrayList; 3 import java.util.ArrayList;
4 import java.util.List; 4 import java.util.List;
5 5
  6 +import com.alibaba.fastjson.JSONArray;
  7 +import com.alibaba.fastjson.JSONObject;
6 import com.trash.business.domain.ConstructionCredit; 8 import com.trash.business.domain.ConstructionCredit;
7 import org.springframework.security.access.prepost.PreAuthorize; 9 import org.springframework.security.access.prepost.PreAuthorize;
8 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,8 +22,10 @@ import com.trash.common.core.domain.AjaxResult; @@ -20,8 +22,10 @@ import com.trash.common.core.domain.AjaxResult;
20 import com.trash.common.enums.BusinessType; 22 import com.trash.common.enums.BusinessType;
21 import com.trash.business.domain.EarthsitesCredit; 23 import com.trash.business.domain.EarthsitesCredit;
22 import com.trash.business.service.IEarthsitesCreditService; 24 import com.trash.business.service.IEarthsitesCreditService;
  25 +import com.trash.common.utils.SecurityUtils;
23 import com.trash.common.utils.poi.ExcelUtil; 26 import com.trash.common.utils.poi.ExcelUtil;
24 import com.trash.common.core.page.TableDataInfo; 27 import com.trash.common.core.page.TableDataInfo;
  28 +import com.trash.common.core.redis.RedisCache;
25 29
26 /** 30 /**
27 * 处理场所失信Controller 31 * 处理场所失信Controller
@@ -44,6 +48,9 @@ public class EarthsitesCreditController extends BaseController @@ -44,6 +48,9 @@ public class EarthsitesCreditController extends BaseController
44 { 48 {
45 startPage(); 49 startPage();
46 List<EarthsitesCredit> list = earthsitesCreditService.selectEarthsitesCreditList(earthsitesCredit); 50 List<EarthsitesCredit> list = earthsitesCreditService.selectEarthsitesCreditList(earthsitesCredit);
  51 +
  52 +
  53 +
47 return getDataTable(list); 54 return getDataTable(list);
48 } 55 }
49 56
@@ -118,6 +125,7 @@ public class EarthsitesCreditController extends BaseController @@ -118,6 +125,7 @@ public class EarthsitesCreditController extends BaseController
118 { 125 {
119 startPage(); 126 startPage();
120 List<EarthsitesCredit> list = earthsitesCreditService.selectEarthsitesCreditHistory(earthsitesCredit); 127 List<EarthsitesCredit> list = earthsitesCreditService.selectEarthsitesCreditHistory(earthsitesCredit);
  128 +
121 return getDataTable(list); 129 return getDataTable(list);
122 } 130 }
123 131
trash-workFlow/src/main/java/com/trash/business/controller/SupervisionThreestepController.java
@@ -70,61 +70,8 @@ public class SupervisionThreestepController extends BaseController @@ -70,61 +70,8 @@ public class SupervisionThreestepController extends BaseController
70 public TableDataInfo list(SupervisionThreestep supervisionThreestep) 70 public TableDataInfo list(SupervisionThreestep supervisionThreestep)
71 { 71 {
72 startPage(); 72 startPage();
73 - supervisionThreestep.setCreateBy(SecurityUtils.getUsername());  
74 -  
75 - JSONArray depts = redisCache.getCacheObject("CSUserDepartmentType");  
76 -  
77 - JSONArray areas = redisCache.getCacheObject("areas");  
78 -  
79 - if(areas == null){  
80 - areas = RemoteServerUtils.getAreas();  
81 - redisCache.setCacheObject("areas", areas);  
82 - }  
83 -  
84 - if(depts == null){  
85 - Map<String, String> map = new HashMap<String, String>();  
86 - map.put("type", "CSUserDepartmentType");  
87 - depts = RemoteServerUtils.getDict(map);  
88 - redisCache.setCacheObject("CSUserDepartmentType", depts);  
89 - }  
90 - 73 +
91 74
92 - for(Object object :depts){  
93 - JSONObject dept = (JSONObject) object;  
94 - List<String> roles = SecurityUtils.getLoginUser().getUser().getRoleIds();  
95 -  
96 - for(String role:roles){  
97 - if(dept.getString("code").equals(role)){  
98 -  
99 - if(dept.getString("name").equals("事务中心")){  
100 - supervisionThreestep.setCreateBy(null);  
101 - break;  
102 - }  
103 -  
104 - if(dept.getString("name").contains("渣土办")){  
105 -  
106 - String deptName = dept.getString("name").replace("渣土办", "");  
107 -  
108 - if(!deptName.isEmpty()){  
109 -  
110 - for(Object obj:areas){  
111 - JSONObject area = (JSONObject)obj;  
112 -  
113 - if(area.getString("name").equals(deptName)){  
114 -  
115 - supervisionThreestep.setPlace(area.getString("code"));  
116 - supervisionThreestep.setCreateBy(null);  
117 - break;  
118 - }  
119 - }  
120 - }  
121 -  
122 - }  
123 - }  
124 - }  
125 - }  
126 -  
127 -  
128 List<SupervisionThreestep> list = supervisionThreestepService.selectSupervisionThreestepList(supervisionThreestep); 75 List<SupervisionThreestep> list = supervisionThreestepService.selectSupervisionThreestepList(supervisionThreestep);
129 return getDataTable(list); 76 return getDataTable(list);
130 } 77 }
@@ -286,101 +233,7 @@ public class SupervisionThreestepController extends BaseController @@ -286,101 +233,7 @@ public class SupervisionThreestepController extends BaseController
286 @PostMapping("/todayDataList") 233 @PostMapping("/todayDataList")
287 public List<SupervisionThreestep> todayDataList(@RequestBody SupervisionThreestep supervisionThreestep) 234 public List<SupervisionThreestep> todayDataList(@RequestBody SupervisionThreestep supervisionThreestep)
288 { 235 {
289 -  
290 - JSONArray depts = redisCache.getCacheObject("CSUserDepartmentType");  
291 -  
292 - if(depts == null){  
293 - Map<String, String> map = new HashMap<String, String>();  
294 - map.put("type", "CSUserDepartmentType");  
295 - depts = RemoteServerUtils.getDict(map);  
296 - redisCache.setCacheObject("CSUserDepartmentType", depts);  
297 - }  
298 -  
299 -  
300 - for(Object object :depts){  
301 - JSONObject dept = (JSONObject) object;  
302 - List<String> roles = SecurityUtils.getLoginUser().getUser().getRoleIds();  
303 -  
304 - for(String role:roles){  
305 - if(dept.getString("code").equals(role)){  
306 - if(dept.getString("name").equals("事务中心")){  
307 - supervisionThreestep.setType(0L);  
308 - supervisionThreestep.setStatus(1L);  
309 -  
310 - List<SupervisionThreestep> threesteps = supervisionThreestepService.selectTodayDataList(supervisionThreestep);  
311 -  
312 - return supervisionThreestepService.selectTodayDataList(supervisionThreestep);  
313 - }  
314 -  
315 - if(dept.getString("name").contains("渣土办")){  
316 - String areaCode = dept.getString("code");  
317 - if(!areaCode.isEmpty()){  
318 - supervisionThreestep.setPlace(areaCode);  
319 - supervisionThreestep.setCreateBy(null);  
320 - supervisionThreestep.setType(0L);  
321 - supervisionThreestep.setStatus(1L);  
322 -  
323 -  
324 - List<SupervisionThreestep> threesteps = supervisionThreestepService.selectTodayDataList(supervisionThreestep);  
325 -  
326 - return supervisionThreestepService.selectTodayDataList(supervisionThreestep);  
327 - }  
328 - }  
329 - }  
330 - }  
331 - }  
332 -  
333 - String companyName = null;  
334 -  
335 - JSONArray compnayList = redisCache.getCacheObject("companyList");  
336 - for(Object obj:compnayList){  
337 - JSONObject con = (JSONObject) obj;  
338 -  
339 - if(con.getString("abbreviation").equals(SecurityUtils.getUsername().replace("公司", ""))){  
340 - companyName = con.getString("name");  
341 - break;  
342 - }  
343 -  
344 - }  
345 -  
346 - List<SupervisionThreestep> threesteps = supervisionThreestepService.selectTodayDataList(supervisionThreestep);  
347 -  
348 - JSONArray array = redisCache.getCacheObject("constructionList");  
349 -  
350 - List<SupervisionThreestep> data = new ArrayList<>();  
351 -  
352 - if(companyName == null)  
353 - return data;  
354 -  
355 - for(SupervisionThreestep three:threesteps){  
356 - for(Object obj:array){  
357 - JSONObject con = (JSONObject) obj;  
358 - if(three.getObjectId().equals(con.getString("id"))){  
359 -  
360 - if(con.getString("transportCompany") != null && con.getString("transportCompany").equals(companyName)){  
361 -  
362 - data.add(three);  
363 -  
364 - continue;  
365 - }  
366 -  
367 - JSONArray array2 = RemoteServerUtils.getUnitetransport(con.getString("id"));  
368 -  
369 - for(Object comObj:array2){  
370 - JSONObject company = (JSONObject) comObj;  
371 -  
372 - if(company.getString("companyName") != null && company.getString("companyName").equals(companyName)){  
373 -  
374 - data.add(three);  
375 - break;  
376 - }  
377 - }  
378 - }  
379 - }  
380 -  
381 - }  
382 -  
383 - return data; 236 + return supervisionThreestepService.selectTodayDataList(supervisionThreestep);
384 } 237 }
385 238
386 239
trash-workFlow/src/main/java/com/trash/business/controller/TruckActivateController.java
@@ -66,80 +66,7 @@ public class TruckActivateController extends BaseController @@ -66,80 +66,7 @@ public class TruckActivateController extends BaseController
66 { 66 {
67 startPage(); 67 startPage();
68 68
69 - List<TruckActivate> list = new ArrayList<>();  
70 -  
71 - Map<String, String> map = new HashMap<String, String>();  
72 - map.put("type", "CSUserDepartmentType");  
73 - JSONArray depts = RemoteServerUtils.getDict(map);  
74 -  
75 - for(Object object :depts){  
76 - JSONObject dept = (JSONObject) object;  
77 - List<String> roles = SecurityUtils.getLoginUser().getUser().getRoleIds();  
78 -  
79 - for(String role:roles){  
80 - if(dept.getString("code").equals(role)){  
81 -  
82 - if(dept.getString("name").equals("事务中心")){  
83 - list = truckActivateService.selectTruckActivateList(truckActivate);  
84 - return getDataTable(list);  
85 - }  
86 -  
87 - if(dept.getString("name").contains("渣土办")){  
88 - String areaCode = dept.getString("code");  
89 - if(!areaCode.isEmpty()){  
90 - SupervisionThreestep supervisionThreestep = new SupervisionThreestep();  
91 - supervisionThreestep.setPlace(areaCode);  
92 - supervisionThreestep.setCreateBy(null);  
93 - supervisionThreestep.setType(0L);  
94 - supervisionThreestep.setStatus(1L);  
95 -  
96 -  
97 - List<SupervisionThreestep> threesteps = threestepService.selectTodayDataList(supervisionThreestep);  
98 - String names = null;  
99 - for(SupervisionThreestep three :threesteps){  
100 - if(names == null){  
101 - names = three.getName();  
102 - }else{  
103 - names += "," + three.getName();  
104 - }  
105 - }  
106 -  
107 - if(names == null){  
108 - return getDataTable(list);  
109 - }  
110 -  
111 - truckActivate.setcIds(names.split(","));  
112 -  
113 - list = truckActivateMapper.selectTruckActivateListByConstructions(truckActivate);  
114 -  
115 - return getDataTable(list);  
116 -  
117 - }  
118 - }  
119 - }  
120 - }  
121 - }  
122 - String companyName = null;  
123 -  
124 - JSONArray compnayList = redisCache.getCacheObject("companyList");  
125 - for(Object obj:compnayList){  
126 - JSONObject con = (JSONObject) obj;  
127 -  
128 - if(con.getString("abbreviation").equals(SecurityUtils.getUsername().replace("公司", ""))){  
129 - companyName = con.getString("name");  
130 - break;  
131 - }  
132 - }  
133 -  
134 - if(companyName == null){  
135 - return getDataTable(list);  
136 - }  
137 -  
138 - truckActivate.setCompany(companyName);  
139 -  
140 -  
141 - list = truckActivateService.selectTruckActivateList(truckActivate);  
142 - return getDataTable(list); 69 + return getDataTable(truckActivateService.selectTruckActivateList(truckActivate));
143 } 70 }
144 71
145 /** 72 /**
@@ -236,7 +163,6 @@ public class TruckActivateController extends BaseController @@ -236,7 +163,6 @@ public class TruckActivateController extends BaseController
236 List<TruckActivate> list = truckActivateService.getActivedTruckList(truckActivate); 163 List<TruckActivate> list = truckActivateService.getActivedTruckList(truckActivate);
237 164
238 for(TruckActivate t:list){ 165 for(TruckActivate t:list){
239 - t.setParams(null);  
240 if(t.getActivateTime() == null){ 166 if(t.getActivateTime() == null){
241 t.setIsAct("0"); 167 t.setIsAct("0");
242 }else{ 168 }else{
@@ -270,6 +196,20 @@ public class TruckActivateController extends BaseController @@ -270,6 +196,20 @@ public class TruckActivateController extends BaseController
270 196
271 } 197 }
272 198
  199 + @PostMapping(value="/getTruckHistoryListByObjects")
  200 + public AjaxResult getTruckHistoryListByObjects(@RequestBody TruckActivate truckActivate)
  201 + {
  202 +
  203 + AjaxResult ajaxResult = AjaxResult.success();
  204 + try {
  205 + ajaxResult.put("result", truckActivateService.getTruckHistoryListByObjects(truckActivate));
  206 + } catch (Exception e) {
  207 + e.printStackTrace();
  208 + }
  209 +
  210 + return ajaxResult;
  211 +
  212 + }
273 213
274 /** 214 /**
275 * 修改车辆激活 215 * 修改车辆激活
trash-workFlow/src/main/java/com/trash/business/domain/CompanyCredit.java
1 package com.trash.business.domain; 1 package com.trash.business.domain;
2 2
3 import java.util.Date; 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 import com.fasterxml.jackson.annotation.JsonFormat; 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 import org.apache.commons.lang3.builder.ToStringBuilder; 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 import org.apache.commons.lang3.builder.ToStringStyle; 8 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -47,8 +49,20 @@ public class CompanyCredit extends BaseEntity @@ -47,8 +49,20 @@ public class CompanyCredit extends BaseEntity
47 49
48 /** 基础数据ID */ 50 /** 基础数据ID */
49 private String objectId; 51 private String objectId;
  52 +
  53 + private List<String> ids;
  54 +
  55 +
  56 +
  57 + public List<String> getIds() {
  58 + return ids;
  59 + }
  60 +
  61 + public void setIds(List<String> ids) {
  62 + this.ids = ids;
  63 + }
50 64
51 - public void setId(Long id) 65 + public void setId(Long id)
52 { 66 {
53 this.id = id; 67 this.id = id;
54 } 68 }
trash-workFlow/src/main/java/com/trash/business/domain/ConstructionCredit.java
1 package com.trash.business.domain; 1 package com.trash.business.domain;
2 2
3 import java.util.Date; 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 import com.fasterxml.jackson.annotation.JsonFormat; 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 import org.apache.commons.lang3.builder.ToStringBuilder; 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 import org.apache.commons.lang3.builder.ToStringStyle; 8 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -41,8 +43,18 @@ public class ConstructionCredit extends BaseEntity @@ -41,8 +43,18 @@ public class ConstructionCredit extends BaseEntity
41 private Long lostCredit; 43 private Long lostCredit;
42 44
43 private String objectId; 45 private String objectId;
  46 + List<String> ids;
  47 +
44 48
45 49
  50 + public List<String> getIds() {
  51 + return ids;
  52 + }
  53 +
  54 + public void setIds(List<String> ids) {
  55 + this.ids = ids;
  56 + }
  57 +
46 public void setId(Long id) 58 public void setId(Long id)
47 { 59 {
48 this.id = id; 60 this.id = id;
trash-workFlow/src/main/java/com/trash/business/domain/DriverCredit.java
1 package com.trash.business.domain; 1 package com.trash.business.domain;
2 2
3 import java.util.Date; 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 import com.fasterxml.jackson.annotation.JsonFormat; 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 import org.apache.commons.lang3.builder.ToStringBuilder; 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 import org.apache.commons.lang3.builder.ToStringStyle; 8 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -52,7 +54,17 @@ public class DriverCredit extends BaseEntity @@ -52,7 +54,17 @@ public class DriverCredit extends BaseEntity
52 /** 基础数据ID */ 54 /** 基础数据ID */
53 private String objectId; 55 private String objectId;
54 56
  57 + List<String> ids;
  58 +
  59 +
  60 +
  61 + public List<String> getIds() {
  62 + return ids;
  63 + }
55 64
  65 + public void setIds(List<String> ids) {
  66 + this.ids = ids;
  67 + }
56 68
57 public String getLicenseplateNo() { 69 public String getLicenseplateNo() {
58 return licenseplateNo; 70 return licenseplateNo;
trash-workFlow/src/main/java/com/trash/business/domain/EarthsitesCredit.java
1 package com.trash.business.domain; 1 package com.trash.business.domain;
2 2
3 import java.util.Date; 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 import com.fasterxml.jackson.annotation.JsonFormat; 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 import org.apache.commons.lang3.builder.ToStringBuilder; 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 import org.apache.commons.lang3.builder.ToStringStyle; 8 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -51,6 +53,17 @@ public class EarthsitesCredit extends BaseEntity @@ -51,6 +53,17 @@ public class EarthsitesCredit extends BaseEntity
51 53
52 /** 基础数据ID */ 54 /** 基础数据ID */
53 private String objectId; 55 private String objectId;
  56 + List<String> ids;
  57 +
  58 +
  59 +
  60 + public List<String> getIds() {
  61 + return ids;
  62 + }
  63 +
  64 + public void setIds(List<String> ids) {
  65 + this.ids = ids;
  66 + }
54 67
55 public void setId(Long id) 68 public void setId(Long id)
56 { 69 {
trash-workFlow/src/main/java/com/trash/business/domain/SupervisionThreestep.java
1 package com.trash.business.domain; 1 package com.trash.business.domain;
2 2
3 import java.util.Date; 3 import java.util.Date;
  4 +import java.util.List;
4 5
5 import com.alibaba.druid.sql.visitor.functions.If; 6 import com.alibaba.druid.sql.visitor.functions.If;
6 import com.fasterxml.jackson.annotation.JsonFormat; 7 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -141,16 +142,16 @@ public class SupervisionThreestep extends BaseEntity @@ -141,16 +142,16 @@ public class SupervisionThreestep extends BaseEntity
141 142
142 private String his; 143 private String his;
143 144
144 - private String[] ids; 145 + private List<String> ids;
145 146
146 147
147 148
148 149
149 - public String[] getIds() { 150 + public List<String> getIds() {
150 return ids; 151 return ids;
151 } 152 }
152 153
153 - public void setIds(String[] ids) { 154 + public void setIds(List<String> ids) {
154 this.ids = ids; 155 this.ids = ids;
155 } 156 }
156 157
trash-workFlow/src/main/java/com/trash/business/domain/TruckActivate.java
@@ -16,7 +16,7 @@ import com.trash.common.core.domain.BaseEntity; @@ -16,7 +16,7 @@ import com.trash.common.core.domain.BaseEntity;
16 * @author trash 16 * @author trash
17 * @date 2023-05-02 17 * @date 2023-05-02
18 */ 18 */
19 -public class TruckActivate extends BaseEntity 19 +public class TruckActivate
20 { 20 {
21 private static final long serialVersionUID = 1L; 21 private static final long serialVersionUID = 1L;
22 22
@@ -70,7 +70,7 @@ public class TruckActivate extends BaseEntity @@ -70,7 +70,7 @@ public class TruckActivate extends BaseEntity
70 70
71 private String activateStatus; 71 private String activateStatus;
72 72
73 - private String[] cIds; 73 + private List<String> cIds;
74 74
75 private int createCount; 75 private int createCount;
76 76
@@ -92,8 +92,50 @@ public class TruckActivate extends BaseEntity @@ -92,8 +92,50 @@ public class TruckActivate extends BaseEntity
92 92
93 private String earthList; 93 private String earthList;
94 94
  95 + private String createBy;
  96 +
  97 + private String coord;
  98 +
  99 +
  100 + private Date createTime;
  101 +
  102 +
  103 + private List<String> ids;
  104 +
95 105
96 106
  107 + public List<String> getIds() {
  108 + return ids;
  109 + }
  110 +
  111 + public void setIds(List<String> ids) {
  112 + this.ids = ids;
  113 + }
  114 +
  115 + public String getCoord() {
  116 + return coord;
  117 + }
  118 +
  119 + public void setCoord(String coord) {
  120 + this.coord = coord;
  121 + }
  122 +
  123 + public String getCreateBy() {
  124 + return createBy;
  125 + }
  126 +
  127 + public void setCreateBy(String createBy) {
  128 + this.createBy = createBy;
  129 + }
  130 +
  131 + public Date getCreateTime() {
  132 + return createTime;
  133 + }
  134 +
  135 + public void setCreateTime(Date createTime) {
  136 + this.createTime = createTime;
  137 + }
  138 +
97 public String getRouteInfo() { 139 public String getRouteInfo() {
98 return routeInfo; 140 return routeInfo;
99 } 141 }
@@ -182,11 +224,11 @@ public class TruckActivate extends BaseEntity @@ -182,11 +224,11 @@ public class TruckActivate extends BaseEntity
182 this.constructionId = constructionId; 224 this.constructionId = constructionId;
183 } 225 }
184 226
185 - public String[] getcIds() { 227 + public List<String> getcIds() {
186 return cIds; 228 return cIds;
187 } 229 }
188 230
189 - public void setcIds(String[] cIds) { 231 + public void setcIds(List<String> cIds) {
190 this.cIds = cIds; 232 this.cIds = cIds;
191 } 233 }
192 234
trash-workFlow/src/main/java/com/trash/business/domain/TruckCredit.java
@@ -7,6 +7,7 @@ import com.trash.common.annotation.Excel; @@ -7,6 +7,7 @@ import com.trash.common.annotation.Excel;
7 import com.trash.common.core.domain.BaseEntity; 7 import com.trash.common.core.domain.BaseEntity;
8 8
9 import java.util.Date; 9 import java.util.Date;
  10 +import java.util.List;
10 11
11 /** 12 /**
12 * 车辆失信对象 truck_credit 13 * 车辆失信对象 truck_credit
@@ -48,8 +49,20 @@ public class TruckCredit extends BaseEntity @@ -48,8 +49,20 @@ public class TruckCredit extends BaseEntity
48 /** 失信原因 */ 49 /** 失信原因 */
49 @Excel(name = "失信原因") 50 @Excel(name = "失信原因")
50 private String reason; 51 private String reason;
  52 +
  53 + List<String> ids;
  54 +
  55 +
  56 +
  57 + public List<String> getIds() {
  58 + return ids;
  59 + }
  60 +
  61 + public void setIds(List<String> ids) {
  62 + this.ids = ids;
  63 + }
51 64
52 - public String getLicensePlate() { 65 + public String getLicensePlate() {
53 return licensePlate; 66 return licensePlate;
54 } 67 }
55 68
trash-workFlow/src/main/java/com/trash/business/mapper/TruckActivateMapper.java
@@ -76,4 +76,6 @@ public interface TruckActivateMapper @@ -76,4 +76,6 @@ public interface TruckActivateMapper
76 public List<TruckActivate> selectTodayTruckByObjIds(String[] objs); 76 public List<TruckActivate> selectTodayTruckByObjIds(String[] objs);
77 77
78 public List<TruckActivate> getTruckListByObjects(TruckActivate truckActivate); 78 public List<TruckActivate> getTruckListByObjects(TruckActivate truckActivate);
  79 +
  80 + public List<TruckActivate> getTruckHistoryListByObjects(TruckActivate truckActivate);
79 } 81 }
trash-workFlow/src/main/java/com/trash/business/service/ITruckActivateService.java
1 package com.trash.business.service; 1 package com.trash.business.service;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +import java.util.Map;
  5 +
4 import com.trash.business.domain.TruckActivate; 6 import com.trash.business.domain.TruckActivate;
5 import com.trash.common.core.domain.AjaxResult; 7 import com.trash.common.core.domain.AjaxResult;
6 8
@@ -67,4 +69,6 @@ public interface ITruckActivateService @@ -67,4 +69,6 @@ public interface ITruckActivateService
67 public List<TruckActivate> getActivedTruckList(TruckActivate truckActivate); 69 public List<TruckActivate> getActivedTruckList(TruckActivate truckActivate);
68 70
69 public List<TruckActivate> getTruckListByObjects(TruckActivate truckActivate); 71 public List<TruckActivate> getTruckListByObjects(TruckActivate truckActivate);
  72 +
  73 + public List<Map> getTruckHistoryListByObjects(TruckActivate truckActivate);
70 } 74 }
trash-workFlow/src/main/java/com/trash/business/service/impl/CompanyCreditServiceImpl.java
@@ -55,8 +55,16 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService @@ -55,8 +55,16 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService
55 */ 55 */
56 @Override 56 @Override
57 public List<CompanyCredit> selectCompanyCreditList(CompanyCredit companyCredit) 57 public List<CompanyCredit> selectCompanyCreditList(CompanyCredit companyCredit)
58 - {  
59 - return companyCreditMapper.selectCompanyCreditList(companyCredit); 58 + {
  59 + List<CompanyCredit> list = new ArrayList<>();
  60 +
  61 + if (SecurityUtils.getLoginUser().getUser().getCompanyIds().size() > 0) {
  62 + companyCredit.setIds(SecurityUtils.getLoginUser().getUser().getCompanyIds());
  63 + list = companyCreditMapper.selectCompanyCreditList(companyCredit);
  64 + }
  65 +
  66 +
  67 + return list;
60 } 68 }
61 69
62 /** 70 /**
@@ -265,8 +273,16 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService @@ -265,8 +273,16 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService
265 273
266 @Override 274 @Override
267 public List<CompanyCredit> selectCompanyCreditHistory(CompanyCredit companyCredit) 275 public List<CompanyCredit> selectCompanyCreditHistory(CompanyCredit companyCredit)
268 - {  
269 - return companyCreditMapper.selectCompanyCreditHistory(companyCredit); 276 + {
  277 + List<CompanyCredit> list = new ArrayList<>();
  278 +
  279 + if (SecurityUtils.getLoginUser().getUser().getCompanyIds().size() > 0) {
  280 + companyCredit.setIds(SecurityUtils.getLoginUser().getUser().getCompanyIds());
  281 + list = companyCreditMapper.selectCompanyCreditHistory(companyCredit);
  282 + }
  283 +
  284 +
  285 + return list;
270 } 286 }
271 287
272 /** 288 /**
trash-workFlow/src/main/java/com/trash/business/service/impl/ConstructionCreditServiceImpl.java
@@ -10,11 +10,15 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -10,11 +10,15 @@ import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
11 import org.springframework.transaction.annotation.Transactional; 11 import org.springframework.transaction.annotation.Transactional;
12 12
  13 +import com.alibaba.fastjson.JSONArray;
  14 +import com.alibaba.fastjson.JSONObject;
13 import com.trash.business.domain.CompanyCredit; 15 import com.trash.business.domain.CompanyCredit;
14 import com.trash.business.domain.ConstructionCredit; 16 import com.trash.business.domain.ConstructionCredit;
15 import com.trash.business.mapper.ConstructionCreditMapper; 17 import com.trash.business.mapper.ConstructionCreditMapper;
16 import com.trash.business.service.IConstructionCreditService; 18 import com.trash.business.service.IConstructionCreditService;
  19 +import com.trash.common.core.redis.RedisCache;
17 import com.trash.common.utils.RemoteServerUtils; 20 import com.trash.common.utils.RemoteServerUtils;
  21 +import com.trash.common.utils.SecurityUtils;
18 22
19 /** 23 /**
20 * 三查机制Service业务层处理 24 * 三查机制Service业务层处理
@@ -28,6 +32,9 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService @@ -28,6 +32,9 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService
28 @Autowired 32 @Autowired
29 private ConstructionCreditMapper constructionCreditMapper; 33 private ConstructionCreditMapper constructionCreditMapper;
30 34
  35 +
  36 + @Autowired
  37 + RedisCache redis;
31 /** 38 /**
32 * 查询三查机制 39 * 查询三查机制
33 * 40 *
@@ -49,13 +56,71 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService @@ -49,13 +56,71 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService
49 @Override 56 @Override
50 public List<ConstructionCredit> selectConstructionCreditList(ConstructionCredit constructionCredit) 57 public List<ConstructionCredit> selectConstructionCreditList(ConstructionCredit constructionCredit)
51 { 58 {
52 - return constructionCreditMapper.selectConstructionCreditList(constructionCredit); 59 + List<ConstructionCredit> list = new ArrayList<>();
  60 + if (SecurityUtils.getLoginUser().getUser().getConAreas().size() > 0 || SecurityUtils.getLoginUser().getUser().getConList().size() > 0) {
  61 + List<String> ids = new ArrayList<>();
  62 + for(String str:SecurityUtils.getLoginUser().getUser().getConList()){
  63 + ids.add(str);
  64 + }
  65 +
  66 +
  67 + if(SecurityUtils.getLoginUser().getUser().getConAreas().size() > 0){
  68 +
  69 + List<String> cArea = SecurityUtils.getLoginUser().getUser().getConAreas();
  70 +
  71 + JSONArray jsonArray = redis.getCacheObject("constructionList");
  72 +
  73 + for(Object obj:jsonArray){
  74 + JSONObject json = (JSONObject) obj;
  75 + if(cArea.indexOf(json.getString("areaCode")) > -1){
  76 + ids.add(json.getString("id"));
  77 + }
  78 + }
  79 + }
  80 +
  81 + constructionCredit.setIds(ids);
  82 +
  83 +
  84 + list = constructionCreditMapper.selectConstructionCreditList(constructionCredit);
  85 + }
  86 +
  87 +
  88 + return list;
53 } 89 }
54 90
55 @Override 91 @Override
56 public List<ConstructionCredit> selectConstructionCreditHistory(ConstructionCredit constructionCredit) 92 public List<ConstructionCredit> selectConstructionCreditHistory(ConstructionCredit constructionCredit)
57 - {  
58 - return constructionCreditMapper.selectConstructionCreditHistory(constructionCredit); 93 + {
  94 + List<ConstructionCredit> list = new ArrayList<>();
  95 +
  96 + if (SecurityUtils.getLoginUser().getUser().getConAreas().size() > 0 || SecurityUtils.getLoginUser().getUser().getConList().size() > 0) {
  97 + List<String> ids = new ArrayList<>();
  98 + for(String str:SecurityUtils.getLoginUser().getUser().getConList()){
  99 + ids.add(str);
  100 + }
  101 +
  102 +
  103 + if(SecurityUtils.getLoginUser().getUser().getConAreas().size() > 0){
  104 +
  105 + List<String> cArea = SecurityUtils.getLoginUser().getUser().getConAreas();
  106 +
  107 + JSONArray jsonArray = redis.getCacheObject("constructionList");
  108 +
  109 + for(Object obj:jsonArray){
  110 + JSONObject json = (JSONObject) obj;
  111 + if(cArea.indexOf(json.getString("areaCode")) > -1){
  112 + ids.add(json.getString("id"));
  113 + }
  114 + }
  115 + }
  116 +
  117 + constructionCredit.setIds(ids);
  118 +
  119 +
  120 + list = constructionCreditMapper.selectConstructionCreditHistory(constructionCredit);
  121 + }
  122 +
  123 + return list;
59 } 124 }
60 125
61 126
trash-workFlow/src/main/java/com/trash/business/service/impl/DriverCreditServiceImpl.java
1 package com.trash.business.service.impl; 1 package com.trash.business.service.impl;
2 2
  3 +import java.util.ArrayList;
3 import java.util.Date; 4 import java.util.Date;
  5 +import java.util.HashMap;
4 import java.util.List; 6 import java.util.List;
  7 +import java.util.Map;
5 8
6 import com.trash.business.domain.TruckCredit; 9 import com.trash.business.domain.TruckCredit;
7 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Service; 11 import org.springframework.stereotype.Service;
9 import com.trash.business.mapper.DriverCreditMapper; 12 import com.trash.business.mapper.DriverCreditMapper;
  13 +import com.alibaba.fastjson.JSONArray;
  14 +import com.alibaba.fastjson.JSONObject;
10 import com.trash.business.domain.DriverCredit; 15 import com.trash.business.domain.DriverCredit;
  16 +import com.trash.business.domain.EarthsitesCredit;
11 import com.trash.business.service.IDriverCreditService; 17 import com.trash.business.service.IDriverCreditService;
  18 +import com.trash.common.config.trashConfig;
  19 +import com.trash.common.utils.RemoteServerUtils;
12 import com.trash.common.utils.SecurityUtils; 20 import com.trash.common.utils.SecurityUtils;
13 21
14 import org.springframework.transaction.annotation.Transactional; 22 import org.springframework.transaction.annotation.Transactional;
@@ -43,10 +51,43 @@ public class DriverCreditServiceImpl implements IDriverCreditService @@ -43,10 +51,43 @@ public class DriverCreditServiceImpl implements IDriverCreditService
43 * @param driverCredit 驾驶员失信 51 * @param driverCredit 驾驶员失信
44 * @return 驾驶员失信 52 * @return 驾驶员失信
45 */ 53 */
  54 + @Autowired
  55 + private trashConfig trashConfig;
  56 +
46 @Override 57 @Override
47 public List<DriverCredit> selectDriverCreditList(DriverCredit driverCredit) 58 public List<DriverCredit> selectDriverCreditList(DriverCredit driverCredit)
48 { 59 {
49 - return driverCreditMapper.selectDriverCreditList(driverCredit); 60 +
  61 + List<DriverCredit> list = new ArrayList<>();
  62 +
  63 + List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds();
  64 +
  65 +
  66 + if (companys.size() > 0) {
  67 +
  68 + List<String> ids = new ArrayList<>();
  69 +
  70 + JSONArray jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken());
  71 +
  72 + for(Object obj:jsonArray){
  73 + JSONObject json = (JSONObject) obj;
  74 + if(companys.indexOf(json.getString("companyId")) > -1){
  75 + ids.add(json.getString("id"));
  76 + }
  77 + }
  78 +
  79 +
  80 + driverCredit.setIds(ids);
  81 +
  82 +
  83 +
  84 + list = driverCreditMapper.selectDriverCreditList(driverCredit);
  85 + }
  86 +
  87 +
  88 +
  89 + return list;
  90 +
50 } 91 }
51 92
52 /** 93 /**
@@ -118,8 +159,36 @@ public class DriverCreditServiceImpl implements IDriverCreditService @@ -118,8 +159,36 @@ public class DriverCreditServiceImpl implements IDriverCreditService
118 159
119 @Override 160 @Override
120 public List<DriverCredit> selectDriverCreditHistory(DriverCredit driverCredit) 161 public List<DriverCredit> selectDriverCreditHistory(DriverCredit driverCredit)
121 - {  
122 - return driverCreditMapper.selectDriverCreditHistory(driverCredit); 162 + {
  163 +
  164 + List<DriverCredit> list = new ArrayList<>();
  165 +
  166 + List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds();
  167 +
  168 +
  169 + if (companys.size() > 0) {
  170 +
  171 + List<String> ids = new ArrayList<>();
  172 +
  173 + JSONArray jsonArray = RemoteServerUtils.getDriverList(trashConfig.getToken());
  174 +
  175 + for(Object obj:jsonArray){
  176 + JSONObject json = (JSONObject) obj;
  177 + if(companys.indexOf(json.getString("companyId")) > -1){
  178 + ids.add(json.getString("id"));
  179 + }
  180 + }
  181 +
  182 +
  183 + driverCredit.setIds(ids);
  184 +
  185 +
  186 +
  187 + list = driverCreditMapper.selectDriverCreditHistory(driverCredit);
  188 + }
  189 +
  190 +
  191 + return list;
123 } 192 }
124 193
125 /** 194 /**
@@ -133,8 +202,11 @@ public class DriverCreditServiceImpl implements IDriverCreditService @@ -133,8 +202,11 @@ public class DriverCreditServiceImpl implements IDriverCreditService
133 { 202 {
134 return driverCreditMapper.deleteDriverCreditByIds(ids); 203 return driverCreditMapper.deleteDriverCreditByIds(ids);
135 } 204 }
136 - 205 +
  206 +
  207 +
137 public List<String> getNames(DriverCredit driverCredit) { 208 public List<String> getNames(DriverCredit driverCredit) {
  209 +
138 return driverCreditMapper.getNames(driverCredit); 210 return driverCreditMapper.getNames(driverCredit);
139 } 211 }
140 212
trash-workFlow/src/main/java/com/trash/business/service/impl/EarthsitesCreditServiceImpl.java
@@ -9,9 +9,12 @@ import java.util.Map; @@ -9,9 +9,12 @@ import java.util.Map;
9 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
11 import com.trash.business.mapper.EarthsitesCreditMapper; 11 import com.trash.business.mapper.EarthsitesCreditMapper;
  12 +import com.alibaba.fastjson.JSONArray;
  13 +import com.alibaba.fastjson.JSONObject;
12 import com.trash.business.domain.ConstructionCredit; 14 import com.trash.business.domain.ConstructionCredit;
13 import com.trash.business.domain.EarthsitesCredit; 15 import com.trash.business.domain.EarthsitesCredit;
14 import com.trash.business.service.IEarthsitesCreditService; 16 import com.trash.business.service.IEarthsitesCreditService;
  17 +import com.trash.common.core.redis.RedisCache;
15 import com.trash.common.utils.RemoteServerUtils; 18 import com.trash.common.utils.RemoteServerUtils;
16 import com.trash.common.utils.SecurityUtils; 19 import com.trash.common.utils.SecurityUtils;
17 20
@@ -27,6 +30,8 @@ public class EarthsitesCreditServiceImpl implements IEarthsitesCreditService @@ -27,6 +30,8 @@ public class EarthsitesCreditServiceImpl implements IEarthsitesCreditService
27 @Autowired 30 @Autowired
28 private EarthsitesCreditMapper earthsitesCreditMapper; 31 private EarthsitesCreditMapper earthsitesCreditMapper;
29 32
  33 + @Autowired
  34 + RedisCache redis;
30 /** 35 /**
31 * 查询处理场所失信 36 * 查询处理场所失信
32 * 37 *
@@ -48,7 +53,38 @@ public class EarthsitesCreditServiceImpl implements IEarthsitesCreditService @@ -48,7 +53,38 @@ public class EarthsitesCreditServiceImpl implements IEarthsitesCreditService
48 @Override 53 @Override
49 public List<EarthsitesCredit> selectEarthsitesCreditList(EarthsitesCredit earthsitesCredit) 54 public List<EarthsitesCredit> selectEarthsitesCreditList(EarthsitesCredit earthsitesCredit)
50 { 55 {
51 - return earthsitesCreditMapper.selectEarthsitesCreditList(earthsitesCredit); 56 + List<EarthsitesCredit> list = new ArrayList<>();
  57 +
  58 + List<String> eLish = SecurityUtils.getLoginUser().getUser().getEarthList();
  59 + List<String> eArea = SecurityUtils.getLoginUser().getUser().getEarthAreas();
  60 +
  61 + if (eLish.size() > 0 || eArea.size() > 0) {
  62 + List<String> ids = new ArrayList<>();
  63 + for(String str:eLish){
  64 + ids.add(str);
  65 + }
  66 +
  67 +
  68 + if(eArea.size() > 0){
  69 +
  70 + JSONArray jsonArray = redis.getCacheObject("earthSitesList");
  71 +
  72 + for(Object obj:jsonArray){
  73 + JSONObject json = (JSONObject) obj;
  74 + if(eArea.indexOf(json.getString("areaCode")) > -1){
  75 + ids.add(json.getString("id"));
  76 + }
  77 + }
  78 + }
  79 +
  80 + earthsitesCredit.setIds(ids);
  81 +
  82 +
  83 + list = earthsitesCreditMapper.selectEarthsitesCreditList(earthsitesCredit);
  84 + }
  85 +
  86 +
  87 + return list;
52 } 88 }
53 89
54 /** 90 /**
@@ -161,6 +197,36 @@ public class EarthsitesCreditServiceImpl implements IEarthsitesCreditService @@ -161,6 +197,36 @@ public class EarthsitesCreditServiceImpl implements IEarthsitesCreditService
161 197
162 @Override 198 @Override
163 public List<EarthsitesCredit> selectEarthsitesCreditHistory(EarthsitesCredit earthsitesCredit) { 199 public List<EarthsitesCredit> selectEarthsitesCreditHistory(EarthsitesCredit earthsitesCredit) {
164 - return earthsitesCreditMapper.selectEarthsitesCreditHistory(earthsitesCredit); 200 + List<EarthsitesCredit> list = new ArrayList<>();
  201 +
  202 + List<String> eLish = SecurityUtils.getLoginUser().getUser().getEarthList();
  203 + List<String> eArea = SecurityUtils.getLoginUser().getUser().getEarthAreas();
  204 +
  205 + if (eLish.size() > 0 || eArea.size() > 0) {
  206 + List<String> ids = new ArrayList<>();
  207 + for(String str:eLish){
  208 + ids.add(str);
  209 + }
  210 +
  211 +
  212 + if(eArea.size() > 0){
  213 +
  214 + JSONArray jsonArray = redis.getCacheObject("earthSitesList");
  215 +
  216 + for(Object obj:jsonArray){
  217 + JSONObject json = (JSONObject) obj;
  218 + if(eArea.indexOf(json.getString("areaCode")) > -1){
  219 + ids.add(json.getString("id"));
  220 + }
  221 + }
  222 + }
  223 +
  224 + earthsitesCredit.setIds(ids);
  225 +
  226 +
  227 + list = earthsitesCreditMapper.selectEarthsitesCreditHistory(earthsitesCredit);
  228 + }
  229 +
  230 + return list;
165 } 231 }
166 } 232 }
167 \ No newline at end of file 233 \ No newline at end of file
trash-workFlow/src/main/java/com/trash/business/service/impl/SupervisionThreestepServiceImpl.java
@@ -53,8 +53,10 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -53,8 +53,10 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
53 53
54 @Autowired 54 @Autowired
55 TruckActivateMapper truckActivateMapper; 55 TruckActivateMapper truckActivateMapper;
56 -  
57 - 56 +
  57 + @Autowired
  58 + RedisCache redis;
  59 +
58 /** 60 /**
59 * 查询三查机制 61 * 查询三查机制
60 * 62 *
@@ -76,6 +78,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -76,6 +78,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
76 */ 78 */
77 @Override 79 @Override
78 public List<SupervisionThreestep> selectSupervisionThreestepList(SupervisionThreestep supervisionThreestep) { 80 public List<SupervisionThreestep> selectSupervisionThreestepList(SupervisionThreestep supervisionThreestep) {
  81 + List<SupervisionThreestep> list = new ArrayList<>();
79 if (supervisionThreestep.getWorkStartTime() == null && supervisionThreestep.getStatus() == null) { 82 if (supervisionThreestep.getWorkStartTime() == null && supervisionThreestep.getStatus() == null) {
80 String start, end; 83 String start, end;
81 84
@@ -111,15 +114,64 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -111,15 +114,64 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
111 supervisionThreestep.setWorkEndTime(new Date("2099-01-01 00:00:00")); 114 supervisionThreestep.setWorkEndTime(new Date("2099-01-01 00:00:00"));
112 } 115 }
113 if (supervisionThreestep.getWorkStartTime() == supervisionThreestep.getWorkEndTime()) { 116 if (supervisionThreestep.getWorkStartTime() == supervisionThreestep.getWorkEndTime()) {
114 - 117 +
115 Date date = supervisionThreestep.getWorkStartTime(); 118 Date date = supervisionThreestep.getWorkStartTime();
116 - date.setDate(date.getDate()+1); 119 + date.setDate(date.getDate() + 1);
117 supervisionThreestep.setWorkEndTime(date); 120 supervisionThreestep.setWorkEndTime(date);
118 } 121 }
119 } 122 }
  123 +
  124 +
  125 +
  126 + List<String> ids = new ArrayList<>();
  127 +
  128 + List<String> eLish = SecurityUtils.getLoginUser().getUser().getEarthList();
  129 + List<String> eArea = SecurityUtils.getLoginUser().getUser().getEarthAreas();
  130 + List<String> cArea = SecurityUtils.getLoginUser().getUser().getConAreas();
  131 +
  132 + for(String str:SecurityUtils.getLoginUser().getUser().getConList()){
  133 + ids.add(str);
  134 + }
  135 +
  136 + if(SecurityUtils.getLoginUser().getUser().getConAreas().size() > 0){
  137 +
  138 +
  139 + JSONArray jsonArray = redis.getCacheObject("constructionList");
  140 +
  141 + for(Object obj:jsonArray){
  142 + JSONObject json = (JSONObject) obj;
  143 + if(cArea.indexOf(json.getString("areaCode")) > -1){
  144 + ids.add(json.getString("id"));
  145 + }
  146 + }
  147 + }
  148 +
  149 + for(String str:eLish){
  150 + ids.add(str);
  151 + }
  152 +
  153 + if(eArea.size() > 0){
  154 +
  155 + JSONArray jsonArray = redis.getCacheObject("earthSitesList");
  156 +
  157 + for(Object obj:jsonArray){
  158 + JSONObject json = (JSONObject) obj;
  159 + if(eArea.indexOf(json.getString("areaCode")) > -1){
  160 + ids.add(json.getString("id"));
  161 + }
  162 + }
  163 + }
  164 +
  165 + supervisionThreestep.setIds(ids);
  166 +
  167 + if(ids.size() == 0){
  168 +
  169 + return list;
  170 + }
  171 +
  172 +
120 173
121 - List<SupervisionThreestep> list = supervisionThreestepMapper  
122 - .selectSupervisionThreestepList(supervisionThreestep); 174 + list = supervisionThreestepMapper.selectSupervisionThreestepList(supervisionThreestep);
123 175
124 return list; 176 return list;
125 } 177 }
@@ -129,8 +181,6 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -129,8 +181,6 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
129 if (supervisionThreestep.getWorkStartTime() == null && supervisionThreestep.getStatus() == null) { 181 if (supervisionThreestep.getWorkStartTime() == null && supervisionThreestep.getStatus() == null) {
130 String start, end; 182 String start, end;
131 183
132 -  
133 -  
134 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd"); 184 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
135 Date date = new Date(); 185 Date date = new Date();
136 186
@@ -164,34 +214,28 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -164,34 +214,28 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
164 supervisionThreestep.setWorkEndTime(new Date("2099-01-01 00:00:00")); 214 supervisionThreestep.setWorkEndTime(new Date("2099-01-01 00:00:00"));
165 } 215 }
166 if (supervisionThreestep.getWorkStartTime() == supervisionThreestep.getWorkEndTime()) { 216 if (supervisionThreestep.getWorkStartTime() == supervisionThreestep.getWorkEndTime()) {
167 - 217 +
168 Date date = supervisionThreestep.getWorkStartTime(); 218 Date date = supervisionThreestep.getWorkStartTime();
169 - date.setDate(date.getDate()+1); 219 + date.setDate(date.getDate() + 1);
170 supervisionThreestep.setWorkEndTime(date); 220 supervisionThreestep.setWorkEndTime(date);
171 } 221 }
172 } 222 }
173 -  
174 -  
175 - 223 +
176 return supervisionThreestepMapper.getNames(supervisionThreestep); 224 return supervisionThreestepMapper.getNames(supervisionThreestep);
177 } 225 }
178 226
179 -  
180 SimpleDateFormat dateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 227 SimpleDateFormat dateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
181 -  
182 228
183 - String[] outside = {"长沙县", "望城区", "浏阳市", "宁乡市", "株洲市", "湘潭市", "汩罗市", "湘阴县"};  
184 - 229 + String[] outside = { "长沙县", "望城区", "浏阳市", "宁乡市", "株洲市", "湘潭市", "汩罗市", "湘阴县" };
  230 +
185 @SuppressWarnings("unchecked") 231 @SuppressWarnings("unchecked")
186 @Override 232 @Override
187 - public List<Map<String,String>> selectDayWorkList(SupervisionThreestep supervisionThreestep) {  
188 -  
189 - SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");  
190 - if (supervisionThreestep.getWorkStartTime() == null) { 233 + public List<Map<String, String>> selectDayWorkList(SupervisionThreestep supervisionThreestep) {
  234 +
  235 + SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
  236 + if (supervisionThreestep.getWorkStartTime() == null) {
191 String start, end; 237 String start, end;
192 238
193 -  
194 -  
195 Date date = new Date(); 239 Date date = new Date();
196 240
197 if (new Date().getHours() < 8) { 241 if (new Date().getHours() < 8) {
@@ -214,7 +258,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -214,7 +258,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
214 // TODO Auto-generated catch block 258 // TODO Auto-generated catch block
215 e.printStackTrace(); 259 e.printStackTrace();
216 } 260 }
217 - if(supervisionThreestep.getHis().equals("1")){ 261 + if (supervisionThreestep.getHis().equals("1")) {
218 try { 262 try {
219 supervisionThreestep.setWorkStartTime(dateTime.parse("2000-01-01 00:00:00")); 263 supervisionThreestep.setWorkStartTime(dateTime.parse("2000-01-01 00:00:00"));
220 supervisionThreestep.setWorkEndTime(dateTime.parse("2100-01-01 00:00:00")); 264 supervisionThreestep.setWorkEndTime(dateTime.parse("2100-01-01 00:00:00"));
@@ -224,178 +268,144 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -224,178 +268,144 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
224 } 268 }
225 } 269 }
226 } 270 }
227 -  
228 - 271 +
229 JSONArray contracts = redisCache.getCacheObject("contractList"); 272 JSONArray contracts = redisCache.getCacheObject("contractList");
230 -  
231 - if(contracts == null){ 273 +
  274 + if (contracts == null) {
232 Map param = new HashMap<>(); 275 Map param = new HashMap<>();
233 - 276 +
234 param.put("page", 1); 277 param.put("page", 1);
235 param.put("size", 99999); 278 param.put("size", 99999);
236 param.put("contractStatus", 1); 279 param.put("contractStatus", 1);
237 param.put("auditStatus", 1); 280 param.put("auditStatus", 1);
238 -  
239 - 281 +
240 contracts = RemoteServerUtils.getContractList(param); 282 contracts = RemoteServerUtils.getContractList(param);
241 - redisCache.setCacheObject("contractList",contracts); 283 + redisCache.setCacheObject("contractList", contracts);
242 } 284 }
243 -  
244 -  
245 - JSONArray depts = redisCache.getCacheObject("CSUserDepartmentType");  
246 -  
247 - JSONArray areas = redisCache.getCacheObject("areas");  
248 -  
249 - String place = null,eplace = null,name= null,ename= null;  
250 -  
251 - String areaCode = "";  
252 -  
253 - if(areas == null){  
254 - areas = RemoteServerUtils.getAreas();  
255 - redisCache.setCacheObject("areas", areas);  
256 - }  
257 -  
258 - if(depts == null){  
259 - Map<String, String> map = new HashMap<String, String>();  
260 - map.put("type", "CSUserDepartmentType");  
261 - depts = RemoteServerUtils.getDict(map);  
262 - redisCache.setCacheObject("CSUserDepartmentType", depts);  
263 - }  
264 -  
265 -  
266 285
267 - boolean isAdmin = false;  
268 - for(Object object :depts){  
269 - JSONObject dept = (JSONObject) object;  
270 - List<String> roles = SecurityUtils.getLoginUser().getUser().getRoleIds();  
271 -  
272 - for(String role:roles){  
273 - if(dept.getString("code").equals(role)){  
274 - if(dept.getString("name").equals("事务中心")){  
275 - supervisionThreestep.setPlace(null);  
276 - isAdmin = true;  
277 - break;  
278 - }else  
279 - if(dept.getString("name").contains("渣土办")){  
280 - areaCode = dept.getString("code");  
281 - if(!areaCode.isEmpty()){  
282 - supervisionThreestep.setPlace(areaCode);  
283 - break;  
284 - }  
285 - }  
286 - }  
287 - }  
288 - if(isAdmin){  
289 - break;  
290 - }  
291 - }  
292 -  
293 -  
294 -  
295 - List<SupervisionThreestep> allList = supervisionThreestepMapper.selectDayWorkList(supervisionThreestep);  
296 - List<SupervisionThreestep> filterList = new ArrayList<>();  
297 -  
298 - List<SupervisionThreestep> constructions = new ArrayList<>();  
299 - List<SupervisionThreestep> earthsites = new ArrayList<>();  
300 -  
301 - List<Map<String,String>> list = new ArrayList<>();  
302 -  
303 - if(!isAdmin && areaCode.isEmpty()){  
304 - String companyName = null;  
305 - JSONArray compnayList = redisCache.getCacheObject("companyList");  
306 - for(Object obj:compnayList){  
307 - JSONObject con = (JSONObject) obj;  
308 - if(con.getString("abbreviation").equals(SecurityUtils.getUsername().replace("公司", ""))){  
309 - companyName = con.getString("name");  
310 - break;  
311 - }  
312 - }  
313 -  
314 - if(companyName != null){  
315 -  
316 - JSONArray array = redisCache.getCacheObject("constructionList");  
317 -  
318 - for(SupervisionThreestep three:allList){  
319 - if(three.getType() == 1){  
320 - filterList.add(three);  
321 - continue;  
322 - }  
323 -  
324 -  
325 - for(Object obj:array){  
326 - JSONObject con = (JSONObject) obj;  
327 - if(three.getObjectId().equals(con.getString("id"))){  
328 -  
329 - if(con.getString("transportCompany") != null && con.getString("transportCompany").equals(companyName)){  
330 -  
331 - filterList.add(three);  
332 - continue;  
333 - }  
334 -  
335 - JSONArray array2 = RemoteServerUtils.getUnitetransport(con.getString("id"));  
336 -  
337 - for(Object comObj:array2){  
338 - JSONObject company = (JSONObject) comObj;  
339 -  
340 - if(company.getString("companyName") != null && company.getString("companyName").equals(companyName)){  
341 -  
342 - filterList.add(three);  
343 - break;  
344 - }  
345 - }  
346 - }  
347 - }  
348 -  
349 - }  
350 - }  
351 - }else{  
352 - filterList = allList;  
353 - }  
354 -  
355 -  
356 - for(SupervisionThreestep s: filterList){ 286 + JSONArray areas = redisCache.getCacheObject("areas");
  287 +
  288 + String place = null, eplace = null, name = null, ename = null;
  289 +
  290 + String areaCode = "";
  291 +
  292 + if (areas == null) {
  293 + areas = RemoteServerUtils.getAreas();
  294 + redisCache.setCacheObject("areas", areas);
  295 + }
  296 +
  297 + // boolean isAdmin = false;
  298 + //
  299 + // if
  300 + // ("事务中心".equals(SecurityUtils.getLoginUser().getUser().getCompanyName()))
  301 + // {
  302 + // supervisionThreestep.setPlace(null);
  303 + // isAdmin = true;
  304 + // } else if
  305 + // ("渣土办".equals(SecurityUtils.getLoginUser().getUser().getCompanyName()))
  306 + // {
  307 + // supervisionThreestep.setPlace(SecurityUtils.getLoginUser().getUser().getAreaCode());
  308 + // areaCode = SecurityUtils.getLoginUser().getUser().getAreaCode();
  309 + // isAdmin = true;
  310 + // }
  311 +
  312 + List<SupervisionThreestep> allList = supervisionThreestepMapper.selectDayWorkList(supervisionThreestep);
  313 + List<SupervisionThreestep> filterList = new ArrayList<>();
  314 +
  315 + List<SupervisionThreestep> constructions = new ArrayList<>();
  316 + List<SupervisionThreestep> earthsites = new ArrayList<>();
  317 +
  318 + List<Map<String, String>> list = new ArrayList<>();
  319 +
  320 + String companyName = SecurityUtils.getLoginUser().getUser().getCompanyName();
  321 +
  322 + // if (!isAdmin && areaCode.isEmpty()) {
  323 + //
  324 + // if (companyName != null) {
  325 + //
  326 + // JSONArray array = redisCache.getCacheObject("constructionList");
  327 + //
  328 + // for (SupervisionThreestep three : allList) {
  329 + // if (three.getType() == 1) {
  330 + // filterList.add(three);
  331 + // continue;
  332 + // }
  333 + //
  334 + // for (Object obj : array) {
  335 + // JSONObject con = (JSONObject) obj;
  336 + // if (three.getObjectId().equals(con.getString("id"))) {
  337 + //
  338 + // if (con.getString("transportCompany") != null
  339 + // && con.getString("transportCompany").equals(companyName)) {
  340 + //
  341 + // filterList.add(three);
  342 + // continue;
  343 + // }
  344 + //
  345 + // JSONArray array2 =
  346 + // RemoteServerUtils.getUnitetransport(con.getString("id"));
  347 + //
  348 + // for (Object comObj : array2) {
  349 + // JSONObject company = (JSONObject) comObj;
  350 + //
  351 + // if (company.getString("companyName") != null
  352 + // && company.getString("companyName").equals(companyName)) {
  353 + //
  354 + // filterList.add(three);
  355 + // break;
  356 + // }
  357 + // }
  358 + // }
  359 + // }
  360 + //
  361 + // }
  362 + // }
  363 + // } else {
  364 + filterList = allList;
  365 + // }
  366 +
  367 + for (SupervisionThreestep s : filterList) {
357 if (s.getType() == 1) { 368 if (s.getType() == 1) {
358 - for(Object object:areas){  
359 - JSONObject area = (JSONObject)object;  
360 - if(s.getPlace().equals(area.getString("code"))){ 369 + for (Object object : areas) {
  370 + JSONObject area = (JSONObject) object;
  371 + if (s.getPlace().equals(area.getString("code"))) {
361 s.setPlace(area.getString("name")); 372 s.setPlace(area.getString("name"));
362 } 373 }
363 -  
364 - if(areaCode.equals(area.getString("code"))){ 374 +
  375 + if (areaCode.equals(area.getString("code"))) {
365 areaCode = area.getString("name"); 376 areaCode = area.getString("name");
366 } 377 }
  378 + }
367 } 379 }
368 - }  
369 -  
370 -  
371 - if(supervisionThreestep.getHis().equals("1")){  
372 - if(yearFomat.format(s.getSelfCheckTime()).equals(yearFomat.format(new Date()))){ 380 +
  381 + if (supervisionThreestep.getHis().equals("1")) {
  382 + if (yearFomat.format(s.getSelfCheckTime()).equals(yearFomat.format(new Date()))) {
373 continue; 383 continue;
374 } 384 }
375 } 385 }
376 -  
377 - if(s.getType() == 0){ 386 +
  387 + if (s.getType() == 0) {
378 constructions.add(s); 388 constructions.add(s);
379 - }else{ 389 + } else {
380 earthsites.add(s); 390 earthsites.add(s);
381 } 391 }
382 } 392 }
383 -  
384 - for(SupervisionThreestep s:constructions){  
385 -  
386 - if(supervisionThreestep.getHis().equals("1")){  
387 - for(SupervisionThreestep e:earthsites){  
388 -  
389 - if(!s.getEarthsitesId().contains(e.getObjectId())) 393 +
  394 + for (SupervisionThreestep s : constructions) {
  395 +
  396 + if (supervisionThreestep.getHis().equals("1")) {
  397 + for (SupervisionThreestep e : earthsites) {
  398 +
  399 + if (!s.getEarthsitesId().contains(e.getObjectId()))
390 continue; 400 continue;
391 -  
392 - if(yearFomat.format(s.getCreateTime()).equals(yearFomat.format(e.getCreateTime()))){  
393 -  
394 - if(s.getStatus() != 1 || e.getStatus() != 1){ 401 +
  402 + if (yearFomat.format(s.getCreateTime()).equals(yearFomat.format(e.getCreateTime()))) {
  403 +
  404 + if (s.getStatus() != 1 || e.getStatus() != 1) {
395 continue; 405 continue;
396 } 406 }
397 -  
398 - Map<String,String> map = new HashMap<String, String>(); 407 +
  408 + Map<String, String> map = new HashMap<String, String>();
399 map.put("id", s.getId() + ""); 409 map.put("id", s.getId() + "");
400 map.put("createTime", yearFomat.format(s.getCreateTime())); 410 map.put("createTime", yearFomat.format(s.getCreateTime()));
401 map.put("name", s.getName()); 411 map.put("name", s.getName());
@@ -407,39 +417,38 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -407,39 +417,38 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
407 map.put("eid", e.getObjectId()); 417 map.put("eid", e.getObjectId());
408 map.put("ename", e.getName()); 418 map.put("ename", e.getName());
409 map.put("eplace", e.getPlace()); 419 map.put("eplace", e.getPlace());
410 - map.put("estatus", "开工" ); 420 + map.put("estatus", "开工");
411 map.put("eselfCheckTime", dateTime.format(e.getSelfCheckTime())); 421 map.put("eselfCheckTime", dateTime.format(e.getSelfCheckTime()));
412 map.put("etype", ""); 422 map.put("etype", "");
413 - 423 +
414 map.put("descript", "有效开工"); 424 map.put("descript", "有效开工");
415 - 425 +
416 list.add(map); 426 list.add(map);
417 } 427 }
418 } 428 }
419 - }else{  
420 - for(Object object : contracts){ 429 + } else {
  430 + for (Object object : contracts) {
421 JSONObject jsonObject = (JSONObject) object; 431 JSONObject jsonObject = (JSONObject) object;
422 -  
423 - if(!s.getObjectId().equals(jsonObject.getString("constructionSiteID"))) 432 +
  433 + if (!s.getObjectId().equals(jsonObject.getString("constructionSiteID")))
424 continue; 434 continue;
425 -  
426 - for(SupervisionThreestep e:earthsites){  
427 -  
428 - if(!supervisionThreestep.getHis().equals("1") && !e.getObjectId().equals(jsonObject.getString("earthSiteID"))) 435 +
  436 + for (SupervisionThreestep e : earthsites) {
  437 +
  438 + if (!supervisionThreestep.getHis().equals("1")
  439 + && !e.getObjectId().equals(jsonObject.getString("earthSiteID")))
429 continue; 440 continue;
430 -  
431 - if(supervisionThreestep.getHis().equals("1") && !s.getEarthsitesId().contains(e.getObjectId())) 441 +
  442 + if (supervisionThreestep.getHis().equals("1") && !s.getEarthsitesId().contains(e.getObjectId()))
432 continue; 443 continue;
433 -  
434 - if(yearFomat.format(s.getCreateTime()).equals(yearFomat.format(e.getCreateTime()))){  
435 -  
436 - if(s.getStatus() != 1 || e.getStatus() != 1){ 444 +
  445 + if (yearFomat.format(s.getCreateTime()).equals(yearFomat.format(e.getCreateTime()))) {
  446 +
  447 + if (s.getStatus() != 1 || e.getStatus() != 1) {
437 continue; 448 continue;
438 } 449 }
439 -  
440 - System.out.println(jsonObject.get("contractNo"));  
441 -  
442 - Map<String,String> map = new HashMap<String, String>(); 450 +
  451 + Map<String, String> map = new HashMap<String, String>();
443 map.put("id", s.getId() + ""); 452 map.put("id", s.getId() + "");
444 map.put("createTime", yearFomat.format(s.getCreateTime())); 453 map.put("createTime", yearFomat.format(s.getCreateTime()));
445 map.put("name", s.getName()); 454 map.put("name", s.getName());
@@ -451,142 +460,130 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -451,142 +460,130 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
451 map.put("eid", e.getObjectId()); 460 map.put("eid", e.getObjectId());
452 map.put("ename", e.getName()); 461 map.put("ename", e.getName());
453 map.put("eplace", e.getPlace()); 462 map.put("eplace", e.getPlace());
454 - map.put("estatus", "开工" ); 463 + map.put("estatus", "开工");
455 map.put("eselfCheckTime", dateTime.format(e.getSelfCheckTime())); 464 map.put("eselfCheckTime", dateTime.format(e.getSelfCheckTime()));
456 map.put("etype", ""); 465 map.put("etype", "");
457 - 466 +
458 map.put("descript", "有效开工"); 467 map.put("descript", "有效开工");
459 - 468 +
460 list.add(map); 469 list.add(map);
461 } 470 }
462 } 471 }
463 } 472 }
464 } 473 }
465 - 474 +
466 } 475 }
467 476
468 -  
469 List FilterList = new ArrayList<>(); 477 List FilterList = new ArrayList<>();
470 -  
471 -  
472 -  
473 - if(supervisionThreestep.getPlace()!=null){ 478 +
  479 + if (supervisionThreestep.getPlace() != null) {
474 place = supervisionThreestep.getPlace(); 480 place = supervisionThreestep.getPlace();
475 } 481 }
476 - if(supervisionThreestep.getName()!=null){ 482 + if (supervisionThreestep.getName() != null) {
477 name = supervisionThreestep.getName(); 483 name = supervisionThreestep.getName();
478 } 484 }
479 - if(supervisionThreestep.getEarthsitesName()!=null){ 485 + if (supervisionThreestep.getEarthsitesName() != null) {
480 ename = supervisionThreestep.getEarthsitesName(); 486 ename = supervisionThreestep.getEarthsitesName();
481 } 487 }
482 - if(supervisionThreestep.getSubReason() !=null){ 488 + if (supervisionThreestep.getSubReason() != null) {
483 eplace = supervisionThreestep.getSubReason(); 489 eplace = supervisionThreestep.getSubReason();
484 } 490 }
485 -  
486 - for(Map<String,String> map:list){  
487 - if(place != null){  
488 - if(!place.equals(map.get("place"))){ 491 +
  492 + for (Map<String, String> map : list) {
  493 + if (place != null) {
  494 + if (!place.equals(map.get("place"))) {
489 continue; 495 continue;
490 } 496 }
491 } 497 }
492 - if(eplace != null){  
493 - if(!eplace.equals(map.get("eplace"))){ 498 + if (eplace != null) {
  499 + if (!eplace.equals(map.get("eplace"))) {
494 continue; 500 continue;
495 } 501 }
496 } 502 }
497 - if(name != null){  
498 - if(map.get("name").indexOf(name) == -1){ 503 + if (name != null) {
  504 + if (map.get("name").indexOf(name) == -1) {
499 continue; 505 continue;
500 } 506 }
501 } 507 }
502 - if(ename != null){  
503 - if(map.get("ename").indexOf(ename) == -1){ 508 + if (ename != null) {
  509 + if (map.get("ename").indexOf(ename) == -1) {
504 continue; 510 continue;
505 } 511 }
506 } 512 }
507 - 513 +
508 FilterList.add(map); 514 FilterList.add(map);
509 - 515 +
510 } 516 }
511 517
512 return FilterList; 518 return FilterList;
513 } 519 }
514 -  
515 -  
516 520
517 @Override 521 @Override
518 public List<Map> selectDayWorkListByType(SupervisionThreestep supervisionThreestep) { 522 public List<Map> selectDayWorkListByType(SupervisionThreestep supervisionThreestep) {
519 523
520 -  
521 -  
522 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd"); 524 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
523 - String start, end; 525 + String start, end;
524 526
525 - Date date = new Date(); 527 + Date date = new Date();
526 528
527 - if (new Date().getHours() < 8) {  
528 - end = yearFomat.format(date);  
529 - date.setDate(date.getDate() - 1);  
530 - start = yearFomat.format(date);  
531 - } else {  
532 - start = yearFomat.format(date);  
533 - date.setDate(date.getDate() + 1);  
534 - end = yearFomat.format(date);  
535 - } 529 + if (new Date().getHours() < 8) {
  530 + end = yearFomat.format(date);
  531 + date.setDate(date.getDate() - 1);
  532 + start = yearFomat.format(date);
  533 + } else {
  534 + start = yearFomat.format(date);
  535 + date.setDate(date.getDate() + 1);
  536 + end = yearFomat.format(date);
  537 + }
536 538
537 - end += " 4:00:00";  
538 - start += " 8:00:00"; 539 + end += " 4:00:00";
  540 + start += " 8:00:00";
539 541
540 - try {  
541 - supervisionThreestep.setWorkStartTime(dateTime.parse(start));  
542 - supervisionThreestep.setWorkEndTime(dateTime.parse(end));  
543 - } catch (Exception e) {  
544 - // TODO Auto-generated catch block  
545 - e.printStackTrace();  
546 - } 542 + try {
  543 + supervisionThreestep.setWorkStartTime(dateTime.parse(start));
  544 + supervisionThreestep.setWorkEndTime(dateTime.parse(end));
  545 + } catch (Exception e) {
  546 + // TODO Auto-generated catch block
  547 + e.printStackTrace();
  548 + }
547 549
  550 + List<Map> map = supervisionThreestepMapper.selectDayWorkListByType(supervisionThreestep);
548 551
549 -  
550 - List<Map> map = supervisionThreestepMapper.selectDayWorkListByType(supervisionThreestep);  
551 -  
552 - List<Map> list = new ArrayList<>();  
553 -  
554 - for(Map m : map){  
555 - if(supervisionThreestep.getType() == 0){ 552 + List<Map> list = new ArrayList<>();
  553 +
  554 + for (Map m : map) {
  555 + if (supervisionThreestep.getType() == 0) {
556 JSONObject object = RemoteServerUtils.getConstructionInfo(m.get("id").toString()); 556 JSONObject object = RemoteServerUtils.getConstructionInfo(m.get("id").toString());
557 -  
558 - if(object != null){  
559 - String endTime = object.get("transportEndTime").toString();  
560 -  
561 - if(new Date().getTime() < DateUtils.dateTime("YYYY-MM-DD HH:mm", yearFomat.format(date) + " " + endTime).getTime()){  
562 - continue; 557 +
  558 + if (object != null) {
  559 + String endTime = object.get("transportEndTime").toString();
  560 +
  561 + if (new Date().getTime() < DateUtils
  562 + .dateTime("YYYY-MM-DD HH:mm", yearFomat.format(date) + " " + endTime).getTime()) {
  563 + continue;
563 } 564 }
564 } 565 }
565 } 566 }
566 - 567 +
567 List<String> idStrings = new ArrayList<String>(); 568 List<String> idStrings = new ArrayList<String>();
568 List<TruckActivate> trucks = truckActivateMapper.selectTodayTruckActivateByObjId(m.get("id").toString()); 569 List<TruckActivate> trucks = truckActivateMapper.selectTodayTruckActivateByObjId(m.get("id").toString());
569 - for(TruckActivate truck:trucks){  
570 - idStrings.add(truck.getObjectId()); 570 + for (TruckActivate truck : trucks) {
  571 + idStrings.add(truck.getObjectId());
571 } 572 }
572 -  
573 - m.put("vehicleIdList", idStrings);  
574 -  
575 - list.add(m);  
576 - }  
577 -  
578 -  
579 -  
580 - return list; 573 +
  574 + m.put("vehicleIdList", idStrings);
  575 +
  576 + list.add(m);
  577 + }
  578 +
  579 + return list;
581 580
582 } 581 }
583 -  
584 -  
585 - public List<SupervisionThreestep> selectTodayDataList(SupervisionThreestep supervisionThreestep){  
586 -  
587 - 582 +
  583 + public List<SupervisionThreestep> selectTodayDataList(SupervisionThreestep supervisionThreestep) {
  584 +
588 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd"); 585 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
589 - if(supervisionThreestep.getWorkStartTime() == null){ 586 + if (supervisionThreestep.getWorkStartTime() == null) {
590 String start, end; 587 String start, end;
591 588
592 Date date = new Date(); 589 Date date = new Date();
@@ -612,11 +609,37 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -612,11 +609,37 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
612 e.printStackTrace(); 609 e.printStackTrace();
613 } 610 }
614 } 611 }
  612 +
  613 + List<SupervisionThreestep> data = new ArrayList<>();
615 614
  615 + String companyName = SecurityUtils.getLoginUser().getUser().getCompanyName();
  616 +
  617 + List<SupervisionThreestep> threesteps = supervisionThreestepMapper.selectTodayDataList(supervisionThreestep);
  618 +
  619 +
  620 + if (SecurityUtils.getLoginUser().getUser().getConAreas().size() > 0 || SecurityUtils.getLoginUser().getUser().getConList().size() > 0) {
  621 +
  622 +
  623 + List<String> idList = SecurityUtils.getLoginUser().getUser().getConList();
  624 +
  625 + for(SupervisionThreestep ts :threesteps){
  626 +
  627 + List<String> cArea = SecurityUtils.getLoginUser().getUser().getConAreas();
  628 +
  629 + if(cArea.indexOf(ts.getPlace()) > -1 || idList.indexOf(ts.getObjectId()) > -1){
  630 + data.add(ts);
  631 + }
  632 +
  633 + }
  634 +
  635 + }
  636 +
  637 +
  638 + return data;
  639 +
616 640
617 - return supervisionThreestepMapper.selectTodayDataList(supervisionThreestep);  
618 } 641 }
619 - 642 +
620 /** 643 /**
621 * 新增三查机制 644 * 新增三查机制
622 * 645 *
@@ -628,17 +651,15 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -628,17 +651,15 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
628 @Transactional 651 @Transactional
629 public int insertSupervisionThreestep(SupervisionThreestep supervisionThreestep) { 652 public int insertSupervisionThreestep(SupervisionThreestep supervisionThreestep) {
630 653
631 - if (new Date().getHours() > -1 && new Date().getHours() < 8 ) { 654 + if (new Date().getHours() > -1 && new Date().getHours() < 8) {
632 return -2; 655 return -2;
633 } 656 }
634 657
635 -  
636 -  
637 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd"); 658 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
638 if (supervisionThreestep.getId() != null) { 659 if (supervisionThreestep.getId() != null) {
639 supervisionThreestepMapper.deleteSupervisionThreestepById(supervisionThreestep.getId()); 660 supervisionThreestepMapper.deleteSupervisionThreestepById(supervisionThreestep.getId());
640 } 661 }
641 - if(supervisionThreestep.getWorkStartTime() == null){ 662 + if (supervisionThreestep.getWorkStartTime() == null) {
642 String start, end; 663 String start, end;
643 664
644 Date date = new Date(); 665 Date date = new Date();
@@ -664,7 +685,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -664,7 +685,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
664 e.printStackTrace(); 685 e.printStackTrace();
665 } 686 }
666 } 687 }
667 - 688 +
668 SupervisionThreestep todayData = supervisionThreestepMapper.selectTodayData(supervisionThreestep); 689 SupervisionThreestep todayData = supervisionThreestepMapper.selectTodayData(supervisionThreestep);
669 690
670 if (todayData != null) { 691 if (todayData != null) {
@@ -699,195 +720,177 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -699,195 +720,177 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
699 @Transactional 720 @Transactional
700 public int updateSupervisionThreestep(SupervisionThreestep supervisionThreestep) { 721 public int updateSupervisionThreestep(SupervisionThreestep supervisionThreestep) {
701 return supervisionThreestepMapper.updateSupervisionThreestep(supervisionThreestep); 722 return supervisionThreestepMapper.updateSupervisionThreestep(supervisionThreestep);
702 - }  
703 - 723 + }
704 724
705 -  
706 @Override 725 @Override
707 public int activeSupervisionThreestep(SupervisionThreestep supervisionThreestep) { 726 public int activeSupervisionThreestep(SupervisionThreestep supervisionThreestep) {
708 - 727 +
709 int j = supervisionThreestepMapper.updateSupervisionThreestep(supervisionThreestep); 728 int j = supervisionThreestepMapper.updateSupervisionThreestep(supervisionThreestep);
710 -  
711 - 729 +
712 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd"); 730 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
713 - 731 +
714 supervisionThreestep = supervisionThreestepMapper.selectSupervisionThreestepById(supervisionThreestep.getId()); 732 supervisionThreestep = supervisionThreestepMapper.selectSupervisionThreestepById(supervisionThreestep.getId());
715 -  
716 - 733 +
717 JSONArray areas = RemoteServerUtils.getAreas(); 734 JSONArray areas = RemoteServerUtils.getAreas();
718 -  
719 - for(int i =0;i< outside.length;i++){  
720 -  
721 - for(Object object:areas){  
722 -  
723 - JSONObject area = (JSONObject)object;  
724 735
725 -// if(outside[i].equals(area.getString("name"))){  
726 -// outside[i] = area.getString("code");  
727 -// } 736 + for (int i = 0; i < outside.length; i++) {
  737 +
  738 + for (Object object : areas) {
  739 +
  740 + JSONObject area = (JSONObject) object;
  741 +
  742 + // if(outside[i].equals(area.getString("name"))){
  743 + // outside[i] = area.getString("code");
  744 + // }
728 } 745 }
729 } 746 }
730 -  
731 -  
732 -  
733 - if(supervisionThreestep.getStatus() == 1 && supervisionThreestep.getType() == 0){  
734 -  
735 - JSONObject earthList = RemoteServerUtils.getEarthSitesInfo( supervisionThreestep.getEarthsitesId());  
736 - 747 +
  748 + if (supervisionThreestep.getStatus() == 1 && supervisionThreestep.getType() == 0) {
  749 +
  750 + JSONObject earthList = RemoteServerUtils.getEarthSitesInfo(supervisionThreestep.getEarthsitesId());
  751 +
737 String eplace = null; 752 String eplace = null;
738 -  
739 - if(earthList != null && earthList.size() > 0){  
740 - eplace = ((JSONObject)earthList).getString("areaName"); 753 +
  754 + if (earthList != null && earthList.size() > 0) {
  755 + eplace = ((JSONObject) earthList).getString("areaName");
741 } 756 }
742 -  
743 -  
744 - for(String out:outside){  
745 - if(out.equals(eplace)){  
746 - supervisionThreestep.setId(null);  
747 -  
748 - SupervisionThreestep sp = new SupervisionThreestep();  
749 - String name = supervisionThreestep.getName();  
750 - String objId = supervisionThreestep.getObjectId();  
751 - String eName = supervisionThreestep.getEarthsitesName();  
752 - String eId = supervisionThreestep.getEarthsitesId();  
753 -  
754 - String start, end;  
755 -  
756 - Date date = new Date();  
757 -  
758 - if (new Date().getHours() < 8) {  
759 - end = yearFomat.format(date);  
760 - date.setDate(date.getDate() - 1);  
761 - start = yearFomat.format(date);  
762 - } else {  
763 - start = yearFomat.format(date);  
764 - date.setDate(date.getDate() + 1);  
765 - end = yearFomat.format(date);  
766 - }  
767 -  
768 - end += " 8:00:00";  
769 - start += " 8:00:00";  
770 -  
771 - try {  
772 - sp.setWorkStartTime(dateTime.parse(start));  
773 - sp.setWorkEndTime(dateTime.parse(end));  
774 - } catch (Exception e) {  
775 - // TODO Auto-generated catch block  
776 - e.printStackTrace();  
777 - }  
778 -  
779 - sp.setEarthsitesId(objId);  
780 - sp.setEarthsitesName(name);  
781 - sp.setName(eName);  
782 - sp.setObjectId(eId);  
783 - sp.setType(1L);  
784 -  
785 - SupervisionThreestep todayData = supervisionThreestepMapper.selectTodayData(sp);  
786 -  
787 - if(todayData != null){  
788 - return j;  
789 - }  
790 -  
791 - supervisionThreestep.setEarthsitesId(objId);  
792 - supervisionThreestep.setEarthsitesName(name);  
793 - supervisionThreestep.setName(eName);  
794 - supervisionThreestep.setObjectId(eId);  
795 -  
796 -  
797 - supervisionThreestep.setCompanys(null);  
798 - supervisionThreestep.setCompanyTrucks(null);  
799 - supervisionThreestep.setType(1L);  
800 - supervisionThreestep.setPlace(eplace);  
801 -  
802 -  
803 -  
804 -  
805 - supervisionThreestepMapper.insertSupervisionThreestep(supervisionThreestep);  
806 -  
807 - supervisionThreestep.setCheckTime(new Date());  
808 -  
809 - supervisionThreestepMapper.updateSupervisionThreestep(supervisionThreestep);  
810 -  
811 -  
812 - return j;  
813 - }  
814 - }  
815 -  
816 - 757 +
  758 + for (String out : outside) {
  759 + if (out.equals(eplace)) {
  760 + supervisionThreestep.setId(null);
  761 +
  762 + SupervisionThreestep sp = new SupervisionThreestep();
  763 + String name = supervisionThreestep.getName();
  764 + String objId = supervisionThreestep.getObjectId();
  765 + String eName = supervisionThreestep.getEarthsitesName();
  766 + String eId = supervisionThreestep.getEarthsitesId();
  767 +
  768 + String start, end;
  769 +
  770 + Date date = new Date();
  771 +
  772 + if (new Date().getHours() < 8) {
  773 + end = yearFomat.format(date);
  774 + date.setDate(date.getDate() - 1);
  775 + start = yearFomat.format(date);
  776 + } else {
  777 + start = yearFomat.format(date);
  778 + date.setDate(date.getDate() + 1);
  779 + end = yearFomat.format(date);
  780 + }
  781 +
  782 + end += " 8:00:00";
  783 + start += " 8:00:00";
  784 +
  785 + try {
  786 + sp.setWorkStartTime(dateTime.parse(start));
  787 + sp.setWorkEndTime(dateTime.parse(end));
  788 + } catch (Exception e) {
  789 + // TODO Auto-generated catch block
  790 + e.printStackTrace();
  791 + }
  792 +
  793 + sp.setEarthsitesId(objId);
  794 + sp.setEarthsitesName(name);
  795 + sp.setName(eName);
  796 + sp.setObjectId(eId);
  797 + sp.setType(1L);
  798 +
  799 + SupervisionThreestep todayData = supervisionThreestepMapper.selectTodayData(sp);
  800 +
  801 + if (todayData != null) {
  802 + return j;
  803 + }
  804 +
  805 + supervisionThreestep.setEarthsitesId(objId);
  806 + supervisionThreestep.setEarthsitesName(name);
  807 + supervisionThreestep.setName(eName);
  808 + supervisionThreestep.setObjectId(eId);
  809 +
  810 + supervisionThreestep.setCompanys(null);
  811 + supervisionThreestep.setCompanyTrucks(null);
  812 + supervisionThreestep.setType(1L);
  813 + supervisionThreestep.setPlace(eplace);
  814 +
  815 + supervisionThreestepMapper.insertSupervisionThreestep(supervisionThreestep);
  816 +
  817 + supervisionThreestep.setCheckTime(new Date());
  818 +
  819 + supervisionThreestepMapper.updateSupervisionThreestep(supervisionThreestep);
  820 +
  821 + return j;
  822 + }
  823 + }
  824 +
817 } 825 }
818 -  
819 -  
820 -// if(supervisionThreestep.getType() == 0 && supervisionThreestep.getStatus() == 1)  
821 -// checkDataToActiveTruck(supervisionThreestep,null); 826 +
  827 + // if(supervisionThreestep.getType() == 0 &&
  828 + // supervisionThreestep.getStatus() == 1)
  829 + // checkDataToActiveTruck(supervisionThreestep,null);
822 830
823 return j; 831 return j;
824 } 832 }
825 833
826 @Override 834 @Override
827 - public void checkDataToActiveTruck(String token){  
828 - 835 + public void checkDataToActiveTruck(String token) {
829 836
830 String[] truckArray; 837 String[] truckArray;
831 - 838 +
832 String unActiveTruck = ""; 839 String unActiveTruck = "";
833 -  
834 - TruckActivate truckActivate = new TruckActivate();  
835 - truckActivate.setStatus(0L);  
836 - truckActivate.setActivateStatus("0");  
837 840
838 - List<TruckActivate> taList = truckActivateService.selectTruckActivateList(truckActivate);  
839 -  
840 - for(TruckActivate ta:taList){  
841 - unActiveTruck += ta.getObjectId() + ",";  
842 - }  
843 -  
844 -  
845 -  
846 -  
847 - if(!unActiveTruck.isEmpty()){ 841 + TruckActivate truckActivate = new TruckActivate();
  842 + truckActivate.setStatus(0L);
  843 + truckActivate.setActivateStatus("0");
  844 +
  845 + List<TruckActivate> taList = truckActivateMapper.selectTruckActivateList(truckActivate);
  846 +
  847 + for (TruckActivate ta : taList) {
  848 + unActiveTruck += ta.getObjectId() + ",";
  849 + }
  850 +
  851 + if (!unActiveTruck.isEmpty()) {
  852 +
  853 + unActiveTruck = unActiveTruck.substring(0, unActiveTruck.length() - 1);
  854 +
  855 + Map<String, Object> params = new HashedMap<>();
848 856
849 - unActiveTruck = unActiveTruck.substring(0,unActiveTruck.length()-1);  
850 -  
851 - Map<String,Object> params = new HashedMap<>();  
852 -  
853 truckArray = unActiveTruck.split(","); 857 truckArray = unActiveTruck.split(",");
854 - 858 +
855 params.put("vehicleIds", truckArray); 859 params.put("vehicleIds", truckArray);
856 params.put("page", 1); 860 params.put("page", 1);
857 params.put("size", 9999); 861 params.put("size", 9999);
858 JSONArray array = null; 862 JSONArray array = null;
859 - if(token ==null) 863 + if (token == null)
860 array = RemoteServerUtils.getTruckOnline(params); 864 array = RemoteServerUtils.getTruckOnline(params);
861 else 865 else
862 - array = RemoteServerUtils.getTruckOnline(params,token);  
863 -  
864 - if(array == null) 866 + array = RemoteServerUtils.getTruckOnline(params, token);
  867 +
  868 + if (array == null)
865 return; 869 return;
866 -  
867 - for(Object object :array){  
868 - JSONObject truckObject = (JSONObject)object;  
869 -  
870 - for(TruckActivate ta:taList){  
871 -  
872 - if(truckObject.getString("vehicleId").equals(ta.getObjectId())){  
873 -  
874 - if(truckObject.getInteger("vehicleStatus") == 1){ 870 +
  871 + for (Object object : array) {
  872 + JSONObject truckObject = (JSONObject) object;
  873 +
  874 + for (TruckActivate ta : taList) {
  875 +
  876 + if (truckObject.getString("vehicleId").equals(ta.getObjectId())) {
  877 +
  878 + if (truckObject.getInteger("vehicleStatus") == 1) {
875 ta.setActivateTime(new Date()); 879 ta.setActivateTime(new Date());
876 - }else{ 880 + } else {
877 continue; 881 continue;
878 } 882 }
879 883
880 truckActivateMapper.updateTruckActivate(ta); 884 truckActivateMapper.updateTruckActivate(ta);
881 - 885 +
882 break; 886 break;
883 } 887 }
884 } 888 }
885 } 889 }
886 - 890 +
887 } 891 }
888 - 892 +
889 } 893 }
890 -  
891 894
892 /** 895 /**
893 * 批量删除三查机制 896 * 批量删除三查机制
@@ -923,114 +926,104 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -923,114 +926,104 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
923 } 926 }
924 return null; 927 return null;
925 } 928 }
926 - 929 +
927 @Autowired 930 @Autowired
928 RedisCache redisCache; 931 RedisCache redisCache;
929 932
930 @Override 933 @Override
931 - public void updateTodayData(String token){ 934 + public void updateTodayData(String token) {
932 935
933 -  
934 -  
935 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd"); 936 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
936 - 937 +
937 SupervisionThreestep supervisionThreestep = new SupervisionThreestep(); 938 SupervisionThreestep supervisionThreestep = new SupervisionThreestep();
938 -  
939 - String start, end;  
940 939
941 - Date date = new Date(); 940 + String start, end;
942 941
943 - end = yearFomat.format(date);  
944 - date.setDate(date.getDate() - 1);  
945 - start = yearFomat.format(date); 942 + Date date = new Date();
946 943
947 - end += " 8:00:00";  
948 - start += " 8:00:00"; 944 + end = yearFomat.format(date);
  945 + date.setDate(date.getDate() - 1);
  946 + start = yearFomat.format(date);
949 947
950 - try {  
951 - supervisionThreestep.setWorkStartTime(dateTime.parse(start));  
952 - supervisionThreestep.setWorkEndTime(dateTime.parse(end));  
953 - supervisionThreestep.setStatus(1L);  
954 - supervisionThreestep.setType(0L);  
955 - } catch (Exception e) {  
956 - // TODO Auto-generated catch block  
957 - e.printStackTrace();  
958 - }  
959 -  
960 - List<SupervisionThreestep> list = supervisionThreestepMapper.selectSupervisionThreestepList(supervisionThreestep);  
961 - 948 + end += " 8:00:00";
  949 + start += " 8:00:00";
962 950
963 -  
964 - JSONArray contracts = redisCache.getCacheObject("contractList");  
965 -  
966 - if(contracts == null){  
967 - Map param = new HashMap<>();  
968 -  
969 - param.put("page", 1);  
970 - param.put("size", 99999);  
971 - param.put("contractStatus", 1);  
972 - param.put("auditStatus", 1);  
973 -  
974 - contracts = RemoteServerUtils.getContractList(param,token);  
975 - redisCache.setCacheObject("contractList",contracts);  
976 - }  
977 -  
978 -  
979 -  
980 -  
981 - if(list.size() > 0){  
982 -  
983 -  
984 -  
985 -  
986 -  
987 - for(SupervisionThreestep s: list){  
988 - String cid = "";  
989 - String cname = "";  
990 - String eid = "";  
991 - String ename = "";  
992 -  
993 - for(Object object : contracts){  
994 - JSONObject jsonObject = (JSONObject) object;  
995 -  
996 - if(s.getObjectId().equals(jsonObject.getString("constructionSiteID"))){  
997 - cid += jsonObject.getString("id") + ",";  
998 - cname += jsonObject.getString("contractNo")+ ",";  
999 - eid += jsonObject.getString("earthSiteID")+ ",";  
1000 - ename += jsonObject.getString("earthSiteName")+ ",";  
1001 - }  
1002 -  
1003 - }  
1004 - if(cid.length() > 0){  
1005 - cid = cid.substring(0,cid.length()-1);  
1006 - }  
1007 - if(cname.length() > 0){  
1008 - cname = cname.substring(0,cname.length()-1);  
1009 - }  
1010 - if(eid.length() > 0){  
1011 - eid = eid.substring(0,eid.length()-1);  
1012 - }  
1013 - if(ename.length() > 0){  
1014 - ename = ename.substring(0,ename.length()-1); 951 + try {
  952 + supervisionThreestep.setWorkStartTime(dateTime.parse(start));
  953 + supervisionThreestep.setWorkEndTime(dateTime.parse(end));
  954 + supervisionThreestep.setStatus(1L);
  955 + supervisionThreestep.setType(0L);
  956 + } catch (Exception e) {
  957 + // TODO Auto-generated catch block
  958 + e.printStackTrace();
  959 + }
  960 +
  961 + List<SupervisionThreestep> list = supervisionThreestepMapper
  962 + .selectSupervisionThreestepList(supervisionThreestep);
  963 +
  964 + JSONArray contracts = redisCache.getCacheObject("contractList");
  965 +
  966 + if (contracts == null) {
  967 + Map param = new HashMap<>();
  968 +
  969 + param.put("page", 1);
  970 + param.put("size", 99999);
  971 + param.put("contractStatus", 1);
  972 + param.put("auditStatus", 1);
  973 +
  974 + contracts = RemoteServerUtils.getContractList(param, token);
  975 + redisCache.setCacheObject("contractList", contracts);
  976 + }
  977 +
  978 + if (list.size() > 0) {
  979 +
  980 + for (SupervisionThreestep s : list) {
  981 + String cid = "";
  982 + String cname = "";
  983 + String eid = "";
  984 + String ename = "";
  985 +
  986 + for (Object object : contracts) {
  987 + JSONObject jsonObject = (JSONObject) object;
  988 +
  989 + if (s.getObjectId().equals(jsonObject.getString("constructionSiteID"))) {
  990 + cid += jsonObject.getString("id") + ",";
  991 + cname += jsonObject.getString("contractNo") + ",";
  992 + eid += jsonObject.getString("earthSiteID") + ",";
  993 + ename += jsonObject.getString("earthSiteName") + ",";
1015 } 994 }
1016 - s.setContractId(cid);  
1017 - s.setContract(cname);  
1018 - s.setEarthsitesId(eid);  
1019 - s.setEarthsitesName(ename);  
1020 -  
1021 - supervisionThreestepMapper.updateSupervisionThreestep(s); 995 +
1022 } 996 }
1023 - 997 + if (cid.length() > 0) {
  998 + cid = cid.substring(0, cid.length() - 1);
  999 + }
  1000 + if (cname.length() > 0) {
  1001 + cname = cname.substring(0, cname.length() - 1);
  1002 + }
  1003 + if (eid.length() > 0) {
  1004 + eid = eid.substring(0, eid.length() - 1);
  1005 + }
  1006 + if (ename.length() > 0) {
  1007 + ename = ename.substring(0, ename.length() - 1);
  1008 + }
  1009 + s.setContractId(cid);
  1010 + s.setContract(cname);
  1011 + s.setEarthsitesId(eid);
  1012 + s.setEarthsitesName(ename);
  1013 +
  1014 + supervisionThreestepMapper.updateSupervisionThreestep(s);
1024 } 1015 }
1025 - 1016 +
  1017 + }
  1018 +
1026 } 1019 }
1027 1020
1028 @Override 1021 @Override
1029 public SupervisionThreestep getSupervisionThreestepInfo(SupervisionThreestep supervisionThreestep) { 1022 public SupervisionThreestep getSupervisionThreestepInfo(SupervisionThreestep supervisionThreestep) {
1030 - if(supervisionThreestep.getWorkStartTime() == null){ 1023 + if (supervisionThreestep.getWorkStartTime() == null) {
1031 1024
1032 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd"); 1025 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
1033 - 1026 +
1034 String start, end; 1027 String start, end;
1035 1028
1036 Date date = new Date(); 1029 Date date = new Date();
@@ -1056,9 +1049,8 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer @@ -1056,9 +1049,8 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
1056 e.printStackTrace(); 1049 e.printStackTrace();
1057 } 1050 }
1058 } 1051 }
1059 -  
1060 -  
1061 - return supervisionThreestepMapper.getSupervisionThreestepInfo(supervisionThreestep); 1052 +
  1053 + return supervisionThreestepMapper.getSupervisionThreestepInfo(supervisionThreestep);
1062 } 1054 }
1063 1055
1064 } 1056 }
trash-workFlow/src/main/java/com/trash/business/service/impl/TruckActivateServiceImpl.java
@@ -12,6 +12,7 @@ import com.trash.common.core.domain.AjaxResult; @@ -12,6 +12,7 @@ import com.trash.common.core.domain.AjaxResult;
12 import com.trash.common.core.redis.RedisCache; 12 import com.trash.common.core.redis.RedisCache;
13 import com.trash.common.utils.DateUtils; 13 import com.trash.common.utils.DateUtils;
14 import com.trash.common.utils.RemoteServerUtils; 14 import com.trash.common.utils.RemoteServerUtils;
  15 +import com.trash.common.utils.SecurityUtils;
15 16
16 import org.apache.commons.lang3.time.DateFormatUtils; 17 import org.apache.commons.lang3.time.DateFormatUtils;
17 import org.springframework.beans.factory.annotation.Autowired; 18 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,6 +22,8 @@ import com.trash.business.mapper.SupervisionThreestepMapper; @@ -21,6 +22,8 @@ import com.trash.business.mapper.SupervisionThreestepMapper;
21 import com.trash.business.mapper.TruckActivateMapper; 22 import com.trash.business.mapper.TruckActivateMapper;
22 import com.alibaba.fastjson.JSONArray; 23 import com.alibaba.fastjson.JSONArray;
23 import com.alibaba.fastjson.JSONObject; 24 import com.alibaba.fastjson.JSONObject;
  25 +import com.google.gson.Gson;
  26 +import com.google.gson.reflect.TypeToken;
24 import com.sun.jna.platform.unix.X11.XClientMessageEvent.Data; 27 import com.sun.jna.platform.unix.X11.XClientMessageEvent.Data;
25 import com.trash.business.domain.SupervisionThreestep; 28 import com.trash.business.domain.SupervisionThreestep;
26 import com.trash.business.domain.TruckActivate; 29 import com.trash.business.domain.TruckActivate;
@@ -34,68 +37,140 @@ import com.trash.business.service.ITruckActivateService; @@ -34,68 +37,140 @@ import com.trash.business.service.ITruckActivateService;
34 * @date 2023-05-02 37 * @date 2023-05-02
35 */ 38 */
36 @Service 39 @Service
37 -public class TruckActivateServiceImpl implements ITruckActivateService  
38 -{  
39 - @Autowired  
40 - private TruckActivateMapper truckActivateMapper;  
41 -  
42 - @Autowired  
43 - SupervisionThreestepMapper threestepMapper;  
44 -  
45 -  
46 - /**  
47 - * 查询车辆激活  
48 - *  
49 - * @param id 车辆激活ID  
50 - * @return 车辆激活  
51 - */  
52 - @Override  
53 - public TruckActivate selectTruckActivateById(Long id)  
54 - {  
55 - return truckActivateMapper.selectTruckActivateById(id);  
56 - }  
57 -  
58 - /**  
59 - * 查询车辆激活列表  
60 - *  
61 - * @param truckActivate 车辆激活  
62 - * @return 车辆激活  
63 - */  
64 -  
65 -  
66 - @Override  
67 - public List<TruckActivate> selectTruckActivateList(TruckActivate truckActivate)  
68 - {  
69 - if(truckActivate.getActivateTime()!=null){  
70 - truckActivate.setActivateDate(DateFormatUtils.format(truckActivate.getActivateTime(),"yyyy-MM-dd")); 40 +public class TruckActivateServiceImpl implements ITruckActivateService {
  41 + @Autowired
  42 + private TruckActivateMapper truckActivateMapper;
  43 +
  44 + @Autowired
  45 + SupervisionThreestepMapper threestepMapper;
  46 +
  47 + @Autowired
  48 + ISupervisionThreestepService threestepService;
  49 +
  50 + /**
  51 + * 查询车辆激活
  52 + *
  53 + * @param id
  54 + * 车辆激活ID
  55 + * @return 车辆激活
  56 + */
  57 + @Override
  58 + public TruckActivate selectTruckActivateById(Long id) {
  59 + return truckActivateMapper.selectTruckActivateById(id);
  60 + }
  61 +
  62 + /**
  63 + * 查询车辆激活列表
  64 + *
  65 + * @param truckActivate
  66 + * 车辆激活
  67 + * @return 车辆激活
  68 + */
  69 +
  70 + @Override
  71 + public List<TruckActivate> selectTruckActivateList(TruckActivate truckActivate) {
  72 + if (truckActivate.getActivateTime() != null) {
  73 + truckActivate.setActivateDate(DateFormatUtils.format(truckActivate.getActivateTime(), "yyyy-MM-dd"));
71 } 74 }
72 75
73 - return truckActivateMapper.selectTruckActivateList(truckActivate);  
74 - }  
75 -  
76 - /**  
77 - * 新增车辆激活  
78 - *  
79 - * @param truckActivate 车辆激活  
80 - * @return 结果  
81 - */  
82 - @Override  
83 - public AjaxResult insertTruckActivate(TruckActivate truckActivate)  
84 - {  
85 -  
86 - AjaxResult ajaxResult = new AjaxResult();  
87 -  
88 - String errorMessage = "";  
89 - String successMessage = "";  
90 -  
91 - String start, end;  
92 -  
93 - SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");  
94 - SimpleDateFormat dateTimeFomat = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS"); 76 + List<TruckActivate> list = new ArrayList<>();
  77 +
  78 + List<String> cArea = SecurityUtils.getLoginUser().getUser().getConAreas();
  79 + List<String> cList = SecurityUtils.getLoginUser().getUser().getConList();
  80 +
  81 + if(cArea.size() > 0){
  82 + JSONArray jsonArray = redis.getCacheObject("constructionList");
  83 + for(Object obj:jsonArray){
  84 + JSONObject json = (JSONObject) obj;
  85 + if(cArea.indexOf(json.getString("areaCode")) > -1){
  86 + cList.add(json.getString("id"));
  87 + }
  88 + }
  89 + }
  90 +
  91 + List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds();
  92 + List<String> tList = SecurityUtils.getLoginUser().getUser().getTruckList();
  93 +
  94 + if (tList.size() > 0 || companys.size() > 0 || cList.size() > 0) {
  95 + List<String> ids = new ArrayList<>();
  96 + for (String str : tList) {
  97 + ids.add(str);
  98 + }
  99 +
  100 + if (companys.size() > 0) {
  101 +
  102 + Map map = new HashMap<>();
  103 + map.put("size", 99999);
  104 + map.put("valid", 0);
  105 + map.put("page", 1);
  106 +
  107 + JSONArray jsonArray = RemoteServerUtils.getTruckList(map);
  108 +
  109 + for (Object obj : jsonArray) {
  110 + JSONObject json = (JSONObject) obj;
  111 + if (companys.indexOf(json.getString("companyID")) > -1) {
  112 + ids.add(json.getString("id"));
  113 + }
  114 + }
  115 + }
  116 +
  117 + truckActivate.setIds(ids);
  118 + truckActivate.setcIds(cList);
  119 + if(ids.size() == 0 && cList.size() == 0){
  120 + return list;
  121 + }
  122 + list = truckActivateMapper.selectTruckActivateList(truckActivate);
  123 + }
  124 +
  125 +
  126 +
  127 + for (TruckActivate ta : list) {
  128 + if (ta.getAddress() == null) {
  129 + JSONObject construction = RemoteServerUtils.getConstructionLicenseById(ta.getConstructionId());
  130 +
  131 + ta.setAddress(construction.getString("address"));
  132 + ta.setEffectiveFrom(construction.getString("effectiveFrom"));
  133 + ta.setEffectiveEnd(construction.getString("effectiveEnd"));
  134 +
  135 + ta.setTransportStartTime(construction.getString("transportStartTime"));
  136 + ta.setTransportEndTime(construction.getString("transportEndTime"));
  137 + ta.setRouteName(construction.getString("routeName"));
  138 + ta.setEarthName(construction.getString("earthName"));
  139 + ta.setRouteInfo(construction.getString("routeInfo"));
  140 + ta.setEarthList(construction.getString("earthList"));
  141 + ta.setCoord(construction.getString("coord"));
  142 +
  143 + truckActivateMapper.updateTruckActivate(ta);
  144 + }
  145 +
  146 + }
  147 +
  148 + return list;
  149 + }
  150 +
  151 + /**
  152 + * 新增车辆激活
  153 + *
  154 + * @param truckActivate
  155 + * 车辆激活
  156 + * @return 结果
  157 + */
  158 + @Override
  159 + public AjaxResult insertTruckActivate(TruckActivate truckActivate) {
  160 +
  161 + AjaxResult ajaxResult = new AjaxResult();
  162 +
  163 + String errorMessage = "";
  164 + String successMessage = "";
  165 +
  166 + String start, end;
  167 +
  168 + SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
  169 + SimpleDateFormat dateTimeFomat = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS");
95 Date date = new Date(); 170 Date date = new Date();
96 171
97 if (new Date().getHours() < 8) { 172 if (new Date().getHours() < 8) {
98 - end = yearFomat.format(date); 173 + end = yearFomat.format(date);
99 date.setDate(date.getDate() - 1); 174 date.setDate(date.getDate() - 1);
100 start = yearFomat.format(date); 175 start = yearFomat.format(date);
101 } else { 176 } else {
@@ -106,78 +181,76 @@ public class TruckActivateServiceImpl implements ITruckActivateService @@ -106,78 +181,76 @@ public class TruckActivateServiceImpl implements ITruckActivateService
106 181
107 end += " 08:00:00"; 182 end += " 08:00:00";
108 start += " 08:00:00"; 183 start += " 08:00:00";
109 - 184 +
110 String[] objs = truckActivate.getObjectId().split(","); 185 String[] objs = truckActivate.getObjectId().split(",");
111 String[] nos = truckActivate.getLicensePlate().split(","); 186 String[] nos = truckActivate.getLicensePlate().split(",");
112 -  
113 187
114 List<TruckActivate> oldDates = truckActivateMapper.selectTodayTruckByObjIds(objs); 188 List<TruckActivate> oldDates = truckActivateMapper.selectTodayTruckByObjIds(objs);
115 - 189 +
116 JSONObject construction = RemoteServerUtils.getConstructionLicenseById(truckActivate.getConstructionId()); 190 JSONObject construction = RemoteServerUtils.getConstructionLicenseById(truckActivate.getConstructionId());
117 -  
118 - for(int i =0 ;i<objs.length;i++){  
119 - 191 +
  192 + for (int i = 0; i < objs.length; i++) {
  193 +
120 TruckActivate active = new TruckActivate(); 194 TruckActivate active = new TruckActivate();
121 - 195 +
122 active.setObjectId(objs[i]); 196 active.setObjectId(objs[i]);
123 active.setLicensePlate(nos[i]); 197 active.setLicensePlate(nos[i]);
124 active.setConstruction(truckActivate.getConstruction()); 198 active.setConstruction(truckActivate.getConstruction());
125 active.setConstructionId(truckActivate.getConstructionId()); 199 active.setConstructionId(truckActivate.getConstructionId());
126 active.setEarthsite(truckActivate.getEarthsite()); 200 active.setEarthsite(truckActivate.getEarthsite());
127 active.setCompany(truckActivate.getCompany()); 201 active.setCompany(truckActivate.getCompany());
128 - 202 +
129 active.setAddress(construction.getString("address")); 203 active.setAddress(construction.getString("address"));
130 active.setEffectiveFrom(construction.getString("effectiveFrom")); 204 active.setEffectiveFrom(construction.getString("effectiveFrom"));
131 active.setEffectiveEnd(construction.getString("effectiveEnd")); 205 active.setEffectiveEnd(construction.getString("effectiveEnd"));
132 - 206 +
133 active.setTransportStartTime(construction.getString("transportStartTime")); 207 active.setTransportStartTime(construction.getString("transportStartTime"));
134 active.setTransportEndTime(construction.getString("transportEndTime")); 208 active.setTransportEndTime(construction.getString("transportEndTime"));
135 active.setRouteName(construction.getString("routeName")); 209 active.setRouteName(construction.getString("routeName"));
136 active.setEarthName(construction.getString("earthName")); 210 active.setEarthName(construction.getString("earthName"));
137 active.setRouteInfo(construction.getString("routeInfo")); 211 active.setRouteInfo(construction.getString("routeInfo"));
138 active.setEarthList(construction.getString("earthList")); 212 active.setEarthList(construction.getString("earthList"));
139 - 213 + active.setCoord(construction.getString("coord"));
  214 +
140 active.setCreateTime(DateUtils.getNowDate()); 215 active.setCreateTime(DateUtils.getNowDate());
141 -  
142 - 216 +
143 TruckActivate oldDate = null; 217 TruckActivate oldDate = null;
144 -  
145 - for(int j =0;j<oldDates.size();j++){  
146 - if(objs[i].equals( oldDates.get(j).getObjectId())){  
147 - oldDate = oldDates.get(j);  
148 - }  
149 - }  
150 -  
151 -  
152 - if(oldDate != null){  
153 -  
154 - if(oldDate.getCreateCount() > 1){  
155 - errorMessage += nos[i] + " ";  
156 - continue;  
157 - }  
158 -  
159 - SupervisionThreestep threestep = new SupervisionThreestep();  
160 -  
161 - threestep.setName(oldDate.getConstruction());  
162 - threestep.setObjectId(oldDate.getConstructionId());  
163 -  
164 - try {  
165 - threestep.setWorkStartTime(DateUtils.parseDate(start));  
166 - threestep.setWorkEndTime(DateUtils.parseDate(end));  
167 - } catch (Exception e) {  
168 - // TODO Auto-generated catch block  
169 - e.printStackTrace();  
170 - }  
171 -  
172 - threestep = threestepMapper.selectThreestepByTruckDate(threestep);  
173 -  
174 - if(threestep == null || threestep.getName().equals(truckActivate.getConstruction())){  
175 -  
176 - //更新绑定的三查数据 218 +
  219 + for (int j = 0; j < oldDates.size(); j++) {
  220 + if (objs[i].equals(oldDates.get(j).getObjectId())) {
  221 + oldDate = oldDates.get(j);
  222 + }
  223 + }
  224 +
  225 + if (oldDate != null) {
  226 +
  227 + if (oldDate.getCreateCount() > 1) {
  228 + errorMessage += nos[i] + " ";
  229 + continue;
  230 + }
  231 +
  232 + SupervisionThreestep threestep = new SupervisionThreestep();
  233 +
  234 + threestep.setName(oldDate.getConstruction());
  235 + threestep.setObjectId(oldDate.getConstructionId());
  236 +
  237 + try {
  238 + threestep.setWorkStartTime(DateUtils.parseDate(start));
  239 + threestep.setWorkEndTime(DateUtils.parseDate(end));
  240 + } catch (Exception e) {
  241 + // TODO Auto-generated catch block
  242 + e.printStackTrace();
  243 + }
  244 +
  245 + threestep = threestepMapper.selectThreestepByTruckDate(threestep);
  246 +
  247 + if (threestep == null || threestep.getName().equals(truckActivate.getConstruction())) {
  248 +
  249 + // 更新绑定的三查数据
177 threestep = new SupervisionThreestep(); 250 threestep = new SupervisionThreestep();
178 251
179 - threestep.setObjectId(active.getConstructionId());  
180 - 252 + threestep.setObjectId(active.getConstructionId());
  253 +
181 try { 254 try {
182 threestep.setWorkStartTime(DateUtils.parseDate(start)); 255 threestep.setWorkStartTime(DateUtils.parseDate(start));
183 threestep.setWorkEndTime(DateUtils.parseDate(end)); 256 threestep.setWorkEndTime(DateUtils.parseDate(end));
@@ -187,152 +260,151 @@ public class TruckActivateServiceImpl implements ITruckActivateService @@ -187,152 +260,151 @@ public class TruckActivateServiceImpl implements ITruckActivateService
187 } 260 }
188 261
189 threestep = threestepMapper.selectThreestepByTruckDate(threestep); 262 threestep = threestepMapper.selectThreestepByTruckDate(threestep);
190 - 263 +
191 String trucks = threestep.getCompanyTrucks(); 264 String trucks = threestep.getCompanyTrucks();
192 -  
193 - if(trucks == null || trucks.isEmpty()){ 265 +
  266 + if (trucks == null || trucks.isEmpty()) {
194 trucks = active.getObjectId(); 267 trucks = active.getObjectId();
195 - }else{  
196 - if(!trucks.contains(active.getObjectId())){ 268 + } else {
  269 + if (!trucks.contains(active.getObjectId())) {
197 trucks += "," + active.getObjectId(); 270 trucks += "," + active.getObjectId();
198 } 271 }
199 } 272 }
200 - 273 +
201 threestep.setCompanyTrucks(trucks); 274 threestep.setCompanyTrucks(trucks);
202 - 275 +
203 threestepMapper.updateSupervisionThreestep(threestep); 276 threestepMapper.updateSupervisionThreestep(threestep);
204 -  
205 277
206 - }else{ 278 + } else {
207 Long threeId = threestep.getId(); 279 Long threeId = threestep.getId();
208 String trucks = threestep.getCompanyTrucks(); 280 String trucks = threestep.getCompanyTrucks();
209 - 281 +
210 threestep = new SupervisionThreestep(); 282 threestep = new SupervisionThreestep();
211 - 283 +
212 threestep.setId(threeId); 284 threestep.setId(threeId);
213 - 285 +
214 trucks = trucks.replace(oldDate.getObjectId(), "").replace(",,", ","); 286 trucks = trucks.replace(oldDate.getObjectId(), "").replace(",,", ",");
215 -  
216 - if(trucks.length() == 1){ 287 +
  288 + if (trucks.length() == 1) {
217 trucks = ""; 289 trucks = "";
218 } 290 }
219 - 291 +
220 threestep.setCompanyTrucks(trucks); 292 threestep.setCompanyTrucks(trucks);
221 -  
222 - //去除已有三查数据的车辆绑定 293 +
  294 + // 去除已有三查数据的车辆绑定
223 threestepMapper.updateSupervisionThreestep(threestep); 295 threestepMapper.updateSupervisionThreestep(threestep);
224 - }  
225 -  
226 - active.setId(oldDate.getId());//更新已有车辆激活数据  
227 - active.setCreateCount(oldDate.getCreateCount()+1);  
228 - successMessage += nos[i] + " ";  
229 - truckActivateMapper.updateTruckActivate(active);  
230 - continue;  
231 - }else{  
232 -  
233 - SupervisionThreestep threestep = new SupervisionThreestep();  
234 -  
235 - threestep.setObjectId(active.getConstructionId());  
236 -  
237 - try {  
238 - threestep.setWorkStartTime(DateUtils.parseDate(start));  
239 - threestep.setWorkEndTime(DateUtils.parseDate(end));  
240 - } catch (Exception e) {  
241 - // TODO Auto-generated catch block  
242 - e.printStackTrace();  
243 - }  
244 -  
245 - threestep = threestepMapper.selectThreestepByTruckDate(threestep);  
246 -  
247 - String trucks = threestep.getCompanyTrucks();  
248 -  
249 - if(trucks == null || trucks.isEmpty()){ 296 + }
  297 +
  298 + active.setId(oldDate.getId());// 更新已有车辆激活数据
  299 + active.setCreateCount(oldDate.getCreateCount() + 1);
  300 + successMessage += nos[i] + " ";
  301 + truckActivateMapper.updateTruckActivate(active);
  302 + continue;
  303 + } else {
  304 +
  305 + SupervisionThreestep threestep = new SupervisionThreestep();
  306 +
  307 + threestep.setObjectId(active.getConstructionId());
  308 +
  309 + try {
  310 + threestep.setWorkStartTime(DateUtils.parseDate(start));
  311 + threestep.setWorkEndTime(DateUtils.parseDate(end));
  312 + } catch (Exception e) {
  313 + // TODO Auto-generated catch block
  314 + e.printStackTrace();
  315 + }
  316 +
  317 + threestep = threestepMapper.selectThreestepByTruckDate(threestep);
  318 +
  319 + String trucks = threestep.getCompanyTrucks();
  320 +
  321 + if (trucks == null || trucks.isEmpty()) {
250 trucks = active.getObjectId(); 322 trucks = active.getObjectId();
251 - }else{ 323 + } else {
252 trucks += "," + active.getObjectId(); 324 trucks += "," + active.getObjectId();
253 } 325 }
254 - 326 +
255 threestep.setCompanyTrucks(trucks); 327 threestep.setCompanyTrucks(trucks);
256 - 328 +
257 threestepMapper.updateSupervisionThreestep(threestep); 329 threestepMapper.updateSupervisionThreestep(threestep);
258 330
259 - active.setCreateCount(1);  
260 - successMessage += nos[i] + " ";  
261 -  
262 - truckActivateMapper.insertTruckActivate(active); 331 + active.setCreateCount(1);
  332 + successMessage += nos[i] + " ";
  333 +
  334 + truckActivateMapper.insertTruckActivate(active);
263 continue; 335 continue;
264 - } 336 + }
265 } 337 }
266 -  
267 - String message = (successMessage.isEmpty() ? "" : successMessage + "激活成功! ") + (errorMessage.isEmpty() ? "" : errorMessage + "已激活2次!");  
268 -  
269 - return ajaxResult.success(message);  
270 -  
271 -  
272 - }  
273 -  
274 - /**  
275 - * 修改车辆激活  
276 - *  
277 - * @param truckActivate 车辆激活  
278 - * @return 结果  
279 - */  
280 - @Override  
281 - public int updateTruckActivate(TruckActivate truckActivate)  
282 - {  
283 -  
284 - truckActivate.setActivateTime(DateUtils.getNowDate());  
285 -  
286 - return truckActivateMapper.updateTruckActivate(truckActivate);  
287 - }  
288 -  
289 - /**  
290 - * 批量删除车辆激活  
291 - *  
292 - * @param ids 需要删除的车辆激活ID  
293 - * @return 结果  
294 - */  
295 - @Override  
296 - public int deleteTruckActivateByIds(Long[] ids)  
297 - {  
298 - return truckActivateMapper.deleteTruckActivateByIds(ids);  
299 - }  
300 -  
301 - /**  
302 - * 删除车辆激活信息  
303 - *  
304 - * @param id 车辆激活ID  
305 - * @return 结果  
306 - */  
307 - @Override  
308 - public int deleteTruckActivateById(Long id)  
309 - {  
310 - return truckActivateMapper.deleteTruckActivateById(id);  
311 - }  
312 -  
313 - @Autowired  
314 - RedisCache redis;  
315 -  
316 - @Override  
317 - public String getConractByObjectId(String id){  
318 -  
319 - TruckActivate turck = new TruckActivate(); 338 +
  339 + String message = (successMessage.isEmpty() ? "" : successMessage + "激活成功! ")
  340 + + (errorMessage.isEmpty() ? "" : errorMessage + "已激活2次!");
  341 +
  342 + return ajaxResult.success(message);
  343 +
  344 + }
  345 +
  346 + /**
  347 + * 修改车辆激活
  348 + *
  349 + * @param truckActivate
  350 + * 车辆激活
  351 + * @return 结果
  352 + */
  353 + @Override
  354 + public int updateTruckActivate(TruckActivate truckActivate) {
  355 +
  356 + truckActivate.setActivateTime(DateUtils.getNowDate());
  357 +
  358 + return truckActivateMapper.updateTruckActivate(truckActivate);
  359 + }
  360 +
  361 + /**
  362 + * 批量删除车辆激活
  363 + *
  364 + * @param ids
  365 + * 需要删除的车辆激活ID
  366 + * @return 结果
  367 + */
  368 + @Override
  369 + public int deleteTruckActivateByIds(Long[] ids) {
  370 + return truckActivateMapper.deleteTruckActivateByIds(ids);
  371 + }
  372 +
  373 + /**
  374 + * 删除车辆激活信息
  375 + *
  376 + * @param id
  377 + * 车辆激活ID
  378 + * @return 结果
  379 + */
  380 + @Override
  381 + public int deleteTruckActivateById(Long id) {
  382 + return truckActivateMapper.deleteTruckActivateById(id);
  383 + }
  384 +
  385 + @Autowired
  386 + RedisCache redis;
  387 +
  388 + @Override
  389 + public String getConractByObjectId(String id) {
  390 +
  391 + TruckActivate turck = new TruckActivate();
320 SupervisionThreestep threestep = new SupervisionThreestep(); 392 SupervisionThreestep threestep = new SupervisionThreestep();
321 - 393 +
322 String conractIds = ""; 394 String conractIds = "";
323 395
324 - SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");  
325 - SimpleDateFormat dateTimeFomat = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS");  
326 -  
327 - turck.setObjectId(id);  
328 -  
329 - if(turck.getStartTime() == null){ 396 + SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
  397 + SimpleDateFormat dateTimeFomat = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS");
  398 +
  399 + turck.setObjectId(id);
  400 +
  401 + if (turck.getStartTime() == null) {
330 String start, end; 402 String start, end;
331 403
332 Date date = new Date(); 404 Date date = new Date();
333 405
334 if (new Date().getHours() < 8) { 406 if (new Date().getHours() < 8) {
335 - end = yearFomat.format(date); 407 + end = yearFomat.format(date);
336 date.setDate(date.getDate() - 1); 408 date.setDate(date.getDate() - 1);
337 start = yearFomat.format(date); 409 start = yearFomat.format(date);
338 } else { 410 } else {
@@ -350,95 +422,147 @@ public class TruckActivateServiceImpl implements ITruckActivateService @@ -350,95 +422,147 @@ public class TruckActivateServiceImpl implements ITruckActivateService
350 threestep.setWorkStartTime(dateTimeFomat.parse(start)); 422 threestep.setWorkStartTime(dateTimeFomat.parse(start));
351 threestep.setWorkEndTime(dateTimeFomat.parse(end)); 423 threestep.setWorkEndTime(dateTimeFomat.parse(end));
352 } catch (Exception e) { 424 } catch (Exception e) {
353 -  
354 - System.out.println(date +""+ start +""+ end);  
355 - 425 +
  426 + System.out.println(date + "" + start + "" + end);
  427 +
356 e.printStackTrace(); 428 e.printStackTrace();
357 } 429 }
358 } 430 }
359 - 431 +
360 TruckActivate truck = truckActivateMapper.getConractByObjectId(turck); 432 TruckActivate truck = truckActivateMapper.getConractByObjectId(turck);
361 433
362 - if(truck == null)return null;  
363 - 434 + if (truck == null)
  435 + return null;
  436 +
364 Map param = new HashMap<>(); 437 Map param = new HashMap<>();
365 -  
366 - List<String> ids =new ArrayList<>();  
367 -  
368 -  
369 - 438 +
  439 + List<String> ids = new ArrayList<>();
  440 +
370 JSONArray contracts = redis.getCacheObject("contractList"); 441 JSONArray contracts = redis.getCacheObject("contractList");
371 -  
372 - if(contracts == null){ 442 +
  443 + if (contracts == null) {
373 param.put("page", 1); 444 param.put("page", 1);
374 param.put("size", 99999); 445 param.put("size", 99999);
375 - 446 +
376 contracts = RemoteServerUtils.getContractList(param); 447 contracts = RemoteServerUtils.getContractList(param);
377 - redis.setCacheObject("contractList",contracts); 448 + redis.setCacheObject("contractList", contracts);
378 } 449 }
379 - 450 +
380 JSONArray array = new JSONArray(); 451 JSONArray array = new JSONArray();
381 - for(Object obj :contracts){  
382 - JSONObject jsonObject = (JSONObject)obj;  
383 -  
384 - if(truck.getConstructionId().equals(jsonObject.getString("constructionSiteID"))){ 452 + for (Object obj : contracts) {
  453 + JSONObject jsonObject = (JSONObject) obj;
  454 +
  455 + if (truck.getConstructionId().equals(jsonObject.getString("constructionSiteID"))) {
385 array.add(obj); 456 array.add(obj);
386 } 457 }
387 } 458 }
388 -  
389 - if(array.size() == 0){ 459 +
  460 + if (array.size() == 0) {
390 return null; 461 return null;
391 } 462 }
392 -  
393 - String eids = "";  
394 -  
395 - for(Object object:array){ 463 +
  464 + List<String> eids = new ArrayList<>();
  465 +
  466 + for (Object object : array) {
396 467
397 JSONObject jsonObject = (JSONObject) object; 468 JSONObject jsonObject = (JSONObject) object;
398 469
399 - eids += jsonObject.getString("earthSiteID") + ","; 470 + eids.add(jsonObject.getString("earthSiteID"));
400 } 471 }
401 -  
402 - threestep.setIds(eids.split(",")); 472 +
  473 + threestep.setIds(eids);
403 threestep.setType(1L); 474 threestep.setType(1L);
404 threestep.setStatus(1L); 475 threestep.setStatus(1L);
405 - 476 +
406 List<SupervisionThreestep> list = threestepMapper.selectSupervisionThreestepList(threestep); 477 List<SupervisionThreestep> list = threestepMapper.selectSupervisionThreestepList(threestep);
407 478
408 - for(SupervisionThreestep three:list){  
409 - for(Object object:array){ 479 + for (SupervisionThreestep three : list) {
  480 + for (Object object : array) {
410 JSONObject jsonObject = (JSONObject) object; 481 JSONObject jsonObject = (JSONObject) object;
411 - if(jsonObject.getString("earthSiteID").equals((three.getObjectId()))){ 482 + if (jsonObject.getString("earthSiteID").equals((three.getObjectId()))) {
412 conractIds += jsonObject.getString("id") + ","; 483 conractIds += jsonObject.getString("id") + ",";
413 break; 484 break;
414 } 485 }
415 } 486 }
416 -  
417 } 487 }
418 -  
419 -  
420 -  
421 - if(conractIds.length() == 0){ 488 +
  489 + if (conractIds.length() == 0) {
422 return conractIds; 490 return conractIds;
423 } 491 }
424 - return conractIds.substring(0,conractIds.length()-1);  
425 - } 492 + return conractIds.substring(0, conractIds.length() - 1);
  493 + }
426 494
427 @Override 495 @Override
428 public void endAllTruckUnActive() { 496 public void endAllTruckUnActive() {
429 truckActivateMapper.endAllTurckUnActive(); 497 truckActivateMapper.endAllTurckUnActive();
430 - 498 +
431 } 499 }
432 500
433 @Override 501 @Override
434 public List<TruckActivate> getTruckListByObjects(TruckActivate truckActivate) { 502 public List<TruckActivate> getTruckListByObjects(TruckActivate truckActivate) {
435 return truckActivateMapper.getTruckListByObjects(truckActivate); 503 return truckActivateMapper.getTruckListByObjects(truckActivate);
436 } 504 }
437 - 505 +
  506 + @Override
  507 + public List<Map> getTruckHistoryListByObjects(TruckActivate truckActivate) {
  508 +
  509 + SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
  510 + if (truckActivate.getStartTime() == null) {
  511 + String start, end;
  512 +
  513 + Date date = new Date();
  514 +
  515 + if (new Date().getHours() < 8) {
  516 + end = yearFomat.format(date);
  517 + date.setDate(date.getDate() - 1);
  518 + start = yearFomat.format(date);
  519 + } else {
  520 + start = yearFomat.format(date);
  521 + date.setDate(date.getDate() + 1);
  522 + end = yearFomat.format(date);
  523 + }
  524 +
  525 + end += " 08:00:00";
  526 + start += " 08:00:00";
  527 +
  528 + try {
  529 + truckActivate.setStartTime(start);
  530 + truckActivate.setEndTime(end);
  531 + } catch (Exception e) {
  532 +
  533 + e.printStackTrace();
  534 + }
  535 + }
  536 +
  537 + List list = truckActivateMapper.getTruckHistoryListByObjects(truckActivate);
  538 +
  539 + Gson gson = new Gson();
  540 +
  541 + String json = gson.toJson(list);
  542 +
  543 + List<Map> data = gson.fromJson(json, new TypeToken<List<Map>>() {
  544 + }.getType());
  545 +
  546 + for (Map map : data) {
  547 +
  548 + if (map.get("routeInfo") != null) {
  549 + map.put("routeInfo", gson.fromJson(map.get("routeInfo").toString(), new TypeToken<List<Map>>() {
  550 + }.getType()));
  551 + }
  552 + if (map.get("earthList") != null) {
  553 + map.put("earthList", gson.fromJson(map.get("earthList").toString(), new TypeToken<List<Map>>() {
  554 + }.getType()));
  555 + }
  556 +
  557 + }
  558 +
  559 + return data;
  560 + }
  561 +
438 @Override 562 @Override
439 public List<TruckActivate> getActivedTruckList(TruckActivate truckActivate) { 563 public List<TruckActivate> getActivedTruckList(TruckActivate truckActivate) {
440 - 564 +
441 return truckActivateMapper.getActivedTruckList(truckActivate); 565 return truckActivateMapper.getActivedTruckList(truckActivate);
442 - 566 +
443 } 567 }
444 } 568 }
trash-workFlow/src/main/java/com/trash/business/service/impl/TruckCreditServiceImpl.java
1 package com.trash.business.service.impl; 1 package com.trash.business.service.impl;
2 2
  3 +import java.util.ArrayList;
3 import java.util.Date; 4 import java.util.Date;
  5 +import java.util.HashMap;
4 import java.util.List; 6 import java.util.List;
  7 +import java.util.Map;
5 8
6 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
8 import org.springframework.transaction.annotation.Transactional; 11 import org.springframework.transaction.annotation.Transactional;
9 12
  13 +import com.alibaba.fastjson.JSONArray;
  14 +import com.alibaba.fastjson.JSONObject;
10 import com.trash.business.domain.CompanyCredit; 15 import com.trash.business.domain.CompanyCredit;
  16 +import com.trash.business.domain.EarthsitesCredit;
11 import com.trash.business.domain.TruckCredit; 17 import com.trash.business.domain.TruckCredit;
12 import com.trash.business.mapper.TruckCreditMapper; 18 import com.trash.business.mapper.TruckCreditMapper;
13 import com.trash.business.service.ITruckCreditService; 19 import com.trash.business.service.ITruckCreditService;
  20 +import com.trash.common.utils.RemoteServerUtils;
14 import com.trash.common.utils.SecurityUtils; 21 import com.trash.common.utils.SecurityUtils;
15 22
16 /** 23 /**
@@ -45,8 +52,46 @@ public class TruckCreditServiceImpl implements ITruckCreditService @@ -45,8 +52,46 @@ public class TruckCreditServiceImpl implements ITruckCreditService
45 */ 52 */
46 @Override 53 @Override
47 public List<TruckCredit> selectTruckCreditList(TruckCredit truckCredit) 54 public List<TruckCredit> selectTruckCreditList(TruckCredit truckCredit)
48 - {  
49 - return truckCreditMapper.selectTruckCreditList(truckCredit); 55 + {
  56 +
  57 + List<TruckCredit> list = new ArrayList<>();
  58 +
  59 + List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds();
  60 + List<String> tList = SecurityUtils.getLoginUser().getUser().getTruckList();
  61 +
  62 + if (tList.size() > 0 || companys.size() > 0) {
  63 + List<String> ids = new ArrayList<>();
  64 + for(String str:tList){
  65 + ids.add(str);
  66 + }
  67 +
  68 +
  69 + if(companys.size() > 0){
  70 +
  71 + Map map = new HashMap<>();
  72 + map.put("size",99999);
  73 + map.put("valid",0);
  74 + map.put("page",1);
  75 +
  76 + JSONArray jsonArray = RemoteServerUtils.getTruckList(map);
  77 +
  78 +
  79 + for(Object obj:jsonArray){
  80 + JSONObject json = (JSONObject) obj;
  81 + if(companys.indexOf(json.getString("companyID")) > -1){
  82 + ids.add(json.getString("id"));
  83 + }
  84 + }
  85 + }
  86 +
  87 + truckCredit.setIds(ids);
  88 +
  89 +
  90 + list = truckCreditMapper.selectTruckCreditList(truckCredit);
  91 + }
  92 +
  93 +
  94 + return list;
50 } 95 }
51 96
52 /** 97 /**
@@ -127,7 +172,42 @@ public class TruckCreditServiceImpl implements ITruckCreditService @@ -127,7 +172,42 @@ public class TruckCreditServiceImpl implements ITruckCreditService
127 @Override 172 @Override
128 public List<TruckCredit> selectTruckCreditHistory(TruckCredit truckCredit) 173 public List<TruckCredit> selectTruckCreditHistory(TruckCredit truckCredit)
129 { 174 {
130 - return truckCreditMapper.selectTruckCreditHistory(truckCredit); 175 + List<TruckCredit> list = new ArrayList<>();
  176 + List<String> companys = SecurityUtils.getLoginUser().getUser().getCompanyIds();
  177 + List<String> tList = SecurityUtils.getLoginUser().getUser().getTruckList();
  178 +
  179 + if (tList.size() > 0 || companys.size() > 0) {
  180 + List<String> ids = new ArrayList<>();
  181 + for(String str:tList){
  182 + ids.add(str);
  183 + }
  184 +
  185 +
  186 + if(companys.size() > 0){
  187 +
  188 + Map map = new HashMap<>();
  189 + map.put("size",99999);
  190 + map.put("valid",0);
  191 + map.put("page",1);
  192 +
  193 + JSONArray jsonArray = RemoteServerUtils.getTruckList(map);
  194 +
  195 +
  196 + for(Object obj:jsonArray){
  197 + JSONObject json = (JSONObject) obj;
  198 + if(companys.indexOf(json.getString("companyID")) > -1){
  199 + ids.add(json.getString("id"));
  200 + }
  201 + }
  202 + }
  203 +
  204 + truckCredit.setIds(ids);
  205 +
  206 +
  207 + list = truckCreditMapper.selectTruckCreditHistory(truckCredit);
  208 + }
  209 +
  210 + return list;
131 } 211 }
132 212
133 /** 213 /**
trash-workFlow/src/main/java/com/trash/caseOffline/controller/CaseOfflineController.java
@@ -23,6 +23,7 @@ import com.alibaba.fastjson.JSONArray; @@ -23,6 +23,7 @@ import com.alibaba.fastjson.JSONArray;
23 import com.alibaba.fastjson.JSONObject; 23 import com.alibaba.fastjson.JSONObject;
24 import com.trash.caseOffline.domain.CaseOffline; 24 import com.trash.caseOffline.domain.CaseOffline;
25 import com.trash.caseOffline.service.ICaseOfflineService; 25 import com.trash.caseOffline.service.ICaseOfflineService;
  26 +import com.trash.casefile.domain.ViolationWarningInformation;
26 import com.trash.common.utils.RemoteServerUtils; 27 import com.trash.common.utils.RemoteServerUtils;
27 import com.trash.common.utils.SecurityUtils; 28 import com.trash.common.utils.SecurityUtils;
28 import com.trash.common.utils.poi.ExcelUtil; 29 import com.trash.common.utils.poi.ExcelUtil;
@@ -53,61 +54,9 @@ public class CaseOfflineController extends BaseController @@ -53,61 +54,9 @@ public class CaseOfflineController extends BaseController
53 { 54 {
54 startPage(); 55 startPage();
55 56
56 - JSONArray depts = redisCache.getCacheObject("CSUserDepartmentType");  
57 -  
58 - JSONArray areas = redisCache.getCacheObject("areas");  
59 -  
60 - if(areas == null){  
61 - areas = RemoteServerUtils.getAreas();  
62 - redisCache.setCacheObject("areas", areas);  
63 - }  
64 -  
65 - if(depts == null){  
66 - Map<String, String> map = new HashMap<String, String>();  
67 - map.put("type", "CSUserDepartmentType");  
68 - depts = RemoteServerUtils.getDict(map);  
69 - redisCache.setCacheObject("CSUserDepartmentType", depts);  
70 - }  
71 -  
72 -  
73 - for(Object object :depts){  
74 - JSONObject dept = (JSONObject) object;  
75 - List<String> roles = SecurityUtils.getLoginUser().getUser().getRoleIds();  
76 57
77 - for(String role:roles){  
78 - if(dept.getString("code").equals(role)){  
79 58
80 - if(dept.getString("name").equals("事务中心")){  
81 - List<CaseOffline> list = caseOfflineService.selectCaseOfflineList(caseOffline);  
82 - return getDataTable(list);  
83 - }  
84 -  
85 - if(dept.getString("name").contains("渣土办")){  
86 - String deptName = dept.getString("name").replace("渣土办", "");  
87 - if(!deptName.isEmpty()){  
88 - for(Object obj:areas){  
89 - JSONObject area = (JSONObject)obj;  
90 -  
91 - if(area.getString("name").equals(deptName)){  
92 -  
93 - caseOffline.setPlace(area.getString("code"));  
94 -  
95 - List<CaseOffline> list = caseOfflineService.selectCaseOfflineList(caseOffline);  
96 - return getDataTable(list);  
97 - }  
98 - }  
99 - }  
100 -  
101 - }  
102 - }  
103 - }  
104 - }  
105 -  
106 -  
107 - caseOffline.setCreateBy(SecurityUtils.getUsername());  
108 -  
109 - List<CaseOffline> list = caseOfflineService.selectCaseOfflineList(caseOffline);  
110 - return getDataTable(list); 59 + return getDataTable(caseOfflineService.selectCaseOfflineList(caseOffline));
111 } 60 }
112 61
113 /** 62 /**
trash-workFlow/src/main/java/com/trash/caseOffline/domain/CaseOffline.java
1 package com.trash.caseOffline.domain; 1 package com.trash.caseOffline.domain;
2 2
3 import java.util.Date; 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 import com.fasterxml.jackson.annotation.JsonFormat; 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 import org.apache.commons.lang3.builder.ToStringBuilder; 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 import org.apache.commons.lang3.builder.ToStringStyle; 8 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -94,6 +96,17 @@ public class CaseOffline extends BaseEntity @@ -94,6 +96,17 @@ public class CaseOffline extends BaseEntity
94 96
95 private String endTime; 97 private String endTime;
96 98
  99 + private List<String> names;
  100 +
  101 +
  102 + public List<String> getNames() {
  103 + return names;
  104 + }
  105 +
  106 + public void setNames(List<String> names) {
  107 + this.names = names;
  108 + }
  109 +
97 public String getStartTime() { 110 public String getStartTime() {
98 return startTime; 111 return startTime;
99 } 112 }
trash-workFlow/src/main/java/com/trash/caseOffline/service/impl/CaseOfflineServiceImpl.java
@@ -75,6 +75,39 @@ public class CaseOfflineServiceImpl implements ICaseOfflineService @@ -75,6 +75,39 @@ public class CaseOfflineServiceImpl implements ICaseOfflineService
75 @Override 75 @Override
76 public List<CaseOffline> selectCaseOfflineList(CaseOffline caseOffline) 76 public List<CaseOffline> selectCaseOfflineList(CaseOffline caseOffline)
77 { 77 {
  78 +
  79 + List<CaseOffline> list = new ArrayList<>();
  80 +
  81 + List<String> names = new ArrayList<>();
  82 +
  83 + List<String> cLish = SecurityUtils.getLoginUser().getUser().getConList();
  84 + List<String> cArea = SecurityUtils.getLoginUser().getUser().getConAreas();
  85 + List<String> eLish = SecurityUtils.getLoginUser().getUser().getEarthList();
  86 + List<String> eArea = SecurityUtils.getLoginUser().getUser().getEarthAreas();
  87 +
  88 + JSONArray earthList = redisCache.getCacheObject("earthSitesList");
  89 + JSONArray construList = redisCache.getCacheObject("constructionList");
  90 +
  91 + for(Object obj:earthList){
  92 + JSONObject jsonObject = (JSONObject) obj;
  93 + if(eLish.indexOf(jsonObject.getString("id")) > 0 || eArea.indexOf(jsonObject.getString("areaCode"))> 0){
  94 + names.add(jsonObject.getString("name"));
  95 + }
  96 + }
  97 + for(Object obj:construList){
  98 + JSONObject jsonObject = (JSONObject) obj;
  99 + if(cLish.indexOf(jsonObject.getString("id")) > 0 || cArea.indexOf(jsonObject.getString("areaCode"))> 0){
  100 + names.add(jsonObject.getString("name"));
  101 + }
  102 + }
  103 +
  104 + if(names.size() == 0){
  105 + return list;
  106 + }else{
  107 + caseOffline.setNames(names);
  108 + }
  109 +
  110 +
78 return caseOfflineMapper.selectCaseOfflineList(caseOffline); 111 return caseOfflineMapper.selectCaseOfflineList(caseOffline);
79 } 112 }
80 113
trash-workFlow/src/main/java/com/trash/casefile/controller/ViolationCaseFileController.java
@@ -41,233 +41,157 @@ import org.springframework.web.multipart.MultipartFile; @@ -41,233 +41,157 @@ import org.springframework.web.multipart.MultipartFile;
41 */ 41 */
42 @RestController 42 @RestController
43 @RequestMapping("/casefile/violationCaseFile") 43 @RequestMapping("/casefile/violationCaseFile")
44 -public class ViolationCaseFileController extends BaseController  
45 -{  
46 - @Autowired  
47 - private IViolationCaseFileService violationCaseFileService; 44 +public class ViolationCaseFileController extends BaseController {
  45 + @Autowired
  46 + private IViolationCaseFileService violationCaseFileService;
  47 +
  48 +
  49 + /**
  50 + * 查询平台违规案卷列表
  51 + */
  52 + @GetMapping("/list")
  53 + public TableDataInfo list(ViolationCaseFile violationCaseFile) {
  54 + startPage();
  55 +
  56 + return getDataTable(violationCaseFileService.selectViolationCaseFileList(violationCaseFile));
  57 + }
  58 +
  59 + /**
  60 + * 导出平台违规案卷列表
  61 + */
  62 + @Log(title = "平台违规案卷", businessType = BusinessType.EXPORT)
  63 + @GetMapping("/export")
  64 + public AjaxResult export(ViolationCaseFile violationCaseFile) {
  65 + List<ViolationCaseFile> list = violationCaseFileService.selectViolationCaseFileList(violationCaseFile);
  66 +
  67 + for (int i = 0; i < list.size(); i++) {
  68 + list.get(i).setId((long) i + 1);
  69 + }
  70 + ExcelUtil<ViolationCaseFile> util = new ExcelUtil<ViolationCaseFile>(ViolationCaseFile.class);
  71 + return util.exportExcel(list, "平台违规案卷数据");
  72 + }
  73 +
  74 + /**
  75 + * 获取平台违规案卷详细信息
  76 + */
  77 + @GetMapping(value = "/{id}")
  78 + public AjaxResult getInfo(@PathVariable("id") Long id) {
  79 + return AjaxResult.success(violationCaseFileService.selectViolationCaseFileById(id));
  80 + }
  81 +
  82 + /**
  83 + * 新增平台违规案卷
  84 + */
  85 + @Log(title = "平台违规案卷", businessType = BusinessType.INSERT)
  86 + @PostMapping
  87 + @RepeatSubmit
  88 + public AjaxResult add(@RequestParam(value = "fileList") MultipartFile[] files, ViolationCaseFile violationCaseFile)
  89 + throws IOException {
  90 + return toAjax(violationCaseFileService.insertViolationCaseFile(files, violationCaseFile));
  91 + }
  92 +
  93 + /**
  94 + * 修改平台违规案卷
  95 + */
  96 + @Log(title = "平台违规案卷", businessType = BusinessType.UPDATE)
  97 + @PutMapping
  98 + public AjaxResult edit(@RequestParam(value = "fileList") MultipartFile[] files, String violationCaseFile,
  99 + String[] uploadFilesList) throws IOException {
  100 + ViolationCaseFileVo violationCaseFileVo = new ViolationCaseFileVo();
  101 + violationCaseFileVo.setViolationCaseFile(JSON.parseObject(violationCaseFile, ViolationCaseFile.class));
  102 + List<UploadFile> uploadFileList = new ArrayList<>();
  103 + for (String uploadFile : uploadFilesList) {
  104 + UploadFile uploadFile1 = JSON.parseObject(uploadFile, UploadFile.class);
  105 + if (uploadFile1 != null) {
  106 + if (uploadFile1.getId() != null) {
  107 + uploadFileList.add(uploadFile1);
  108 + }
  109 + }
  110 + }
  111 + violationCaseFileVo.setUploadFiles(uploadFileList);
  112 + return toAjax(violationCaseFileService.updateViolationCaseFile(files, violationCaseFileVo));
  113 + }
  114 +
  115 + @PutMapping(value = "updateViolationCaseFileReader")
  116 + public int updateViolationCaseFileReader(@RequestBody ViolationCaseFile violationCaseFile) throws IOException {
  117 + try {
  118 +
  119 + violationCaseFile.setReadBy(SecurityUtils.getUsername());
  120 + violationCaseFile.setReadTime(DateUtils.getNowDate());
  121 + violationCaseFileService.updateViolationCaseFile(violationCaseFile);
  122 + return 1;
  123 + } catch (Exception e) {
  124 + e.printStackTrace();
  125 + return 0;
  126 + }
  127 + }
48 128
49 - @Autowired  
50 - RedisCache redisCache; 129 + String[] caseType = { "进入非专用车辆", "无许可手续(工)", "无许可手续(消)", "黄土覆盖情况", "出入口路面污染", "出入口道路硬化", "车辆冲洗是否到位", "雾炮机是否正常开启",
  130 + "使用非专用车运输", "监控点位未对准", "工地预警-未报开工作业", "工地预警-视频设备离线超时报警", "工地预警-三无车辆进入工地", "工地预警-未按时间作业",
  131 + "处理场所预警-未报开工作业", "处理场所预警-视频设备离线超时报警", "处理场所预警-三无车辆进入处理场所","处理场所预警-未到指定的处理场所作业", "离线运输报警(工)", "离线运输报警(消)",
  132 + "未激活车辆作业", "未核准作业车辆作业", "未按线路行驶", "闯禁行驶", "失信车辆作业", "卫星定位异常",
  133 + "其他2", "其他3", "其他4", "其他5" };
51 134
52 - /**  
53 - * 查询平台违规案卷列表  
54 - */  
55 - @GetMapping("/list")  
56 - public TableDataInfo list(ViolationCaseFile violationCaseFile)  
57 - {  
58 - startPage();  
59 -  
60 - JSONArray depts = redisCache.getCacheObject("CSUserDepartmentType");  
61 -  
62 - JSONArray areas = redisCache.getCacheObject("areas");  
63 -  
64 - if(areas == null){  
65 - areas = RemoteServerUtils.getAreas();  
66 - redisCache.setCacheObject("areas", areas);  
67 - }  
68 -  
69 - if(depts == null){  
70 - Map<String, String> map = new HashMap<String, String>();  
71 - map.put("type", "CSUserDepartmentType");  
72 - depts = RemoteServerUtils.getDict(map);  
73 - redisCache.setCacheObject("CSUserDepartmentType", depts);  
74 - }  
75 -  
76 -  
77 - for(Object object :depts){  
78 - JSONObject dept = (JSONObject) object;  
79 - List<String> roles = SecurityUtils.getLoginUser().getUser().getRoleIds();  
80 -  
81 - for(String role:roles){  
82 - if(dept.getString("code").equals(role)){ 135 + @GetMapping(value = "/caseTable")
  136 + public AjaxResult getTable(String owningRegion, String startDate, String endDate) {
  137 + List<HashMap<String, String>> maps = new ArrayList<HashMap<String, String>>();
83 138
84 - if(dept.getString("name").equals("事务中心")){  
85 - List<ViolationCaseFile> list = violationCaseFileService.selectViolationCaseFileList(violationCaseFile);  
86 - return getDataTable(list);  
87 - }  
88 -  
89 - if(dept.getString("name").contains("渣土办")){  
90 - String deptName = dept.getString("name").replace("渣土办", "");  
91 - if(!deptName.isEmpty()){  
92 - violationCaseFile.setOwningRegion(deptName);  
93 -  
94 - List<ViolationCaseFile> list = violationCaseFileService.selectViolationCaseFileList(violationCaseFile);  
95 - return getDataTable(list);  
96 - }  
97 -  
98 -  
99 - }  
100 - }  
101 - }  
102 - }  
103 -  
104 - String companyName = null;  
105 - JSONArray compnayList = redisCache.getCacheObject("companyList");  
106 - for(Object obj:compnayList){  
107 - JSONObject con = (JSONObject) obj;  
108 - if(con.getString("abbreviation").equals(SecurityUtils.getUsername().replace("公司", ""))){  
109 - companyName = con.getString("name");  
110 - break;  
111 - }  
112 - }  
113 -  
114 - if(companyName!=null){  
115 - violationCaseFile.setCompanyName(companyName);  
116 - }else{  
117 - violationCaseFile.setCreateBy(SecurityUtils.getUsername());  
118 - }  
119 -  
120 - List<ViolationCaseFile> list = violationCaseFileService.selectViolationCaseFileList(violationCaseFile);  
121 - return getDataTable(list);  
122 - } 139 + if (owningRegion.equals("长沙市")) {
  140 + owningRegion = "";
  141 + }
123 142
124 - /**  
125 - * 导出平台违规案卷列表  
126 - */  
127 - @Log(title = "平台违规案卷", businessType = BusinessType.EXPORT)  
128 - @GetMapping("/export")  
129 - public AjaxResult export(ViolationCaseFile violationCaseFile)  
130 - {  
131 - List<ViolationCaseFile> list = violationCaseFileService.selectViolationCaseFileList(violationCaseFile); 143 + if (startDate != null && endDate != null && startDate != "" && endDate != "") {
  144 + startDate = startDate.substring(0, 10);
  145 + endDate = endDate.substring(0, 10);
  146 + }
132 147
133 - for(int i = 0;i<list.size();i++){  
134 - list.get(i).setId((long)i+1);  
135 - }  
136 - ExcelUtil<ViolationCaseFile> util = new ExcelUtil<ViolationCaseFile>(ViolationCaseFile.class);  
137 - return util.exportExcel(list, "平台违规案卷数据");  
138 - } 148 + List<ViolationCaseFile> list = violationCaseFileService.selectViolationCaseFileListByTable(owningRegion,
  149 + startDate, endDate);
139 150
140 - /**  
141 - * 获取平台违规案卷详细信息  
142 - */  
143 - @GetMapping(value = "/{id}")  
144 - public AjaxResult getInfo(@PathVariable("id") Long id)  
145 - {  
146 - return AjaxResult.success(violationCaseFileService.selectViolationCaseFileById(id));  
147 - } 151 + for (String type : caseType) {
148 152
149 - /**  
150 - * 新增平台违规案卷  
151 - */  
152 - @Log(title = "平台违规案卷", businessType = BusinessType.INSERT)  
153 - @PostMapping  
154 - @RepeatSubmit  
155 - public AjaxResult add(@RequestParam(value = "fileList") MultipartFile[] files, ViolationCaseFile violationCaseFile) throws IOException  
156 - {  
157 - return toAjax(violationCaseFileService.insertViolationCaseFile(files,violationCaseFile));  
158 - } 153 + HashMap<String, String> map = new HashMap<>();
159 154
160 - /**  
161 - * 修改平台违规案卷  
162 - */  
163 - @Log(title = "平台违规案卷", businessType = BusinessType.UPDATE)  
164 - @PutMapping  
165 - public AjaxResult edit(@RequestParam(value = "fileList") MultipartFile[] files, String violationCaseFile, String[] uploadFilesList) throws IOException  
166 - {  
167 - ViolationCaseFileVo violationCaseFileVo = new ViolationCaseFileVo();  
168 - violationCaseFileVo.setViolationCaseFile(JSON.parseObject(violationCaseFile, ViolationCaseFile.class));  
169 - List<UploadFile> uploadFileList = new ArrayList<>();  
170 - for (String uploadFile : uploadFilesList) {  
171 - UploadFile uploadFile1 = JSON.parseObject(uploadFile,UploadFile.class);  
172 - if(uploadFile1!=null){  
173 - if(uploadFile1.getId()!=null){  
174 - uploadFileList.add(uploadFile1);  
175 - }  
176 - }  
177 - }  
178 - violationCaseFileVo.setUploadFiles(uploadFileList);  
179 - return toAjax(violationCaseFileService.updateViolationCaseFile(files,violationCaseFileVo));  
180 - }  
181 -  
182 - @PutMapping(value="updateViolationCaseFileReader")  
183 - public int updateViolationCaseFileReader(@RequestBody ViolationCaseFile violationCaseFile) throws IOException  
184 - {  
185 - try { 155 + map.put("type", type);
186 156
187 - violationCaseFile.setReadBy(SecurityUtils.getUsername());  
188 - violationCaseFile.setReadTime(DateUtils.getNowDate());  
189 - violationCaseFileService.updateViolationCaseFile(violationCaseFile);  
190 - return 1;  
191 - } catch (Exception e) {  
192 - e.printStackTrace();  
193 - return 0;  
194 - }  
195 - }  
196 -  
197 -  
198 - String[] caseType = {"进入非专用车辆","无许可手续(工)","无许可手续(消)","黄土覆盖情况","出入口路面污染","出入口道路硬化","车辆冲洗是否到位",  
199 - "雾炮机是否正常开启","使用费专用车运输","监控点位未对准","未报开工作业","视频设备离线超时报警","三无车辆进入工地","未按时间作业",  
200 - "未报开工作业","视频设备离线超时报警","三无车辆进入处理场所","未到指定的处理场所作业","离线运输报警(工)","离线运输报警(消)","未激活车辆作业",  
201 - "未核准作业车辆作业","未按线路行驶","闯禁行驶","失信车辆作业","卫星定位异常","其他2","其他3","其他4","其他5"}; 157 + int count = 0;
  158 + int repCount = 0;
  159 +
  160 + for (ViolationCaseFile file : list) {
  161 + if (type.equals(file.getViolationType())) {
  162 + count += 1;
  163 + if (file.getReadBy() != null && !file.getReadBy().isEmpty()) {
  164 + repCount += 1;
  165 + }
202 166
203 - @GetMapping(value = "/caseTable")  
204 - public AjaxResult getTable(String owningRegion,String startDate,String endDate){  
205 - List<HashMap<String, String>> maps = new ArrayList<HashMap<String,String>>(); 167 + }
206 168
207 - if(owningRegion.equals("长沙市")){  
208 - owningRegion = "";  
209 - } 169 + }
  170 +
  171 + map.put("count", count + "");
  172 + map.put("repCount", repCount + "");
  173 +
  174 + if (count == 0) {
  175 + double pct = ((double) repCount) / ((double) count);
  176 + map.put("repPct", "0%");
  177 + maps.add(map);
  178 + } else {
  179 + double pct = ((double) repCount) / ((double) count);
  180 + map.put("repPct", String.format("%.2f", (pct * 100)) + "%");
  181 + maps.add(map);
  182 + }
  183 +
  184 + }
210 185
211 - if(startDate != null && endDate != null&&startDate!=""&&endDate!=""){  
212 - startDate = startDate.substring(0,10);  
213 - endDate = endDate.substring(0,10);  
214 - }  
215 -  
216 - List<ViolationCaseFile> list = violationCaseFileService.selectViolationCaseFileListByTable(owningRegion,startDate,endDate);  
217 -  
218 - for(String type:caseType){  
219 -  
220 - HashMap<String, String> map = new HashMap<>();  
221 -  
222 - map.put("type", type);  
223 -  
224 - int count = 0;  
225 - int repCount = 0;  
226 -  
227 - for(ViolationCaseFile file:list){  
228 - if(type.equals(file.getViolationType())){  
229 - count +=1;  
230 - if(file.getReadBy() != null && !file.getReadBy().isEmpty()){  
231 - repCount += 1;  
232 - }  
233 -  
234 - }  
235 -  
236 -  
237 - }  
238 -  
239 - map.put("count", count + "");  
240 - map.put("repCount", repCount + "");  
241 -  
242 - if(count == 0){  
243 - double pct = ((double)repCount)/((double)count);  
244 - map.put("repPct","0%");  
245 - maps.add(map);  
246 - }else{  
247 - double pct = ((double)repCount)/((double)count);  
248 - map.put("repPct",String.format("%.2f", (pct*100)) + "%");  
249 - maps.add(map);  
250 - }  
251 -  
252 -  
253 -  
254 - }  
255 -  
256 -  
257 -  
258 - return AjaxResult.success(maps);  
259 - }  
260 -  
261 -  
262 - 186 + return AjaxResult.success(maps);
  187 + }
263 188
264 - /**  
265 - * 删除平台违规案卷  
266 - */  
267 - @Log(title = "平台违规案卷", businessType = BusinessType.DELETE) 189 + /**
  190 + * 删除平台违规案卷
  191 + */
  192 + @Log(title = "平台违规案卷", businessType = BusinessType.DELETE)
268 @DeleteMapping("/{ids}") 193 @DeleteMapping("/{ids}")
269 - public AjaxResult remove(@PathVariable Long[] ids) throws IOException  
270 - {  
271 - return toAjax(violationCaseFileService.deleteViolationCaseFileByIds(ids));  
272 - } 194 + public AjaxResult remove(@PathVariable Long[] ids) throws IOException {
  195 + return toAjax(violationCaseFileService.deleteViolationCaseFileByIds(ids));
  196 + }
273 } 197 }
trash-workFlow/src/main/java/com/trash/casefile/controller/ViolationWarningInformationController.java
@@ -59,69 +59,7 @@ public class ViolationWarningInformationController extends BaseController @@ -59,69 +59,7 @@ public class ViolationWarningInformationController extends BaseController
59 { 59 {
60 startPage(); 60 startPage();
61 61
62 -  
63 - JSONArray depts = redisCache.getCacheObject("CSUserDepartmentType");  
64 -  
65 - JSONArray areas = redisCache.getCacheObject("areas");  
66 -  
67 - if(areas == null){  
68 - areas = RemoteServerUtils.getAreas();  
69 - redisCache.setCacheObject("areas", areas);  
70 - }  
71 -  
72 - if(depts == null){  
73 - Map<String, String> map = new HashMap<String, String>();  
74 - map.put("type", "CSUserDepartmentType");  
75 - depts = RemoteServerUtils.getDict(map);  
76 - redisCache.setCacheObject("CSUserDepartmentType", depts);  
77 - }  
78 -  
79 -  
80 - for(Object object :depts){  
81 - JSONObject dept = (JSONObject) object;  
82 - List<String> roles = SecurityUtils.getLoginUser().getUser().getRoleIds();  
83 -  
84 - for(String role:roles){  
85 - if(dept.getString("code").equals(role)){  
86 -  
87 - if(dept.getString("name").equals("事务中心")){  
88 - List<ViolationWarningInformation> list = violationWarningInformationService.selectViolationWarningInformationList(violationWarningInformation);  
89 - return getDataTable(list);  
90 - }  
91 -  
92 - if(dept.getString("name").contains("渣土办")){  
93 - String deptName = dept.getString("name").replace("渣土办", "");  
94 - if(!deptName.isEmpty()){  
95 - violationWarningInformation.setOwningRegion(deptName);  
96 - List<ViolationWarningInformation> list = violationWarningInformationService.selectViolationWarningInformationList(violationWarningInformation);  
97 - return getDataTable(list);  
98 - }  
99 -  
100 -  
101 - }  
102 - }  
103 - }  
104 - }  
105 -  
106 - String companyName = null;  
107 - JSONArray compnayList = redisCache.getCacheObject("companyList");  
108 - for(Object obj:compnayList){  
109 - JSONObject con = (JSONObject) obj;  
110 - if(con.getString("abbreviation").equals(SecurityUtils.getUsername().replace("公司", ""))){  
111 - companyName = con.getString("name");  
112 - break;  
113 - }  
114 - }  
115 -  
116 - if(companyName!=null){  
117 - violationWarningInformation.setCompanyName(companyName);  
118 - }else{  
119 - violationWarningInformation.setCreateBy(SecurityUtils.getUsername());  
120 - }  
121 -  
122 -  
123 - List<ViolationWarningInformation> list = violationWarningInformationService.selectViolationWarningInformationList(violationWarningInformation);  
124 - return getDataTable(list); 62 + return getDataTable(violationWarningInformationService.selectViolationWarningInformationList(violationWarningInformation));
125 } 63 }
126 64
127 /** 65 /**
trash-workFlow/src/main/java/com/trash/casefile/domain/ViolationCaseFile.java
1 package com.trash.casefile.domain; 1 package com.trash.casefile.domain;
2 2
3 import java.util.Date; 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 import com.fasterxml.jackson.annotation.JsonFormat; 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 import org.apache.commons.lang3.builder.ToStringBuilder; 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 import org.apache.commons.lang3.builder.ToStringStyle; 8 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -83,9 +85,18 @@ public class ViolationCaseFile extends BaseEntity @@ -83,9 +85,18 @@ public class ViolationCaseFile extends BaseEntity
83 85
84 private String endTime; 86 private String endTime;
85 87
  88 + private List<String> names;
86 89
87 90
88 - public String getStartTime() { 91 + public List<String> getNames() {
  92 + return names;
  93 + }
  94 +
  95 + public void setNames(List<String> names) {
  96 + this.names = names;
  97 + }
  98 +
  99 + public String getStartTime() {
89 return startTime; 100 return startTime;
90 } 101 }
91 102
trash-workFlow/src/main/java/com/trash/casefile/domain/ViolationWarningInformation.java
1 package com.trash.casefile.domain; 1 package com.trash.casefile.domain;
2 2
3 import java.util.Date; 3 import java.util.Date;
  4 +import java.util.List;
4 5
5 import com.fasterxml.jackson.annotation.JsonFormat; 6 import com.fasterxml.jackson.annotation.JsonFormat;
6 import org.apache.commons.lang3.builder.ToStringBuilder; 7 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -120,8 +121,17 @@ public class ViolationWarningInformation extends BaseEntity { @@ -120,8 +121,17 @@ public class ViolationWarningInformation extends BaseEntity {
120 121
121 private String endTime; 122 private String endTime;
122 123
  124 + private List<String> names;
123 125
124 126
  127 + public List<String> getNames() {
  128 + return names;
  129 + }
  130 +
  131 + public void setNames(List<String> names) {
  132 + this.names = names;
  133 + }
  134 +
125 public String getStartTime() { 135 public String getStartTime() {
126 return startTime; 136 return startTime;
127 } 137 }
trash-workFlow/src/main/java/com/trash/casefile/kafka/Consumer.java
1 -package com.trash.casefile.kafka;  
2 -  
3 -import com.alibaba.fastjson.JSONArray;  
4 -import com.alibaba.fastjson.JSONObject;  
5 -import com.trash.casefile.domain.KafkaCompensation;  
6 -import com.trash.casefile.domain.ViolationWarningInformation;  
7 -import com.trash.casefile.mapper.KafkaCompensationMapper;  
8 -import com.trash.casefile.mapper.ViolationWarningInformationMapper;  
9 -import com.trash.casefile.service.IViolationWarningInformationService;  
10 -import com.trash.common.config.trashConfig;  
11 -import com.trash.common.core.redis.RedisCache;  
12 -import com.trash.common.utils.DateUtils;  
13 -import com.trash.common.utils.RemoteServerUtils;  
14 -import com.trash.common.utils.StringUtils;  
15 -import com.trash.common.utils.spring.SpringUtils;  
16 -import com.trash.framework.web.service.SysLoginService;  
17 -import org.apache.commons.lang3.time.DateFormatUtils;  
18 -import org.apache.kafka.clients.consumer.ConsumerRecord;  
19 -import org.slf4j.Logger;  
20 -import org.slf4j.LoggerFactory;  
21 -import org.springframework.beans.factory.annotation.Autowired;  
22 -import org.springframework.kafka.annotation.KafkaListener;  
23 -import org.springframework.kafka.support.Acknowledgment;  
24 -import org.springframework.kafka.support.KafkaHeaders;  
25 -import org.springframework.messaging.handler.annotation.Header;  
26 -import org.springframework.messaging.handler.annotation.Payload;  
27 -import org.springframework.stereotype.Component;  
28 -import org.springframework.transaction.annotation.Transactional;  
29 -  
30 -import java.io.IOException;  
31 -import java.time.LocalTime;  
32 -import java.time.format.DateTimeFormatter;  
33 -import java.util.*;  
34 -import java.util.concurrent.TimeUnit;  
35 -  
36 -@Component  
37 -public class Consumer {  
38 - private static final Logger log = LoggerFactory.getLogger(Consumer.class);  
39 -  
40 - @Autowired  
41 - private IViolationWarningInformationService violationWarningInformationService;  
42 -  
43 - @KafkaListener(topics = "record_process_alarm")  
44 - public void consume(ConsumerRecord<?, ?> record, Acknowledgment ack) throws InterruptedException, IOException {  
45 - log.info("kafka消费数据成功,offset:"+ record.offset() +",data:" + record.value());  
46 - String id = insertKafkaCompensation(record.value().toString());  
47 - autoViolationWarning(record.value().toString(),id);  
48 - //手动提交offset  
49 - ack.acknowledge();  
50 - }  
51 -  
52 - @Autowired  
53 - trashConfig trashConfig;  
54 -  
55 - @Autowired  
56 - SysLoginService loginService;  
57 -  
58 - @Autowired  
59 - RedisCache redisCache;  
60 -  
61 - public void autoViolationWarning(String data,String id) throws InterruptedException, IOException {  
62 -  
63 - String[] code = {"44030020=工地预警-未报开工作业", "44030021=工地预警-视频设备离线超时报警", "44030022=工地预警-三无车辆进入工地", "44030023=工地预警-未按时间作业",  
64 - "44030024=处理场所预警-未报开工作业", "44030025=处理场所预警-视频设备离线超时报警", "44030026=处理场所预警-三无车辆进入处理场所", "44030027=处理场所预警-未到指定的处理场所作业",  
65 - "44030028=离线运输报警(工)", "44030029=离线运输报警(消)", "44030030=未激活车辆作业", "44030031=未核准作业车辆作业", "44030032=未按线路行驶",  
66 - "44030033=闯禁行驶", "44030034=失信车辆作业", "44030035=卫星定位异常"};  
67 -  
68 -  
69 - JSONObject jsonObject = JSONObject.parseObject(data);  
70 - //报警时间  
71 - Date alarmTime = new Date(jsonObject.getLong("alarmTime")*1000L);  
72 -  
73 - //这一块是一天内同一工地,同一类型的报警,只报有一条数据,不重复报工,只累加  
74 - String nowHour = DateFormatUtils.format(alarmTime, "HH");  
75 - String nowDate = null;  
76 - String tomorrowDate = null;  
77 - if(Integer.valueOf(nowHour)<8){  
78 - nowDate = DateFormatUtils.format(DateUtils.addDays(alarmTime, -1), "yyyy-MM-dd");  
79 - tomorrowDate = DateFormatUtils.format(alarmTime, "yyyy-MM-dd");  
80 - }else{  
81 - nowDate = DateFormatUtils.format(alarmTime, "yyyy-MM-dd");  
82 - tomorrowDate = DateFormatUtils.format(DateUtils.addDays(alarmTime, 1), "yyyy-MM-dd");  
83 - }  
84 -  
85 -  
86 -  
87 -  
88 - //违规类型code  
89 - String violationTypeCode = jsonObject.getString("alarmType");  
90 - //违规类型  
91 - String violationType = jsonObject.getString("alarmName");  
92 - if(RemoteServerUtils.remote==null){  
93 - //登录  
94 - RemoteServerUtils.remote = trashConfig.getRemotePath();  
95 - loginService.loginByRemote(trashConfig.getToken());  
96 - }  
97 - ViolationWarningInformation violationWarningInformation1 = null;  
98 - JSONArray company1 = null;  
99 - JSONObject basevehicleInfo = null;  
100 - //这些类型无需累加  
101 - if(violationTypeCode.equals("44030021") || violationTypeCode.equals("44030025")||violationTypeCode.equals("44030023")){  
102 - violationWarningInformation1 = null;  
103 - }else if(violationTypeCode.equals("44030033")||violationTypeCode.equals("44030034")){//这两种类型根据公司累加  
104 - company1 = redisCache.getCacheObject("companyList");  
105 - basevehicleInfo = RemoteServerUtils.getBasevehicleInfo(jsonObject.getString("vehicleId"),trashConfig.getToken());  
106 - if(company1==null){  
107 - throw new RuntimeException("获取公司列表失败!!!");  
108 - }  
109 -  
110 - if(basevehicleInfo==null){  
111 - throw new RuntimeException("获取公司详情失败!vehicleId:"+jsonObject.getString("vehicleId"));  
112 - }  
113 - }else{//其他都是根据工地/消纳站累加  
114 - String project = jsonObject.getString("siteName");  
115 - violationWarningInformation1 = SpringUtils.getBean(ViolationWarningInformationMapper.class).selectViolationWarningInformation(null,project, violationType, nowDate, tomorrowDate);  
116 - }  
117 - String siteName = jsonObject.getString("siteName");  
118 - //判断该类型,该工地,该时间段是否已经存在报警信息,如果存在则不再新增,如果不存在则新增  
119 - if (violationWarningInformation1 == null) {  
120 - ViolationWarningInformation violationWarningInformation = new ViolationWarningInformation();  
121 - String siteType = jsonObject.getString("siteType");  
122 - if ("2".equals(siteType)) {//消纳场  
123 - violationWarningInformation.setViolationObjectType("1");  
124 - }  
125 - //所属区域  
126 - violationWarningInformation.setOwningRegion(jsonObject.getString("areaName"));  
127 - //案卷编码  
128 - String number = DateFormatUtils.format(alarmTime, "yyyyMMddHHmmssSSS");  
129 - violationWarningInformation.setNumber(number.substring(2));  
130 - //公司名称  
131 - violationWarningInformation.setCompanyName(jsonObject.getString("enterpriseName"));  
132 - //违规类型  
133 - violationWarningInformation.setViolationType(jsonObject.getString("alarmName"));  
134 - //发送人  
135 - violationWarningInformation.setCreateBy("长沙市建筑垃圾智慧监管平台");  
136 - //推送对象  
137 - violationWarningInformation.setViolationGrade("一般类");  
138 - //项目名称(工地名称,处理场所名称)  
139 -  
140 - violationWarningInformation.setSendObject("区管理部门");  
141 - String describe = "";  
142 - String alarmTimeString = DateFormatUtils.format(alarmTime,"HH:mm");  
143 - //根据不同违规类型,走不同流程  
144 - switch (violationTypeCode) {  
145 - case "44030020"://工地预警-未报开工作业  
146 - //获取报警次数  
147 - int count44030020 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020")==null?1:Integer.parseInt(redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020").toString())+1;  
148 - //获取累计报警描述  
149 - String describe44030020 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe")==null?"":redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe").toString();  
150 - if(!StringUtils.isEmpty(describe44030020)){  
151 - describe44030020 = describe44030020 + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
152 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
153 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
154 - }else{  
155 - describe44030020 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
156 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
157 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
158 - }  
159 - //报警次数等于5推送案卷  
160 - if(count44030020==5){  
161 - violationWarningInformation.setViolationObjectType("0");  
162 - violationWarningInformation.setSendObject("区管理部门");  
163 - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));  
164 - violationWarningInformation.setCreateTime(alarmTime);  
165 - violationWarningInformation.setDescribe(describe44030020);  
166 - // 业务逻辑  
167 - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);  
168 - }  
169 - //次数+1  
170 - redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030020",count44030020,24, TimeUnit.HOURS);  
171 - //累计描述  
172 - redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe",describe44030020,24, TimeUnit.HOURS);  
173 - break;  
174 - case "44030023"://工地预警-未按时间作业  
175 - try{  
176 - //获取工地信息  
177 - JSONObject object = RemoteServerUtils.getConstructionLicenseById(jsonObject.getString("siteId"), trashConfig.getToken());  
178 - String transportEndTime = object.getString("transportEndTime");  
179 - String transportStartTime = object.getString("transportStartTime");  
180 - String endTime = manipulateTime(transportEndTime,30);  
181 - String startTime = manipulateTime(transportStartTime,-30);  
182 - //获取结束运输报警次数  
183 - String countKey = nowDate+jsonObject.getString("siteId")+"44030023"+transportEndTime;  
184 - int count44030023 = redisCache.getCacheObject(countKey)==null?1:Integer.parseInt(redisCache.getCacheObject(countKey).toString())+1;  
185 - //获取结束运输累计报警描述  
186 - String describeKey = nowDate+jsonObject.getString("siteId")+"44030023describe"+transportEndTime;  
187 - String describe44030023 = redisCache.getCacheObject(describeKey)==null?"":redisCache.getCacheObject(describeKey).toString();  
188 - //获取结束运输报警次数  
189 - String countEKey = nowDate+jsonObject.getString("siteId")+"44030023"+transportStartTime;  
190 - int countE = redisCache.getCacheObject(countEKey)==null?1:Integer.parseInt(redisCache.getCacheObject(countEKey).toString())+1;  
191 - //获取结束运输累计报警描述  
192 - String describeEKey = nowDate+jsonObject.getString("siteId")+"44030023describe"+transportStartTime;  
193 - String describeE = redisCache.getCacheObject(describeEKey)==null?"":redisCache.getCacheObject(describeEKey).toString();  
194 -  
195 - if(!StringUtils.isEmpty(describe44030023)){  
196 - describe44030023 = describe44030023 + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
197 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
198 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
199 - }else{  
200 - describe44030023 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
201 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
202 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
203 - }  
204 - //报警次数等于5推送案卷  
205 - if(count44030023==5){  
206 - violationWarningInformation.setViolationObjectType("0");  
207 - violationWarningInformation.setSendObject("区管理部门");  
208 - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));  
209 -  
210 - violationWarningInformation.setCreateTime(alarmTime);  
211 - violationWarningInformation.setDescribe(describe44030023);  
212 - // 业务逻辑  
213 - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);  
214 - }  
215 -  
216 - if(!StringUtils.isEmpty(describeE)){  
217 - describeE = describeE + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
218 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
219 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
220 - }else{  
221 - describeE = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
222 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
223 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
224 - }  
225 - //报警次数等于5推送案卷  
226 - if(countE==5){  
227 - violationWarningInformation.setViolationObjectType("0");  
228 - violationWarningInformation.setSendObject("区管理部门");  
229 - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));  
230 -  
231 - violationWarningInformation.setCreateTime(alarmTime);  
232 - violationWarningInformation.setDescribe(describeE);  
233 - // 业务逻辑  
234 - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);  
235 - }  
236 -  
237 -  
238 - //判断结束运输  
239 - if(isTimeWithinRange(alarmTimeString,transportEndTime,endTime)){  
240 - //次数+1  
241 - redisCache.setCacheObject(countKey,count44030023,12, TimeUnit.HOURS);  
242 - //累计描述  
243 - redisCache.setCacheObject(describeKey,describe44030023,12, TimeUnit.HOURS);  
244 - }else if(isTimeWithinRange(alarmTimeString,startTime,transportStartTime)){  
245 - //次数+1  
246 - redisCache.setCacheObject(countEKey,countE,12, TimeUnit.HOURS);  
247 - //累计描述  
248 - redisCache.setCacheObject(describeEKey,describeE,12, TimeUnit.HOURS);  
249 - }  
250 - }catch (NullPointerException e){  
251 - throw e;  
252 - }  
253 - break;  
254 -  
255 - case "44030030"://未激活车辆作业  
256 - case "44030031"://未核准作业车辆作业  
257 - case "44030022"://工地预警-三无车辆进入工地  
258 - case "44030021"://工地预警-视频设备离线超时报警  
259 - case "44030028"://离线运输报警(工)  
260 -  
261 - violationWarningInformation.setViolationObjectType("0");  
262 - violationWarningInformation.setSendObject("区管理部门");  
263 - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));  
264 - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
265 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
266 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
267 - violationWarningInformation.setCreateTime(alarmTime);  
268 - violationWarningInformation.setDescribe(describe);  
269 - // 业务逻辑  
270 - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);  
271 - break;  
272 -  
273 - case "44030024"://处理场所预警-未报开工作业  
274 - //获取报警次数  
275 - int count44030024 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024")==null?1:Integer.parseInt(redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024").toString())+1;  
276 - //获取累计报警描述  
277 - String describe44030024 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe")==null?"":redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe").toString();  
278 - if(!StringUtils.isEmpty(describe44030024)){  
279 - describe44030024 = describe44030024 + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
280 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
281 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
282 - }else{  
283 - describe44030024 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
284 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
285 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
286 - }  
287 - //报警次数等于5推送案卷  
288 - if(count44030024==5){  
289 - violationWarningInformation.setViolationObjectType("1");  
290 - violationWarningInformation.setSendObject("区管理部门");  
291 - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));  
292 -  
293 - violationWarningInformation.setCreateTime(alarmTime);  
294 - violationWarningInformation.setDescribe(describe44030024);  
295 - // 业务逻辑  
296 - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);  
297 - }  
298 -  
299 -  
300 - //次数+1  
301 - redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030024",count44030024,24, TimeUnit.HOURS);  
302 - //累计描述  
303 - redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe",describe44030024,24, TimeUnit.HOURS);  
304 - break;  
305 - case "44030027"://处理场所预警-未到指定的处理场所作业  
306 - case "44030026"://处理场所预警-三无车辆进入处理场所  
307 - case "44030029"://离线运输报警(消)  
308 - case "44030025"://处理场所预警-视频设备离线超时报警  
309 - violationWarningInformation.setViolationObjectType("1");  
310 - violationWarningInformation.setSendObject("区管理部门");  
311 - violationWarningInformation.setProjectName(jsonObject.getString("siteName"));  
312 - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
313 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
314 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
315 - violationWarningInformation.setCreateTime(alarmTime);  
316 - violationWarningInformation.setDescribe(describe);  
317 - // 业务逻辑  
318 - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);  
319 - break;  
320 - case "44030032"://未按线路行驶  
321 - violationWarningInformation.setViolationObjectType("0");  
322 - violationWarningInformation.setViolationGrade("重点类");  
323 - violationWarningInformation.setSendObject("区管理部门");  
324 - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
325 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +  
326 - jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();  
327 - violationWarningInformation.setCreateTime(alarmTime);  
328 - violationWarningInformation.setDescribe(describe);  
329 - // 业务逻辑  
330 - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);  
331 - break;  
332 - case "44030033"://闯禁行驶  
333 - violationWarningInformation.setViolationObjectType("0");  
334 - violationWarningInformation.setSendObject("区管理部门");  
335 - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
336 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "出现" + violationWarningInformation.getViolationType();  
337 - //设置公司简称  
338 - for(Object o:company1){  
339 - JSONObject jo = (JSONObject) o;  
340 - if(basevehicleInfo.getString("companyID").equals(jo.getString("id"))){  
341 - violationWarningInformation.setAbbreviation(jo.getString("abbreviation"));  
342 - }  
343 - }  
344 - violationWarningInformation.setCreateTime(alarmTime);  
345 - violationWarningInformation.setDescribe(describe);  
346 - // 业务逻辑  
347 - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);  
348 - break;  
349 -  
350 - case "44030034"://失信车辆作业  
351 - violationWarningInformation.setViolationObjectType("2");  
352 - violationWarningInformation.setSendObject("运输企业");  
353 - describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
354 - + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "出现" + violationWarningInformation.getViolationType();  
355 - //设置公司简称  
356 - for(Object o:company1){  
357 - JSONObject jo = (JSONObject) o;  
358 - if(basevehicleInfo.getString("companyID").equals(jo.getString("id"))){  
359 - violationWarningInformation.setAbbreviation(jo.getString("abbreviation"));  
360 - }  
361 - }  
362 - violationWarningInformation.setCreateTime(alarmTime);  
363 - violationWarningInformation.setDescribe(describe);  
364 - // 业务逻辑  
365 - violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);  
366 - break;  
367 - }  
368 -  
369 -  
370 -  
371 -  
372 - } else {  
373 - String describe = "";  
374 - if(violationTypeCode.equals("44030033")||violationTypeCode.equals("44030034")){  
375 - describe = violationWarningInformation1.getDescribe() + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
376 - + jsonObject.getString("enterpriseName") + " " + jsonObject.get("licenseplateNo") + "出现" + jsonObject.getString("alarmName");  
377 - }else{  
378 - describe = violationWarningInformation1.getDescribe() + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "  
379 - + jsonObject.getString("enterpriseName") + " " + jsonObject.get("licenseplateNo") + "在" +  
380 - jsonObject.get("siteName") + "出现" + jsonObject.getString("alarmName");  
381 - }  
382 -  
383 - violationWarningInformation1.setDescribe(describe);  
384 - SpringUtils.getBean(ViolationWarningInformationMapper.class).updateViolationWarningInformation(violationWarningInformation1);  
385 - }  
386 - //kafka消费成功  
387 - KafkaCompensation kafkaCompensation = new KafkaCompensation();  
388 - kafkaCompensation.setId(Long.valueOf(id));  
389 - kafkaCompensation.setStatus(1);  
390 - SpringUtils.getBean(KafkaCompensationMapper.class).updateKafkaCompensation(kafkaCompensation);  
391 -  
392 - }  
393 -  
394 - public String insertKafkaCompensation(String data){  
395 - KafkaCompensation kafkaCompensation = new KafkaCompensation();  
396 - kafkaCompensation.setData(data);  
397 - kafkaCompensation.setCreateTime(DateUtils.getNowDate());  
398 - kafkaCompensation.setStatus(0);  
399 - SpringUtils.getBean(KafkaCompensationMapper.class).insertKafkaCompensation(kafkaCompensation);  
400 - return kafkaCompensation.getId().toString();  
401 - }  
402 -  
403 - /**  
404 - * 对HH:mm格式时间进行分钟的加减  
405 - * @param timeStr  
406 - * @param minutesToAddOrSubtract  
407 - * @return  
408 - */  
409 - public String manipulateTime(String timeStr, int minutesToAddOrSubtract) {  
410 - // 定义输入时间格式的日期时间格式器  
411 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");  
412 -  
413 - // 解析输入的时间字符串为 LocalTime 对象  
414 - LocalTime time = LocalTime.parse(timeStr, formatter);  
415 -  
416 - // 执行加减分钟的操作  
417 - LocalTime modifiedTime = time.plusMinutes(minutesToAddOrSubtract);  
418 -  
419 - // 将修改后的时间格式化为 HH:mm 格式  
420 - String formattedModifiedTime = modifiedTime.format(formatter);  
421 -  
422 - return formattedModifiedTime;  
423 - }  
424 -  
425 - /**  
426 - * 判断timeStr是否在startTimeStr-endTimeStr区间  
427 - * @param timeStr  
428 - * @param startTimeStr  
429 - * @param endTimeStr  
430 - * @return  
431 - */  
432 - public boolean isTimeWithinRange(String timeStr, String startTimeStr, String endTimeStr) {  
433 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");  
434 - LocalTime time = LocalTime.parse(timeStr, formatter);  
435 - LocalTime startTime = LocalTime.parse(startTimeStr, formatter);  
436 - LocalTime endTime = LocalTime.parse(endTimeStr, formatter);  
437 -  
438 - return !time.isBefore(startTime) && !time.isAfter(endTime);  
439 -  
440 - }  
441 -} 1 +//package com.trash.casefile.kafka;
  2 +//
  3 +//import com.alibaba.fastjson.JSONArray;
  4 +//import com.alibaba.fastjson.JSONObject;
  5 +//import com.trash.casefile.domain.KafkaCompensation;
  6 +//import com.trash.casefile.domain.ViolationWarningInformation;
  7 +//import com.trash.casefile.mapper.KafkaCompensationMapper;
  8 +//import com.trash.casefile.mapper.ViolationWarningInformationMapper;
  9 +//import com.trash.casefile.service.IViolationWarningInformationService;
  10 +//import com.trash.common.config.trashConfig;
  11 +//import com.trash.common.core.redis.RedisCache;
  12 +//import com.trash.common.utils.DateUtils;
  13 +//import com.trash.common.utils.RemoteServerUtils;
  14 +//import com.trash.common.utils.StringUtils;
  15 +//import com.trash.common.utils.spring.SpringUtils;
  16 +//import com.trash.framework.web.service.SysLoginService;
  17 +//import org.apache.commons.lang3.time.DateFormatUtils;
  18 +//import org.apache.kafka.clients.consumer.ConsumerRecord;
  19 +//import org.slf4j.Logger;
  20 +//import org.slf4j.LoggerFactory;
  21 +//import org.springframework.beans.factory.annotation.Autowired;
  22 +//import org.springframework.kafka.annotation.KafkaListener;
  23 +//import org.springframework.kafka.support.Acknowledgment;
  24 +//import org.springframework.kafka.support.KafkaHeaders;
  25 +//import org.springframework.messaging.handler.annotation.Header;
  26 +//import org.springframework.messaging.handler.annotation.Payload;
  27 +//import org.springframework.stereotype.Component;
  28 +//import org.springframework.transaction.annotation.Transactional;
  29 +//
  30 +//import java.io.IOException;
  31 +//import java.time.LocalTime;
  32 +//import java.time.format.DateTimeFormatter;
  33 +//import java.util.*;
  34 +//import java.util.concurrent.TimeUnit;
  35 +//
  36 +//@Component
  37 +//public class Consumer {
  38 +// private static final Logger log = LoggerFactory.getLogger(Consumer.class);
  39 +//
  40 +// @Autowired
  41 +// private IViolationWarningInformationService violationWarningInformationService;
  42 +//
  43 +// @KafkaListener(topics = "record_process_alarm")
  44 +// public void consume(ConsumerRecord<?, ?> record, Acknowledgment ack) throws InterruptedException, IOException {
  45 +// log.info("kafka消费数据成功,offset:"+ record.offset() +",data:" + record.value());
  46 +// String id = insertKafkaCompensation(record.value().toString());
  47 +// autoViolationWarning(record.value().toString(),id);
  48 +// //手动提交offset
  49 +// ack.acknowledge();
  50 +// }
  51 +//
  52 +// @Autowired
  53 +// trashConfig trashConfig;
  54 +//
  55 +// @Autowired
  56 +// SysLoginService loginService;
  57 +//
  58 +// @Autowired
  59 +// RedisCache redisCache;
  60 +//
  61 +// public void autoViolationWarning(String data,String id) throws InterruptedException, IOException {
  62 +//
  63 +// String[] code = {"44030020=工地预警-未报开工作业", "44030021=工地预警-视频设备离线超时报警", "44030022=工地预警-三无车辆进入工地", "44030023=工地预警-未按时间作业",
  64 +// "44030024=处理场所预警-未报开工作业", "44030025=处理场所预警-视频设备离线超时报警", "44030026=处理场所预警-三无车辆进入处理场所", "44030027=处理场所预警-未到指定的处理场所作业",
  65 +// "44030028=离线运输报警(工)", "44030029=离线运输报警(消)", "44030030=未激活车辆作业", "44030031=未核准作业车辆作业", "44030032=未按线路行驶",
  66 +// "44030033=闯禁行驶", "44030034=失信车辆作业", "44030035=卫星定位异常"};
  67 +//
  68 +//
  69 +// JSONObject jsonObject = JSONObject.parseObject(data);
  70 +// //报警时间
  71 +// Date alarmTime = new Date(jsonObject.getLong("alarmTime")*1000L);
  72 +//
  73 +// //这一块是一天内同一工地,同一类型的报警,只报有一条数据,不重复报工,只累加
  74 +// String nowHour = DateFormatUtils.format(alarmTime, "HH");
  75 +// String nowDate = null;
  76 +// String tomorrowDate = null;
  77 +// if(Integer.valueOf(nowHour)<8){
  78 +// nowDate = DateFormatUtils.format(DateUtils.addDays(alarmTime, -1), "yyyy-MM-dd");
  79 +// tomorrowDate = DateFormatUtils.format(alarmTime, "yyyy-MM-dd");
  80 +// }else{
  81 +// nowDate = DateFormatUtils.format(alarmTime, "yyyy-MM-dd");
  82 +// tomorrowDate = DateFormatUtils.format(DateUtils.addDays(alarmTime, 1), "yyyy-MM-dd");
  83 +// }
  84 +//
  85 +//
  86 +//
  87 +//
  88 +// //违规类型code
  89 +// String violationTypeCode = jsonObject.getString("alarmType");
  90 +// //违规类型
  91 +// String violationType = jsonObject.getString("alarmName");
  92 +// if(RemoteServerUtils.remote==null){
  93 +// //登录
  94 +// RemoteServerUtils.remote = trashConfig.getRemotePath();
  95 +// loginService.loginByRemote(trashConfig.getToken());
  96 +// }
  97 +// ViolationWarningInformation violationWarningInformation1 = null;
  98 +// JSONArray company1 = null;
  99 +// JSONObject basevehicleInfo = null;
  100 +// //这些类型无需累加
  101 +// if(violationTypeCode.equals("44030021") || violationTypeCode.equals("44030025")||violationTypeCode.equals("44030023")){
  102 +// violationWarningInformation1 = null;
  103 +// }else if(violationTypeCode.equals("44030033")||violationTypeCode.equals("44030034")){//这两种类型根据公司累加
  104 +// company1 = redisCache.getCacheObject("companyList");
  105 +// basevehicleInfo = RemoteServerUtils.getBasevehicleInfo(jsonObject.getString("vehicleId"),trashConfig.getToken());
  106 +// if(company1==null){
  107 +// throw new RuntimeException("获取公司列表失败!!!");
  108 +// }
  109 +//
  110 +// if(basevehicleInfo==null){
  111 +// throw new RuntimeException("获取公司详情失败!vehicleId:"+jsonObject.getString("vehicleId"));
  112 +// }
  113 +// }else{//其他都是根据工地/消纳站累加
  114 +// String project = jsonObject.getString("siteName");
  115 +// violationWarningInformation1 = SpringUtils.getBean(ViolationWarningInformationMapper.class).selectViolationWarningInformation(null,project, violationType, nowDate, tomorrowDate);
  116 +// }
  117 +// String siteName = jsonObject.getString("siteName");
  118 +// //判断该类型,该工地,该时间段是否已经存在报警信息,如果存在则不再新增,如果不存在则新增
  119 +// if (violationWarningInformation1 == null) {
  120 +// ViolationWarningInformation violationWarningInformation = new ViolationWarningInformation();
  121 +// String siteType = jsonObject.getString("siteType");
  122 +// if ("2".equals(siteType)) {//消纳场
  123 +// violationWarningInformation.setViolationObjectType("1");
  124 +// }
  125 +// //所属区域
  126 +// violationWarningInformation.setOwningRegion(jsonObject.getString("areaName"));
  127 +// //案卷编码
  128 +// String number = DateFormatUtils.format(alarmTime, "yyyyMMddHHmmssSSS");
  129 +// violationWarningInformation.setNumber(number.substring(2));
  130 +// //公司名称
  131 +// violationWarningInformation.setCompanyName(jsonObject.getString("enterpriseName"));
  132 +// //违规类型
  133 +// violationWarningInformation.setViolationType(jsonObject.getString("alarmName"));
  134 +// //发送人
  135 +// violationWarningInformation.setCreateBy("长沙市建筑垃圾智慧监管平台");
  136 +// //推送对象
  137 +// violationWarningInformation.setViolationGrade("一般类");
  138 +// //项目名称(工地名称,处理场所名称)
  139 +//
  140 +// violationWarningInformation.setSendObject("区管理部门");
  141 +// String describe = "";
  142 +// String alarmTimeString = DateFormatUtils.format(alarmTime,"HH:mm");
  143 +// //根据不同违规类型,走不同流程
  144 +// switch (violationTypeCode) {
  145 +// case "44030020"://工地预警-未报开工作业
  146 +// //获取报警次数
  147 +// int count44030020 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020")==null?1:Integer.parseInt(redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020").toString())+1;
  148 +// //获取累计报警描述
  149 +// String describe44030020 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe")==null?"":redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe").toString();
  150 +// if(!StringUtils.isEmpty(describe44030020)){
  151 +// describe44030020 = describe44030020 + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  152 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  153 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  154 +// }else{
  155 +// describe44030020 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  156 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  157 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  158 +// }
  159 +// //报警次数等于5推送案卷
  160 +// if(count44030020==5){
  161 +// violationWarningInformation.setViolationObjectType("0");
  162 +// violationWarningInformation.setSendObject("区管理部门");
  163 +// violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  164 +// violationWarningInformation.setCreateTime(alarmTime);
  165 +// violationWarningInformation.setDescribe(describe44030020);
  166 +// // 业务逻辑
  167 +// violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  168 +// }
  169 +// //次数+1
  170 +// redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030020",count44030020,24, TimeUnit.HOURS);
  171 +// //累计描述
  172 +// redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030020describe",describe44030020,24, TimeUnit.HOURS);
  173 +// break;
  174 +// case "44030023"://工地预警-未按时间作业
  175 +// try{
  176 +// //获取工地信息
  177 +// JSONObject object = RemoteServerUtils.getConstructionLicenseById(jsonObject.getString("siteId"), trashConfig.getToken());
  178 +// String transportEndTime = object.getString("transportEndTime");
  179 +// String transportStartTime = object.getString("transportStartTime");
  180 +// String endTime = manipulateTime(transportEndTime,30);
  181 +// String startTime = manipulateTime(transportStartTime,-30);
  182 +// //获取结束运输报警次数
  183 +// String countKey = nowDate+jsonObject.getString("siteId")+"44030023"+transportEndTime;
  184 +// int count44030023 = redisCache.getCacheObject(countKey)==null?1:Integer.parseInt(redisCache.getCacheObject(countKey).toString())+1;
  185 +// //获取结束运输累计报警描述
  186 +// String describeKey = nowDate+jsonObject.getString("siteId")+"44030023describe"+transportEndTime;
  187 +// String describe44030023 = redisCache.getCacheObject(describeKey)==null?"":redisCache.getCacheObject(describeKey).toString();
  188 +// //获取结束运输报警次数
  189 +// String countEKey = nowDate+jsonObject.getString("siteId")+"44030023"+transportStartTime;
  190 +// int countE = redisCache.getCacheObject(countEKey)==null?1:Integer.parseInt(redisCache.getCacheObject(countEKey).toString())+1;
  191 +// //获取结束运输累计报警描述
  192 +// String describeEKey = nowDate+jsonObject.getString("siteId")+"44030023describe"+transportStartTime;
  193 +// String describeE = redisCache.getCacheObject(describeEKey)==null?"":redisCache.getCacheObject(describeEKey).toString();
  194 +//
  195 +// if(!StringUtils.isEmpty(describe44030023)){
  196 +// describe44030023 = describe44030023 + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  197 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  198 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  199 +// }else{
  200 +// describe44030023 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  201 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  202 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  203 +// }
  204 +// //报警次数等于5推送案卷
  205 +// if(count44030023==5){
  206 +// violationWarningInformation.setViolationObjectType("0");
  207 +// violationWarningInformation.setSendObject("区管理部门");
  208 +// violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  209 +//
  210 +// violationWarningInformation.setCreateTime(alarmTime);
  211 +// violationWarningInformation.setDescribe(describe44030023);
  212 +// // 业务逻辑
  213 +// violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  214 +// }
  215 +//
  216 +// if(!StringUtils.isEmpty(describeE)){
  217 +// describeE = describeE + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  218 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  219 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  220 +// }else{
  221 +// describeE = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  222 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  223 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  224 +// }
  225 +// //报警次数等于5推送案卷
  226 +// if(countE==5){
  227 +// violationWarningInformation.setViolationObjectType("0");
  228 +// violationWarningInformation.setSendObject("区管理部门");
  229 +// violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  230 +//
  231 +// violationWarningInformation.setCreateTime(alarmTime);
  232 +// violationWarningInformation.setDescribe(describeE);
  233 +// // 业务逻辑
  234 +// violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  235 +// }
  236 +//
  237 +//
  238 +// //判断结束运输
  239 +// if(isTimeWithinRange(alarmTimeString,transportEndTime,endTime)){
  240 +// //次数+1
  241 +// redisCache.setCacheObject(countKey,count44030023,12, TimeUnit.HOURS);
  242 +// //累计描述
  243 +// redisCache.setCacheObject(describeKey,describe44030023,12, TimeUnit.HOURS);
  244 +// }else if(isTimeWithinRange(alarmTimeString,startTime,transportStartTime)){
  245 +// //次数+1
  246 +// redisCache.setCacheObject(countEKey,countE,12, TimeUnit.HOURS);
  247 +// //累计描述
  248 +// redisCache.setCacheObject(describeEKey,describeE,12, TimeUnit.HOURS);
  249 +// }
  250 +// }catch (NullPointerException e){
  251 +// throw e;
  252 +// }
  253 +// break;
  254 +//
  255 +// case "44030030"://未激活车辆作业
  256 +// case "44030031"://未核准作业车辆作业
  257 +// case "44030022"://工地预警-三无车辆进入工地
  258 +// case "44030021"://工地预警-视频设备离线超时报警
  259 +// case "44030028"://离线运输报警(工)
  260 +//
  261 +// violationWarningInformation.setViolationObjectType("0");
  262 +// violationWarningInformation.setSendObject("区管理部门");
  263 +// violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  264 +// describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  265 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  266 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  267 +// violationWarningInformation.setCreateTime(alarmTime);
  268 +// violationWarningInformation.setDescribe(describe);
  269 +// // 业务逻辑
  270 +// violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  271 +// break;
  272 +//
  273 +// case "44030024"://处理场所预警-未报开工作业
  274 +// //获取报警次数
  275 +// int count44030024 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024")==null?1:Integer.parseInt(redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024").toString())+1;
  276 +// //获取累计报警描述
  277 +// String describe44030024 = redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe")==null?"":redisCache.getCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe").toString();
  278 +// if(!StringUtils.isEmpty(describe44030024)){
  279 +// describe44030024 = describe44030024 + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  280 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  281 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  282 +// }else{
  283 +// describe44030024 = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  284 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  285 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  286 +// }
  287 +// //报警次数等于5推送案卷
  288 +// if(count44030024==5){
  289 +// violationWarningInformation.setViolationObjectType("1");
  290 +// violationWarningInformation.setSendObject("区管理部门");
  291 +// violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  292 +//
  293 +// violationWarningInformation.setCreateTime(alarmTime);
  294 +// violationWarningInformation.setDescribe(describe44030024);
  295 +// // 业务逻辑
  296 +// violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  297 +// }
  298 +//
  299 +//
  300 +// //次数+1
  301 +// redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030024",count44030024,24, TimeUnit.HOURS);
  302 +// //累计描述
  303 +// redisCache.setCacheObject(nowDate+jsonObject.getString("siteId")+"44030024describe",describe44030024,24, TimeUnit.HOURS);
  304 +// break;
  305 +// case "44030027"://处理场所预警-未到指定的处理场所作业
  306 +// case "44030026"://处理场所预警-三无车辆进入处理场所
  307 +// case "44030029"://离线运输报警(消)
  308 +// case "44030025"://处理场所预警-视频设备离线超时报警
  309 +// violationWarningInformation.setViolationObjectType("1");
  310 +// violationWarningInformation.setSendObject("区管理部门");
  311 +// violationWarningInformation.setProjectName(jsonObject.getString("siteName"));
  312 +// describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  313 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  314 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  315 +// violationWarningInformation.setCreateTime(alarmTime);
  316 +// violationWarningInformation.setDescribe(describe);
  317 +// // 业务逻辑
  318 +// violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  319 +// break;
  320 +// case "44030032"://未按线路行驶
  321 +// violationWarningInformation.setViolationObjectType("0");
  322 +// violationWarningInformation.setViolationGrade("重点类");
  323 +// violationWarningInformation.setSendObject("区管理部门");
  324 +// describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  325 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "在" +
  326 +// jsonObject.get("siteName") + "出现" + violationWarningInformation.getViolationType();
  327 +// violationWarningInformation.setCreateTime(alarmTime);
  328 +// violationWarningInformation.setDescribe(describe);
  329 +// // 业务逻辑
  330 +// violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  331 +// break;
  332 +// case "44030033"://闯禁行驶
  333 +// violationWarningInformation.setViolationObjectType("0");
  334 +// violationWarningInformation.setSendObject("区管理部门");
  335 +// describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  336 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "出现" + violationWarningInformation.getViolationType();
  337 +// //设置公司简称
  338 +// for(Object o:company1){
  339 +// JSONObject jo = (JSONObject) o;
  340 +// if(basevehicleInfo.getString("companyID").equals(jo.getString("id"))){
  341 +// violationWarningInformation.setAbbreviation(jo.getString("abbreviation"));
  342 +// }
  343 +// }
  344 +// violationWarningInformation.setCreateTime(alarmTime);
  345 +// violationWarningInformation.setDescribe(describe);
  346 +// // 业务逻辑
  347 +// violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  348 +// break;
  349 +//
  350 +// case "44030034"://失信车辆作业
  351 +// violationWarningInformation.setViolationObjectType("2");
  352 +// violationWarningInformation.setSendObject("运输企业");
  353 +// describe = DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  354 +// + violationWarningInformation.getCompanyName() + " " + jsonObject.get("licenseplateNo") + "出现" + violationWarningInformation.getViolationType();
  355 +// //设置公司简称
  356 +// for(Object o:company1){
  357 +// JSONObject jo = (JSONObject) o;
  358 +// if(basevehicleInfo.getString("companyID").equals(jo.getString("id"))){
  359 +// violationWarningInformation.setAbbreviation(jo.getString("abbreviation"));
  360 +// }
  361 +// }
  362 +// violationWarningInformation.setCreateTime(alarmTime);
  363 +// violationWarningInformation.setDescribe(describe);
  364 +// // 业务逻辑
  365 +// violationWarningInformationService.insertViolationWarningInformation(null, violationWarningInformation);
  366 +// break;
  367 +// }
  368 +//
  369 +//
  370 +//
  371 +//
  372 +// } else {
  373 +// String describe = "";
  374 +// if(violationTypeCode.equals("44030033")||violationTypeCode.equals("44030034")){
  375 +// describe = violationWarningInformation1.getDescribe() + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  376 +// + jsonObject.getString("enterpriseName") + " " + jsonObject.get("licenseplateNo") + "出现" + jsonObject.getString("alarmName");
  377 +// }else{
  378 +// describe = violationWarningInformation1.getDescribe() + ";\n" + DateFormatUtils.format(alarmTime, "yyyy/MM/dd HH:mm:ss") + " "
  379 +// + jsonObject.getString("enterpriseName") + " " + jsonObject.get("licenseplateNo") + "在" +
  380 +// jsonObject.get("siteName") + "出现" + jsonObject.getString("alarmName");
  381 +// }
  382 +//
  383 +// violationWarningInformation1.setDescribe(describe);
  384 +// SpringUtils.getBean(ViolationWarningInformationMapper.class).updateViolationWarningInformation(violationWarningInformation1);
  385 +// }
  386 +// //kafka消费成功
  387 +// KafkaCompensation kafkaCompensation = new KafkaCompensation();
  388 +// kafkaCompensation.setId(Long.valueOf(id));
  389 +// kafkaCompensation.setStatus(1);
  390 +// SpringUtils.getBean(KafkaCompensationMapper.class).updateKafkaCompensation(kafkaCompensation);
  391 +//
  392 +// }
  393 +//
  394 +// public String insertKafkaCompensation(String data){
  395 +// KafkaCompensation kafkaCompensation = new KafkaCompensation();
  396 +// kafkaCompensation.setData(data);
  397 +// kafkaCompensation.setCreateTime(DateUtils.getNowDate());
  398 +// kafkaCompensation.setStatus(0);
  399 +// SpringUtils.getBean(KafkaCompensationMapper.class).insertKafkaCompensation(kafkaCompensation);
  400 +// return kafkaCompensation.getId().toString();
  401 +// }
  402 +//
  403 +// /**
  404 +// * 对HH:mm格式时间进行分钟的加减
  405 +// * @param timeStr
  406 +// * @param minutesToAddOrSubtract
  407 +// * @return
  408 +// */
  409 +// public String manipulateTime(String timeStr, int minutesToAddOrSubtract) {
  410 +// // 定义输入时间格式的日期时间格式器
  411 +// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
  412 +//
  413 +// // 解析输入的时间字符串为 LocalTime 对象
  414 +// LocalTime time = LocalTime.parse(timeStr, formatter);
  415 +//
  416 +// // 执行加减分钟的操作
  417 +// LocalTime modifiedTime = time.plusMinutes(minutesToAddOrSubtract);
  418 +//
  419 +// // 将修改后的时间格式化为 HH:mm 格式
  420 +// String formattedModifiedTime = modifiedTime.format(formatter);
  421 +//
  422 +// return formattedModifiedTime;
  423 +// }
  424 +//
  425 +// /**
  426 +// * 判断timeStr是否在startTimeStr-endTimeStr区间
  427 +// * @param timeStr
  428 +// * @param startTimeStr
  429 +// * @param endTimeStr
  430 +// * @return
  431 +// */
  432 +// public boolean isTimeWithinRange(String timeStr, String startTimeStr, String endTimeStr) {
  433 +// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
  434 +// LocalTime time = LocalTime.parse(timeStr, formatter);
  435 +// LocalTime startTime = LocalTime.parse(startTimeStr, formatter);
  436 +// LocalTime endTime = LocalTime.parse(endTimeStr, formatter);
  437 +//
  438 +// return !time.isBefore(startTime) && !time.isAfter(endTime);
  439 +//
  440 +// }
  441 +//}
trash-workFlow/src/main/java/com/trash/casefile/service/impl/ViolationCaseFileServiceImpl.java
@@ -2,6 +2,7 @@ package com.trash.casefile.service.impl; @@ -2,6 +2,7 @@ package com.trash.casefile.service.impl;
2 2
3 import java.io.IOException; 3 import java.io.IOException;
4 import java.sql.Date; 4 import java.sql.Date;
  5 +import java.util.ArrayList;
5 import java.util.List; 6 import java.util.List;
6 import java.util.stream.Collectors; 7 import java.util.stream.Collectors;
7 8
@@ -19,6 +20,7 @@ import com.trash.casefile.domain.vo.ViolationCaseFileVo; @@ -19,6 +20,7 @@ import com.trash.casefile.domain.vo.ViolationCaseFileVo;
19 import com.trash.casefile.mapper.ViolationCaseFileMapper; 20 import com.trash.casefile.mapper.ViolationCaseFileMapper;
20 import com.trash.casefile.service.IViolationCaseFileService; 21 import com.trash.casefile.service.IViolationCaseFileService;
21 import com.trash.common.utils.DateUtils; 22 import com.trash.common.utils.DateUtils;
  23 +import com.trash.common.utils.RemoteServerUtils;
22 import com.trash.common.utils.SecurityUtils; 24 import com.trash.common.utils.SecurityUtils;
23 import com.trash.common.utils.file.FileUploadUtils; 25 import com.trash.common.utils.file.FileUploadUtils;
24 import com.trash.office.domain.UploadFile; 26 import com.trash.office.domain.UploadFile;
@@ -73,7 +75,48 @@ public class ViolationCaseFileServiceImpl implements IViolationCaseFileService @@ -73,7 +75,48 @@ public class ViolationCaseFileServiceImpl implements IViolationCaseFileService
73 */ 75 */
74 @Override 76 @Override
75 public List<ViolationCaseFile> selectViolationCaseFileList(ViolationCaseFile violationCaseFile) 77 public List<ViolationCaseFile> selectViolationCaseFileList(ViolationCaseFile violationCaseFile)
76 - { 78 + {
  79 +
  80 + List<ViolationCaseFile> list = new ArrayList<>();
  81 + JSONArray areas = redisCache.getCacheObject("areas");
  82 +
  83 + if (areas == null) {
  84 + areas = RemoteServerUtils.getAreas();
  85 + redisCache.setCacheObject("areas", areas);
  86 + }
  87 +
  88 +
  89 + List<String> names = new ArrayList<>();
  90 +
  91 + List<String> cLish = SecurityUtils.getLoginUser().getUser().getConList();
  92 + List<String> cArea = SecurityUtils.getLoginUser().getUser().getConAreas();
  93 + List<String> eLish = SecurityUtils.getLoginUser().getUser().getEarthList();
  94 + List<String> eArea = SecurityUtils.getLoginUser().getUser().getEarthAreas();
  95 +
  96 + JSONArray earthList = redisCache.getCacheObject("earthSitesList");
  97 + JSONArray construList = redisCache.getCacheObject("constructionList");
  98 +
  99 + for(Object obj:earthList){
  100 + JSONObject jsonObject = (JSONObject) obj;
  101 + if(eLish.indexOf(jsonObject.getString("id")) > 0 || eArea.indexOf(jsonObject.getString("areaCode"))> 0){
  102 + names.add(jsonObject.getString("name"));
  103 + }
  104 + }
  105 + for(Object obj:construList){
  106 + JSONObject jsonObject = (JSONObject) obj;
  107 + if(cLish.indexOf(jsonObject.getString("id")) > 0 || cArea.indexOf(jsonObject.getString("areaCode"))> 0){
  108 + names.add(jsonObject.getString("name"));
  109 + }
  110 + }
  111 +
  112 + if(names.size() == 0){
  113 + return list;
  114 + }else{
  115 + violationCaseFile.setNames(names);
  116 + }
  117 +
  118 +
  119 +
77 return violationCaseFileMapper.selectViolationCaseFileList(violationCaseFile); 120 return violationCaseFileMapper.selectViolationCaseFileList(violationCaseFile);
78 } 121 }
79 122
trash-workFlow/src/main/java/com/trash/casefile/service/impl/ViolationWarningInformationServiceImpl.java
@@ -5,6 +5,7 @@ import java.io.File; @@ -5,6 +5,7 @@ import java.io.File;
5 import java.io.FileNotFoundException; 5 import java.io.FileNotFoundException;
6 import java.io.FileReader; 6 import java.io.FileReader;
7 import java.io.IOException; 7 import java.io.IOException;
  8 +import java.util.ArrayList;
8 import java.util.HashMap; 9 import java.util.HashMap;
9 import java.util.List; 10 import java.util.List;
10 import java.util.Map; 11 import java.util.Map;
@@ -16,6 +17,7 @@ import com.alibaba.fastjson.JSONObject; @@ -16,6 +17,7 @@ import com.alibaba.fastjson.JSONObject;
16 import com.trash.casefile.domain.vo.ViolationWarningInformationVo; 17 import com.trash.casefile.domain.vo.ViolationWarningInformationVo;
17 import com.trash.common.core.redis.RedisCache; 18 import com.trash.common.core.redis.RedisCache;
18 import com.trash.common.utils.DateUtils; 19 import com.trash.common.utils.DateUtils;
  20 +import com.trash.common.utils.RemoteServerUtils;
19 import com.trash.common.utils.SecurityUtils; 21 import com.trash.common.utils.SecurityUtils;
20 import com.trash.common.utils.StringUtils; 22 import com.trash.common.utils.StringUtils;
21 import com.trash.common.utils.file.FileUploadUtils; 23 import com.trash.common.utils.file.FileUploadUtils;
@@ -78,7 +80,42 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning @@ -78,7 +80,42 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning
78 */ 80 */
79 @Override 81 @Override
80 public List<ViolationWarningInformation> selectViolationWarningInformationList(ViolationWarningInformation violationWarningInformation) 82 public List<ViolationWarningInformation> selectViolationWarningInformationList(ViolationWarningInformation violationWarningInformation)
81 - { 83 + {
  84 +
  85 + List<ViolationWarningInformation> list = new ArrayList<>();
  86 + JSONArray areas = redisCache.getCacheObject("areas");
  87 +
  88 + List<String> names = new ArrayList<>();
  89 +
  90 + List<String> cLish = SecurityUtils.getLoginUser().getUser().getConList();
  91 + List<String> cArea = SecurityUtils.getLoginUser().getUser().getConAreas();
  92 + List<String> eLish = SecurityUtils.getLoginUser().getUser().getEarthList();
  93 + List<String> eArea = SecurityUtils.getLoginUser().getUser().getEarthAreas();
  94 +
  95 + JSONArray earthList = redisCache.getCacheObject("earthSitesList");
  96 + JSONArray construList = redisCache.getCacheObject("constructionList");
  97 +
  98 + for(Object obj:earthList){
  99 + JSONObject jsonObject = (JSONObject) obj;
  100 + if(eLish.indexOf(jsonObject.getString("id")) > 0 || eArea.indexOf(jsonObject.getString("areaCode"))> 0){
  101 + names.add(jsonObject.getString("name"));
  102 + }
  103 + }
  104 + for(Object obj:construList){
  105 + JSONObject jsonObject = (JSONObject) obj;
  106 + if(cLish.indexOf(jsonObject.getString("id")) > 0 || cArea.indexOf(jsonObject.getString("areaCode"))> 0){
  107 + names.add(jsonObject.getString("name"));
  108 + }
  109 + }
  110 +
  111 + if(names.size() == 0){
  112 + return list;
  113 + }else{
  114 + violationWarningInformation.setNames(names);
  115 + }
  116 +
  117 +
  118 +
82 return violationWarningInformationMapper.selectViolationWarningInformationList(violationWarningInformation); 119 return violationWarningInformationMapper.selectViolationWarningInformationList(violationWarningInformation);
83 } 120 }
84 121
trash-workFlow/src/main/resources/mapper/CompanyCreditMapper.xml
@@ -30,6 +30,13 @@ @@ -30,6 +30,13 @@
30 <if test="status != null "> and status = #{status}</if> 30 <if test="status != null "> and status = #{status}</if>
31 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if> 31 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if>
32 <if test="objectId != null and objectId != ''"> and object_id = #{objectId}</if> 32 <if test="objectId != null and objectId != ''"> and object_id = #{objectId}</if>
  33 +
  34 + <if test="ids != null ">
  35 + and object_id in
  36 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  37 + #{id}
  38 + </foreach>
  39 + </if>
33 </where> 40 </where>
34 order by time DESC 41 order by time DESC
35 </select> 42 </select>
@@ -115,6 +122,12 @@ @@ -115,6 +122,12 @@
115 <where> 122 <where>
116 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> 123 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
117 <if test="place != null and place != ''"> and place = #{place}</if> 124 <if test="place != null and place != ''"> and place = #{place}</if>
  125 + <if test="ids != null ">
  126 + and object_id in
  127 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  128 + #{id}
  129 + </foreach>
  130 + </if>
118 </where> 131 </where>
119 </select> 132 </select>
120 133
trash-workFlow/src/main/resources/mapper/ConstructionCreditMapper.xml
@@ -31,6 +31,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -31,6 +31,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
31 <if test="status != null "> and status = #{status}</if> 31 <if test="status != null "> and status = #{status}</if>
32 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if> 32 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if>
33 <if test="objectId != null "> and object_id = #{objectId}</if> 33 <if test="objectId != null "> and object_id = #{objectId}</if>
  34 + <if test="ids != null ">
  35 + and object_id in
  36 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  37 + #{id}
  38 + </foreach>
  39 + </if>
34 </where> 40 </where>
35 order by time DESC 41 order by time DESC
36 </select> 42 </select>
@@ -126,6 +132,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -126,6 +132,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
126 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> 132 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
127 <if test="type != null and type != ''"> and type = #{type}</if> 133 <if test="type != null and type != ''"> and type = #{type}</if>
128 <if test="place != null and place != ''"> and place = #{place}</if> 134 <if test="place != null and place != ''"> and place = #{place}</if>
  135 + <if test="ids != null ">
  136 + and object_id in
  137 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  138 + #{id}
  139 + </foreach>
  140 + </if>
129 </where> 141 </where>
130 </select> 142 </select>
131 143
trash-workFlow/src/main/resources/mapper/DriverCreditMapper.xml
@@ -33,6 +33,12 @@ @@ -33,6 +33,12 @@
33 <if test="status != null "> and status = #{status}</if> 33 <if test="status != null "> and status = #{status}</if>
34 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if> 34 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if>
35 <if test="objectId != null and objectId != ''"> and object_id = #{objectId}</if> 35 <if test="objectId != null and objectId != ''"> and object_id = #{objectId}</if>
  36 + <if test="ids != null ">
  37 + and object_id in
  38 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  39 + #{id}
  40 + </foreach>
  41 + </if>
36 </where> 42 </where>
37 order by time DESC 43 order by time DESC
38 </select> 44 </select>
@@ -125,6 +131,12 @@ @@ -125,6 +131,12 @@
125 131
126 <where> 132 <where>
127 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> 133 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  134 + <if test="ids != null ">
  135 + and object_id in
  136 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  137 + #{id}
  138 + </foreach>
  139 + </if>
128 </where> 140 </where>
129 141
130 </select> 142 </select>
trash-workFlow/src/main/resources/mapper/EarthsitesCreditMapper.xml
@@ -31,6 +31,12 @@ @@ -31,6 +31,12 @@
31 <if test="status != null "> and status = #{status}</if> 31 <if test="status != null "> and status = #{status}</if>
32 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if> 32 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if>
33 <if test="objectId != null and objectId != ''"> and object_id = #{objectId}</if> 33 <if test="objectId != null and objectId != ''"> and object_id = #{objectId}</if>
  34 + <if test="ids != null ">
  35 + and object_id in
  36 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  37 + #{id}
  38 + </foreach>
  39 + </if>
34 </where> 40 </where>
35 order by time DESC 41 order by time DESC
36 </select> 42 </select>
@@ -127,6 +133,12 @@ @@ -127,6 +133,12 @@
127 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> 133 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
128 <if test="type != null and type != ''"> and type = #{type}</if> 134 <if test="type != null and type != ''"> and type = #{type}</if>
129 <if test="place != null and place != ''"> and place = #{place}</if> 135 <if test="place != null and place != ''"> and place = #{place}</if>
  136 + <if test="ids != null ">
  137 + and object_id in
  138 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  139 + #{id}
  140 + </foreach>
  141 + </if>
130 </where> 142 </where>
131 </select> 143 </select>
132 144
trash-workFlow/src/main/resources/mapper/TruckActivateMapper.xml
@@ -28,13 +28,15 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -28,13 +28,15 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
28 <result property="earthName" column="earth_name" /> 28 <result property="earthName" column="earth_name" />
29 <result property="routeInfo" column="route_info" /> 29 <result property="routeInfo" column="route_info" />
30 <result property="earthList" column="earth_list" /> 30 <result property="earthList" column="earth_list" />
  31 + <result property="coord" column="coord" />
  32 +
31 33
32 </resultMap> 34 </resultMap>
33 35
34 <sql id="selectTruckActivateVo"> 36 <sql id="selectTruckActivateVo">
35 select id, company, license_plate, time, construction,construction_id, status, earthsite, object_id, 37 select id, company, license_plate, time, construction,construction_id, status, earthsite, object_id,
36 create_by, create_type, activate_time, create_time,create_count,address,effective_from,effective_end, 38 create_by, create_type, activate_time, create_time,create_count,address,effective_from,effective_end,
37 - transport_start_time,transport_end_time,route_name,earth_name,route_info,earth_list 39 + transport_start_time,transport_end_time,route_name,earth_name,route_info,earth_list,coord
38 from truck_activate 40 from truck_activate
39 </sql> 41 </sql>
40 42
@@ -55,6 +57,31 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -55,6 +57,31 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
55 <if test="activateStatus == 0 "> and activate_time is null</if> 57 <if test="activateStatus == 0 "> and activate_time is null</if>
56 <if test="activateStatus == 1 "> and activate_time is not null</if> 58 <if test="activateStatus == 1 "> and activate_time is not null</if>
57 <if test="createTime != null "> and DATE_FORMAT(create_time,("%y%m%d")) = DATE_FORMAT(#{createTime},("%y%m%d"))</if> 59 <if test="createTime != null "> and DATE_FORMAT(create_time,("%y%m%d")) = DATE_FORMAT(#{createTime},("%y%m%d"))</if>
  60 +
  61 + <if test="cIds.size() > 0 and ids.size() > 0">and (
  62 + construction_id in
  63 + <foreach item="id" collection="cIds" open="(" separator="," close=")">
  64 + #{id}
  65 + </foreach>
  66 + or object_id in
  67 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  68 + #{id}
  69 + </foreach>
  70 + )
  71 +
  72 + </if>
  73 + <if test="cIds.size() > 0 and ids.size() == 0">
  74 + and construction_id in
  75 + <foreach item="id" collection="cIds" open="(" separator="," close=")">
  76 + #{id}
  77 + </foreach>
  78 + </if>
  79 + <if test="cIds.size() == 0 and ids.size() > 0">
  80 + and object_id in
  81 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  82 + #{id}
  83 + </foreach>
  84 + </if>
58 </where> 85 </where>
59 </select> 86 </select>
60 87
@@ -139,6 +166,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -139,6 +166,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
139 <if test="earthName != null">earth_name,</if> 166 <if test="earthName != null">earth_name,</if>
140 <if test="routeInfo != null">route_info,</if> 167 <if test="routeInfo != null">route_info,</if>
141 <if test="earthList != null">earth_list,</if> 168 <if test="earthList != null">earth_list,</if>
  169 + <if test="coord != null">coord,</if>
142 </trim> 170 </trim>
143 <trim prefix="values (" suffix=")" suffixOverrides=","> 171 <trim prefix="values (" suffix=")" suffixOverrides=",">
144 <if test="company != null">#{company},</if> 172 <if test="company != null">#{company},</if>
@@ -163,6 +191,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -163,6 +191,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
163 <if test="earthName != null">#{earthName},</if> 191 <if test="earthName != null">#{earthName},</if>
164 <if test="routeInfo != null">#{routeInfo},</if> 192 <if test="routeInfo != null">#{routeInfo},</if>
165 <if test="earthList != null">#{earthList},</if> 193 <if test="earthList != null">#{earthList},</if>
  194 + <if test="coord != null">#{coord},</if>
166 </trim> 195 </trim>
167 </insert> 196 </insert>
168 197
@@ -191,6 +220,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -191,6 +220,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
191 <if test="earthName != null">earth_name = #{earthName},</if> 220 <if test="earthName != null">earth_name = #{earthName},</if>
192 <if test="routeInfo != null">route_info = #{routeInfo},</if> 221 <if test="routeInfo != null">route_info = #{routeInfo},</if>
193 <if test="earthList != null">earth_list = #{earthList},</if> 222 <if test="earthList != null">earth_list = #{earthList},</if>
  223 + <if test="coord != null">coord = #{coord},</if>
194 </trim> 224 </trim>
195 where id = #{id} 225 where id = #{id}
196 </update> 226 </update>
@@ -217,6 +247,17 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -217,6 +247,17 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
217 </foreach> 247 </foreach>
218 </select> 248 </select>
219 249
  250 + <select id="getTruckHistoryListByObjects" parameterType="TruckActivate" resultMap="TruckActivateResult">
  251 + <include refid="selectTruckActivateVo"/>
  252 + <where>
  253 + <if test="startTime != null "> and activate_time BETWEEN #{startTime} and #{endTime}</if>
  254 + and object_id in
  255 + <foreach item="id" collection="cIds" open="(" separator="," close=")">
  256 + #{id}
  257 + </foreach>
  258 + </where>
  259 + </select>
  260 +
220 <select id="selectTodayTruckByObjIds" parameterType="String" resultMap="TruckActivateResult"> 261 <select id="selectTodayTruckByObjIds" parameterType="String" resultMap="TruckActivateResult">
221 <include refid="selectTruckActivateVo"/> 262 <include refid="selectTruckActivateVo"/>
222 where status = 0 and object_id in 263 where status = 0 and object_id in
trash-workFlow/src/main/resources/mapper/TruckCreditMapper.xml
@@ -33,6 +33,12 @@ @@ -33,6 +33,12 @@
33 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if> 33 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if>
34 <if test="objectId != null and objectId != ''"> and object_id = #{objectId}</if> 34 <if test="objectId != null and objectId != ''"> and object_id = #{objectId}</if>
35 <if test="time != null "> and DATE_FORMAT(time,("%y%m%d")) = DATE_FORMAT(#{time},("%y%m%d"))</if> 35 <if test="time != null "> and DATE_FORMAT(time,("%y%m%d")) = DATE_FORMAT(#{time},("%y%m%d"))</if>
  36 + <if test="ids != null ">
  37 + and object_id in
  38 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  39 + #{id}
  40 + </foreach>
  41 + </if>
36 </where> 42 </where>
37 order by time DESC 43 order by time DESC
38 </select> 44 </select>
@@ -123,6 +129,12 @@ @@ -123,6 +129,12 @@
123 <where> 129 <where>
124 <if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%')</if> 130 <if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%')</if>
125 <if test="licensePlate != null and licensePlate != ''"> and license_plate like concat('%', #{licensePlate}, '%')</if> 131 <if test="licensePlate != null and licensePlate != ''"> and license_plate like concat('%', #{licensePlate}, '%')</if>
  132 + <if test="ids != null ">
  133 + and object_id in
  134 + <foreach item="id" collection="ids" open="(" separator="," close=")">
  135 + #{id}
  136 + </foreach>
  137 + </if>
126 </where> 138 </where>
127 </select> 139 </select>
128 140
trash-workFlow/src/main/resources/mapper/caseOffline/CaseOfflineMapper.xml
@@ -37,6 +37,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -37,6 +37,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
37 <if test="type != null and type != ''"> and type = #{type}</if> 37 <if test="type != null and type != ''"> and type = #{type}</if>
38 <if test="place != null and place != ''"> and place = #{place}</if> 38 <if test="place != null and place != ''"> and place = #{place}</if>
39 <if test="startTime != null "> and create_time between #{startTime} and #{endTime}</if> 39 <if test="startTime != null "> and create_time between #{startTime} and #{endTime}</if>
  40 + <if test="names != null ">
  41 + and site_name in
  42 + <foreach item="name" collection="names" open="(" separator="," close=")">
  43 + #{name}
  44 + </foreach>
  45 + </if>
40 </where> 46 </where>
41 </select> 47 </select>
42 48
trash-workFlow/src/main/resources/mapper/casefile/ViolationCaseFileMapper.xml
@@ -50,6 +50,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -50,6 +50,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
50 <if test="readTime != null "> and read_time = #{readTime}</if> 50 <if test="readTime != null "> and read_time = #{readTime}</if>
51 <if test="createTime != null "> and DATE_FORMAT(create_time,("%y%m%d")) = DATE_FORMAT(#{createTime},("%y%m%d"))</if> 51 <if test="createTime != null "> and DATE_FORMAT(create_time,("%y%m%d")) = DATE_FORMAT(#{createTime},("%y%m%d"))</if>
52 <if test="startTime != null "> and create_time between #{startTime} and #{endTime}</if> 52 <if test="startTime != null "> and create_time between #{startTime} and #{endTime}</if>
  53 + <if test="names != null ">
  54 + and project_name in
  55 + <foreach item="name" collection="names" open="(" separator="," close=")">
  56 + #{name}
  57 + </foreach>
  58 + </if>
53 </where> 59 </where>
54 order by create_time desc 60 order by create_time desc
55 </select> 61 </select>
trash-workFlow/src/main/resources/mapper/casefile/ViolationWarningInformationMapper.xml
@@ -42,6 +42,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -42,6 +42,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
42 <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if> 42 <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
43 <if test="createTime != null"> and DATE_FORMAT(create_time,("%y%m%d")) = DATE_FORMAT(#{createTime},("%y%m%d"))</if> 43 <if test="createTime != null"> and DATE_FORMAT(create_time,("%y%m%d")) = DATE_FORMAT(#{createTime},("%y%m%d"))</if>
44 <if test="startTime != null "> and create_time between #{startTime} and #{endTime}</if> 44 <if test="startTime != null "> and create_time between #{startTime} and #{endTime}</if>
  45 + <if test="names != null ">
  46 + and project_name in
  47 + <foreach item="name" collection="names" open="(" separator="," close=")">
  48 + #{name}
  49 + </foreach>
  50 + </if>
45 </where> 51 </where>
46 order by create_time desc 52 order by create_time desc
47 </select> 53 </select>