فهرست منبع

Merge remote-tracking branch 'origin/master'

yanliming 4 سال پیش
والد
کامیت
8b22915a85
21فایلهای تغییر یافته به همراه1281 افزوده شده و 77 حذف شده
  1. 27 24
      common/src/main/java/com/jpsoft/bus/modules/base/entity/OrderInfo.java
  2. 23 20
      common/src/main/java/com/jpsoft/bus/modules/base/entity/PaymentInfo.java
  3. 18 0
      common/src/main/java/com/jpsoft/bus/modules/bus/dao/PassengerInfoDAO.java
  4. 18 0
      common/src/main/java/com/jpsoft/bus/modules/bus/dao/ShiftInfoDAO.java
  5. 59 0
      common/src/main/java/com/jpsoft/bus/modules/bus/entity/PassengerInfo.java
  6. 53 0
      common/src/main/java/com/jpsoft/bus/modules/bus/entity/ShiftInfo.java
  7. 21 18
      common/src/main/java/com/jpsoft/bus/modules/bus/entity/UserInfo.java
  8. 17 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/PassengerInfoService.java
  9. 17 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/ShiftInfoService.java
  10. 70 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/PassengerInfoServiceImpl.java
  11. 70 0
      common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/ShiftInfoServiceImpl.java
  12. 105 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/BaiduAuthUtil.java
  13. 8 4
      common/src/main/resources/mapper/base/OrderInfo.xml
  14. 8 4
      common/src/main/resources/mapper/base/PaymentInfo.xml
  15. 131 0
      common/src/main/resources/mapper/bus/PassengerInfo.xml
  16. 121 0
      common/src/main/resources/mapper/bus/ShiftInfo.xml
  17. 7 3
      common/src/main/resources/mapper/bus/UserInfo.xml
  18. 229 0
      web/src/main/java/com/jpsoft/bus/modules/bus/controller/PassengerInfoController.java
  19. 229 0
      web/src/main/java/com/jpsoft/bus/modules/bus/controller/ShiftInfoController.java
  20. 3 4
      web/src/main/java/com/jpsoft/bus/modules/bus/controller/UserInfoController.java
  21. 47 0
      web/src/main/java/com/jpsoft/bus/modules/mobile/controller/PassengerApiController.java

+ 27 - 24
common/src/main/java/com/jpsoft/bus/modules/base/entity/OrderInfo.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,49 +12,51 @@ import io.swagger.annotations.ApiModel;
 import lombok.Data;
 
 /**
-  描述:base_order_info的实体类
+ * 描述:base_order_info的实体类
  */
 @Data
 @ApiModel(value = "base_order_info的实体类")
 public class OrderInfo {
-        @ApiModelProperty(value = "")
+    @ApiModelProperty(value = "")
     private String id;
-        @ApiModelProperty(value = "账单金额")
+    @ApiModelProperty(value = "账单金额")
     private BigDecimal totalFee;
-        @ApiModelProperty(value = "商品描述")
+    @ApiModelProperty(value = "商品描述")
     private String body;
-        @ApiModelProperty(value = "支付状态(10:未支付,15:部分支付,20:支付完成,30:关闭,40:全额退款,45:部分退款)")
+    @ApiModelProperty(value = "支付状态(10:未支付,15:部分支付,20:支付完成,30:关闭,40:全额退款,45:部分退款)")
     private Integer payStatus;
-        @ApiModelProperty(value = "支付方式(wechat:微信,alipay:支付宝,cash:现金,ticket:车票)")
+    @ApiModelProperty(value = "支付方式(wechat:微信,alipay:支付宝,cash:现金,ticket:车票)")
     private String payName;
-        @ApiModelProperty(value = "支付金额")
+    @ApiModelProperty(value = "支付金额")
     private BigDecimal payFee;
-        @ApiModelProperty(value = "退款金额")
+    @ApiModelProperty(value = "退款金额")
     private BigDecimal refundFee;
-        @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 payTime;
-        @ApiModelProperty(value = "系统订单号")
+    @ApiModelProperty(value = "系统订单号")
     private String outOrderNo;
-        @ApiModelProperty(value = "微信支付订单号")
+    @ApiModelProperty(value = "微信支付订单号")
     private String transactionId;
-        @ApiModelProperty(value = "用户标识")
+    @ApiModelProperty(value = "用户标识")
     private String openId;
-        @ApiModelProperty(value = "收款账户id")
+    @ApiModelProperty(value = "收款账户id")
     private String paymentId;
-        @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;
+    @ApiModelProperty(value = "乘客记录表")
+    private String passengerId;
 }

+ 23 - 20
common/src/main/java/com/jpsoft/bus/modules/base/entity/PaymentInfo.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,43 +12,45 @@ import io.swagger.annotations.ApiModel;
 import lombok.Data;
 
 /**
-  描述:base_payment_info的实体类
+ * 描述:base_payment_info的实体类
  */
 @Data
 @ApiModel(value = "base_payment_info的实体类")
 public class PaymentInfo {
-        @ApiModelProperty(value = "")
+    @ApiModelProperty(value = "")
     private String id;
-        @ApiModelProperty(value = "账户名称")
+    @ApiModelProperty(value = "对应公司id")
+    private String companyId;
+    @ApiModelProperty(value = "账户名称")
     private String name;
-        @ApiModelProperty(value = "微信的回调地址")
+    @ApiModelProperty(value = "微信的回调地址")
     private String wechatNotifyUrl;
-        @ApiModelProperty(value = "支付宝的回调地址")
+    @ApiModelProperty(value = "支付宝的回调地址")
     private String alipayNotifyUrl;
-        @ApiModelProperty(value = "")
+    @ApiModelProperty(value = "")
     private String appId;
-        @ApiModelProperty(value = "")
+    @ApiModelProperty(value = "")
     private String subAppSecret;
-        @ApiModelProperty(value = "服务商标识")
+    @ApiModelProperty(value = "服务商标识")
     private String mchId;
-        @ApiModelProperty(value = "服务商模式下子公众号APPID")
+    @ApiModelProperty(value = "服务商模式下子公众号APPID")
     private String subAppId;
-        @ApiModelProperty(value = "服务商模式下子商户号id")
+    @ApiModelProperty(value = "服务商模式下子商户号id")
     private String subMchId;
-        @ApiModelProperty(value = "支付宝授权token")
+    @ApiModelProperty(value = "支付宝授权token")
     private String appAuthToken;
-        @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;
 }

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

@@ -0,0 +1,18 @@
+package com.jpsoft.bus.modules.bus.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.bus.modules.bus.entity.PassengerInfo;
+import java.util.Map;
+import com.jpsoft.bus.modules.common.dto.Sort;
+
+@Repository
+public interface PassengerInfoDAO {
+	int insert(PassengerInfo entity);
+	int update(PassengerInfo entity);
+	int exist(String id);
+	PassengerInfo get(String id);
+	int delete(String id);
+	List<PassengerInfo> list();
+	List<PassengerInfo> search(Map<String,Object> searchParams,List<Sort> sortList);
+}

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

@@ -0,0 +1,18 @@
+package com.jpsoft.bus.modules.bus.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.bus.modules.bus.entity.ShiftInfo;
+import java.util.Map;
+import com.jpsoft.bus.modules.common.dto.Sort;
+
+@Repository
+public interface ShiftInfoDAO {
+	int insert(ShiftInfo entity);
+	int update(ShiftInfo entity);
+	int exist(String id);
+	ShiftInfo get(String id);
+	int delete(String id);
+	List<ShiftInfo> list();
+	List<ShiftInfo> search(Map<String,Object> searchParams,List<Sort> sortList);
+}

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

@@ -0,0 +1,59 @@
+package com.jpsoft.bus.modules.bus.entity;
+
+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;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+  描述:bus_passenger_info的实体类
+ */
+@Data
+@ApiModel(value = "bus_passenger_info的实体类")
+public class PassengerInfo {
+        @ApiModelProperty(value = "乘客表主键")
+    private String id;
+        @ApiModelProperty(value = "车辆班次编号")
+    private String vehicleShiftId;
+        @ApiModelProperty(value = "车辆人员设备编号")
+    private Long  vehiclePersonId;
+        @ApiModelProperty(value = "注册用户编号")
+    private Long userId;
+        @ApiModelProperty(value = "乘车人照片")
+    private String imageUrl;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "上车时间")
+    private Date upTime;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "下车时间")
+    private Date downTime;
+        @ApiModelProperty(value = "上车站点")
+    private String upStationId;
+        @ApiModelProperty(value = "下车站点")
+    private String downStationId;
+        @ApiModelProperty(value = "0-未乘车、1-上车、2-下车")
+    private String status;
+        @ApiModelProperty(value = "0-未购票、1-已购票,2-已过站,3-已补票")
+    private String payStatus;
+        @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;
+}

+ 53 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/entity/ShiftInfo.java

@@ -0,0 +1,53 @@
+package com.jpsoft.bus.modules.bus.entity;
+
+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;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+  描述:bus_shift_info的实体类
+ */
+@Data
+@ApiModel(value = "bus_shift_info的实体类")
+public class ShiftInfo {
+        @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;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "是否收班(到达终点站,乘客全部下车)")
+    private Date finishTime;
+}

+ 21 - 18
common/src/main/java/com/jpsoft/bus/modules/bus/entity/UserInfo.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,37 +12,39 @@ import io.swagger.annotations.ApiModel;
 import lombok.Data;
 
 /**
-  描述:bus_user_info的实体类
+ * 描述:bus_user_info的实体类
  */
 @Data
 @ApiModel(value = "bus_user_info的实体类")
 public class UserInfo {
-        @ApiModelProperty(value = "")
-    private String id;
-        @ApiModelProperty(value = "乘客姓名")
+    @ApiModelProperty(value = "")
+    private Long id;
+    @ApiModelProperty(value = "乘客姓名")
     private String name;
-        @ApiModelProperty(value = "手机号码")
+    @ApiModelProperty(value = "手机号码")
     private String phone;
-        @ApiModelProperty(value = "密码")
+    @ApiModelProperty(value = "密码")
     private String password;
-        @ApiModelProperty(value = "人脸图片")
+    @ApiModelProperty(value = "人脸图片")
     private String faceImage;
-        @ApiModelProperty(value = "是否接受乘车信息(0:否,1:是)")
+    @ApiModelProperty(value = "是否接受乘车信息(0:否,1:是)")
     private Boolean acceptMessage;
-        @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;
-        @ApiModelProperty(value = "备注")
+    @ApiModelProperty(value = "备注")
     private String remark;
+    @ApiModelProperty(value = "openId")
+    private String openId;
 }

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

@@ -0,0 +1,17 @@
+package com.jpsoft.bus.modules.bus.service;
+
+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.common.dto.Sort;
+
+public interface PassengerInfoService {
+	PassengerInfo get(String id);
+	boolean exist(String id);
+	int insert(PassengerInfo model);
+	int update(PassengerInfo model);
+	int delete(String id);
+	List<PassengerInfo> list();
+	Page<PassengerInfo> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+}

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

@@ -0,0 +1,17 @@
+package com.jpsoft.bus.modules.bus.service;
+
+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.common.dto.Sort;
+
+public interface ShiftInfoService {
+	ShiftInfo get(String id);
+	boolean exist(String id);
+	int insert(ShiftInfo model);
+	int update(ShiftInfo model);
+	int delete(String id);
+	List<ShiftInfo> list();
+	Page<ShiftInfo> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+}

+ 70 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/PassengerInfoServiceImpl.java

@@ -0,0 +1,70 @@
+package com.jpsoft.bus.modules.bus.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.bus.modules.bus.dao.PassengerInfoDAO;
+import com.jpsoft.bus.modules.bus.entity.PassengerInfo;
+import com.jpsoft.bus.modules.bus.service.PassengerInfoService;
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="passengerInfoService")
+public class PassengerInfoServiceImpl implements PassengerInfoService {
+	@Resource(name="passengerInfoDAO")
+	private PassengerInfoDAO passengerInfoDAO;
+
+	@Override
+	public PassengerInfo get(String id) {
+		// TODO Auto-generated method stub
+		return passengerInfoDAO.get(id);
+	}
+
+	@Override
+	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);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return passengerInfoDAO.delete(id);
+	}
+
+	@Override
+	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;
+	}
+}

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

@@ -0,0 +1,70 @@
+package com.jpsoft.bus.modules.bus.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.bus.modules.bus.dao.ShiftInfoDAO;
+import com.jpsoft.bus.modules.bus.entity.ShiftInfo;
+import com.jpsoft.bus.modules.bus.service.ShiftInfoService;
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="shiftInfoService")
+public class ShiftInfoServiceImpl implements ShiftInfoService {
+	@Resource(name="shiftInfoDAO")
+	private ShiftInfoDAO shiftInfoDAO;
+
+	@Override
+	public ShiftInfo get(String id) {
+		// TODO Auto-generated method stub
+		return shiftInfoDAO.get(id);
+	}
+
+	@Override
+	public int insert(ShiftInfo model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return shiftInfoDAO.insert(model);
+	}
+
+	@Override
+	public int update(ShiftInfo model) {
+		// TODO Auto-generated method stub
+		return shiftInfoDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return shiftInfoDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = shiftInfoDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<ShiftInfo> list() {
+		// TODO Auto-generated method stub
+		return shiftInfoDAO.list();
+	}
+		
+	@Override
+	public Page<ShiftInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<ShiftInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            shiftInfoDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 105 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/BaiduAuthUtil.java

@@ -0,0 +1,105 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import cn.hutool.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-3-29 11:19
+ */
+@Component
+public class BaiduAuthUtil {
+
+
+    @Autowired
+    private RedisTemplate redisTemplate;
+
+    /**
+     * 获取权限token
+     *
+     * @return 返回示例:
+     * {
+     * "access_token": "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567",
+     * "expires_in": 2592000
+     * }
+     */
+    public String getAuth() {
+        // 官网获取的 API Key 更新为你注册的
+        String clientId = "FhN3QuocpqH2XNMHZU3GlCun";
+        // 官网获取的 Secret Key 更新为你注册的
+        String clientSecret = "N5Lfz9p8MHn8m0YSwjmT6SWvkboKYa2A";
+        return getAuth(clientId, clientSecret);
+    }
+
+    /**
+     * 获取API访问token
+     * 该token有一定的有效期,需要自行管理,当失效时需重新获取.
+     *
+     * @param ak - 百度云官网获取的 API Key
+     * @param sk - 百度云官网获取的 Securet Key
+     * @return assess_token 示例:
+     * "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567"
+     */
+    public String getAuth(String ak, String sk) {
+
+
+        try {
+            String accessToken = null;
+            if (redisTemplate.hasKey("baiduToken")) {
+                accessToken = redisTemplate.opsForValue().get("baiduToken").toString();
+            } else {
+
+
+                // 获取token地址
+                String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
+                String getAccessTokenUrl = authHost
+                        // 1. grant_type为固定参数
+                        + "grant_type=client_credentials"
+                        // 2. 官网获取的 API Key
+                        + "&client_id=" + ak
+                        // 3. 官网获取的 Secret Key
+                        + "&client_secret=" + sk;
+
+                URL realUrl = new URL(getAccessTokenUrl);
+                // 打开和URL之间的连接
+                HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
+                connection.setRequestMethod("GET");
+                connection.connect();
+                // 获取所有响应头字段
+                Map<String, List<String>> map = connection.getHeaderFields();
+                // 遍历所有的响应头字段
+                for (String key : map.keySet()) {
+                    System.err.println(key + "--->" + map.get(key));
+                }
+                // 定义 BufferedReader输入流来读取URL的响应
+                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+                String result = "";
+                String line;
+                while ((line = in.readLine()) != null) {
+                    result += line;
+                }
+                JSONObject jsonObject = new JSONObject(result);
+                accessToken = jsonObject.getStr("access_token");
+
+                redisTemplate.opsForValue().set("baiduToken",accessToken,10, TimeUnit.DAYS);
+
+            }
+                return accessToken;
+            } catch(Exception e){
+                System.err.printf("获取token失败!");
+                e.printStackTrace(System.err);
+            }
+            return null;
+        }
+
+    }

+ 8 - 4
common/src/main/resources/mapper/base/OrderInfo.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.base.dao.OrderInfoDAO">
@@ -21,6 +21,7 @@
 			<result property="updateBy" column="update_by" />
 			<result property="updateTime" column="update_time" />
 			<result property="delFlag" column="del_flag" />
+			<result property="passengerId" column="passenger_id"/>
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.bus.modules.base.entity.OrderInfo">
 	<!--
@@ -30,7 +31,7 @@
 	-->
 	<![CDATA[
 		insert into base_order_info
-	    (id_,total_fee,body_,pay_status,pay_name,pay_fee,refund_fee,pay_time,out_order_no,transaction_id,open_id,payment_id,create_by,create_time,update_by,update_time,del_flag)
+	    (id_,total_fee,body_,pay_status,pay_name,pay_fee,refund_fee,pay_time,out_order_no,transaction_id,open_id,payment_id,create_by,create_time,update_by,update_time,del_flag,passenger_id)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -50,6 +51,7 @@
 ,#{updateBy,jdbcType=VARCHAR}
 ,#{updateTime,jdbcType= TIMESTAMP }
 ,#{delFlag,jdbcType= NUMERIC }
+,#{passengerId,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -107,12 +109,14 @@
 				<if test="delFlag!=null">
 		del_flag=#{delFlag,jdbcType= NUMERIC },
 		</if>
+			<if test="passengerId!=null">
+				passenger_id = #{passengerId,jdbcType=VARCHAR},
+			</if>
 		</set>
 	where id_=#{id}
 	</update>
 	<select id="get" parameterType="string" resultMap="OrderInfoMap">
-		select 
-id_,total_fee,body_,pay_status,pay_name,pay_fee,refund_fee,pay_time,out_order_no,transaction_id,open_id,payment_id,create_by,create_time,update_by,update_time,del_flag		from base_order_info where id_=#{0}
+		select * from base_order_info where id_=#{0}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_order_info where id_=#{0}

+ 8 - 4
common/src/main/resources/mapper/base/PaymentInfo.xml

@@ -1,10 +1,11 @@
 <?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.base.dao.PaymentInfoDAO">
 	<resultMap id="PaymentInfoMap" type="com.jpsoft.bus.modules.base.entity.PaymentInfo">
 		<id property="id" column="id_" />
+			<result property="companyId" column="company_id"/>
 			<result property="name" column="name_" />
 			<result property="wechatNotifyUrl" column="wechat_notify_url" />
 			<result property="alipayNotifyUrl" column="alipay_notify_url" />
@@ -28,10 +29,11 @@
 	-->
 	<![CDATA[
 		insert into base_payment_info
-	    (id_,name_,wechat_notify_url,alipay_notify_url,app_id,sub_app_secret,mch_id,sub_app_id,sub_mch_id,app_auth_token,create_by,create_time,update_by,update_time,del_flag)
+	    (id_,company_id,name_,wechat_notify_url,alipay_notify_url,app_id,sub_app_secret,mch_id,sub_app_id,sub_mch_id,app_auth_token,create_by,create_time,update_by,update_time,del_flag)
 		values
 		(
 #{id,jdbcType=VARCHAR}
+,#{companyId,jdbcType=VARCHAR}
 ,#{name,jdbcType=VARCHAR}
 ,#{wechatNotifyUrl,jdbcType=VARCHAR}
 ,#{alipayNotifyUrl,jdbcType=VARCHAR}
@@ -55,6 +57,9 @@
 	<update id="update" parameterType="com.jpsoft.bus.modules.base.entity.PaymentInfo">
 		update base_payment_info
 		<set>
+			<if test="companyId!=null">
+				company_id=#{companyId,jdbcType=VARCHAR},
+			</if>
 				<if test="name!=null">
 		name_=#{name,jdbcType=VARCHAR},
 		</if>
@@ -101,8 +106,7 @@
 	where id_=#{id}
 	</update>
 	<select id="get" parameterType="string" resultMap="PaymentInfoMap">
-		select 
-id_,name_,wechat_notify_url,alipay_notify_url,app_id,sub_app_secret,mch_id,sub_app_id,sub_mch_id,app_auth_token,create_by,create_time,update_by,update_time,del_flag		from base_payment_info where id_=#{0}
+		select  *	from base_payment_info where id_=#{0}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_payment_info where id_=#{0}

+ 131 - 0
common/src/main/resources/mapper/bus/PassengerInfo.xml

@@ -0,0 +1,131 @@
+<?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">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.bus.dao.PassengerInfoDAO">
+	<resultMap id="PassengerInfoMap" type="com.jpsoft.bus.modules.bus.entity.PassengerInfo">
+		<id property="id" column="id_" />
+			<result property="vehicleShiftId" column="vehicle_shift_id" />
+			<result property="vehiclePersonId" column="vehicle_person_id" />
+			<result property="userId" column="user_id" />
+			<result property="imageUrl" column="image_url" />
+			<result property="upTime" column="up_time" />
+			<result property="downTime" column="down_time" />
+			<result property="upStationId" column="up_station_id" />
+			<result property="downStationId" column="down_station_id" />
+			<result property="status" column="status_" />
+			<result property="payStatus" column="pay_status" />
+			<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.PassengerInfo">
+	<!--
+	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+		select sys_guid() from dual
+	</selectKey>
+	-->
+	<![CDATA[
+		insert into bus_passenger_info
+	    (id_,vehicle_shift_id,vehicle_person_id,user_id,image_url,up_time,down_time,up_station_id,down_station_id,status_,pay_status,create_by,create_time,update_by,update_time,del_flag)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{vehicleShiftId,jdbcType=VARCHAR}
+,#{vehiclePersonId,jdbcType= NUMERIC }
+,#{userId,jdbcType= NUMERIC }
+,#{imageUrl,jdbcType=VARCHAR}
+,#{upTime,jdbcType= TIMESTAMP }
+,#{downTime,jdbcType= TIMESTAMP }
+,#{upStationId,jdbcType=VARCHAR}
+,#{downStationId,jdbcType=VARCHAR}
+,#{status,jdbcType=VARCHAR}
+,#{payStatus,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_passenger_info where id_=#{id,jdbcType=VARCHAR}
+	</delete>
+	<update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.PassengerInfo">
+		update bus_passenger_info
+		<set>
+				<if test="vehicleShiftId!=null">
+		vehicle_shift_id=#{vehicleShiftId,jdbcType=VARCHAR},
+		</if>
+				<if test="vehiclePersonId!=null">
+		vehicle_person_id=#{vehiclePersonId,jdbcType= NUMERIC },
+		</if>
+				<if test="userId!=null">
+		user_id=#{userId,jdbcType= NUMERIC },
+		</if>
+				<if test="imageUrl!=null">
+		image_url=#{imageUrl,jdbcType=VARCHAR},
+		</if>
+				<if test="upTime!=null">
+		up_time=#{upTime,jdbcType= TIMESTAMP },
+		</if>
+				<if test="downTime!=null">
+		down_time=#{downTime,jdbcType= TIMESTAMP },
+		</if>
+				<if test="upStationId!=null">
+		up_station_id=#{upStationId,jdbcType=VARCHAR},
+		</if>
+				<if test="downStationId!=null">
+		down_station_id=#{downStationId,jdbcType=VARCHAR},
+		</if>
+				<if test="status!=null">
+		status_=#{status,jdbcType=VARCHAR},
+		</if>
+				<if test="payStatus!=null">
+		pay_status=#{payStatus,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="PassengerInfoMap">
+		select * from bus_passenger_info where id_=#{0}
+	</select>
+	<select id="exist" parameterType="string" resultType="int">
+		select count(*) from bus_passenger_info where id_=#{0}
+	</select>
+	<select id="list" resultMap="PassengerInfoMap">
+		select * from bus_passenger_info
+	</select>
+	<select id="search" parameterType="hashmap" resultMap="PassengerInfoMap">
+		<![CDATA[
+			select * from bus_passenger_info
+		]]>
+		<where>
+			del_flag = 0
+			<if test="searchParams.id != null">
+				and ID_ like #{searchParams.id}
+			</if>
+		</where>
+		<foreach item="sort" collection="sortList"  open="order by" separator=",">
+	        ${sort.name} ${sort.order}
+	 	</foreach>
+	</select>
+</mapper>

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

@@ -0,0 +1,121 @@
+<?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">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.bus.dao.ShiftInfoDAO">
+	<resultMap id="ShiftInfoMap" type="com.jpsoft.bus.modules.bus.entity.ShiftInfo">
+		<id property="id" column="id_" />
+			<result property="driverId" column="driver_id" />
+			<result property="vehicleId" column="vehicle_id" />
+			<result property="routeId" column="route_id" />
+			<result property="startStationId" column="start_station_id" />
+			<result property="currentStationId" column="current_station_id" />
+			<result property="status" column="status_" />
+			<result property="endStationId" column="end_station_id" />
+			<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" />
+			<result property="finishTime" column="finish_time" />
+			</resultMap>
+	<insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.ShiftInfo">
+	<!--
+	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+		select sys_guid() from dual
+	</selectKey>
+	-->
+	<![CDATA[
+		insert into bus_shift_info
+	    (id_,driver_id,vehicle_id,route_id,start_station_id,current_station_id,status_,end_station_id,create_by,create_time,update_by,update_time,del_flag,finish_time)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{driverId,jdbcType= NUMERIC }
+,#{vehicleId,jdbcType=VARCHAR}
+,#{routeId,jdbcType=VARCHAR}
+,#{startStationId,jdbcType=VARCHAR}
+,#{currentStationId,jdbcType=VARCHAR}
+,#{status,jdbcType=VARCHAR}
+,#{endStationId,jdbcType=VARCHAR}
+,#{createBy,jdbcType=VARCHAR}
+,#{createTime,jdbcType= TIMESTAMP }
+,#{updateBy,jdbcType=VARCHAR}
+,#{updateTime,jdbcType= TIMESTAMP }
+,#{delFlag,jdbcType= NUMERIC }
+,#{finishTime,jdbcType= TIMESTAMP }
+		)
+	]]>
+	</insert>
+	<delete id="delete" parameterType="string">
+		delete from bus_shift_info where id_=#{id,jdbcType=VARCHAR}
+	</delete>
+	<update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.ShiftInfo">
+		update bus_shift_info
+		<set>
+				<if test="driverId!=null">
+		driver_id=#{driverId,jdbcType= NUMERIC },
+		</if>
+				<if test="vehicleId!=null">
+		vehicle_id=#{vehicleId,jdbcType=VARCHAR},
+		</if>
+				<if test="routeId!=null">
+		route_id=#{routeId,jdbcType=VARCHAR},
+		</if>
+				<if test="startStationId!=null">
+		start_station_id=#{startStationId,jdbcType=VARCHAR},
+		</if>
+				<if test="currentStationId!=null">
+		current_station_id=#{currentStationId,jdbcType=VARCHAR},
+		</if>
+				<if test="status!=null">
+		status_=#{status,jdbcType=VARCHAR},
+		</if>
+				<if test="endStationId!=null">
+		end_station_id=#{endStationId,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>
+				<if test="finishTime!=null">
+		finish_time=#{finishTime,jdbcType= TIMESTAMP },
+		</if>
+		</set>
+	where id_=#{id}
+	</update>
+	<select id="get" parameterType="string" resultMap="ShiftInfoMap">
+		select * from bus_shift_info where id_=#{0}
+	</select>
+	<select id="exist" parameterType="string" resultType="int">
+		select count(*) from bus_shift_info where id_=#{0}
+	</select>
+	<select id="list" resultMap="ShiftInfoMap">
+		select * from bus_shift_info
+	</select>
+	<select id="search" parameterType="hashmap" resultMap="ShiftInfoMap">
+		<![CDATA[
+			select * from bus_shift_info
+		]]>
+		<where>
+			del_flag = 0
+			<if test="searchParams.id != null">
+				and ID_ like #{searchParams.id}
+			</if>
+		</where>
+		<foreach item="sort" collection="sortList"  open="order by" separator=",">
+	        ${sort.name} ${sort.order}
+	 	</foreach>
+	</select>
+</mapper>

+ 7 - 3
common/src/main/resources/mapper/bus/UserInfo.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.UserInfoDAO">
@@ -16,6 +16,7 @@
 			<result property="updateTime" column="update_time" />
 			<result property="delFlag" column="del_flag" />
 			<result property="remark" column="remark_" />
+			<result property="openId" column="open_id"/>
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.UserInfo">
 	<!--
@@ -25,10 +26,9 @@
 	-->
 	<![CDATA[
 		insert into bus_user_info
-	    (id_,name_,phone_,password_,face_image,accept_message,create_by,create_time,update_by,update_time,del_flag,remark_)
+	    (name_,phone_,password_,face_image,accept_message,create_by,create_time,update_by,update_time,del_flag,remark_,open_id)
 		values
 		(
-#{id,jdbcType=VARCHAR}
 ,#{name,jdbcType=VARCHAR}
 ,#{phone,jdbcType=VARCHAR}
 ,#{password,jdbcType=VARCHAR}
@@ -40,6 +40,7 @@
 ,#{updateTime,jdbcType= TIMESTAMP }
 ,#{delFlag,jdbcType= NUMERIC }
 ,#{remark,jdbcType=VARCHAR}
+,#{openId,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -82,6 +83,9 @@
 				<if test="remark!=null">
 		remark_=#{remark,jdbcType=VARCHAR},
 		</if>
+			<if test="openId !=null">
+				open_id=#{openId,jdbcType=VARCHAR},
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 229 - 0
web/src/main/java/com/jpsoft/bus/modules/bus/controller/PassengerInfoController.java

@@ -0,0 +1,229 @@
+package com.jpsoft.bus.modules.bus.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.MessageResult;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.bus.entity.PassengerInfo;
+import com.jpsoft.bus.modules.bus.service.PassengerInfoService;
+import com.jpsoft.bus.modules.common.utils.PojoUtils;
+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.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 乘客
+ */
+
+@RestController
+@RequestMapping("/bus/passengerInfo")
+@Api(description = "passengerInfo")
+public class PassengerInfoController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private PassengerInfoService passengerInfoService;
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<PassengerInfo> create(){
+        MessageResult<PassengerInfo> msgResult = new MessageResult<>();
+
+        PassengerInfo passengerInfo = new PassengerInfo();
+
+        msgResult.setData(passengerInfo);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+    
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<PassengerInfo> add(@RequestBody PassengerInfo passengerInfo,@RequestAttribute String subject){
+        MessageResult<PassengerInfo> msgResult = new MessageResult<>();
+
+        try {
+            passengerInfo.setId(UUID.randomUUID().toString());
+            passengerInfo.setDelFlag(false);
+            passengerInfo.setCreateBy(subject);
+            passengerInfo.setCreateTime(new Date());
+            
+            int affectCount = passengerInfoService.insert(passengerInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(passengerInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<PassengerInfo> edit(@PathVariable("id") String id){
+        MessageResult<PassengerInfo> msgResult = new MessageResult<>();
+
+        try {
+            PassengerInfo passengerInfo = passengerInfoService.get(id);
+
+            if (passengerInfo != null) {
+                msgResult.setResult(true);
+                msgResult.setData(passengerInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<PassengerInfo> update(@RequestBody PassengerInfo passengerInfo,@RequestAttribute String subject){
+        MessageResult<PassengerInfo> msgResult = new MessageResult<>();
+
+        try {
+            passengerInfo.setUpdateBy(subject);
+            passengerInfo.setUpdateTime(new Date());
+            
+            int affectCount = passengerInfoService.update(passengerInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(passengerInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+	@ApiOperation(value="删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            PassengerInfo passengerInfo = passengerInfoService.get(id);
+            passengerInfo.setDelFlag(true);
+            passengerInfo.setUpdateBy(subject);
+            passengerInfo.setUpdateTime(new Date());
+
+            int affectCount = passengerInfoService.update(passengerInfo);
+
+            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;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (String id : idList) {
+                PassengerInfo passengerInfo = passengerInfoService.get(id);
+                passengerInfo.setDelFlag(true);
+                passengerInfo.setUpdateBy(subject);
+                passengerInfo.setUpdateTime(new Date());
+
+                affectCount += passengerInfoService.update(passengerInfo);
+            }
+
+            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;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String id,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            @RequestAttribute String subject){
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+        Page<PassengerInfo> page = passengerInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 229 - 0
web/src/main/java/com/jpsoft/bus/modules/bus/controller/ShiftInfoController.java

@@ -0,0 +1,229 @@
+package com.jpsoft.bus.modules.bus.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.MessageResult;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.bus.entity.ShiftInfo;
+import com.jpsoft.bus.modules.bus.service.ShiftInfoService;
+import com.jpsoft.bus.modules.common.utils.PojoUtils;
+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.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 班次
+ */
+
+@RestController
+@RequestMapping("/bus/shiftInfo")
+@Api(description = "shiftInfo")
+public class ShiftInfoController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ShiftInfoService shiftInfoService;
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<ShiftInfo> create(){
+        MessageResult<ShiftInfo> msgResult = new MessageResult<>();
+
+        ShiftInfo shiftInfo = new ShiftInfo();
+
+        msgResult.setData(shiftInfo);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+    
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<ShiftInfo> add(@RequestBody ShiftInfo shiftInfo,@RequestAttribute String subject){
+        MessageResult<ShiftInfo> msgResult = new MessageResult<>();
+
+        try {
+            shiftInfo.setId(UUID.randomUUID().toString());
+            shiftInfo.setDelFlag(false);
+            shiftInfo.setCreateBy(subject);
+            shiftInfo.setCreateTime(new Date());
+            
+            int affectCount = shiftInfoService.insert(shiftInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(shiftInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<ShiftInfo> edit(@PathVariable("id") String id){
+        MessageResult<ShiftInfo> msgResult = new MessageResult<>();
+
+        try {
+            ShiftInfo shiftInfo = shiftInfoService.get(id);
+
+            if (shiftInfo != null) {
+                msgResult.setResult(true);
+                msgResult.setData(shiftInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<ShiftInfo> update(@RequestBody ShiftInfo shiftInfo,@RequestAttribute String subject){
+        MessageResult<ShiftInfo> msgResult = new MessageResult<>();
+
+        try {
+            shiftInfo.setUpdateBy(subject);
+            shiftInfo.setUpdateTime(new Date());
+            
+            int affectCount = shiftInfoService.update(shiftInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(shiftInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+	@ApiOperation(value="删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            ShiftInfo shiftInfo = shiftInfoService.get(id);
+            shiftInfo.setDelFlag(true);
+            shiftInfo.setUpdateBy(subject);
+            shiftInfo.setUpdateTime(new Date());
+
+            int affectCount = shiftInfoService.update(shiftInfo);
+
+            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;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (String id : idList) {
+                ShiftInfo shiftInfo = shiftInfoService.get(id);
+                shiftInfo.setDelFlag(true);
+                shiftInfo.setUpdateBy(subject);
+                shiftInfo.setUpdateTime(new Date());
+
+                affectCount += shiftInfoService.update(shiftInfo);
+            }
+
+            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;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String id,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            @RequestAttribute String subject){
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+        Page<ShiftInfo> page = shiftInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

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

@@ -42,18 +42,17 @@ public class UserInfoController {
 
         return msgResult;
     }
-    
+
     @ApiOperation(value="添加信息")
     @PostMapping("add")
     public MessageResult<UserInfo> add(@RequestBody UserInfo userInfo,@RequestAttribute String subject){
         MessageResult<UserInfo> msgResult = new MessageResult<>();
 
         try {
-            userInfo.setId(UUID.randomUUID().toString());
             userInfo.setDelFlag(false);
             userInfo.setCreateBy(subject);
             userInfo.setCreateTime(new Date());
-            
+
             int affectCount = userInfoService.insert(userInfo);
 
             if (affectCount > 0) {
@@ -108,7 +107,7 @@ public class UserInfoController {
         try {
             userInfo.setUpdateBy(subject);
             userInfo.setUpdateTime(new Date());
-            
+
             int affectCount = userInfoService.update(userInfo);
 
             if (affectCount > 0) {

+ 47 - 0
web/src/main/java/com/jpsoft/bus/modules/mobile/controller/PassengerApiController.java

@@ -0,0 +1,47 @@
+package com.jpsoft.bus.modules.mobile.controller;
+
+import com.jpsoft.bus.modules.common.dto.MessageResult;
+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.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 java.util.Map;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-3-26 8:57
+ */
+@RestController
+@RequestMapping("/mobile/passengerApi")
+@Api(value = "passengerApi")
+@Slf4j
+public class PassengerApiController {
+
+
+    @PostMapping
+    @ApiOperation(value = "通过车牌号查询详情")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "token", value = "令牌", required = false, paramType = "query"),
+            @ApiImplicitParam(name = "subject", value = "令牌", required = false, paramType = "query"),
+            @ApiImplicitParam(name = "carNum", value = "车牌号", required = true, paramType = "form")
+    })
+    public MessageResult<Map> findByCarNum(String token, @RequestAttribute String subject, String carNum){
+
+        MessageResult<Map> messageResult = new MessageResult<>();
+        try{
+
+        }catch (Exception ex){
+            log.error(ex.getMessage(),ex);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+
+    }
+}