Commit b507aac8d848a3082246de2542a244c18dd73318

Authored by youxiw2000
1 parent 5502c360

m

trash-quartz/src/main/java/com/trash/quartz/task/DriverTask.java
@@ -24,6 +24,7 @@ import com.trash.business.domain.CompanyCredit; @@ -24,6 +24,7 @@ import com.trash.business.domain.CompanyCredit;
24 import com.trash.business.domain.DriverCredit; 24 import com.trash.business.domain.DriverCredit;
25 import com.trash.business.domain.SupervisionThreestep; 25 import com.trash.business.domain.SupervisionThreestep;
26 import com.trash.business.domain.TruckCredit; 26 import com.trash.business.domain.TruckCredit;
  27 +import com.trash.business.mapper.CompanyCreditMapper;
27 import com.trash.business.mapper.SupervisionThreestepMapper; 28 import com.trash.business.mapper.SupervisionThreestepMapper;
28 import com.trash.business.service.ICompanyCreditService; 29 import com.trash.business.service.ICompanyCreditService;
29 import com.trash.business.service.IDriverCreditService; 30 import com.trash.business.service.IDriverCreditService;
@@ -94,7 +95,8 @@ public class DriverTask @@ -94,7 +95,8 @@ public class DriverTask
94 95
95 96
96 private void checkDriverCredit() { 97 private void checkDriverCredit() {
97 - 98 +
  99 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
98 if(RemoteServerUtils.remote == null){ 100 if(RemoteServerUtils.remote == null){
99 RemoteServerUtils.remote = trashConfig.getRemotePath(); 101 RemoteServerUtils.remote = trashConfig.getRemotePath();
100 } 102 }
@@ -134,14 +136,14 @@ public class DriverTask @@ -134,14 +136,14 @@ public class DriverTask
134 136
135 } 137 }
136 138
137 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");  
138 139
139 140
140 @SuppressWarnings({ "unchecked", "rawtypes" }) 141 @SuppressWarnings({ "unchecked", "rawtypes" })
141 private void checkTruckCredit() { 142 private void checkTruckCredit() {
  143 +
  144 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
142 Map map = new HashMap<>(); 145 Map map = new HashMap<>();
143 map.put("size",9999); 146 map.put("size",9999);
144 - map.put("dishonestState",0);  
145 map.put("valid",0); 147 map.put("valid",0);
146 map.put("page",1); 148 map.put("page",1);
147 149
@@ -207,11 +209,11 @@ public class DriverTask @@ -207,11 +209,11 @@ public class DriverTask
207 } catch (Exception e) { 209 } catch (Exception e) {
208 e.printStackTrace(); 210 e.printStackTrace();
209 } 211 }
210 - 212 +
  213 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
211 214
212 Map map = new HashMap<>(); 215 Map map = new HashMap<>();
213 map.put("size",9999); 216 map.put("size",9999);
214 - map.put("dishonestState",0);  
215 map.put("page",1); 217 map.put("page",1);
216 218
217 JSONArray companys = RemoteServerUtils.getCompanyList(map,TOKEN); 219 JSONArray companys = RemoteServerUtils.getCompanyList(map,TOKEN);
@@ -243,7 +245,7 @@ public class DriverTask @@ -243,7 +245,7 @@ public class DriverTask
243 companyCredit.setLostCredit(1L); 245 companyCredit.setLostCredit(1L);
244 companyCredit.setStatus(0L); 246 companyCredit.setStatus(0L);
245 247
246 - List<CompanyCredit> companyList = SpringUtils.getBean(ICompanyCreditService.class).selectCompanyCreditList(companyCredit); 248 + List<CompanyCredit> companyList = SpringUtils.getBean(CompanyCreditMapper.class).selectCompanyCreditList(companyCredit);
247 249
248 for(CompanyCredit c:companyList){ 250 for(CompanyCredit c:companyList){
249 SpringUtils.getBean(ICompanyCreditService.class).updateRemoteCompanyAndTruck(c,TOKEN); 251 SpringUtils.getBean(ICompanyCreditService.class).updateRemoteCompanyAndTruck(c,TOKEN);
trash-workFlow/src/main/java/com/trash/business/service/impl/CompanyCreditServiceImpl.java
@@ -15,6 +15,7 @@ import com.alibaba.fastjson.JSONObject; @@ -15,6 +15,7 @@ import com.alibaba.fastjson.JSONObject;
15 import com.trash.business.domain.CompanyCredit; 15 import com.trash.business.domain.CompanyCredit;
16 import com.trash.business.domain.TruckCredit; 16 import com.trash.business.domain.TruckCredit;
17 import com.trash.business.mapper.CompanyCreditMapper; 17 import com.trash.business.mapper.CompanyCreditMapper;
  18 +import com.trash.business.mapper.TruckCreditMapper;
18 import com.trash.business.service.ICompanyCreditService; 19 import com.trash.business.service.ICompanyCreditService;
19 import com.trash.business.service.ITruckCreditService; 20 import com.trash.business.service.ITruckCreditService;
20 import com.trash.common.core.redis.RedisCache; 21 import com.trash.common.core.redis.RedisCache;
@@ -33,8 +34,10 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { @@ -33,8 +34,10 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService {
33 private CompanyCreditMapper companyCreditMapper; 34 private CompanyCreditMapper companyCreditMapper;
34 35
35 @Autowired 36 @Autowired
36 - private ITruckCreditService truckService;;  
37 - 37 + private TruckCreditMapper truckMapper;
  38 +
  39 + @Autowired
  40 + private ITruckCreditService truckService;
38 @Autowired 41 @Autowired
39 RedisCache redisCache; 42 RedisCache redisCache;
40 /** 43 /**
@@ -111,9 +114,20 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { @@ -111,9 +114,20 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService {
111 } 114 }
112 115
113 public void insertCompanyCredit(CompanyCredit companyCredit, String token) { 116 public void insertCompanyCredit(CompanyCredit companyCredit, String token) {
114 - companyCredit.setTime(new Date()); 117 + int i = 0;
  118 + CompanyCredit cc = new CompanyCredit();
  119 +
  120 + cc.setStatus(0L);
  121 + cc.setLostCredit(companyCredit.getLostCredit());
  122 + cc.setObjectId(companyCredit.getObjectId());
115 123
116 - int i = companyCreditMapper.insertCompanyCredit(companyCredit); 124 + List old = companyCreditMapper.selectCompanyCreditList(cc);
  125 +
  126 + if (old.size() > 0) {
  127 + i = 1;
  128 + } else {
  129 + i = companyCreditMapper.insertCompanyCredit(companyCredit);
  130 + }
117 131
118 updateRemoteCompanyAndTruck(companyCredit, token); 132 updateRemoteCompanyAndTruck(companyCredit, token);
119 133
@@ -158,7 +172,7 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService { @@ -158,7 +172,7 @@ public class CompanyCreditServiceImpl implements ICompanyCreditService {
158 tredit.setStatus(0L); 172 tredit.setStatus(0L);
159 tredit.setObjectId(truckId); 173 tredit.setObjectId(truckId);
160 174
161 - List<TruckCredit> oldData = truckService.selectTruckCreditList(tredit); 175 + List<TruckCredit> oldData = truckMapper.selectTruckCreditList(tredit);
162 TruckCredit data; 176 TruckCredit data;
163 if (oldData.size() > 0) { 177 if (oldData.size() > 0) {
164 data = oldData.get(0); 178 data = oldData.get(0);