Переглянути джерело

Merge remote-tracking branch 'origin/master'

zhengqiang 4 роки тому
батько
коміт
b808f6b77c

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

@@ -29,6 +29,8 @@ public interface OrderInfoDAO {
 
     OrderInfo findByPassengerIdMergeOrderId(String passengerId, String mergeOrderId);
 
+	OrderInfo findByPassengerId(String passengerId);
+
     BigDecimal paySum(List<VehicleInfo> vehicleInfoList, String companyId,String payName, Date beginOfDay, Date endOfDay, Boolean settlementFlag);
 
     Integer payNum(List<VehicleInfo> vehicleInfoList,String companyId, String payName, Date beginOfDay, Date endOfDay, Boolean settlementFlag);

+ 12 - 0
common/src/main/java/com/jpsoft/bus/modules/base/entity/RegionInfo.java

@@ -40,4 +40,16 @@ public class RegionInfo {
     private Boolean delFlag = false;
     @ApiModelProperty(value = "全称")
     private String fullName;
+
+    @ApiModelProperty(value = "经度")
+    private Double longitude;
+    @ApiModelProperty(value = "纬度")
+    private Double latitude;
+    @ApiModelProperty(value = "半径(米)")
+    private Integer radius;
+    @ApiModelProperty(value = "排序")
+    private Integer sortNo;
+    @ApiModelProperty(value = "上级名称")
+    private String parentName;
+
 }

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

@@ -28,6 +28,8 @@ public interface OrderInfoService {
 
     OrderInfo findByPassengerIdMergeOrderId(String id, String mergeOrderId);
 
+	OrderInfo findByPassengerId(String passengerId);
+
 
 	/**
 	 * 订单在线退款

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

@@ -113,6 +113,11 @@ public class OrderInfoServiceImpl implements OrderInfoService {
 		return orderInfoDAO.findByPassengerIdMergeOrderId(id,mergeOrderId);
 	}
 
+	@Override
+	public OrderInfo findByPassengerId(String passengerId){
+		return orderInfoDAO.findByPassengerId(passengerId);
+	}
+
 	@Override
 	public Boolean refund(String orderId,String userId) throws Exception {
 

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dto/RouteInfoDTO.java

@@ -34,4 +34,6 @@ public class RouteInfoDTO {
     private String regionId;
     @ApiModelProperty(value = "地区翻译")
     private String regionName;
+    @ApiModelProperty(value = "间隔时间(分钟)")
+    private Integer interval;
 }

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dto/StationInfoDTO.java

@@ -44,4 +44,6 @@ public class StationInfoDTO {
 
     @ApiModelProperty(value = "是否删除")
     private Boolean delFlag;
+    @ApiModelProperty(value = "半径(米)")
+    private Integer radius;
 }

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

@@ -116,4 +116,7 @@ public class PassengerInfo {
         }
         return payStatusName;
     }
+
+    @ApiModelProperty(value = "购票方式")
+    private String payName;
 }

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/entity/RouteInfo.java

@@ -51,4 +51,6 @@ public class RouteInfo {
     private String regionId;
     @ApiModelProperty(value = "地区翻译")
     private String regionName;
+    @ApiModelProperty(value = "间隔时间(分钟)")
+    private Integer interval;
 }

+ 2 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/entity/StationInfo.java

@@ -44,4 +44,6 @@ public class StationInfo {
     private Date updateTime;
         @ApiModelProperty(value = "是否删除")
     private Boolean delFlag;
+    @ApiModelProperty(value = "半径(米)")
+    private Integer radius;
 }

+ 8 - 0
common/src/main/resources/mapper/base/OrderInfo.xml

@@ -273,6 +273,14 @@
 		]]>
 	</select>
 
+	<select id="findByPassengerId" resultMap="OrderInfoMap">
+		<![CDATA[
+		select * from base_order_info
+		where del_flag = 0
+		and passenger_id = #{passengerId} order by create_time asc limit 1
+		]]>
+	</select>
+
 	<select id="paySum" resultType="java.math.BigDecimal">
 		<![CDATA[
 		select SUM(a.pay_fee) from base_order_info a

+ 35 - 4
common/src/main/resources/mapper/base/RegionInfo.xml

@@ -14,6 +14,12 @@
         <result property="updateTime" column="update_time" />
         <result property="delFlag" column="del_flag" />
         <result property="fullName" column="full_name" />
+        <result property="longitude" column="longitude_" />
+        <result property="latitude" column="latitude_" />
+        <result property="radius" column="radius_" />
+        <result property="sortNo" column="sort_no" />
+        <result property="parentName" column="parent_name" />
+
     </resultMap>
     <insert id="insert" parameterType="com.jpsoft.bus.modules.base.entity.RegionInfo">
         <!--
@@ -23,7 +29,8 @@
         -->
         <![CDATA[
 		insert into base_region_info
-	    (id_,name_,parent_id,remark_,create_by,create_time,update_by,update_time,del_flag,full_name)
+	    (id_,name_,parent_id,remark_,create_by,create_time,update_by,update_time,del_flag,full_name,
+	    longitude_,latitude_,radius_,sort_no)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -36,6 +43,10 @@
 ,#{updateTime,jdbcType= TIMESTAMP }
 ,#{delFlag,jdbcType= NUMERIC }
 ,#{fullName,jdbcType=VARCHAR}
+,#{longitude,jdbcType=DOUBLE}
+,#{latitude,jdbcType=DOUBLE}
+,#{radius,jdbcType= NUMERIC }
+,#{sortNo,jdbcType= NUMERIC }
 		)
 	]]>
     </insert>
@@ -72,6 +83,18 @@
             <if test="fullName!=null">
                 full_name=#{fullName,jdbcType=VARCHAR},
             </if>
+            <if test="longitude!=null">
+                longitude_=#{longitude,jdbcType=DOUBLE},
+            </if>
+            <if test="latitude!=null">
+                latitude_=#{latitude,jdbcType=DOUBLE},
+            </if>
+            <if test="radius!=null">
+                radius_=#{radius,jdbcType= NUMERIC },
+            </if>
+            <if test="sortNo!=null">
+                sort_no=#{sortNo,jdbcType= NUMERIC },
+            </if>
         </set>
         where id_=#{id}
     </update>
@@ -86,12 +109,20 @@
 	</select>
     <select id="search" parameterType="hashmap" resultMap="RegionInfoMap">
         <![CDATA[
-			select * from base_region_info
+			SELECT
+                a.*,
+                b.name_ AS parent_name
+            FROM
+                base_region_info a
+                LEFT JOIN base_region_info b ON a.parent_id = b.id_
 		]]>
         <where>
-            and del_flag = 0
+            and a.del_flag = 0
             <if test="searchParams.id != null">
-                and ID_ like #{searchParams.id}
+                and a.ID_ like #{searchParams.id}
+            </if>
+            <if test="searchParams.name != null">
+                and a.name_ like #{searchParams.name}
             </if>
         </where>
         <foreach item="sort" collection="sortList"  open="order by" separator=",">

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

@@ -19,6 +19,7 @@
 			<result property="companyName" column="company_name" />
 			<result property="regionId" column="region_id"/>
 			<result property="regionName" column="region_name" />
+			<result property="interval" column="interval_" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.RouteInfo">
 	<!--
@@ -29,7 +30,7 @@
 	<![CDATA[
 		insert into bus_route_info
 	    (id_,name_,create_by,create_time,update_by,update_time,del_flag,map_path,company_id,goods_id,start_time,end_time,
-	    region_id)
+	    region_id,interval_)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -45,6 +46,7 @@
 ,#{startTime,jdbcType=VARCHAR}
 ,#{endTime,jdbcType=VARCHAR}
             ,#{regionId,jdbcType=VARCHAR}
+			,#{interval,jdbcType= NUMERIC }
 		)
 	]]>
 	</insert>
@@ -90,6 +92,9 @@
 			<if test="regionId!=null">
 				region_id=#{regionId,jdbcType= VARCHAR },
 			</if>
+			<if test="interval!=null">
+				interval_=#{interval,jdbcType= NUMERIC },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 2 - 1
common/src/main/resources/mapper/bus/ShiftInfo.xml

@@ -34,7 +34,8 @@
 	-->
 	<![CDATA[
 		insert into bus_shift_info
-	    (id_,driver_id,vehicle_id,route_id,start_station_id,current_station_id,current_station_status,status_,end_station_id,create_by,create_time,update_by,update_time,del_flag,finish_time)
+	    (id_,driver_id,vehicle_id,route_id,start_station_id,current_station_id,current_station_status,status_,end_station_id,create_by,create_time,update_by,update_time,del_flag,finish_time
+	    )
 		values
 		(
 #{id,jdbcType=VARCHAR}

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

@@ -16,6 +16,7 @@
 			<result property="updateBy" column="update_by" />
 			<result property="updateTime" column="update_time" />
 			<result property="delFlag" column="del_flag" />
+			<result property="radius" column="radius_" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.StationInfo">
 	<!--
@@ -25,7 +26,7 @@
 	-->
 	<![CDATA[
 		insert into bus_station_info
-	    (id_,sort_no,route_id,name_,longitude_,latitude_,classify_,create_by,create_time,update_by,update_time,del_flag)
+	    (id_,sort_no,route_id,name_,longitude_,latitude_,classify_,create_by,create_time,update_by,update_time,del_flag,radius_)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -40,6 +41,7 @@
 ,#{updateBy,jdbcType=VARCHAR}
 ,#{updateTime,jdbcType= TIMESTAMP }
 ,#{delFlag,jdbcType= NUMERIC }
+,#{radius,jdbcType= NUMERIC }
 		)
 	]]>
 	</insert>
@@ -82,6 +84,9 @@
 				<if test="delFlag!=null">
 		del_flag=#{delFlag,jdbcType= NUMERIC },
 		</if>
+			<if test="radius!=null">
+				radius_=#{radius,jdbcType= NUMERIC },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 5 - 9
web/src/main/java/com/jpsoft/bus/modules/base/controller/RegionInfoController.java

@@ -199,8 +199,7 @@ public class RegionInfoController {
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
             String id,
-            @RequestParam(value="sceneId",defaultValue="") String sceneId,
-            @RequestParam(value="useEnable",defaultValue="") String useEnable,
+            @RequestParam(value="name",defaultValue="") String name,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -213,18 +212,15 @@ public class RegionInfoController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("a.create_time","asc"));
+        sortList.add(new Sort("b.sort_no","asc"));
+        sortList.add(new Sort("a.sort_no","asc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
         }
 
-        if (StringUtils.isNotEmpty(sceneId)) {
-            searchParams.put("sceneId",sceneId);
-        }
-
-        if (StringUtils.isNotEmpty(useEnable)) {
-            searchParams.put("useEnable",useEnable);
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name","%" + name + "%");
         }
 
         Page<RegionInfo> page = regionInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);

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

@@ -1,6 +1,8 @@
 package com.jpsoft.bus.modules.bus.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.base.entity.OrderInfo;
+import com.jpsoft.bus.modules.base.service.OrderInfoService;
 import com.jpsoft.bus.modules.common.dto.MessageResult;
 import com.jpsoft.bus.modules.common.dto.Sort;
 import com.jpsoft.bus.modules.bus.entity.PassengerInfo;
@@ -31,6 +33,9 @@ public class PassengerInfoController {
     @Autowired
     private PassengerInfoService passengerInfoService;
 
+    @Autowired
+    private OrderInfoService orderInfoService;
+
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
     public MessageResult<PassengerInfo> create(){
@@ -236,6 +241,29 @@ public class PassengerInfoController {
 
         Page<PassengerInfo> page = passengerInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
+        for (PassengerInfo passengerInfo:page) {
+
+            OrderInfo orderInfo = orderInfoService.findByPassengerId(passengerInfo.getId());
+
+            if(orderInfo!=null){
+                if(("wechat").equals(orderInfo.getPayName())){
+                    passengerInfo.setPayName("微信");
+                }
+                else if(("alipay").equals(orderInfo.getPayName())){
+                    passengerInfo.setPayName("支付宝");
+                }
+                else if(("cash").equals(orderInfo.getPayName())){
+                    passengerInfo.setPayName("现金");
+                }
+                else if(("ticket").equals(orderInfo.getPayName())){
+                    passengerInfo.setPayName("车票");
+                }
+            }
+
+
+        }
+
+
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));
 

+ 3 - 0
web/src/main/java/com/jpsoft/bus/modules/bus/controller/RouteInfoController.java

@@ -180,6 +180,7 @@ public class RouteInfoController {
                     String classifyName = dataDictionaryService.findNameByCatalogNameAndValue("站点类型",stationInfo.getClassify().toString());
                     stationInfoDTO.setClassifyName(classifyName);
                     stationInfoDTO.setRouteId(stationInfo.getRouteId());
+                    stationInfoDTO.setRadius(stationInfo.getRadius());
                     stationInfoDTO.setSortNo(stationInfo.getSortNo());
                     stationInfoDTO.setDelFlag(stationInfo.getDelFlag());
 
@@ -234,6 +235,7 @@ public class RouteInfoController {
             routeInfo.setStartTime(dto.getStartTime());
             routeInfo.setEndTime(dto.getEndTime());
             routeInfo.setRegionId(dto.getRegionId());
+            routeInfo.setInterval(dto.getInterval());
             routeInfo.setUpdateBy(subject);
             routeInfo.setUpdateTime(new Date());
 
@@ -263,6 +265,7 @@ public class RouteInfoController {
                                 }
                             }
 
+                            stationInfo.setRadius(stationInfoDTO.getRadius());
                             stationInfo.setSortNo(stationInfoDTO.getSortNo());
                             stationInfo.setUpdateBy(subject);
                             stationInfo.setUpdateTime(new Date());