|
@@ -1,5 +1,6 @@
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
import com.yh.saas.common.support.util.StringUtils;
|
|
import com.yh.saas.common.support.util.StringUtils;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
@@ -25,6 +26,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, CarrierInfo> implements ICarrierInfoService {
|
|
public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, CarrierInfo> implements ICarrierInfoService {
|
|
@Autowired
|
|
@Autowired
|
|
private IOrderInfoService orderInfoService;
|
|
private IOrderInfoService orderInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICarrierInfoService carrierInfoService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 确认装车
|
|
* 确认装车
|
|
@@ -40,7 +43,7 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, Carri
|
|
//判断暂存提交(前端传参1暂存3提交)
|
|
//判断暂存提交(前端传参1暂存3提交)
|
|
if ("1".equals(carrierInfo.getStatusFlag())) {
|
|
if ("1".equals(carrierInfo.getStatusFlag())) {
|
|
//添加装车信息
|
|
//添加装车信息
|
|
- if(StringUtils.isEmpty(carrierInfo.getId())) {
|
|
|
|
|
|
+ if (StringUtils.isEmpty(carrierInfo.getId())) {
|
|
//新增主键id
|
|
//新增主键id
|
|
carrierInfo.setId(IdGenerator.generateUUID());
|
|
carrierInfo.setId(IdGenerator.generateUUID());
|
|
carrierInfo.setCompId(orderInfo.getCompId());
|
|
carrierInfo.setCompId(orderInfo.getCompId());
|
|
@@ -56,10 +59,9 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, Carri
|
|
else {
|
|
else {
|
|
this.updateById(carrierInfo);
|
|
this.updateById(carrierInfo);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else{
|
|
|
|
|
|
+ } else {
|
|
//添加装车信息
|
|
//添加装车信息
|
|
- if(StringUtils.isEmpty(carrierInfo.getId())) {
|
|
|
|
|
|
+ if (StringUtils.isEmpty(carrierInfo.getId())) {
|
|
//新增主键id
|
|
//新增主键id
|
|
carrierInfo.setId(IdGenerator.generateUUID());
|
|
carrierInfo.setId(IdGenerator.generateUUID());
|
|
carrierInfo.setCompId(orderInfo.getCompId());
|
|
carrierInfo.setCompId(orderInfo.getCompId());
|
|
@@ -74,7 +76,7 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, Carri
|
|
this.insert(carrierInfo);
|
|
this.insert(carrierInfo);
|
|
}
|
|
}
|
|
//编辑装车信息
|
|
//编辑装车信息
|
|
- else{
|
|
|
|
|
|
+ else {
|
|
this.updateById(carrierInfo);
|
|
this.updateById(carrierInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -93,7 +95,7 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, Carri
|
|
if ("1".equals(carrierInfo.getStatusFlag())) {
|
|
if ("1".equals(carrierInfo.getStatusFlag())) {
|
|
this.updateById(carrierInfo);
|
|
this.updateById(carrierInfo);
|
|
}
|
|
}
|
|
- else{
|
|
|
|
|
|
+ else {
|
|
carrierInfo.setStatus(StatusEnum.SUBMITTED.getName());
|
|
carrierInfo.setStatus(StatusEnum.SUBMITTED.getName());
|
|
carrierInfo.setStatusFlag(StatusEnum.SUBMITTED.getFlag());
|
|
carrierInfo.setStatusFlag(StatusEnum.SUBMITTED.getFlag());
|
|
carrierInfo.setUnloadingConfirm(StatusEnum.NOT_LOADING_CONFIRM.getName());
|
|
carrierInfo.setUnloadingConfirm(StatusEnum.NOT_LOADING_CONFIRM.getName());
|
|
@@ -104,4 +106,47 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, Carri
|
|
}
|
|
}
|
|
return "OK";
|
|
return "OK";
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 货主端确认装卸车
|
|
|
|
+ *
|
|
|
|
+ * @param carrierInfo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public String cargoOwnerLoadingAdd(CarrierInfo carrierInfo) {
|
|
|
|
+ //查询订单
|
|
|
|
+ OrderInfo orderInfo = orderInfoService.selectById(carrierInfo.getOrderId());
|
|
|
|
+ //查询承运信息
|
|
|
|
+ CarrierInfo carrierInfo1 = carrierInfoService.selectOne(new EntityWrapper<CarrierInfo>()
|
|
|
|
+ .eq("id",carrierInfo.getId())
|
|
|
|
+ .eq("order_id",carrierInfo.getOrderId()));
|
|
|
|
+ if(carrierInfo1 != null){
|
|
|
|
+ if("1".equals(carrierInfo1.getFlag())){
|
|
|
|
+ if("1".equals(carrierInfo1.getLoadingFlag())){
|
|
|
|
+ carrierInfo1.setLoadingConfirm(StatusEnum.LOADING_CONFIRM.getName());
|
|
|
|
+ carrierInfo1.setLoadingConfirmFlag(StatusEnum.LOADING_CONFIRM.getFlag());
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ carrierInfo1.setUnloadingConfirm(StatusEnum.LOADING_CONFIRM.getName());
|
|
|
|
+ carrierInfo1.setUnloadingConfirmFlag(StatusEnum.LOADING_CONFIRM.getFlag());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ if("2".equals(carrierInfo1.getLoadingFlag())){
|
|
|
|
+ carrierInfo1.setLoadingConfirm(StatusEnum.LOADING_REJECTION.getName());
|
|
|
|
+ carrierInfo1.setLoadingConfirmFlag(StatusEnum.LOADING_REJECTION.getFlag());
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ carrierInfo1.setUnloadingConfirm(StatusEnum.LOADING_REJECTION.getName());
|
|
|
|
+ carrierInfo1.setUnloadingConfirmFlag(StatusEnum.LOADING_REJECTION.getFlag());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.updateById(carrierInfo1);
|
|
|
|
+ //更改订单状态
|
|
|
|
+ orderInfo.setOrderStatus(StatusEnum.DRIVER_ORDER_SETTLEMENT.getName());
|
|
|
|
+ orderInfo.setOrderStatusKey(StatusEnum.DRIVER_ORDER_SETTLEMENT.getFlag());
|
|
|
|
+ orderInfoService.updateById(orderInfo);
|
|
|
|
+ }
|
|
|
|
+ return "OK";
|
|
|
|
+ }
|
|
}
|
|
}
|