From e1940dda45fa066d994cc5cf0e34c7f97d9e7b2d Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期三, 02 四月 2025 09:42:45 +0800
Subject: [PATCH] 修改bug

---
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/OrderCrossCityServiceImpl.java |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/OrderCrossCityServiceImpl.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/OrderCrossCityServiceImpl.java
index 4f9cd6c..21a335c 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/OrderCrossCityServiceImpl.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/OrderCrossCityServiceImpl.java
@@ -1198,21 +1198,11 @@
     public ResultUtil addCancle(Integer id, String reason, String remark, Integer uid) throws Exception {
         if(ToolUtil.isNotEmpty(remark)){
             if(ToolUtil.isNotEmpty(remark)){
+                remark = remark.toLowerCase();
                 List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null);
-                List<String> list = Arrays.asList(remark.split(" "));
-                for(SensitiveWords s : sensitiveWords){
-                    List<String> str = new ArrayList<>();
-                    String lowerCase = s.getContent().toLowerCase();
-                    for (String s1 : list) {
-                        if(lowerCase.equals(s1.toLowerCase())){
-                            str.add("***");
-                        }else{
-                            str.add(s1);
-                        }
-                    }
-                    list = str;
+                for(SensitiveWords s : sensitiveWords) {
+                    remark = remark.replaceAll(s.getContent().toLowerCase(), "***");
                 }
-                remark = list.stream().collect(Collectors.joining(" "));
             }
         }
 
@@ -1592,7 +1582,7 @@
             if(ToolUtil.isEmpty(userInfo.getPhone())){
                 return ResultUtil.error("请先绑定手机号码");
             }
-            orderPrivateCar.setPassengers(userInfo.getFirstName() + "." + userInfo.getLastName());
+            orderPrivateCar.setPassengers(ToolUtil.isNotEmpty(userInfo.getFirstName()) ? userInfo.getFirstName() + "." + userInfo.getLastName() : "");
             orderPrivateCar.setPassengersPhone(userInfo.getPhone());
         }
         orderPrivateCar.setState(1);

--
Gitblit v1.7.1