From 044a57d2133b2363a6f0d3d167b3eaa587c70b91 Mon Sep 17 00:00:00 2001
From: xin <1099200748@qq.com>
Date: Thu, 31 Jul 2025 17:18:47 +0800
Subject: [PATCH] Merge branch 'pxb' into xin

---
 oying-system/src/main/java/com/oying/modules/rider/rest/RiderDeliveryPhotosController.java          |   73 ++++++
 oying-system/src/main/java/com/oying/modules/rider/utils/RiderSourceHttpUtils.java                  |   50 ++-
 oying-system/src/main/java/com/oying/modules/rider/domain/dto/RiderOrderRecordQueryCriteria.java    |    6 
 oying-system/src/main/java/com/oying/modules/rider/service/impl/RiderDeliveryPhotosServiceImpl.java |  121 +++++++++++
 oying-system/src/main/java/com/oying/modules/rider/utils/Constants.java                             |    6 
 oying-system/src/main/java/com/oying/modules/rider/domain/RiderDeliveryPhotos.java                  |   73 ++++++
 oying-system/src/main/java/com/oying/modules/rider/domain/dto/RiderDeliveryPhotosQueryCriteria.java |   45 ++++
 oying-system/src/main/java/com/oying/modules/rider/domain/vo/OrderDeliveryPhotosVo.java             |   37 +++
 oying-system/src/main/java/com/oying/modules/rider/service/impl/RiderOrderRecordServiceImpl.java    |   19 
 oying-system/src/main/resources/mapper/rider/RiderOrderRecordMapper.xml                             |   12 
 oying-system/src/main/java/com/oying/modules/rider/domain/RiderSourceInfoHttp.java                  |    2 
 oying-system/src/main/java/com/oying/modules/rider/service/RiderDeliveryPhotosService.java          |   68 ++++++
 oying-system/src/main/java/com/oying/modules/rider/domain/RiderOrderRecord.java                     |    4 
 oying-system/src/main/resources/mapper/rider/RiderDeliveryPhotosMapper.xml                          |   64 +++++
 oying-system/src/main/java/com/oying/modules/rider/mapper/RiderDeliveryPhotosMapper.java            |   22 ++
 oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java                      |   28 ++
 16 files changed, 592 insertions(+), 38 deletions(-)

diff --git a/oying-system/src/main/java/com/oying/modules/rider/domain/RiderDeliveryPhotos.java b/oying-system/src/main/java/com/oying/modules/rider/domain/RiderDeliveryPhotos.java
new file mode 100644
index 0000000..00b39fc
--- /dev/null
+++ b/oying-system/src/main/java/com/oying/modules/rider/domain/RiderDeliveryPhotos.java
@@ -0,0 +1,73 @@
+package com.oying.modules.rider.domain;
+
+import com.oying.base.BaseEntity;
+import lombok.Getter;
+import lombok.Setter;
+import cn.hutool.core.bean.BeanUtil;
+import io.swagger.annotations.ApiModelProperty;
+import cn.hutool.core.bean.copier.CopyOptions;
+import java.sql.Timestamp;
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+/**
+* @description /
+* @author pxb
+* @date 2025-07-22
+**/
+@Getter
+@Setter
+@TableName("qs_rider_delivery_photos")
+public class RiderDeliveryPhotos extends BaseEntity implements Serializable {
+
+    @TableId(value = "photo_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "照片记录ID")
+    private Long photoId;
+
+    @ApiModelProperty(value = "关联的订单ID")
+    private Long orderId;
+
+    @ApiModelProperty(value = "关联的订单号")
+    private String orderNum;
+
+    @ApiModelProperty(value = "骑手ID")
+    private Long riderId;
+
+    @ApiModelProperty(value = "骑手姓名")
+    private String riderName;
+
+    @ApiModelProperty(value = "骑手手机号")
+    private String riderPhone;
+
+    @ApiModelProperty(value = "照片存储的URL地址")
+    private String photoUrl;
+
+    @ApiModelProperty(value = "照片存储ID")
+    private Long uploadId;
+
+    @ApiModelProperty(value = "拍摄地点纬度")
+    private String latitude;
+
+    @ApiModelProperty(value = "拍摄地点经度")
+    private String longitude;
+
+    @ApiModelProperty(value = "照片描述信息")
+    private String description;
+
+    @ApiModelProperty(value = "是否有效 1-有效 0-无效")
+    private String isValid;
+
+    @ApiModelProperty(value = "用户手机号")
+    private String userPhone;
+
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
+
+    public static final String COL_ORDER_NUM = "order_num";
+
+    public void copy(RiderDeliveryPhotos source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}
diff --git a/oying-system/src/main/java/com/oying/modules/rider/domain/RiderOrderRecord.java b/oying-system/src/main/java/com/oying/modules/rider/domain/RiderOrderRecord.java
index 9fc34c6..d37fe8e 100644
--- a/oying-system/src/main/java/com/oying/modules/rider/domain/RiderOrderRecord.java
+++ b/oying-system/src/main/java/com/oying/modules/rider/domain/RiderOrderRecord.java
@@ -99,6 +99,10 @@
     @ApiModelProperty(value = "预计送达时间")
     private String orderTime;
 
+    @ApiModelProperty(value = "用户手机号")
+    private String userName;
+
+
     public void copy(RiderOrderRecord source){
         BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
     }
diff --git a/oying-system/src/main/java/com/oying/modules/rider/domain/RiderSourceInfoHttp.java b/oying-system/src/main/java/com/oying/modules/rider/domain/RiderSourceInfoHttp.java
index e9918ec..74d0246 100644
--- a/oying-system/src/main/java/com/oying/modules/rider/domain/RiderSourceInfoHttp.java
+++ b/oying-system/src/main/java/com/oying/modules/rider/domain/RiderSourceInfoHttp.java
@@ -2,6 +2,7 @@
 
 import lombok.Getter;
 import lombok.Setter;
+import lombok.ToString;
 
 import java.io.Serializable;
 import java.util.List;
@@ -13,6 +14,7 @@
 **/
 @Getter
 @Setter
+@ToString
 public class RiderSourceInfoHttp implements Serializable {
 
     private String code;
diff --git a/oying-system/src/main/java/com/oying/modules/rider/domain/dto/RiderDeliveryPhotosQueryCriteria.java b/oying-system/src/main/java/com/oying/modules/rider/domain/dto/RiderDeliveryPhotosQueryCriteria.java
new file mode 100644
index 0000000..3c66081
--- /dev/null
+++ b/oying-system/src/main/java/com/oying/modules/rider/domain/dto/RiderDeliveryPhotosQueryCriteria.java
@@ -0,0 +1,45 @@
+package com.oying.modules.rider.domain.dto;
+
+import lombok.Data;
+import java.sql.Timestamp;
+import java.util.List;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+* @author pxb
+* @date 2025-07-22
+**/
+@Data
+public class RiderDeliveryPhotosQueryCriteria{
+
+    @ApiModelProperty(value = "页码", example = "1")
+    private Integer page = 1;
+
+    @ApiModelProperty(value = "每页数据量", example = "10")
+    private Integer size = 10;
+
+    @ApiModelProperty(value = "关联的订单ID")
+    private Long orderId;
+
+    @ApiModelProperty(value = "关联的订单号")
+    private String orderNum;
+
+    @ApiModelProperty(value = "骑手ID")
+    private Long riderId;
+
+    @ApiModelProperty(value = "骑手姓名")
+    private String riderName;
+
+    @ApiModelProperty(value = "骑手手机号")
+    private String riderPhone;
+
+    @ApiModelProperty(value = "照片存储ID")
+    private Long uploadId;
+
+    @ApiModelProperty(value = "用户手机号")
+    private String userPhone;
+
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
+    private List<Timestamp> createTime;
+}
diff --git a/oying-system/src/main/java/com/oying/modules/rider/domain/dto/RiderOrderRecordQueryCriteria.java b/oying-system/src/main/java/com/oying/modules/rider/domain/dto/RiderOrderRecordQueryCriteria.java
index 4ef50fc..51b05a9 100644
--- a/oying-system/src/main/java/com/oying/modules/rider/domain/dto/RiderOrderRecordQueryCriteria.java
+++ b/oying-system/src/main/java/com/oying/modules/rider/domain/dto/RiderOrderRecordQueryCriteria.java
@@ -27,6 +27,9 @@
     @ApiModelProperty(value = "用户id")
     private Long userId;
 
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
     @ApiModelProperty(value = "订单编号")
     private String orderNum;
 
@@ -45,6 +48,9 @@
     @ApiModelProperty(value = "订单状态: 1-待取货 2-配送中 3-已完成 4-商家取消 5-骑手取消 6-客户取消 7-系统取消")
     private String orderStatus;
 
+    @ApiModelProperty(value = "用户手机号")
+    private String userName;
+
     @ApiModelProperty(value = "是否超时:1-是 0-否")
     private String isOvertime;
     private List<Timestamp> acceptTime;
diff --git a/oying-system/src/main/java/com/oying/modules/rider/domain/vo/OrderDeliveryPhotosVo.java b/oying-system/src/main/java/com/oying/modules/rider/domain/vo/OrderDeliveryPhotosVo.java
new file mode 100644
index 0000000..845a296
--- /dev/null
+++ b/oying-system/src/main/java/com/oying/modules/rider/domain/vo/OrderDeliveryPhotosVo.java
@@ -0,0 +1,37 @@
+package com.oying.modules.rider.domain.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+* @description /
+* @author pxb
+* @date 2025-06-18
+**/
+@Getter
+@Setter
+public class OrderDeliveryPhotosVo implements Serializable {
+
+
+    @ApiModelProperty(value = "订单号")
+    private String orderNum;
+
+    @ApiModelProperty(value = "拍照经度")
+    private String userLongitude;
+
+    @ApiModelProperty(value = "拍照纬度")
+    private String userLatitude;
+
+    @ApiModelProperty(value = "图片地址")
+    private String photoUrl;
+
+    @ApiModelProperty(value = "描述")
+    private String description;
+
+    @ApiModelProperty(value = "照片存储ID")
+    private Long uploadId;
+
+}
diff --git a/oying-system/src/main/java/com/oying/modules/rider/mapper/RiderDeliveryPhotosMapper.java b/oying-system/src/main/java/com/oying/modules/rider/mapper/RiderDeliveryPhotosMapper.java
new file mode 100644
index 0000000..34de69b
--- /dev/null
+++ b/oying-system/src/main/java/com/oying/modules/rider/mapper/RiderDeliveryPhotosMapper.java
@@ -0,0 +1,22 @@
+package com.oying.modules.rider.mapper;
+
+import com.oying.modules.rider.domain.RiderDeliveryPhotos;
+import com.oying.modules.rider.domain.dto.RiderDeliveryPhotosQueryCriteria;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Mapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+/**
+* @author pxb
+* @date 2025-07-22
+**/
+@Mapper
+public interface RiderDeliveryPhotosMapper extends BaseMapper<RiderDeliveryPhotos> {
+
+    IPage<RiderDeliveryPhotos> findAll(@Param("criteria") RiderDeliveryPhotosQueryCriteria criteria, Page<Object> page);
+
+    List<RiderDeliveryPhotos> findAll(@Param("criteria") RiderDeliveryPhotosQueryCriteria criteria);
+}
diff --git a/oying-system/src/main/java/com/oying/modules/rider/rest/RiderDeliveryPhotosController.java b/oying-system/src/main/java/com/oying/modules/rider/rest/RiderDeliveryPhotosController.java
new file mode 100644
index 0000000..62080cc
--- /dev/null
+++ b/oying-system/src/main/java/com/oying/modules/rider/rest/RiderDeliveryPhotosController.java
@@ -0,0 +1,73 @@
+package com.oying.modules.rider.rest;
+
+import com.oying.annotation.Log;
+import com.oying.modules.rider.domain.RiderDeliveryPhotos;
+import com.oying.modules.rider.service.RiderDeliveryPhotosService;
+import com.oying.modules.rider.domain.dto.RiderDeliveryPhotosQueryCriteria;
+import lombok.RequiredArgsConstructor;
+import java.util.List;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.oying.utils.PageResult;
+
+/**
+* @author pxb
+* @date 2025-07-22
+**/
+@RestController
+@RequiredArgsConstructor
+@Api(tags = "骑手送达照片记录")
+@RequestMapping("/api/riderDeliveryPhotos")
+public class RiderDeliveryPhotosController {
+
+    private final RiderDeliveryPhotosService riderDeliveryPhotosService;
+
+    @ApiOperation("导出数据")
+    @GetMapping(value = "/download")
+    @PreAuthorize("@el.check('riderDeliveryPhotos:list')")
+    public void exportRiderDeliveryPhotos(HttpServletResponse response, RiderDeliveryPhotosQueryCriteria criteria) throws IOException {
+        riderDeliveryPhotosService.download(riderDeliveryPhotosService.queryAll(criteria), response);
+    }
+
+    @GetMapping
+    @ApiOperation("查询骑手送达照片记录")
+    @PreAuthorize("@el.check('riderDeliveryPhotos:list')")
+    public ResponseEntity<PageResult<RiderDeliveryPhotos>> queryRiderDeliveryPhotos(RiderDeliveryPhotosQueryCriteria criteria){
+        Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
+        return new ResponseEntity<>(riderDeliveryPhotosService.queryAll(criteria,page),HttpStatus.OK);
+    }
+
+    @PostMapping
+    @Log("新增骑手送达照片记录")
+    @ApiOperation("新增骑手送达照片记录")
+    @PreAuthorize("@el.check('riderDeliveryPhotos:add')")
+    public ResponseEntity<Object> createRiderDeliveryPhotos(@Validated @RequestBody RiderDeliveryPhotos resources){
+        riderDeliveryPhotosService.create(resources);
+        return new ResponseEntity<>(HttpStatus.CREATED);
+    }
+
+    @PutMapping
+    @Log("修改骑手送达照片记录")
+    @ApiOperation("修改骑手送达照片记录")
+    @PreAuthorize("@el.check('riderDeliveryPhotos:edit')")
+    public ResponseEntity<Object> updateRiderDeliveryPhotos(@Validated @RequestBody RiderDeliveryPhotos resources){
+        riderDeliveryPhotosService.update(resources);
+        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+    }
+
+    @DeleteMapping
+    @Log("删除骑手送达照片记录")
+    @ApiOperation("删除骑手送达照片记录")
+    @PreAuthorize("@el.check('riderDeliveryPhotos:del')")
+    public ResponseEntity<Object> deleteRiderDeliveryPhotos(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) {
+        riderDeliveryPhotosService.deleteAll(ids);
+        return new ResponseEntity<>(HttpStatus.OK);
+    }
+}
diff --git a/oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java b/oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java
index caaee55..6b046a1 100644
--- a/oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java
+++ b/oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java
@@ -5,11 +5,13 @@
 import com.oying.modules.rider.domain.dto.RiderIncomeDetailQueryCriteria;
 import com.oying.modules.rider.domain.dto.RiderOrderRecordQueryCriteria;
 import com.oying.modules.rider.domain.dto.RiderWithdrawalRecordQueryCriteria;
+import com.oying.modules.rider.domain.vo.OrderDeliveryPhotosVo;
 import com.oying.modules.rider.domain.vo.OrderRiderOperationVo;
 import com.oying.modules.rider.service.*;
 import com.oying.modules.rider.utils.Constants;
 import com.oying.utils.PageResult;
 import com.oying.utils.R;
+import com.oying.utils.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
@@ -37,6 +39,8 @@
     private final RiderInfoService riderInfoService;
 
     private final RiderOrderRecordService riderOrderRecordService;
+
+    private final RiderDeliveryPhotosService riderDeliveryPhotosService;
 
 
     @GetMapping("getRiderSourceInfo/{riderId}")
@@ -96,7 +100,7 @@
     // @PreAuthorize("@el.check('riderOrderRecord:list')")
     public ResponseEntity<?> riderGrabOrder(@PathVariable String orderNum) {
         // 订单号不能为空
-        if (orderNum == null || orderNum.equals("")) {
+        if (StringUtils.isBlank(orderNum)) {
             return ResponseEntity.ok(R.fail(Constants.HTTP_CODE_FAIL, "订单号不能为空"));
         }
         R result = riderOrderRecordService.riderGrabOrder(orderNum);
@@ -108,7 +112,7 @@
     // @PreAuthorize("@el.check('riderOrderRecord:list')")
     public ResponseEntity<?> riderCancelOrder(@PathVariable String orderNum) {
         // 订单号不能为空
-        if (orderNum == null || orderNum.equals("")) {
+        if (StringUtils.isBlank(orderNum)) {
             return ResponseEntity.ok(R.fail(Constants.HTTP_CODE_FAIL, "订单号不能为空"));
         }
         R result = riderOrderRecordService.riderCancelOrder(orderNum);
@@ -120,7 +124,7 @@
     // @PreAuthorize("@el.check('riderOrderRecord:list')")
     public ResponseEntity<?> riderCompleteOrder(@PathVariable String orderNum) {
         // 订单号不能为空
-        if (orderNum == null || orderNum.equals("")) {
+        if (StringUtils.isBlank(orderNum)) {
             return ResponseEntity.ok(R.fail(Constants.HTTP_CODE_FAIL, "订单号不能为空"));
         }
         R result = riderOrderRecordService.riderCompleteOrder(orderNum);
@@ -130,12 +134,24 @@
     @PostMapping("riderOperationOrder")
     @ApiOperation("骑手上报到店/取货配送")
     // @PreAuthorize("@el.check('riderOrderRecord:list')")
-    public ResponseEntity<?> riderOperationOrder(@RequestBody OrderRiderOperationVo orderRiderOperation) {
+    public ResponseEntity<?> riderOperationOrder(@RequestBody OrderRiderOperationVo orderRiderOperationVo) {
         // 订单号不能为空
-        if (orderRiderOperation.getOrderNum() == null || orderRiderOperation.getOrderNum().equals("")) {
+        if (StringUtils.isBlank(orderRiderOperationVo.getOrderNum())) {
             return ResponseEntity.ok(R.fail(Constants.HTTP_CODE_FAIL, "订单号不能为空"));
         }
-        R result = riderOrderRecordService.riderOperationOrder(orderRiderOperation);
+        R result = riderOrderRecordService.riderOperationOrder(orderRiderOperationVo);
+        return ResponseEntity.ok(R.success(result));
+    }
+
+    @PostMapping("riderDeliveryPhotos")
+    @ApiOperation("骑手上传图片记录")
+    // @PreAuthorize("@el.check('riderOrderRecord:list')")
+    public ResponseEntity<?> riderDeliveryPhotos(@RequestBody OrderDeliveryPhotosVo orderDeliveryPhotosVo) {
+        // 订单号不能为空
+        if (StringUtils.isBlank(orderDeliveryPhotosVo.getOrderNum())) {
+            return ResponseEntity.ok(R.fail(Constants.HTTP_CODE_FAIL, "订单号不能为空"));
+        }
+        Boolean result = riderDeliveryPhotosService.riderDeliveryPhotos(orderDeliveryPhotosVo);
         return ResponseEntity.ok(R.success(result));
     }
 
diff --git a/oying-system/src/main/java/com/oying/modules/rider/service/RiderDeliveryPhotosService.java b/oying-system/src/main/java/com/oying/modules/rider/service/RiderDeliveryPhotosService.java
new file mode 100644
index 0000000..3db8594
--- /dev/null
+++ b/oying-system/src/main/java/com/oying/modules/rider/service/RiderDeliveryPhotosService.java
@@ -0,0 +1,68 @@
+package com.oying.modules.rider.service;
+
+import com.oying.modules.rider.domain.RiderDeliveryPhotos;
+import com.oying.modules.rider.domain.dto.RiderDeliveryPhotosQueryCriteria;
+import java.util.Map;
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.oying.modules.rider.domain.vo.OrderDeliveryPhotosVo;
+import com.oying.utils.PageResult;
+
+/**
+* @description 服务接口
+* @author pxb
+* @date 2025-07-22
+**/
+public interface RiderDeliveryPhotosService extends IService<RiderDeliveryPhotos> {
+
+    /**
+    * 查询数据分页
+    * @param criteria 条件
+    * @param page 分页参数
+    * @return PageResult
+    */
+    PageResult<RiderDeliveryPhotos> queryAll(RiderDeliveryPhotosQueryCriteria criteria, Page<Object> page);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria 条件参数
+    * @return List<RiderDeliveryPhotosDto>
+    */
+    List<RiderDeliveryPhotos> queryAll(RiderDeliveryPhotosQueryCriteria criteria);
+
+    /**
+    * 创建
+    * @param resources /
+    */
+    void create(RiderDeliveryPhotos resources);
+
+    /**
+    * 编辑
+    * @param resources /
+    */
+    void update(RiderDeliveryPhotos resources);
+
+    /**
+    * 多选删除
+    * @param ids /
+    */
+    void deleteAll(List<Long> ids);
+
+    /**
+    * 导出数据
+    * @param all 待导出的数据
+    * @param response /
+    * @throws IOException /
+    */
+    void download(List<RiderDeliveryPhotos> all, HttpServletResponse response) throws IOException;
+
+    /**
+     * 新增配送照片记录
+     * @param orderDeliveryPhotosVo
+     * @throws IOException /
+     */
+    Boolean riderDeliveryPhotos(OrderDeliveryPhotosVo orderDeliveryPhotosVo);
+}
diff --git a/oying-system/src/main/java/com/oying/modules/rider/service/impl/RiderDeliveryPhotosServiceImpl.java b/oying-system/src/main/java/com/oying/modules/rider/service/impl/RiderDeliveryPhotosServiceImpl.java
new file mode 100644
index 0000000..2c0d9be
--- /dev/null
+++ b/oying-system/src/main/java/com/oying/modules/rider/service/impl/RiderDeliveryPhotosServiceImpl.java
@@ -0,0 +1,121 @@
+package com.oying.modules.rider.service.impl;
+
+import com.oying.modules.rider.domain.RiderDeliveryPhotos;
+import com.oying.modules.rider.domain.vo.OrderDeliveryPhotosVo;
+import com.oying.modules.rider.utils.Constants;
+import com.oying.modules.sh.domain.vo.OrderResponse;
+import com.oying.modules.sh.service.OrderService;
+import com.oying.utils.FileUtil;
+import lombok.RequiredArgsConstructor;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.oying.modules.rider.service.RiderDeliveryPhotosService;
+import com.oying.modules.rider.domain.dto.RiderDeliveryPhotosQueryCriteria;
+import com.oying.modules.rider.mapper.RiderDeliveryPhotosMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import com.oying.utils.PageUtil;
+
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+
+import com.oying.utils.PageResult;
+
+/**
+ * @author pxb
+ * @description 服务实现
+ * @date 2025-07-22
+ **/
+@Service
+@RequiredArgsConstructor
+public class RiderDeliveryPhotosServiceImpl extends ServiceImpl<RiderDeliveryPhotosMapper, RiderDeliveryPhotos> implements RiderDeliveryPhotosService {
+
+    private final RiderDeliveryPhotosMapper riderDeliveryPhotosMapper;
+    private final OrderService orderService;
+
+    @Override
+    public PageResult<RiderDeliveryPhotos> queryAll(RiderDeliveryPhotosQueryCriteria criteria, Page<Object> page) {
+        return PageUtil.toPage(riderDeliveryPhotosMapper.findAll(criteria, page));
+    }
+
+    @Override
+    public List<RiderDeliveryPhotos> queryAll(RiderDeliveryPhotosQueryCriteria criteria) {
+        return riderDeliveryPhotosMapper.findAll(criteria);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void create(RiderDeliveryPhotos resources) {
+        riderDeliveryPhotosMapper.insert(resources);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void update(RiderDeliveryPhotos resources) {
+        RiderDeliveryPhotos riderDeliveryPhotos = getById(resources.getPhotoId());
+        riderDeliveryPhotos.copy(resources);
+        riderDeliveryPhotosMapper.updateById(riderDeliveryPhotos);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void deleteAll(List<Long> ids) {
+        riderDeliveryPhotosMapper.deleteBatchIds(ids);
+    }
+
+    @Override
+    public void download(List<RiderDeliveryPhotos> all, HttpServletResponse response) throws IOException {
+        List<Map<String, Object>> list = new ArrayList<>();
+        for (RiderDeliveryPhotos riderDeliveryPhotos : all) {
+            Map<String, Object> map = new LinkedHashMap<>();
+            map.put("关联的订单ID", riderDeliveryPhotos.getOrderId());
+            map.put("关联的订单号", riderDeliveryPhotos.getOrderNum());
+            map.put("骑手ID", riderDeliveryPhotos.getRiderId());
+            map.put("骑手姓名", riderDeliveryPhotos.getRiderName());
+            map.put("骑手手机号", riderDeliveryPhotos.getRiderPhone());
+            map.put("照片存储的URL地址", riderDeliveryPhotos.getPhotoUrl());
+            map.put("照片存储ID", riderDeliveryPhotos.getUploadId());
+            map.put("拍摄地点纬度", riderDeliveryPhotos.getLatitude());
+            map.put("拍摄地点经度", riderDeliveryPhotos.getLongitude());
+            map.put("照片描述信息", riderDeliveryPhotos.getDescription());
+            map.put("是否有效 1-有效 0-无效", riderDeliveryPhotos.getIsValid());
+            map.put("用户手机号", riderDeliveryPhotos.getUserPhone());
+            map.put("用户id", riderDeliveryPhotos.getUserId());
+            map.put("创建人", riderDeliveryPhotos.getCreateBy());
+            map.put("修改人", riderDeliveryPhotos.getUpdateBy());
+            map.put("创建时间", riderDeliveryPhotos.getCreateTime());
+            map.put("修改时间", riderDeliveryPhotos.getUpdateTime());
+            list.add(map);
+        }
+        FileUtil.downloadExcel(list, response);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean riderDeliveryPhotos(OrderDeliveryPhotosVo orderDeliveryPhotosVo) {
+        OrderResponse orderResponse = orderService.getByOrderNum(orderDeliveryPhotosVo.getOrderNum());
+        if (orderResponse != null) {
+            // 封装数据
+            RiderDeliveryPhotos riderDeliveryPhotos = new RiderDeliveryPhotos();
+            riderDeliveryPhotos.setOrderId(orderResponse.getOrder().getOrderId());
+            riderDeliveryPhotos.setOrderNum(orderResponse.getOrder().getOrderNum());
+            riderDeliveryPhotos.setRiderId(orderResponse.getOrder().getRiderId());
+            riderDeliveryPhotos.setRiderName(orderResponse.getOrder().getRiderName());
+            riderDeliveryPhotos.setRiderPhone(orderResponse.getOrder().getRiderPhone());
+            riderDeliveryPhotos.setPhotoUrl(orderDeliveryPhotosVo.getPhotoUrl());
+            riderDeliveryPhotos.setUploadId(orderDeliveryPhotosVo.getUploadId());
+            riderDeliveryPhotos.setLatitude(orderDeliveryPhotosVo.getUserLatitude());
+            riderDeliveryPhotos.setLongitude(orderDeliveryPhotosVo.getUserLongitude());
+            riderDeliveryPhotos.setDescription(orderDeliveryPhotosVo.getDescription());
+            riderDeliveryPhotos.setIsValid(Constants.IS_VALID_YES);
+            riderDeliveryPhotos.setUserPhone(orderResponse.getOrder().getUsername());
+            riderDeliveryPhotos.setUserId(orderResponse.getOrder().getUserId());
+            return this.save(riderDeliveryPhotos);
+        }
+        return false;
+    }
+}
diff --git a/oying-system/src/main/java/com/oying/modules/rider/service/impl/RiderOrderRecordServiceImpl.java b/oying-system/src/main/java/com/oying/modules/rider/service/impl/RiderOrderRecordServiceImpl.java
index 78ac98d..ba8b304 100644
--- a/oying-system/src/main/java/com/oying/modules/rider/service/impl/RiderOrderRecordServiceImpl.java
+++ b/oying-system/src/main/java/com/oying/modules/rider/service/impl/RiderOrderRecordServiceImpl.java
@@ -4,14 +4,9 @@
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.oying.exception.BadRequestException;
 import com.oying.modules.pc.store.service.StoreService;
-import com.oying.modules.rider.domain.RiderIncomeDetail;
-import com.oying.modules.rider.domain.RiderInfo;
-import com.oying.modules.rider.domain.RiderOrderRecord;
-import com.oying.modules.rider.domain.RiderWalletInfo;
+import com.oying.modules.rider.domain.*;
 import com.oying.modules.rider.domain.vo.OrderRiderOperationVo;
-import com.oying.modules.rider.service.RiderIncomeDetailService;
-import com.oying.modules.rider.service.RiderInfoService;
-import com.oying.modules.rider.service.RiderWalletInfoService;
+import com.oying.modules.rider.service.*;
 import com.oying.modules.rider.utils.Constants;
 import com.oying.modules.sh.domain.Order;
 import com.oying.modules.sh.domain.vo.OrderResponse;
@@ -21,7 +16,6 @@
 import lombok.RequiredArgsConstructor;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.oying.modules.rider.service.RiderOrderRecordService;
 import com.oying.modules.rider.domain.dto.RiderOrderRecordQueryCriteria;
 import com.oying.modules.rider.mapper.RiderOrderRecordMapper;
 import org.springframework.stereotype.Service;
@@ -50,9 +44,9 @@
     private final RedisUtils redisUtils;
     private final OrderService orderService;
     private final RiderInfoService riderInfoService;
-    private final StoreService storeService;
     private final RiderWalletInfoService riderWalletInfoService;
     private final RiderIncomeDetailService riderIncomeDetailService;
+    private final RiderDeliveryPhotosService riderDeliveryPhotosService;
 
     @Override
     public PageResult<RiderOrderRecord> queryAll(RiderOrderRecordQueryCriteria criteria, Page<Object> page) {
@@ -253,6 +247,7 @@
         // riderOrderRecord.setDeliveryFeeId(orderResponse.getOrder().getDeliveryFeeId());
         riderOrderRecord.setOrderIncome(orderResponse.getOrder().getSendPrice());
         riderOrderRecord.setOrderTime(orderResponse.getOrder().getOrderTime());
+        riderOrderRecord.setUserName(orderResponse.getOrder().getUsername());
         create(riderOrderRecord);
     }
 
@@ -290,6 +285,12 @@
     @Override
     @Transactional(rollbackFor = Exception.class)
     public R riderCompleteOrder(String orderNum) {
+        // 是否上传送达照片
+        RiderDeliveryPhotos riderDeliveryPhotos = riderDeliveryPhotosService.getOne(
+                new QueryWrapper<RiderDeliveryPhotos>().eq(RiderDeliveryPhotos.COL_ORDER_NUM, orderNum));
+        if (riderDeliveryPhotos == null) {
+            return R.fail(400, "请上传送达照片");
+        }
         // 当前订单信息
         OrderResponse orderResponse = orderService.getByOrderNum(orderNum);
         Order order = orderResponse.getOrder();
diff --git a/oying-system/src/main/java/com/oying/modules/rider/utils/Constants.java b/oying-system/src/main/java/com/oying/modules/rider/utils/Constants.java
index ecbb6cc..04a90b6 100644
--- a/oying-system/src/main/java/com/oying/modules/rider/utils/Constants.java
+++ b/oying-system/src/main/java/com/oying/modules/rider/utils/Constants.java
@@ -45,6 +45,12 @@
     String IS_OVERTIME_YES = "1";
 
     /**
+     * 是否有效 1-有效 0-无效
+     */
+    String IS_VALID_YES = "1";
+    String IS_VALID_NO = "0";
+
+    /**
      * 订单来源: 1-平台派单 2-骑手抢单 3-商家直派 4-其他
      */
     String ORDER_SOURCE_PLATFORM = "1";
diff --git a/oying-system/src/main/java/com/oying/modules/rider/utils/RiderSourceHttpUtils.java b/oying-system/src/main/java/com/oying/modules/rider/utils/RiderSourceHttpUtils.java
index 3112573..1f616a6 100644
--- a/oying-system/src/main/java/com/oying/modules/rider/utils/RiderSourceHttpUtils.java
+++ b/oying-system/src/main/java/com/oying/modules/rider/utils/RiderSourceHttpUtils.java
@@ -11,6 +11,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -26,7 +27,7 @@
 public class RiderSourceHttpUtils {
 
     private static final Logger log = LoggerFactory.getLogger(RiderSourceHttpUtils.class);
-    // private static final String URL = "http://1.14.71.182:5000/";
+    private static final String URL = "https://1.95.3.255:443/lyhd/api/contract/syncRiderContract";
     // private static final String URL = "http://192.168.18.111:5000/";
 
 
@@ -72,28 +73,29 @@
         HashMap<String, Object> param = new HashMap<>(2);
         param.put("phones", phones);
         param.put("sourcePlatform", sourcePlatform);
-        // String url = "";
+        String url = URL;
         // 转化成对象
         RiderSourceInfoHttp riderSourceInfoHttp = new RiderSourceInfoHttp();
-        // try {
-        //     String result = httpPostRequest(param, url);
-        //     // 转换数据
-        //     riderSourceInfoHttp = riderConvertUtils(result);
-        // } catch (Exception e) {
-        //     riderSourceInfoHttp.setCode("500");
-        //     riderSourceInfoHttp.setMessage("获取数据失败");
-        //     riderSourceInfoHttp.setSuccess("false");
-        //     return riderSourceInfoHttp;
-        // }
-        riderSourceInfoHttp.setCode(Constants.HTTP_CODE_SUCCESS);
-        riderSourceInfoHttp.setMessage("请求成功");
-        RiderSourceInfo riderSourceInfo = new RiderSourceInfo();
-        riderSourceInfo.setSourcePlatform("LY");
-        riderSourceInfo.setCardNum("123456789012345678");
-        riderSourceInfo.setPhone("18706999997");
-        riderSourceInfo.setCardName("张三");
-        riderSourceInfo.setEnabled(Constants.SOURCE_ENABLED_ON);
-        riderSourceInfoHttp.getData().add(riderSourceInfo);
+        try {
+            String result = httpPostRequest(param, url);
+            log.info("第三方骑手数据信息:{}", result);
+            // 转换数据
+            riderSourceInfoHttp = riderConvertUtils(result);
+        } catch (Exception e) {
+            riderSourceInfoHttp.setCode("500");
+            riderSourceInfoHttp.setMessage("获取数据失败");
+            riderSourceInfoHttp.setData(null);
+            return riderSourceInfoHttp;
+        }
+        // riderSourceInfoHttp.setCode(Constants.HTTP_CODE_SUCCESS);
+        // riderSourceInfoHttp.setMessage("请求成功");
+        // RiderSourceInfo riderSourceInfo = new RiderSourceInfo();
+        // riderSourceInfo.setSourcePlatform("LY");
+        // riderSourceInfo.setCardNum("123456789012345678");
+        // riderSourceInfo.setPhone("18706999997");
+        // riderSourceInfo.setCardName("张三");
+        // riderSourceInfo.setEnabled(Constants.SOURCE_ENABLED_ON);
+        // riderSourceInfoHttp.getData().add(riderSourceInfo);
         return riderSourceInfoHttp;
     }
 
@@ -115,4 +117,10 @@
             return riderSourceInfoHttp;
         }
     }
+
+    public static void main(String[] args) {
+        List<String> phones = new ArrayList<>();
+        phones.add("13954532585");
+        RiderSourceHttpUtils.getRiderSourceInfoHttp(phones, "LY");
+    }
 }
diff --git a/oying-system/src/main/resources/mapper/rider/RiderDeliveryPhotosMapper.xml b/oying-system/src/main/resources/mapper/rider/RiderDeliveryPhotosMapper.xml
new file mode 100644
index 0000000..32d1a3d
--- /dev/null
+++ b/oying-system/src/main/resources/mapper/rider/RiderDeliveryPhotosMapper.xml
@@ -0,0 +1,64 @@
+<?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.oying.modules.rider.mapper.RiderDeliveryPhotosMapper">
+    <resultMap id="BaseResultMap" type="com.oying.modules.rider.domain.RiderDeliveryPhotos">
+        <id column="photo_id" property="photoId"/>
+        <result column="order_id" property="orderId"/>
+        <result column="order_num" property="orderNum"/>
+        <result column="rider_id" property="riderId"/>
+        <result column="rider_name" property="riderName"/>
+        <result column="rider_phone" property="riderPhone"/>
+        <result column="photo_url" property="photoUrl"/>
+        <result column="upload_id" property="uploadId"/>
+        <result column="latitude" property="latitude"/>
+        <result column="longitude" property="longitude"/>
+        <result column="description" property="description"/>
+        <result column="is_valid" property="isValid"/>
+        <result column="user_phone" property="userPhone"/>
+        <result column="user_id" property="userId"/>
+        <result column="create_by" property="createBy"/>
+        <result column="update_by" property="updateBy"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_time" property="updateTime"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        photo_id, order_id, order_num, rider_id, rider_name, rider_phone, photo_url, upload_id, latitude, longitude, description, is_valid, user_phone, user_id, create_by, update_by, create_time, update_time
+    </sql>
+
+    <select id="findAll" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from qs_rider_delivery_photos
+        <where>
+            <if test="criteria.orderId != null">
+                and order_id = #{criteria.orderId}
+            </if>
+            <if test="criteria.orderNum != null">
+                and order_num = #{criteria.orderNum}
+            </if>
+            <if test="criteria.riderId != null">
+                and rider_id = #{criteria.riderId}
+            </if>
+            <if test="criteria.riderName != null">
+                and rider_name = #{criteria.riderName}
+            </if>
+            <if test="criteria.riderPhone != null">
+                and rider_phone = #{criteria.riderPhone}
+            </if>
+            <if test="criteria.uploadId != null">
+                and upload_id = #{criteria.uploadId}
+            </if>
+            <if test="criteria.userPhone != null">
+                and user_phone = #{criteria.userPhone}
+            </if>
+            <if test="criteria.userId != null">
+                and user_id = #{criteria.userId}
+            </if>
+            <if test="criteria.createTime != null and criteria.createTime.size() > 0">
+                AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]}
+            </if>
+        </where>
+        order by photo_id desc
+    </select>
+</mapper>
\ No newline at end of file
diff --git a/oying-system/src/main/resources/mapper/rider/RiderOrderRecordMapper.xml b/oying-system/src/main/resources/mapper/rider/RiderOrderRecordMapper.xml
index 354abbc..d8db864 100644
--- a/oying-system/src/main/resources/mapper/rider/RiderOrderRecordMapper.xml
+++ b/oying-system/src/main/resources/mapper/rider/RiderOrderRecordMapper.xml
@@ -31,6 +31,7 @@
         <result column="user_id" property="userId"/>
         <result column="delivery_fee_id" property="deliveryFeeId"/>
         <result column="order_time" property="orderTime"/>
+        <result column="user_name" property="userName"/>
     </resultMap>
 
     <sql id="Base_Column_List">
@@ -62,7 +63,8 @@
         merchant_longitude,
         merchant_latitude,
         delivery_fee_id,
-        order_time
+        order_time,
+        user_name
     </sql>
     <select id="findAll" resultMap="BaseResultMap">
         select
@@ -75,10 +77,16 @@
             <if test="criteria.userId != null">
                 and user_id = #{criteria.userId}
             </if>
+            <if test="criteria.userName != null">
+                and user_name = #{criteria.userName}
+            </if>
             <if test="criteria.orderId != null">
                 and order_id = #{criteria.orderId}
             </if>
-            <if test="criteria.orderNum != null">
+            <if test="criteria.phone != null">
+                and phone = #{criteria.phone}
+            </if>
+             <if test="criteria.orderNum != null">
                 and order_num = #{criteria.orderNum}
             </if>
             <if test="criteria.merchantId != null">

--
Gitblit v1.9.3