From 6e70ee2d0b73f70fe1140cc7d51c4e847d50aa51 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期四, 17 四月 2025 10:54:26 +0800
Subject: [PATCH] 2.0迭代师傅订单列表

---
 ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/controller/OrderController.java |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/controller/OrderController.java b/ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/controller/OrderController.java
index 8b75f97..cf1d75f 100644
--- a/ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/controller/OrderController.java
+++ b/ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/controller/OrderController.java
@@ -95,19 +95,21 @@
      *
      * @param state 订单状态(0:全部、1:待上门、2:已完结)
      */
-    @ApiOperation(value = "订单列表", tags = {"师傅端-订单列表"})
+    @ApiOperation(value = "订单列表", tags = {"师傅端-订单列表[2.0]"})
     @GetMapping(value = "/orderList")
     @ApiImplicitParams({
-            @ApiImplicitParam(value = "订单状态(0:全部、1:待上门、2:已完结)", name = "state", dataType = "Integer", required = true)
+            @ApiImplicitParam(value = "订单状态(0:全部、1:待上门、2:已完结、7:待预约)", name = "state", dataType = "Integer", required = true),
+            @ApiImplicitParam(value = "姓名,电话,地址搜索", name = "searchValues", dataType = "String", required = false),
     })
     public R<Page<Order>> orderList(@RequestParam Integer state,
+                                    @RequestParam String searchValues,
                                     @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         LoginUserInfo loginWorker = tokenService.getLoginUserByWorker();
         if (null == loginWorker) {
             return R.loginExpire("登录失效!");
         }
-        Page<Order> dataList = orderClient.orderListWorker(loginWorker.getUserid(), state, pageNum, pageSize).getData();
+        Page<Order> dataList = orderClient.orderListWorker(loginWorker.getUserid(), state,searchValues, pageNum, pageSize).getData();
         List<Order> orderList = dataList.getRecords();
         List<Integer> ids = orderList.stream().map(Order::getServeId).collect(Collectors.toList());
         if (!ids.isEmpty()) {
@@ -535,7 +537,7 @@
 //
 //    }
 
-    @ApiOperation(value = "上传经纬度", tags = {"师傅端-首页"})
+    @ApiOperation(value = "上传经纬度", tags = {"师傅端-首页[2.0]"})
     @GetMapping(value = "/putLocation")
     @ApiImplicitParams({
             @ApiImplicitParam(value = "workId", name = "workId", dataType = "int", required = true),
@@ -545,11 +547,20 @@
     public R<Object> orderNavigation(@RequestParam Integer workId, @RequestParam String longitude,
                                      @RequestParam String latitude) {
         Result<String> address = GaoDeMapUtil.getCityCode(longitude, latitude);
-        System.err.println(address.getDatas());
+        String cityCode = address.getDatas();
+        System.err.println("城市code"+cityCode);
+        String provinceCode = cityCode.substring(0, 2) + "0000";
+        System.err.println("省份code"+provinceCode);
         Set<Integer> strings = new HashSet<>();
         strings.add(workId);
-        redisService.setCacheSet("workerLocation:"+address.getDatas()+":", strings);
+        redisService.setCacheSet("workerLocation:"+cityCode+":", strings);
+        redisService.setCacheSet("workerLocation:"+provinceCode+":", strings);
         redisService.setCacheObject("work:"+workId+":", longitude+","+latitude);
+        masterWorkerService.lambdaUpdate()
+                .set(MasterWorker::getWorkerLon, longitude)
+                .set(MasterWorker::getWorkerLat, latitude)
+                .eq(MasterWorker::getId, workId)
+                .eq(MasterWorker::getIsDelete, 0).update();
         return R.ok();
 
     }

--
Gitblit v1.7.1