|
@@ -11,6 +11,7 @@ import com.yh.saas.plugin.yiliangyiyun.service.*;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
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 java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
@@ -37,6 +38,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
private ICommonUserService commonUserService;
|
|
private ICommonUserService commonUserService;
|
|
@Autowired
|
|
@Autowired
|
|
private INewsInfoService newsInfoService;
|
|
private INewsInfoService newsInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IRepaymentInfoService repaymentInfoService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 司机订单列表
|
|
* 司机订单列表
|
|
@@ -127,12 +130,23 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
if(freightInfo != null){
|
|
if(freightInfo != null){
|
|
orderInfo.setFreightInfo(freightInfo);
|
|
orderInfo.setFreightInfo(freightInfo);
|
|
}
|
|
}
|
|
|
|
+ //还款信息
|
|
|
|
+ RepaymentInfo repaymentInfo = repaymentInfoService.selectOne(new EntityWrapper<RepaymentInfo>().eq(RepaymentInfo.QueryFiles.ORDER_ID,id));
|
|
|
|
+ if(repaymentInfo != null){
|
|
|
|
+ orderInfo.setRepaymentInfo(repaymentInfo);
|
|
|
|
+ }
|
|
//查询货主头像
|
|
//查询货主头像
|
|
CommonUser commonUser = commonUserService.selectOne(new EntityWrapper<CommonUser>()
|
|
CommonUser commonUser = commonUserService.selectOne(new EntityWrapper<CommonUser>()
|
|
.eq("id",orderInfo.getCargoCommonId()));
|
|
.eq("id",orderInfo.getCargoCommonId()));
|
|
if(commonUser != null){
|
|
if(commonUser != null){
|
|
orderInfo.setCargoOwnerPortrait(commonUser.getAvatarUrl());
|
|
orderInfo.setCargoOwnerPortrait(commonUser.getAvatarUrl());
|
|
}
|
|
}
|
|
|
|
+ //查询司机头像
|
|
|
|
+ CommonUser commonUser1 = commonUserService.selectOne(new EntityWrapper<CommonUser>()
|
|
|
|
+ .eq("id",orderInfo.getCommonId()));
|
|
|
|
+ if(commonUser1 != null){
|
|
|
|
+ orderInfo.setDriverPortrait(commonUser1.getAvatarUrl());
|
|
|
|
+ }
|
|
return orderInfo;
|
|
return orderInfo;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -142,6 +156,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public String end (OrderInfo orderInfo){
|
|
public String end (OrderInfo orderInfo){
|
|
//查询订单
|
|
//查询订单
|
|
OrderInfo orderInfo1 = this.selectById(orderInfo.getId());
|
|
OrderInfo orderInfo1 = this.selectById(orderInfo.getId());
|
|
@@ -246,7 +261,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
OrderInfo orderInfo1 = this.selectById(orderInfo.getId());
|
|
OrderInfo orderInfo1 = this.selectById(orderInfo.getId());
|
|
if(orderInfo1 != null){
|
|
if(orderInfo1 != null){
|
|
//接单
|
|
//接单
|
|
- if("1".equals(orderInfo1.getFlag())){
|
|
|
|
|
|
+ if("1".equals(orderInfo.getFlag())){
|
|
//司机端和货主端订单状态改为未装车
|
|
//司机端和货主端订单状态改为未装车
|
|
orderInfo1.setOrderStatusKey(StatusEnum.DRIVER_ORDER_LOADING.getFlag());
|
|
orderInfo1.setOrderStatusKey(StatusEnum.DRIVER_ORDER_LOADING.getFlag());
|
|
orderInfo1.setOrderStatus(StatusEnum.DRIVER_ORDER_LOADING.getName());
|
|
orderInfo1.setOrderStatus(StatusEnum.DRIVER_ORDER_LOADING.getName());
|
|
@@ -255,6 +270,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
//新增消息
|
|
//新增消息
|
|
NewsInfo newsInfo = new NewsInfo();
|
|
NewsInfo newsInfo = new NewsInfo();
|
|
newsInfo.setNumber(orderInfo1.getOrderNo());
|
|
newsInfo.setNumber(orderInfo1.getOrderNo());
|
|
|
|
+ newsInfo.setBussId(orderInfo1.getId());
|
|
newsInfo.setCrtCommonId(orderInfo1.getCargoCommonId());
|
|
newsInfo.setCrtCommonId(orderInfo1.getCargoCommonId());
|
|
newsInfo.setReCommonId(orderInfo1.getCommonId());
|
|
newsInfo.setReCommonId(orderInfo1.getCommonId());
|
|
newsInfo.setNewsContent("订单编号" + orderInfo1.getOrderNo() + "货主已接单");
|
|
newsInfo.setNewsContent("订单编号" + orderInfo1.getOrderNo() + "货主已接单");
|
|
@@ -269,6 +285,16 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
orderInfo1.setOrderStatus(StatusEnum.DRIVER_ORDER_END.getName());
|
|
orderInfo1.setOrderStatus(StatusEnum.DRIVER_ORDER_END.getName());
|
|
orderInfo1.setCargoOwnerStatusKey(StatusEnum.OWNER_ORDER_END.getFlag());
|
|
orderInfo1.setCargoOwnerStatusKey(StatusEnum.OWNER_ORDER_END.getFlag());
|
|
orderInfo1.setCargoOwnerStatus(StatusEnum.OWNER_ORDER_END.getName());
|
|
orderInfo1.setCargoOwnerStatus(StatusEnum.OWNER_ORDER_END.getName());
|
|
|
|
+ //新增消息
|
|
|
|
+ NewsInfo newsInfo = new NewsInfo();
|
|
|
|
+ newsInfo.setNumber(orderInfo1.getOrderNo());
|
|
|
|
+ newsInfo.setBussId(orderInfo1.getId());
|
|
|
|
+ newsInfo.setCrtCommonId(orderInfo1.getCargoCommonId());
|
|
|
|
+ newsInfo.setReCommonId(orderInfo1.getCommonId());
|
|
|
|
+ newsInfo.setNewsContent("订单编号" + orderInfo1.getOrderNo() + "货主已拒单");
|
|
|
|
+ newsInfo.setNewsTypeKey("2");
|
|
|
|
+ newsInfo.setNewsType("承运通知");
|
|
|
|
+ newsInfoService.addNewsInfo(newsInfo);
|
|
}
|
|
}
|
|
this.updateById(orderInfo1);
|
|
this.updateById(orderInfo1);
|
|
}
|
|
}
|