浏览代码

8.9 商家叫车,司机接单,记录其信息

Mechrevo 2 年之前
父节点
当前提交
a9c9d14ecf
共有 21 个文件被更改,包括 1219 次插入59 次删除
  1. 10 2
      sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterface.java
  2. 17 3
      sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterfaceFallback.java
  3. 459 0
      sp-core/sp-api/src/main/java/com/pj/api/dto/GoodsTransitDto.java
  4. 11 0
      sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseAppController.java
  5. 9 0
      sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseService.java
  6. 12 6
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/GoodsTransitAppController.java
  7. 9 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/TbGoodsTransitService.java
  8. 2 2
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderAppController.java
  9. 80 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/AppCarRecordController.java
  10. 151 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecord.java
  11. 85 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecordController.java
  12. 30 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecordMapper.java
  13. 77 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecordMapper.xml
  14. 66 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecordService.java
  15. 27 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecordUtil.java
  16. 53 12
      sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/MethodVehicleService.java
  17. 10 11
      sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/TbVehicleAppController.java
  18. 28 19
      sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/TbVehicleService.java
  19. 23 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/param/FailDriverResultParam.java
  20. 56 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/param/MakeCarRecordParam.java
  21. 4 4
      sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/param/SucessDriverResultParam.java

+ 10 - 2
sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterface.java

@@ -22,9 +22,17 @@ import java.util.List;
 )
 public interface LevelOneServerInterface {
 
+    /** 根据ID获取一级市场商户信息 */
+    @RequestMapping("/app/TbEnterprise/rpc/getEnterpriseById")
+    public EnterpriseDto getEnterpriseById(@RequestParam("enterpriseId")Long enterpriseId);
+
+    /** 根据商户ID和过审商品表ID查询过审商品 */
+    @RequestMapping("/app/TbGoodsTransit/rpc/getGoodsTransitById")
+    public GoodsTransitDto getGoodsTransitById(@RequestParam("goodsTransitId") Long goodsTransitId,@RequestParam("enterpriseId") Long enterpriseId);
+
     /** 查 - 根据id查orderDto */
-    @RequestMapping("rpc/getById")
-    public OrderDto rpcGetById(@RequestParam("orderId") Long orderId);
+    @RequestMapping("/app/TbOrder/rpc/getOrderDtoById")
+    public OrderDto getOrderDtoById(@RequestParam("orderId") Long orderId);
 
     @RequestMapping("/app/TbOrder/rpc/selectOrderList")
     public List<OrderDto> selectOrderList(@RequestParam("currDay") Date currDay, @RequestParam("appUserId") Long appUserId);

+ 17 - 3
sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterfaceFallback.java

@@ -23,16 +23,30 @@ public class LevelOneServerInterfaceFallback implements FallbackFactory<LevelOne
     public LevelOneServerInterface create(Throwable throwable) {
         return new LevelOneServerInterface() {
             @Override
-            public OrderDto rpcGetById(Long orderId) {
+            public EnterpriseDto getEnterpriseById(Long enterpriseId) {
                 System.out.println(throwable.getMessage());
-                log.error("根据一级市场订单错误,当前ID:{},错误信息是:{}",orderId,throwable.getMessage());
+                log.error("查询一级市场商户错误,当前ID:{},错误信息是:{}",enterpriseId,throwable.getMessage());
+                return null;
+            }
+
+            @Override
+            public GoodsTransitDto getGoodsTransitById(Long goodsTransitId, Long enterpriseId) {
+                System.out.println(throwable.getMessage());
+                log.error("查询一级市场过审商品错误,过审商品表ID:{},一级市场商户ID:{},错误信息是:{}",goodsTransitId,enterpriseId,throwable.getMessage());
+                return null;
+            }
+
+            @Override
+            public OrderDto getOrderDtoById(Long orderId) {
+                System.out.println(throwable.getMessage());
+                log.error("查询一级市场订单错误,当前ID:{},错误信息是:{}",orderId,throwable.getMessage());
                 return null;
             }
 
             @Override
             public List<OrderDto> selectOrderList(Date currDay, Long appUserId) {
                 System.out.println(throwable.getMessage());
-                log.error("根据一级市场订单错误,当前日:{},当前用户ID:{},错误信息是:{}",currDay,appUserId,throwable.getMessage());
+                log.error("查询一级市场订单列表错误,当前日:{},当前用户ID:{},错误信息是:{}",currDay,appUserId,throwable.getMessage());
                 return null;
             }
 

+ 459 - 0
sp-core/sp-api/src/main/java/com/pj/api/dto/GoodsTransitDto.java

@@ -0,0 +1,459 @@
+package com.pj.api.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.util.Date;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 08 09 15 43
+ **/
+public class GoodsTransitDto {
+
+    private Long id;
+
+    /**
+     * 商户编号
+     */
+    private String merchantId;
+
+    /**
+     * 商户名称
+     */
+    private String merchantName;
+
+    /**
+     * 商品类型
+     */
+    private String goodsType;
+    /**
+     * 商品图片
+     */
+    private String goodsImg;
+
+    /**
+     * 海关商品表主键
+     */
+    private Long goodsId;
+
+    /**
+     * 商品名称
+     */
+    private String goodsName;
+
+    /**
+     * 商品单位(吨、kg、个、柜)
+     */
+    private String goodsUnits;
+
+    /** 互市区名称 */
+    private String tradeAreaName;
+
+    /** 互市区ID */
+    private Long tradeAreaId;
+
+    /**
+     * 净重
+     */
+    private Double netWeight;
+
+    /**
+     * 毛重
+     */
+    private Double grossWeight;
+
+    /**
+     * 商品价格
+     */
+    private Double price;
+
+    /**
+     * 海关申报单号
+     */
+    private String declareOdd;
+
+    /**
+     * 产地(国家)
+     */
+    private String placeOrigin;
+
+    /**
+     * 商品描述
+     */
+    private String description;
+
+    /**
+     * 库存数量
+     */
+    private Integer stock;
+
+    /**
+     * 商品状态(0=下架,1=在售)
+     */
+    private Integer goodsStatus;
+
+    /**
+     * 审核状态(0=待审核,1=通过,2=不通过)
+     */
+    private Integer auditStatus;
+
+    /**
+     * 审核时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date auditTime;
+
+    /**
+     * 审核意见
+     */
+    private String remark;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date createTime;
+
+    /**
+     * 创建人编号
+     */
+    private String createBy;
+
+    /**
+     * 创建人名称
+     */
+    private String createName;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date updateTime;
+
+    /**
+     * 更新人编号
+     */
+    private String updateBy;
+
+    /**
+     * 更新人名称
+     */
+    private String updateName;
+    /**
+     * 商铺名称
+     */
+    private String shopName;
+    /**
+     * 商铺ID
+     */
+    private Long shopId;
+
+    /**
+     * 删除状态(0=禁用,1=启用)
+     */
+    private Integer deleteStatus;
+
+    /**
+     * 是否已被下单[0=未被下单,1=已被下单]
+     */
+    private Integer isOrders;
+
+    /**
+     * 商铺确认情况[0=待确认,1=已确认,2=拒绝]
+     */
+    private Integer enterpriseConfirm;
+
+    public GoodsTransitDto(Long id, String merchantId, String merchantName, String goodsType, String goodsImg, Long goodsId, String goodsName, String goodsUnits, String tradeAreaName, Long tradeAreaId, Double netWeight, Double grossWeight, Double price, String declareOdd, String placeOrigin, String description, Integer stock, Integer goodsStatus, Integer auditStatus, Date auditTime, String remark, Date createTime, String createBy, String createName, Date updateTime, String updateBy, String updateName, String shopName, Long shopId, Integer deleteStatus, Integer isOrders, Integer enterpriseConfirm) {
+        this.id = id;
+        this.merchantId = merchantId;
+        this.merchantName = merchantName;
+        this.goodsType = goodsType;
+        this.goodsImg = goodsImg;
+        this.goodsId = goodsId;
+        this.goodsName = goodsName;
+        this.goodsUnits = goodsUnits;
+        this.tradeAreaName = tradeAreaName;
+        this.tradeAreaId = tradeAreaId;
+        this.netWeight = netWeight;
+        this.grossWeight = grossWeight;
+        this.price = price;
+        this.declareOdd = declareOdd;
+        this.placeOrigin = placeOrigin;
+        this.description = description;
+        this.stock = stock;
+        this.goodsStatus = goodsStatus;
+        this.auditStatus = auditStatus;
+        this.auditTime = auditTime;
+        this.remark = remark;
+        this.createTime = createTime;
+        this.createBy = createBy;
+        this.createName = createName;
+        this.updateTime = updateTime;
+        this.updateBy = updateBy;
+        this.updateName = updateName;
+        this.shopName = shopName;
+        this.shopId = shopId;
+        this.deleteStatus = deleteStatus;
+        this.isOrders = isOrders;
+        this.enterpriseConfirm = enterpriseConfirm;
+    }
+
+    public GoodsTransitDto() {
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getMerchantId() {
+        return merchantId;
+    }
+
+    public void setMerchantId(String merchantId) {
+        this.merchantId = merchantId;
+    }
+
+    public String getMerchantName() {
+        return merchantName;
+    }
+
+    public void setMerchantName(String merchantName) {
+        this.merchantName = merchantName;
+    }
+
+    public String getGoodsType() {
+        return goodsType;
+    }
+
+    public void setGoodsType(String goodsType) {
+        this.goodsType = goodsType;
+    }
+
+    public String getGoodsImg() {
+        return goodsImg;
+    }
+
+    public void setGoodsImg(String goodsImg) {
+        this.goodsImg = goodsImg;
+    }
+
+    public Long getGoodsId() {
+        return goodsId;
+    }
+
+    public void setGoodsId(Long goodsId) {
+        this.goodsId = goodsId;
+    }
+
+    public String getGoodsName() {
+        return goodsName;
+    }
+
+    public void setGoodsName(String goodsName) {
+        this.goodsName = goodsName;
+    }
+
+    public String getGoodsUnits() {
+        return goodsUnits;
+    }
+
+    public void setGoodsUnits(String goodsUnits) {
+        this.goodsUnits = goodsUnits;
+    }
+
+    public String getTradeAreaName() {
+        return tradeAreaName;
+    }
+
+    public void setTradeAreaName(String tradeAreaName) {
+        this.tradeAreaName = tradeAreaName;
+    }
+
+    public Long getTradeAreaId() {
+        return tradeAreaId;
+    }
+
+    public void setTradeAreaId(Long tradeAreaId) {
+        this.tradeAreaId = tradeAreaId;
+    }
+
+    public Double getNetWeight() {
+        return netWeight;
+    }
+
+    public void setNetWeight(Double netWeight) {
+        this.netWeight = netWeight;
+    }
+
+    public Double getGrossWeight() {
+        return grossWeight;
+    }
+
+    public void setGrossWeight(Double grossWeight) {
+        this.grossWeight = grossWeight;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public String getDeclareOdd() {
+        return declareOdd;
+    }
+
+    public void setDeclareOdd(String declareOdd) {
+        this.declareOdd = declareOdd;
+    }
+
+    public String getPlaceOrigin() {
+        return placeOrigin;
+    }
+
+    public void setPlaceOrigin(String placeOrigin) {
+        this.placeOrigin = placeOrigin;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Integer getStock() {
+        return stock;
+    }
+
+    public void setStock(Integer stock) {
+        this.stock = stock;
+    }
+
+    public Integer getGoodsStatus() {
+        return goodsStatus;
+    }
+
+    public void setGoodsStatus(Integer goodsStatus) {
+        this.goodsStatus = goodsStatus;
+    }
+
+    public Integer getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(Integer auditStatus) {
+        this.auditStatus = auditStatus;
+    }
+
+    public Date getAuditTime() {
+        return auditTime;
+    }
+
+    public void setAuditTime(Date auditTime) {
+        this.auditTime = auditTime;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public String getCreateName() {
+        return createName;
+    }
+
+    public void setCreateName(String createName) {
+        this.createName = createName;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public String getUpdateName() {
+        return updateName;
+    }
+
+    public void setUpdateName(String updateName) {
+        this.updateName = updateName;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    public Long getShopId() {
+        return shopId;
+    }
+
+    public void setShopId(Long shopId) {
+        this.shopId = shopId;
+    }
+
+    public Integer getDeleteStatus() {
+        return deleteStatus;
+    }
+
+    public void setDeleteStatus(Integer deleteStatus) {
+        this.deleteStatus = deleteStatus;
+    }
+
+    public Integer getIsOrders() {
+        return isOrders;
+    }
+
+    public void setIsOrders(Integer isOrders) {
+        this.isOrders = isOrders;
+    }
+
+    public Integer getEnterpriseConfirm() {
+        return enterpriseConfirm;
+    }
+
+    public void setEnterpriseConfirm(Integer enterpriseConfirm) {
+        this.enterpriseConfirm = enterpriseConfirm;
+    }
+}

+ 11 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseAppController.java

@@ -1,5 +1,6 @@
 package com.pj.tb_enterprise;
 
+import com.pj.api.dto.EnterpriseDto;
 import com.pj.tb_enterprise.param.EnterpriseParam;
 import com.pj.tb_enterprise.vo.OrdersVo;
 import com.pj.utils.sg.AjaxJson;
@@ -56,4 +57,14 @@ public class TbEnterpriseAppController {
 		return AjaxJson.getSuccessData(ordersVos);
 	}
 
+	/*------            正常业务👆👆    rpc远程调用👇👇                         -----------*/
+
+
+	/** 根据ID获取一级市场商户信息 */
+	@RequestMapping("rpc/getEnterpriseById")
+	public EnterpriseDto getEnterpriseById(@RequestParam("enterpriseId")Long enterpriseId){
+		EnterpriseDto enterpriseById = tbEnterpriseService.getEnterpriseById(enterpriseId);
+		return enterpriseById;
+	}
+
 }

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

@@ -381,4 +381,13 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
         });
         this.updateBatchById(list);
     }
+
+	/** 远程调用:根据ID获取一级市场商户 */
+	EnterpriseDto getEnterpriseById(Long id) {
+		TbEnterprise enterprise = super.getById(id);
+		EnterpriseDto enterpriseDto = new EnterpriseDto();
+		BeanUtils.copyProperties(enterprise,enterpriseDto);
+		return enterpriseDto;
+	}
+
 }

+ 12 - 6
sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/GoodsTransitAppController.java

@@ -1,14 +1,10 @@
 package com.pj.tb_goods_transit;
 
 
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.pj.current.dto.APPLoginUserInfo;
-import com.pj.current.satoken.StpAPPUserUtil;
-import com.pj.enummj.DeleteStatus;
+import com.pj.api.dto.GoodsTransitDto;
+
 import com.pj.tb_goods_transit.param.PurchaseLevelOneGoodsTransitParam;
 import com.pj.tb_goods_transit.param.TransactionGoodsParam;
-import com.pj.tb_order.TbOrder;
-import com.pj.tb_order.TbOrderService;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -137,5 +133,15 @@ public class GoodsTransitAppController {
         return AjaxJson.getError("提交失败!");
     }
 
+    /*-----       远程调用👇👇  正常业务方法👆👆    -----*/
+
+    /**
+     * 根据商户ID和过审商品表ID查询过审商品
+     */
+    @RequestMapping("rpc/getGoodsTransitById")
+    public GoodsTransitDto getGoodsTransitById(@RequestParam("goodsTransitId") Long goodsTransitId,@RequestParam("enterpriseId") Long enterpriseId) {
+        GoodsTransitDto t = tbGoodsTransitService.getGoodsTransitById(goodsTransitId,enterpriseId);
+        return t;
+    }
 
 }

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

@@ -10,6 +10,7 @@ import java.util.List;
 import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.pj.api.dto.GoodsTransitDto;
 import com.pj.common.core.exception.ServiceException;
 import com.pj.current.dto.APPLoginUserInfo;
 import com.pj.current.satoken.StpAPPUserUtil;
@@ -452,4 +453,12 @@ public class TbGoodsTransitService extends ServiceImpl<TbGoodsTransitMapper, TbG
 		return "数据导出完成!共导出 " + count + " 条数据。";
 	}
 
+	/** 远程调用: 根据ID查询过审商品表(tb_goods_transit) */
+	GoodsTransitDto getGoodsTransitById(Long goodsTransitId,Long enterpriseId){
+		TbGoodsTransit tbGoodsTransit = tbGoodsTransitMapper.selectOne(new LambdaQueryWrapper<TbGoodsTransit>().eq(TbGoodsTransit::getId, goodsTransitId).eq(TbGoodsTransit::getMerchantId, enterpriseId));
+		GoodsTransitDto goodsTransitDto = new GoodsTransitDto();
+		BeanUtils.copyProperties(tbGoodsTransit,goodsTransitDto);
+		return goodsTransitDto;
+	}
+
 }

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

@@ -108,8 +108,8 @@ public class TbOrderAppController {
 		return orderDtos;
 	}
 	/** 查 - 根据id查orderDto */
-	@RequestMapping("rpc/getById")
-	public OrderDto rpcGetById(@RequestParam("orderId") Long orderId){
+	@RequestMapping("rpc/getOrderDtoById")
+	public OrderDto getOrderDtoById(@RequestParam("orderId") Long orderId){
 		OrderDto t = tbOrderService.getOrderDtoById(orderId);
 		return t;
 	}

+ 80 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/AppCarRecordController.java

@@ -0,0 +1,80 @@
+package com.pj.project.tb_car_record;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+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.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+/**
+ * Controller: tb_car_record -- 商户司机叫车记录表
+ * @author yzs 
+ */
+@RestController
+@RequestMapping("/app/TbCarRecord/")
+public class AppCarRecordController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbCarRecordService tbCarRecordService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	public AjaxJson add(TbCarRecord t){
+		tbCarRecordService.add(t);
+		t = tbCarRecordService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	public AjaxJson delete(Long id){
+		 tbCarRecordService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbCarRecord.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	public AjaxJson update(TbCarRecord t){
+		tbCarRecordService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** app:查 - 根据id */
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		TbCarRecord t = tbCarRecordService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** app:查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("getAppList")
+	public AjaxJson getList(@RequestParam(value = "driverResult",required = false) Integer driverResult) {
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbCarRecord> list = tbCarRecordService.getAppList(so.startPage(),driverResult);
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	
+
+	
+	
+	
+
+}

+ 151 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecord.java

@@ -0,0 +1,151 @@
+package com.pj.project.tb_car_record;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * Model: tb_car_record -- 商户司机叫车记录表
+ * @author yzs 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbCarRecord.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbCarRecord extends Model<TbCarRecord> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_car_record";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-car-record";
+	public static final String PERMISSION_CODE_ADD = "tb-car-record-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-car-record-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-car-record-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 商户司机叫车记录表主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 互市区ID 
+	 */
+	private Long tradeAreaId;	
+
+	/**
+	 * 互市区名称 
+	 */
+	private String tradeAreaName;	
+
+	/**
+	 * 司机表主键 
+	 */
+	private Long driverId;	
+
+	/**
+	 * 一级市场商户主键 
+	 */
+	private Long enterpriseId;	
+
+	/**
+	 * 一级市场订单表主键 
+	 */
+	private Long orderId;	
+
+	/**
+	 * 车辆表主键 
+	 */
+	private Long vehicleId;	
+
+	/**
+	 * 商品名称 
+	 */
+	private String goodsName;	
+
+	/**
+	 * 商品图片 
+	 */
+	private String goodsImg;	
+
+	/**
+	 * 商品重量 
+	 */
+	private Double goodsWeight;	
+
+	/**
+	 * 商铺名称 
+	 */
+	private String shopName;	
+
+	/**
+	 * 商户名称 
+	 */
+	private String enterpriseName;	
+
+	/**
+	 * 商户电话 
+	 */
+	private String enterprisePhone;	
+
+	/**
+	 * 商户备注 
+	 */
+	private String remark;	
+
+	/**
+	 * 创建人编号 
+	 */
+	private Long createBy;	
+
+	/**
+	 * 创建人名称 
+	 */
+	private String createName;	
+
+	/**
+	 * 创建时间 
+	 */
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	private Date createTime;
+
+	/**
+	 * 删除状态 
+	 */
+	private Integer deleteStatus;
+
+	/**
+	 * 司机处理[0=待处理,1=同意,2=拒绝]
+	 */
+	private Integer driverResult;
+
+
+
+
+
+	
+
+
+}

+ 85 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecordController.java

@@ -0,0 +1,85 @@
+package com.pj.project.tb_car_record;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: tb_car_record -- 商户司机叫车记录表
+ * @author yzs 
+ */
+@RestController
+@RequestMapping("/TbCarRecord/")
+public class TbCarRecordController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbCarRecordService tbCarRecordService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(TbCarRecord.PERMISSION_CODE_ADD)
+	public AjaxJson add(TbCarRecord t){
+		tbCarRecordService.add(t);
+		t = tbCarRecordService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbCarRecord.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 tbCarRecordService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbCarRecord.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbCarRecord.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbCarRecord.PERMISSION_CODE_EDIT)
+	public AjaxJson update(TbCarRecord t){
+		tbCarRecordService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(TbCarRecord.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		TbCarRecord t = tbCarRecordService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(TbCarRecord.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbCarRecord> list = tbCarRecordService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	
+
+	
+	
+	
+
+}

+ 30 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecordMapper.java

@@ -0,0 +1,30 @@
+package com.pj.project.tb_car_record;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: tb_car_record -- 商户司机叫车记录表
+ * @author yzs 
+ */
+
+@Mapper
+@Repository
+public interface TbCarRecordMapper extends BaseMapper <TbCarRecord> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbCarRecord> getList(SoMap so);
+
+
+}

+ 77 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecordMapper.xml

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.project.tb_car_record.TbCarRecordMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, trade_area_id, trade_area_name, driver_id, enterprise_id, order_id, vehicle_id, goods_name, goods_img, goods_weight, shop_name, enterprise_name, enterprise_phone, remark, create_by, create_name, create_time, delete_status from tb_car_record  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.project.tb_car_record.TbCarRecord"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from tb_car_record 
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<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("tradeAreaName") '> and trade_area_name = #{tradeAreaName} </if>
+			<if test=' this.has("driverId") '> and driver_id = #{driverId} </if>
+			<if test=' this.has("enterpriseId") '> and enterprise_id = #{enterpriseId} </if>
+			<if test=' this.has("orderId") '> and order_id = #{orderId} </if>
+			<if test=' this.has("vehicleId") '> and vehicle_id = #{vehicleId} </if>
+			<if test=' this.has("goodsName") '> and goods_name = #{goodsName} </if>
+			<if test=' this.has("goodsImg") '> and goods_img = #{goodsImg} </if>
+			<if test=' this.has("goodsWeight") '> and goods_weight = #{goodsWeight} </if>
+			<if test=' this.has("shopName") '> and shop_name = #{shopName} </if>
+			<if test=' this.has("enterpriseName") '> and enterprise_name = #{enterpriseName} </if>
+			<if test=' this.has("enterprisePhone") '> and enterprise_phone = #{enterprisePhone} </if>
+			<if test=' this.has("remark") '> and remark = #{remark} </if>
+			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>
+			<if test=' this.has("createName") '> and create_name = #{createName} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> trade_area_id desc </when>
+			<when test='sortType == 3'> trade_area_name desc </when>
+			<when test='sortType == 4'> driver_id desc </when>
+			<when test='sortType == 5'> enterprise_id desc </when>
+			<when test='sortType == 6'> order_id desc </when>
+			<when test='sortType == 7'> vehicle_id desc </when>
+			<when test='sortType == 8'> goods_name desc </when>
+			<when test='sortType == 9'> goods_img desc </when>
+			<when test='sortType == 10'> goods_weight desc </when>
+			<when test='sortType == 11'> shop_name desc </when>
+			<when test='sortType == 12'> enterprise_name desc </when>
+			<when test='sortType == 13'> enterprise_phone desc </when>
+			<when test='sortType == 14'> remark desc </when>
+			<when test='sortType == 15'> create_by desc </when>
+			<when test='sortType == 16'> create_name desc </when>
+			<when test='sortType == 17'> create_time desc </when>
+			<when test='sortType == 18'> delete_status desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 66 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecordService.java

@@ -0,0 +1,66 @@
+package com.pj.project.tb_car_record;
+
+import java.util.List;
+
+import com.pj.current.dto.APPLoginUserInfo;
+import com.pj.current.satoken.StpAPPUserUtil;
+import com.pj.enummj.DeleteStatus;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Service: tb_car_record -- 商户司机叫车记录表
+ * @author yzs 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TbCarRecordService extends ServiceImpl<TbCarRecordMapper, TbCarRecord> implements IService<TbCarRecord>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbCarRecordMapper tbCarRecordMapper;
+
+	/** 增 */
+	void add(TbCarRecord t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(TbCarRecord t){
+		updateById(t);
+
+	}
+
+	/** 查 */
+	TbCarRecord getById(Long id){
+		return super.getById(id);
+	}
+
+	/** pc:查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	List<TbCarRecord> getList(SoMap so) { 
+		return tbCarRecordMapper.getList(so);	
+	}
+
+	/** app:查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	List<TbCarRecord> getAppList(SoMap so,Integer driverResult) {
+		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
+		//查询自己的记录
+		Long fk = appLoginInfo.getFk(); // driverId
+		so.put("driverId",fk);
+		so.put("deleteStatus", DeleteStatus.DELETE_STATUS_ON.getCode());
+		so.put("sortType",17); // 根据日期降序
+		if(driverResult != null)so.put("driverResult",driverResult);
+		return tbCarRecordMapper.getList(so);
+	}
+
+
+}

+ 27 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_car_record/TbCarRecordUtil.java

@@ -0,0 +1,27 @@
+package com.pj.project.tb_car_record;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 工具类:tb_car_record -- 商户司机叫车记录表
+ * @author yzs 
+ *
+ */
+@Component
+public class TbCarRecordUtil {
+
+	
+	/** 底层 Mapper 对象 */
+	public static TbCarRecordMapper tbCarRecordMapper;
+	@Autowired
+	private void setTbCarRecordMapper(TbCarRecordMapper tbCarRecordMapper) {
+		TbCarRecordUtil.tbCarRecordMapper = tbCarRecordMapper;
+	}
+	
+
+
+	
+	
+	
+}

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

@@ -1,10 +1,19 @@
 package com.pj.project.tb_vehicle;
 
+import com.pj.api.client.level_one_server.LevelOneServerInterface;
+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.DriverResultParam;
+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;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
@@ -35,12 +44,53 @@ public class MethodVehicleService {
     private TbVehicleMapper tbVehicleMapper;
     @Autowired
     private TbLogisticsMapper tbLogisticsMapper;
+    @Autowired
+    private TbCarRecordMapper tbCarRecordMapper;
+    @Autowired
+    private LevelOneServerInterface levelOneServerInterface;
+
+    /** 创建叫车记录 */
+    public TbCarRecord makeCarRecord(MakeCarRecordParam makeCarRecordParam){
+        //创建返回值对象
+        TbCarRecord carRecord = new TbCarRecord();
+        //数据拷贝
+        BeanUtils.copyProperties(makeCarRecordParam,carRecord);
+        //获取先决条件
+        OrderDto orderDtoById = levelOneServerInterface.getOrderDtoById(makeCarRecordParam.getOrderId());
+        if(orderDtoById == null)throw new ServiceException("一级市场订单信息异常!");
+        GoodsTransitDto goodsTransitById = levelOneServerInterface.getGoodsTransitById(orderDtoById.getGoodsId(), orderDtoById.getEnterpriseId());
+        if(goodsTransitById == null)throw new ServiceException("商品信息异常!");
+        EnterpriseDto enterpriseById = levelOneServerInterface.getEnterpriseById(makeCarRecordParam.getEnterpriseId());
+        if(enterpriseById == null)throw new ServiceException("一级市场商户信息错误!");
+        //赋值基本信息
+        carRecord.setGoodsName(goodsTransitById.getGoodsName()); //过审商品名称
+        carRecord.setGoodsImg(goodsTransitById.getGoodsImg()); // 过审商品图片
+        carRecord.setGoodsWeight(goodsTransitById.getGrossWeight()); // 过审商品毛重
+        carRecord.setShopName(goodsTransitById.getShopName());  // 一级市场商铺名称
+        carRecord.setEnterpriseName(goodsTransitById.getMerchantName()); // 一级市场商户名称
+        carRecord.setEnterprisePhone(enterpriseById.getContact()); // 一级市场商户电话
+        //司机处理[0=待处理,1=同意,2=拒绝]
+        carRecord.setDriverResult(0); // 默认待处理
+        //公共字段属性赋值
+        carRecord.setCreateBy(StpAPPUserUtil.getAPPLoginInfo().getLoginId());
+        carRecord.setCreateName(StpAPPUserUtil.getAPPLoginInfo().getLoginName());
+        carRecord.setCreateTime(new Date());
+        carRecord.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
+        return carRecord;
+    }
 
     /** 司机同意 */
-    public boolean agree(APPLoginUserInfo appLoginInfo, DriverResultParam driverResultParam){
+    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 RuntimeException("车辆信息异常!");
+        if(tbVehicle == null)throw new ServiceException("车辆信息异常!");
         tbVehicle.setVehicleStatus(1); // 将状态修改成作业中
         int updateById = tbVehicleMapper.updateById(tbVehicle);
         if(updateById != 1)throw new RuntimeException("车辆状态异常");
@@ -71,21 +121,12 @@ public class MethodVehicleService {
 
         //保存物流信息
         int updateById1 = tbLogisticsMapper.updateById(logistics);
-
         if(updateById1 != 1)throw new RuntimeException("物流信息保存异常!");
 
         return true;
     }
 
 
-    /** 司机拒绝 */
-    public boolean refuse(APPLoginUserInfo appLoginInfo){
-
-
-
-        return false;
-    }
-
 
 
 

+ 10 - 11
sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/TbVehicleAppController.java

@@ -1,9 +1,9 @@
 package com.pj.project.tb_vehicle;
 
-import cn.dev33.satoken.annotation.SaCheckPermission;
-import com.pj.api.dto.OrderDto;
 import com.pj.enummj.DeleteStatus;
-import com.pj.project.tb_vehicle.param.DriverResultParam;
+import com.pj.project.tb_vehicle.param.FailDriverResultParam;
+import com.pj.project.tb_vehicle.param.SucessDriverResultParam;
+import com.pj.project.tb_vehicle.param.MakeCarRecordParam;
 import com.pj.project.tb_vehicle.vo.TbVehicleVo;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
@@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
@@ -58,14 +57,14 @@ public class TbVehicleAppController {
 
 	/**
 	 * 商户确定车辆后执行通知司机
-	 * @param driverId tb_driver表主键
+	 * @param makeCarRecordParam
 	 * @return
 	 * @throws Exception
 	 */
 	@RequestMapping("informDriver")
-	public AjaxJson informDriver(@RequestParam("driverId") Long driverId,@RequestParam("") Long levelOneOrderId) throws Exception {
-		OrderDto orderDto = tbVehicleService.informDriver(driverId, levelOneOrderId);
-		return AjaxJson.getSuccessData(orderDto);
+	public AjaxJson informDriver(@Validated @RequestBody MakeCarRecordParam makeCarRecordParam) throws Exception {
+		tbVehicleService.informDriver(makeCarRecordParam);
+		return AjaxJson.getSuccess();
 	}
 
 	/**
@@ -74,7 +73,7 @@ public class TbVehicleAppController {
 	 * @throws Exception
 	 */
 	@RequestMapping("driverAgree")
-	public AjaxJson driverDispose(@Validated @RequestBody DriverResultParam driverResultParam) throws Exception {
+	public AjaxJson driverDispose(@Validated @RequestBody SucessDriverResultParam driverResultParam) throws Exception {
 		boolean dispose = tbVehicleService.driverAgree(driverResultParam);
 		if(dispose)return AjaxJson.getSuccess();
 		return AjaxJson.getError();
@@ -86,8 +85,8 @@ public class TbVehicleAppController {
 	 * @throws Exception
 	 */
 	@RequestMapping("driverRefuse")
-	public AjaxJson driverRefuse(String purchaserPhone) throws Exception {
-		boolean dispose = tbVehicleService.driverRefuse(purchaserPhone);
+	public AjaxJson driverRefuse(FailDriverResultParam failDriverResultParam) throws Exception {
+		boolean dispose = tbVehicleService.driverRefuse(failDriverResultParam);
 		if(dispose)return AjaxJson.getSuccess();
 		return AjaxJson.getError();
 	}

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

@@ -10,14 +10,17 @@ 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.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_driver.TbDriver;
 import com.pj.project.tb_driver.TbDriverMapper;
-import com.pj.project.tb_vehicle.param.DriverResultParam;
+import com.pj.project.tb_vehicle.param.FailDriverResultParam;
+import com.pj.project.tb_vehicle.param.SucessDriverResultParam;
+import com.pj.project.tb_vehicle.param.MakeCarRecordParam;
 import com.pj.project.tb_vehicle.vo.TbVehicleVo;
 import com.pj.retry.SmsRetryService;
 import com.pj.utils.so.SoMap;
@@ -58,6 +61,9 @@ public class TbVehicleService extends ServiceImpl<TbVehicleMapper, TbVehicle> im
 	@Autowired
 	private LevelOneServerInterface levelOneServerInterface;
 
+	@Autowired
+	private TbCarRecordMapper tbCarRecordMapper;
+
 	/** 增 */
 	void add(TbVehicle t){
 		t.setCreateTime(new Date());
@@ -113,49 +119,52 @@ public class TbVehicleService extends ServiceImpl<TbVehicleMapper, TbVehicle> im
 
 	/**
 	 * 商户确定车辆后执行通知司机
-	 * @param driverId tb_driver 表ID
+	 * @param makeCarRecordParam
 	 * @return
 	 * @throws Exception
 	 */
-	public OrderDto informDriver(Long driverId,Long levelOneOrderId) throws Exception {
+	public boolean informDriver(MakeCarRecordParam makeCarRecordParam) throws Exception {
 		//通过driverId查询司机表
-		TbDriver tbDriver = tbDriverMapper.selectById(driverId);
+		TbDriver tbDriver = tbDriverMapper.selectById(makeCarRecordParam.getDriverId());
 		if(tbDriver == null)throw new ServiceException("司机信息有误!");
 		//获取司机号码
 		String phone = tbDriver.getPhone();
 		//todo: 执行通知
 //		boolean smsMsg = smsRetryService.sendSmsMsg(phone);
-		//发送订单内容
-		OrderDto orderDto = levelOneServerInterface.rpcGetById(levelOneOrderId);
-		if(orderDto == null)throw new ServiceException("未知异常!");
-		return orderDto;
+		//创建叫车记录
+		TbCarRecord tbCarRecord = methodVehicleService.makeCarRecord(makeCarRecordParam);
+		int insert = tbCarRecordMapper.insert(tbCarRecord);
+		return insert == 1;
 	}
 
+
+
 	/**
 	 * 司机处理订单,同意
 	 * @return
 	 */
-	public boolean driverAgree(DriverResultParam driverResultParam){
+	public boolean driverAgree(SucessDriverResultParam driverResultParam){
 		//获取当前登录人
 		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
-
 		boolean agree = methodVehicleService.agree(appLoginInfo, driverResultParam);
-
 		return agree;
-
 	}
 
 	/**
 	 * 司机处理订单,拒绝
-	 * @param purchaserPhone 收购商电话
+	 * @param failDriverResultParam
 	 * @return
 	 */
-	public boolean driverRefuse(String purchaserPhone) throws Exception {
-
+	public boolean driverRefuse(FailDriverResultParam failDriverResultParam) throws Exception {
 		//todo:司机拒绝,发送通知短信给收购商
-//		smsRetryService.sendSmsMsg(purchaserPhone);
-
-		return false;
+//		smsRetryService.sendSmsMsg(failDriverResultParam.getEnterprisePhone());
+		//将叫车表状态改成已拒绝
+		TbCarRecord tbCarRecord = tbCarRecordMapper.selectById(failDriverResultParam.getCarRecordId());
+		if(tbCarRecord == null)throw new ServiceException("叫车记录信息异常!");
+		tbCarRecord.setDriverResult(2);
+		//执行保存
+		int i = tbCarRecordMapper.updateById(tbCarRecord);
+		return i == 1;
 
 	}
 

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

@@ -0,0 +1,23 @@
+package com.pj.project.tb_vehicle.param;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 08 09 17 26
+ **/
+@Data
+public class FailDriverResultParam {
+
+    @NotNull(message = "叫车记录表主键")
+    private Long carRecordId;
+
+    @NotNull(message = "一级市场商户主键不为空")
+    private Long enterpriseId;
+
+    @NotNull(message = "收购商电话不能为空")
+    private String enterprisePhone;
+
+}

+ 56 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/param/MakeCarRecordParam.java

@@ -0,0 +1,56 @@
+package com.pj.project.tb_vehicle.param;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 创建叫车记录表入参类
+ * @Author Mechrevo
+ * @Date 2023 08 09 15 33
+ **/
+@Data
+public class MakeCarRecordParam {
+
+
+    /**
+     * 交易地区ID
+     */
+    @NotNull(message = "tradeAreaId,交易地区ID不能为空")
+    private Long tradeAreaId;
+
+    /**
+     * 交易地区名称
+     */
+    @NotNull(message = "tradeAreaName,交易地区名称不能为空")
+    private Long tradeAreaName;
+
+    /**
+     * 司机表ID
+     */
+    @NotNull(message = "driverId,司机表ID不能为空")
+    private Long driverId;
+
+    /**
+     * 一级市场商户主键
+     */
+    @NotNull(message = "enterpriseId,一级市场商户表ID不能为空")
+    private Long enterpriseId;
+
+    /**
+     * 一级市场订单表主键
+     */
+    @NotNull(message = "orderId,一级市场订单表ID不能为空")
+    private Long orderId;
+
+    /**
+     * 车辆表主键
+     */
+    @NotNull(message = "vehicleId,车辆表ID不能为空")
+    private Long vehicleId;
+
+    /**
+     * 商户备注
+     */
+    private String remark;
+}

+ 4 - 4
sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/param/DriverResultParam.java → sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/param/SucessDriverResultParam.java

@@ -10,13 +10,13 @@ import javax.validation.constraints.NotNull;
  * @Date 2023 08 09 10 48
  **/
 @Data
-public class DriverResultParam {
+public class SucessDriverResultParam {
 
     /**
-     * 处理结果
+     * 叫车表主键
      */
-    @NotNull(message = "result,处理结果必填!")
-    private Integer result;
+    @NotNull(message = "carRecordId,叫车表主键必填!")
+    private Integer carRecordId;
 
     /**
      * 一级市场订单ID