소스 검색

8.11 为了方便物流运输模块信息展示,给订单等添加识别状态

Mechrevo 1 년 전
부모
커밋
0c9ba343cf
16개의 변경된 파일156개의 추가작업 그리고 81개의 파일을 삭제
  1. 4 0
      sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterface.java
  2. 7 0
      sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterfaceFallback.java
  3. 73 58
      sp-core/sp-api/src/main/java/com/pj/api/dto/OrderDto.java
  4. 1 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/MethodGoodsTransitService.java
  5. 5 0
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrder.java
  6. 8 4
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderAppController.java
  7. 1 0
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderMapper.xml
  8. 9 0
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderService.java
  9. 9 1
      sp-service/transport-server/src/main/java/com/pj/project/tb_driver/MethodDriverService.java
  10. 10 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_driver/TbDriverService.java
  11. 3 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_driver/param/FailDriverResultParam.java
  12. 4 8
      sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsAppController.java
  13. 1 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsMapper.xml
  14. 9 8
      sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsService.java
  15. 3 2
      sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/MethodVehicleService.java
  16. 9 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/TbVehicleService.java

+ 4 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterface.java

@@ -22,6 +22,10 @@ import java.util.List;
 )
 public interface LevelOneServerInterface {
 
+    /** 远程调用  修改订单的叫车状态 */
+    @RequestMapping("/app/TbEnterprise/rpc/updateOrderCallCarStatus")
+    public boolean updateOrderCallCarStatus(@RequestBody OrderDto orderDto);
+
     /** 根据ID获取一级市场商户信息 */
     @RequestMapping("/app/TbEnterprise/rpc/getEnterpriseById")
     public EnterpriseDto getEnterpriseById(@RequestParam("enterpriseId")Long enterpriseId);

+ 7 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterfaceFallback.java

@@ -23,6 +23,13 @@ public class LevelOneServerInterfaceFallback implements FallbackFactory<LevelOne
     public LevelOneServerInterface create(Throwable throwable) {
         return new LevelOneServerInterface() {
             @Override
+            public boolean updateOrderCallCarStatus(OrderDto orderDto) {
+                System.out.println(throwable.getMessage());
+                log.error("查询一级市场商户错误,当前对象:{},错误信息是:{}",orderDto.toString(),throwable.getMessage());
+                return false;
+            }
+
+            @Override
             public EnterpriseDto getEnterpriseById(Long enterpriseId) {
                 System.out.println(throwable.getMessage());
                 log.error("查询一级市场商户错误,当前ID:{},错误信息是:{}",enterpriseId,throwable.getMessage());

+ 73 - 58
sp-core/sp-api/src/main/java/com/pj/api/dto/OrderDto.java

@@ -26,64 +26,6 @@ public class OrderDto {
     public OrderDto() {
     }
 
-    public OrderDto(Integer cancelPeople, Long id, Long tradeAreaId, String tradeAreaName, String addressIds, Long saleMainId, Long groupId, Long goodsId, String tradeNo, Long buyUserId, String buyUserName, String buyUserType, Long enterpriseId, String enterpriseName, Double totalWeight, Double totalPrice, Date tradeTime, Integer tradeStatus, String payType, String settleTime, Double realPrice, Double shouldPrice, Long settleUserId, Long recordUserId, String recordTime, String record, String refundReason, String refundTime, String receiveName, String receivePhone, String receiveAddress, String outTime, String goodsNames, Integer apply, String applyTime, String applyResult, String applyFailReason, String distribution, Integer peopleConfirm, Integer enterpriseConfirm, String pick, Date pickTime, Long shopId, String shopName, Integer send, String sendTime, Long levelTwoOrderId, Date createTime, Long createBy, String createName, Date updateTime, Long updateBy, String updateName, Integer deleteStatus, Integer finishStatus, Integer resaleStatus) {
-        this.cancelPeople = cancelPeople;
-        this.id = id;
-        this.tradeAreaId = tradeAreaId;
-        this.tradeAreaName = tradeAreaName;
-        this.addressIds = addressIds;
-        this.saleMainId = saleMainId;
-        this.groupId = groupId;
-        this.goodsId = goodsId;
-        this.tradeNo = tradeNo;
-        this.buyUserId = buyUserId;
-        this.buyUserName = buyUserName;
-        this.buyUserType = buyUserType;
-        this.enterpriseId = enterpriseId;
-        this.enterpriseName = enterpriseName;
-        this.totalWeight = totalWeight;
-        this.totalPrice = totalPrice;
-        this.tradeTime = tradeTime;
-        this.tradeStatus = tradeStatus;
-        this.payType = payType;
-        this.settleTime = settleTime;
-        this.realPrice = realPrice;
-        this.shouldPrice = shouldPrice;
-        this.settleUserId = settleUserId;
-        this.recordUserId = recordUserId;
-        this.recordTime = recordTime;
-        this.record = record;
-        this.refundReason = refundReason;
-        this.refundTime = refundTime;
-        this.receiveName = receiveName;
-        this.receivePhone = receivePhone;
-        this.receiveAddress = receiveAddress;
-        this.outTime = outTime;
-        this.goodsNames = goodsNames;
-        this.apply = apply;
-        this.applyTime = applyTime;
-        this.applyResult = applyResult;
-        this.applyFailReason = applyFailReason;
-        this.distribution = distribution;
-        this.peopleConfirm = peopleConfirm;
-        this.enterpriseConfirm = enterpriseConfirm;
-        this.pick = pick;
-        this.pickTime = pickTime;
-        this.shopId = shopId;
-        this.shopName = shopName;
-        this.send = send;
-        this.sendTime = sendTime;
-        this.levelTwoOrderId = levelTwoOrderId;
-        this.createTime = createTime;
-        this.createBy = createBy;
-        this.createName = createName;
-        this.updateTime = updateTime;
-        this.updateBy = updateBy;
-        this.updateName = updateName;
-        this.deleteStatus = deleteStatus;
-        this.finishStatus = finishStatus;
-        this.resaleStatus = resaleStatus;
-    }
 
     private Long id;
 
@@ -188,6 +130,79 @@ public class OrderDto {
     private Double shouldPrice;
 
     /**
+     * 叫车状态[默认是0=待叫车,1=已叫车,2=完成叫车]
+     */
+    private Integer callCarStatus;
+
+    public Integer getCallCarStatus() {
+        return callCarStatus;
+    }
+
+    public void setCallCarStatus(Integer callCarStatus) {
+        this.callCarStatus = callCarStatus;
+    }
+
+    public OrderDto(Integer cancelPeople, Long id, Long tradeAreaId, String tradeAreaName, String addressIds, Long saleMainId, Long groupId, Long goodsId, String tradeNo, Long buyUserId, String buyUserName, String buyUserType, Long enterpriseId, String enterpriseName, Double totalWeight, Double totalPrice, Date tradeTime, Integer tradeStatus, String payType, String settleTime, Double realPrice, Double shouldPrice, Integer callCarStatus, Long settleUserId, Long recordUserId, String recordTime, String record, String refundReason, String refundTime, String receiveName, String receivePhone, String receiveAddress, String outTime, String goodsNames, Integer apply, String applyTime, String applyResult, String applyFailReason, String distribution, Integer peopleConfirm, Integer enterpriseConfirm, String pick, Date pickTime, Long shopId, String shopName, Integer send, String sendTime, Long levelTwoOrderId, Date createTime, Long createBy, String createName, Date updateTime, Long updateBy, String updateName, Integer deleteStatus, Integer finishStatus, Integer resaleStatus) {
+        this.cancelPeople = cancelPeople;
+        this.id = id;
+        this.tradeAreaId = tradeAreaId;
+        this.tradeAreaName = tradeAreaName;
+        this.addressIds = addressIds;
+        this.saleMainId = saleMainId;
+        this.groupId = groupId;
+        this.goodsId = goodsId;
+        this.tradeNo = tradeNo;
+        this.buyUserId = buyUserId;
+        this.buyUserName = buyUserName;
+        this.buyUserType = buyUserType;
+        this.enterpriseId = enterpriseId;
+        this.enterpriseName = enterpriseName;
+        this.totalWeight = totalWeight;
+        this.totalPrice = totalPrice;
+        this.tradeTime = tradeTime;
+        this.tradeStatus = tradeStatus;
+        this.payType = payType;
+        this.settleTime = settleTime;
+        this.realPrice = realPrice;
+        this.shouldPrice = shouldPrice;
+        this.callCarStatus = callCarStatus;
+        this.settleUserId = settleUserId;
+        this.recordUserId = recordUserId;
+        this.recordTime = recordTime;
+        this.record = record;
+        this.refundReason = refundReason;
+        this.refundTime = refundTime;
+        this.receiveName = receiveName;
+        this.receivePhone = receivePhone;
+        this.receiveAddress = receiveAddress;
+        this.outTime = outTime;
+        this.goodsNames = goodsNames;
+        this.apply = apply;
+        this.applyTime = applyTime;
+        this.applyResult = applyResult;
+        this.applyFailReason = applyFailReason;
+        this.distribution = distribution;
+        this.peopleConfirm = peopleConfirm;
+        this.enterpriseConfirm = enterpriseConfirm;
+        this.pick = pick;
+        this.pickTime = pickTime;
+        this.shopId = shopId;
+        this.shopName = shopName;
+        this.send = send;
+        this.sendTime = sendTime;
+        this.levelTwoOrderId = levelTwoOrderId;
+        this.createTime = createTime;
+        this.createBy = createBy;
+        this.createName = createName;
+        this.updateTime = updateTime;
+        this.updateBy = updateBy;
+        this.updateName = updateName;
+        this.deleteStatus = deleteStatus;
+        this.finishStatus = finishStatus;
+        this.resaleStatus = resaleStatus;
+    }
+
+    /**
      * 对账人
      */
     private Long settleUserId;

+ 1 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/MethodGoodsTransitService.java

@@ -116,6 +116,7 @@ public class MethodGoodsTransitService {
         tbOrder.setBuyUserId(tbPeopleList.get(0).getId());
         tbOrder.setBuyUserType(2 + "");
         tbOrder.setBuyUserName(appLoginInfo.getLoginName());
+        tbOrder.setCallCarStatus(0); // 叫车状态,默认未叫车
         tbOrder.setEnterpriseId(Long.valueOf(tbGoodsTransit.getMerchantId()));
         tbOrder.setEnterpriseName(tbGoodsTransit.getMerchantName());
         tbOrder.setTotalWeight(tbGoodsTransit.getGrossWeight());

+ 5 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrder.java

@@ -330,6 +330,11 @@ public class TbOrder extends Model<TbOrder> implements Serializable {
 	 */
 	private Integer resaleStatus;
 
+	/**
+	 * 叫车状态[默认是0=待叫车,1=已叫车,2=完成叫车]
+	 */
+	private Integer callCarStatus;
+
 
 	/**
 	 * 商品单位

+ 8 - 4
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderAppController.java

@@ -5,10 +5,7 @@ import com.pj.project4sp.SP;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
 import java.util.List;
@@ -124,5 +121,12 @@ public class TbOrderAppController {
 		return t;
 	}
 
+	/** 远程调用  修改订单的叫车状态 */
+	@RequestMapping("rpc/updateOrderCallCarStatus")
+	public boolean updateOrderCallCarStatus(@RequestBody OrderDto orderDto){
+		boolean b = tbOrderService.updateOrderCallCarStatus(orderDto);
+		return b;
+	}
+
 
 }

+ 1 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderMapper.xml

@@ -29,6 +29,7 @@
 		<where>
 			<if test=' this.has("id") '> and id = #{id} </if>
 			<if test=' this.has("tradeAreaId") '> and trade_area_id = #{tradeAreaId} </if>
+			<if test=' this.has("callCarStatus") '> and call_car_status = #{callCarStatus} </if>
 			<if test=' this.has("finishStatus") '> and finish_status = #{finishStatus} </if>
 			<if test=' this.has("cancelPeople") '> and cancel_people = #{cancelPeople} </if>
 			<if test=' this.has("groupId") '> and group_id = #{groupId} </if>

+ 9 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderService.java

@@ -274,4 +274,13 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 		return orderDto;
 	}
 
+	/** 远程调用  修改订单的叫车状态 */
+	public boolean updateOrderCallCarStatus(OrderDto orderDto){
+		TbOrder tbOrder = new TbOrder();
+		BeanUtils.copyProperties(orderDto,tbOrder);
+		int update = tbOrderMapper.updateById(tbOrder);
+		System.out.println("finish update order call_car_status");
+		return update == 1;
+	}
+
 }

+ 9 - 1
sp-service/transport-server/src/main/java/com/pj/project/tb_driver/MethodDriverService.java

@@ -1,5 +1,7 @@
 package com.pj.project.tb_driver;
 
+import com.pj.api.client.level_one_server.LevelOneServerInterface;
+import com.pj.api.dto.OrderDto;
 import com.pj.common.core.exception.ServiceException;
 import com.pj.current.dto.APPLoginUserInfo;
 import com.pj.enummj.DeleteStatus;
@@ -46,10 +48,11 @@ public class MethodDriverService {
     @Autowired
     private TbVehicleMapper tbVehicleMapper;
 
+    @Autowired
+    private LevelOneServerInterface levelOneServerInterface;
     /** 司机同意 */
     public boolean agree(APPLoginUserInfo appLoginInfo, SucessDriverResultParam driverResultParam){
 
-        //叫车表修改状态
         TbCarRecord tbCarRecord = tbCarRecordMapper.selectById(driverResultParam.getCarRecordId());
         if(tbCarRecord == null)throw new ServiceException("服务器繁忙!");
         tbCarRecord.setDriverResult(1); // 同意
@@ -61,6 +64,11 @@ public class MethodDriverService {
         tbVehicle.setVehicleStatus(1); // 将状态修改成作业中
         int updateById = tbVehicleMapper.updateById(tbVehicle);
         if(updateById != 1)throw new RuntimeException("车辆状态异常");
+        //修改一级订单表叫车状态
+        OrderDto orderDto = levelOneServerInterface.getOrderDtoById(driverResultParam.getLevelOneOrderId());
+        orderDto.setCallCarStatus(2); // 2=已完成叫车
+        boolean b = levelOneServerInterface.updateOrderCallCarStatus(orderDto);
+        if(!b)throw new ServiceException("一级市场订单表状态异常!");
         //生成物流信息
         TbLogistics logistics = new TbLogistics();
         //数据拷贝

+ 10 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_driver/TbDriverService.java

@@ -7,7 +7,9 @@ import java.time.format.DateTimeFormatter;
 import java.util.List;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.pj.api.client.level_one_server.LevelOneServerInterface;
 import com.pj.api.dto.DriverDto;
+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;
@@ -46,6 +48,9 @@ public class TbDriverService extends ServiceImpl<TbDriverMapper, TbDriver> imple
 	@Autowired
 	private MethodDriverService methodDriverService;
 
+	@Autowired
+	private LevelOneServerInterface levelOneServerInterface;
+
 
 	/** 增 */
 	void add(TbDriver t){
@@ -104,6 +109,11 @@ public class TbDriverService extends ServiceImpl<TbDriverMapper, TbDriver> imple
 		//执行保存
 		int i = tbCarRecordMapper.updateById(tbCarRecord);
 		if(i == 1){
+			//修改一级订单表叫车状态
+			OrderDto orderDto = levelOneServerInterface.getOrderDtoById(failDriverResultParam.getLevelOneOrderId());
+			orderDto.setCallCarStatus(0); // 修改成未叫车状态
+			boolean b = levelOneServerInterface.updateOrderCallCarStatus(orderDto);
+			if(!b)throw new ServiceException("一级市场订单表状态异常!");
 			//todo:司机拒绝,发送通知短信给收购商
 //		smsRetryService.sendSmsMsg(failDriverResultParam.getEnterprisePhone());
 		}

+ 3 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_driver/param/FailDriverResultParam.java

@@ -14,6 +14,9 @@ public class FailDriverResultParam {
     @NotNull(message = "叫车记录表主键")
     private Long carRecordId;
 
+    @NotNull(message = "叫车记录表主键")
+    private Long levelOneOrderId;
+
 //    @NotNull(message = "一级市场商户主键不为空")
 //    private Long enterpriseId;
 

+ 4 - 8
sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsAppController.java

@@ -27,7 +27,6 @@ public class TbLogisticsAppController {
 
 	/** 查 - 根据id */
 	@RequestMapping("getById")
-		@SaCheckPermission(TbLogistics.PERMISSION_CODE)
 	public AjaxJson getById(Long id){
 		TbLogistics t = tbLogisticsService.getById(id);
 		return AjaxJson.getSuccessData(t);
@@ -35,7 +34,6 @@ public class TbLogisticsAppController {
 
 	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
 	@RequestMapping("getList")
-		@SaCheckPermission(TbLogistics.PERMISSION_CODE)
 	public AjaxJson getList() {
 		SoMap so = SoMap.getRequestSoMap();
 		List<TbLogistics> list = tbLogisticsService.getList(so.startPage());
@@ -45,7 +43,6 @@ public class TbLogisticsAppController {
 
 	/** 增 二级市场订单选择车辆时触发,物流订单在此传入并绑定二级市场订单号*/
 	@RequestMapping("saveLogisticOrder")
-	@SaCheckPermission(TbLogistics.PERMISSION_CODE_ADD)
 	public AjaxJson saveLogisticOrder(TbLogisticsDto logisticsDto) {
 		boolean result = tbLogisticsService.saveLogisticOrder(logisticsDto);
 		if(result) return AjaxJson.getSuccess();
@@ -55,7 +52,6 @@ public class TbLogisticsAppController {
 
 	/** 改 根据物流订单Id,修改物流状态*/
 	@RequestMapping("updateLogisticStatus")
-	@SaCheckPermission(TbLogistics.PERMISSION_CODE_EDIT)
 	public AjaxJson updateLogisticStatus(TbLogisticsDto logisticsDto) {
 		boolean result = tbLogisticsService.saveLogisticOrder(logisticsDto);
 		if(result) return AjaxJson.getSuccess();
@@ -64,10 +60,10 @@ public class TbLogisticsAppController {
 	}
 
 	/** 查 通过司机Id查物流订单 */
-	@RequestMapping("selectByDriverId")
-	@SaCheckPermission(TbLogistics.PERMISSION_CODE)
-	public AjaxJson selectByDriverId(Long driverId) {
-		List<TbLogistics> list = tbLogisticsService.selectByDriverId(driverId);
+	@RequestMapping("getAppList")
+	public AjaxJson selectByDriverId() {
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbLogistics> list = tbLogisticsService.selectByDriverId(so.startPage());
 		return AjaxJson.getPageData(Long.valueOf(list.size()), list);
 	}
 

+ 1 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsMapper.xml

@@ -24,6 +24,7 @@
 		<where>
 			<if test=' this.has("id") '> and id = #{id} </if>
 			<if test=' this.has("ordersId") '> and orders_id = #{ordersId} </if>
+			<if test=' this.has("driverId") '> and driver_id = #{driverId} </if>
 			<if test=' this.has("declarationNumber") '> and declaration_number = #{declarationNumber} </if>
 			<if test=' this.has("prepare") '> and prepare = #{prepare} </if>
 			<if test=' this.has("prepareTime") '> and prepare_time = #{prepareTime} </if>

+ 9 - 8
sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsService.java

@@ -163,13 +163,14 @@ public class TbLogisticsService extends ServiceImpl<TbLogisticsMapper, TbLogisti
 	}
 
 	/** 查 通过司机Id查物流订单 */
-	List<TbLogistics> selectByDriverId(Long driverId) {
-		List<TbLogistics> tbLogistics = tbLogisticsMapper.selectList(
-				new LambdaQueryWrapper<TbLogistics>()
-						.eq(TbLogistics::getDriverId, driverId)
-						.eq(TbLogistics::getDeleteStatus, DeleteStatus.DELETE_STATUS_ON.getCode()));
-		if(tbLogistics.size() == 0)return null;
-
-		return tbLogistics;
+	List<TbLogistics> selectByDriverId(SoMap soMap) {
+		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
+		if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
+			throw new SecurityException("当前登录账号信息已失效,请检查!");
+		//查询条件
+		soMap.put("driverId",appLoginInfo.getFk());
+		soMap.put("deleteStatus",DeleteStatus.DELETE_STATUS_ON.getCode());
+		soMap.set("sortType",17);
+		return tbLogisticsMapper.getList(soMap);
 	}
 }

+ 3 - 2
sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/MethodVehicleService.java

@@ -8,8 +8,6 @@ import com.pj.common.core.exception.ServiceException;
 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.TbLogisticsMapper;
 import com.pj.project.tb_vehicle.param.MakeCarRecordParam;
 import org.apache.poi.hssf.usermodel.HSSFCell;
 import org.apache.poi.hssf.usermodel.HSSFRow;
@@ -58,6 +56,9 @@ public class MethodVehicleService {
         if(goodsTransitById == null)throw new ServiceException("商品信息异常!");
         EnterpriseDto enterpriseById = levelOneServerInterface.getEnterpriseById(makeCarRecordParam.getEnterpriseId());
         if(enterpriseById == null)throw new ServiceException("一级市场商户信息错误!");
+        //将订单状态修改成正在叫车
+        boolean carStatus = levelOneServerInterface.updateOrderCallCarStatus(orderDtoById);
+        if(!carStatus)throw new ServiceException("叫车状态修改异常!");
         //赋值基本信息
         carRecord.setVehicleType(tbVehicle.getVehicleType()); // 车辆类型
         carRecord.setVehicleModel(tbVehicle.getVehicleModel());  // 车辆品牌型号

+ 9 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/TbVehicleService.java

@@ -10,6 +10,7 @@ import java.util.List;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.pj.api.client.level_one_server.LevelOneServerInterface;
+import com.pj.api.dto.OrderDto;
 import com.pj.common.core.exception.ServiceException;
 import com.pj.enummj.DeleteStatus;
 import com.pj.project.tb_car_record.TbCarRecord;
@@ -138,6 +139,14 @@ public class TbVehicleService extends ServiceImpl<TbVehicleMapper, TbVehicle> im
 		//创建叫车记录
 		TbCarRecord tbCarRecord = methodVehicleService.makeCarRecord(makeCarRecordParam);
 		int insert = tbCarRecordMapper.insert(tbCarRecord);
+
+		if(insert == 1){
+			//修改一级订单表叫车状态
+			OrderDto orderDto = levelOneServerInterface.getOrderDtoById(makeCarRecordParam.getOrderId());
+			orderDto.setCallCarStatus(1); // 1=已叫车状态
+			boolean b = levelOneServerInterface.updateOrderCallCarStatus(orderDto);
+			if(!b)throw new ServiceException("一级市场订单表状态异常!");
+		}
 		return insert == 1;
 	}