|
|
@@ -22,6 +22,7 @@ import com.sckw.transport.dao.*;
|
|
|
import com.sckw.transport.model.KwtLogisticsOrder;
|
|
|
import com.sckw.transport.model.KwtWaybillOrderTrack;
|
|
|
import com.sckw.transport.model.dto.WayBillDetailDTO;
|
|
|
+import com.sckw.transport.model.dto.WaybillListAppDTO;
|
|
|
import com.sckw.transport.model.dto.WaybillOrderDTO;
|
|
|
import com.sckw.transport.model.vo.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -518,7 +519,7 @@ public class WaybillManagementService {
|
|
|
_onway.put("name", "运输中");
|
|
|
_onway.put("value", "onway");
|
|
|
_onway.put("total", "0");
|
|
|
- List<Integer> onWayStates = getWallBillStatues("onway");
|
|
|
+ List<Long> onWayStates = getWallBillStatues("onway");
|
|
|
Long onWayCount = kwtWaybillOrderMapper.selectWaybillOrderCountByStatus(entId, onWayStates, keyword);
|
|
|
_onway.put("total", onWayCount.toString());
|
|
|
// 已完成
|
|
|
@@ -526,7 +527,7 @@ public class WaybillManagementService {
|
|
|
_finish.put("name", "已完成");
|
|
|
_finish.put("value", "finish");
|
|
|
_finish.put("total", "0");
|
|
|
- List<Integer> finishStates = getWallBillStatues("finish");
|
|
|
+ List<Long> finishStates = getWallBillStatues("finish");
|
|
|
Long finishCount = kwtWaybillOrderMapper.selectWaybillOrderCountByStatus(entId, finishStates, keyword);
|
|
|
_onway.put("total", finishCount.toString());
|
|
|
List<Map<String, String>> _list = new ArrayList<>();
|
|
|
@@ -536,19 +537,20 @@ public class WaybillManagementService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * app 运单分类统计数据 [运输中|已完成]
|
|
|
- * @param keyword
|
|
|
+ * app 运单列表 [运输中|已完成]
|
|
|
+ * @param query
|
|
|
* @return
|
|
|
*/
|
|
|
- public HttpResult waybillDataApp(String status, Integer page, Integer pageSize, String keyword){
|
|
|
- List<Integer> _statuses = getWallBillStatues(status);
|
|
|
+ public HttpResult waybillDataApp(WaybillListAppDTO query){
|
|
|
+ List<Integer> processStatuses = initWaybillIndexStatus();
|
|
|
+ List<Long> _statuses = getWallBillStatues(query.getStatus());
|
|
|
Criteria criteria = new Criteria();
|
|
|
criteria.and("entId").is(LoginUserHolder.getEntId());
|
|
|
criteria.and("delFlag").is(NumberConstant.ZERO);
|
|
|
// 多条件模糊查询
|
|
|
List<Criteria> orCriteria = new ArrayList<>();
|
|
|
- if (StringUtils.isNotBlank(keyword)) {
|
|
|
- Pattern pattern = Pattern.compile("^.*" + keyword + ".*$", Pattern.CASE_INSENSITIVE);
|
|
|
+ if (StringUtils.isNotBlank(query.getKeyword())) {
|
|
|
+ Pattern pattern = Pattern.compile("^.*" + query.getKeyword() + ".*$", Pattern.CASE_INSENSITIVE);
|
|
|
orCriteria.add(Criteria.where("wOrderNo").regex(pattern));
|
|
|
orCriteria.add(Criteria.where("truckNo").regex(pattern));
|
|
|
orCriteria.add(Criteria.where("driverName").regex(pattern));
|
|
|
@@ -562,14 +564,14 @@ public class WaybillManagementService {
|
|
|
}
|
|
|
// 总记录数
|
|
|
long total = mongoTemplate.count(queryFormat, SckwWaybillOrder.class);
|
|
|
- queryFormat.with(PageRequest.of(page - 1, pageSize,
|
|
|
+ queryFormat.with(PageRequest.of(query.getPage() - 1, query.getPageSize(),
|
|
|
Sort.by(Sort.Order.desc("createTime"))));
|
|
|
// 执行查询
|
|
|
List<SckwWaybillOrder> list = mongoTemplate.find(queryFormat, SckwWaybillOrder.class);
|
|
|
List<WaybillBoardListVO> returnList = new ArrayList<>();
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
List<WaybillStatusVO> statusVOS = new ArrayList();
|
|
|
- _statuses.forEach(e -> {
|
|
|
+ processStatuses.forEach(e -> {
|
|
|
WaybillStatusVO waybillStatusVO = new WaybillStatusVO();
|
|
|
waybillStatusVO.setStatus(false);
|
|
|
waybillStatusVO.setCode(e);
|
|
|
@@ -578,28 +580,46 @@ public class WaybillManagementService {
|
|
|
});
|
|
|
packageWaybillIndexResult(list, statusVOS, returnList);
|
|
|
}
|
|
|
- PageResult build = PageResult.build(page, pageSize, total, returnList);
|
|
|
+ PageResult build = PageResult.build(query.getPage(), query.getPageSize(), total, returnList);
|
|
|
return HttpResult.ok(build);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * app 运单分类吨量统计数据 [运输中|已完成]
|
|
|
+ * @param query
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public HttpResult waybillAmountStatistic(WaybillListAppDTO query){
|
|
|
+ List<Long> _statuses = getWallBillStatues(query.getStatus());
|
|
|
+ Map<String,Object> amount = kwtWaybillOrderMapper.selectWaybillOrderAmountByStatus(
|
|
|
+ LoginUserHolder.getEntId(),
|
|
|
+ _statuses,
|
|
|
+ query.getKeyword(),
|
|
|
+ query.getStartDate() == null ? null : query.getStartDate().toString().concat(" 00:00:00"),
|
|
|
+ query.getEndDate() == null ? null : query.getEndDate().toString().concat(" 23:59:59")
|
|
|
+ );
|
|
|
+ return HttpResult.ok(amount);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取 [运输中|已完成] 状态列表
|
|
|
* @param status
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Integer> getWallBillStatues(String status) {
|
|
|
- List<Integer> _list = new ArrayList<>();
|
|
|
+ public List<Long> getWallBillStatues(String status) {
|
|
|
+ List<Long> _list = new ArrayList<>();
|
|
|
if(status.equals("onway")) {
|
|
|
- _list.add(CarWaybillEnum.PENDING_ORDER.getCode());
|
|
|
- _list.add(CarWaybillEnum.PENDING_VEHICLE.getCode());
|
|
|
- _list.add(CarWaybillEnum.EXIT_COMPLETED.getCode());
|
|
|
- _list.add(CarWaybillEnum.WAIT_LOADING.getCode());
|
|
|
- _list.add(CarWaybillEnum.COMPLETION_LOADING.getCode());
|
|
|
- _list.add(CarWaybillEnum.WAIT_UNLOADING.getCode());
|
|
|
+ _list.add(CarWaybillEnum.PENDING_ORDER.getCode().longValue());
|
|
|
+ _list.add(CarWaybillEnum.PENDING_VEHICLE.getCode().longValue());
|
|
|
+ _list.add(CarWaybillEnum.EXIT_COMPLETED.getCode().longValue());
|
|
|
+ _list.add(CarWaybillEnum.WAIT_LOADING.getCode().longValue());
|
|
|
+ _list.add(CarWaybillEnum.COMPLETION_LOADING.getCode().longValue());
|
|
|
+ _list.add(CarWaybillEnum.WAIT_UNLOADING.getCode().longValue());
|
|
|
}
|
|
|
if(status.equals("finish")) {
|
|
|
- _list.add(CarWaybillEnum.COMPLETION_UNLOADING.getCode());
|
|
|
- _list.add(CarWaybillEnum.APPROVAL_PASS.getCode());
|
|
|
+ _list.add(CarWaybillEnum.COMPLETION_UNLOADING.getCode().longValue());
|
|
|
+ _list.add(CarWaybillEnum.APPROVAL_PASS.getCode().longValue());
|
|
|
}
|
|
|
return _list;
|
|
|
}
|