|
@@ -3,7 +3,9 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.plugins.Page;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
import com.openapi.sdk.service.DataExchangeService;
|
|
import com.openapi.sdk.service.DataExchangeService;
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
@@ -11,6 +13,7 @@ import com.yh.saas.plugin.yiliangyiyun.entity.view.GpsView;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.HyOrderTravelPathMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.HyOrderTravelPathMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.util.PositionUtil;
|
|
import com.yh.saas.plugin.yiliangyiyun.util.PositionUtil;
|
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -51,23 +54,23 @@ public class HyOrderTravelPathServiceImpl extends ServiceImpl<HyOrderTravelPathM
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public String addInfo(HyOrderTravelPath hyOrderTravelPath) {
|
|
public String addInfo(HyOrderTravelPath hyOrderTravelPath) {
|
|
- HyOrderTravelPath hyOrderTravelPath1 = this.selectOne(new EntityWrapper<HyOrderTravelPath>()
|
|
|
|
- .eq("order_id", hyOrderTravelPath.getOrderId()).eq("delete_flag", "0"));
|
|
|
|
- if (hyOrderTravelPath1 == null) {
|
|
|
|
- hyOrderTravelPath.setId(IdGenerator.generateUUID());
|
|
|
|
- hyOrderTravelPath.setType("1");
|
|
|
|
- hyOrderTravelPath.setOrderId(hyOrderTravelPath.getOrderId());
|
|
|
|
- hyOrderTravelPath.setLongitudeLatitude(hyOrderTravelPath.getLongitudeLatitude());
|
|
|
|
- hyOrderTravelPath.setStartDate(new Date());
|
|
|
|
- this.insert(hyOrderTravelPath);
|
|
|
|
- } else {
|
|
|
|
- hyOrderTravelPath1.setLongitudeLatitude(hyOrderTravelPath1.getLongitudeLatitude()
|
|
|
|
- .substring(0, hyOrderTravelPath1.getLongitudeLatitude().length() - 1) + ","
|
|
|
|
- + hyOrderTravelPath.getLongitudeLatitude()
|
|
|
|
- .substring(1));
|
|
|
|
- hyOrderTravelPath1.setEndDate(new Date());
|
|
|
|
- this.updateById(hyOrderTravelPath1);
|
|
|
|
- }
|
|
|
|
|
|
+// HyOrderTravelPath hyOrderTravelPath1 = this.selectOne(new EntityWrapper<HyOrderTravelPath>()
|
|
|
|
+// .eq("order_id", hyOrderTravelPath.getOrderId()).eq("delete_flag", "0"));
|
|
|
|
+// if (hyOrderTravelPath1 == null) {
|
|
|
|
+ hyOrderTravelPath.setId(IdGenerator.generateUUID());
|
|
|
|
+ hyOrderTravelPath.setType("1");
|
|
|
|
+ hyOrderTravelPath.setOrderId(hyOrderTravelPath.getOrderId());
|
|
|
|
+ hyOrderTravelPath.setLongitudeLatitude(hyOrderTravelPath.getLongitudeLatitude());
|
|
|
|
+ hyOrderTravelPath.setStartDate(new Date());
|
|
|
|
+ this.insert(hyOrderTravelPath);
|
|
|
|
+// } else {
|
|
|
|
+// hyOrderTravelPath1.setLongitudeLatitude(hyOrderTravelPath1.getLongitudeLatitude()
|
|
|
|
+// .substring(0, hyOrderTravelPath1.getLongitudeLatitude().length() - 1) + ","
|
|
|
|
+// + hyOrderTravelPath.getLongitudeLatitude()
|
|
|
|
+// .substring(1));
|
|
|
|
+// hyOrderTravelPath1.setEndDate(new Date());
|
|
|
|
+// this.updateById(hyOrderTravelPath1);
|
|
|
|
+// }
|
|
return "ok";
|
|
return "ok";
|
|
}
|
|
}
|
|
|
|
|
|
@@ -79,10 +82,23 @@ public class HyOrderTravelPathServiceImpl extends ServiceImpl<HyOrderTravelPathM
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public HyOrderTravelPath getInfo(HyOrderTravelPath hyOrderTravelPath) {
|
|
|
|
- HyOrderTravelPath hyOrderTravelPath1 = this.selectOne(new EntityWrapper<HyOrderTravelPath>()
|
|
|
|
- .eq("order_id", hyOrderTravelPath.getOrderId()).eq("delete_flag", "0").eq("type", "1"));
|
|
|
|
- return hyOrderTravelPath1;
|
|
|
|
|
|
+ public Page<HyOrderTravelPath> getInfo(HyOrderTravelPath hyOrderTravelPath) {
|
|
|
|
+ Map<String, Object> pageView = new HashMap<>(7);
|
|
|
|
+ pageView.put("startRecord", (hyOrderTravelPath.getCurrentPage() - 1)
|
|
|
|
+ * hyOrderTravelPath.getPageSize());
|
|
|
|
+ //订单id
|
|
|
|
+ pageView.put("orderId", hyOrderTravelPath.getOrderId());
|
|
|
|
+ pageView.put("pageSize", hyOrderTravelPath.getPageSize());
|
|
|
|
+ pageView.put("currentPage", hyOrderTravelPath.getCurrentPage());
|
|
|
|
+ // 查询总数
|
|
|
|
+ Integer dataCount = baseMapper.getCountByCondition(pageView);
|
|
|
|
+ List<HyOrderTravelPath> dataList = baseMapper.getListByCondition(pageView);
|
|
|
|
+ Page<HyOrderTravelPath> page = new Page<>();
|
|
|
|
+ page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
|
|
|
|
+ page.setTotal(dataCount == null ? 0 : dataCount);
|
|
|
|
+ page.setCurrent(hyOrderTravelPath.getCurrentPage());
|
|
|
|
+ page.setSize(hyOrderTravelPath.getPageSize());
|
|
|
|
+ return page;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -215,7 +231,7 @@ public class HyOrderTravelPathServiceImpl extends ServiceImpl<HyOrderTravelPathM
|
|
// login();
|
|
// login();
|
|
// orderPath(hyOrderTravelPath);
|
|
// orderPath(hyOrderTravelPath);
|
|
// }
|
|
// }
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
//获取当前年月日
|
|
//获取当前年月日
|
|
String date = f.format(new Date(System.currentTimeMillis()));
|
|
String date = f.format(new Date(System.currentTimeMillis()));
|
|
map.put("qryEtm", date);
|
|
map.put("qryEtm", date);
|