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 1 package com.trash.common.core.domain.entity;
2 2  
  3 +import java.util.ArrayList;
3 4 import java.util.Date;
4 5 import java.util.List;
5 6 import javax.validation.constraints.Email;
... ... @@ -92,8 +93,84 @@ public class SysUser extends BaseEntity
92 93  
93 94 /** 岗位组 */
94 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 403 .append("dept", getDept())
327 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 48  
49 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 54 public static String ConstructionList = "/api/siteservice/cs/constructionsites/search";
55 55  
... ... @@ -81,6 +81,9 @@ public class RemoteServerUtils {
81 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 87 public static JSONArray getUnitetransport(String id){
85 88 JSONArray list = null;
86 89 try {
... ... @@ -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 1 package com.trash.framework.web.service;
2 2  
3 3 import java.util.ArrayList;
  4 +import java.util.HashMap;
4 5 import java.util.HashSet;
5 6 import java.util.List;
  7 +import java.util.Map;
6 8 import java.util.Set;
7 9 import java.util.concurrent.TimeUnit;
8 10  
... ... @@ -19,6 +21,7 @@ import org.springframework.security.core.userdetails.UserDetailsService;
19 21 import org.springframework.stereotype.Component;
20 22  
21 23 import com.alibaba.fastjson.JSON;
  24 +import com.alibaba.fastjson.JSONArray;
22 25 import com.alibaba.fastjson.JSONObject;
23 26 import com.trash.common.config.trashConfig;
24 27 import com.trash.common.constant.Constants;
... ... @@ -171,6 +174,14 @@ public class SysLoginService
171 174 user.setPassword(userJson.getString("id"));
172 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 186 if(userJson.getJSONArray("userIdentityList")!=null){
176 187  
... ... @@ -183,11 +194,27 @@ public class SysLoginService
183 194 for(Object obj:userJson.getJSONArray("userIdentityList")){
184 195  
185 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 220 user.setPostIds(poStrings);
... ... @@ -195,7 +222,6 @@ public class SysLoginService
195 222 user.setRoleIds(rolStrings);
196 223  
197 224  
198   -
199 225 } catch (Exception e) {
200 226 // TODO: handle exception
201 227 }
... ... @@ -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 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 273 * @throws InterruptedException
274 274 */
275 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 289 RemoteServerUtils.remote = trashConfig.getRemotePath();
290 290 }
291 291 Map<String, Object> map = new HashMap<>();
292   - map.put("size",9999);
  292 + map.put("size",99999);
293 293 map.put("page",1);
294 294 JSONArray jsonArray = RemoteServerUtils.getCompanyList(map, trashConfig.getToken());
295 295 redisCache.setCacheObject("companyList",jsonArray);
... ... @@ -300,7 +300,7 @@ public class DriverTask
300 300 RemoteServerUtils.remote = trashConfig.getRemotePath();
301 301 }
302 302 Map<String, Object> map = new HashMap<>();
303   - map.put("size",9999);
  303 + map.put("size",99999);
304 304 map.put("page",1);
305 305 map.put("contractStatus", 1);
306 306 map.put("auditStatus", 1);
... ... @@ -316,7 +316,7 @@ public class DriverTask
316 316 RemoteServerUtils.remote = trashConfig.getRemotePath();
317 317 }
318 318 Map<String, Object> map = new HashMap<>();
319   - map.put("size",9999);
  319 + map.put("size",99999);
320 320 map.put("page",1);
321 321 JSONArray jsonArray = RemoteServerUtils.getConstructionList(map,trashConfig.getToken());
322 322 redisCache.setCacheObject("constructionList",jsonArray);
... ... @@ -330,7 +330,7 @@ public class DriverTask
330 330 RemoteServerUtils.remote = trashConfig.getRemotePath();
331 331 }
332 332 Map<String, Object> map = new HashMap<>();
333   - map.put("size",9999);
  333 + map.put("size",99999);
334 334 map.put("page",1);
335 335 JSONArray jsonArray = RemoteServerUtils.getEarthSitesList(map,trashConfig.getToken());
336 336 redisCache.setCacheObject("earthSitesList",jsonArray);
... ... @@ -344,7 +344,7 @@ public class DriverTask
344 344 RemoteServerUtils.remote = trashConfig.getRemotePath();
345 345 }
346 346 Map<String, Object> map = new HashMap<>();
347   - map.put("size",9999);
  347 + map.put("size",99999);
348 348 map.put("page",1);
349 349 JSONArray jsonArray = RemoteServerUtils.getAreas(trashConfig.getToken());
350 350 redisCache.setCacheObject("areaList",jsonArray);
... ...
trash-ui/src/api/caseoffline.js
... ... @@ -106,9 +106,6 @@ export default {
106 106 };
107 107 },
108 108 created() {
109   -
110   -
111   -
112 109 this.getList();
113 110  
114 111 if(window.location.search){
... ... @@ -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 172 getList() {
176 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 189 this.caseOfflineList = response.rows;
187 190  
188 191 for(let i in this.caseOfflineList){
... ...
trash-ui/src/api/dict.js
... ... @@ -7,10 +7,10 @@ export function getTruckList(params) {
7 7 params:params
8 8 });
9 9 }
10   -
  10 +//license/ 先留一下免得又改
11 11 export function constructionLicenseById(id) {
12 12 return requestRemote({
13   - url: '/api/siteservice/cs/constructionsites/license/'+id,
  13 + url: '/api/siteservice/cs/constructionsites/'+id,
14 14 method: 'get',
15 15 });
16 16 }
... ... @@ -179,7 +179,15 @@ export function getUsers(data){
179 179 method: 'post',
180 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 193 export function getDict(params) {
... ...
trash-ui/src/api/three_step.js
... ... @@ -31,7 +31,8 @@ import {
31 31 getConstructionTruck,
32 32 constructionById,
33 33 earthsitesById,
34   - getTruckList,
  34 + getTruckList,
  35 + getAuth,
35 36 } from "@/api/dict";
36 37  
37 38 export default {
... ... @@ -176,7 +177,14 @@ export default {
176 177 info2: false,
177 178 slides: [],
178 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 190 created() {
... ... @@ -201,7 +209,32 @@ export default {
201 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 238 conractCheck(value) {
206 239 let item
207 240 for (let i in this.contractList) {
... ... @@ -286,6 +319,25 @@ export default {
286 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 341 getRemoteData(){
290 342 if(this.form.type){
291 343 if (this.form.type == "0") {
... ... @@ -330,8 +382,7 @@ export default {
330 382 }
331 383 }
332 384 },
333   - getObjId(value) {
334   - console.log(value);
  385 + getObjId(value) {
335 386 let item;
336 387  
337 388 this.remoteQueryData.name = value;
... ... @@ -635,7 +686,25 @@ export default {
635 686 handleAdd() {
636 687 this.reset();
637 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 710 handleUpdate(row, idx) {
... ... @@ -831,7 +900,7 @@ export default {
831 900  
832 901 if (this.form.id != null) {
833 902 if (this.queryParams.pageStatus == 1) {
834   -
  903 +
835 904 this.form.companys = this.form.companys + "";
836 905 this.form.companyTrucks = this.form.companyTrucks + "";
837 906 updateThreestep(this.form).then(response => {
... ...
trash-ui/src/api/truck_active.js
... ... @@ -112,7 +112,6 @@ export default {
112 112 },
113 113 created() {
114 114  
115   -
116 115 if(window.location.search){
117 116 let params = window.location.search.replace("?","");
118 117 let arr = params.split("&");
... ... @@ -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 140 methods: {
175 141 getInfo(row){
... ... @@ -198,10 +164,6 @@ export default {
198 164 }
199 165 }
200 166 }
201   -
202   -
203   -
204   -
205 167 },
206 168 /** 查询车辆激活列表 */
207 169 getList(index) {
... ... @@ -245,7 +207,7 @@ export default {
245 207  
246 208  
247 209 constructionById(item.objectId).then(res => {
248   -
  210 + debugger;
249 211 for(let i in this.remoteCompanys){
250 212 if(this.remoteCompanys[i].id == res.result.transportCompanyId){
251 213 if(this.remoteCompanys[i].auditStatus != 1){
... ... @@ -315,13 +277,14 @@ export default {
315 277 let list = tres.result.list;
316 278  
317 279 let qr = {
318   - constructionId:item.objectId
  280 + constructionId:item.objectId,
  281 + status:0
319 282 }
320 283  
321 284 listTruckActivate(qr).then(response => {
322 285 let taList = response.rows;
323 286 for(let i = 0;i< list.length;i++){
324   -
  287 +
325 288 let count = 0;
326 289 for(let j in taList){
327 290 if(taList[j].objectId == list[i].id){
... ... @@ -340,10 +303,7 @@ export default {
340 303 creditStatus:list[i].creditStatus,
341 304 createCount:count});
342 305 }
343   -
344 306 });
345   -
346   -
347 307 })
348 308 });
349 309  
... ... @@ -398,7 +358,11 @@ export default {
398 358 handleAdd() {
399 359 this.reset();
400 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 368 handleUpdate(row) {
... ...
trash-ui/src/api/vio_casefile.js
... ... @@ -89,14 +89,14 @@ export default {
89 89 {code: 7, name: "雾炮机是否正常开启"},
90 90 {code: 8, name: "使用非专用车运输"},
91 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 100 {code: 18, name: "离线运输报警(工)"},
101 101 {code: 19, name: "离线运输报警(消)"},
102 102 {code: 20, name: "未激活车辆作业"},
... ...
trash-ui/src/layout/index.vue
1 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 3 </template>
11 4  
12 5 <script>
13 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 8 import ResizeMixin from './mixin/ResizeHandler'
16   -import {mapState} from 'vuex'
  9 +import { mapState } from 'vuex'
17 10  
18 11 export default {
19 12 name: 'Layout',
... ... @@ -45,63 +38,52 @@ export default {
45 38 },
46 39 methods: {
47 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 45 </script>
53 46  
54 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 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 27 loginByToken(to.query.token).then(res=>{
28 28 setToken(res.token);
29 29 if (store.getters.roles.length === 0) {
30   -
31 30 const user = res.user;
32 31 const roles = res.roles;
33 32 const avatar = require("@/assets/image/profile.jpg");
... ...
trash-ui/src/store/modules/user.js
... ... @@ -10,13 +10,29 @@ const user = {
10 10 avatar: '',
11 11 roles: [],
12 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 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 36 SET_TOKEN: (state, token) => {
21 37 state.token = token
22 38 },
... ... @@ -63,6 +79,7 @@ const user = {
63 79 return new Promise((resolve, reject) => {
64 80 getInfo(state.token).then(res => {
65 81 const user = res.user
  82 + commit('SET_AUTH', user)
66 83 const avatar = res.user.avatar;
67 84 if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
68 85 commit('SET_ROLES', res.roles)
... ...
trash-ui/src/views/business/threestep/index.vue
... ... @@ -29,13 +29,15 @@
29 29 </el-form-item>
30 30  
31 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 35 </el-date-picker>
35 36 </el-form-item>
36 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 41 </el-date-picker>
40 42 </el-form-item>
41 43  
... ... @@ -110,7 +112,7 @@
110 112 <el-row type="flex" justify="center">
111 113 <el-col :span="12">
112 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 116 <el-option label="工地" value="0" />
115 117 <el-option label="处理场所" value="1" />
116 118 </el-select>
... ... @@ -118,8 +120,8 @@
118 120 </el-col>
119 121 <el-col :span="12">
120 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 125 </el-option>
124 126 </el-select>
125 127 </el-form-item>
... ... @@ -128,7 +130,7 @@
128 130 <el-row type="flex" justify="center" v-if="form.type != null">
129 131 <el-col >
130 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 134 <el-option v-for="item in remoteData" :label="item.name"
133 135 :value="item.name" v-if="(!form.place || item.areaCode == form.place) && (item.auditStatus > 0 && item.auditStatus != 2)">
134 136 </el-option>
... ...
trash-ui/src/views/business/truckActivate/index.vue
... ... @@ -37,8 +37,9 @@
37 37 <el-form-item label="激活时间" prop="activateDate" v-if="openActivateTime">
38 38 <el-date-picker size="small" style="width: 200px"
39 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 43 placeholder="选择激活时间">
43 44 </el-date-picker>
44 45 </el-form-item>
... ...
trash-ui/src/views/business/truckActivate/truckActivateInfo.vue
... ... @@ -10,7 +10,7 @@
10 10 <el-col :span="24" class="title">施工地址</el-col>
11 11 </el-row>
12 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 14 </el-row>
15 15 <el-row >
16 16 <el-col :span="24" class="title">运输车辆</el-col>
... ... @@ -30,35 +30,35 @@
30 30 <el-col :span="24" class="title">证照有效期起</el-col>
31 31 </el-row>
32 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 34 </el-row>
35 35 <el-row >
36 36 <el-col :span="24" class="title" >证照有效期止</el-col>
37 37 </el-row>
38 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 40 </el-row>
41 41  
42 42 <el-row >
43 43 <el-col :span="24" class="title">运输开始时间</el-col> </el-row>
44 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 46 <el-row >
47 47 <el-col :span="24" class="title" >运输结束时间</el-col> </el-row>
48 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 50 </el-row>
51 51 <el-row >
52 52 <el-col :span="24" class="title">路线描述</el-col>
53 53 </el-row>
54 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 56 </el-row>
57 57 <el-row >
58 58 <el-col :span="24" class="title">卸区描述</el-col>
59 59 </el-row>
60 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 62 </el-row>
63 63  
64 64  
... ... @@ -92,10 +92,6 @@ import {
92 92 },
93 93 created() {
94 94  
95   - constructionLicenseById(this.truckObj.constructionId).then(res=>{
96   - this.construction = res.result;
97   - });
98   -
99 95 let query = {
100 96 name:this.truckObj.company
101 97 };
... ...
trash-ui/src/views/casefile/violationCaseFile/violationCaseTable.vue
... ... @@ -9,7 +9,7 @@
9 9 <el-form-item label="日期" prop="createTime">
10 10 <el-date-picker
11 11 v-model="createTime"
12   - type="daterange"
  12 + type="datetimerange"
13 13 :picker-options="pickerOptions"
14 14 range-separator="至"
15 15 start-placeholder="开始日期"
... ...
trash-ui/src/views/casefile/violationWarningInformation/violationWarningInformationTable.vue
... ... @@ -9,7 +9,7 @@
9 9 <el-form-item label="日期" prop="createTime">
10 10 <el-date-picker
11 11 v-model="createTime"
12   - type="daterange"
  12 + type="datetimerange"
13 13 :picker-options="pickerOptions"
14 14 range-separator="至"
15 15 start-placeholder="开始日期"
... ...
trash-ui/src/views/h5/threestep/index.vue
... ... @@ -17,11 +17,18 @@
17 17 </el-select>
18 18 </el-form-item>
19 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 25 </el-date-picker>
22 26 </el-form-item>
23 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 32 </el-date-picker>
26 33 </el-form-item>
27 34  
... ... @@ -51,7 +58,7 @@
51 58 <span >{{item.place}}</span>
52 59 </el-col>
53 60 </el-row>
54   -
  61 +
55 62 <el-row class="card_row" style="margin-top: 5px;">
56 63 <el-col :span="24">
57 64 <div>自查时间:{{item.selfCheckTime}}</div>
... ... @@ -69,8 +76,8 @@
69 76  
70 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 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 81 <el-button size="mini" type="text" @click="handleUpdate(item,1)" v-hasPermi="['business:threestep:edit']">查看详情</el-button>
75 82  
76 83 </el-card>
... ... @@ -82,14 +89,14 @@
82 89 <el-form ref="form" :model="form" :rules="rules" label-width="100px" v-if="open">
83 90  
84 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 93 <el-option label="工地" value="0" />
87 94 <el-option label="处理场所" value="1" />
88 95 </el-select>
89 96 </el-form-item>
90 97  
91 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 100 <el-option v-for="item in remoteData" :label="item.name" :title="item.name"
94 101 :value="item.name" :key="item.id" v-if="(!form.place || item.areaCode == form.place)&& (item.auditStatus > 0 && item.auditStatus != 2)" >
95 102 </el-option>
... ... @@ -97,7 +104,7 @@
97 104 </el-form-item>
98 105  
99 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 108 <el-option v-for="item in areas" :label="item.name" :value="item.code" :key="item.code">
102 109 </el-option>
103 110 </el-select>
... ...
trash-ui/src/views/h5/truckActivate/index.vue
... ... @@ -36,8 +36,9 @@
36 36 <el-form-item label="激活时间" prop="activateDate" v-if="openActivateTime">
37 37 <el-date-picker size="small" style="width: 200px"
38 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 42 placeholder="选择激活时间">
42 43 </el-date-picker>
43 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 20 import com.trash.common.enums.BusinessType;
21 21 import com.trash.business.domain.CompanyCredit;
22 22 import com.trash.business.service.ICompanyCreditService;
  23 +import com.trash.common.utils.SecurityUtils;
23 24 import com.trash.common.utils.poi.ExcelUtil;
24 25 import com.trash.common.core.page.TableDataInfo;
25 26  
... ... @@ -31,123 +32,110 @@ import com.trash.common.core.page.TableDataInfo;
31 32 */
32 33 @RestController
33 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 114 return toAjax(companyCreditService.insertCompanyCredit(companyCredit));
125 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 127 return toAjax(companyCreditService.updateCompanyCredit(companyCredit));
139 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 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 14 import org.springframework.web.bind.annotation.RequestMapping;
15 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 20 import com.trash.business.domain.ConstructionCredit;
18 21 import com.trash.business.service.IConstructionCreditService;
19 22 import com.trash.common.annotation.Log;
20 23 import com.trash.common.core.controller.BaseController;
21 24 import com.trash.common.core.domain.AjaxResult;
22 25 import com.trash.common.core.page.TableDataInfo;
  26 +import com.trash.common.core.redis.RedisCache;
23 27 import com.trash.common.enums.BusinessType;
  28 +import com.trash.common.utils.SecurityUtils;
24 29 import com.trash.common.utils.poi.ExcelUtil;
25 30  
26 31 /**
... ... @@ -35,6 +40,7 @@ public class ConstructionCreditController extends BaseController
35 40 {
36 41 @Autowired
37 42 private IConstructionCreditService constructionCreditService;
  43 +
38 44  
39 45 /**
40 46 * 查询工地失信列表
... ... @@ -43,16 +49,17 @@ public class ConstructionCreditController extends BaseController
43 49 public TableDataInfo list(ConstructionCredit constructionCredit)
44 50 {
45 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 56 @GetMapping("/historyCredit")
51 57 public TableDataInfo historyCredit(ConstructionCredit constructionCredit)
52 58 {
53 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 3 import java.util.ArrayList;
4 4 import java.util.List;
5 5  
  6 +import com.alibaba.fastjson.JSONArray;
  7 +import com.alibaba.fastjson.JSONObject;
6 8 import com.trash.business.domain.ConstructionCredit;
7 9 import org.springframework.security.access.prepost.PreAuthorize;
8 10 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -20,8 +22,10 @@ import com.trash.common.core.domain.AjaxResult;
20 22 import com.trash.common.enums.BusinessType;
21 23 import com.trash.business.domain.EarthsitesCredit;
22 24 import com.trash.business.service.IEarthsitesCreditService;
  25 +import com.trash.common.utils.SecurityUtils;
23 26 import com.trash.common.utils.poi.ExcelUtil;
24 27 import com.trash.common.core.page.TableDataInfo;
  28 +import com.trash.common.core.redis.RedisCache;
25 29  
26 30 /**
27 31 * 处理场所失信Controller
... ... @@ -44,6 +48,9 @@ public class EarthsitesCreditController extends BaseController
44 48 {
45 49 startPage();
46 50 List<EarthsitesCredit> list = earthsitesCreditService.selectEarthsitesCreditList(earthsitesCredit);
  51 +
  52 +
  53 +
47 54 return getDataTable(list);
48 55 }
49 56  
... ... @@ -118,6 +125,7 @@ public class EarthsitesCreditController extends BaseController
118 125 {
119 126 startPage();
120 127 List<EarthsitesCredit> list = earthsitesCreditService.selectEarthsitesCreditHistory(earthsitesCredit);
  128 +
121 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 70 public TableDataInfo list(SupervisionThreestep supervisionThreestep)
71 71 {
72 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 75 List<SupervisionThreestep> list = supervisionThreestepService.selectSupervisionThreestepList(supervisionThreestep);
129 76 return getDataTable(list);
130 77 }
... ... @@ -286,101 +233,7 @@ public class SupervisionThreestepController extends BaseController
286 233 @PostMapping("/todayDataList")
287 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 66 {
67 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 163 List<TruckActivate> list = truckActivateService.getActivedTruckList(truckActivate);
237 164  
238 165 for(TruckActivate t:list){
239   - t.setParams(null);
240 166 if(t.getActivateTime() == null){
241 167 t.setIsAct("0");
242 168 }else{
... ... @@ -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 1 package com.trash.business.domain;
2 2  
3 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 8 import org.apache.commons.lang3.builder.ToStringStyle;
... ... @@ -47,8 +49,20 @@ public class CompanyCredit extends BaseEntity
47 49  
48 50 /** 基础数据ID */
49 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 67 this.id = id;
54 68 }
... ...
trash-workFlow/src/main/java/com/trash/business/domain/ConstructionCredit.java
1 1 package com.trash.business.domain;
2 2  
3 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 8 import org.apache.commons.lang3.builder.ToStringStyle;
... ... @@ -41,8 +43,18 @@ public class ConstructionCredit extends BaseEntity
41 43 private Long lostCredit;
42 44  
43 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 58 public void setId(Long id)
47 59 {
48 60 this.id = id;
... ...
trash-workFlow/src/main/java/com/trash/business/domain/DriverCredit.java
1 1 package com.trash.business.domain;
2 2  
3 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 8 import org.apache.commons.lang3.builder.ToStringStyle;
... ... @@ -52,7 +54,17 @@ public class DriverCredit extends BaseEntity
52 54 /** 基础数据ID */
53 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 69 public String getLicenseplateNo() {
58 70 return licenseplateNo;
... ...
trash-workFlow/src/main/java/com/trash/business/domain/EarthsitesCredit.java
1 1 package com.trash.business.domain;
2 2  
3 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 8 import org.apache.commons.lang3.builder.ToStringStyle;
... ... @@ -51,6 +53,17 @@ public class EarthsitesCredit extends BaseEntity
51 53  
52 54 /** 基础数据ID */
53 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 68 public void setId(Long id)
56 69 {
... ...
trash-workFlow/src/main/java/com/trash/business/domain/SupervisionThreestep.java
1 1 package com.trash.business.domain;
2 2  
3 3 import java.util.Date;
  4 +import java.util.List;
4 5  
5 6 import com.alibaba.druid.sql.visitor.functions.If;
6 7 import com.fasterxml.jackson.annotation.JsonFormat;
... ... @@ -141,16 +142,16 @@ public class SupervisionThreestep extends BaseEntity
141 142  
142 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 151 return ids;
151 152 }
152 153  
153   - public void setIds(String[] ids) {
  154 + public void setIds(List<String> ids) {
154 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 16 * @author trash
17 17 * @date 2023-05-02
18 18 */
19   -public class TruckActivate extends BaseEntity
  19 +public class TruckActivate
20 20 {
21 21 private static final long serialVersionUID = 1L;
22 22  
... ... @@ -70,7 +70,7 @@ public class TruckActivate extends BaseEntity
70 70  
71 71 private String activateStatus;
72 72  
73   - private String[] cIds;
  73 + private List<String> cIds;
74 74  
75 75 private int createCount;
76 76  
... ... @@ -92,8 +92,50 @@ public class TruckActivate extends BaseEntity
92 92  
93 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 139 public String getRouteInfo() {
98 140 return routeInfo;
99 141 }
... ... @@ -182,11 +224,11 @@ public class TruckActivate extends BaseEntity
182 224 this.constructionId = constructionId;
183 225 }
184 226  
185   - public String[] getcIds() {
  227 + public List<String> getcIds() {
186 228 return cIds;
187 229 }
188 230  
189   - public void setcIds(String[] cIds) {
  231 + public void setcIds(List<String> cIds) {
190 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 7 import com.trash.common.core.domain.BaseEntity;
8 8  
9 9 import java.util.Date;
  10 +import java.util.List;
10 11  
11 12 /**
12 13 * 车辆失信对象 truck_credit
... ... @@ -48,8 +49,20 @@ public class TruckCredit extends BaseEntity
48 49 /** 失信原因 */
49 50 @Excel(name = "失信原因")
50 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 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 76 public List<TruckActivate> selectTodayTruckByObjIds(String[] objs);
77 77  
78 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 1 package com.trash.business.service;
2 2  
3 3 import java.util.List;
  4 +import java.util.Map;
  5 +
4 6 import com.trash.business.domain.TruckActivate;
5 7 import com.trash.common.core.domain.AjaxResult;
6 8  
... ... @@ -67,4 +69,6 @@ public interface ITruckActivateService
67 69 public List<TruckActivate> getActivedTruckList(TruckActivate truckActivate);
68 70  
69 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 55 */
56 56 @Override
57 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 273  
266 274 @Override
267 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 10 import org.springframework.stereotype.Service;
11 11 import org.springframework.transaction.annotation.Transactional;
12 12  
  13 +import com.alibaba.fastjson.JSONArray;
  14 +import com.alibaba.fastjson.JSONObject;
13 15 import com.trash.business.domain.CompanyCredit;
14 16 import com.trash.business.domain.ConstructionCredit;
15 17 import com.trash.business.mapper.ConstructionCreditMapper;
16 18 import com.trash.business.service.IConstructionCreditService;
  19 +import com.trash.common.core.redis.RedisCache;
17 20 import com.trash.common.utils.RemoteServerUtils;
  21 +import com.trash.common.utils.SecurityUtils;
18 22  
19 23 /**
20 24 * 三查机制Service业务层处理
... ... @@ -28,6 +32,9 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService
28 32 @Autowired
29 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 56 @Override
50 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 91 @Override
56 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 1 package com.trash.business.service.impl;
2 2  
  3 +import java.util.ArrayList;
3 4 import java.util.Date;
  5 +import java.util.HashMap;
4 6 import java.util.List;
  7 +import java.util.Map;
5 8  
6 9 import com.trash.business.domain.TruckCredit;
7 10 import org.springframework.beans.factory.annotation.Autowired;
8 11 import org.springframework.stereotype.Service;
9 12 import com.trash.business.mapper.DriverCreditMapper;
  13 +import com.alibaba.fastjson.JSONArray;
  14 +import com.alibaba.fastjson.JSONObject;
10 15 import com.trash.business.domain.DriverCredit;
  16 +import com.trash.business.domain.EarthsitesCredit;
11 17 import com.trash.business.service.IDriverCreditService;
  18 +import com.trash.common.config.trashConfig;
  19 +import com.trash.common.utils.RemoteServerUtils;
12 20 import com.trash.common.utils.SecurityUtils;
13 21  
14 22 import org.springframework.transaction.annotation.Transactional;
... ... @@ -43,10 +51,43 @@ public class DriverCreditServiceImpl implements IDriverCreditService
43 51 * @param driverCredit 驾驶员失信
44 52 * @return 驾驶员失信
45 53 */
  54 + @Autowired
  55 + private trashConfig trashConfig;
  56 +
46 57 @Override
47 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 159  
119 160 @Override
120 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 202 {
134 203 return driverCreditMapper.deleteDriverCreditByIds(ids);
135 204 }
136   -
  205 +
  206 +
  207 +
137 208 public List<String> getNames(DriverCredit driverCredit) {
  209 +
138 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 import org.springframework.beans.factory.annotation.Autowired;
10 10 import org.springframework.stereotype.Service;
11 11 import com.trash.business.mapper.EarthsitesCreditMapper;
  12 +import com.alibaba.fastjson.JSONArray;
  13 +import com.alibaba.fastjson.JSONObject;
12 14 import com.trash.business.domain.ConstructionCredit;
13 15 import com.trash.business.domain.EarthsitesCredit;
14 16 import com.trash.business.service.IEarthsitesCreditService;
  17 +import com.trash.common.core.redis.RedisCache;
15 18 import com.trash.common.utils.RemoteServerUtils;
16 19 import com.trash.common.utils.SecurityUtils;
17 20  
... ... @@ -27,6 +30,8 @@ public class EarthsitesCreditServiceImpl implements IEarthsitesCreditService
27 30 @Autowired
28 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 53 @Override
49 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 197  
162 198 @Override
163 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 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 53  
54 54 @Autowired
55 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 78 */
77 79 @Override
78 80 public List<SupervisionThreestep> selectSupervisionThreestepList(SupervisionThreestep supervisionThreestep) {
  81 + List<SupervisionThreestep> list = new ArrayList<>();
79 82 if (supervisionThreestep.getWorkStartTime() == null && supervisionThreestep.getStatus() == null) {
80 83 String start, end;
81 84  
... ... @@ -111,15 +114,64 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
111 114 supervisionThreestep.setWorkEndTime(new Date("2099-01-01 00:00:00"));
112 115 }
113 116 if (supervisionThreestep.getWorkStartTime() == supervisionThreestep.getWorkEndTime()) {
114   -
  117 +
115 118 Date date = supervisionThreestep.getWorkStartTime();
116   - date.setDate(date.getDate()+1);
  119 + date.setDate(date.getDate() + 1);
117 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 176 return list;
125 177 }
... ... @@ -129,8 +181,6 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
129 181 if (supervisionThreestep.getWorkStartTime() == null && supervisionThreestep.getStatus() == null) {
130 182 String start, end;
131 183  
132   -
133   -
134 184 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
135 185 Date date = new Date();
136 186  
... ... @@ -164,34 +214,28 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
164 214 supervisionThreestep.setWorkEndTime(new Date("2099-01-01 00:00:00"));
165 215 }
166 216 if (supervisionThreestep.getWorkStartTime() == supervisionThreestep.getWorkEndTime()) {
167   -
  217 +
168 218 Date date = supervisionThreestep.getWorkStartTime();
169   - date.setDate(date.getDate()+1);
  219 + date.setDate(date.getDate() + 1);
170 220 supervisionThreestep.setWorkEndTime(date);
171 221 }
172 222 }
173   -
174   -
175   -
  223 +
176 224 return supervisionThreestepMapper.getNames(supervisionThreestep);
177 225 }
178 226  
179   -
180 227 SimpleDateFormat dateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
181   -
182 228  
183   - String[] outside = {"长沙县", "望城区", "浏阳市", "宁乡市", "株洲市", "湘潭市", "汩罗市", "湘阴县"};
184   -
  229 + String[] outside = { "长沙县", "望城区", "浏阳市", "宁乡市", "株洲市", "湘潭市", "汩罗市", "湘阴县" };
  230 +
185 231 @SuppressWarnings("unchecked")
186 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 237 String start, end;
192 238  
193   -
194   -
195 239 Date date = new Date();
196 240  
197 241 if (new Date().getHours() < 8) {
... ... @@ -214,7 +258,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
214 258 // TODO Auto-generated catch block
215 259 e.printStackTrace();
216 260 }
217   - if(supervisionThreestep.getHis().equals("1")){
  261 + if (supervisionThreestep.getHis().equals("1")) {
218 262 try {
219 263 supervisionThreestep.setWorkStartTime(dateTime.parse("2000-01-01 00:00:00"));
220 264 supervisionThreestep.setWorkEndTime(dateTime.parse("2100-01-01 00:00:00"));
... ... @@ -224,178 +268,144 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
224 268 }
225 269 }
226 270 }
227   -
228   -
  271 +
229 272 JSONArray contracts = redisCache.getCacheObject("contractList");
230   -
231   - if(contracts == null){
  273 +
  274 + if (contracts == null) {
232 275 Map param = new HashMap<>();
233   -
  276 +
234 277 param.put("page", 1);
235 278 param.put("size", 99999);
236 279 param.put("contractStatus", 1);
237 280 param.put("auditStatus", 1);
238   -
239   -
  281 +
240 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 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 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 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 383 continue;
374 384 }
375 385 }
376   -
377   - if(s.getType() == 0){
  386 +
  387 + if (s.getType() == 0) {
378 388 constructions.add(s);
379   - }else{
  389 + } else {
380 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 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 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 409 map.put("id", s.getId() + "");
400 410 map.put("createTime", yearFomat.format(s.getCreateTime()));
401 411 map.put("name", s.getName());
... ... @@ -407,39 +417,38 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
407 417 map.put("eid", e.getObjectId());
408 418 map.put("ename", e.getName());
409 419 map.put("eplace", e.getPlace());
410   - map.put("estatus", "开工" );
  420 + map.put("estatus", "开工");
411 421 map.put("eselfCheckTime", dateTime.format(e.getSelfCheckTime()));
412 422 map.put("etype", "");
413   -
  423 +
414 424 map.put("descript", "有效开工");
415   -
  425 +
416 426 list.add(map);
417 427 }
418 428 }
419   - }else{
420   - for(Object object : contracts){
  429 + } else {
  430 + for (Object object : contracts) {
421 431 JSONObject jsonObject = (JSONObject) object;
422   -
423   - if(!s.getObjectId().equals(jsonObject.getString("constructionSiteID")))
  432 +
  433 + if (!s.getObjectId().equals(jsonObject.getString("constructionSiteID")))
424 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 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 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 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 452 map.put("id", s.getId() + "");
444 453 map.put("createTime", yearFomat.format(s.getCreateTime()));
445 454 map.put("name", s.getName());
... ... @@ -451,142 +460,130 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
451 460 map.put("eid", e.getObjectId());
452 461 map.put("ename", e.getName());
453 462 map.put("eplace", e.getPlace());
454   - map.put("estatus", "开工" );
  463 + map.put("estatus", "开工");
455 464 map.put("eselfCheckTime", dateTime.format(e.getSelfCheckTime()));
456 465 map.put("etype", "");
457   -
  466 +
458 467 map.put("descript", "有效开工");
459   -
  468 +
460 469 list.add(map);
461 470 }
462 471 }
463 472 }
464 473 }
465   -
  474 +
466 475 }
467 476  
468   -
469 477 List FilterList = new ArrayList<>();
470   -
471   -
472   -
473   - if(supervisionThreestep.getPlace()!=null){
  478 +
  479 + if (supervisionThreestep.getPlace() != null) {
474 480 place = supervisionThreestep.getPlace();
475 481 }
476   - if(supervisionThreestep.getName()!=null){
  482 + if (supervisionThreestep.getName() != null) {
477 483 name = supervisionThreestep.getName();
478 484 }
479   - if(supervisionThreestep.getEarthsitesName()!=null){
  485 + if (supervisionThreestep.getEarthsitesName() != null) {
480 486 ename = supervisionThreestep.getEarthsitesName();
481 487 }
482   - if(supervisionThreestep.getSubReason() !=null){
  488 + if (supervisionThreestep.getSubReason() != null) {
483 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 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 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 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 510 continue;
505 511 }
506 512 }
507   -
  513 +
508 514 FilterList.add(map);
509   -
  515 +
510 516 }
511 517  
512 518 return FilterList;
513 519 }
514   -
515   -
516 520  
517 521 @Override
518 522 public List<Map> selectDayWorkListByType(SupervisionThreestep supervisionThreestep) {
519 523  
520   -
521   -
522 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 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 568 List<String> idStrings = new ArrayList<String>();
568 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 585 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
589   - if(supervisionThreestep.getWorkStartTime() == null){
  586 + if (supervisionThreestep.getWorkStartTime() == null) {
590 587 String start, end;
591 588  
592 589 Date date = new Date();
... ... @@ -612,11 +609,37 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
612 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 651 @Transactional
629 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 655 return -2;
633 656 }
634 657  
635   -
636   -
637 658 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
638 659 if (supervisionThreestep.getId() != null) {
639 660 supervisionThreestepMapper.deleteSupervisionThreestepById(supervisionThreestep.getId());
640 661 }
641   - if(supervisionThreestep.getWorkStartTime() == null){
  662 + if (supervisionThreestep.getWorkStartTime() == null) {
642 663 String start, end;
643 664  
644 665 Date date = new Date();
... ... @@ -664,7 +685,7 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
664 685 e.printStackTrace();
665 686 }
666 687 }
667   -
  688 +
668 689 SupervisionThreestep todayData = supervisionThreestepMapper.selectTodayData(supervisionThreestep);
669 690  
670 691 if (todayData != null) {
... ... @@ -699,195 +720,177 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
699 720 @Transactional
700 721 public int updateSupervisionThreestep(SupervisionThreestep supervisionThreestep) {
701 722 return supervisionThreestepMapper.updateSupervisionThreestep(supervisionThreestep);
702   - }
703   -
  723 + }
704 724  
705   -
706 725 @Override
707 726 public int activeSupervisionThreestep(SupervisionThreestep supervisionThreestep) {
708   -
  727 +
709 728 int j = supervisionThreestepMapper.updateSupervisionThreestep(supervisionThreestep);
710   -
711   -
  729 +
712 730 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
713   -
  731 +
714 732 supervisionThreestep = supervisionThreestepMapper.selectSupervisionThreestepById(supervisionThreestep.getId());
715   -
716   -
  733 +
717 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 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 831 return j;
824 832 }
825 833  
826 834 @Override
827   - public void checkDataToActiveTruck(String token){
828   -
  835 + public void checkDataToActiveTruck(String token) {
829 836  
830 837 String[] truckArray;
831   -
  838 +
832 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 857 truckArray = unActiveTruck.split(",");
854   -
  858 +
855 859 params.put("vehicleIds", truckArray);
856 860 params.put("page", 1);
857 861 params.put("size", 9999);
858 862 JSONArray array = null;
859   - if(token ==null)
  863 + if (token == null)
860 864 array = RemoteServerUtils.getTruckOnline(params);
861 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 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 879 ta.setActivateTime(new Date());
876   - }else{
  880 + } else {
877 881 continue;
878 882 }
879 883  
880 884 truckActivateMapper.updateTruckActivate(ta);
881   -
  885 +
882 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 926 }
924 927 return null;
925 928 }
926   -
  929 +
927 930 @Autowired
928 931 RedisCache redisCache;
929 932  
930 933 @Override
931   - public void updateTodayData(String token){
  934 + public void updateTodayData(String token) {
932 935  
933   -
934   -
935 936 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
936   -
  937 +
937 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 1021 @Override
1029 1022 public SupervisionThreestep getSupervisionThreestepInfo(SupervisionThreestep supervisionThreestep) {
1030   - if(supervisionThreestep.getWorkStartTime() == null){
  1023 + if (supervisionThreestep.getWorkStartTime() == null) {
1031 1024  
1032 1025 SimpleDateFormat yearFomat = new SimpleDateFormat("yyyy-MM-dd");
1033   -
  1026 +
1034 1027 String start, end;
1035 1028  
1036 1029 Date date = new Date();
... ... @@ -1056,9 +1049,8 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
1056 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 12 import com.trash.common.core.redis.RedisCache;
13 13 import com.trash.common.utils.DateUtils;
14 14 import com.trash.common.utils.RemoteServerUtils;
  15 +import com.trash.common.utils.SecurityUtils;
15 16  
16 17 import org.apache.commons.lang3.time.DateFormatUtils;
17 18 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -21,6 +22,8 @@ import com.trash.business.mapper.SupervisionThreestepMapper;
21 22 import com.trash.business.mapper.TruckActivateMapper;
22 23 import com.alibaba.fastjson.JSONArray;
23 24 import com.alibaba.fastjson.JSONObject;
  25 +import com.google.gson.Gson;
  26 +import com.google.gson.reflect.TypeToken;
24 27 import com.sun.jna.platform.unix.X11.XClientMessageEvent.Data;
25 28 import com.trash.business.domain.SupervisionThreestep;
26 29 import com.trash.business.domain.TruckActivate;
... ... @@ -34,68 +37,140 @@ import com.trash.business.service.ITruckActivateService;
34 37 * @date 2023-05-02
35 38 */
36 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 170 Date date = new Date();
96 171  
97 172 if (new Date().getHours() < 8) {
98   - end = yearFomat.format(date);
  173 + end = yearFomat.format(date);
99 174 date.setDate(date.getDate() - 1);
100 175 start = yearFomat.format(date);
101 176 } else {
... ... @@ -106,78 +181,76 @@ public class TruckActivateServiceImpl implements ITruckActivateService
106 181  
107 182 end += " 08:00:00";
108 183 start += " 08:00:00";
109   -
  184 +
110 185 String[] objs = truckActivate.getObjectId().split(",");
111 186 String[] nos = truckActivate.getLicensePlate().split(",");
112   -
113 187  
114 188 List<TruckActivate> oldDates = truckActivateMapper.selectTodayTruckByObjIds(objs);
115   -
  189 +
116 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 194 TruckActivate active = new TruckActivate();
121   -
  195 +
122 196 active.setObjectId(objs[i]);
123 197 active.setLicensePlate(nos[i]);
124 198 active.setConstruction(truckActivate.getConstruction());
125 199 active.setConstructionId(truckActivate.getConstructionId());
126 200 active.setEarthsite(truckActivate.getEarthsite());
127 201 active.setCompany(truckActivate.getCompany());
128   -
  202 +
129 203 active.setAddress(construction.getString("address"));
130 204 active.setEffectiveFrom(construction.getString("effectiveFrom"));
131 205 active.setEffectiveEnd(construction.getString("effectiveEnd"));
132   -
  206 +
133 207 active.setTransportStartTime(construction.getString("transportStartTime"));
134 208 active.setTransportEndTime(construction.getString("transportEndTime"));
135 209 active.setRouteName(construction.getString("routeName"));
136 210 active.setEarthName(construction.getString("earthName"));
137 211 active.setRouteInfo(construction.getString("routeInfo"));
138 212 active.setEarthList(construction.getString("earthList"));
139   -
  213 + active.setCoord(construction.getString("coord"));
  214 +
140 215 active.setCreateTime(DateUtils.getNowDate());
141   -
142   -
  216 +
143 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 250 threestep = new SupervisionThreestep();
178 251  
179   - threestep.setObjectId(active.getConstructionId());
180   -
  252 + threestep.setObjectId(active.getConstructionId());
  253 +
181 254 try {
182 255 threestep.setWorkStartTime(DateUtils.parseDate(start));
183 256 threestep.setWorkEndTime(DateUtils.parseDate(end));
... ... @@ -187,152 +260,151 @@ public class TruckActivateServiceImpl implements ITruckActivateService
187 260 }
188 261  
189 262 threestep = threestepMapper.selectThreestepByTruckDate(threestep);
190   -
  263 +
191 264 String trucks = threestep.getCompanyTrucks();
192   -
193   - if(trucks == null || trucks.isEmpty()){
  265 +
  266 + if (trucks == null || trucks.isEmpty()) {
194 267 trucks = active.getObjectId();
195   - }else{
196   - if(!trucks.contains(active.getObjectId())){
  268 + } else {
  269 + if (!trucks.contains(active.getObjectId())) {
197 270 trucks += "," + active.getObjectId();
198 271 }
199 272 }
200   -
  273 +
201 274 threestep.setCompanyTrucks(trucks);
202   -
  275 +
203 276 threestepMapper.updateSupervisionThreestep(threestep);
204   -
205 277  
206   - }else{
  278 + } else {
207 279 Long threeId = threestep.getId();
208 280 String trucks = threestep.getCompanyTrucks();
209   -
  281 +
210 282 threestep = new SupervisionThreestep();
211   -
  283 +
212 284 threestep.setId(threeId);
213   -
  285 +
214 286 trucks = trucks.replace(oldDate.getObjectId(), "").replace(",,", ",");
215   -
216   - if(trucks.length() == 1){
  287 +
  288 + if (trucks.length() == 1) {
217 289 trucks = "";
218 290 }
219   -
  291 +
220 292 threestep.setCompanyTrucks(trucks);
221   -
222   - //去除已有三查数据的车辆绑定
  293 +
  294 + // 去除已有三查数据的车辆绑定
223 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 322 trucks = active.getObjectId();
251   - }else{
  323 + } else {
252 324 trucks += "," + active.getObjectId();
253 325 }
254   -
  326 +
255 327 threestep.setCompanyTrucks(trucks);
256   -
  328 +
257 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 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 392 SupervisionThreestep threestep = new SupervisionThreestep();
321   -
  393 +
322 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 402 String start, end;
331 403  
332 404 Date date = new Date();
333 405  
334 406 if (new Date().getHours() < 8) {
335   - end = yearFomat.format(date);
  407 + end = yearFomat.format(date);
336 408 date.setDate(date.getDate() - 1);
337 409 start = yearFomat.format(date);
338 410 } else {
... ... @@ -350,95 +422,147 @@ public class TruckActivateServiceImpl implements ITruckActivateService
350 422 threestep.setWorkStartTime(dateTimeFomat.parse(start));
351 423 threestep.setWorkEndTime(dateTimeFomat.parse(end));
352 424 } catch (Exception e) {
353   -
354   - System.out.println(date +""+ start +""+ end);
355   -
  425 +
  426 + System.out.println(date + "" + start + "" + end);
  427 +
356 428 e.printStackTrace();
357 429 }
358 430 }
359   -
  431 +
360 432 TruckActivate truck = truckActivateMapper.getConractByObjectId(turck);
361 433  
362   - if(truck == null)return null;
363   -
  434 + if (truck == null)
  435 + return null;
  436 +
364 437 Map param = new HashMap<>();
365   -
366   - List<String> ids =new ArrayList<>();
367   -
368   -
369   -
  438 +
  439 + List<String> ids = new ArrayList<>();
  440 +
370 441 JSONArray contracts = redis.getCacheObject("contractList");
371   -
372   - if(contracts == null){
  442 +
  443 + if (contracts == null) {
373 444 param.put("page", 1);
374 445 param.put("size", 99999);
375   -
  446 +
376 447 contracts = RemoteServerUtils.getContractList(param);
377   - redis.setCacheObject("contractList",contracts);
  448 + redis.setCacheObject("contractList", contracts);
378 449 }
379   -
  450 +
380 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 456 array.add(obj);
386 457 }
387 458 }
388   -
389   - if(array.size() == 0){
  459 +
  460 + if (array.size() == 0) {
390 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 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 474 threestep.setType(1L);
404 475 threestep.setStatus(1L);
405   -
  476 +
406 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 481 JSONObject jsonObject = (JSONObject) object;
411   - if(jsonObject.getString("earthSiteID").equals((three.getObjectId()))){
  482 + if (jsonObject.getString("earthSiteID").equals((three.getObjectId()))) {
412 483 conractIds += jsonObject.getString("id") + ",";
413 484 break;
414 485 }
415 486 }
416   -
417 487 }
418   -
419   -
420   -
421   - if(conractIds.length() == 0){
  488 +
  489 + if (conractIds.length() == 0) {
422 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 495 @Override
428 496 public void endAllTruckUnActive() {
429 497 truckActivateMapper.endAllTurckUnActive();
430   -
  498 +
431 499 }
432 500  
433 501 @Override
434 502 public List<TruckActivate> getTruckListByObjects(TruckActivate truckActivate) {
435 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 562 @Override
439 563 public List<TruckActivate> getActivedTruckList(TruckActivate truckActivate) {
440   -
  564 +
441 565 return truckActivateMapper.getActivedTruckList(truckActivate);
442   -
  566 +
443 567 }
444 568 }
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/TruckCreditServiceImpl.java
1 1 package com.trash.business.service.impl;
2 2  
  3 +import java.util.ArrayList;
3 4 import java.util.Date;
  5 +import java.util.HashMap;
4 6 import java.util.List;
  7 +import java.util.Map;
5 8  
6 9 import org.springframework.beans.factory.annotation.Autowired;
7 10 import org.springframework.stereotype.Service;
8 11 import org.springframework.transaction.annotation.Transactional;
9 12  
  13 +import com.alibaba.fastjson.JSONArray;
  14 +import com.alibaba.fastjson.JSONObject;
10 15 import com.trash.business.domain.CompanyCredit;
  16 +import com.trash.business.domain.EarthsitesCredit;
11 17 import com.trash.business.domain.TruckCredit;
12 18 import com.trash.business.mapper.TruckCreditMapper;
13 19 import com.trash.business.service.ITruckCreditService;
  20 +import com.trash.common.utils.RemoteServerUtils;
14 21 import com.trash.common.utils.SecurityUtils;
15 22  
16 23 /**
... ... @@ -45,8 +52,46 @@ public class TruckCreditServiceImpl implements ITruckCreditService
45 52 */
46 53 @Override
47 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 172 @Override
128 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 23 import com.alibaba.fastjson.JSONObject;
24 24 import com.trash.caseOffline.domain.CaseOffline;
25 25 import com.trash.caseOffline.service.ICaseOfflineService;
  26 +import com.trash.casefile.domain.ViolationWarningInformation;
26 27 import com.trash.common.utils.RemoteServerUtils;
27 28 import com.trash.common.utils.SecurityUtils;
28 29 import com.trash.common.utils.poi.ExcelUtil;
... ... @@ -53,61 +54,9 @@ public class CaseOfflineController extends BaseController
53 54 {
54 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 1 package com.trash.caseOffline.domain;
2 2  
3 3 import java.util.Date;
  4 +import java.util.List;
  5 +
4 6 import com.fasterxml.jackson.annotation.JsonFormat;
5 7 import org.apache.commons.lang3.builder.ToStringBuilder;
6 8 import org.apache.commons.lang3.builder.ToStringStyle;
... ... @@ -94,6 +96,17 @@ public class CaseOffline extends BaseEntity
94 96  
95 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 110 public String getStartTime() {
98 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 75 @Override
76 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 111 return caseOfflineMapper.selectCaseOfflineList(caseOffline);
79 112 }
80 113  
... ...