|
@@ -1,5 +1,6 @@
|
|
|
package com.sckw.transport.service;
|
|
package com.sckw.transport.service;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.sckw.core.common.enums.NumberConstant;
|
|
import com.sckw.core.common.enums.NumberConstant;
|
|
|
import com.sckw.core.utils.CollectionUtils;
|
|
import com.sckw.core.utils.CollectionUtils;
|
|
@@ -10,15 +11,16 @@ import com.sckw.excel.utils.DateUtil;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.transport.dao.*;
|
|
import com.sckw.transport.dao.*;
|
|
|
import com.sckw.transport.model.*;
|
|
import com.sckw.transport.model.*;
|
|
|
-import com.sckw.transport.model.dto.OrderDto;
|
|
|
|
|
|
|
+import com.sckw.transport.model.dto.OrderDTO;
|
|
|
import com.sckw.transport.model.param.ConsignOrderQuery;
|
|
import com.sckw.transport.model.param.ConsignOrderQuery;
|
|
|
-import com.sckw.transport.model.vo.CarDataVo;
|
|
|
|
|
-import com.sckw.transport.model.vo.CarWaybillVo;
|
|
|
|
|
-import com.sckw.transport.model.vo.ConsignOrderVo;
|
|
|
|
|
|
|
+import com.sckw.transport.model.vo.CarDataVO;
|
|
|
|
|
+import com.sckw.transport.model.vo.CarWaybillVO;
|
|
|
|
|
+import com.sckw.transport.model.vo.ConsignOrderVO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -74,12 +76,12 @@ public class ConsignOrderService {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public List<ConsignOrderVo> export(ConsignOrderQuery query) {
|
|
|
|
|
- return new ArrayList<ConsignOrderVo>();
|
|
|
|
|
|
|
+ public List<ConsignOrderVO> export(ConsignOrderQuery query) {
|
|
|
|
|
+ return new ArrayList<ConsignOrderVO>();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public HttpResult getCarWaybillByOrder(OrderDto orderDto) {
|
|
|
|
|
- List<CarWaybillVo> returnList = new ArrayList<>();
|
|
|
|
|
|
|
+ public HttpResult getCarWaybillByOrder(OrderDTO orderDto) {
|
|
|
|
|
+ List<CarWaybillVO> returnList = new ArrayList<>();
|
|
|
KwtLogisticsOrder order = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
|
|
KwtLogisticsOrder order = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
|
|
|
.eq(StringUtils.isNotBlank(orderDto.getId()), KwtLogisticsOrder::getId, Long.parseLong(orderDto.getId()))
|
|
.eq(StringUtils.isNotBlank(orderDto.getId()), KwtLogisticsOrder::getId, Long.parseLong(orderDto.getId()))
|
|
|
.eq(StringUtils.isNotBlank(orderDto.getOrderNo()), KwtLogisticsOrder::getLOrderNo, orderDto.getOrderNo())
|
|
.eq(StringUtils.isNotBlank(orderDto.getOrderNo()), KwtLogisticsOrder::getLOrderNo, orderDto.getOrderNo())
|
|
@@ -92,7 +94,7 @@ public class ConsignOrderService {
|
|
|
.eq(KwtWaybillOrder::getEntId, LoginUserHolder.getEntId()));
|
|
.eq(KwtWaybillOrder::getEntId, LoginUserHolder.getEntId()));
|
|
|
if (CollectionUtils.isNotEmpty(kwtWaybillOrders)) {
|
|
if (CollectionUtils.isNotEmpty(kwtWaybillOrders)) {
|
|
|
for (KwtWaybillOrder kwtWaybillOrder : kwtWaybillOrders) {
|
|
for (KwtWaybillOrder kwtWaybillOrder : kwtWaybillOrders) {
|
|
|
- CarWaybillVo carWaybillVo = new CarWaybillVo();
|
|
|
|
|
|
|
+ CarWaybillVO carWaybillVo = new CarWaybillVO();
|
|
|
KwtWaybillOrderTrack track = kwtWaybillOrderTrackMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTrack>()
|
|
KwtWaybillOrderTrack track = kwtWaybillOrderTrackMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTrack>()
|
|
|
.eq(StringUtils.isNotBlank(kwtWaybillOrder.getId()), KwtWaybillOrderTrack::getWOrderId, kwtWaybillOrder.getId()));
|
|
.eq(StringUtils.isNotBlank(kwtWaybillOrder.getId()), KwtWaybillOrderTrack::getWOrderId, kwtWaybillOrder.getId()));
|
|
|
KwtWaybillOrderTicket loadTicket = kwtWaybillOrderTicketMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTicket>()
|
|
KwtWaybillOrderTicket loadTicket = kwtWaybillOrderTicketMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTicket>()
|
|
@@ -150,17 +152,17 @@ public class ConsignOrderService {
|
|
|
return HttpResult.ok(returnList);
|
|
return HttpResult.ok(returnList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public HttpResult getCarListByOrder(OrderDto orderDto) {
|
|
|
|
|
|
|
+ public HttpResult getCarListByOrder(OrderDTO orderDto) {
|
|
|
KwtWaybillOrder waybillOrder = kwtWaybillOrderMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrder>()
|
|
KwtWaybillOrder waybillOrder = kwtWaybillOrderMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrder>()
|
|
|
.eq(KwtWaybillOrder::getLOrderId, orderDto.getId())
|
|
.eq(KwtWaybillOrder::getLOrderId, orderDto.getId())
|
|
|
.eq(KwtWaybillOrder::getEntId, LoginUserHolder.getEntId()));
|
|
.eq(KwtWaybillOrder::getEntId, LoginUserHolder.getEntId()));
|
|
|
List<KwtLogisticsOrderCirculate> list = kwtLogisticsOrderCirculateMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrderCirculate>()
|
|
List<KwtLogisticsOrderCirculate> list = kwtLogisticsOrderCirculateMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrderCirculate>()
|
|
|
.eq(KwtLogisticsOrderCirculate::getLOrderId, orderDto.getId())
|
|
.eq(KwtLogisticsOrderCirculate::getLOrderId, orderDto.getId())
|
|
|
.eq(KwtLogisticsOrderCirculate::getEntId, LoginUserHolder.getEntId()));
|
|
.eq(KwtLogisticsOrderCirculate::getEntId, LoginUserHolder.getEntId()));
|
|
|
- List<CarDataVo> carDataVos = new ArrayList<CarDataVo>();
|
|
|
|
|
|
|
+ List<CarDataVO> carDataVOS = new ArrayList<CarDataVO>();
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
for (KwtLogisticsOrderCirculate circulate : list) {
|
|
for (KwtLogisticsOrderCirculate circulate : list) {
|
|
|
- CarDataVo carDataVo = new CarDataVo();
|
|
|
|
|
|
|
+ CarDataVO carDataVo = new CarDataVO();
|
|
|
//todo dubbo查询
|
|
//todo dubbo查询
|
|
|
// circulate.getDriverId() ;
|
|
// circulate.getDriverId() ;
|
|
|
// carDataVo.setDriverName();
|
|
// carDataVo.setDriverName();
|
|
@@ -169,9 +171,32 @@ public class ConsignOrderService {
|
|
|
// carDataVo.getLoadAmount();
|
|
// carDataVo.getLoadAmount();
|
|
|
carDataVo.setTruckNo(circulate.getTruckNo());
|
|
carDataVo.setTruckNo(circulate.getTruckNo());
|
|
|
carDataVo.setWOrderNo(waybillOrder.getWOrderNo());
|
|
carDataVo.setWOrderNo(waybillOrder.getWOrderNo());
|
|
|
- carDataVos.add(carDataVo);
|
|
|
|
|
|
|
+ carDataVOS.add(carDataVo);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return HttpResult.ok(carDataVos);
|
|
|
|
|
|
|
+ return HttpResult.ok(carDataVOS);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ public HttpResult cancelConsign(OrderDTO orderDto) {
|
|
|
|
|
+ log.info("订单-撤销托运请求参数:{}", JSONObject.toJSONString(orderDto));
|
|
|
|
|
+ HttpResult result = new HttpResult();
|
|
|
|
|
+ KwtLogisticsOrder logisticsOrder = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
|
|
|
|
|
+ .eq(KwtLogisticsOrder::getId, orderDto.getId())
|
|
|
|
|
+ .eq(KwtLogisticsOrder::getLOrderNo, orderDto.getOrderNo())
|
|
|
|
|
+ .eq(KwtLogisticsOrder::getEntId, LoginUserHolder.getEntId()));
|
|
|
|
|
+ if (logisticsOrder == null) {
|
|
|
|
|
+ result.setMsg("单据不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ /**以此字段判别是否存在分包操作*/
|
|
|
|
|
+ if (logisticsOrder.getPid()==null){//撤销数据回归到贸易订单
|
|
|
|
|
+ //并不属于被分包
|
|
|
|
|
+ //待接单状态下才能撤销托运
|
|
|
|
|
+ //
|
|
|
|
|
+
|
|
|
|
|
+ }else {
|
|
|
|
|
+ //即代表存在分包,当次是属于被分包.需要将数据回归到上游数据。
|
|
|
|
|
+ }
|
|
|
|
|
+ return result;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|