From ae32c3a7d77e2ed114555623c70e3fbd1d6aba59 Mon Sep 17 00:00:00 2001
From: wang-hao-jie <1550036656@qq.com>
Date: 星期四, 10 三月 2022 08:47:45 +0800
Subject: [PATCH] 违章记录
---
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java | 62 +++++++++++++++++++++++-------
1 files changed, 47 insertions(+), 15 deletions(-)
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
index c7e2b16..676b95d 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
@@ -95,7 +95,7 @@
//openId锛氬井淇d
@RequestMapping(value = "/bindWx", method = RequestMethod.POST)
@ApiOperation(value = "寰俊缁戝畾闆跺敭璁稿彲璇�")
- public Object bindWx(String licence,String openId){
+ public Object bindWx(String licence,String openId,String linker,String phone){
QueryWrapper<Customer> wrapper2 = new QueryWrapper<>();
wrapper2.eq("open_id",openId);
Customer c = iCustomerService.getOne(wrapper2);
@@ -109,6 +109,12 @@
QueryWrapper<Customer> wrapper = new QueryWrapper<>();
wrapper.eq("licence",licence);
+ if(StrUtil.isNotEmpty(linker)){
+ wrapper.eq("linker",linker);
+ }
+ if(StrUtil.isNotEmpty(phone)){
+ wrapper.eq("phone",phone);
+ }
Customer one = iCustomerService.getOne(wrapper);
if(one==null){
return ResultUtil.error("闆跺敭璁稿彲璇佹棤鏁�");//棣栨鐧婚檰闇�缁戝畾闆跺敭璁稿彲璇�
@@ -157,21 +163,47 @@
}
String carId = orderTask.getCarId();
Car car = iCarService.getById(carId);
- String[] carids = new String[1];
- carids[0]= car.getCode();
- String latestGps = haiKangPost.findLatestGps(carids);
- JSONObject jsonObject = JSONUtil.parseObj(latestGps);
- String data = jsonObject.getStr("data");
- JSONArray objects = JSONUtil.parseArray(data);
- JSONObject jsonObject2 = objects.getJSONObject(0);
- Integer lng = jsonObject2.getInt("longitude");
- Integer lat = jsonObject2.getInt("latitude");
-
- DecimalFormat df = new DecimalFormat("#.000000");
Map<String,Object> map = new HashMap<>();
- map.put("lng",df.format(lng/360000.0));
- map.put("lat",df.format(lat/360000.0));
- map.put("content","杩樻湁3鍗曪紝棰勮10锛�22閫佽揪");
+ map.put("lng",118.167491);
+ map.put("lat",39.651253);
+ map.put("content","鏆傛棤杞﹁締鏁版嵁");
+ if(StrUtil.isEmpty(car.getCode())){
+ return ResultUtil.data(map);
+ }
+ try {
+ String[] carids = new String[1];
+ carids[0]= car.getCode();
+ String latestGps = haiKangPost.findLatestGps(carids);
+ JSONObject jsonObject = JSONUtil.parseObj(latestGps);
+ String data = jsonObject.getStr("data");
+ JSONArray objects = JSONUtil.parseArray(data);
+ JSONObject jsonObject2 = objects.getJSONObject(0);
+ Integer lng = jsonObject2.getInt("longitude");
+ Integer lat = jsonObject2.getInt("latitude");
+
+ DecimalFormat df = new DecimalFormat("#.000000");
+ map.put("lng",df.format(lng/360000.0));
+ map.put("lat",df.format(lat/360000.0));
+ }catch (Exception e){
+
+ }
+ QueryWrapper<OrderTask> wrapper = new QueryWrapper<OrderTask>();
+ wrapper.eq("area_id",orderTask.getAreaId());
+ wrapper.eq("send_date",format);
+ wrapper.eq("status",0);
+ wrapper.orderByAsc("seq");
+ List<OrderTask> list = iOrderTaskService.list(wrapper);
+
+ if(list.size()>0){
+ if(list.get(0).getSeq()<orderTask.getSeq()){
+ int i = orderTask.getSeq() - list.get(0).getSeq();
+ map.put("content","杩樻湁"+i+"鍗曪紝棰勮"+(i*5)+"鍒嗛挓鍚庨�佽揪");
+ }
+ if(list.get(0).getSeq()==orderTask.getSeq()){
+ int i = orderTask.getSeq() - list.get(0).getSeq();
+ map.put("content","棰勮5鍒嗛挓鍐呴�佽揪");
+ }
+ }
return ResultUtil.data(map);
}
--
Gitblit v1.9.1