From a73f1ac7a2d006b207f06534604100e01f6119a5 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期四, 21 八月 2025 01:12:16 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/QianYunTong

---
 UserQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java |  207 ++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 138 insertions(+), 69 deletions(-)

diff --git a/UserQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java b/UserQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java
index 5a52f13..1978e22 100644
--- a/UserQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java
+++ b/UserQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java
@@ -1,69 +1,138 @@
-package com.stylefeng.guns;
-
-import com.alibaba.fastjson.JSON;
-import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
-import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
-import com.stylefeng.guns.modular.system.model.Company;
-import com.stylefeng.guns.modular.system.model.Driver;
-import com.stylefeng.guns.modular.system.model.UserInfo;
-import com.stylefeng.guns.modular.system.service.ICompanyService;
-import com.stylefeng.guns.modular.system.service.IDriverService;
-import com.stylefeng.guns.modular.system.service.IUserInfoService;
-import com.stylefeng.guns.modular.system.util.EmailUtil;
-import com.stylefeng.guns.modular.system.util.qianyuntong.OrderUtil;
-import com.stylefeng.guns.modular.system.util.qianyuntong.UserUtil;
-import com.stylefeng.guns.modular.system.util.qianyuntong.model.*;
-import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.mail.MessagingException;
-import java.io.UnsupportedEncodingException;
-import java.math.BigDecimal;
-import java.util.List;
-
-/**
- * SpringBoot方式启动类
- *
- * @author stylefeng
- * @Date 2017/5/21 12:06
- */
-@Slf4j
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class GunsApplicationTest {
-
-	@Autowired
-	private IOrderPrivateCarService orderPrivateCarService;
-
-	@Autowired
-	private IUserInfoService userInfoService;
-
-	@Autowired
-	private IDriverService driverService;
-	@Autowired
-	private ICompanyService companyService;
-	@Autowired
-	private IPaymentRecordService paymentRecordService;
-    @Autowired
-    private EmailUtil emailUtil;
-
-
-
-
-	@Test
-	public void test(){
-        try {
-            emailUtil.sendEmailWithAttachment("393733352@qq.com", "贵人家园出行-行程单", "请查收您的行程单", null, "贵人家园出行-行程单");
-        } catch (MessagingException e) {
-            throw new RuntimeException(e);
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e);
-        }
-    }
-}
+//package com.stylefeng.guns;
+//
+//import com.alibaba.fastjson.JSON;
+//import com.stylefeng.guns.core.util.ToolUtil;
+//import com.stylefeng.guns.modular.shunfeng.model.DriverRide;
+//import com.stylefeng.guns.modular.shunfeng.model.Evaluate;
+//import com.stylefeng.guns.modular.shunfeng.model.OrderRide;
+//import com.stylefeng.guns.modular.shunfeng.service.IDriverRideService;
+//import com.stylefeng.guns.modular.shunfeng.service.IEvaluateService;
+//import com.stylefeng.guns.modular.shunfeng.service.IOrderRideService;
+//import com.stylefeng.guns.modular.shunfeng.util.SensitiveWordUtil;
+//import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
+//import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
+//import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper;
+//import com.stylefeng.guns.modular.system.model.Company;
+//import com.stylefeng.guns.modular.system.model.Driver;
+//import com.stylefeng.guns.modular.system.model.SensitiveWords;
+//import com.stylefeng.guns.modular.system.model.UserInfo;
+//import com.stylefeng.guns.modular.system.service.ICompanyService;
+//import com.stylefeng.guns.modular.system.service.IDriverService;
+//import com.stylefeng.guns.modular.system.service.IUserInfoService;
+//import com.stylefeng.guns.modular.system.util.EmailUtil;
+//import com.stylefeng.guns.modular.system.util.ResultUtil;
+//import com.stylefeng.guns.modular.system.util.qianyuntong.OrderUtil;
+//import com.stylefeng.guns.modular.system.util.qianyuntong.UserUtil;
+//import com.stylefeng.guns.modular.system.util.qianyuntong.model.*;
+//import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
+//import lombok.extern.slf4j.Slf4j;
+//import org.junit.Test;
+//import org.junit.runner.RunWith;
+//import org.springframework.beans.BeanUtils;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.boot.test.context.SpringBootTest;
+//import org.springframework.test.context.junit4.SpringRunner;
+//
+//import javax.annotation.Resource;
+//import javax.mail.MessagingException;
+//import java.io.UnsupportedEncodingException;
+//import java.math.BigDecimal;
+//import java.util.Date;
+//import java.util.HashSet;
+//import java.util.List;
+//import java.util.Set;
+//
+///**
+// * SpringBoot方式启动类
+// *
+// * @author stylefeng
+// * @Date 2017/5/21 12:06
+// */
+//@Slf4j
+//@RunWith(SpringRunner.class)
+//@SpringBootTest
+//public class GunsApplicationTest {
+//
+//	@Autowired
+//	private IOrderPrivateCarService orderPrivateCarService;
+//
+//	@Autowired
+//	private IUserInfoService userInfoService;
+//
+//	@Autowired
+//	private IDriverService driverService;
+//	@Autowired
+//	private ICompanyService companyService;
+//	@Autowired
+//	private IPaymentRecordService paymentRecordService;
+//    @Autowired
+//    private EmailUtil emailUtil;
+//    /*顺风车司机*/
+//    @Autowired
+//    private IDriverRideService driverRideService;
+//
+//    @Resource
+//    private SensitiveWordsMapper sensitiveWordsMapper;
+//    /*评价*/
+//    @Autowired
+//    private IEvaluateService evaluateService;
+//    /*顺风车订单*/
+//    @Autowired
+//    private IOrderRideService orderRideService;
+//
+//
+//
+//
+//	@Test
+//	public void test(){
+//        Integer orderId = 163;
+//        Integer score = 5;
+//        Integer userId = 17;
+//        String content = "";
+//        Integer driverId = 37;
+//        try {
+//            Evaluate evaluate=new Evaluate();
+//            evaluate.setAddTime(new Date());
+//            evaluate.setType(8);
+//            evaluate.setOrderId(orderId);
+//            evaluate.setScore(score);
+//            evaluate.setUserId(userId);
+//            if(ToolUtil.isNotEmpty(content)){
+//                /*判断评价内容是否包含敏感词*/
+//                List<SensitiveWords> list = sensitiveWordsMapper.selectList(null);
+//                Set<String> sensitiveWordSet = new HashSet<>();
+//                for(SensitiveWords gs:list){
+//                    sensitiveWordSet.add(gs.getContent());
+//                }
+//                SensitiveWordUtil.init(sensitiveWordSet);
+//                boolean result = SensitiveWordUtil.contains(content);
+//
+//            }
+//            evaluate.setContent(content);
+//            evaluate.setDriverId(driverId);
+//            /*查询用户手机号*/
+//            UserInfo userInfo=userInfoService.selectById(userId);
+//            if(userInfo!=null){
+//                evaluate.setUserPhone(userInfo.getPhone());
+//            }
+//            /*查询司机电话*/
+//            DriverRide driverRide=driverRideService.selectById(driverId);
+//            if(driverRide!=null){
+//                /*计算司机的评分*/
+//                driverRide.setEvaluateNum((null != driverRide.getEvaluateNum() ? driverRide.getEvaluateNum() : 0 )+1);
+//                driverRide.setEvaluateScore((null == driverRide.getEvaluateScore() ? 0 : driverRide.getEvaluateScore())+score);
+//                driverRideService.updateById(driverRide);
+//            }
+//            /*标记订单已评价*/
+//            OrderRide orderTaxi=new OrderRide();
+//            orderTaxi.setId(orderId);
+//            orderTaxi.setIsEvaluate(2);
+//            orderTaxi.setEvaluateScoreUser(score);
+//            orderTaxi.setContent(content);
+//            orderRideService.updateById(orderTaxi);
+//            evaluateService.insert(evaluate);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//    }
+//}

--
Gitblit v1.7.1