|
|
@@ -81,7 +81,7 @@ public class WaybillManagementService {
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
- public HttpResult waybillData(@Param("id") Long id) {
|
|
|
+ public HttpResult waybillData(Long id) {
|
|
|
WaybillDataVO waybillDataVO = new WaybillDataVO();
|
|
|
Criteria criteria = new Criteria();
|
|
|
criteria.and("wOrderId").is(id);
|
|
|
@@ -118,10 +118,9 @@ public class WaybillManagementService {
|
|
|
waybillCarVO.setDriverPhone(info.getDriverPhone());
|
|
|
List<String> list = new ArrayList<>();
|
|
|
list.add(info.getTruckNo());
|
|
|
-// Map<String, RTruckVo> trucks = remoteFleetService.findTruck(list);
|
|
|
- Map<String, RTruckVo> trucks = new HashMap<>();
|
|
|
+ Map<String, RTruckVo> trucks = remoteFleetService.findTruck(list);
|
|
|
if (CollectionUtils.isNotEmpty(trucks)) {
|
|
|
- waybillCarVO.setTrailerNo(trucks.get(0).getTrailerNo());
|
|
|
+ waybillCarVO.setTrailerNo(trucks.get(info.getTruckNo()) != null ? trucks.get(info.getTruckNo()).getTrailerNo() : null);
|
|
|
}
|
|
|
// 票据
|
|
|
waybillTicketVO.setLoadTime(DateUtil.getDateTime(info.getLoadTime()));
|
|
|
@@ -138,15 +137,7 @@ public class WaybillManagementService {
|
|
|
WaybillStatusVO waybillStatusVO = new WaybillStatusVO();
|
|
|
waybillStatusVO.setStatus(false);
|
|
|
waybillStatusVO.setCode(e);
|
|
|
- switch (e){
|
|
|
- case 2 -> waybillStatusVO.setDestination("已接单");
|
|
|
- case 3 -> waybillStatusVO.setDestination("已出车");
|
|
|
- case 4 -> waybillStatusVO.setDestination("到达装货地");
|
|
|
- case 5 -> waybillStatusVO.setDestination("已装货");
|
|
|
- case 6 -> waybillStatusVO.setDestination("到达卸货点");
|
|
|
- case 7 -> waybillStatusVO.setDestination("已卸货");
|
|
|
- case 8 -> waybillStatusVO.setDestination("已核单");
|
|
|
- }
|
|
|
+ waybillStatusVO.setDestination(CarWaybillEnum.getName(e));
|
|
|
statusVOS.add(waybillStatusVO);
|
|
|
});
|
|
|
List<KwtWaybillOrderTrack> kwtWaybillOrderTracks = kwtWaybillOrderTrackMapper.selectList(new LambdaQueryWrapper<KwtWaybillOrderTrack>()
|
|
|
@@ -155,8 +146,7 @@ public class WaybillManagementService {
|
|
|
if (CollectionUtils.isNotEmpty(kwtWaybillOrderTracks)) {
|
|
|
List<Long> userIds = new ArrayList<>();
|
|
|
kwtWaybillOrderTracks.forEach(e -> userIds.add(e.getCreateBy()));
|
|
|
-// List<UserCacheResDto> users = remoteSystemService.queryUserCacheByIds(userIds);
|
|
|
- List<UserCacheResDto> users = new ArrayList<>();
|
|
|
+ List<UserCacheResDto> users = remoteSystemService.queryUserCacheByIds(userIds);
|
|
|
Map<Long, String> usersMap = new HashMap<>();
|
|
|
users.forEach(e -> usersMap.put(e.getId(), e.getName()));
|
|
|
for (KwtWaybillOrderTrack kwtWaybillOrderTrack: kwtWaybillOrderTracks) {
|
|
|
@@ -165,7 +155,8 @@ public class WaybillManagementService {
|
|
|
statusVO.setStatus(true);
|
|
|
statusVO.setId(kwtWaybillOrderTrack.getId());
|
|
|
statusVO.setCreateTime(DateUtil.getDateTime(kwtWaybillOrderTrack.getCreateTime()));
|
|
|
- statusVO.setCreateByName(usersMap.get(kwtWaybillOrderTrack.getCreateBy()));
|
|
|
+ statusVO.setCreateByName(usersMap.get(kwtWaybillOrderTrack.getCreateBy()) == null
|
|
|
+ ? null : usersMap.get(kwtWaybillOrderTrack.getCreateBy()));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -173,7 +164,8 @@ public class WaybillManagementService {
|
|
|
waybillTrackVO.setId(String.valueOf(kwtWaybillOrderTrack.getId()))
|
|
|
.setRemark(kwtWaybillOrderTrack.getRemark())
|
|
|
.setStatus(String.valueOf(kwtWaybillOrderTrack.getStatus()))
|
|
|
- .setCreateBy(usersMap.get(String.valueOf(kwtWaybillOrderTrack.getCreateBy())))
|
|
|
+ .setCreateBy(usersMap.get(kwtWaybillOrderTrack.getCreateBy()) == null
|
|
|
+ ? null : usersMap.get(kwtWaybillOrderTrack.getCreateBy()))
|
|
|
.setCreateTime(DateUtil.getDateTime(kwtWaybillOrderTrack.getCreateTime()));
|
|
|
waybillTrackVOS.add(waybillTrackVO);
|
|
|
}
|
|
|
@@ -203,15 +195,7 @@ public class WaybillManagementService {
|
|
|
WaybillStatusVO waybillStatusVO = new WaybillStatusVO();
|
|
|
waybillStatusVO.setStatus(false);
|
|
|
waybillStatusVO.setCode(e);
|
|
|
- switch (e){
|
|
|
- case 2 -> waybillStatusVO.setDestination("司机接单");
|
|
|
- case 3 -> waybillStatusVO.setDestination("出车");
|
|
|
- case 4 -> waybillStatusVO.setDestination("到装货地");
|
|
|
- case 5 -> waybillStatusVO.setDestination("装货");
|
|
|
- case 6 -> waybillStatusVO.setDestination("到卸货地");
|
|
|
- case 7 -> waybillStatusVO.setDestination("卸货");
|
|
|
- case 8 -> waybillStatusVO.setDestination("核单");
|
|
|
- }
|
|
|
+ waybillStatusVO.setDestination(CarWaybillEnum.getName(e));
|
|
|
statusVOS.add(waybillStatusVO);
|
|
|
});
|
|
|
|
|
|
@@ -255,8 +239,7 @@ public class WaybillManagementService {
|
|
|
if (CollectionUtils.isNotEmpty(kwtWaybillOrderTracks)) {
|
|
|
List<Long> userIds = new ArrayList<>();
|
|
|
kwtWaybillOrderTracks.forEach(e -> userIds.add(e.getCreateBy()));
|
|
|
-// List<UserCacheResDto> users = remoteSystemService.queryUserCacheByIds(userIds);
|
|
|
- List<UserCacheResDto> users = new ArrayList<>();
|
|
|
+ List<UserCacheResDto> users = remoteSystemService.queryUserCacheByIds(userIds);
|
|
|
Map<Long, String> usersMap = new HashMap<>();
|
|
|
users.forEach(e -> usersMap.put(e.getId(), e.getName()));
|
|
|
waybillBoardListVO.getTracks().forEach(e -> {
|
|
|
@@ -265,7 +248,7 @@ public class WaybillManagementService {
|
|
|
e.setStatus(true);
|
|
|
e.setId(e2.getId());
|
|
|
e.setCreateTime(DateUtil.getDateTime(e2.getCreateTime()));
|
|
|
- e.setCreateByName(usersMap.get(e2.getCreateBy()));
|
|
|
+ e.setCreateByName(usersMap.get(e2.getCreateBy()) == null ? null : usersMap.get(e2.getCreateBy()));
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
@@ -309,7 +292,7 @@ public class WaybillManagementService {
|
|
|
Criteria.where("wOrderId").in(wOrderIds);
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isNotBlank(query.getStatus())) {
|
|
|
+ if (StringUtils.isNotBlank(query.getStatus()) && !query.getStatus().equals("all")) {
|
|
|
criteria.and("status").is(query.getStatus());
|
|
|
} else {
|
|
|
criteria.and("status").in(statuses);
|
|
|
@@ -376,22 +359,14 @@ public class WaybillManagementService {
|
|
|
Map<String, TableTops> listMap = new HashMap<>();
|
|
|
TableTops topTotal = new TableTops();
|
|
|
topTotal.setName("全部");
|
|
|
- topTotal.setValue("");
|
|
|
+ topTotal.setValue("all");
|
|
|
topTotal.setTotal(0);
|
|
|
listMap.put("", topTotal);
|
|
|
statuses.forEach(e -> {
|
|
|
TableTops top = new TableTops();
|
|
|
top.setValue(String.valueOf(e));
|
|
|
top.setTotal(0);
|
|
|
- switch (e){
|
|
|
- case 2 -> top.setName("司机接单");
|
|
|
- case 3 -> top.setName("出车");
|
|
|
- case 4 -> top.setName("到装货地");
|
|
|
- case 5 -> top.setName("装货");
|
|
|
- case 6 -> top.setName("到卸货地");
|
|
|
- case 7 -> top.setName("卸货");
|
|
|
- case 8 -> top.setName("核单");
|
|
|
- }
|
|
|
+ top.setName(CarWaybillEnum.getName(e));
|
|
|
listMap.put(String.valueOf(e), top);
|
|
|
});
|
|
|
if(CollectionUtils.isNotEmpty(results)) {
|
|
|
@@ -399,7 +374,7 @@ public class WaybillManagementService {
|
|
|
listMap.get(result.getValue()).setTotal(result.getTotal());
|
|
|
}
|
|
|
}
|
|
|
- listMap.get("").setTotal(listMap.values().parallelStream().mapToInt(e -> e.getTotal()).sum());
|
|
|
+ listMap.get("all").setTotal(listMap.values().parallelStream().mapToInt(e -> e.getTotal()).sum());
|
|
|
return HttpResult.ok(listMap.values());
|
|
|
}
|
|
|
}
|