From 4af0a2ddc8940cd38d0e602409cace1a7c50ea13 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期一, 04 八月 2025 09:55:58 +0800 Subject: [PATCH] 新增加开通城市基础配置功能 --- DriverQYTTravel/guns-admin/src/test/java/com/stylefeng/guns/GunsApplicationTest.java | 32 +++++++++++++++++++++----------- 1 files changed, 21 insertions(+), 11 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 96776f7..49643d3 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,26 +1,36 @@ package com.stylefeng.guns; -import com.stylefeng.guns.modular.system.util.qianyuntong.EnterpriseUtil; -import com.stylefeng.guns.modular.system.util.qianyuntong.model.CreateEnterpriseRequest; import org.junit.Test; import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class GunsApplicationTest { - + @Autowired + private MongoTemplate mongoTemplate; + + @Test - public void test() throws Exception { - CreateEnterpriseRequest request = new CreateEnterpriseRequest(); - request.setName("成都喜望科技有限公司"); - request.setNickName("成都喜望"); - request.setIndustry_code("123456789"); - request.setMobile("15828353127"); - request.setMobileFlag("1"); - Boolean enterprise = EnterpriseUtil.createEnterprise(request); + 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); } } -- Gitblit v1.7.1