Преглед на файлове

Merge remote-tracking branch 'origin/master'

yanliming преди 4 години
родител
ревизия
89f99f9db8
променени са 40 файла, в които са добавени 1449 реда и са изтрити 140 реда
  1. 5 2
      common/pom.xml
  2. 19 0
      common/src/main/java/com/jpsoft/bus/config/BaiduConfig.java
  3. 2 0
      common/src/main/java/com/jpsoft/bus/modules/bus/dao/DriverRecordInfoDAO.java
  4. 2 0
      common/src/main/java/com/jpsoft/bus/modules/bus/dao/PassengerInfoDAO.java
  5. 2 0
      common/src/main/java/com/jpsoft/bus/modules/bus/dao/ShiftInfoDAO.java
  6. 2 0
      common/src/main/java/com/jpsoft/bus/modules/bus/dao/StationInfoDAO.java
  7. 64 0
      common/src/main/java/com/jpsoft/bus/modules/bus/dto/ShiftInfoDTO.java
  8. 30 0
      common/src/main/java/com/jpsoft/bus/modules/bus/dto/StationStatusDTO.java
  9. 11 3
      common/src/main/java/com/jpsoft/bus/modules/bus/entity/DriverRecordInfo.java
  10. 1 1
      common/src/main/java/com/jpsoft/bus/modules/bus/entity/PassengerInfo.java
  11. 14 1
      common/src/main/java/com/jpsoft/bus/modules/bus/entity/ShiftInfo.java
  12. 21 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/BaiduService.java
  13. 2 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/DriverRecordInfoService.java
  14. 9 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/GpsService.java
  15. 6 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/PassengerInfoService.java
  16. 6 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/ShiftInfoService.java
  17. 2 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/StationInfoService.java
  18. 109 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/BaiduServiceImpl.java
  19. 5 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/DriverRecordInfoServiceImpl.java
  20. 162 53
      common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/GpsServiceImpl.java
  21. 58 6
      common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/PassengerInfoServiceImpl.java
  22. 42 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/ShiftInfoServiceImpl.java
  23. 12 6
      common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/StationInfoServiceImpl.java
  24. 8 4
      common/src/main/java/com/jpsoft/bus/modules/common/utils/BaiduAuthUtil.java
  25. 116 19
      common/src/main/java/com/jpsoft/bus/modules/common/utils/CommonUtil.java
  26. 38 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/OSSUtil.java
  27. 33 3
      common/src/main/resources/mapper/bus/DriverRecordInfo.xml
  28. 6 6
      common/src/main/resources/mapper/bus/GpsDataInfo.xml
  29. 23 1
      common/src/main/resources/mapper/bus/PassengerInfo.xml
  30. 36 3
      common/src/main/resources/mapper/bus/ShiftInfo.xml
  31. 11 2
      common/src/main/resources/mapper/bus/StationInfo.xml
  32. 7 1
      common/src/main/resources/mapper/bus/UserInfo.xml
  33. 2 0
      web/src/main/java/com/jpsoft/bus/config/WebMvcConfig.java
  34. 7 2
      web/src/main/java/com/jpsoft/bus/modules/bus/controller/ShiftInfoController.java
  35. 55 2
      web/src/main/java/com/jpsoft/bus/modules/bus/controller/UserInfoController.java
  36. 360 16
      web/src/main/java/com/jpsoft/bus/modules/driver/controller/DriverApiController.java
  37. 148 2
      web/src/main/java/com/jpsoft/bus/modules/mobile/controller/PassengerApiController.java
  38. 3 3
      web/src/main/resources/application-production.yml
  39. 3 3
      web/src/main/resources/application-test.yml
  40. 7 1
      web/src/main/resources/application.yml

+ 5 - 2
common/pom.xml

@@ -254,7 +254,10 @@
             <artifactId>gps</artifactId>
             <version>1.0.0</version>
         </dependency>
+        <dependency>
+            <groupId>org.gavaghan</groupId>
+            <artifactId>geodesy</artifactId>
+            <version>1.1.3</version>
+        </dependency>
     </dependencies>
-
-
 </project>

+ 19 - 0
common/src/main/java/com/jpsoft/bus/config/BaiduConfig.java

@@ -0,0 +1,19 @@
+package com.jpsoft.bus.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-4-6 10:17
+ */
+@Data
+@ConfigurationProperties(prefix = "baidu")
+@Component
+public class BaiduConfig {
+
+    private String key;
+
+    private String secret;
+}

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dao/DriverRecordInfoDAO.java

@@ -4,6 +4,7 @@ import com.jpsoft.bus.modules.bus.entity.DriverRecordInfo;
 import com.jpsoft.bus.modules.common.dto.Sort;
 import org.springframework.stereotype.Repository;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -20,4 +21,5 @@ public interface DriverRecordInfoDAO {
     int delete(String id);
     List<DriverRecordInfo> list();
     List<DriverRecordInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
+    DriverRecordInfo findLastAttendanceRecord(Long driverId, String licensePlateNumber, Date startTime);
 }

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dao/PassengerInfoDAO.java

@@ -15,4 +15,6 @@ public interface PassengerInfoDAO {
 	int delete(String id);
 	List<PassengerInfo> list();
 	List<PassengerInfo> search(Map<String,Object> searchParams,List<Sort> sortList);
+
+    List<PassengerInfo> findByPersonIdShiftIdStatus(Long personId, String shiftId, String status);
 }

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dao/ShiftInfoDAO.java

@@ -17,4 +17,6 @@ public interface ShiftInfoDAO {
 	List<ShiftInfo> search(Map<String,Object> searchParams,List<Sort> sortList);
 
     List<ShiftInfo> findByDriverIdAndStatus(Long driverId, String status);
+
+    List<ShiftInfo> findByVehicleIdAndStatus(String vehicleId, String status);
 }

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dao/StationInfoDAO.java

@@ -16,4 +16,6 @@ public interface StationInfoDAO {
 	List<StationInfo> list();
 	List<StationInfo> findByRouteId(String routeId);
 	List<StationInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+    List<StationInfo> findByRouteIdAndClassify(String routeId, int classify);
 }

+ 64 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dto/ShiftInfoDTO.java

@@ -0,0 +1,64 @@
+package com.jpsoft.bus.modules.bus.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述:bus_shift_info的实体类
+ */
+@Data
+@ApiModel(value = "bus_shift_info的实体类")
+public class ShiftInfoDTO {
+        @ApiModelProperty(value = "车辆班次编号")
+    private String id;
+        @ApiModelProperty(value = "司机")
+    private Long  driverId;
+        @ApiModelProperty(value = "车辆编号")
+    private String vehicleId;
+        @ApiModelProperty(value = "路线编号")
+    private String routeId;
+        @ApiModelProperty(value = "起始站")
+    private String startStationId;
+        @ApiModelProperty(value = "当前站点")
+    private String currentStationId;
+        @ApiModelProperty(value = "状态值")
+    private String status;
+        @ApiModelProperty(value = "终点站")
+    private String endStationId;
+        @ApiModelProperty(value = "创建人")
+    private String createBy;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+        @ApiModelProperty(value = "更新人")
+    private String updateBy;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+        @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag = false;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "是否收班(到达终点站,乘客全部下车)")
+    private Date finishTime;
+
+    @ApiModelProperty(value = "司机")
+    private String driverName;
+    @ApiModelProperty(value = "车辆名称")
+    private String vehicleName;
+    @ApiModelProperty(value = "路线名称")
+    private String routeName;
+    @ApiModelProperty(value = "起始站")
+    private String startStationName;
+    @ApiModelProperty(value = "当前站点")
+    private String currentStationName;
+    @ApiModelProperty(value = "终点站")
+    private String endStationName;
+}

+ 30 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dto/StationStatusDTO.java

@@ -0,0 +1,30 @@
+package com.jpsoft.bus.modules.bus.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-4-7 8:54
+ */
+@Data
+public class StationStatusDTO {
+
+    @ApiModelProperty(value = "当前站点")
+    private String nowStationId;
+
+    @ApiModelProperty(value = "当前站点名称")
+    private String nowStationName;
+
+    @ApiModelProperty(value = "当前站点状态(1:到站,2:离站,3:未到站)")
+    private String nowStationStatus;
+
+    @ApiModelProperty(value = "下一站点")
+    private String nextStationId;
+
+    @ApiModelProperty(value = "下一站点名称")
+    private String nextStationName;
+
+    @ApiModelProperty(value = "下一站点状态(1:到站,2:离站,3:未到站)")
+    private String nextStationStatus;
+}

+ 11 - 3
common/src/main/java/com/jpsoft/bus/modules/bus/entity/DriverRecordInfo.java

@@ -17,15 +17,23 @@ import java.util.Date;
 public class DriverRecordInfo {
 
     @ApiModelProperty(value = "")
-    private Long id;
+    private String id;
     @ApiModelProperty(value = "司机id")
-    private String driverId;
+    private Long driverId;
     @ApiModelProperty(value = "车牌号")
     private String licensePlateNumber;
     @ApiModelProperty(value = "记录时间")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
     private Date recordTime;
+    @ApiModelProperty(value = "考勤地点")
+    private String place;
+    @ApiModelProperty(value = "经度")
+    private String longitude;
+    @ApiModelProperty(value = "纬度")
+    private String latitude;
+    @ApiModelProperty(value = "图片")
+    private String imageUrl;
     @ApiModelProperty(value = "创建人")
     private String createBy;
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
@@ -39,6 +47,6 @@ public class DriverRecordInfo {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
     @ApiModelProperty(value = "是否删除")
-    private Boolean delFlag;
+    private Boolean delFlag = false;
 
 }

+ 1 - 1
common/src/main/java/com/jpsoft/bus/modules/bus/entity/PassengerInfo.java

@@ -55,7 +55,7 @@ public class PassengerInfo {
 	    @ApiModelProperty(value = "更新时间")
     private Date updateTime;
         @ApiModelProperty(value = "是否删除")
-    private Boolean delFlag;
+    private Boolean delFlag = false;
 
     @ApiModelProperty(value = "注册用户名")
     private String userName;

+ 14 - 1
common/src/main/java/com/jpsoft/bus/modules/bus/entity/ShiftInfo.java

@@ -45,9 +45,22 @@ public class ShiftInfo {
 	    @ApiModelProperty(value = "更新时间")
     private Date updateTime;
         @ApiModelProperty(value = "是否删除")
-    private Boolean delFlag;
+    private Boolean delFlag = false;
         @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
 	    @ApiModelProperty(value = "是否收班(到达终点站,乘客全部下车)")
     private Date finishTime;
+
+    @ApiModelProperty(value = "司机")
+    private String driverName;
+    @ApiModelProperty(value = "车辆车牌")
+    private String vehicleNumber;
+    @ApiModelProperty(value = "路线名称")
+    private String routeName;
+    @ApiModelProperty(value = "起始站")
+    private String startStationName;
+    @ApiModelProperty(value = "当前站点")
+    private String currentStationName;
+    @ApiModelProperty(value = "终点站")
+    private String endStationName;
 }

+ 21 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/BaiduService.java

@@ -0,0 +1,21 @@
+package com.jpsoft.bus.modules.bus.service;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-4-6 10:00
+ */
+public interface BaiduService {
+
+
+    void faceSearch(String faceImageUrl,String faceType,String groupId) throws Exception;
+
+    /**
+     * 创建人脸用户组
+     * @param faceGroupId
+     * @throws Exception
+     */
+    void createFaceGroup(String faceGroupId) throws Exception;
+
+
+    void faceUserAdd(String imageUrl,String groupId,String personId,String userInfo) throws Exception;
+}

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/DriverRecordInfoService.java

@@ -5,6 +5,7 @@ import com.jpsoft.bus.modules.bus.entity.DriverInfo;
 import com.jpsoft.bus.modules.bus.entity.DriverRecordInfo;
 import com.jpsoft.bus.modules.common.dto.Sort;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -21,4 +22,5 @@ public interface DriverRecordInfoService {
     int delete(String id);
     List<DriverRecordInfo> list();
     Page<DriverRecordInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+    DriverRecordInfo findLastAttendanceRecord(Long driverId, String licensePlateNumber, Date startTime);
 }

+ 9 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/GpsService.java

@@ -1,5 +1,6 @@
 package com.jpsoft.bus.modules.bus.service;
 
+import com.jpsoft.bus.modules.bus.dto.StationStatusDTO;
 import com.jpsoft.bus.modules.bus.entity.VehicleInfo;
 
 import java.util.Date;
@@ -12,4 +13,12 @@ public interface GpsService {
     boolean isVehicleOnline(VehicleInfo v);
     List<Map<String,String>> queryVehicleOnlineInfo(List<VehicleInfo> vList);
     List<Map<String,String>> queryVehicleAccInfo(List<VehicleInfo> vList);
+    StationStatusDTO queryStation(String id) throws Exception;
+
+    /**
+     * 获取当前车辆最近的站点
+     * @param id
+     * @return
+     */
+    String getLatelyStation(String id) throws Exception;
 }

+ 6 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/PassengerInfoService.java

@@ -4,6 +4,8 @@ import java.util.List;
 import java.util.Map;
 import com.jpsoft.bus.modules.bus.entity.PassengerInfo;
 import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.bus.entity.ShiftInfo;
+import com.jpsoft.bus.modules.bus.entity.VehicleInfo;
 import com.jpsoft.bus.modules.common.dto.Sort;
 
 public interface PassengerInfoService {
@@ -14,4 +16,8 @@ public interface PassengerInfoService {
 	int delete(String id);
 	List<PassengerInfo> list();
 	Page<PassengerInfo> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+
+	List<PassengerInfo> findByPersonIdShiftIdStatus(Long personId,String shiftId,String status);
+
+    void passengerFace(VehicleInfo vehicleInfo, ShiftInfo shiftInfo, String retFileUrl, String recordTime, String stationId,String personId) throws Exception;
 }

+ 6 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/ShiftInfoService.java

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 import com.jpsoft.bus.modules.bus.entity.ShiftInfo;
 import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.bus.entity.VehicleInfo;
 import com.jpsoft.bus.modules.common.dto.Sort;
 
 public interface ShiftInfoService {
@@ -16,4 +17,9 @@ public interface ShiftInfoService {
 	Page<ShiftInfo> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
 
     List<ShiftInfo> findByDriverIdAndStatus(Long driverId, String status);
+
+    List<ShiftInfo> findByVehicleIdAndStatus(String vehicleId, String status);
+
+    void createShift(VehicleInfo vehicleInfo, String driverId, String startStationId, String endStationId) throws Exception;
+
 }

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/StationInfoService.java

@@ -15,4 +15,6 @@ public interface StationInfoService {
 	List<StationInfo> findByRouteId(String routeId);
 	List<StationInfo> list();
 	Page<StationInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+
+    List<StationInfo> findByRouteIdAndClassify(String routeId, int classify);
 }

+ 109 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/BaiduServiceImpl.java

@@ -0,0 +1,109 @@
+package com.jpsoft.bus.modules.bus.service.impl;
+
+import cn.hutool.http.HttpRequest;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.jpsoft.bus.modules.bus.service.BaiduService;
+import com.jpsoft.bus.modules.common.utils.BaiduAuthUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-4-6 11:05
+ */
+@Transactional
+@Component(value="baiduService")
+public class BaiduServiceImpl implements BaiduService {
+
+    @Autowired
+    private BaiduAuthUtil baiduAuthUtil;
+
+
+    @Override
+    public void faceSearch(String faceImageUrl, String faceType, String groupId) throws Exception {
+
+        // 请求url
+        String url = "https://aip.baidubce.com/rest/2.0/face/v3/search";
+        Map<String, Object> map = new HashMap<>();
+        map.put("image",faceImageUrl);
+        map.put("image_type", faceType);
+        map.put("group_id_list",groupId);
+        map.put("max_user_num",3);
+
+        // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
+        String accessToken = baiduAuthUtil.getAuth();
+
+        String body = HttpRequest.post(url+"?access_token="+accessToken)
+                .form(map)
+                .execute()
+                .body();
+
+
+
+    }
+
+    @Override
+    public void createFaceGroup(String faceGroupId) throws Exception {
+        // 请求url
+        String url = "https://aip.baidubce.com/rest/2.0/face/v3/faceset/group/add";
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("group_id", faceGroupId);
+
+        // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
+        String accessToken = baiduAuthUtil.getAuth();
+
+        String body = HttpRequest.post(url+"?access_token="+accessToken)
+                .form(map)
+                .execute()
+                .body();
+
+        JSONObject jsonObject = JSONUtil.parseObj(body);
+
+        String errorMsg = jsonObject.getStr("error_msg");
+        Integer errorCode = jsonObject.getInt("error_code");
+        if (!"SUCCESS".equals(errorMsg)){
+            if (errorCode != 223101){
+                throw new Exception(errorMsg);
+            }
+        }
+
+
+    }
+
+    @Override
+    public void faceUserAdd(String imageUrl, String groupId, String personId,String userInfo) throws Exception {
+
+        // 请求url
+        String url = "https://aip.baidubce.com/rest/2.0/face/v3/faceset/user/add";
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("image",imageUrl);
+        map.put("image_type", "URL");
+        map.put("group_id",groupId);
+        map.put("user_id",personId);
+        map.put("user_info",userInfo);
+
+        // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
+        String accessToken = baiduAuthUtil.getAuth();
+
+        String body = HttpRequest.post(url+"?access_token="+accessToken)
+                .form(map)
+                .execute()
+                .body();
+        JSONObject jsonObject = JSONUtil.parseObj(body);
+        String errorMsg = jsonObject.getStr("error_msg");
+        Integer errorCode = jsonObject.getInt("error_code");
+        if (!"SUCCESS".equals(errorMsg)){
+            if (errorCode != 223105){
+                throw new Exception(errorMsg);
+            }
+        }
+
+    }
+}

+ 5 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/DriverRecordInfoServiceImpl.java

@@ -10,6 +10,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -73,4 +74,8 @@ public class DriverRecordInfoServiceImpl implements DriverRecordInfoService {
         return page;
     }
 
+    @Override
+    public DriverRecordInfo findLastAttendanceRecord(Long driverId, String licensePlateNumber, Date startTime) {
+        return driverRecordInfoDAO.findLastAttendanceRecord(driverId,licensePlateNumber, startTime);
+    }
 }

+ 162 - 53
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/GpsServiceImpl.java

@@ -1,16 +1,18 @@
 package com.jpsoft.bus.modules.bus.service.impl;
 
-import com.jpsoft.bus.modules.bus.service.GpsDataInfoService;
+import com.jpsoft.bus.modules.bus.dto.StationStatusDTO;
+import com.jpsoft.bus.modules.bus.entity.*;
+import com.jpsoft.bus.modules.bus.service.*;
+import com.jpsoft.bus.modules.common.utils.CommonUtil;
 import com.jpsoft.gps.utils.GPSUtil;
 import com.jpsoft.bus.config.GpsParamConfig;
 import com.jpsoft.bus.modules.bus.dao.VehicleInfoDAO;
-import com.jpsoft.bus.modules.bus.entity.GpsDataInfo;
-import com.jpsoft.bus.modules.bus.entity.VehicleInfo;
-import com.jpsoft.bus.modules.bus.service.GpsService;
 import com.jpsoft.bus.modules.common.dto.Sort;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Mapper;
+import org.gavaghan.geodesy.Ellipsoid;
+import org.gavaghan.geodesy.GlobalCoordinates;
 import org.joda.time.DateTime;
 import org.joda.time.Minutes;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,20 +27,32 @@ import java.util.*;
 import java.util.concurrent.TimeUnit;
 
 @Mapper
-@Component(value="gpsService")
+@Component(value = "gpsService")
 @Slf4j
 public class GpsServiceImpl implements GpsService {
-    @Resource(name="vehicleInfoDAO")
+    @Resource(name = "vehicleInfoDAO")
     private VehicleInfoDAO vehicleInfoDAO;
 
     @Autowired
     private RestTemplate restTemplate;
 
+    @Autowired
+    private VehicleInfoService vehicleInfoService;
+
+    @Autowired
+    private RouteInfoService routeInfoService;
+
+    @Autowired
+    private StationInfoService stationInfoService;
+
+    @Autowired
+    private ShiftInfoService shiftInfoService;
+
     @Autowired
     private GpsParamConfig gpsParamConfig;
 
     @Autowired
-    private ValueOperations<String,Object> valueOperations;
+    private ValueOperations<String, Object> valueOperations;
 
     @Autowired
     private GpsDataInfoService gpsDataInfoService;
@@ -48,7 +62,7 @@ public class GpsServiceImpl implements GpsService {
      * @param vList 车辆实体列表
      * */
     @Override
-    public List<Map<String,String>> queryLatestVehicleGps(List<VehicleInfo> vList) {
+    public List<Map<String, String>> queryLatestVehicleGps(List<VehicleInfo> vList) {
         // TODO Auto-generated method stub
         List<Map<String, String>> coordinateList = new ArrayList<Map<String, String>>();
 
@@ -69,13 +83,13 @@ public class GpsServiceImpl implements GpsService {
 
                 String address = "";
 
-                if(Double.valueOf(longitude)>0 && Double.valueOf(latitude)>0) {
+                if (Double.valueOf(longitude) > 0 && Double.valueOf(latitude) > 0) {
                     String key = "lbs_" + longitude + "," + latitude;
 
                     address = (String) valueOperations.get(key);
 
                     if (StringUtils.isEmpty(address)) {
-                        address = GPSUtil.regeo(longitude, latitude , gpsParamConfig.getKey());
+                        address = GPSUtil.regeo(longitude, latitude, gpsParamConfig.getKey());
                         valueOperations.set(key, address, 1, TimeUnit.DAYS);
                     }
 
@@ -93,43 +107,43 @@ public class GpsServiceImpl implements GpsService {
     }
 
     /*
-    * 获取车辆轨迹
-    * @param v 车辆实体
-    * @param st 开始时间
-    * @param et 结束时间
-    * */
+     * 获取车辆轨迹
+     * @param v 车辆实体
+     * @param st 开始时间
+     * @param et 结束时间
+     * */
     @Override
-    public List<Map<String,String>> getVehicleGpsList(VehicleInfo v,Date st,Date et) {
+    public List<Map<String, String>> getVehicleGpsList(VehicleInfo v, Date st, Date et) {
         // TODO Auto-generated method stub
         //开始时间不得大于结束时间,并且查询天数不得大于7天。
-        List<Map<String,String>> gpsList = new ArrayList<Map<String,String>>();
+        List<Map<String, String>> gpsList = new ArrayList<Map<String, String>>();
         long day1 = st.getTime();
         long day2 = et.getTime();
 
-        if(day1>day2){
+        if (day1 > day2) {
             log.warn("查询车辆轨迹时开始时间大于结束时间");
             return null;
         }
-        if(day2-day1>=7*1000*3600*24){
+        if (day2 - day1 >= 7 * 1000 * 3600 * 24) {
             log.warn("查询车辆轨迹时天数超过7天");
             return null;
         }
 
-        Map<String,Object> searchParams = new HashMap<>();
+        Map<String, Object> searchParams = new HashMap<>();
         searchParams.put("deviceNo", v.getGpsDeviceNo());
         searchParams.put("startTime", st);
         searchParams.put("endTime", et);
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("create_time","asc"));
+        sortList.add(new Sort("create_time", "asc"));
 
-        List<GpsDataInfo> dataList = gpsDataInfoService.pageSearch(searchParams,1,1000,false,sortList);
+        List<GpsDataInfo> dataList = gpsDataInfoService.pageSearch(searchParams, 1, 1000, false, sortList);
 
         for (GpsDataInfo data : dataList) {
-            Map<String,String> map=new HashMap<String,String>();
+            Map<String, String> map = new HashMap<String, String>();
 
-            map.put("lat",data.getLatitude());//纬度
-            map.put("lng",data.getLongitude());//经度
+            map.put("lat", data.getLatitude());//纬度
+            map.put("lng", data.getLongitude());//经度
 
             gpsList.add(map);
         }
@@ -142,40 +156,39 @@ public class GpsServiceImpl implements GpsService {
      * @param v 车辆实体
      * */
     @Override
-    public boolean isVehicleOnline(VehicleInfo v){
+    public boolean isVehicleOnline(VehicleInfo v) {
         //最后一次上传经纬度时间是否超过5分钟
         GpsDataInfo gpsDataInfo = gpsDataInfoService.findLast(v.getGpsDeviceNo());
 
-        if(gpsDataInfo!=null) {
+        if (gpsDataInfo != null) {
             DateTime lastTime = new DateTime(gpsDataInfo.getCreateTime());
 
             long minutes = Minutes.minutesBetween(lastTime, DateTime.now()).getMinutes();
 
             return minutes < 5;
-        }
-        else{
+        } else {
             return false;
         }
     }
 
     @Override
-    public List<Map<String,String>> queryVehicleOnlineInfo(List<VehicleInfo> vList) {
+    public List<Map<String, String>> queryVehicleOnlineInfo(List<VehicleInfo> vList) {
         // TODO Auto-generated method stub
         //单次查询,车牌号查询
-        List<Map<String,String>> onlineList = new ArrayList<>();
+        List<Map<String, String>> onlineList = new ArrayList<>();
 
-        for(VehicleInfo v : vList){
-            Map<String,String> olmap = new HashMap<String,String>();
+        for (VehicleInfo v : vList) {
+            Map<String, String> olmap = new HashMap<String, String>();
 
             boolean online = isVehicleOnline(v);
 
-            if(online){
-                olmap.put("online","1");
-            }else{
-                olmap.put("online","0");
+            if (online) {
+                olmap.put("online", "1");
+            } else {
+                olmap.put("online", "0");
             }
 
-            olmap.put("licensePlateNumber",v.getLicensePlateNumber());//车牌号
+            olmap.put("licensePlateNumber", v.getLicensePlateNumber());//车牌号
             onlineList.add(olmap);
         }
 
@@ -187,33 +200,129 @@ public class GpsServiceImpl implements GpsService {
      * @param vList 车辆实体列表
      * */
     @Override
-    public List<Map<String,String>> queryVehicleAccInfo(List<VehicleInfo> vList) {
+    public List<Map<String, String>> queryVehicleAccInfo(List<VehicleInfo> vList) {
         // TODO Auto-generated method stub
-        List<Map<String,String>> accList = new ArrayList<Map<String,String>>();
+        List<Map<String, String>> accList = new ArrayList<Map<String, String>>();
 
-        for(VehicleInfo v : vList){
-            Map<String,String> olmap = new HashMap<String,String>();
+        for (VehicleInfo v : vList) {
+            Map<String, String> olmap = new HashMap<String, String>();
 
             boolean online = isVehicleOnline(v);
 
-            if(online){
-                olmap.put("acc","1");
-            }else{
-                olmap.put("acc","0");
+            if (online) {
+                olmap.put("acc", "1");
+            } else {
+                olmap.put("acc", "0");
             }
 
-            olmap.put("licensePlateNumber",v.getLicensePlateNumber());//车牌号
+            olmap.put("licensePlateNumber", v.getLicensePlateNumber());//车牌号
             accList.add(olmap);
         }
 
         return accList;
     }
 
-    public String encode(String text){
-        try {
-            text=URLEncoder.encode(text,"UTF-8");
+    @Override
+    public StationStatusDTO queryStation(String id) throws Exception {
+
+        StationStatusDTO stationStatusDTO = new StationStatusDTO();
+        VehicleInfo vehicleInfo = vehicleInfoService.get(id);
+        if (vehicleInfo == null) {
+            throw new Exception("车辆不存在");
         }
-        catch(NumberFormatException | UnsupportedEncodingException e) {
+        List<ShiftInfo> shiftInfoList = shiftInfoService.findByVehicleIdAndStatus(id, "1");
+        if (shiftInfoList.size() == 0) {
+            throw new Exception("此车辆无正在运行的班次");
+        }
+        ShiftInfo shiftInfo = shiftInfoList.get(0);
+
+        RouteInfo routeInfo = routeInfoService.get(shiftInfo.getRouteId());
+
+        List<StationInfo> stationInfoList = stationInfoService.findByRouteId(routeInfo.getId());
+
+        //线路中的当前站点
+         StationInfo currentStation = stationInfoService.get(shiftInfo.getCurrentStationId());
+
+         //下一站站点
+        StationInfo nextStation = null;
+
+         Integer index =  stationInfoList.indexOf(currentStation);
+
+         Integer nextIndex = index+1;
+         if (!stationInfoList.get(0).getId().equals(shiftInfo.getStartStationId())){
+             nextIndex = index-1;
+         }
+
+         if (nextIndex > stationInfoList.size()-1 || nextIndex<0){
+             nextStation = currentStation;
+         }else {
+             nextStation = stationInfoList.get(nextIndex);
+         }
+
+         //车辆离当前站点的距离
+        GlobalCoordinates source = new GlobalCoordinates(Double.valueOf(vehicleInfo.getLatitude()), Double.valueOf(vehicleInfo.getLongitude()));
+        GlobalCoordinates target = new GlobalCoordinates(Double.valueOf(currentStation.getLatitude()), Double.valueOf(currentStation.getLongitude()));
+
+        double meter1 = CommonUtil.getDistanceMeter(source, target, Ellipsoid.Sphere);
+        if (meter1 <= Double.valueOf(50)){
+            stationStatusDTO.setNowStationStatus("1");
+        }else {
+            stationStatusDTO.setNowStationStatus("2");
+        }
+
+        stationStatusDTO.setNowStationId(currentStation.getId());
+        stationStatusDTO.setNowStationName(currentStation.getName());
+        stationStatusDTO.setNextStationId(nextStation.getId());
+        stationStatusDTO.setNextStationName(nextStation.getName());
+
+        if (nextStation.equals(currentStation)){
+            stationStatusDTO.setNextStationStatus(stationStatusDTO.getNowStationStatus());
+        }else {
+            stationStatusDTO.setNextStationStatus("3");
+        }
+
+
+        return stationStatusDTO;
+    }
+
+    @Override
+    public String getLatelyStation(String id) throws Exception {
+        VehicleInfo vehicleInfo = vehicleInfoService.get(id);
+        if (vehicleInfo == null) {
+            throw new Exception("车辆不存在");
+        }
+
+        String currentStationId = null;
+        List<ShiftInfo> shiftInfoList = shiftInfoService.findByVehicleIdAndStatus(id, "1");
+        if (shiftInfoList.size() > 0) {
+
+
+            ShiftInfo shiftInfo = shiftInfoList.get(0);
+
+            RouteInfo routeInfo = routeInfoService.get(shiftInfo.getRouteId());
+
+            List<StationInfo> stationInfoList = stationInfoService.findByRouteId(routeInfo.getId());
+            currentStationId = shiftInfo.getStartStationId();
+            if (stationInfoList.size() > 0) {
+                for (StationInfo stationInfo : stationInfoList) {
+                    GlobalCoordinates source = new GlobalCoordinates(Double.valueOf(vehicleInfo.getLatitude()), Double.valueOf(vehicleInfo.getLongitude()));
+                    GlobalCoordinates target = new GlobalCoordinates(Double.valueOf(stationInfo.getLatitude()), Double.valueOf(stationInfo.getLongitude()));
+
+                    double meter1 = CommonUtil.getDistanceMeter(source, target, Ellipsoid.Sphere);
+                    if (meter1 <= Double.valueOf(50)) {
+                        currentStationId = stationInfo.getId();
+                        break;
+                    }
+                }
+            }
+        }
+        return currentStationId;
+    }
+
+    public String encode(String text) {
+        try {
+            text = URLEncoder.encode(text, "UTF-8");
+        } catch (NumberFormatException | UnsupportedEncodingException e) {
             System.out.println(e);
         }
 
@@ -226,11 +335,11 @@ public class GpsServiceImpl implements GpsService {
         System.out.println(Integer.toBinaryString(s1));
 
         int pos = 2;
-        int value = 1 << (pos-1);
+        int value = 1 << (pos - 1);
 
         System.out.println(value);
 
-        if((s1 & value)==value){
+        if ((s1 & value) == value) {
             System.out.println("ACC开启");
         }
     }

+ 58 - 6
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/PassengerInfoServiceImpl.java

@@ -1,9 +1,18 @@
 package com.jpsoft.bus.modules.bus.service.impl;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 import javax.annotation.Resource;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
+import com.jpsoft.bus.modules.bus.entity.ShiftInfo;
+import com.jpsoft.bus.modules.bus.entity.VehicleInfo;
+import com.jpsoft.bus.modules.bus.service.BaiduService;
+import com.jpsoft.bus.modules.common.utils.CommonUtil;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 import com.jpsoft.bus.modules.bus.dao.PassengerInfoDAO;
@@ -19,6 +28,9 @@ public class PassengerInfoServiceImpl implements PassengerInfoService {
 	@Resource(name="passengerInfoDAO")
 	private PassengerInfoDAO passengerInfoDAO;
 
+	@Autowired
+	private BaiduService baiduService;
+
 	@Override
 	public PassengerInfo get(String id) {
 		// TODO Auto-generated method stub
@@ -29,14 +41,14 @@ public class PassengerInfoServiceImpl implements PassengerInfoService {
 	public int insert(PassengerInfo model) {
 		// TODO Auto-generated method stub
 		//model.setId(UUID.randomUUID().toString());
-		
+
 		return passengerInfoDAO.insert(model);
 	}
 
 	@Override
 	public int update(PassengerInfo model) {
 		// TODO Auto-generated method stub
-		return passengerInfoDAO.update(model);		
+		return passengerInfoDAO.update(model);
 	}
 
 	@Override
@@ -49,22 +61,62 @@ public class PassengerInfoServiceImpl implements PassengerInfoService {
 	public boolean exist(String id) {
 		// TODO Auto-generated method stub
 		int count = passengerInfoDAO.exist(id);
-		
+
 		return count > 0 ? true : false;
 	}
-	
+
 	@Override
 	public List<PassengerInfo> list() {
 		// TODO Auto-generated method stub
 		return passengerInfoDAO.list();
 	}
-		
+
 	@Override
 	public Page<PassengerInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
         Page<PassengerInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
             passengerInfoDAO.search(searchParams,sortList);
         });
-        
+
         return page;
 	}
+
+	@Override
+	public List<PassengerInfo> findByPersonIdShiftIdStatus(Long personId, String shiftId, String status) {
+		return passengerInfoDAO.findByPersonIdShiftIdStatus(personId,shiftId,status);
+	}
+
+	@Override
+	public void passengerFace(VehicleInfo vehicleInfo, ShiftInfo shiftInfo, String retFileUrl, String recordTime, String stationId,String personId) throws Exception {
+
+		Date recordDate = DateUtil.parse(recordTime,"yyyy-MM-dd HH:mm:ss");
+		//查询是否有已上车的乘客记录
+		List<PassengerInfo> passengerInfoList = findByPersonIdShiftIdStatus(Long.parseLong(personId),shiftInfo.getId(),"1");
+
+		if (passengerInfoList.size()>0){
+			PassengerInfo passengerInfo = passengerInfoList.get(0);
+			passengerInfo.setDownTime(recordDate);
+			passengerInfo.setDownStationId(stationId);
+			passengerInfo.setStatus("2");
+			update(passengerInfo);
+		}
+		else {
+			PassengerInfo passengerInfo = new PassengerInfo();
+			passengerInfo.setId(UUID.randomUUID().toString());
+			passengerInfo.setVehicleShiftId(shiftInfo.getId());
+			passengerInfo.setVehiclePersonId(Long.parseLong(personId));
+			passengerInfo.setImageUrl(retFileUrl);
+			passengerInfo.setUpTime(recordDate);
+			passengerInfo.setUpStationId(stationId);
+			passengerInfo.setStatus("1");
+			passengerInfo.setPayStatus("0");
+			passengerInfo.setCreateTime(new Date());
+			insert(passengerInfo);
+
+			String groupId = CommonUtil.getProvinceNum(vehicleInfo.getLicensePlateNumber()) + StrUtil.sub(vehicleInfo.getLicensePlateNumber(),1,10);
+			//将图片上传到百度AI人脸识别,  userInfo 1:司机,2:乘客
+			baiduService.faceUserAdd(retFileUrl,groupId,personId,"2");
+
+
+		}
+	}
 }

+ 42 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/ShiftInfoServiceImpl.java

@@ -1,9 +1,15 @@
 package com.jpsoft.bus.modules.bus.service.impl;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 import javax.annotation.Resource;
+
+import com.jpsoft.bus.modules.bus.entity.VehicleInfo;
+import com.jpsoft.bus.modules.bus.service.GpsService;
+import com.sun.xml.bind.v2.TODO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 import com.jpsoft.bus.modules.bus.dao.ShiftInfoDAO;
@@ -19,6 +25,9 @@ public class ShiftInfoServiceImpl implements ShiftInfoService {
 	@Resource(name="shiftInfoDAO")
 	private ShiftInfoDAO shiftInfoDAO;
 
+	@Autowired
+	private GpsService gpsService;
+
 	@Override
 	public ShiftInfo get(String id) {
 		// TODO Auto-generated method stub
@@ -72,4 +81,37 @@ public class ShiftInfoServiceImpl implements ShiftInfoService {
 	public List<ShiftInfo> findByDriverIdAndStatus(Long driverId, String status) {
 		return shiftInfoDAO.findByDriverIdAndStatus(driverId,status);
 	}
+
+	@Override
+	public List<ShiftInfo> findByVehicleIdAndStatus(String vehicleId, String status) {
+		return shiftInfoDAO.findByVehicleIdAndStatus(vehicleId,status);
+	}
+
+	@Override
+	public void createShift(VehicleInfo vehicleInfo, String driverId, String startStationId, String endStationId) throws Exception {
+		List<ShiftInfo> shiftInfoList = findByVehicleIdAndStatus(vehicleInfo.getId(),"1");
+		if (shiftInfoList.size()>0){
+			for (ShiftInfo shiftInfo : shiftInfoList){
+				shiftInfo.setStatus("2");
+				update(shiftInfo);
+			}
+		}
+		//TODO 根据经纬度查询当前站点
+		String currentStationId = gpsService.getLatelyStation(vehicleInfo.getId());
+
+
+		ShiftInfo shiftInfo = new ShiftInfo();
+		shiftInfo.setId(UUID.randomUUID().toString());
+		shiftInfo.setDriverId(Long.valueOf(driverId));
+		shiftInfo.setVehicleId(vehicleInfo.getId());
+		shiftInfo.setRouteId(vehicleInfo.getRouteId());
+		shiftInfo.setStartStationId(startStationId);
+		shiftInfo.setCurrentStationId(currentStationId);
+		shiftInfo.setEndStationId(endStationId);
+		shiftInfo.setStatus("1");
+		shiftInfo.setCreateTime(new Date());
+		insert(shiftInfo);
+
+
+	}
 }

+ 12 - 6
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/StationInfoServiceImpl.java

@@ -29,14 +29,14 @@ public class StationInfoServiceImpl implements StationInfoService {
 	public int insert(StationInfo model) {
 		// TODO Auto-generated method stub
 		//model.setId(UUID.randomUUID().toString());
-		
+
 		return stationInfoDAO.insert(model);
 	}
 
 	@Override
 	public int update(StationInfo model) {
 		// TODO Auto-generated method stub
-		return stationInfoDAO.update(model);		
+		return stationInfoDAO.update(model);
 	}
 
 	@Override
@@ -49,10 +49,10 @@ public class StationInfoServiceImpl implements StationInfoService {
 	public boolean exist(String id) {
 		// TODO Auto-generated method stub
 		int count = stationInfoDAO.exist(id);
-		
+
 		return count > 0 ? true : false;
 	}
-	
+
 	@Override
 	public List<StationInfo> list() {
 		// TODO Auto-generated method stub
@@ -63,13 +63,19 @@ public class StationInfoServiceImpl implements StationInfoService {
 	public List<StationInfo> findByRouteId(String routeId){
 		return stationInfoDAO.findByRouteId(routeId);
 	}
-		
+
+
 	@Override
 	public Page<StationInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
         Page<StationInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
             stationInfoDAO.search(searchParams,sortList);
         });
-        
+
         return page;
 	}
+
+	@Override
+	public List<StationInfo> findByRouteIdAndClassify(String routeId, int classify) {
+		return stationInfoDAO.findByRouteIdAndClassify(routeId,classify);
+	}
 }

+ 8 - 4
common/src/main/java/com/jpsoft/bus/modules/common/utils/BaiduAuthUtil.java

@@ -1,6 +1,7 @@
 package com.jpsoft.bus.modules.common.utils;
 
 import cn.hutool.json.JSONObject;
+import com.jpsoft.bus.config.BaiduConfig;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Component;
@@ -24,6 +25,9 @@ public class BaiduAuthUtil {
     @Autowired
     private RedisTemplate redisTemplate;
 
+    @Autowired
+    private BaiduConfig baiduConfig;
+
     /**
      * 获取权限token
      *
@@ -35,9 +39,9 @@ public class BaiduAuthUtil {
      */
     public String getAuth() {
         // 官网获取的 API Key 更新为你注册的
-        String clientId = "FhN3QuocpqH2XNMHZU3GlCun";
+        String clientId = baiduConfig.getKey();
         // 官网获取的 Secret Key 更新为你注册的
-        String clientSecret = "N5Lfz9p8MHn8m0YSwjmT6SWvkboKYa2A";
+        String clientSecret = baiduConfig.getSecret();
         return getAuth(clientId, clientSecret);
     }
 
@@ -78,9 +82,9 @@ public class BaiduAuthUtil {
                 // 获取所有响应头字段
                 Map<String, List<String>> map = connection.getHeaderFields();
                 // 遍历所有的响应头字段
-                for (String key : map.keySet()) {
+                /*for (String key : map.keySet()) {
                     System.err.println(key + "--->" + map.get(key));
-                }
+                }*/
                 // 定义 BufferedReader输入流来读取URL的响应
                 BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                 String result = "";

+ 116 - 19
common/src/main/java/com/jpsoft/bus/modules/common/utils/CommonUtil.java

@@ -1,29 +1,126 @@
 package com.jpsoft.bus.modules.common.utils;
 
+import cn.hutool.core.util.StrUtil;
+import org.gavaghan.geodesy.Ellipsoid;
+import org.gavaghan.geodesy.GeodeticCalculator;
+import org.gavaghan.geodesy.GeodeticCurve;
+import org.gavaghan.geodesy.GlobalCoordinates;
+
 /**
  * @author 墨鱼_mo
  * @date 2020-8-4 17:17
  */
 public class CommonUtil {
 
-    public static String getGoodTypeName(String type){
-        String goodTypeName ="";
-       if ("1".equals(type)){
-           goodTypeName = "校车服务";
-       }
-       if ("2".equals(type)){
-           goodTypeName = "学平险";
-       }
-       if ("3".equals(type)){
-           goodTypeName = "虹膜";
-       }
-       if ("4".equals(type)){
-           goodTypeName = "人工智能";
-       }
-       if ("5".equals(type)){
-           goodTypeName = "移动充值";
-       }
-
-        return goodTypeName;
+    public static String getProvinceNum(String carNum) {
+        String provinceNum = "un";
+        String provinceName = StrUtil.sub(carNum, 0, 1);
+        if ("京".equals(provinceName)) {
+            provinceNum = "00";
+        }
+        if ("津".equals(provinceName)) {
+            provinceNum = "01";
+        }
+        if ("沪".equals(provinceName)) {
+            provinceNum = "02";
+        }
+        if ("渝".equals(provinceName)) {
+            provinceNum = "03";
+        }
+        if ("冀".equals(provinceName)) {
+            provinceNum = "04";
+        }
+        if ("豫".equals(provinceName)) {
+            provinceNum = "05";
+        }
+        if ("云".equals(provinceName)) {
+            provinceNum = "06";
+        }
+        if ("辽".equals(provinceName)) {
+            provinceNum = "07";
+        }
+        if ("黑".equals(provinceName)) {
+            provinceNum = "08";
+        }
+        if ("湘".equals(provinceName)) {
+            provinceNum = "09";
+        }
+        if ("皖".equals(provinceName)) {
+            provinceNum = "10";
+        }
+        if ("鲁".equals(provinceName)) {
+            provinceNum = "11";
+        }
+        if ("新".equals(provinceName)) {
+            provinceNum = "12";
+        }
+        if ("苏".equals(provinceName)) {
+            provinceNum = "13";
+        }
+        if ("浙".equals(provinceName)) {
+            provinceNum = "14";
+        }
+        if ("赣".equals(provinceName)) {
+            provinceNum = "15";
+        }
+        if ("桂".equals(provinceName)) {
+            provinceNum = "16";
+        }
+        if ("甘".equals(provinceName)) {
+            provinceNum = "17";
+        }
+        if ("晋".equals(provinceName)) {
+            provinceNum = "18";
+        }
+        if ("蒙".equals(provinceName)) {
+            provinceNum = "19";
+        }
+        if ("陕".equals(provinceName)) {
+            provinceNum = "20";
+        }
+        if ("吉".equals(provinceName)) {
+            provinceNum = "21";
+        }
+        if ("闽".equals(provinceName)) {
+            provinceNum = "22";
+        }
+        if ("贵".equals(provinceName)) {
+            provinceNum = "23";
+        }
+        if ("粤".equals(provinceName)) {
+            provinceNum = "24";
+        }
+        if ("青".equals(provinceName)) {
+            provinceNum = "25";
+        }
+        if ("藏".equals(provinceName)) {
+            provinceNum = "26";
+        }
+        if ("琼".equals(provinceName)) {
+            provinceNum = "27";
+        }
+        if ("鄂".equals(provinceName)) {
+            provinceNum = "28";
+        }
+        if ("川".equals(provinceName)) {
+            provinceNum = "29";
+        }
+        if ("宁".equals(provinceName)) {
+            provinceNum = "30";
+        }
+
+
+
+        return provinceNum;
+    }
+
+
+    //根据坐标系判断距离
+    public static double getDistanceMeter(GlobalCoordinates gpsFrom, GlobalCoordinates gpsTo, Ellipsoid ellipsoid) {
+
+        //创建GeodeticCalculator,调用计算方法,传入坐标系、经纬度用于计算距离
+        GeodeticCurve geoCurve = new GeodeticCalculator().calculateGeodeticCurve(ellipsoid, gpsFrom, gpsTo);
+
+        return geoCurve.getEllipsoidalDistance();
     }
 }

+ 38 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/OSSUtil.java

@@ -10,6 +10,7 @@ import com.aliyun.oss.model.PutObjectResult;
 import com.jpsoft.bus.config.OSSConfig;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import sun.misc.BASE64Decoder;
 
 import java.io.*;
 import java.net.HttpURLConnection;
@@ -75,6 +76,43 @@ public class OSSUtil {
         return ossConfig.getUrlPrefix() + "/" + retFileUrl;
     }
 
+
+    public static String uploadBase64(String photoBase64Data,String photoName,OSSConfig ossConfig){
+
+        try{
+            //前50个字符
+            if (StringUtils.isNotEmpty(photoBase64Data)) {
+                // sysLog.setData(photoBase64Data.substring(0, Math.min(photoBase64Data.length(), 50)));
+            }
+
+            BASE64Decoder decoder = new BASE64Decoder();
+
+            String[] arr = photoBase64Data.split(",");
+
+            byte[] imgData = decoder.decodeBuffer(arr[1]);
+
+            for (int i = 0; i < imgData.length; ++i) {
+                if (imgData[i] < 0) {// 调整异常数据
+                    imgData[i] += 256;
+                }
+            }
+
+            ByteArrayInputStream inputStream = new ByteArrayInputStream(imgData);
+
+            if (StringUtils.isEmpty(photoName)) {
+                photoName = "1.jpg";
+            }
+
+            String retFileUrl = OSSUtil.upload(ossConfig, "/faceImage", photoName, inputStream);
+            return retFileUrl;
+        }catch (Exception ex){
+
+        }
+        return null;
+
+
+    }
+
     public static boolean download(String fileUrl,String filePath){
         boolean result;
 

+ 33 - 3
common/src/main/resources/mapper/bus/DriverRecordInfo.xml

@@ -8,6 +8,10 @@
         <result property="driverId" column="driver_id" />
         <result property="licensePlateNumber" column="license_plate_number" />
         <result property="recordTime" column="record_time" />
+        <result property="place" column="place_"/>
+        <result property="latitude" column="latitude_"/>
+        <result property="longitude" column="longitude_"/>
+        <result property="imageUrl" column="image_url"/>
         <result property="createBy" column="create_by" />
         <result property="createTime" column="create_time" />
         <result property="updateBy" column="update_by" />
@@ -22,13 +26,17 @@
         -->
         <![CDATA[
 		insert into bus_driver_record_info
-	    (id,driver_id,license_plate_number,record_time,create_by,create_time,update_by,update_time,del_flag)
+	    (id_,driver_id,license_plate_number,record_time,place_,latitude_,longitude_,image_url,create_by,create_time,update_by,update_time,del_flag)
 		values
 		(
 #{id,jdbcType=VARCHAR}
-,#{driverId,jdbcType=VARCHAR}
+,#{driverId,jdbcType=NUMERIC}
 ,#{licensePlateNumber,jdbcType=VARCHAR}
 ,#{recordTime,jdbcType=TIMESTAMP}
+,#{place,jdbcType=VARCHAR}
+,#{latitude,jdbcType=VARCHAR}
+,#{longitude,jdbcType=VARCHAR}
+,#{imageUrl,jdbcType=VARCHAR}
 ,#{createBy,jdbcType=VARCHAR}
 ,#{createTime,jdbcType= TIMESTAMP }
 ,#{updateBy,jdbcType=VARCHAR}
@@ -52,6 +60,18 @@
             <if test="recordTime!=null">
                 record_time=#{recordTime,jdbcType=TIMESTAMP},
             </if>
+            <if test="place!=null">
+                place_=#{place,jdbcType=VARCHAR},
+            </if>
+            <if test="latitude!=null">
+                latitude_=#{latitude,jdbcType=VARCHAR},
+            </if>
+            <if test="longitude!=null">
+                longitude_=#{longitude,jdbcType=VARCHAR},
+            </if>
+            <if test="imageUrl!=null">
+                image_url = #{imageUrl,jdbcType=VARCHAR},
+            </if>
             <if test="createBy!=null">
                 create_by=#{createBy,jdbcType=VARCHAR},
             </if>
@@ -93,5 +113,15 @@
             ${sort.name} ${sort.order}
         </foreach>
     </select>
-
+    <select id="findLastAttendanceRecord" parameterType="hashmap" resultMap="DriverRecordInfoMap">
+        <![CDATA[
+            select * from bus_driver_record_info
+            where del_flag=0
+            and driver_id=#{driverId}
+            and license_plate_number = #{licensePlateNumber}
+            and record_time > #{startTime}
+            order by record_time desc
+            limit 1
+        ]]>
+    </select>
 </mapper>

+ 6 - 6
common/src/main/resources/mapper/bus/GpsDataInfo.xml

@@ -6,8 +6,8 @@
     <resultMap id="GpsDataInfoMap" type="com.jpsoft.bus.modules.bus.entity.GpsDataInfo">
         <id property="id" column="id_"/>
         <result property="deviceNo" column="device_no"/>
-        <result property="longitude" column="longitude"/>
-        <result property="latitude" column="latitude"/>
+        <result property="longitude" column="longitude_"/>
+        <result property="latitude" column="latitude_"/>
         <result property="createBy" column="create_by"/>
         <result property="createTime" column="create_time"/>
         <result property="updateBy" column="update_by"/>
@@ -22,7 +22,7 @@
         -->
         <![CDATA[
 		insert into bus_gps_data_info
-	    (id_,device_no,longitude,latitude,create_by,create_time,update_by,update_time,del_flag)
+	    (id_,device_no,longitude_,latitude_,create_by,create_time,update_by,update_time,del_flag)
 		values
 		(
             #{id,jdbcType=VARCHAR}
@@ -47,10 +47,10 @@
                 device_no=#{deviceNo,jdbcType=VARCHAR},
             </if>
             <if test="longitude!=null">
-                longitude=#{longitude,jdbcType=VARCHAR},
+                longitude_=#{longitude,jdbcType=VARCHAR},
             </if>
             <if test="latitude!=null">
-                latitude=#{latitude,jdbcType=VARCHAR},
+                latitude_=#{latitude,jdbcType=VARCHAR},
             </if>
             <if test="createBy!=null">
                 create_by=#{createBy,jdbcType=VARCHAR},
@@ -71,7 +71,7 @@
         where id_=#{id}
     </update>
     <select id="get" parameterType="string" resultMap="GpsDataInfoMap">
-        select id_,device_no,longitude,latitude,create_by,create_time,update_by,update_time,del_flag
+        select id_,device_no,longitude_,latitude_,create_by,create_time,update_by,update_time,del_flag
         from bus_gps_data_info where id_=#{0}
     </select>
     <select id="exist" parameterType="string" resultType="int">

+ 23 - 1
common/src/main/resources/mapper/bus/PassengerInfo.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!-- namespace必须指向DAO接口 -->
 <mapper namespace="com.jpsoft.bus.modules.bus.dao.PassengerInfoDAO">
@@ -141,9 +141,31 @@
 			<if test="searchParams.payStatus != null">
 				and a.pay_status = #{searchParams.payStatus}
 			</if>
+			<if test="searchParams.vehicleShiftId != null">
+				and a.vehicle_shift_id = #{searchParams.vehicleShiftId}
+			</if>
+			<if test="searchParams.status != null">
+				and a.status_ = #{searchParams.status}
+			</if>
+			<if test="searchParams.notPayStatus != null">
+				and a.pay_status != #{searchParams.notPayStatus}
+			</if>
+			<if test="searchParams.downStationId != null">
+				and a.down_station_id = #{searchParams.downStationId}
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 	        ${sort.name} ${sort.order}
 	 	</foreach>
 	</select>
+
+	<select id="findByPersonIdShiftIdStatus" resultMap="PassengerInfoMap">
+		<![CDATA[
+		select * from bus_passenger_info
+		where del_flag = 0
+		and vehicle_person_id = #{personId}
+		and vehicle_shift_id = #{shiftId}
+		and status_ = #{status}
+		]]>
+	</select>
 </mapper>

+ 36 - 3
common/src/main/resources/mapper/bus/ShiftInfo.xml

@@ -18,6 +18,12 @@
 			<result property="updateTime" column="update_time" />
 			<result property="delFlag" column="del_flag" />
 			<result property="finishTime" column="finish_time" />
+			<result property="driverName" column="driver_name" />
+			<result property="vehicleNumber" column="vehicle_number" />
+			<result property="routeName" column="route_name" />
+			<result property="startStationName" column="start_station_name" />
+			<result property="currentStationName" column="current_station_name" />
+			<result property="endStationName" column="end_station_name" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.ShiftInfo">
 	<!--
@@ -106,12 +112,30 @@
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="ShiftInfoMap">
 		<![CDATA[
-			select * from bus_shift_info
+			SELECT
+				a.*,
+				b.name_ AS driver_name,
+				c.license_plate_number AS vehicle_number,
+				d.name_ AS route_name,
+				e.name_ AS start_station_name,
+				f.name_ AS current_station_name,
+				g.name_ AS end_station_name
+			FROM
+				bus_shift_info a
+				LEFT JOIN bus_driver_info b ON a.driver_id = b.id_
+				LEFT JOIN bus_vehicle_info c ON a.vehicle_id = c.id_
+				LEFT JOIN bus_route_info d ON a.route_id = d.id_
+				LEFT JOIN bus_station_info e ON a.start_station_id = e.id_
+				LEFT JOIN bus_station_info f ON a.current_station_id = f.id_
+				LEFT JOIN bus_station_info g ON a.end_station_id = g.id_
 		]]>
 		<where>
-			del_flag = 0
+			a.del_flag = 0
 			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+				and a.ID_ like #{searchParams.id}
+			</if>
+			<if test="searchParams.vehicleNumber != null">
+				and c.license_plate_number like #{searchParams.vehicleNumber}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
@@ -126,4 +150,13 @@
 		and status_ = #{status}
 		]]>
 	</select>
+
+	<select id="findByVehicleIdAndStatus" resultMap="ShiftInfoMap">
+		<![CDATA[
+		select * from bus_shift_info
+		where del_flag = 0
+		and vehicle_id = #{vehicleId}
+		and status_ = #{status}
+		]]>
+	</select>
 </mapper>

+ 11 - 2
common/src/main/resources/mapper/bus/StationInfo.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!-- namespace必须指向DAO接口 -->
 <mapper namespace="com.jpsoft.bus.modules.bus.dao.StationInfoDAO">
@@ -86,7 +86,7 @@
 	where id_=#{id}
 	</update>
 	<select id="get" parameterType="string" resultMap="StationInfoMap">
-		select 
+		select
 id_,sort_no,route_id,name_,longitude_,latitude_,classify_,create_by,create_time,update_by,update_time,del_flag		from bus_station_info where id_=#{0}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
@@ -111,4 +111,13 @@ id_,sort_no,route_id,name_,longitude_,latitude_,classify_,create_by,create_time,
 	        ${sort.name} ${sort.order}
 	 	</foreach>
 	</select>
+
+	<select id="findByRouteIdAndClassify" resultMap="StationInfoMap">
+		<![CDATA[
+		select * from bus_station_info
+		where del_flag = 0
+		and route_id = #{routeId}
+		and classify_ = #{classify}
+		]]>
+	</select>
 </mapper>

+ 7 - 1
common/src/main/resources/mapper/bus/UserInfo.xml

@@ -105,7 +105,13 @@
 		<where>
 			del_flag = 0
 			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+				and ID_ = #{searchParams.id}
+			</if>
+			<if test="searchParams.name != null">
+				and name_ like #{searchParams.name}
+			</if>
+			<if test="searchParams.phone != null">
+				and phone_ like #{searchParams.phone}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 2 - 0
web/src/main/java/com/jpsoft/bus/config/WebMvcConfig.java

@@ -57,6 +57,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
 				.excludePathPatterns("/mobile/passengerApi/validateCode")
 				.excludePathPatterns("/mobile/driverApi/carActivation")
 				.excludePathPatterns("/mobile/driverApi/findByPhone")
+				.excludePathPatterns("/mobile/passengerApi/getShiftInfo")
+				.excludePathPatterns("/mobile/passengerApi/upload")
 				;
 	}
 }

+ 7 - 2
web/src/main/java/com/jpsoft/bus/modules/bus/controller/ShiftInfoController.java

@@ -200,7 +200,8 @@ public class ShiftInfoController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            @RequestParam(value="id",defaultValue="") String id,
+            @RequestParam(value="vehicleNumber",defaultValue="") String vehicleNumber,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -213,12 +214,16 @@ public class ShiftInfoController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("a.create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
         }
 
+        if (StringUtils.isNotEmpty(vehicleNumber)) {
+            searchParams.put("vehicleNumber","%" + vehicleNumber + "%");
+        }
+
         Page<ShiftInfo> page = shiftInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
         msgResult.setResult(true);

+ 55 - 2
web/src/main/java/com/jpsoft/bus/modules/bus/controller/UserInfoController.java

@@ -5,13 +5,16 @@ import com.jpsoft.bus.modules.common.dto.MessageResult;
 import com.jpsoft.bus.modules.common.dto.Sort;
 import com.jpsoft.bus.modules.bus.entity.UserInfo;
 import com.jpsoft.bus.modules.bus.service.UserInfoService;
+import com.jpsoft.bus.modules.common.utils.DES3;
 import com.jpsoft.bus.modules.common.utils.PojoUtils;
+import com.jpsoft.bus.modules.sys.entity.User;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
@@ -29,6 +32,8 @@ public class UserInfoController {
 
     @Autowired
     private UserInfoService userInfoService;
+    @Value("${jwt.secret}")
+    private String jwtSecret;
 
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
@@ -52,6 +57,8 @@ public class UserInfoController {
             userInfo.setDelFlag(false);
             userInfo.setCreateBy(subject);
             userInfo.setCreateTime(new Date());
+            DES3 des3 = new DES3();
+            userInfo.setPassword(des3.encrypt(jwtSecret,userInfo.getPassword()));
 
             int affectCount = userInfoService.insert(userInfo);
 
@@ -197,7 +204,9 @@ public class UserInfoController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            @RequestParam(value="id",defaultValue="") String id,
+            @RequestParam(value="name",defaultValue="") String name,
+            @RequestParam(value="phone",defaultValue="") String phone,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -213,7 +222,15 @@ public class UserInfoController {
         sortList.add(new Sort("id_","asc"));
 
         if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+            searchParams.put("id",id);
+        }
+
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name","%" + name + "%");
+        }
+
+        if (StringUtils.isNotEmpty(phone)) {
+            searchParams.put("phone","%" + phone + "%");
         }
 
         Page<UserInfo> page = userInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
@@ -223,4 +240,40 @@ public class UserInfoController {
 
         return msgResult;
     }
+
+    @ApiOperation(value="修改用户密码")
+    @PostMapping("changePassword")
+    public MessageResult<Integer> changePassword(String userId,String newPwd,@RequestAttribute String subject) {
+
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+
+            UserInfo userInfo = userInfoService.get(userId);
+
+            DES3 des3 = new DES3();
+
+            userInfo.setPassword(des3.encrypt(jwtSecret, newPwd));
+            userInfo.setUpdateBy(subject);
+            userInfo.setUpdateTime(new Date());
+
+            int affectCount = userInfoService.update(userInfo);
+
+            if(affectCount>0){
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            }
+            else{
+                msgResult.setResult(false);
+                msgResult.setMessage("修改失败!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
 }

+ 360 - 16
web/src/main/java/com/jpsoft/bus/modules/driver/controller/DriverApiController.java

@@ -1,30 +1,33 @@
 package com.jpsoft.bus.modules.driver.controller;
 
-import com.jpsoft.bus.modules.bus.entity.DriverInfo;
-import com.jpsoft.bus.modules.bus.entity.ShiftInfo;
-import com.jpsoft.bus.modules.bus.entity.VehicleInfo;
-import com.jpsoft.bus.modules.bus.service.DriverInfoService;
-import com.jpsoft.bus.modules.bus.service.ShiftInfoService;
-import com.jpsoft.bus.modules.bus.service.VehicleInfoService;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.config.OSSConfig;
+import com.jpsoft.bus.modules.bus.dto.StationStatusDTO;
+import com.jpsoft.bus.modules.bus.entity.*;
+import com.jpsoft.bus.modules.bus.service.*;
 import com.jpsoft.bus.modules.common.dto.MessageResult;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.common.utils.CommonUtil;
 import com.jpsoft.bus.modules.common.utils.JwtUtil;
+import com.jpsoft.bus.modules.common.utils.OSSUtil;
+import com.jpsoft.bus.modules.common.utils.PojoUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.bouncycastle.crypto.signers.ECDSASigner;
 import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
 
 /**
  * @author 墨鱼_mo
@@ -39,9 +42,30 @@ public class DriverApiController {
     @Value("${jwt.secret}")
     private String jwtSecret;
 
+    @Autowired
+    private OSSConfig ossConfig;
+
     @Autowired
     private ShiftInfoService shiftInfoService;
 
+    @Autowired
+    private BaiduService baiduService;
+
+    @Autowired
+    private GpsService gpsService;
+
+    @Autowired
+    private PassengerInfoService passengerInfoService;
+
+    @Autowired
+    private StationInfoService stationInfoService;
+
+    @Autowired
+    private RouteInfoService routeInfoService;
+
+    @Autowired
+    private DriverRecordInfoService driverRecordInfoService;
+
     @Autowired
     private DriverInfoService driverInfoService;
 
@@ -62,16 +86,17 @@ public class DriverApiController {
             if (vehicleInfo == null){
                 throw new Exception("车牌号或激活码错误");
             }
-            if ("1".equals(vehicleInfo.getStatus())){
+            /*if ("1".equals(vehicleInfo.getStatus())){
                 throw new Exception("此车辆已被激活");
-            }
+            }*/
             vehicleInfo.setStatus("1");
             vehicleInfoService.update(vehicleInfo);
 
-            String token = JwtUtil.createToken(jwtSecret, vehicleInfo.getId(), DateTime.now().plusHours(6).toDate());
+            String token = JwtUtil.createToken(jwtSecret, vehicleInfo.getId(), DateTime.now().plusDays(30).toDate());
 
             Map<String,Object> map = new HashMap<>();
             map.put("token",token);
+            map.put("vehicleInfo",vehicleInfo);
             messageResult.setResult(true);
             messageResult.setCode(200);
             messageResult.setData(map);
@@ -120,4 +145,323 @@ public class DriverApiController {
 
     }
 
+    @PostMapping("driverAttendance")
+    @ApiOperation(value = "司机考勤")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "driverId", value = "司机id", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "recordTime", value = "考勤时间", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "photoBase64Data", value = "照片base64编码", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "token", value = "令牌", paramType = "form"),
+            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form")
+    })
+    public MessageResult<DriverRecordInfo> driverAttendance(String driverId, String photoBase64Data, String recordTime, String token, @RequestAttribute String subject) {
+        MessageResult<DriverRecordInfo> messageResult = new MessageResult<>();
+
+        try {
+
+            VehicleInfo vehicleInfo = vehicleInfoService.get(subject);
+            if (vehicleInfo == null){
+                throw new Exception("当前车辆不存在");
+            }
+            DriverInfo driverInfo = driverInfoService.get(driverId);
+            if (driverInfo == null){
+                throw new Exception("当前司机不存在");
+            }
+            String retFileUrl = OSSUtil.uploadBase64(photoBase64Data,driverId+".jpg",ossConfig);
+           // String retFileUrl = OSSUtil.upload(ossConfig, "/faceImage", driverInfo.getName(), photoFile.getInputStream());
+            DriverRecordInfo driverRecordInfo = new DriverRecordInfo();
+            driverRecordInfo.setId(UUID.randomUUID().toString());
+            driverRecordInfo.setDriverId(driverInfo.getId());
+            driverRecordInfo.setLicensePlateNumber(vehicleInfo.getLicensePlateNumber());
+            driverRecordInfo.setRecordTime(DateUtil.parse(recordTime,"yyyy-MM-dd HH:mm:ss"));
+            driverRecordInfo.setPlace(vehicleInfo.getLatestAddress());
+            driverRecordInfo.setLatitude(vehicleInfo.getLatitude());
+            driverRecordInfo.setLongitude(vehicleInfo.getLongitude());
+            driverRecordInfo.setImageUrl(retFileUrl);
+            driverRecordInfo.setCreateTime(new Date());
+            driverRecordInfoService.insert(driverRecordInfo);
+
+            messageResult.setData(driverRecordInfo);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @GetMapping("findLastAttendanceRecord")
+    @ApiOperation(value="查询司机今日最后考勤打卡")
+    public MessageResult<DriverRecordInfo> findLastAttendanceRecord(@RequestAttribute String subject,Long driverId){
+        MessageResult<DriverRecordInfo> messageResult = new MessageResult<>();
+
+        try {
+            VehicleInfo vehicleInfo = vehicleInfoService.get(subject);
+
+            Date startTime = DateTime.now().withTimeAtStartOfDay().toDate();
+
+            DriverRecordInfo driverRecordInfo = driverRecordInfoService.findLastAttendanceRecord(driverId,vehicleInfo.getLicensePlateNumber(),startTime);
+
+            //todo 填写具体代码
+            messageResult.setData(driverRecordInfo);
+            messageResult.setResult(true);
+        }
+        catch (Exception ex){
+            log.error(ex.getMessage(),ex);
+
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+
+    @PostMapping("busRouteInfo")
+    @ApiOperation(value = "车辆线路信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "token", value = "令牌", paramType = "form"),
+            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form")
+    })
+    public MessageResult<Map> busRouteInfo(String token, @RequestAttribute String subject) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            VehicleInfo vehicleInfo = vehicleInfoService.get(subject);
+            if (vehicleInfo == null){
+                throw new Exception("当前车辆不存在");
+            }
+            if (StringUtils.isBlank(vehicleInfo.getRouteId())){
+                throw new Exception("当前车辆还未分配线路");
+            }
+            RouteInfo routeInfo = routeInfoService.get(vehicleInfo.getRouteId());
+            if (routeInfo == null){
+                throw new Exception("线路错误");
+            }
+            //始发站
+            List<StationInfo> startStationInfoList = stationInfoService.findByRouteIdAndClassify(routeInfo.getId(),1);
+            if (startStationInfoList.size() != 1){
+                throw new Exception("线路的始发站配置错误");
+            }
+            //终点站
+            List<StationInfo> endStationInfoList = stationInfoService.findByRouteIdAndClassify(routeInfo.getId(),3);
+            if (endStationInfoList.size() != 1){
+                throw new Exception("线路的终点站配置错误");
+            }
+
+
+            Map<String,Object> map = new HashMap<>();
+            map.put("startStationId",startStationInfoList.get(0).getId());
+            map.put("startStationName",startStationInfoList.get(0).getName());
+            map.put("endStationId",endStationInfoList.get(0).getId());
+            map.put("endStationName",endStationInfoList.get(0).getName());
+
+            messageResult.setData(map);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("createShift")
+    @ApiOperation(value = "开班")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "token", value = "令牌", paramType = "form"),
+            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form"),
+            @ApiImplicitParam(name = "driverId", value = "司机id", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "startStationId", value = "始发站id", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "endStationId", value = "终点站id", required = true, paramType = "form")
+
+    })
+    public MessageResult<Map> createShift(String driverId,String startStationId,String endStationId ,String token, @RequestAttribute String subject) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            VehicleInfo vehicleInfo = vehicleInfoService.get(subject);
+            if (vehicleInfo == null){
+                throw new Exception("当前车辆不存在");
+            }
+            DriverInfo driverInfo = driverInfoService.get(driverId);
+            if (driverInfo == null){
+                throw new Exception("司机不存在");
+            }
+            //始发站
+            StationInfo start = stationInfoService.get(startStationId);
+            //终点站
+            StationInfo end = stationInfoService.get(endStationId);
+            if (start == null || end == null){
+                throw new Exception("站点错误");
+            }
+            if (!start.getRouteId().equals(vehicleInfo.getRouteId()) || !end.getRouteId().equals(vehicleInfo.getRouteId())){
+                throw new Exception("站点错误");
+            }
+            shiftInfoService.createShift(vehicleInfo,driverId,startStationId,endStationId);
+
+
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("busShiftInfo")
+    @ApiOperation(value = "车辆班次信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "token", value = "令牌", paramType = "form"),
+            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form")
+    })
+    public MessageResult<Map> busShiftInfo(String token, @RequestAttribute String subject) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            VehicleInfo vehicleInfo = vehicleInfoService.get(subject);
+            if (vehicleInfo == null){
+                throw new Exception("当前车辆不存在");
+            }
+
+            List<ShiftInfo> shiftInfoList = shiftInfoService.findByVehicleIdAndStatus(vehicleInfo.getId(),"1");
+            if (shiftInfoList.size() == 0){
+                throw new Exception("车辆没有相关班次信息");
+            }
+
+            ShiftInfo shiftInfo = shiftInfoList.get(0);
+            //始发站
+            StationInfo startStation = stationInfoService.get(shiftInfo.getStartStationId());
+            //终点站
+            StationInfo endStation = stationInfoService.get(shiftInfo.getEndStationId());
+
+            //当前站点
+            StationInfo currentStation = stationInfoService.get(shiftInfo.getCurrentStationId());
+
+            StationStatusDTO stationStatusDTO = gpsService.queryStation(vehicleInfo.getId());
+            Map<String,Object> map = new HashMap<>();
+            map.put("startStationId",startStation.getId());
+            map.put("startStationName",startStation.getName());
+            map.put("endStationId",endStation.getId());
+            map.put("endStationName",endStation.getName());
+            map.put("currentStationId",currentStation.getId());
+            map.put("currentStationName",currentStation.getName());
+            map.put("nextStationId",stationStatusDTO.getNextStationId());
+            map.put("nextStationName",stationStatusDTO.getNextStationName());
+
+            messageResult.setData(map);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("passengerFaceRegister")
+    @ApiOperation(value = "乘客刷脸登记")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "personId", value = "乘客在设备上的id", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "recordTime", value = "登记时间", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "photoBase64Data", value = "照片base64编码", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "token", value = "令牌", paramType = "form"),
+            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form")
+    })
+    public MessageResult<Map> passengerFaceRegister(String personId, String photoBase64Data, String recordTime,String token, @RequestAttribute String subject) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            VehicleInfo vehicleInfo = vehicleInfoService.get(subject);
+            if (vehicleInfo == null){
+                throw new Exception("当前车辆不存在");
+            }
+
+            List<ShiftInfo> shiftInfoList = shiftInfoService.findByVehicleIdAndStatus(vehicleInfo.getId(),"1");
+            if (shiftInfoList.size() == 0){
+                throw new Exception("车辆没有相关班次信息");
+            }
+
+            ShiftInfo shiftInfo = shiftInfoList.get(0);
+            String retFileUrl = OSSUtil.uploadBase64(photoBase64Data,personId+".jpg",ossConfig);
+
+
+            passengerInfoService.passengerFace(vehicleInfo,shiftInfo,retFileUrl,recordTime,shiftInfo.getCurrentStationId(),personId);
+
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("busShiftTicketList")
+    @ApiOperation(value = "车辆班次购票情况列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "token", value = "令牌", paramType = "form"),
+            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form"),
+            @ApiImplicitParam(name = "type", value = "1:未购票,2:待下车,3:待补票,4:全部", required = true, paramType = "form")
+    })
+    public MessageResult<Map> busShiftNoTicket(String token, @RequestAttribute String subject,@RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,@RequestParam(value = "pageSize", defaultValue = "20") int pageSize,String type) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            VehicleInfo vehicleInfo = vehicleInfoService.get(subject);
+            if (vehicleInfo == null){
+                throw new Exception("当前车辆不存在");
+            }
+
+            List<ShiftInfo> shiftInfoList = shiftInfoService.findByVehicleIdAndStatus(vehicleInfo.getId(),"1");
+            if (shiftInfoList.size() == 0){
+                throw new Exception("车辆没有相关班次信息");
+            }
+
+            ShiftInfo shiftInfo = shiftInfoList.get(0);
+            Map<String,Object> searchParams = new HashMap<>();
+            searchParams.put("vehicleShiftId",shiftInfo.getId());
+            searchParams.put("status","1");
+            //未购票
+            if ("1".equals(type)){
+                searchParams.put("payStatus","0");
+            }
+            //待下车
+            if ("2".equals(type)){
+                searchParams.put("notPayStatus","0");
+                searchParams.put("downStationId",shiftInfo.getCurrentStationId());
+            }
+            //待补票
+            if ("3".equals(type)){
+                searchParams.put("payStatus","2");
+            }
+
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_time","desc"));
+            Page<PassengerInfo> page = passengerInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+
+            messageResult.setData(PojoUtils.pageWrapper(page));
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
 }

+ 148 - 2
web/src/main/java/com/jpsoft/bus/modules/mobile/controller/PassengerApiController.java

@@ -1,12 +1,15 @@
 package com.jpsoft.bus.modules.mobile.controller;
 
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.crypto.symmetric.DES;
 import com.alibaba.fastjson.JSONObject;
-import com.jpsoft.bus.modules.bus.entity.UserInfo;
-import com.jpsoft.bus.modules.bus.service.UserInfoService;
+import com.jpsoft.bus.config.OSSConfig;
+import com.jpsoft.bus.modules.bus.entity.*;
+import com.jpsoft.bus.modules.bus.service.*;
 import com.jpsoft.bus.modules.common.dto.MessageResult;
 import com.jpsoft.bus.modules.common.utils.DES3;
 import com.jpsoft.bus.modules.common.utils.JwtUtil;
+import com.jpsoft.bus.modules.common.utils.OSSUtil;
 import com.jpsoft.bus.modules.common.utils.SMSUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -22,10 +25,12 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 import sun.security.krb5.internal.crypto.Des3;
 
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
@@ -42,12 +47,30 @@ public class PassengerApiController {
     @Value("${jwt.secret}")
     private String jwtSecret;
 
+    @Autowired
+    private OSSConfig ossConfig;
+
+    @Autowired
+    private BaiduService baiduService;
+
     @Autowired
     private RedisTemplate redisTemplate;
 
     @Autowired
     private UserInfoService userInfoService;
 
+    @Autowired
+    private ShiftInfoService shiftInfoService;
+
+    @Autowired
+    private VehicleInfoService vehicleInfoService;
+
+    @Autowired
+    private RouteInfoService routeInfoService;
+
+    @Autowired
+    private StationInfoService stationInfoService;
+
 
     @PostMapping
     @ApiOperation(value = "通过车牌号查询详情")
@@ -183,4 +206,127 @@ public class PassengerApiController {
 
         return messageResult;
     }
+
+
+    @PostMapping("getShiftInfo")
+    @ApiOperation(value = "扫码获取当前班次")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "车辆id", required = true, paramType = "form")
+    })
+    public MessageResult<Map> getShiftInfo(String id) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            List<ShiftInfo> shiftInfoList = shiftInfoService.findByVehicleIdAndStatus(id,"1");
+
+            if (shiftInfoList.size() == 0){
+                throw new Exception("当前车辆没有正运行的班次");
+            }
+
+            //班次信息
+            ShiftInfo shiftInfo = shiftInfoList.get(0);
+
+            //车辆信息
+            VehicleInfo vehicleInfo = vehicleInfoService.get(id);
+
+            //线路
+            RouteInfo routeInfo = routeInfoService.get(shiftInfo.getRouteId());
+
+            //开始站点
+            StationInfo startStation = stationInfoService.get(shiftInfo.getStartStationId());
+            //结束站点
+            StationInfo endStation = stationInfoService.get(shiftInfo.getEndStationId());
+
+
+            Map<String, Object> map = new HashMap<>();
+            map.put("startStation",startStation.getName());
+            map.put("endStation",endStation.getName());
+            map.put("startTime",routeInfo.getStartTime());
+            map.put("endTime",routeInfo.getEndTime());
+            map.put("routeName",routeInfo.getName());
+            map.put("mapPath",routeInfo.getMapPath());
+            map.put("longitude",vehicleInfo.getLongitude());
+            map.put("latitude",vehicleInfo.getLatitude());
+            messageResult.setData(map);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage());
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("upload")
+    @ApiOperation(value = "人员照片上传")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "photoName", value = "照片名称", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "photoFile", value = "员工照片", required = true, paramType = "form", dataType = "__file"),
+            @ApiImplicitParam(name = "token", value = "令牌", required = false, paramType = "query"),
+            @ApiImplicitParam(name = "subject", value = "令牌", required = false, paramType = "query")
+    })
+    public MessageResult<String> upload(
+            String photoName, MultipartFile photoFile, String token, @RequestAttribute String subject) {
+        MessageResult<String> messageResult = new MessageResult<>();
+
+        try {
+
+
+            String retFileUrl = OSSUtil.upload(ossConfig, "/faceImage", photoName, photoFile.getInputStream());
+
+            messageResult.setResult(true);
+            messageResult.setData(retFileUrl);
+            messageResult.setCode(200);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            messageResult.setResult(false);
+            messageResult.setMessage(e.getMessage());
+        }
+
+        return messageResult;
+    }
+
+
+    @PostMapping("matchFaceImage")
+    @ApiOperation(value = "匹配照片")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "faceImageUrl", value = "人脸照片", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "id", value = "车辆id", required = true, paramType = "form")
+    })
+    public MessageResult<Map> matchFaceImage(String faceImageUrl,String id) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+            //车辆
+            VehicleInfo vehicleInfo = vehicleInfoService.get(id);
+            //人脸库id
+            String groupId = StrUtil.sub(vehicleInfo.getLicensePlateNumber(),1,-1);
+
+          //  baiduService.faceSearch();
+
+
+
+
+
+
+
+
+
+            Map<String, Object> map = new HashMap<>();
+            messageResult.setData(map);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage());
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+
 }

+ 3 - 3
web/src/main/resources/application-production.yml

@@ -38,9 +38,9 @@ wx:
   #荆楚云服务器内不能访问自身域名
   commonAccessTokenUrl: http://192.168.0.1:8080/weixin/token
   pay:
-    #企业联合会
-    appId: wx343bf93d2a3dc8af
-    appSecret: ac61fa669a7a79c7d2a8188ff7ddaef6
+    #车信达
+    appId: wx93675268c87a5a46
+    appSecret: 8a55e8cc8cffbf2db66f3024311036bc
 #    appId: wx0b3c41a903053808
 #    appSecret: 43557bd62f77b0c3d6670e991872f0e7
     mchId: 1500160622

+ 3 - 3
web/src/main/resources/application-test.yml

@@ -42,9 +42,9 @@ springfox:
 
 wx:
   pay:
-    #企业联合会
-    appId: wx343bf93d2a3dc8af
-    appSecret: ac61fa669a7a79c7d2a8188ff7ddaef6
+    #车信达
+    appId: wx93675268c87a5a46
+    appSecret: 8a55e8cc8cffbf2db66f3024311036bc
     token: weixin
     tokenUrl: "https://api.weixin.qq.com/cgi-bin/token"
     refreshOAuth2TokenUrl: "https://api.weixin.qq.com/sns/oauth2/refresh_token"

+ 7 - 1
web/src/main/resources/application.yml

@@ -163,9 +163,15 @@ oss:
   bucketName: rccs
 #  urlPrefix: http://rccs.oss-cn-hangzhou.aliyuncs.com
   urlPrefix: http://oss.xiaoxinda.com
-  objectPre: bus
+  objectPre: smart-bus
 
 
 gps:
   port: 8866
   key: "a71a4fa458ed085246ea75ebe096bbea"
+
+baidu:
+  key: RUxNy49Ysd5GirjID4Hn7uI5
+  secret: NRof4lmzgV3tVog47Xtd859Em413qHsw
+
+