Commit 5502c3602412f8844a8d7b10c9c6430ab9647546

Authored by youxiw2000
1 parent 21c52f23

m

trash-workFlow/src/main/java/com/trash/business/controller/CompanyCreditController.java
1 1 package com.trash.business.controller;
2 2  
3 3 import java.util.ArrayList;
  4 +import java.util.Date;
4 5 import java.util.List;
5 6  
6 7 import com.trash.business.domain.ConstructionCredit;
... ... @@ -111,6 +112,10 @@ public class CompanyCreditController extends BaseController {
111 112 @PostMapping
112 113 public AjaxResult add(@RequestBody CompanyCredit companyCredit) {
113 114 try {
  115 +
  116 + companyCredit.setCreateBy(SecurityUtils.getUsername());
  117 + companyCredit.setTime(new Date());
  118 +
114 119 return toAjax(companyCreditService.insertCompanyCredit(companyCredit));
115 120 } catch (Exception e) {
116 121 return AjaxResult.error(e.getMessage());
... ...
trash-workFlow/src/main/java/com/trash/business/controller/ConstructionCreditController.java
1 1 package com.trash.business.controller;
2 2  
3 3 import java.util.ArrayList;
  4 +import java.util.Date;
4 5 import java.util.List;
5 6  
6 7 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -103,7 +104,9 @@ public class ConstructionCreditController extends BaseController
103 104 @Log(title = "工地失信", businessType = BusinessType.INSERT)
104 105 @PostMapping
105 106 public AjaxResult add(@RequestBody ConstructionCredit constructionCredit)
106   - {
  107 + {
  108 + constructionCredit.setTime(new Date());
  109 + constructionCredit.setCreateBy(SecurityUtils.getUsername());
107 110 return toAjax(constructionCreditService.insertConstructionCredit(constructionCredit));
108 111 }
109 112  
... ...
trash-workFlow/src/main/java/com/trash/business/controller/DriverCreditController.java
1 1 package com.trash.business.controller;
2 2  
3 3 import java.util.ArrayList;
  4 +import java.util.Date;
4 5 import java.util.List;
5 6  
6 7 import com.trash.business.domain.ConstructionCredit;
... ... @@ -21,6 +22,7 @@ import com.trash.common.enums.BusinessType;
21 22 import com.trash.business.domain.DriverCredit;
22 23 import com.trash.business.mapper.DriverCreditMapper;
23 24 import com.trash.business.service.IDriverCreditService;
  25 +import com.trash.common.utils.SecurityUtils;
24 26 import com.trash.common.utils.poi.ExcelUtil;
25 27 import com.trash.common.core.page.TableDataInfo;
26 28  
... ... @@ -32,115 +34,107 @@ import com.trash.common.core.page.TableDataInfo;
32 34 */
33 35 @RestController
34 36 @RequestMapping("/business/driverCredit")
35   -public class DriverCreditController extends BaseController
36   -{
37   - @Autowired
38   - private IDriverCreditService driverCreditService;
39   -
40   - @Autowired
41   - private DriverCreditMapper mapper;
42   -
43   - /**
44   - * 查询驾驶员失信列表
45   - */
46   - @GetMapping("/list")
47   - public TableDataInfo list(DriverCredit driverCredit)
48   - {
49   - startPage();
50   - List<DriverCredit> list = driverCreditService.selectDriverCreditList(driverCredit);
51   - return getDataTable(list);
52   - }
53   -
54   - @GetMapping("/historyCredit")
55   - public TableDataInfo historyCredit(DriverCredit driverCredit)
56   - {
57   - startPage();
58   - List<DriverCredit> list = driverCreditService.selectDriverCreditHistory(driverCredit);
59   - return getDataTable(list);
60   - }
61   -
62   - @GetMapping("/names")
63   - public List<String> getNames(DriverCredit credit)
64   - {
65   -
66   - if(credit.getStatus() == 1){
67   - credit.setStatus(null);
68   - }
69   - return mapper.getNames(credit);
70   - }
71   -
72   - @GetMapping("/licenseplates")
73   - public List<String> getLicenseplates(DriverCredit credit)
74   - {
75   -
76   - if(credit.getStatus() == 1){
77   - credit.setStatus(null);
78   - }
79   - return mapper.getLicenseplate(credit);
80   - }
81   -
82   - /**
83   - * 导出驾驶员失信列表
84   - */
85   - @Log(title = "驾驶员失信", businessType = BusinessType.EXPORT)
86   - @GetMapping("/export")
87   - public AjaxResult export(DriverCredit driverCredit)
88   - {
89   -
90   - List<DriverCredit> list = null;
91   - List<String> withOut = new ArrayList<String>();
92   -
93   - if(driverCredit.getStatus() == 1){
94   - withOut.add("time");
95   - list = driverCreditService.selectDriverCreditHistory(driverCredit);
96   - }else{
97   -
98   - list = driverCreditService.selectDriverCreditList(driverCredit);
99   -
100   - }
101   - for(int i = 0;i<list.size();i++){
102   - list.get(i).setId((long)i+1);
103   - }
104   - ExcelUtil<DriverCredit> util = new ExcelUtil<DriverCredit>(DriverCredit.class);
105   - return util.exportExcel(list, "驾驶员失信",withOut);
106   - }
107   -
108   - /**
109   - * 获取驾驶员失信详细信息
110   - */
111   - @GetMapping(value = "/{id}")
112   - public AjaxResult getInfo(@PathVariable("id") Long id)
113   - {
114   - return AjaxResult.success(driverCreditService.selectDriverCreditById(id));
115   - }
116   -
117   - /**
118   - * 新增驾驶员失信
119   - */
120   - @Log(title = "驾驶员失信", businessType = BusinessType.INSERT)
121   - @PostMapping
122   - public AjaxResult add(@RequestBody DriverCredit driverCredit)
123   - {
124   - return toAjax(driverCreditService.insertDriverCredit(driverCredit));
125   - }
126   -
127   - /**
128   - * 修改驾驶员失信
129   - */
130   - @Log(title = "驾驶员失信", businessType = BusinessType.UPDATE)
131   - @PutMapping
132   - public AjaxResult edit(@RequestBody DriverCredit driverCredit)
133   - {
134   - return toAjax(driverCreditService.updateDriverCredit(driverCredit));
135   - }
136   -
137   - /**
138   - * 删除驾驶员失信
139   - */
140   - @Log(title = "驾驶员失信", businessType = BusinessType.DELETE)
141   - @DeleteMapping("/{ids}")
142   - public AjaxResult remove(@PathVariable Long[] ids)
143   - {
144   - return toAjax(driverCreditService.deleteDriverCreditByIds(ids));
145   - }
  37 +public class DriverCreditController extends BaseController {
  38 + @Autowired
  39 + private IDriverCreditService driverCreditService;
  40 +
  41 + @Autowired
  42 + private DriverCreditMapper mapper;
  43 +
  44 + /**
  45 + * 查询驾驶员失信列表
  46 + */
  47 + @GetMapping("/list")
  48 + public TableDataInfo list(DriverCredit driverCredit) {
  49 + startPage();
  50 + List<DriverCredit> list = driverCreditService.selectDriverCreditList(driverCredit);
  51 + return getDataTable(list);
  52 + }
  53 +
  54 + @GetMapping("/historyCredit")
  55 + public TableDataInfo historyCredit(DriverCredit driverCredit) {
  56 + startPage();
  57 + List<DriverCredit> list = driverCreditService.selectDriverCreditHistory(driverCredit);
  58 + return getDataTable(list);
  59 + }
  60 +
  61 + @GetMapping("/names")
  62 + public List<String> getNames(DriverCredit credit) {
  63 +
  64 + if (credit.getStatus() == 1) {
  65 + credit.setStatus(null);
  66 + }
  67 + return mapper.getNames(credit);
  68 + }
  69 +
  70 + @GetMapping("/licenseplates")
  71 + public List<String> getLicenseplates(DriverCredit credit) {
  72 +
  73 + if (credit.getStatus() == 1) {
  74 + credit.setStatus(null);
  75 + }
  76 + return mapper.getLicenseplate(credit);
  77 + }
  78 +
  79 + /**
  80 + * 导出驾驶员失信列表
  81 + */
  82 + @Log(title = "驾驶员失信", businessType = BusinessType.EXPORT)
  83 + @GetMapping("/export")
  84 + public AjaxResult export(DriverCredit driverCredit) {
  85 +
  86 + List<DriverCredit> list = null;
  87 + List<String> withOut = new ArrayList<String>();
  88 +
  89 + if (driverCredit.getStatus() == 1) {
  90 + withOut.add("time");
  91 + list = driverCreditService.selectDriverCreditHistory(driverCredit);
  92 + } else {
  93 +
  94 + list = driverCreditService.selectDriverCreditList(driverCredit);
  95 +
  96 + }
  97 + for (int i = 0; i < list.size(); i++) {
  98 + list.get(i).setId((long) i + 1);
  99 + }
  100 + ExcelUtil<DriverCredit> util = new ExcelUtil<DriverCredit>(DriverCredit.class);
  101 + return util.exportExcel(list, "驾驶员失信", withOut);
  102 + }
  103 +
  104 + /**
  105 + * 获取驾驶员失信详细信息
  106 + */
  107 + @GetMapping(value = "/{id}")
  108 + public AjaxResult getInfo(@PathVariable("id") Long id) {
  109 + return AjaxResult.success(driverCreditService.selectDriverCreditById(id));
  110 + }
  111 +
  112 + /**
  113 + * 新增驾驶员失信
  114 + */
  115 + @Log(title = "驾驶员失信", businessType = BusinessType.INSERT)
  116 + @PostMapping
  117 + public AjaxResult add(@RequestBody DriverCredit driverCredit) {
  118 + driverCredit.setCreateBy(SecurityUtils.getUsername());
  119 + driverCredit.setTime(new Date());
  120 + return toAjax(driverCreditService.insertDriverCredit(driverCredit));
  121 + }
  122 +
  123 + /**
  124 + * 修改驾驶员失信
  125 + */
  126 + @Log(title = "驾驶员失信", businessType = BusinessType.UPDATE)
  127 + @PutMapping
  128 + public AjaxResult edit(@RequestBody DriverCredit driverCredit) {
  129 + return toAjax(driverCreditService.updateDriverCredit(driverCredit));
  130 + }
  131 +
  132 + /**
  133 + * 删除驾驶员失信
  134 + */
  135 + @Log(title = "驾驶员失信", businessType = BusinessType.DELETE)
  136 + @DeleteMapping("/{ids}")
  137 + public AjaxResult remove(@PathVariable Long[] ids) {
  138 + return toAjax(driverCreditService.deleteDriverCreditByIds(ids));
  139 + }
146 140 }
... ...
trash-workFlow/src/main/java/com/trash/business/controller/EarthsitesCreditController.java
1 1 package com.trash.business.controller;
2 2  
3 3 import java.util.ArrayList;
  4 +import java.util.Date;
4 5 import java.util.List;
5 6  
6 7 import com.alibaba.fastjson.JSONArray;
... ... @@ -96,7 +97,9 @@ public class EarthsitesCreditController extends BaseController
96 97 @Log(title = "处理场所失信", businessType = BusinessType.INSERT)
97 98 @PostMapping
98 99 public AjaxResult add(@RequestBody EarthsitesCredit earthsitesCredit)
99   - {
  100 + { earthsitesCredit.setCreateBy(SecurityUtils.getUsername());
  101 + earthsitesCredit.setTime(new Date());
  102 +
100 103 return toAjax(earthsitesCreditService.insertEarthsitesCredit(earthsitesCredit));
101 104 }
102 105  
... ...
trash-workFlow/src/main/java/com/trash/business/controller/TruckCreditController.java
1 1 package com.trash.business.controller;
2 2  
3 3 import java.util.ArrayList;
  4 +import java.util.Date;
4 5 import java.util.List;
5 6  
6 7 import com.trash.business.domain.ConstructionCredit;
... ... @@ -20,6 +21,7 @@ import com.trash.common.core.domain.AjaxResult;
20 21 import com.trash.common.enums.BusinessType;
21 22 import com.trash.business.domain.TruckCredit;
22 23 import com.trash.business.service.ITruckCreditService;
  24 +import com.trash.common.utils.SecurityUtils;
23 25 import com.trash.common.utils.poi.ExcelUtil;
24 26 import com.trash.common.core.page.TableDataInfo;
25 27  
... ... @@ -114,6 +116,8 @@ public class TruckCreditController extends BaseController
114 116 @PostMapping
115 117 public AjaxResult add(@RequestBody TruckCredit truckCredit)
116 118 {
  119 + truckCredit.setCreateBy(SecurityUtils.getUsername());
  120 + truckCredit.setTime(new Date());
117 121 return toAjax(truckCreditService.insertTruckCredit(truckCredit));
118 122 }
119 123  
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/CompanyCreditServiceImpl.java
... ... @@ -91,16 +91,13 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService {
91 91 @Override
92 92 public int insertCompanyCredit(CompanyCredit companyCredit) {
93 93 int i = 0;
94   - companyCredit.setCreateBy(SecurityUtils.getUsername());
95   - companyCredit.setTime(new Date());
96   -
97 94 CompanyCredit cc = new CompanyCredit();
98 95  
99 96 cc.setStatus(0L);
100 97 cc.setLostCredit(companyCredit.getLostCredit());
101 98 cc.setObjectId(companyCredit.getObjectId());
102 99  
103   - List old = selectCompanyCreditList(cc);
  100 + List old = companyCreditMapper.selectCompanyCreditList(cc);
104 101  
105 102 if (old.size() > 0) {
106 103 i = 1;
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/ConstructionCreditServiceImpl.java
... ... @@ -134,7 +134,6 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService
134 134 public int insertConstructionCredit(ConstructionCredit constructionCredit)
135 135 {
136 136  
137   - constructionCredit.setTime(new Date());
138 137  
139 138 List<Map> map = new ArrayList<Map>();
140 139  
... ... @@ -144,7 +143,7 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService
144 143 cc.setLostCredit(constructionCredit.getLostCredit());
145 144 cc.setObjectId(constructionCredit.getObjectId());
146 145  
147   - List old = selectConstructionCreditList(cc);
  146 + List old = constructionCreditMapper.selectConstructionCreditList(cc);
148 147  
149 148 int i = 0;
150 149  
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/DriverCreditServiceImpl.java
... ... @@ -116,8 +116,7 @@ List&lt;String&gt; areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas();
116 116 @Override
117 117 public int insertDriverCredit(DriverCredit driverCredit)
118 118 {
119   - driverCredit.setCreateBy(SecurityUtils.getUsername());
120   - driverCredit.setTime(new Date());
  119 +
121 120 int i;
122 121  
123 122 DriverCredit cc = new DriverCredit();
... ... @@ -126,7 +125,7 @@ List&lt;String&gt; areas = SecurityUtils.getLoginUser().getUser().getCompanyAreas();
126 125 cc.setLostCredit(driverCredit.getLostCredit());
127 126 cc.setObjectId(driverCredit.getObjectId());
128 127  
129   - List old = selectDriverCreditList(cc);
  128 + List old = driverCreditMapper.selectDriverCreditList(cc);
130 129  
131 130 if(old.size() > 0){
132 131 i = 1;
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/EarthsitesCreditServiceImpl.java
... ... @@ -9,6 +9,7 @@ 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.trash.business.mapper.TruckCreditMapper;
12 13 import com.alibaba.fastjson.JSONArray;
13 14 import com.alibaba.fastjson.JSONObject;
14 15 import com.trash.business.domain.ConstructionCredit;
... ... @@ -96,8 +97,6 @@ public class EarthsitesCreditServiceImpl implements IEarthsitesCreditService
96 97 @Override
97 98 public int insertEarthsitesCredit(EarthsitesCredit earthsitesCredit)
98 99 {
99   - earthsitesCredit.setCreateBy(SecurityUtils.getUsername());
100   - earthsitesCredit.setTime(new Date());
101 100  
102 101 List<Map> map = new ArrayList<Map>();
103 102  
... ... @@ -107,7 +106,7 @@ public class EarthsitesCreditServiceImpl implements IEarthsitesCreditService
107 106 cc.setLostCredit(earthsitesCredit.getLostCredit());
108 107 cc.setObjectId(earthsitesCredit.getObjectId());
109 108  
110   - List old = selectEarthsitesCreditList(cc);
  109 + List old = earthsitesCreditMapper.selectEarthsitesCreditList(cc);
111 110  
112 111 int i = 0;
113 112  
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/SupervisionThreestepServiceImpl.java
... ... @@ -620,17 +620,44 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer
620 620  
621 621 String companyName = SecurityUtils.getLoginUser().getUser().getCompanyName();
622 622  
623   - if(companyName != null){
624   - supervisionThreestep.setCompanys(companyName);
625   - }
  623 +
626 624  
627 625 List<SupervisionThreestep> threesteps = supervisionThreestepMapper.selectTodayDataList(supervisionThreestep);
  626 +
  627 + if(companyName != null){
628 628  
629   -
630   -
631   - return threesteps;
632   -
  629 + JSONArray array = redisCache.getCacheObject("constructionList");
  630 +
  631 + for(SupervisionThreestep three:threesteps){
  632 + for(Object obj:array){
  633 + JSONObject con = (JSONObject) obj;
  634 + if(three.getObjectId().equals(con.getString("id"))){
  635 +
  636 + if(con.getString("transportCompany") != null && con.getString("transportCompany").equals(companyName)){
  637 +
  638 + data.add(three);
  639 +
  640 + continue;
  641 + }
  642 +
  643 + JSONArray array2 = RemoteServerUtils.getUnitetransport(con.getString("id"));
  644 +
  645 + for(Object comObj:array2){
  646 + JSONObject company = (JSONObject) comObj;
  647 +
  648 + if(company.getString("companyName") != null && company.getString("companyName").equals(companyName)){
  649 +
  650 + data.add(three);
  651 + break;
  652 + }
  653 + }
  654 + }
  655 + }
  656 + }
  657 + return data;
  658 + }
633 659  
  660 + return threesteps;
634 661 }
635 662  
636 663 /**
... ...
trash-workFlow/src/main/java/com/trash/business/service/impl/TruckCreditServiceImpl.java
... ... @@ -118,16 +118,13 @@ public class TruckCreditServiceImpl implements ITruckCreditService
118 118  
119 119 int i;
120 120  
121   - truckCredit.setCreateBy(SecurityUtils.getUsername());
122   - truckCredit.setTime(new Date());
123   -
124 121 TruckCredit cc = new TruckCredit();
125 122  
126 123 cc.setStatus(0L);
127 124 cc.setLostCredit(truckCredit.getLostCredit());
128 125 cc.setObjectId(truckCredit.getObjectId());
129 126  
130   - List old = selectTruckCreditList(cc);
  127 + List old = truckCreditMapper.selectTruckCreditList(cc);
131 128  
132 129 if(old.size() > 0){
133 130 i = 1;
... ...