From 6c764f473b1e0e9dd2fb13034fe0d7295ab3724e Mon Sep 17 00:00:00 2001
From: xuefei <564615061@qq.cm>
Date: 星期二, 08 八月 2023 11:05:58 +0800
Subject: [PATCH] 允许跨域

---
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java
index ac9f147..0fb4216 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java
@@ -231,20 +231,22 @@
         map.put("name", "");
         map.put("sectons", null);
         if (list.size() > 0) {
-            Area areaName = iAreaService.getById(list.get(0).getAreaId());
             List<String> temp = new ArrayList<>();
+            List<String> tempIds = new ArrayList<>();
             List<AreaSection> areaSections = new ArrayList<>();
             for(int i=0;i<list.size();i++){
-                if(!temp.contains(list.get(i).getAreaSectionId())){
+                if(!tempIds.contains(list.get(i).getAreaSectionId())){
+                    tempIds.add(list.get(i).getAreaSectionId());
                     AreaSection a = iAreaSectionService.getById(list.get(i).getAreaSectionId());
                     temp.add(a.getName());
                     areaSections.add(a);
                 }
             }
-            map.put("name", areaName + StringUtils.join(temp,"-"));
+            map.put("name", area.getName() + StringUtils.join(temp,"-"));
             map.put("sectons",areaSections);
             temp.clear();
-            areaSections.clear();
+            tempIds.clear();
+            //areaSections.clear();
             list.clear();
         }
         return new ResultUtil<Object>().setData(map);
@@ -559,6 +561,55 @@
         return ResultUtil.success("娣诲姞鎴愬姛");
     }
 
+    @RequestMapping(value = "/signForX", method = RequestMethod.POST)
+    @ApiOperation(value = "绛炬敹")
+    public Object signForX(String orderId, int status, String content, String customerReceiveId, int time, String carId,String img) {
+        if (status == 1) {
+            if (StrUtil.isEmpty(customerReceiveId)) {
+                return ResultUtil.error("姝e父绛炬敹锛屾帴璐т汉id蹇呭~");
+            }
+        }
+
+        if (StrUtil.isEmpty(carId)) {
+            return ResultUtil.error("杞﹁締id涓嶈兘涓虹┖");
+        }
+        OrderTask orderTask = iOrderTaskService.getById(orderId);
+        orderTask.setStatus(status);
+        orderTask.setUserId(securityUtil.getCurrUser().getId());
+        orderTask.setTime(time);
+        orderTask.setCarId(carId);
+        if (StrUtil.isNotEmpty(customerReceiveId)) {
+            orderTask.setCustomerReceiveId(customerReceiveId);
+        }
+        if(StrUtil.isNotEmpty(img)){
+            if(StrUtil.isNotEmpty(orderTask.getImg())){
+                String imgO = orderTask.getImg();
+                orderTask.setImg(imgO+","+img);
+            }else{
+                orderTask.setImg(","+img);
+            }
+        }
+
+        if (!StrUtil.isEmpty(content)) {
+            orderTask.setRemarks(content);
+        } else {
+            if (status == 2) {
+                return ResultUtil.error("璇峰~鍐欏紓甯哥鏀跺師鍥�");
+            }
+        }
+        iOrderTaskService.saveOrUpdate(orderTask);
+
+        Car car = iCarService.getById(orderTask.getCarId());
+        EventLog eventLog = new EventLog();
+        eventLog.setCarNo(car.getCarNo());
+        eventLog.setRefId(orderId);
+        eventLog.setType(6);//6:閰嶉�佸畬鎴�
+        iEventLogService.saveOrUpdate(eventLog);
+
+        saveLog();
+        return ResultUtil.success("娣诲姞鎴愬姛");
+    }
+
     private void saveLog() {
         QueryWrapper<OrderLog> wp = new QueryWrapper<>();
         wp.eq("type", 2);

--
Gitblit v1.9.1