Commit d1ba992a09ac067ebe2f8b8ea5465f8230b38715

Authored by lichao
1 parent 5ee98a6d

时间排序

trash-garbage/src/main/java/com/trash/garbage/service/GarTransportationEnterpriseService.java
@@ -7,6 +7,9 @@ import java.util.List; @@ -7,6 +7,9 @@ import java.util.List;
7 public interface GarTransportationEnterpriseService { 7 public interface GarTransportationEnterpriseService {
8 String requestStr(String tel,String adCodes,String officeAddress); 8 String requestStr(String tel,String adCodes,String officeAddress);
9 9
10 - List<TransportationEnterprise> request(String tel,String adCodes,String officeAddress); 10 + // 实现接口中定义的三个参数的request方法
  11 + List<TransportationEnterprise> request(String tel, String adCodes, String officeAddress);
  12 +
  13 + List<TransportationEnterprise> request(String tel, String adCodes, String officeAddress, String name);
11 14
12 } 15 }
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
@@ -770,7 +770,8 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt; @@ -770,7 +770,8 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt;
770 LambdaQueryWrapper<GarOrder> qw = new LambdaQueryWrapper<>(); 770 LambdaQueryWrapper<GarOrder> qw = new LambdaQueryWrapper<>();
771 qw.like(StringUtils.isNotEmpty(dto.getGarOrderCompanyName()), GarOrder::getGarOrderCompanyName, dto.getGarOrderCompanyName()) 771 qw.like(StringUtils.isNotEmpty(dto.getGarOrderCompanyName()), GarOrder::getGarOrderCompanyName, dto.getGarOrderCompanyName())
772 .eq(dto.getGarOrderHandlerStatus() != null, GarOrder::getGarOrderHandlerStatus, dto.getGarOrderHandlerStatus()) 772 .eq(dto.getGarOrderHandlerStatus() != null, GarOrder::getGarOrderHandlerStatus, dto.getGarOrderHandlerStatus())
773 - .eq(dto.getGarCancelFlag() != null, GarOrder::getGarCancelFlag, dto.getGarCancelFlag()); 773 + .eq(dto.getGarCancelFlag() != null, GarOrder::getGarCancelFlag, dto.getGarCancelFlag())
  774 + .orderByDesc(GarOrder::getGarOrderAgreementTime); // 添加按创建时间倒序排序
774 List<GarOrder> list = list(qw); 775 List<GarOrder> list = list(qw);
775 PageInfo<GarOrder> pageInfo = new PageInfo<>(list); 776 PageInfo<GarOrder> pageInfo = new PageInfo<>(list);
776 return pageInfo; 777 return pageInfo;
@@ -965,10 +966,11 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt; @@ -965,10 +966,11 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt;
965 return pageInfo; 966 return pageInfo;
966 } 967 }
967 968
  969 +
968 @Override 970 @Override
969 public PageInfo dockingUpEnterpriseList(TransportationEnterprise dto) { 971 public PageInfo dockingUpEnterpriseList(TransportationEnterprise dto) {
970 - // 1)支持选择企业“所属区域”(长沙市内的)展示区域内所有企业  
971 - // 2)支持选择车辆“车辆类型”展示有该车辆类型的企业 972 + // 1)支持选择企业"所属区域"(长沙市内的)展示区域内所有企业
  973 + // 2)支持选择车辆"车辆类型"展示有该车辆类型的企业
972 // TODO 车辆类型暂时不考虑 974 // TODO 车辆类型暂时不考虑
973 975
974 Map<String, String> headers = new HashMap<>(); 976 Map<String, String> headers = new HashMap<>();
@@ -978,6 +980,7 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt; @@ -978,6 +980,7 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt;
978 String tel = null; 980 String tel = null;
979 String areaCode = null; 981 String areaCode = null;
980 String officeAddress = null; 982 String officeAddress = null;
  983 + String name = null; // 添加name变量
981 984
982 if (StringUtils.isNotEmpty(dto.getServicePhone())) { 985 if (StringUtils.isNotEmpty(dto.getServicePhone())) {
983 tel = dto.getServicePhone(); 986 tel = dto.getServicePhone();
@@ -987,6 +990,11 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt; @@ -987,6 +990,11 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt;
987 officeAddress = dto.getRegistrationArea(); 990 officeAddress = dto.getRegistrationArea();
988 } 991 }
989 992
  993 + // 添加对企业名称的处理
  994 + if (StringUtils.isNotEmpty(dto.getName())) {
  995 + name = dto.getName();
  996 + }
  997 +
990 if (StringUtils.isNotEmpty(dto.getRegistrationArea())) { 998 if (StringUtils.isNotEmpty(dto.getRegistrationArea())) {
991 try { 999 try {
992 JSONArray jsonArray = garAreaServer.request(); 1000 JSONArray jsonArray = garAreaServer.request();
@@ -1009,7 +1017,10 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt; @@ -1009,7 +1017,10 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt;
1009 } 1017 }
1010 } 1018 }
1011 1019
1012 - List<TransportationEnterprise> list = garTransportationEnterpriseService.request(tel, areaCode, officeAddress); 1020 + // 修改这里,将name参数传递给request方法
  1021 + List<TransportationEnterprise> list = garTransportationEnterpriseService.request(tel, areaCode, officeAddress, name);
  1022 +
  1023 + // 后续代码保持不变...
1013 if (CollectionUtils.isNotEmpty(list) && StringUtils.isNotEmpty(tel)) { 1024 if (CollectionUtils.isNotEmpty(list) && StringUtils.isNotEmpty(tel)) {
1014 String telStr = tel; 1025 String telStr = tel;
1015 list = list.stream().filter(t -> StringUtils.equals(telStr, t.getServicePhone())).collect(Collectors.toList()); 1026 list = list.stream().filter(t -> StringUtils.equals(telStr, t.getServicePhone())).collect(Collectors.toList());
@@ -1220,7 +1231,7 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt; @@ -1220,7 +1231,7 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt;
1220 1231
1221 String tel = SecurityUtils.getLoginUser().getUser().getPhonenumber(); 1232 String tel = SecurityUtils.getLoginUser().getUser().getPhonenumber();
1222 1233
1223 - List<TransportationEnterprise> enterprises = garTransportationEnterpriseService.request(tel, null, null); 1234 + List<TransportationEnterprise> enterprises = garTransportationEnterpriseService.request(tel, null, null, null);
1224 if (CollectionUtils.isEmpty(enterprises)) { 1235 if (CollectionUtils.isEmpty(enterprises)) {
1225 return Collections.emptyList(); 1236 return Collections.emptyList();
1226 } 1237 }
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarTransportationEnterpriseServiceImpl.java
@@ -11,10 +11,18 @@ import org.springframework.stereotype.Service; @@ -11,10 +11,18 @@ import org.springframework.stereotype.Service;
11 11
12 import java.util.*; 12 import java.util.*;
13 13
  14 +
14 @Service 15 @Service
15 public class GarTransportationEnterpriseServiceImpl implements GarTransportationEnterpriseService { 16 public class GarTransportationEnterpriseServiceImpl implements GarTransportationEnterpriseService {
  17 +
  18 + // 实现接口中定义的三个参数的requestStr方法
16 @Override 19 @Override
17 - public String requestStr(String tel, String adCodes,String officeAddress) { 20 + public String requestStr(String tel, String adCodes, String officeAddress) {
  21 + return requestStr(tel, adCodes, officeAddress, null); // 调用四个参数的版本,name传null
  22 + }
  23 +
  24 + // 新增的四个参数的requestStr方法
  25 + public String requestStr(String tel, String adCodes, String officeAddress, String name) {
18 Map<String, Object> params = new HashMap<>(); 26 Map<String, Object> params = new HashMap<>();
19 if (StringUtils.isNotEmpty(tel)) { 27 if (StringUtils.isNotEmpty(tel)) {
20 params.put("phoneNo", tel); 28 params.put("phoneNo", tel);
@@ -24,16 +32,27 @@ public class GarTransportationEnterpriseServiceImpl implements GarTransportation @@ -24,16 +32,27 @@ public class GarTransportationEnterpriseServiceImpl implements GarTransportation
24 params.put("adCodes", adCodes); 32 params.put("adCodes", adCodes);
25 } 33 }
26 34
27 - if (StringUtils.isNotEmpty(adCodes)) { 35 + if (StringUtils.isNotEmpty(officeAddress)) {
28 params.put("officeAddress", officeAddress); 36 params.put("officeAddress", officeAddress);
29 } 37 }
30 38
  39 + // 添加名称模糊查询参数
  40 + if (StringUtils.isNotEmpty(name)) {
  41 + params.put("name", name);
  42 + }
  43 +
31 return HttpUtil.doGet("/api/gpsservice/cs/companies/simple/list?tag=1", params); 44 return HttpUtil.doGet("/api/gpsservice/cs/companies/simple/list?tag=1", params);
32 } 45 }
33 46
  47 + // 实现接口中定义的三个参数的request方法
34 @Override 48 @Override
35 - public List<TransportationEnterprise> request(String tel, String adCodes,String officeAddress) {  
36 - String json = requestStr(tel, adCodes,officeAddress); 49 + public List<TransportationEnterprise> request(String tel, String adCodes, String officeAddress) {
  50 + return request(tel, adCodes, officeAddress, null); // 调用四个参数的版本,name传null
  51 + }
  52 +
  53 + // 新增的四个参数的request方法
  54 + public List<TransportationEnterprise> request(String tel, String adCodes, String officeAddress, String name) {
  55 + String json = requestStr(tel, adCodes, officeAddress, name); // 传递name参数
37 if (StringUtils.isEmpty(json)) { 56 if (StringUtils.isEmpty(json)) {
38 return Collections.emptyList(); 57 return Collections.emptyList();
39 } 58 }
@@ -47,7 +66,6 @@ public class GarTransportationEnterpriseServiceImpl implements GarTransportation @@ -47,7 +66,6 @@ public class GarTransportationEnterpriseServiceImpl implements GarTransportation
47 JSONObject jsonObject = (JSONObject) object; 66 JSONObject jsonObject = (JSONObject) object;
48 TransportationEnterprise transportationEnterprise = new TransportationEnterprise(); 67 TransportationEnterprise transportationEnterprise = new TransportationEnterprise();
49 transportationEnterprise.setId(StringUtils.replace(jsonObject.get("id").toString(), "zxljqy", "")); 68 transportationEnterprise.setId(StringUtils.replace(jsonObject.get("id").toString(), "zxljqy", ""));
50 - //transportationEnterprise.setId(jsonObject.get("id").toString());  
51 transportationEnterprise.setName(jsonObject.getString("name")); 69 transportationEnterprise.setName(jsonObject.getString("name"));
52 transportationEnterprise.setAbbreviation(jsonObject.getString("abbreviation")); 70 transportationEnterprise.setAbbreviation(jsonObject.getString("abbreviation"));
53 transportationEnterprise.setOfficeAddress(jsonObject.getString("officeAddress")); 71 transportationEnterprise.setOfficeAddress(jsonObject.getString("officeAddress"));
trash-ui/dist.zip deleted 100644 → 0
No preview for this file type