| | |
| | | public String index() { |
| | | return PREFIX + "tLine.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到行程列表页 |
| | | */ |
| | | @RequestMapping("/travelListPage") |
| | | public String travelListPage() { |
| | | return PREFIX + "travelList.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到行程订单列表页 |
| | | */ |
| | | @RequestMapping("/travelOrdersPage") |
| | | public String travelOrdersPage(Integer lineShiftDriverId, Integer lineId, Integer driverId, Model model) { |
| | | model.addAttribute("lineShiftDriverId", lineShiftDriverId); |
| | | model.addAttribute("lineId", lineId); |
| | | model.addAttribute("driverId", driverId); |
| | | return PREFIX + "travelOrders.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加跨城站点管理 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取行程列表 |
| | | */ |
| | | @RequestMapping(value = "/travelList") |
| | | @ResponseBody |
| | | public Object travelList(String city, String lineName, String driverKeyword, Integer status) { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | Integer companyId = ShiroKit.getUser().getObjectId(); |
| | | page.setRecords(tLineService.getTravelList(page, city, lineName, driverKeyword, status, roleType, companyId)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 获取行程对应订单列表 |
| | | */ |
| | | @RequestMapping(value = "/travelOrders") |
| | | @ResponseBody |
| | | public Object travelOrders(Integer lineShiftDriverId, Integer lineId, Integer driverId) { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | Integer companyId = ShiroKit.getUser().getObjectId(); |
| | | page.setRecords(tLineService.getTravelOrders(page, lineShiftDriverId, lineId, driverId, roleType, companyId)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增跨城站点管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> getLineCompanyList(@Param("lineId") Integer lineId); |
| | | |
| | | /** |
| | | * 行程列表 |
| | | */ |
| | | List<Map<String,Object>> getTravelList(@Param("page") Page<Map<String, Object>> page, |
| | | @Param("city") String city, |
| | | @Param("lineName") String lineName, |
| | | @Param("driverKeyword") String driverKeyword, |
| | | @Param("status") Integer status, |
| | | @Param("roleType") Integer roleType, |
| | | @Param("companyId") Integer companyId); |
| | | |
| | | /** |
| | | * 行程对应订单列表 |
| | | */ |
| | | List<Map<String,Object>> getTravelOrders(@Param("page") Page<Map<String, Object>> page, |
| | | @Param("lineShiftDriverId") Integer lineShiftDriverId, |
| | | @Param("lineId") Integer lineId, |
| | | @Param("driverId") Integer driverId, |
| | | @Param("roleType") Integer roleType, |
| | | @Param("companyId") Integer companyId); |
| | | } |
| | |
| | | where lc.lineId = #{lineId} |
| | | </select> |
| | | |
| | | <!--行程列表--> |
| | | <select id="getTravelList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT |
| | | lsd.id as lineShiftDriverId, |
| | | CONCAT(DATE_FORMAT(lsd.`day`, '%Y-%m-%d'), ' ', ls.startTime, ' - ', ls.endTime) as shiftTime, |
| | | l.`name` as lineName, |
| | | IFNULL(s.city, '') as city, |
| | | CONCAT(d.`name`, '-', d.phone) as driver, |
| | | COUNT(oc.id) as orderNum, |
| | | '排班' as tripType, |
| | | case |
| | | when NOW() < STR_TO_DATE(CONCAT(DATE_FORMAT(lsd.`day`, '%Y-%m-%d'), ' ', ls.startTime, ':00'), '%Y-%m-%d %H:%i:%s') then 1 |
| | | when NOW() > STR_TO_DATE(CONCAT(DATE_FORMAT(lsd.`day`, '%Y-%m-%d'), ' ', ls.endTime, ':00'), '%Y-%m-%d %H:%i:%s') then 3 |
| | | else 2 |
| | | end as status, |
| | | lsd.driverId as driverId, |
| | | ls.lineId as lineId, |
| | | lsd.`day` as day |
| | | FROM t_line_shift_driver lsd |
| | | LEFT JOIN t_line_shift ls on ls.id = lsd.lineShiftId and ls.state != 3 |
| | | LEFT JOIN t_line l on l.id = ls.lineId and l.state != 3 |
| | | LEFT JOIN t_driver d on d.id = lsd.driverId and d.flag != 3 |
| | | LEFT JOIN t_line_site lsite on lsite.lineId = l.id and lsite.type = 1 |
| | | LEFT JOIN t_site s on s.id = lsite.siteId |
| | | LEFT JOIN t_order_cross_city oc on oc.lineShiftDriverId = lsd.id and oc.lineId = ls.lineId and oc.isDelete = 1 |
| | | <where> |
| | | l.id is not null |
| | | <if test="city != null and city != ''"> |
| | | and s.city LIKE CONCAT('%',#{city},'%') |
| | | </if> |
| | | <if test="lineName != null and lineName != ''"> |
| | | and l.name LIKE CONCAT('%',#{lineName},'%') |
| | | </if> |
| | | <if test="driverKeyword != null and driverKeyword != ''"> |
| | | and (d.name LIKE CONCAT('%',#{driverKeyword},'%') or d.phone LIKE CONCAT('%',#{driverKeyword},'%')) |
| | | </if> |
| | | <if test="roleType != null and roleType != '' and roleType != 1"> |
| | | and (l.id in (select lineId from t_line_company where companyId = #{companyId}) or l.companyId = #{companyId}) |
| | | </if> |
| | | </where> |
| | | GROUP BY lsd.id |
| | | <if test="status != null"> |
| | | HAVING status = #{status} |
| | | </if> |
| | | order by lsd.day desc, ls.startTime desc, lsd.id desc |
| | | </select> |
| | | |
| | | <!--行程对应订单列表--> |
| | | <select id="getTravelOrders" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT |
| | | o.id as id, |
| | | o.orderNum as orderNum, |
| | | o.travelId as travelId, |
| | | o.travelTime as travelTime, |
| | | o.passengers as passengers, |
| | | o.passengersPhone as passengersPhone, |
| | | o.startAddress as startAddress, |
| | | o.endAddress as endAddress, |
| | | o.orderMoney as orderMoney, |
| | | o.state as state, |
| | | CONCAT(d.`name`, '-', d.phone) as driver, |
| | | l.`name` as lineName |
| | | FROM t_order_cross_city o |
| | | LEFT JOIN t_driver d on d.id = o.driverId |
| | | LEFT JOIN t_line l on l.id = o.lineId |
| | | <where> |
| | | o.isDelete = 1 |
| | | <if test="lineShiftDriverId != null"> |
| | | and o.lineShiftDriverId = #{lineShiftDriverId} |
| | | </if> |
| | | <if test="lineId != null"> |
| | | and o.lineId = #{lineId} |
| | | </if> |
| | | <if test="driverId != null"> |
| | | and o.driverId = #{driverId} |
| | | </if> |
| | | <if test="roleType != null and roleType != '' and roleType == 2"> |
| | | and (o.companyId = #{companyId} or FIND_IN_SET(o.companyId,(SELECT GROUP_CONCAT(id) as ids FROM t_company where superiorId = #{companyId} GROUP BY superiorId))) |
| | | </if> |
| | | <if test="roleType != null and roleType != '' and roleType == 3"> |
| | | and o.companyId = #{companyId} |
| | | </if> |
| | | </where> |
| | | order by o.id desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> getLineCompanyList(@Param("lineId") Integer lineId); |
| | | |
| | | /** |
| | | * 行程列表 |
| | | */ |
| | | List<Map<String,Object>> getTravelList(@Param("page") Page<Map<String, Object>> page, |
| | | @Param("city") String city, |
| | | @Param("lineName") String lineName, |
| | | @Param("driverKeyword") String driverKeyword, |
| | | @Param("status") Integer status, |
| | | @Param("roleType") Integer roleType, |
| | | @Param("companyId") Integer companyId); |
| | | |
| | | /** |
| | | * 行程对应订单列表 |
| | | */ |
| | | List<Map<String,Object>> getTravelOrders(@Param("page") Page<Map<String, Object>> page, |
| | | @Param("lineShiftDriverId") Integer lineShiftDriverId, |
| | | @Param("lineId") Integer lineId, |
| | | @Param("driverId") Integer driverId, |
| | | @Param("roleType") Integer roleType, |
| | | @Param("companyId") Integer companyId); |
| | | } |
| | |
| | | public List<Map<String, Object>> getLineCompanyList(Integer lineId) { |
| | | return this.baseMapper.getLineCompanyList(lineId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getTravelList(Page<Map<String, Object>> page, String city, String lineName, |
| | | String driverKeyword, Integer status, Integer roleType, Integer companyId) { |
| | | return this.baseMapper.getTravelList(page, city, lineName, driverKeyword, status, roleType, companyId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getTravelOrders(Page<Map<String, Object>> page, Integer lineShiftDriverId, |
| | | Integer lineId, Integer driverId, Integer roleType, Integer companyId) { |
| | | return this.baseMapper.getTravelOrders(page, lineShiftDriverId, lineId, driverId, roleType, companyId); |
| | | } |
| | | } |
| New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>行程列表</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="city" name="所属城市" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="lineName" name="线路名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="driverKeyword" name="接单司机名称/手机号" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="status" name="状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">待出发</option> |
| | | <option value="2">进行中</option> |
| | | <option value="3">已完成</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TravelList.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TravelList.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TravelListTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tLine/travelOrders")){ |
| | | <#button name="查看订单" icon="fa-search" clickFun="TravelList.openTravelOrders()"/> |
| | | @} |
| | | </div> |
| | | <#table id="TravelListTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tLine/travelList.js"></script> |
| | | @} |
| New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>行程订单列表</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input type="hidden" id="lineShiftDriverId" value="${lineShiftDriverId!}"/> |
| | | <input type="hidden" id="lineId" value="${lineId!}"/> |
| | | <input type="hidden" id="driverId" value="${driverId!}"/> |
| | | <#table id="TravelOrdersTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tLine/travelOrders.js"></script> |
| | | @} |
| New file |
| | |
| | | /** |
| | | * 行程列表初始化 |
| | | */ |
| | | var TravelList = { |
| | | id: "TravelListTable", |
| | | seItem: null, |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | TravelList.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'lineShiftDriverId', field: 'lineShiftDriverId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: 'lineId', field: 'lineId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: 'driverId', field: 'driverId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '班次时间', field: 'shiftTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '线路名称', field: 'lineName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所属城市', field: 'city', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '接单司机', field: 'driver', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '订单数', field: 'orderNum', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '行程类型', field: 'tripType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value) { |
| | | if (value == 1) { |
| | | return "待出发"; |
| | | } else if (value == 2) { |
| | | return "进行中"; |
| | | } else if (value == 3) { |
| | | return "已完成"; |
| | | } |
| | | return ""; |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | TravelList.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | } else { |
| | | TravelList.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | TravelList.search = function () { |
| | | var queryData = {}; |
| | | queryData['city'] = $("#city").val(); |
| | | queryData['lineName'] = $("#lineName").val(); |
| | | queryData['driverKeyword'] = $("#driverKeyword").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | TravelList.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TravelList.resetSearch = function () { |
| | | $("#city").val(""); |
| | | $("#lineName").val(""); |
| | | $("#driverKeyword").val(""); |
| | | $("#status").val(""); |
| | | TravelList.search(); |
| | | }; |
| | | |
| | | TravelList.openTravelOrders = function () { |
| | | if (this.check()) { |
| | | if (!TravelList.seItem.orderNum || parseInt(TravelList.seItem.orderNum, 10) <= 0) { |
| | | Feng.info("订单不存在"); |
| | | return; |
| | | } |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '行程订单列表', |
| | | area: ['100%', '100%'], |
| | | fix: false, |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tLine/travelOrdersPage?lineShiftDriverId=' + TravelList.seItem.lineShiftDriverId + |
| | | '&lineId=' + TravelList.seItem.lineId + '&driverId=' + TravelList.seItem.driverId |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColumns = TravelList.initColumn(); |
| | | var table = new BSTable(TravelList.id, "/tLine/travelList", defaultColumns); |
| | | table.setPaginationType("server"); |
| | | TravelList.table = table.init(); |
| | | }); |
| New file |
| | |
| | | /** |
| | | * 行程订单列表初始化 |
| | | */ |
| | | var TravelOrders = { |
| | | id: "TravelOrdersTable", |
| | | table: null |
| | | }; |
| | | |
| | | TravelOrders.initColumn = function () { |
| | | return [ |
| | | {title: '主键id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '系统订单编号', field: 'orderNum', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '订单中心编号', field: 'travelId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '班次时间', field: 'travelTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '线路名称', field: 'lineName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '接单司机', field: 'driver', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '乘车用户姓名', field: 'passengers', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '乘车用户手机', field: 'passengersPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '起点', field: 'startAddress', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '终点', field: 'endAddress', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '订单金额', field: 'orderMoney', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value) { |
| | | return { |
| | | 1: "待接单", |
| | | 2: "待出发", |
| | | 3: "待到达预约地点", |
| | | 4: "待乘客上车", |
| | | 5: "服务中", |
| | | 6: "完成服务", |
| | | 7: "待支付", |
| | | 8: "待评价", |
| | | 9: "已完成", |
| | | 10: "已取消", |
| | | 11: "改派中", |
| | | 12: "取消待支付" |
| | | }[value] || ""; |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColumns = TravelOrders.initColumn(); |
| | | var table = new BSTable(TravelOrders.id, "/tLine/travelOrders", defaultColumns); |
| | | table.setPaginationType("server"); |
| | | table.setQueryParams({ |
| | | lineShiftDriverId: $("#lineShiftDriverId").val(), |
| | | lineId: $("#lineId").val(), |
| | | driverId: $("#driverId").val() |
| | | }); |
| | | TravelOrders.table = table.init(); |
| | | |
| | | $('#' + TravelOrders.id).on('load-success.bs.table', function (e, data) { |
| | | if (data && data.total == 0) { |
| | | Feng.info("暂无订单"); |
| | | } |
| | | }); |
| | | }); |