Commit 04d317096134f1f5e03f53e0cd6ea6bfa60ef3c5

Authored by youxiw2000
1 parent 8fb9f115

m

Showing 44 changed files with 2031 additions and 1486 deletions

Too many changes to show.

To preserve performance only 44 of 60 files are displayed.

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