|
|
@@ -1017,8 +1017,21 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
|
|
|
public void transferOfOrder(Long userId, RiderTransferOrderDTO transferOrderDTO) {
|
|
|
// 获取待转单
|
|
|
TbIndent indent = getTransferOrder(userId, transferOrderDTO);
|
|
|
+ UserEntity indentuserEntity = userService.selectUserById(indent.getRiderUserId());
|
|
|
+ if(indentuserEntity == null){
|
|
|
+ throw new SqxException("订单骑手已失效,无法发起转单!");
|
|
|
+ }
|
|
|
+
|
|
|
// 获取新的骑手
|
|
|
UserEntity userEntity = getNewRicher(userId, transferOrderDTO);
|
|
|
+ if(userEntity == null){
|
|
|
+ throw new SqxException("被转单骑手已失效,无法发起转单!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(userEntity.getRiderStationId().intValue() != indentuserEntity.getRiderStationId().intValue()){
|
|
|
+ throw new SqxException("无法选择其他站点骑手进行转单操作!");
|
|
|
+ }
|
|
|
+
|
|
|
// 开始转单
|
|
|
indent.setRiderUserId(userEntity.getUserId());
|
|
|
indent.setIsRider(1);
|