|
@@ -5,14 +5,11 @@ import com.pj.api.dto.EnterpriseDto;
|
|
|
import com.pj.api.dto.GoodsTransitDto;
|
|
|
import com.pj.api.dto.OrderDto;
|
|
|
import com.pj.common.core.exception.ServiceException;
|
|
|
-import com.pj.current.dto.APPLoginUserInfo;
|
|
|
import com.pj.current.satoken.StpAPPUserUtil;
|
|
|
import com.pj.enummj.DeleteStatus;
|
|
|
import com.pj.project.tb_car_record.TbCarRecord;
|
|
|
import com.pj.project.tb_car_record.TbCarRecordMapper;
|
|
|
-import com.pj.project.tb_logistics.TbLogistics;
|
|
|
import com.pj.project.tb_logistics.TbLogisticsMapper;
|
|
|
-import com.pj.project.tb_vehicle.param.SucessDriverResultParam;
|
|
|
import com.pj.project.tb_vehicle.param.MakeCarRecordParam;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFCell;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
@@ -42,10 +39,7 @@ public class MethodVehicleService {
|
|
|
private TbVehicleService tbVehicleService;
|
|
|
@Autowired
|
|
|
private TbVehicleMapper tbVehicleMapper;
|
|
|
- @Autowired
|
|
|
- private TbLogisticsMapper tbLogisticsMapper;
|
|
|
- @Autowired
|
|
|
- private TbCarRecordMapper tbCarRecordMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private LevelOneServerInterface levelOneServerInterface;
|
|
|
|
|
@@ -56,6 +50,8 @@ public class MethodVehicleService {
|
|
|
//数据拷贝
|
|
|
BeanUtils.copyProperties(makeCarRecordParam,carRecord);
|
|
|
//获取先决条件
|
|
|
+ TbVehicle tbVehicle = tbVehicleMapper.selectById(makeCarRecordParam.getVehicleId());
|
|
|
+ if(tbVehicle == null)throw new ServiceException("车辆信息有误!");
|
|
|
OrderDto orderDtoById = levelOneServerInterface.getOrderDtoById(makeCarRecordParam.getOrderId());
|
|
|
if(orderDtoById == null)throw new ServiceException("一级市场订单信息异常!");
|
|
|
GoodsTransitDto goodsTransitById = levelOneServerInterface.getGoodsTransitById(orderDtoById.getGoodsId(), orderDtoById.getEnterpriseId());
|
|
@@ -63,6 +59,8 @@ public class MethodVehicleService {
|
|
|
EnterpriseDto enterpriseById = levelOneServerInterface.getEnterpriseById(makeCarRecordParam.getEnterpriseId());
|
|
|
if(enterpriseById == null)throw new ServiceException("一级市场商户信息错误!");
|
|
|
//赋值基本信息
|
|
|
+ carRecord.setVehicleType(tbVehicle.getVehicleType()); // 车辆类型
|
|
|
+ carRecord.setVehicleModel(tbVehicle.getVehicleModel()); // 车辆品牌型号
|
|
|
carRecord.setGoodsName(goodsTransitById.getGoodsName()); //过审商品名称
|
|
|
carRecord.setGoodsImg(goodsTransitById.getGoodsImg()); // 过审商品图片
|
|
|
carRecord.setGoodsWeight(goodsTransitById.getGrossWeight()); // 过审商品毛重
|
|
@@ -79,53 +77,6 @@ public class MethodVehicleService {
|
|
|
return carRecord;
|
|
|
}
|
|
|
|
|
|
- /** 司机同意 */
|
|
|
- public boolean agree(APPLoginUserInfo appLoginInfo, SucessDriverResultParam driverResultParam){
|
|
|
-
|
|
|
- //叫车表修改状态
|
|
|
- TbCarRecord tbCarRecord = tbCarRecordMapper.selectById(driverResultParam.getCarRecordId());
|
|
|
- if(tbCarRecord == null)throw new ServiceException("服务器繁忙!");
|
|
|
- tbCarRecord.setDriverResult(1); // 同意
|
|
|
- int update = tbCarRecordMapper.updateById(tbCarRecord);
|
|
|
- if(update != 1)throw new RuntimeException("接单失败~");
|
|
|
- //修改车辆状态
|
|
|
- TbVehicle tbVehicle = tbVehicleMapper.selectById(driverResultParam.getVehicleId());
|
|
|
- if(tbVehicle == null)throw new ServiceException("车辆信息异常!");
|
|
|
- tbVehicle.setVehicleStatus(1); // 将状态修改成作业中
|
|
|
- int updateById = tbVehicleMapper.updateById(tbVehicle);
|
|
|
- if(updateById != 1)throw new RuntimeException("车辆状态异常");
|
|
|
- //生成物流信息
|
|
|
- TbLogistics logistics = new TbLogistics();
|
|
|
- //数据拷贝
|
|
|
- BeanUtils.copyProperties(driverResultParam,logistics);
|
|
|
-// logistics.setDeclarationNumber(); //申报订单号
|
|
|
-// logistics.setPrepare(); //订单待确认(0=待确认,1=订单已确认,2=订单确认失败)[j switch=true]
|
|
|
- logistics.setPrepareTime(new Date()); // 确认接单时间
|
|
|
- logistics.setLoading(0); //装货状态0,默认待装货
|
|
|
-// logistics.setLoadingTime(); // 装货时间
|
|
|
- logistics.setDelivery(0); // 发货状态,默认未发货
|
|
|
-// logistics.setDeliveryTime(); // 发货时间
|
|
|
- logistics.setClearedCustom(0); // 海关状态0, 默认未出海关
|
|
|
-// logistics.setClearedCustomTime(); // 出海关时间
|
|
|
- logistics.setMakeCargo(1); // 接货人确定接货(0=禁用,1=启用)[j switch=true]
|
|
|
- logistics.setMakeCargoTime(null); // 接货完成时间
|
|
|
- logistics.setConfirmReceipt(1); // 收购商确认(0=禁用,1=启用)[j switch=true]
|
|
|
- logistics.setConfirmReceiptTime(null); // 收货方确认时间(相当于订单完成时间)
|
|
|
- logistics.setOrderFinish(0); // 订单完成状态, 默认未完成
|
|
|
-
|
|
|
- //设置基本字段属性
|
|
|
- logistics.setCreateBy(appLoginInfo.getLoginId());
|
|
|
- logistics.setCreateName(appLoginInfo.getLoginName());
|
|
|
- logistics.setCreateTime(new Date());
|
|
|
- logistics.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode()); // 默认可用
|
|
|
-
|
|
|
- //保存物流信息
|
|
|
- int insert = tbLogisticsMapper.insert(logistics);
|
|
|
- if(insert != 1)throw new RuntimeException("物流信息保存异常!");
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
|
|
|
|