From c78417df3dc09978a82dd6f1e122a9bfb5f5cd06 Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期二, 05 八月 2025 17:13:24 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/QianYunTong --- DriverQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java | 45 ++++++++++++++++++++++++++++----------------- 1 files changed, 28 insertions(+), 17 deletions(-) diff --git a/DriverQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java b/DriverQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java index 49643d3..ae5d1f0 100644 --- a/DriverQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java +++ b/DriverQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java @@ -1,5 +1,11 @@ package com.stylefeng.guns; +import com.stylefeng.guns.modular.system.model.Driver; +import com.stylefeng.guns.modular.system.service.IDriverService; +import com.stylefeng.guns.modular.system.util.zhenglian.ZhengLianUtil; +import com.stylefeng.guns.modular.system.util.zhenglian.model.TokenRequest; +import com.stylefeng.guns.modular.system.util.zhenglian.model.TradeTerminalInfo; +import com.stylefeng.guns.modular.system.util.zhenglian.model.ZLUserInfo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -10,27 +16,32 @@ @RunWith(SpringRunner.class) @SpringBootTest public class GunsApplicationTest { - + @Autowired private MongoTemplate mongoTemplate; + @Autowired + private IDriverService driverService; @Test - public void test(){ -// GeoJsonPoint point = new GeoJsonPoint(new Point(Double.parseDouble("104.043149"), -// Double.parseDouble("30.642483"))); -// DriverPosition position = mongoTemplate.findOne(Query.query(Criteria.where("driverId") -// .is(14)), DriverPosition.class); -// if(null == position){ -// position = new DriverPosition(); -// } -// position.setDriverId(14); -// position.setPoint(point); -// mongoTemplate.save(position); - - -// Query query = Query.query(Criteria.where("point").nearSphere(new Point(Double.parseDouble("104.043149"), Double.parseDouble("30.642483"))).maxDistance(5000)); -// List<DriverPosition> driverPositions = mongoTemplate.find(query, DriverPosition.class); -// System.err.println(driverPositions); + public void test() { + + Driver driver = driverService.selectById(14); + TokenRequest tokenRequest = new TokenRequest(); + tokenRequest.setAppUserId(driver.getEmpId().toString()); + tokenRequest.setUserName(driver.getName()); + tokenRequest.setCertNo(driver.getIdCard()); + tokenRequest.setPhone(driver.getPhone()); + TradeTerminalInfo tradeTerminalInfo = new TradeTerminalInfo(); + tradeTerminalInfo.setIp("127.0.0.1"); + tradeTerminalInfo.setTerminal("1"); + tradeTerminalInfo.setMac(""); + ZLUserInfo userInfo = null; + try { + userInfo = ZhengLianUtil.getUserInfo("14", tradeTerminalInfo); + } catch (Exception e) { + throw new RuntimeException(e); + } + System.err.println(userInfo); } } -- Gitblit v1.7.1