소스 검색

增加查询班次列表接口。

zhengqiang 4 년 전
부모
커밋
6b8de6ba5a

+ 3 - 3
common/src/main/java/com/jpsoft/bus/modules/bus/dao/DriverInfoDAO.java

@@ -10,9 +10,9 @@ import com.jpsoft.bus.modules.common.dto.Sort;
 public interface DriverInfoDAO {
 	int insert(DriverInfo entity);
 	int update(DriverInfo entity);
-	int exist(String id);
-	DriverInfo get(String id);
-	int delete(String id);
+	int exist(Long id);
+	DriverInfo get(Long id);
+	int delete(Long id);
 	List<DriverInfo> list();
 	List<DriverInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
 

+ 18 - 17
common/src/main/java/com/jpsoft/bus/modules/bus/entity/DriverInfo.java

@@ -4,6 +4,7 @@ import java.io.Serializable;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
+
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
@@ -11,38 +12,38 @@ import io.swagger.annotations.ApiModel;
 import lombok.Data;
 
 /**
-  描述:bus_driver_info的实体类
+ * 描述:bus_driver_info的实体类
  */
 @Data
 @ApiModel(value = "bus_driver_info的实体类")
 public class DriverInfo {
-        @ApiModelProperty(value = "")
+    @ApiModelProperty(value = "司机编号")
     private Long id;
-        @ApiModelProperty(value = "公司id")
+    @ApiModelProperty(value = "公司id")
     private String companyId;
-        @ApiModelProperty(value = "司机姓名")
+    @ApiModelProperty(value = "司机姓名")
     private String name;
-        @ApiModelProperty(value = "身份证号码")
+    @ApiModelProperty(value = "身份证号码")
     private String idCard;
-        @ApiModelProperty(value = "手机号码")
+    @ApiModelProperty(value = "手机号码")
     private String phone;
-        @ApiModelProperty(value = "照片地址")
+    @ApiModelProperty(value = "照片地址")
     private String faceImage;
-        @ApiModelProperty(value = "备注")
+    @ApiModelProperty(value = "备注")
     private String remark;
-        @ApiModelProperty(value = "创建人")
+    @ApiModelProperty(value = "创建人")
     private String createBy;
-        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-	    @ApiModelProperty(value = "创建时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
     private Date createTime;
-        @ApiModelProperty(value = "更新人")
+    @ApiModelProperty(value = "更新人")
     private String updateBy;
-        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-	    @ApiModelProperty(value = "更新时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "更新时间")
     private Date updateTime;
-        @ApiModelProperty(value = "是否删除")
+    @ApiModelProperty(value = "是否删除")
     private Boolean delFlag;
 
 

+ 3 - 3
common/src/main/java/com/jpsoft/bus/modules/bus/service/DriverInfoService.java

@@ -7,11 +7,11 @@ import com.github.pagehelper.Page;
 import com.jpsoft.bus.modules.common.dto.Sort;
 
 public interface DriverInfoService {
-	DriverInfo get(String id);
-	boolean exist(String id);
+	DriverInfo get(Long id);
+	boolean exist(Long id);
 	int insert(DriverInfo model);
 	int update(DriverInfo model);
-	int delete(String id);
+	int delete(Long id);
 	List<DriverInfo> list();
 	Page<DriverInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 

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

@@ -20,6 +20,6 @@ public interface ShiftInfoService {
 
     List<ShiftInfo> findByVehicleIdAndStatus(String vehicleId, String status);
 
-    void createShift(VehicleInfo vehicleInfo, String driverId, String startStationId, String endStationId) throws Exception;
+    void createShift(VehicleInfo vehicleInfo, Long driverId, String startStationId, String endStationId) throws Exception;
 
 }

+ 3 - 3
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/DriverInfoServiceImpl.java

@@ -20,7 +20,7 @@ public class DriverInfoServiceImpl implements DriverInfoService {
 	private DriverInfoDAO driverInfoDAO;
 
 	@Override
-	public DriverInfo get(String id) {
+	public DriverInfo get(Long id) {
 		// TODO Auto-generated method stub
 		return driverInfoDAO.get(id);
 	}
@@ -40,13 +40,13 @@ public class DriverInfoServiceImpl implements DriverInfoService {
 	}
 
 	@Override
-	public int delete(String id) {
+	public int delete(Long id) {
 		// TODO Auto-generated method stub
 		return driverInfoDAO.delete(id);
 	}
 
 	@Override
-	public boolean exist(String id) {
+	public boolean exist(Long id) {
 		// TODO Auto-generated method stub
 		int count = driverInfoDAO.exist(id);
 

+ 16 - 11
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/GpsServiceImpl.java

@@ -246,16 +246,16 @@ public class GpsServiceImpl implements GpsService {
          //下一站站点
         StationInfo nextStation = null;
 
-         Integer index =  stationInfoList.indexOf(currentStation);
+         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 {
+         if (nextIndex>=0 && nextIndex < stationInfoList.size()){
              nextStation = stationInfoList.get(nextIndex);
          }
 
@@ -266,6 +266,7 @@ public class GpsServiceImpl implements GpsService {
              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 {
@@ -275,15 +276,17 @@ public class GpsServiceImpl implements GpsService {
 
         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");
-        }
+        if (nextStation!=null) {
+            stationStatusDTO.setNextStationId(nextStation.getId());
+            stationStatusDTO.setNextStationName(nextStation.getName());
 
+            if (nextStation.equals(currentStation)){
+                stationStatusDTO.setNextStationStatus(stationStatusDTO.getNowStationStatus());
+            }else {
+                stationStatusDTO.setNextStationStatus("3");
+            }
+        }
 
         return stationStatusDTO;
     }
@@ -331,6 +334,7 @@ public class GpsServiceImpl implements GpsService {
 
                         if(matchDistance(stationInfo,vehicleInfo,50)){
                            currentStationId = stationInfo.getId();
+                           break;
                         }
                     }
                 }
@@ -345,6 +349,7 @@ public class GpsServiceImpl implements GpsService {
 
                         if(matchDistance(stationInfo,vehicleInfo,50)){
                             currentStationId = stationInfo.getId();
+                            break;
                         }
                     }
                 }

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

@@ -88,7 +88,7 @@ public class ShiftInfoServiceImpl implements ShiftInfoService {
 	}
 
 	@Override
-	public void createShift(VehicleInfo vehicleInfo, String driverId, String startStationId, String endStationId) throws Exception {
+	public void createShift(VehicleInfo vehicleInfo, Long driverId, String startStationId, String endStationId) throws Exception {
 		List<ShiftInfo> shiftInfoList = findByVehicleIdAndStatus(vehicleInfo.getId(),"1");
 		if (shiftInfoList.size()>0){
 			for (ShiftInfo shiftInfo : shiftInfoList){

+ 111 - 110
common/src/main/resources/mapper/bus/DriverInfo.xml

@@ -1,128 +1,129 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!-- namespace必须指向DAO接口 -->
 <mapper namespace="com.jpsoft.bus.modules.bus.dao.DriverInfoDAO">
-	<resultMap id="DriverInfoMap" type="com.jpsoft.bus.modules.bus.entity.DriverInfo">
-		<id property="id" column="id_" />
-			<result property="companyId" column="company_id" />
-			<result property="name" column="name_" />
-			<result property="idCard" column="id_card" />
-			<result property="phone" column="phone_" />
-			<result property="faceImage" column="face_image" />
-			<result property="remark" column="remark_" />
-			<result property="createBy" column="create_by" />
-			<result property="createTime" column="create_time" />
-			<result property="updateBy" column="update_by" />
-			<result property="updateTime" column="update_time" />
-			<result property="delFlag" column="del_flag" />
-			</resultMap>
-	<insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.DriverInfo">
-	<!--
-	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
-		select sys_guid() from dual
-	</selectKey>
-	-->
-	<![CDATA[
+    <resultMap id="DriverInfoMap" type="com.jpsoft.bus.modules.bus.entity.DriverInfo">
+        <id property="id" column="id_"/>
+        <result property="companyId" column="company_id"/>
+        <result property="name" column="name_"/>
+        <result property="idCard" column="id_card"/>
+        <result property="phone" column="phone_"/>
+        <result property="faceImage" column="face_image"/>
+        <result property="remark" column="remark_"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="delFlag" column="del_flag"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.DriverInfo">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
 		insert into bus_driver_info
 	    (company_id,name_,id_card,phone_,face_image,remark_,create_by,create_time,update_by,update_time,del_flag)
 		values
 		(
-#{companyId,jdbcType=VARCHAR}
-,#{name,jdbcType=VARCHAR}
-,#{idCard,jdbcType=VARCHAR}
-,#{phone,jdbcType=VARCHAR}
-,#{faceImage,jdbcType=VARCHAR}
-,#{remark,jdbcType=VARCHAR}
-,#{createBy,jdbcType=VARCHAR}
-,#{createTime,jdbcType= TIMESTAMP }
-,#{updateBy,jdbcType=VARCHAR}
-,#{updateTime,jdbcType= TIMESTAMP }
-,#{delFlag,jdbcType= NUMERIC }
+		#{companyId,jdbcType=VARCHAR}
+		,#{name,jdbcType=VARCHAR}
+		,#{idCard,jdbcType=VARCHAR}
+		,#{phone,jdbcType=VARCHAR}
+		,#{faceImage,jdbcType=VARCHAR}
+		,#{remark,jdbcType=VARCHAR}
+		,#{createBy,jdbcType=VARCHAR}
+		,#{createTime,jdbcType= TIMESTAMP }
+		,#{updateBy,jdbcType=VARCHAR}
+		,#{updateTime,jdbcType= TIMESTAMP }
+		,#{delFlag,jdbcType= NUMERIC }
 		)
 	]]>
-	</insert>
-	<delete id="delete" parameterType="string">
-		delete from bus_driver_info where id_=#{id,jdbcType=VARCHAR}
-	</delete>
-	<update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.DriverInfo">
-		update bus_driver_info
-		<set>
-				<if test="companyId!=null">
-		  company_id=#{companyId,jdbcType=VARCHAR},
-		</if>
-				<if test="name!=null">
-		name_=#{name,jdbcType=VARCHAR},
-		</if>
-				<if test="idCard!=null">
-		id_card=#{idCard,jdbcType=VARCHAR},
-		</if>
-				<if test="phone!=null">
-		phone_=#{phone,jdbcType=VARCHAR},
-		</if>
-				<if test="faceImage!=null">
-		face_image=#{faceImage,jdbcType=VARCHAR},
-		</if>
-				<if test="remark!=null">
-		remark_=#{remark,jdbcType=VARCHAR},
-		</if>
-				<if test="createBy!=null">
-		create_by=#{createBy,jdbcType=VARCHAR},
-		</if>
-				<if test="createTime!=null">
-		create_time=#{createTime,jdbcType= TIMESTAMP },
-		</if>
-				<if test="updateBy!=null">
-		update_by=#{updateBy,jdbcType=VARCHAR},
-		</if>
-				<if test="updateTime!=null">
-		update_time=#{updateTime,jdbcType= TIMESTAMP },
-		</if>
-				<if test="delFlag!=null">
-		del_flag=#{delFlag,jdbcType= NUMERIC },
-		</if>
-		</set>
-	where id_=#{id}
-	</update>
-	<select id="get" parameterType="string" resultMap="DriverInfoMap">
-		select
-id_,company_id,name_,id_card,phone_,face_image,remark_,create_by,create_time,update_by,update_time,del_flag		from bus_driver_info where id_=#{0}
-	</select>
-	<select id="exist" parameterType="string" resultType="int">
-		select count(*) from bus_driver_info where id_=#{0}
-	</select>
-	<select id="list" resultMap="DriverInfoMap">
-		select * from bus_driver_info
-	</select>
-	<select id="search" parameterType="hashmap" resultMap="DriverInfoMap">
-		<![CDATA[
+    </insert>
+    <delete id="delete" parameterType="long">
+        delete from bus_driver_info where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.DriverInfo">
+        update bus_driver_info
+        <set>
+            <if test="companyId!=null">
+                company_id=#{companyId,jdbcType=VARCHAR},
+            </if>
+            <if test="name!=null">
+                name_=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="idCard!=null">
+                id_card=#{idCard,jdbcType=VARCHAR},
+            </if>
+            <if test="phone!=null">
+                phone_=#{phone,jdbcType=VARCHAR},
+            </if>
+            <if test="faceImage!=null">
+                face_image=#{faceImage,jdbcType=VARCHAR},
+            </if>
+            <if test="remark!=null">
+                remark_=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="long" resultMap="DriverInfoMap">
+        select
+        id_,company_id,name_,id_card,phone_,face_image,remark_,create_by,create_time,update_by,update_time,del_flag from
+        bus_driver_info where id_=#{0}
+    </select>
+    <select id="exist" parameterType="long" resultType="int">
+        select count(*) from bus_driver_info where id_=#{0}
+    </select>
+    <select id="list" resultMap="DriverInfoMap">
+        select * from bus_driver_info
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="DriverInfoMap">
+        <![CDATA[
 			select * from bus_driver_info
 		]]>
-		<where>
-			del_flag = false
-			<if test="searchParams.companyId != null">
-				and company_id = #{searchParams.companyId}
-			</if>
-			<if test="searchParams.name != null">
-				and name_ like #{searchParams.name}
-			</if>
-			<if test="searchParams.idCard != null">
-				and id_card like #{searchParams.idCard}
-			</if>
-			<if test="searchParams.phone != null">
-				and phone_ like #{searchParams.phone}
-			</if>
-		</where>
-		<foreach item="sort" collection="sortList"  open="order by" separator=",">
-	        ${sort.name} ${sort.order}
-	 	</foreach>
-	</select>
-	<select id="findByPhone" resultMap="DriverInfoMap">
-		<![CDATA[
+        <where>
+            del_flag = false
+            <if test="searchParams.companyId != null">
+                and company_id = #{searchParams.companyId}
+            </if>
+            <if test="searchParams.name != null">
+                and name_ like #{searchParams.name}
+            </if>
+            <if test="searchParams.idCard != null">
+                and id_card like #{searchParams.idCard}
+            </if>
+            <if test="searchParams.phone != null">
+                and phone_ like #{searchParams.phone}
+            </if>
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+    <select id="findByPhone" resultMap="DriverInfoMap">
+        <![CDATA[
 		select * from bus_driver_info
 		where del_flag = 0
 		and phone_ = #{phone}
 		limit 1
 		]]>
-	</select>
+    </select>
 </mapper>

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

@@ -134,6 +134,9 @@
 			<if test="searchParams.id != null">
 				and a.ID_ like #{searchParams.id}
 			</if>
+			<if test="searchParams.vehicleId != null">
+				and a.vehicle_id = #{searchParams.vehicleId}
+			</if>
 			<if test="searchParams.vehicleNumber != null">
 				and c.license_plate_number like #{searchParams.vehicleNumber}
 			</if>

+ 1 - 1
web/src/main/java/com/jpsoft/bus/modules/base/controller/OrderInfoController.java

@@ -280,7 +280,7 @@ public class OrderInfoController {
             if(passengerInfo!=null){
                 ShiftInfo shiftInfo = shiftInfoService.get(passengerInfo.getVehicleShiftId());
                 if(shiftInfo!=null){
-                    DriverInfo driverInfo = driverInfoService.get(shiftInfo.getDriverId().toString());
+                    DriverInfo driverInfo = driverInfoService.get(shiftInfo.getDriverId());
                     if(driverInfo!=null){
                         dto.setDriverName(driverInfo.getName());
                     }

+ 4 - 4
web/src/main/java/com/jpsoft/bus/modules/bus/controller/DriverInfoController.java

@@ -93,7 +93,7 @@ public class DriverInfoController {
 
     @ApiOperation(value="获取信息")
     @GetMapping("edit/{id}")
-    public MessageResult<DriverInfo> edit(@PathVariable("id") String id){
+    public MessageResult<DriverInfo> edit(@PathVariable("id") Long id){
         MessageResult<DriverInfo> msgResult = new MessageResult<>();
 
         try {
@@ -148,7 +148,7 @@ public class DriverInfoController {
 
 	@ApiOperation(value="删除")
     @PostMapping("delete/{id}")
-    public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+    public MessageResult<Integer> delete(@PathVariable("id") Long id,@RequestAttribute String subject){
         MessageResult<Integer> msgResult = new MessageResult<>();
 
         try {
@@ -180,13 +180,13 @@ public class DriverInfoController {
 
     @ApiOperation(value="批量删除")
     @PostMapping("batchDelete")
-    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
+    public MessageResult<Integer> batchDelete(@RequestBody List<Long> idList,@RequestAttribute String subject){
         MessageResult<Integer> msgResult = new MessageResult<>();
 
         try {
             int affectCount = 0;
 
-            for (String id : idList) {
+            for (Long id : idList) {
                 DriverInfo driverInfo = driverInfoService.get(id);
                 driverInfo.setDelFlag(true);
                 driverInfo.setUpdateBy(subject);

+ 1 - 1
web/src/main/java/com/jpsoft/bus/modules/bus/controller/DriverRecordInfoController.java

@@ -81,7 +81,7 @@ public class DriverRecordInfoController {
         Page<DriverRecordInfo> page = driverRecordInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
         for (DriverRecordInfo driverRecordInfo:page) {
-            DriverInfo driverInfo = driverInfoService.get(driverRecordInfo.getDriverId().toString());
+            DriverInfo driverInfo = driverInfoService.get(driverRecordInfo.getDriverId());
             if(driverInfo!=null){
                 driverRecordInfo.setDriverName(driverInfo.getName());
             }

+ 100 - 2
web/src/main/java/com/jpsoft/bus/modules/driver/controller/DriverApiController.java

@@ -181,18 +181,25 @@ public class DriverApiController {
             @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) {
+    public MessageResult<DriverRecordInfo> driverAttendance(@RequestBody JSONObject requestBody, @RequestAttribute String subject) {
         MessageResult<DriverRecordInfo> messageResult = new MessageResult<>();
 
         try {
+            Long driverId = requestBody.getLong("driverId");
+            String photoBase64Data = requestBody.getString("photoBase64Data");
+            String recordTime = requestBody.getString("recordTime");
+
             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();
@@ -308,7 +315,7 @@ public class DriverApiController {
             @ApiImplicitParam(name = "endStationId", value = "终点站id", required = true, paramType = "form")
 
     })
-    public MessageResult<Map> createShift(String driverId,String startStationId,String endStationId ,String token, @RequestAttribute String subject) {
+    public MessageResult<Map> createShift(Long driverId,String startStationId,String endStationId ,String token, @RequestAttribute String subject) {
         MessageResult<Map> messageResult = new MessageResult<>();
 
         try {
@@ -532,6 +539,10 @@ public class DriverApiController {
                 throw new Exception("当前车辆不存在");
             }
 
+            if (pageSize>100){
+                pageSize=100;
+            }
+
             ShiftInfo shiftInfo = null;
 
             if (StringUtils.isNotEmpty(shiftId)){
@@ -1035,4 +1046,91 @@ public class DriverApiController {
 
         return messageResult;
     }
+
+    @PostMapping("queryBusShiftList")
+    @ApiOperation(value="查询车辆班次列表")
+    public MessageResult<Map> queryBusShiftList(
+            @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
+            @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
+            @RequestAttribute String subject){
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+            Map<String,Object> searchParams = new HashMap<>();
+
+            searchParams.put("vehicleId", subject);
+
+            List<Sort> sortList = new ArrayList<>();
+
+            sortList.add(new Sort("create_time","desc"));
+
+            if (pageSize>100){
+                pageSize=100;
+            }
+
+            Page<ShiftInfo> page = shiftInfoService.pageSearch(searchParams,pageIndex,pageSize,true, sortList);
+
+            Map<String,Object> dataMap = PojoUtils.pageWrapper(page);
+
+//            List<Map> mapList = new ArrayList<>();
+//
+//            VehicleInfo vehicleInfo = vehicleInfoService.get(subject);
+//
+//            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+//
+//            for (ShiftInfo shiftInfo : page.getResult()) {
+//                Map<String,Object> map = new HashMap<>();
+//
+//                //查询司机、线路、车牌、起始站、终点站、开班时间、收班时间
+//                DriverInfo driverInfo = driverInfoService.get(shiftInfo.getDriverId());
+//                RouteInfo routeInfo = routeInfoService.get(shiftInfo.getRouteId());
+//                //起始站
+//                StationInfo startStation = stationInfoService.get(shiftInfo.getStartStationId());
+//                //终点站
+//                StationInfo endStation = stationInfoService.get(shiftInfo.getEndStationId());
+//
+//                if (driverInfo!=null){
+//                    map.put("driverName", driverInfo.getName());
+//                }
+//
+//                if (routeInfo!=null) {
+//                    map.put("routeName", routeInfo.getName());
+//                }
+//
+//                map.put("licensePlateNumber", vehicleInfo.getLicensePlateNumber());
+//
+//                if (startStation!=null){
+//                    map.put("startStationName", startStation.getName());
+//                }
+//
+//                if(endStation!=null) {
+//                    map.put("endStationName", endStation.getName());
+//                }
+//
+//                if (shiftInfo.getCreateTime()!=null){
+//                    map.put("createTime", sdf.format(shiftInfo.getCreateTime()));
+//                }
+//
+//                if (shiftInfo.getFinishTime()!=null){
+//                    map.put("finishTime", sdf.format(shiftInfo.getFinishTime()));
+//                }
+//
+//                mapList.add(map);
+//            }
+
+//            dataMap.put("data", mapList);
+
+            messageResult.setData(dataMap);
+
+            messageResult.setResult(true);
+        }
+        catch (Exception ex){
+            log.error(ex.getMessage(),ex);
+
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
 }