Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/QianYunTong into dev
| New file |
| | |
| | | package com.stylefeng.guns.modular.crossCity.controller; |
| | | |
| | | import com.stylefeng.guns.modular.crossCity.server.ILineShiftDriverService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.DriverShiftListWarpper; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 【202601】城际专线排班控制器 |
| | | */ |
| | | @Api |
| | | @RestController |
| | | @RequestMapping("/api/crossCity") |
| | | public class CrossCityShiftController { |
| | | |
| | | @Autowired |
| | | private ILineShiftDriverService lineShiftDriverService; |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | /** |
| | | * 【202601】获取司机城际专线排班列表 |
| | | * @param date 日期(yyyy-MM-dd),默认当天 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryDriverShiftList") |
| | | @ApiOperation(value = "【202601】获取司机城际专线排班列表", tags = {"司机端-首页"}, notes = "获取司机在指定日期的城际专线排班信息,支持7天日期选择") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "日期(yyyy-MM-dd),默认当天", name = "date", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<DriverShiftListWarpper> queryDriverShiftList(String date, HttpServletRequest request) { |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if (null == driverId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | DriverShiftListWarpper result = lineShiftDriverService.queryDriverShiftList(driverId, date); |
| | | return ResultUtil.success(result); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.service.ITEnterpriseWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.crossCity.model.LineShiftDriver; |
| | | import com.stylefeng.guns.modular.crossCity.server.ILineShiftDriverService; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityInfoWrapper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityOnBehalfWarpper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderWarpper; |
| | | import com.stylefeng.guns.modular.system.model.Reassign; |
| | |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.SystemException; |
| | | import com.stylefeng.guns.modular.system.util.WeChatUtil; |
| | | import com.stylefeng.guns.modular.system.util.OssUploadUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.util.Map; |
| | | |
| | | |
| | |
| | | private ICompanyService companyService; |
| | | @Autowired |
| | | private ITEnterpriseWithdrawalService enterpriseWithdrawalService; |
| | | |
| | | @Autowired |
| | | private WeChatUtil weChatUtil; |
| | | |
| | | @Autowired |
| | | private ILineShiftDriverService lineShiftDriverService; |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String env; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成跨城扫码下单小程序码 |
| | | * @param lineShiftDriverId 司机排班记录ID(班次ID) |
| | | * @param otherFee 其他费用金额(可选) |
| | | * @param request HttpServletRequest |
| | | * @return 小程序码图片URL |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/orderCrossCity/generateScanOrderQrCode") |
| | | @ApiOperation(value = "【202601】生成跨城扫码下单小程序码", tags = {"司机端-服务中"}, notes = "司机展示小程序码给客户扫码下单") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "司机排班记录ID(班次ID)", name = "lineShiftDriverId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "其他费用金额", name = "otherFee", required = false, dataType = "BigDecimal"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<BaseWarpper> generateScanOrderQrCode(Integer lineShiftDriverId, BigDecimal otherFee, HttpServletRequest request) { |
| | | try { |
| | | // 1. 验证Token获取司机ID |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if (null == driverId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | |
| | | // 2. 校验班次有效性 |
| | | LineShiftDriver lineShiftDriver = lineShiftDriverService.selectById(lineShiftDriverId); |
| | | if (null == lineShiftDriver) { |
| | | return ResultUtil.error("班次信息不存在"); |
| | | } |
| | | if (!driverId.equals(lineShiftDriver.getDriverId())) { |
| | | return ResultUtil.error("无权操作此班次"); |
| | | } |
| | | |
| | | // 3. 构建scene参数(最大32字符) |
| | | StringBuilder sceneBuilder = new StringBuilder(); |
| | | sceneBuilder.append("id=").append(lineShiftDriverId); |
| | | if (ToolUtil.isNotEmpty(otherFee)) { |
| | | sceneBuilder.append("&f=").append(otherFee); |
| | | } |
| | | String scene = sceneBuilder.toString(); |
| | | |
| | | // 4. 生成小程序码 |
| | | String page = "pages/scanOrder/scanOrder"; // 小程序跳转页面 |
| | | String envVersion = env.equals("prod") ? "release" : "trial"; // 正式版环境 |
| | | InputStream inputStream = weChatUtil.getwxacodeunlimit(page, scene, envVersion); |
| | | |
| | | if (null == inputStream) { |
| | | return ResultUtil.error("生成小程序码失败"); |
| | | } |
| | | |
| | | // 5. 上传到OSS |
| | | String qrCodeUrl = OssUploadUtil.ossUploadByStream(driverId, inputStream); |
| | | if (ToolUtil.isEmpty(qrCodeUrl)) { |
| | | return ResultUtil.error("上传小程序码失败"); |
| | | } |
| | | |
| | | // 6. 返回结果 |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setContent(qrCodeUrl); |
| | | return ResultUtil.success(baseWarpper); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跨城代客下单 |
| | | * @param warpper 代客下单参数 |
| | | * @param request HttpServletRequest |
| | | * @return 订单ID |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/orderCrossCity/orderOnBehalf") |
| | | @ApiOperation(value = "【202601】跨城代客下单", tags = {"司机端-服务中"}, notes = "司机代乘客下单,乘客通过手机号登录小程序支付") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<BaseWarpper> orderCrossCityOnBehalf(OrderCrossCityOnBehalfWarpper warpper, HttpServletRequest request) { |
| | | try { |
| | | // 1. 验证Token获取司机ID |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if (null == driverId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | |
| | | // 2. 调用Service执行代客下单 |
| | | return orderCrossCityService.orderCrossCityOnBehalf(warpper, driverId); |
| | | |
| | | } catch (SystemException se) { |
| | | return ResultUtil.error(se.getMessage()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface LineShiftDriverMapper extends BaseMapper<LineShiftDriver> { |
| | | |
| | |
| | | */ |
| | | List<LineShiftDriver> queryByDriver(@Param("lineShiftId") Integer lineShiftId, @Param("driverId") Integer driverId, |
| | | @Param("time") Date time); |
| | | |
| | | /** |
| | | * 【202601】查询司机在指定日期的排班信息 |
| | | * @param driverId 司机id |
| | | * @param date 日期(yyyy-MM-dd) |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryDriverShiftByDate(@Param("driverId") Integer driverId, @Param("date") String date); |
| | | } |
| | |
| | | </if> |
| | | order by `day` |
| | | </select> |
| | | |
| | | <!-- 【202601】查询司机在指定日期的排班信息 --> |
| | | <select id="queryDriverShiftByDate" resultType="java.util.Map"> |
| | | SELECT |
| | | lsd.id as lineShiftDriverId, |
| | | lsd.lineShiftId as lineShiftId, |
| | | lsd.laveSeat as laveSeat, |
| | | lsd.totalSeat as totalSeat, |
| | | ls.startTime as startTime, |
| | | ls.endTime as endTime, |
| | | l.id as lineId, |
| | | l.name as lineName |
| | | FROM t_line_shift_driver lsd |
| | | LEFT JOIN t_line_shift ls ON lsd.lineShiftId = ls.id |
| | | LEFT JOIN t_line l ON ls.lineId = l.id |
| | | WHERE lsd.driverId = #{driverId} |
| | | AND DATE_FORMAT(lsd.`day`, '%Y-%m-%d') = #{date} |
| | | AND ls.state = 1 |
| | | AND l.state = 1 |
| | | ORDER BY l.id, ls.startTime |
| | | </select> |
| | | </mapper> |
| | |
| | | a.id as orderId, |
| | | a.state as orderState, |
| | | ('跨城出行订单') as orderName, |
| | | CONCAT(DATE_FORMAT(a.travelTime, '%m月%d日'), ' ', c.startTime) as travelTime, |
| | | DATE_FORMAT(a.insertTime, '%m月%d日 %H:%i') as travelTime, |
| | | a.startAddress as startAddress, |
| | | a.endAddress as endAddress, |
| | | a.startLon as startLon, |
| | |
| | | a.id as id, |
| | | (3) as type, |
| | | ('跨城出行订单') as `name`, |
| | | CONCAT(DATE_FORMAT(a.travelTime, '%Y-%m-%d'), ' ', c.startTime) as time, |
| | | DATE_FORMAT(a.insertTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | a.startAddress as startAddress, |
| | | a.endAddress as endAddress, |
| | | a.state as state, |
| | |
| | | a.id as id, |
| | | (3) as type, |
| | | ('跨城出行订单') as `name`, |
| | | CONCAT(DATE_FORMAT(a.travelTime, '%Y-%m-%d'), ' ', c.startTime) as time, |
| | | DATE_FORMAT(a.insertTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | a.startAddress as startAddress, |
| | | a.endAddress as endAddress, |
| | | a.state as state, |
| | |
| | | a.id as id, |
| | | (3) as type, |
| | | ('跨城出行订单') as `name`, |
| | | CONCAT(DATE_FORMAT(a.travelTime, '%Y-%m-%d'), ' ', c.startTime) as time, |
| | | DATE_FORMAT(a.insertTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | a.startAddress as startAddress, |
| | | a.endAddress as endAddress, |
| | | a.state as state, |
| | |
| | | a.id as id, |
| | | (3) as type, |
| | | ('跨城出行订单') as `name`, |
| | | CONCAT(DATE_FORMAT(a.travelTime, '%Y-%m-%d'), ' ', c.startTime) as time, |
| | | DATE_FORMAT(a.insertTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | a.startAddress as startAddress, |
| | | a.endAddress as endAddress, |
| | | a.state as state, |
| | |
| | | a.userId as userId, |
| | | a.driverId as driverId, |
| | | a.state as orderState, |
| | | CONCAT(DATE_FORMAT(a.travelTime, '%m月%d日'), ' ', d.startTime) as travelTime_, |
| | | CONCAT(DATE_FORMAT(a.travelTime, '%Y-%m-%d'), ' ', d.startTime) as travelTime, |
| | | DATE_FORMAT(a.insertTime, '%m月%d日 %H:%i') as travelTime_, |
| | | DATE_FORMAT(a.insertTime, '%Y-%m-%d %H:%i:%s') as travelTime, |
| | | DATE_FORMAT(a.arriveTime, '%Y-%m-%d %H:%i:%s') as arriveTime, |
| | | a.startAddress as startAddress, |
| | | a.endAddress as endAddress, |
| | |
| | | a.driverId as driverId, |
| | | a.state as orderState, |
| | | a.travelTime as travelTime, |
| | | CONCAT(DATE_FORMAT(a.travelTime, '%m月%d日'), ' ', d.startTime) as travelTime_, |
| | | DATE_FORMAT(a.insertTime, '%m月%d日 %H:%i') as travelTime_, |
| | | CONCAT(DATE_FORMAT(a.arriveTime, '%Y-%m-%d'), ' ', d.startTime) as arriveTime, |
| | | a.startAddress as startAddress, |
| | | a.endAddress as endAddress, |
| | |
| | | |
| | | private Date recoveryOrderCreateDate; |
| | | |
| | | private BigDecimal otherFee; |
| | | |
| | | public BigDecimal getOtherFee() { |
| | | return otherFee; |
| | | } |
| | | |
| | | public void setOtherFee(BigDecimal otherFee) { |
| | | this.otherFee = otherFee; |
| | | } |
| | | |
| | | public Integer getResponsibilityType() { |
| | | return responsibilityType; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.crossCity.model.LineShiftDriver; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.DriverShiftListWarpper; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | |
| | | public interface ILineShiftDriverService extends IService<LineShiftDriver> { |
| | |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil reservation(Integer type, Integer lineShiftId, String time, Integer driverId) throws Exception; |
| | | |
| | | /** |
| | | * 【202601】查询司机排班列表 |
| | | * @param driverId 司机id |
| | | * @param date 日期(yyyy-MM-dd),为空则默认当天 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | DriverShiftListWarpper queryDriverShiftList(Integer driverId, String date) throws Exception; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityOnBehalfWarpper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | |
| | | |
| | | |
| | | ResultUtil cancleOrder(Integer orderId) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 跨城代客下单操作 |
| | | * @param warpper 代客下单参数 |
| | | * @param driverId 司机ID |
| | | * @return 订单ID |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil<BaseWarpper> orderCrossCityOnBehalf(OrderCrossCityOnBehalfWarpper warpper, Integer driverId) throws Exception; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LinePriceMapper; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LineShiftDriverMapper; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LineShiftMapper; |
| | |
| | | import com.stylefeng.guns.modular.crossCity.server.ILineShiftDriverService; |
| | | import com.stylefeng.guns.modular.crossCity.server.ILineSiteService; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.DriverShiftListWarpper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.LineShiftItemWarpper; |
| | | import com.stylefeng.guns.modular.system.dao.CarModelMapper; |
| | | import com.stylefeng.guns.modular.system.dao.CarServiceMapper; |
| | | import com.stylefeng.guns.modular.system.dao.ServerCarModelMapper; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 【202601】查询司机排班列表 |
| | | * @param driverId 司机id |
| | | * @param date 日期(yyyy-MM-dd),为空则默认当天 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public DriverShiftListWarpper queryDriverShiftList(Integer driverId, String date) throws Exception { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | // 如果日期为空,默认当天 |
| | | if (ToolUtil.isEmpty(date)) { |
| | | date = sdf.format(new Date()); |
| | | } |
| | | |
| | | DriverShiftListWarpper result = new DriverShiftListWarpper(); |
| | | |
| | | // 查询司机在指定日期的排班信息 |
| | | List<Map<String, Object>> shiftList = lineShiftDriverMapper.queryDriverShiftByDate(driverId, date); |
| | | |
| | | // 按线路分组 |
| | | Map<Integer, List<Map<String, Object>>> lineGroupMap = new LinkedHashMap<>(); |
| | | Map<Integer, String> lineNameMap = new HashMap<>(); |
| | | |
| | | for (Map<String, Object> shift : shiftList) { |
| | | Integer lineId = Integer.valueOf(shift.get("lineId").toString()); |
| | | String lineName = shift.get("lineName").toString(); |
| | | lineNameMap.put(lineId, lineName); |
| | | |
| | | if (!lineGroupMap.containsKey(lineId)) { |
| | | lineGroupMap.put(lineId, new ArrayList<>()); |
| | | } |
| | | lineGroupMap.get(lineId).add(shift); |
| | | } |
| | | |
| | | // 构建线路列表 |
| | | List<DriverShiftListWarpper.LineItemWarpper> lineList = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm"); |
| | | String currentTime = timeFormat.format(now); |
| | | String today = sdf.format(now); |
| | | |
| | | for (Map.Entry<Integer, List<Map<String, Object>>> entry : lineGroupMap.entrySet()) { |
| | | DriverShiftListWarpper.LineItemWarpper lineItem = new DriverShiftListWarpper.LineItemWarpper(); |
| | | lineItem.setLineId(entry.getKey()); |
| | | lineItem.setLineName(lineNameMap.get(entry.getKey())); |
| | | |
| | | List<LineShiftItemWarpper> shifts = new ArrayList<>(); |
| | | for (Map<String, Object> shiftMap : entry.getValue()) { |
| | | LineShiftItemWarpper shiftItem = new LineShiftItemWarpper(); |
| | | shiftItem.setLineShiftId(Integer.valueOf(shiftMap.get("lineShiftId").toString())); |
| | | shiftItem.setLineShiftDriverId(Integer.valueOf(shiftMap.get("lineShiftDriverId").toString())); |
| | | shiftItem.setStartTime(shiftMap.get("startTime").toString()); |
| | | shiftItem.setEndTime(shiftMap.get("endTime").toString()); |
| | | shiftItem.setLaveSeat(Integer.valueOf(shiftMap.get("laveSeat").toString())); |
| | | shiftItem.setTotalSeat(Integer.valueOf(shiftMap.get("totalSeat").toString())); |
| | | |
| | | // 判断状态:已预约的班次,判断是否过期 |
| | | String endTime = shiftMap.get("endTime").toString(); |
| | | boolean isExpired = false; |
| | | |
| | | // 如果是今天,比较时间;如果是过去的日期,则已过期 |
| | | if (date.equals(today)) { |
| | | // 比较当前时间和班次结束时间 |
| | | isExpired = currentTime.compareTo(endTime) >= 0; |
| | | } else if (date.compareTo(today) < 0) { |
| | | // 过去的日期 |
| | | isExpired = true; |
| | | } |
| | | |
| | | if (isExpired) { |
| | | // 已过期 |
| | | shiftItem.setStatus(2); |
| | | shiftItem.setStatusText("已过期"); |
| | | shiftItem.setCanOperate(false); |
| | | } else { |
| | | // 已预约可操作 |
| | | shiftItem.setStatus(1); |
| | | shiftItem.setStatusText("预约"); |
| | | shiftItem.setCanOperate(true); |
| | | } |
| | | |
| | | shifts.add(shiftItem); |
| | | } |
| | | lineItem.setShifts(shifts); |
| | | lineList.add(lineItem); |
| | | } |
| | | |
| | | result.setLineList(lineList); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper; |
| | | import com.stylefeng.guns.modular.crossCity.model.Line; |
| | | import com.stylefeng.guns.modular.crossCity.model.LineShiftDriver; |
| | | import com.stylefeng.guns.modular.crossCity.model.LineSite; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.ILineService; |
| | | import com.stylefeng.guns.modular.crossCity.server.ILineSiteService; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityOnBehalfWarpper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper; |
| | | import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | |
| | | |
| | | @Autowired |
| | | private ILineService lineService; |
| | | |
| | | @Autowired |
| | | private ILineSiteService lineSiteService; |
| | | |
| | | @Autowired |
| | | private ISystemNoticeService systemNoticeService; |
| | |
| | | private CarServiceImpl carServiceImpl; |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | |
| | | @Autowired |
| | | private CarServiceMapper carServiceMapper; |
| | | @Autowired |
| | | private WeChatUtil weChatUtil; |
| | | |
| | |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跨城代客下单操作 |
| | | * @param warpper 代客下单参数 |
| | | * @param driverId 司机ID |
| | | * @return 订单ID |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public synchronized ResultUtil<BaseWarpper> orderCrossCityOnBehalf(OrderCrossCityOnBehalfWarpper warpper, Integer driverId) throws Exception { |
| | | // 1. 参数校验 |
| | | if (warpper.getLineShiftDriverId() == null) { |
| | | return ResultUtil.error("班次ID不能为空"); |
| | | } |
| | | if (warpper.getPeopleNumber() == null || warpper.getPeopleNumber() < 1 || warpper.getPeopleNumber() > 7) { |
| | | return ResultUtil.error("乘车人数必须在1-7之间"); |
| | | } |
| | | if (ToolUtil.isEmpty(warpper.getPassengersPhone())) { |
| | | return ResultUtil.error("乘客手机号不能为空"); |
| | | } |
| | | if (warpper.getStartLon() == null || warpper.getStartLat() == null || ToolUtil.isEmpty(warpper.getStartAddress())) { |
| | | return ResultUtil.error("上车点信息不完整"); |
| | | } |
| | | if (warpper.getEndLon() == null || warpper.getEndLat() == null || ToolUtil.isEmpty(warpper.getEndAddress())) { |
| | | return ResultUtil.error("下车点信息不完整"); |
| | | } |
| | | if (warpper.getOtherFee() != null && warpper.getOtherFee().compareTo(BigDecimal.ZERO) < 0) { |
| | | return ResultUtil.error("其他费用不能为负数"); |
| | | } |
| | | |
| | | // 2. 校验班次信息 |
| | | LineShiftDriver lineShiftDriver = lineShiftDriverMapper.selectById(warpper.getLineShiftDriverId()); |
| | | if (lineShiftDriver == null) { |
| | | return ResultUtil.error("班次信息不存在"); |
| | | } |
| | | if (!driverId.equals(lineShiftDriver.getDriverId())) { |
| | | return ResultUtil.error("无权操作此班次"); |
| | | } |
| | | |
| | | // 3. 校验剩余座位数 |
| | | if (lineShiftDriver.getLaveSeat() < warpper.getPeopleNumber()) { |
| | | return ResultUtil.error("座位不足,无法下单"); |
| | | } |
| | | |
| | | // 4. 自动分配座位号 |
| | | String laveSeatNumber = lineShiftDriver.getLaveSeatNumber(); |
| | | if (ToolUtil.isEmpty(laveSeatNumber)) { |
| | | return ResultUtil.error("无可用座位"); |
| | | } |
| | | String[] availableSeats = laveSeatNumber.split(","); |
| | | if (availableSeats.length < warpper.getPeopleNumber()) { |
| | | return ResultUtil.error("座位不足,无法下单"); |
| | | } |
| | | // 取前 peopleNumber 个座位 |
| | | StringBuilder seatNumberBuilder = new StringBuilder(); |
| | | for (int i = 0; i < warpper.getPeopleNumber(); i++) { |
| | | if (i > 0) { |
| | | seatNumberBuilder.append(","); |
| | | } |
| | | seatNumberBuilder.append(availableSeats[i]); |
| | | } |
| | | String seatNumber = seatNumberBuilder.toString(); |
| | | |
| | | // 5. 获取司机信息 |
| | | Driver driver = driverService.selectById(driverId); |
| | | if (driver == null) { |
| | | return ResultUtil.error("司机信息不存在"); |
| | | } |
| | | if (driver.getState() == 1) { |
| | | return ResultUtil.error("司机处于离线状态"); |
| | | } |
| | | |
| | | // 6. 获取线路班次信息 |
| | | LineSite lineSite = lineSiteService.selectById(lineShiftDriver.getLineShiftId()); |
| | | if (lineSite == null) { |
| | | return ResultUtil.error("线路班次信息不存在"); |
| | | } |
| | | Line line = lineService.selectById(lineSite.getLineId()); |
| | | if (line == null) { |
| | | return ResultUtil.error("线路信息不存在"); |
| | | } |
| | | |
| | | // 7. 处理用户信息 |
| | | UserInfo userInfo = userInfoMapper.queryByPhone(warpper.getPassengersPhone()); |
| | | if (userInfo == null) { |
| | | // 自动创建用户 |
| | | userInfo = new UserInfo(); |
| | | Integer integer = userInfoMapper.selectCount(null) + 1000001; |
| | | userInfo.setNickName("GRJY" + String.valueOf(integer).substring(1)); |
| | | userInfo.setPhone(warpper.getPassengersPhone()); |
| | | userInfo.setState(1); |
| | | userInfo.setFlag(1); |
| | | userInfo.setInsertTime(new Date()); |
| | | userInfo.setInsertUser(driverId); |
| | | userInfoMapper.insert(userInfo); |
| | | } |
| | | |
| | | // 8. 检查用户是否有未完成订单 |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(userInfo.getId(), 1, 1, 1, 2, 3, 4, 5, 6, 7, 11, 12); |
| | | if (orderPrivateCars.size() > 0) { |
| | | return ResultUtil.error("该乘客有未完成的订单"); |
| | | } |
| | | List<OrderTaxi> orderTaxis = orderTaxiMapper.queryByState_(userInfo.getId(), 1, 1, 1, 2, 3, 4, 5, 6, 7, 11, 12); |
| | | if (orderTaxis.size() > 0) { |
| | | return ResultUtil.error("该乘客有未完成的订单"); |
| | | } |
| | | List<OrderCrossCity> orderCrossCities1 = orderCrossCityMapper.queryByState(userInfo.getId(), 1, 2, 3, 4, 5, 6, 7, 11, 12); |
| | | if (orderCrossCities1.size() > 0) { |
| | | return ResultUtil.error("该乘客有未完成的订单"); |
| | | } |
| | | |
| | | // 9. 检查司机是否正在服务中 |
| | | List<OrderCrossCity> orderCrossCities2 = orderCrossCityMapper.queryOrders(driverId, warpper.getLineShiftDriverId(), Arrays.asList(5)); |
| | | if (orderCrossCities2.size() > 0) { |
| | | return ResultUtil.error("司机正在服务中"); |
| | | } |
| | | |
| | | // 10. 计算价格 |
| | | Map<String, String> distanceMap = gdMapElectricFenceUtil.getDistance( |
| | | warpper.getStartLon() + "," + warpper.getStartLat(), |
| | | warpper.getEndLon() + "," + warpper.getEndLat(), 1); |
| | | if (distanceMap == null) { |
| | | return ResultUtil.error("计算行程距离出错"); |
| | | } |
| | | Double distance = Double.valueOf(distanceMap.get("distance")); |
| | | |
| | | // 获取车辆信息 |
| | | Car car = carServiceImpl.selectById(driver.getCarId()); |
| | | if (car == null) { |
| | | return ResultUtil.error("车辆信息不存在"); |
| | | } |
| | | CarModel carModel = carModelMapper.selectById(car.getCarModelId()); |
| | | if (carModel == null) { |
| | | return ResultUtil.error("车型信息不存在"); |
| | | } |
| | | CarService carService = carServiceMapper.query(3, driver.getCarId()); |
| | | if(null == carService){ |
| | | return ResultUtil.error("车辆未开通该服务"); |
| | | } |
| | | ResultUtil<Map<String, Object>> priceResult = this.getPrice(distance, warpper.getPeopleNumber(), 1, |
| | | lineSite.getLineId(), carService.getServerCarModelId(), lineShiftDriver.getTotalSeat(), seatNumber); |
| | | if (priceResult.getCode() != 200) { |
| | | return ResultUtil.error("计算价格失败"); |
| | | } |
| | | Double ticketPrice = Double.valueOf(priceResult.getData().get("price").toString()); |
| | | |
| | | // 计算合计费用 |
| | | Double otherFee = warpper.getOtherFee() != null ? warpper.getOtherFee().setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() : 0D; |
| | | Double totalMoney = new BigDecimal(ticketPrice).add(new BigDecimal(otherFee)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | |
| | | // 11. 创建订单 |
| | | OrderCrossCity orderCrossCity = new OrderCrossCity(); |
| | | orderCrossCity.setUserId(userInfo.getId()); |
| | | orderCrossCity.setPassengers(userInfo.getName()); |
| | | orderCrossCity.setPassengersPhone(warpper.getPassengersPhone()); |
| | | orderCrossCity.setServerCarModelId(carService.getServerCarModelId()); |
| | | orderCrossCity.setDriverId(driverId); |
| | | orderCrossCity.setLineId(lineSite.getLineId()); |
| | | orderCrossCity.setCarId(driver.getCarId()); |
| | | orderCrossCity.setOrderNum(this.getOrderNum(driverId, warpper.getLineShiftDriverId())); |
| | | |
| | | // 下单地点 |
| | | orderCrossCity.setPlacementLat(warpper.getPlacementLat()); |
| | | orderCrossCity.setPlacementLon(warpper.getPlacementLon()); |
| | | String placementAddress = warpper.getStartAddress(); |
| | | placementAddress = placementAddress.replaceAll("& #40;", "("); |
| | | placementAddress = placementAddress.replaceAll("& #41;", ")"); |
| | | orderCrossCity.setPlacementAddress(placementAddress); |
| | | |
| | | // 上车点 |
| | | orderCrossCity.setStartLon(warpper.getStartLon()); |
| | | orderCrossCity.setStartLat(warpper.getStartLat()); |
| | | String startAddress = warpper.getStartAddress(); |
| | | startAddress = startAddress.replaceAll("& #40;", "("); |
| | | startAddress = startAddress.replaceAll("& #41;", ")"); |
| | | orderCrossCity.setStartAddress(startAddress); |
| | | |
| | | // 下车点 |
| | | orderCrossCity.setEndLon(warpper.getEndLon()); |
| | | orderCrossCity.setEndLat(warpper.getEndLat()); |
| | | String endAddress = warpper.getEndAddress(); |
| | | endAddress = endAddress.replaceAll("& #40;", "("); |
| | | endAddress = endAddress.replaceAll("& #41;", ")"); |
| | | orderCrossCity.setEndAddress(endAddress); |
| | | |
| | | orderCrossCity.setMileage(0D); |
| | | orderCrossCity.setOrderMoney(totalMoney); |
| | | orderCrossCity.setCompanyId(driver.getCompanyId()); |
| | | orderCrossCity.setPeopleNumber(warpper.getPeopleNumber()); |
| | | orderCrossCity.setSeatNumber(seatNumber); |
| | | |
| | | List<OrderCrossCity> orderCrossCities = this.selectList(new EntityWrapper<OrderCrossCity>().eq("orderNum", orderCrossCity.getOrderNum()).eq("isDelete", 1)); |
| | | orderCrossCity.setSort(orderCrossCities.size() + 1); |
| | | orderCrossCity.setState(7); // 待支付 |
| | | orderCrossCity.setInsertTime(new Date()); |
| | | |
| | | // 设置出行时间为班次日期+开始时间 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(lineShiftDriver.getDay()); |
| | | String[] startTimeParts = lineSite.getStartTime().split(":"); |
| | | calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(startTimeParts[0])); |
| | | calendar.set(Calendar.MINUTE, Integer.parseInt(startTimeParts[1])); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | orderCrossCity.setTravelTime(calendar.getTime()); |
| | | |
| | | orderCrossCity.setSnatchOrderTime(new Date()); |
| | | orderCrossCity.setTravelMode(1); // 固定拼车 |
| | | orderCrossCity.setIsDelete(1); |
| | | orderCrossCity.setIsReassign(1); |
| | | orderCrossCity.setLineShiftDriverId(warpper.getLineShiftDriverId()); |
| | | orderCrossCity.setOrderSource(4); // 司机下单 |
| | | orderCrossCity.setOtherFee(warpper.getOtherFee()); |
| | | this.insert(orderCrossCity); |
| | | |
| | | // 13. 更新司机状态 |
| | | if (driver.getState() == 2) { |
| | | driver.setState(3); |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | // 14. 更新班次座位信息 |
| | | lineShiftDriver.setLaveSeat(lineShiftDriver.getLaveSeat() - warpper.getPeopleNumber()); |
| | | // 更新剩余座位号 |
| | | StringBuilder newLaveSeatNumber = new StringBuilder(); |
| | | for (int i = warpper.getPeopleNumber(); i < availableSeats.length; i++) { |
| | | if (newLaveSeatNumber.length() > 0) { |
| | | newLaveSeatNumber.append(","); |
| | | } |
| | | newLaveSeatNumber.append(availableSeats[i]); |
| | | } |
| | | lineShiftDriver.setLaveSeatNumber(newLaveSeatNumber.toString()); |
| | | lineShiftDriverMapper.updateById(lineShiftDriver); |
| | | |
| | | // 15. 添加系统消息 |
| | | systemNoticeService.addSystemNotice(1, "您的跨城订单已下单成功,请尽快完成支付!", orderCrossCity.getUserId(), 1); |
| | | |
| | | // 16. 创建定时任务,30分钟未支付自动取消 |
| | | Integer orderId = orderCrossCity.getId(); |
| | | TimerTask timerTask = new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | OrderCrossCity order = orderCrossCityMapper.selectById(orderId); |
| | | if (order.getState() == 7 && order.getPayMoney() == null) { |
| | | order.setState(10); |
| | | orderCrossCityMapper.updateById(order); |
| | | |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(orderId); |
| | | orderCancel.setOrderType(3); |
| | | orderCancel.setReason("用户未及时付款,系统自动取消订单"); |
| | | orderCancel.setRemark("用户未及时付款,系统自动取消订单"); |
| | | orderCancel.setState(2); |
| | | orderCancel.setInsertTime(new Date()); |
| | | orderCancel.setUserType(2); |
| | | orderCancelService.insert(orderCancel); |
| | | |
| | | // 恢复座位 |
| | | LineShiftDriver lsd = lineShiftDriverMapper.selectById(order.getLineShiftDriverId()); |
| | | lsd.setLaveSeat(lsd.getLaveSeat() + order.getPeopleNumber()); |
| | | lsd.setLaveSeatNumber( |
| | | (ToolUtil.isNotEmpty(lsd.getLaveSeatNumber()) ? lsd.getLaveSeatNumber() + "," : "") + |
| | | order.getSeatNumber() |
| | | ); |
| | | lineShiftDriverMapper.updateById(lsd); |
| | | |
| | | // 修改司机为空闲 |
| | | List<OrderCrossCity> orders = orderCrossCityMapper.queryByDriverId(order.getDriverId(), 2, 3, 4, 5, 11); |
| | | if (orders.size() == 0) { |
| | | Driver d = driverService.selectById(order.getDriverId()); |
| | | d.setState(2); |
| | | driverService.updateById(d); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | Timer timer = new Timer(); |
| | | timer.schedule(timerTask, 30 * 60 * 1000); |
| | | |
| | | // 17. 返回结果 |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setId(orderCrossCity.getId()); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.stylefeng.guns.modular.crossCity.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 司机排班列表包装类 |
| | | */ |
| | | @ApiModel("司机排班列表") |
| | | public class DriverShiftListWarpper { |
| | | @ApiModelProperty("线路列表") |
| | | private List<LineItemWarpper> lineList; |
| | | |
| | | public List<LineItemWarpper> getLineList() { |
| | | return lineList; |
| | | } |
| | | |
| | | public void setLineList(List<LineItemWarpper> lineList) { |
| | | this.lineList = lineList; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "DriverShiftListWarpper{" + |
| | | "lineList=" + lineList + |
| | | '}'; |
| | | } |
| | | |
| | | /** |
| | | * 线路项包装类 |
| | | */ |
| | | @ApiModel("线路项") |
| | | public static class LineItemWarpper { |
| | | @ApiModelProperty("线路id") |
| | | private Integer lineId; |
| | | @ApiModelProperty("线路名称") |
| | | private String lineName; |
| | | @ApiModelProperty("班次列表") |
| | | private List<LineShiftItemWarpper> shifts; |
| | | |
| | | public Integer getLineId() { |
| | | return lineId; |
| | | } |
| | | |
| | | public void setLineId(Integer lineId) { |
| | | this.lineId = lineId; |
| | | } |
| | | |
| | | public String getLineName() { |
| | | return lineName; |
| | | } |
| | | |
| | | public void setLineName(String lineName) { |
| | | this.lineName = lineName; |
| | | } |
| | | |
| | | public List<LineShiftItemWarpper> getShifts() { |
| | | return shifts; |
| | | } |
| | | |
| | | public void setShifts(List<LineShiftItemWarpper> shifts) { |
| | | this.shifts = shifts; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "LineItemWarpper{" + |
| | | "lineId=" + lineId + |
| | | ", lineName='" + lineName + '\'' + |
| | | ", shifts=" + shifts + |
| | | '}'; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.stylefeng.guns.modular.crossCity.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 班次项包装类 |
| | | */ |
| | | @ApiModel("班次项") |
| | | public class LineShiftItemWarpper { |
| | | @ApiModelProperty("班次id") |
| | | private Integer lineShiftId; |
| | | @ApiModelProperty("司机排班记录id") |
| | | private Integer lineShiftDriverId; |
| | | @ApiModelProperty("开始时间") |
| | | private String startTime; |
| | | @ApiModelProperty("结束时间") |
| | | private String endTime; |
| | | @ApiModelProperty("状态(1=已预约可操作, 2=已过期, 3=未预约)") |
| | | private Integer status; |
| | | @ApiModelProperty("状态文本") |
| | | private String statusText; |
| | | @ApiModelProperty("是否可以扫码下单/代客下单") |
| | | private Boolean canOperate; |
| | | @ApiModelProperty("剩余座位") |
| | | private Integer laveSeat; |
| | | @ApiModelProperty("总座位") |
| | | private Integer totalSeat; |
| | | |
| | | public Integer getLineShiftId() { |
| | | return lineShiftId; |
| | | } |
| | | |
| | | public void setLineShiftId(Integer lineShiftId) { |
| | | this.lineShiftId = lineShiftId; |
| | | } |
| | | |
| | | public Integer getLineShiftDriverId() { |
| | | return lineShiftDriverId; |
| | | } |
| | | |
| | | public void setLineShiftDriverId(Integer lineShiftDriverId) { |
| | | this.lineShiftDriverId = lineShiftDriverId; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getStatusText() { |
| | | return statusText; |
| | | } |
| | | |
| | | public void setStatusText(String statusText) { |
| | | this.statusText = statusText; |
| | | } |
| | | |
| | | public Boolean getCanOperate() { |
| | | return canOperate; |
| | | } |
| | | |
| | | public void setCanOperate(Boolean canOperate) { |
| | | this.canOperate = canOperate; |
| | | } |
| | | |
| | | public Integer getLaveSeat() { |
| | | return laveSeat; |
| | | } |
| | | |
| | | public void setLaveSeat(Integer laveSeat) { |
| | | this.laveSeat = laveSeat; |
| | | } |
| | | |
| | | public Integer getTotalSeat() { |
| | | return totalSeat; |
| | | } |
| | | |
| | | public void setTotalSeat(Integer totalSeat) { |
| | | this.totalSeat = totalSeat; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "LineShiftItemWarpper{" + |
| | | "lineShiftId=" + lineShiftId + |
| | | ", lineShiftDriverId=" + lineShiftDriverId + |
| | | ", startTime='" + startTime + '\'' + |
| | | ", endTime='" + endTime + '\'' + |
| | | ", status=" + status + |
| | | ", statusText='" + statusText + '\'' + |
| | | ", canOperate=" + canOperate + |
| | | ", laveSeat=" + laveSeat + |
| | | ", totalSeat=" + totalSeat + |
| | | '}'; |
| | | } |
| | | |
| | | public static LineShiftItemWarpper getLineShiftItemWarpper(Map<String, Object> map) { |
| | | LineShiftItemWarpper warpper = new LineShiftItemWarpper(); |
| | | if (null != map) { |
| | | warpper.setLineShiftId(null != map.get("lineShiftId") ? Integer.valueOf(map.get("lineShiftId").toString()) : null); |
| | | warpper.setLineShiftDriverId(null != map.get("lineShiftDriverId") ? Integer.valueOf(map.get("lineShiftDriverId").toString()) : null); |
| | | warpper.setStartTime(null != map.get("startTime") ? map.get("startTime").toString() : ""); |
| | | warpper.setEndTime(null != map.get("endTime") ? map.get("endTime").toString() : ""); |
| | | warpper.setStatus(null != map.get("status") ? Integer.valueOf(map.get("status").toString()) : 3); |
| | | warpper.setStatusText(null != map.get("statusText") ? map.get("statusText").toString() : ""); |
| | | warpper.setCanOperate(null != map.get("canOperate") ? Boolean.valueOf(map.get("canOperate").toString()) : false); |
| | | warpper.setLaveSeat(null != map.get("laveSeat") ? Integer.valueOf(map.get("laveSeat").toString()) : 0); |
| | | warpper.setTotalSeat(null != map.get("totalSeat") ? Integer.valueOf(map.get("totalSeat").toString()) : 0); |
| | | } |
| | | return warpper; |
| | | } |
| | | |
| | | public static List<LineShiftItemWarpper> getLineShiftItemWarppers(List<Map<String, Object>> maps) { |
| | | List<LineShiftItemWarpper> list = new ArrayList<>(); |
| | | if (null != maps) { |
| | | for (Map<String, Object> map : maps) { |
| | | list.add(LineShiftItemWarpper.getLineShiftItemWarpper(map)); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.stylefeng.guns.modular.crossCity.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 跨城代客下单请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("跨城代客下单参数") |
| | | public class OrderCrossCityOnBehalfWarpper { |
| | | |
| | | @ApiModelProperty(value = "司机排班记录ID(班次ID)", required = true, dataType = "int") |
| | | private Integer lineShiftDriverId; |
| | | |
| | | @ApiModelProperty(value = "乘车人数", required = true, dataType = "int") |
| | | private Integer peopleNumber; |
| | | |
| | | @ApiModelProperty(value = "乘客手机号", required = true, dataType = "string") |
| | | private String passengersPhone; |
| | | |
| | | @ApiModelProperty(value = "下单地点经度", required = true, dataType = "double") |
| | | private Double placementLon; |
| | | |
| | | @ApiModelProperty(value = "下单地点纬度", required = true, dataType = "double") |
| | | private Double placementLat; |
| | | |
| | | @ApiModelProperty(value = "下单详细地址", required = true, dataType = "string") |
| | | private String placementAddress; |
| | | |
| | | @ApiModelProperty(value = "上车点经度", required = true, dataType = "double") |
| | | private Double startLon; |
| | | |
| | | @ApiModelProperty(value = "上车点纬度", required = true, dataType = "double") |
| | | private Double startLat; |
| | | |
| | | @ApiModelProperty(value = "上车点地址", required = true, dataType = "string") |
| | | private String startAddress; |
| | | |
| | | @ApiModelProperty(value = "下车点经度", required = true, dataType = "double") |
| | | private Double endLon; |
| | | |
| | | @ApiModelProperty(value = "下车点纬度", required = true, dataType = "double") |
| | | private Double endLat; |
| | | |
| | | @ApiModelProperty(value = "下车点地址", required = true, dataType = "string") |
| | | private String endAddress; |
| | | |
| | | @ApiModelProperty(value = "其他费用(远程费、高速费、等待费等),>=0,保留两位小数", required = false, dataType = "BigDecimal") |
| | | private BigDecimal otherFee; |
| | | |
| | | } |
| | |
| | | //经营区域 |
| | | List<Map<String, Object>> scopeList = tCompanyService.getCompanyScopeById(tCompany.getId()); |
| | | model.addAttribute("scopeList",scopeList); |
| | | |
| | | //传递当前用户角色类型,用于控制非平台账号禁用经营业务和经营区域编辑 |
| | | model.addAttribute("roleType", user1.getRoleType()); |
| | | |
| | | return PREFIX + "platformEdit.html"; |
| | | } |
| | | |
| | |
| | | //经营区域 |
| | | List<Map<String, Object>> scopeList = tCompanyService.getCompanyScopeById(tCompanyId); |
| | | model.addAttribute("scopeList",scopeList); |
| | | |
| | | // 传递当前用户角色类型,用于控制非平台账号禁用经营业务和经营区域编辑 |
| | | model.addAttribute("roleType", shiroExtUtil.getUser().getRoleType()); |
| | | return PREFIX + "tCompany_edit.html"; |
| | | } |
| | | |
| | |
| | | shellList.add("所属分公司"); |
| | | shellList.add("所属加盟商"); |
| | | shellList.add("当前车辆"); |
| | | shellList.add("当前绑定车辆"); |
| | | shellList.add("服务模式"); |
| | | shellList.add("关联线路"); |
| | | shellList.add("评分"); |
| | |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("carName"))){ |
| | | shellList.add(object.get("carName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("serverStr"))){ |
| | | shellList.add(object.get("serverStr").toString()); |
| | | }else{ |
| | |
| | | shellList.add("系统订单编号"); |
| | | shellList.add("订单中心编号"); |
| | | shellList.add("订单来源"); |
| | | shellList.add("乘车时间"); |
| | | shellList.add("班次时间"); |
| | | shellList.add("下单用户昵称"); |
| | | shellList.add("下单用户手机"); |
| | | shellList.add("乘车用户姓名"); |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | public class MenuController extends BaseController { |
| | | |
| | | private static String PREFIX = "/system/menu/"; |
| | | |
| | | // 快车相关菜单(isSpe=2时过滤) |
| | | private static final List<String> SPE_MENUS = Arrays.asList( |
| | | "快车订单", "快车改派管理", "快车车型设置" |
| | | ); |
| | | |
| | | // 出租车相关菜单(isTaxi=2时过滤) |
| | | private static final List<String> TAXI_MENUS = Arrays.asList( |
| | | "出租车订单", "出租车改派管理" |
| | | ); |
| | | |
| | | // 跨城相关菜单(isCross=2时过滤) |
| | | private static final List<String> CROSS_MENUS = Arrays.asList( |
| | | "跨城出行订单", "跨城改派管理", "跨城线路管理", "开通城市管理" |
| | | ); |
| | | |
| | | // 顺风车相关菜单(isHitchRide=2时过滤) |
| | | private static final List<String> HITCH_RIDE_MENUS = Arrays.asList( |
| | | "顺风车订单", "顺风车设置", "顺风车司机审核列表", |
| | | "顺风车司机", "顺风车投诉", "顺风车评价" |
| | | ); |
| | | |
| | | @Autowired |
| | | private IMenuService menuService; |
| | |
| | | } |
| | | } |
| | | List<ZTreeNode> roleTreeList = this.menuService.menuTreeList(ids); |
| | | // 分公司(type=2)和供应商(type=3)需要根据经营范围过滤菜单 |
| | | if (tCompany.getType() == 2 || tCompany.getType() == 3) { |
| | | roleTreeList = filterMenusByBusinessScope(roleTreeList, tCompany); |
| | | } |
| | | return roleTreeList; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | List<ZTreeNode> roleTreeList = this.menuService.menuTreeList(ids); |
| | | // 分公司(type=2)和供应商(type=3)需要根据经营范围过滤菜单 |
| | | if (tCompany.getType() == 2 || tCompany.getType() == 3) { |
| | | roleTreeList = filterMenusByBusinessScope(roleTreeList, tCompany); |
| | | } |
| | | roleTreeList.add(ZTreeNode.createParent()); |
| | | return roleTreeList; |
| | | } |
| | |
| | | } |
| | | if (ToolUtil.isEmpty(menuIds)) { |
| | | List<ZTreeNode> roleTreeList = this.menuService.menuTreeList(ids); |
| | | // 分公司(type=2)和供应商(type=3)需要根据经营范围过滤菜单 |
| | | if (tCompany.getType() == 2 || tCompany.getType() == 3) { |
| | | roleTreeList = filterMenusByBusinessScope(roleTreeList, tCompany); |
| | | } |
| | | return roleTreeList; |
| | | } else { |
| | | List<ZTreeNode> roleTreeListByUserId = this.menuService.menuTreeListByMenuIds(menuIds, ids); |
| | | // 分公司(type=2)和供应商(type=3)需要根据经营范围过滤菜单 |
| | | if (tCompany.getType() == 2 || tCompany.getType() == 3) { |
| | | roleTreeListByUserId = filterMenusByBusinessScope(roleTreeListByUserId, tCompany); |
| | | } |
| | | return roleTreeListByUserId; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据企业经营范围过滤菜单 |
| | | * @param menuList 原始菜单列表 |
| | | * @param company 企业信息 |
| | | * @return 过滤后的菜单列表 |
| | | */ |
| | | private List<ZTreeNode> filterMenusByBusinessScope(List<ZTreeNode> menuList, TCompany company) { |
| | | List<String> excludeMenuNames = new ArrayList<>(); |
| | | |
| | | // isSpe=2 不经营快车 |
| | | if (company.getIsSpe() != null && company.getIsSpe() == 2) { |
| | | excludeMenuNames.addAll(SPE_MENUS); |
| | | } |
| | | // isTaxi=2 不经营出租车 |
| | | if (company.getIsTaxi() != null && company.getIsTaxi() == 2) { |
| | | excludeMenuNames.addAll(TAXI_MENUS); |
| | | } |
| | | // isCross=2 不经营跨城 |
| | | if (company.getIsCross() != null && company.getIsCross() == 2) { |
| | | excludeMenuNames.addAll(CROSS_MENUS); |
| | | } |
| | | // isHitchRide=2 不经营顺风车 |
| | | if (company.getIsHitchRide() != null && company.getIsHitchRide() == 2) { |
| | | excludeMenuNames.addAll(HITCH_RIDE_MENUS); |
| | | } |
| | | |
| | | if (excludeMenuNames.isEmpty()) { |
| | | return menuList; |
| | | } |
| | | |
| | | return menuList.stream() |
| | | .filter(node -> !excludeMenuNames.contains(node.getName())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | <!--根据审核通过的司机列表--> |
| | | <select id="getDriverList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT cc1.`name` as companyName,cc2.`name` as franchiseeName,if(dw.driverId is null, '', ci.carLicensePlate) as carLicensePlate,ds.serverStr,IFNULL(oe.evaluateNum,0) as evaluateNum, |
| | | SELECT * FROM (SELECT cc1.`name` as companyName,cc2.`name` as franchiseeName,if(dw.driverId is null, '', ci.carLicensePlate) as carLicensePlate,if(dw.driverId is null, '', CONCAT(IFNULL(cb.name,''), IFNULL(cm.name,''))) as carName,ds.serverStr,IFNULL(oe.evaluateNum,0) as evaluateNum, |
| | | (IFNULL(ot1.taxiNum, 0) + IFNULL(ot3.num, 0) + IFNULL(ot5.num, 0) + IFNULL(ot7.num, 0)) as historyNum, |
| | | (IFNULL(ot2.taxiMoney, 0)+ IFNULL(ot4.money, 0) + IFNULL(ot6.money, 0) + IFNULL(ot8.money, 0)) as historyMoney, |
| | | dd.* from t_driver as dd |
| | | LEFT JOIN (select * from t_company where type = 2 and flag != 3) as cc1 on cc1.id = dd.companyId |
| | | LEFT JOIN (select * from t_company where type = 3 and flag != 3) as cc2 on cc2.id = dd.franchiseeId |
| | | LEFT JOIN (select * from t_car where state = 1) as ci on ci.id = dd.carId |
| | | LEFT JOIN (select * from t_car_brand where state = 1) as cb on cb.id = ci.carBrandId |
| | | LEFT JOIN (select * from t_car_model where state = 1) as cm on cm.id = ci.carModelId |
| | | LEFT JOIN (select * from t_driver_work where state = 1) as dw on dd.id = dw.driverId |
| | | LEFT JOIN ( |
| | | SELECT |
| | |
| | | <fieldset> |
| | | <div class="checkbox checkbox-success"> |
| | | <input name="checkbox" id="checkbox1" type="checkbox" value="1" ${1== item.isSpe ? |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox1()"> |
| | | <label for="checkbox1"> |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox1()" ${roleType != 1 ? 'disabled' : ''}> |
| | | <label for="checkbox1" ${roleType != 1 ? 'style="color:#999"' : ''}> |
| | | 快车 |
| | | </label> |
| | | <fieldset> |
| | | @if(roleType == 1){ |
| | | <#button btnCss="info" name="设置司机抽成" id="Spe1" icon="fa-check" |
| | | clickFun="TLineInfoDlg.set1('Spe')"/> |
| | | @} |
| | | <textarea id="Spe" rows="5" cols="50" hidden="hidden" value="${item.Spe}">${item.Spe}</textarea> |
| | | |
| | | |
| | | </fieldset> |
| | | </div> |
| | | <div class="checkbox checkbox-primary"> |
| | | <input name="checkbox" id="checkbox2" type="checkbox" value="2" ${1== item.isTaxi ? |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox2()"> |
| | | <label for="checkbox2"> |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox2()" ${roleType != 1 ? 'disabled' : ''}> |
| | | <label for="checkbox2" ${roleType != 1 ? 'style="color:#999"' : ''}> |
| | | 出租车 |
| | | </label> |
| | | <fieldset> |
| | | <div class="row" style="display: none;" id="czDiv"> |
| | | @if(roleType == 1){ |
| | | <#button btnCss="info" name="设置司机抽成" id="rakeRate" icon="fa-check" |
| | | clickFun="TLineInfoDlg.set1('Taxi')"/> |
| | | @} |
| | | <textarea id="Taxi" rows="5" cols="50" hidden="hidden" value="${item.Taxi}">${item.Taxi}</textarea> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <div class="checkbox checkbox-success"> |
| | | <input name="checkbox" id="checkbox3" type="checkbox" value="3" ${1== item.isCross ? |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox3()"> |
| | | <label for="checkbox3"> |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox3()" ${roleType != 1 ? 'disabled' : ''}> |
| | | <label for="checkbox3" ${roleType != 1 ? 'style="color:#999"' : ''}> |
| | | 跨城出行 |
| | | </label> |
| | | </div> |
| | |
| | | <!-- </div>--> |
| | | <div class="checkbox checkbox-success"> |
| | | <input id="checkbox8" name="checkbox" onclick="TCompanyInfoDlg.checkbox8()" |
| | | type="checkbox" value="8" ${1 == item.isHitchRide ? 'checked=checked' : ''} > |
| | | <label for="checkbox8"> |
| | | type="checkbox" value="8" ${1 == item.isHitchRide ? 'checked=checked' : ''} ${roleType != 1 ? 'disabled' : ''}> |
| | | <label for="checkbox8" ${roleType != 1 ? 'style="color:#999"' : ''}> |
| | | 顺风车 |
| | | </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success"> |
| | | <input id="checkbox9" name="checkbox" onclick="TCompanyInfoDlg.checkbox9()" |
| | | type="checkbox" value="9" ${1 == item.isSubstituteDriving ? 'checked=checked' : ''} > |
| | | <label for="checkbox9"> |
| | | type="checkbox" value="9" ${1 == item.isSubstituteDriving ? 'checked=checked' : ''} ${roleType != 1 ? 'disabled' : ''}> |
| | | <label for="checkbox9" ${roleType != 1 ? 'style="color:#999"' : ''}> |
| | | 代驾 |
| | | </label> |
| | | </div> |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">经营区域:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="province" onchange="TCompanyInfoDlg.provinceChange(this)"> |
| | | <select class="form-control" id="province" onchange="TCompanyInfoDlg.provinceChange(this)" ${roleType != 1 ? 'disabled' : ''}> |
| | | <option value="">选择省</option> |
| | | @for(obj in provinceList){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="city" onchange="TCompanyInfoDlg.cityChage(this)"> |
| | | <select class="form-control" id="city" onchange="TCompanyInfoDlg.cityChage(this)" ${roleType != 1 ? 'disabled' : ''}> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="area"> |
| | | <select class="form-control" id="area" ${roleType != 1 ? 'disabled' : ''}> |
| | | <option value="">选择区</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-1"> |
| | | @if(roleType == 1){ |
| | | <#button btnCss="info" name="添加" id="ensure" icon="fa-check" |
| | | clickFun="TCompanyInfoDlg.addScope()"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | |
| | | <input type="hidden" id="areaCode" name="areaCode" value="${obj.areaCode}">${obj.value} |
| | | </td> |
| | | <td> |
| | | @if(roleType == 1){ |
| | | <button onclick="deleteSub(this)">移除</button> |
| | | @} |
| | | </td> |
| | | </tr> |
| | | @} |
| | |
| | | <label class="col-sm-3 control-label">经营业务:</label> |
| | | <div class="col-sm-9"> |
| | | <fieldset> |
| | | @if(roleType == 1 || (roleType == 2 && company.isSpe == 1)){ |
| | | <div class="checkbox checkbox-success"> |
| | | <input name="checkbox" id="checkbox1" type="checkbox" value="1" onclick="FranchiseeInfoDlg.checkbox1()"> |
| | | <label for="checkbox1"> |
| | |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | @} |
| | | @if(roleType == 1 || (roleType == 2 && company.isTaxi == 1)){ |
| | | <div class="checkbox checkbox-primary"> |
| | | <input name="checkbox" id="checkbox2" type="checkbox" value="2" onclick="FranchiseeInfoDlg.checkbox2()"> |
| | | <label for="checkbox2"> |
| | |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | @} |
| | | @if(roleType == 1 || (roleType == 2 && company.isCross == 1)){ |
| | | <div class="checkbox checkbox-success"> |
| | | <input name="checkbox" id="checkbox3" type="checkbox" value="3" onclick="FranchiseeInfoDlg.checkbox3()"> |
| | | <label for="checkbox3"> |
| | | 跨城出行 |
| | | </label> |
| | | </div> |
| | | @} |
| | | <!-- <div class="checkbox checkbox-info">--> |
| | | <!-- <input name="checkbox" id="checkbox4" type="checkbox" value="4" onclick="FranchiseeInfoDlg.checkbox4()">--> |
| | | <!-- <label for="checkbox4">--> |
| | |
| | | <!-- </div>--> |
| | | <!-- </fieldset>--> |
| | | <!-- </div>--> |
| | | @if(roleType == 1 || (roleType == 2 && company.isHitchRide == 1)){ |
| | | <div class="checkbox checkbox-success"> |
| | | <input id="checkbox8" name="checkbox" onclick="TCompanyInfoDlg.checkbox8()" |
| | | type="checkbox" value="8"> |
| | |
| | | 顺风车 |
| | | </label> |
| | | </div> |
| | | @} |
| | | @if(roleType == 1 || (roleType == 2 && company.isSubstituteDriving == 1)){ |
| | | <div class="checkbox checkbox-success"> |
| | | <input id="checkbox9" name="checkbox" onclick="TCompanyInfoDlg.checkbox9()" |
| | | type="checkbox" value="9"> |
| | |
| | | 代驾 |
| | | </label> |
| | | </div> |
| | | @} |
| | | </fieldset> |
| | | </div> |
| | | </div> |
| | |
| | | <fieldset> |
| | | <div class="checkbox checkbox-success"> |
| | | <input name="checkbox" id="checkbox1" type="checkbox" value="1" ${1== item.isSpe ? |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox1()"> |
| | | <label for="checkbox1"> |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox1()" ${roleType != 1 ? 'disabled' : ''}> |
| | | <label for="checkbox1" ${roleType != 1 ? 'style="color:#999"' : ''}> |
| | | 快车 |
| | | </label> |
| | | <fieldset> |
| | |
| | | </div> |
| | | <div class="checkbox checkbox-primary"> |
| | | <input name="checkbox" id="checkbox2" type="checkbox" value="2" ${1== item.isTaxi ? |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox2()"> |
| | | <label for="checkbox2"> |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox2()" ${roleType != 1 ? 'disabled' : ''}> |
| | | <label for="checkbox2" ${roleType != 1 ? 'style="color:#999"' : ''}> |
| | | 出租车 |
| | | </label> |
| | | <fieldset> |
| | |
| | | </div> |
| | | <div class="checkbox checkbox-success"> |
| | | <input name="checkbox" id="checkbox3" type="checkbox" value="3" ${1== item.isCross ? |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox3()"> |
| | | <label for="checkbox3"> |
| | | 'checked=checked' : ''} onclick="TCompanyInfoDlg.checkbox3()" ${roleType != 1 ? 'disabled' : ''}> |
| | | <label for="checkbox3" ${roleType != 1 ? 'style="color:#999"' : ''}> |
| | | 跨城出行 |
| | | </label> |
| | | </div> |
| | |
| | | <!-- </div>--> |
| | | <div class="checkbox checkbox-success"> |
| | | <input id="checkbox8" name="checkbox" onclick="TCompanyInfoDlg.checkbox8()" |
| | | type="checkbox" value="8" ${1 == item.isHitchRide ? 'checked=checked' : ''} > |
| | | <label for="checkbox8"> |
| | | type="checkbox" value="8" ${1 == item.isHitchRide ? 'checked=checked' : ''} ${roleType != 1 ? 'disabled' : ''}> |
| | | <label for="checkbox8" ${roleType != 1 ? 'style="color:#999"' : ''}> |
| | | 顺风车 |
| | | </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success"> |
| | | <input id="checkbox9" name="checkbox" onclick="TCompanyInfoDlg.checkbox9()" |
| | | type="checkbox" value="9" ${1 == item.isSubstituteDriving ? 'checked=checked' : ''} > |
| | | <label for="checkbox9"> |
| | | type="checkbox" value="9" ${1 == item.isSubstituteDriving ? 'checked=checked' : ''} ${roleType != 1 ? 'disabled' : ''}> |
| | | <label for="checkbox9" ${roleType != 1 ? 'style="color:#999"' : ''}> |
| | | 代驾 |
| | | </label> |
| | | </div> |
| | |
| | | <label class="col-sm-3 control-label">经营业务:</label> |
| | | <div class="col-sm-9"> |
| | | <fieldset> |
| | | @if(roleType == 1 || (roleType == 2 && company.isSpe == 1)){ |
| | | <div class="checkbox checkbox-success"> |
| | | <input name="checkbox" id="checkbox1" type="checkbox" value="1" ${1== item.isSpe ? 'checked=checked' : ''} onclick="FranchiseeInfoDlg.checkbox1()"> |
| | | <label for="checkbox1"> |
| | |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | @} |
| | | @if(roleType == 1 || (roleType == 2 && company.isTaxi == 1)){ |
| | | <div class="checkbox checkbox-primary"> |
| | | <input name="checkbox" id="checkbox2" type="checkbox" value="2" ${1== item.isTaxi ? 'checked=checked' : ''} onclick="FranchiseeInfoDlg.checkbox2()"> |
| | | <label for="checkbox2"> |
| | |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | @} |
| | | @if(roleType == 1 || (roleType == 2 && company.isCross == 1)){ |
| | | <div class="checkbox checkbox-success"> |
| | | <input name="checkbox" id="checkbox3" type="checkbox" value="3" ${1== item.isCross ? 'checked=checked' : ''} onclick="FranchiseeInfoDlg.checkbox3()"> |
| | | <label for="checkbox3"> |
| | | 跨城出行 |
| | | </label> |
| | | </div> |
| | | @} |
| | | <!-- <div class="checkbox checkbox-info">--> |
| | | <!-- <input name="checkbox" id="checkbox4" type="checkbox" value="4" ${1 == item.isSameLogistics ? 'checked=checked' : ''} onclick="FranchiseeInfoDlg.checkbox4()">--> |
| | | <!-- <label for="checkbox4">--> |
| | |
| | | <!-- </div>--> |
| | | <!-- </fieldset>--> |
| | | <!-- </div>--> |
| | | @if(roleType == 1 || (roleType == 2 && company.isHitchRide == 1)){ |
| | | <div class="checkbox checkbox-success"> |
| | | <input id="checkbox8" name="checkbox" onclick="TCompanyInfoDlg.checkbox8()" |
| | | type="checkbox" value="8" ${1 == item.isHitchRide ? 'checked=checked' : ''} > |
| | | type="checkbox" value="8" ${1 == item.isHitchRide ? 'checked=checked' : ''}> |
| | | <label for="checkbox8"> |
| | | 顺风车 |
| | | </label> |
| | | </div> |
| | | @} |
| | | @if(roleType == 1 || (roleType == 2 && company.isSubstituteDriving == 1)){ |
| | | <div class="checkbox checkbox-success"> |
| | | <input id="checkbox9" name="checkbox" onclick="TCompanyInfoDlg.checkbox9()" |
| | | type="checkbox" value="9" ${1 == item.isSubstituteDriving ? 'checked=checked' : ''} > |
| | | type="checkbox" value="9" ${1 == item.isSubstituteDriving ? 'checked=checked' : ''}> |
| | | <label for="checkbox9"> |
| | | 代驾 |
| | | </label> |
| | | </div> |
| | | @} |
| | | </fieldset> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <div class="col-sm-6"> |
| | | <#label id="orderNum" name="订单编号" value="${item.orderNum}"/> |
| | | <#label id="travelTimeStr" name="乘车时间" value="${item.travelTimeStr}"/> |
| | | <#label id="travelTimeStr" name="班次时间" value="${item.travelTimeStr}"/> |
| | | <#label id="userPhone" name="下单用户手机号" value="${item.userPhone}"/> |
| | | <#label id="passengersPhone" name="乘车用户手机号" value="${item.passengersPhone}"/> |
| | | <#label id="endAddress" name="终点" value="${item.endAddress}"/> |
| | |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '当前绑定车辆', field: 'carName', visible: true, align: 'center', valign: 'middle',width:'7%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.carName != '' && row.carName != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.carName + '" onfocus="TUser.tooltip()">' + row.carName + '</p>'] |
| | | }else{ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="-" onfocus="TUser.tooltip()">-</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '服务模式', field: 'serverStr', visible: true, align: 'center', valign: 'middle',width:'7%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | |
| | | }, |
| | | {title: '所属公司', field: 'companyName', visible: true, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '乘车时间', field: 'travelTime', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | {title: '班次时间', field: 'travelTime', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.travelTime != '' && row.travelTime != null) { |