management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
@@ -598,8 +598,6 @@ @ResponseBody public Object rechargeBalance(Integer id, String money) { TDriver tDriver = tDriverService.selectById(id); tDriver.setBackgroundBalance(new BigDecimal(money).add(tDriver.getBackgroundBalance())); tDriverService.updateById(tDriver); // 添加充值记录 TRechargeRecord tRechargeRecord = new TRechargeRecord(); @@ -614,6 +612,20 @@ Integer id1 = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); tRechargeRecord.setAgentId(id1); tRechargeRecordService.insert(tRechargeRecord); AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); accountChangeDetail.setUserId(id); accountChangeDetail.setUserType(2); accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); accountChangeDetail.setChangeType(10); accountChangeDetail.setCreateTime(new Date()); accountChangeDetail.setExplain("平台充值"); accountChangeDetail.setOldData(tDriver.getBalance().add(tDriver.getBackgroundBalance()).add(tDriver.getCouponBalance()).add(tDriver.getCommission()).doubleValue()); tDriver.setBackgroundBalance(new BigDecimal(money).add(tDriver.getBackgroundBalance())); tDriverService.updateById(tDriver); accountChangeDetail.setNewData(tDriver.getBalance().add(tDriver.getBackgroundBalance()).add(tDriver.getCouponBalance()).add(tDriver.getCommission()).doubleValue()); accountChangeDetail.setType(1); accountChangeDetailMapper.insert(accountChangeDetail); return SUCCESS_TIP; } management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/THomePageController.java
@@ -270,13 +270,13 @@ map.put("onLineDriver",list1); }else { List<TAgent> tAgentList = tAgentService.selectList(new EntityWrapper<TAgent>() .eq("provinceCode", "440000")); .eq("provinceCode", "530000")); List<Integer> ids = tAgentList.stream().map(TAgent::getId).collect(Collectors.toList()); // 查询统计在线司机,待接单,服务中,已完成,已取消 List<TDriver> onLineDriver = tDriverService.selectList(new EntityWrapper<TDriver>() .in("agentId", ids)); Map<String, String> mapAddress = geocode("广东省广州市"); Map<String, String> mapAddress = geocode("云南省昆明市"); map.put("addressLon",mapAddress.get("addressLon")); map.put("addressLat",mapAddress.get("addressLat")); management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOrderController.java
@@ -9,11 +9,14 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.base.tips.SuccessTip; import com.stylefeng.guns.core.log.LogObjectHolder; import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.system.controller.resp.TAppUserDetailOrderResp; import com.stylefeng.guns.modular.system.controller.resp.TDriverCommissionResp; import com.stylefeng.guns.modular.system.controller.resp.TOrderResp; import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; import com.stylefeng.guns.modular.system.dao.TCancelOrderMapper; import com.stylefeng.guns.modular.system.enums.OrderStateEnum; import com.stylefeng.guns.modular.system.model.TAppUser; import com.stylefeng.guns.modular.system.model.TDriver; import com.stylefeng.guns.modular.system.model.TOrder; @@ -36,6 +39,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.math.BigDecimal; @@ -64,6 +68,8 @@ private ITAppUserService tAppUserService; @Autowired private ITCancelOrderService tCancelOrderService; @Resource private TCancelOrderMapper tCancelOrderMapper; @Value("${filePath}") private String filePath; @@ -72,7 +78,11 @@ * 跳转到首页 */ @RequestMapping("") public String index() { public String index(Model model) { Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); List<TOrderResp> tOrderResps = tCancelOrderMapper.orderExceptionList(null, null, null, null, null, null, null, null, roleType, objectId); model.addAttribute("error", tOrderResps.size()); return PREFIX + "tOrder.html"; } @@ -197,7 +207,7 @@ Integer state, String driverName) { // return tOrderService.getOrderList(createTime, code, source, userName, userPhone, state, driverName,2); return tCancelOrderService.getCancelOrderList(createTime, code, source, userName, userPhone, state, driverName); return tCancelOrderService.orderExceptionList(createTime, code, source, userName, userPhone, state, driverName); } /** @@ -476,4 +486,17 @@ return ResultUtil.paranErr(); } } /** * 关闭订单 */ @RequestMapping(value = "/cancelOrderUpdate") @ResponseBody public Object cancelOrderUpdate(@RequestParam Integer tOrderId) { TOrder tOrder = tOrderService.selectById(tOrderId); tOrder.setState(OrderStateEnum.CANCELED.getCode()); tOrderService.updateById(tOrder); return SUCCESS_TIP; } } management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/resp/TDriverResp.java
@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty; public class TDriverResp extends TDriver { //驾龄 private Integer driverAge; //所属代理商 @ApiModelProperty(value = "所属代理商") @@ -121,4 +123,12 @@ public void setRefusalCount(Integer refusalCount) { this.refusalCount = refusalCount; } public Integer getDriverAge() { return driverAge; } public void setDriverAge(Integer driverAge) { this.driverAge = driverAge; } } management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TCancelOrderMapper.java
@@ -19,6 +19,15 @@ @Mapper public interface TCancelOrderMapper extends BaseMapper<TCancelOrder> { List<TOrderResp> orderExceptionList(@Param("startTime") String startTime, @Param("endTime")String endTime, @Param("code") String code, @Param("source") Integer source, @Param("userName")String userName, @Param("userPhone")String userPhone, @Param("state")Integer state, @Param("driverName")String driverName,@Param("roleType")Integer roleType, @Param("objectId")Integer objectId); /** * 查询取消订单列表 * @param startTime management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCancelOrderMapper.xml
@@ -23,6 +23,62 @@ a.nickname AS userName,a.phone AS userPhone,a.cancelCount,a.status AS userStatus,d.name AS driverName,d.phone AS driverPhone </sql> <select id="orderExceptionList" resultType="com.stylefeng.guns.modular.system.controller.resp.TOrderResp"> select o.id, o.createTime, o.code, o.source, o.startTime, o.userName, o.userPhone, o.startAddress, o.endAddress, d.name as driverName, d.phone as driverPhone, o.estimatedPrice, a.cancelCount, o.state, a.status AS userStatus from t_order o left join t_app_user a on o.userId = a.id left join t_driver d on o.driverId = d.id <where> a.cancelCount >= 3 <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> AND o.createTime between #{startTime} and #{endTime} </if> <if test="code != null and code != ''"> AND o.code LIKE concat('%',#{code},'%') </if> <if test="source != null"> AND o.source = #{source} </if> <if test="userName != null and userName != ''"> AND a.nickname LIKE concat('%',#{userName},'%') </if> <if test="userPhone != null and userPhone != ''"> AND a.phone LIKE concat('%',#{userPhone},'%') </if> <if test="state != null"> AND o.state = #{state} </if> <if test="driverName != null and driverName != ''"> AND d.name LIKE concat('%',#{driverName},'%') </if> <if test="roleType != null and roleType == 2"> AND o.branchOfficeId = #{objectId} </if> <if test="roleType != null and roleType == 3"> AND o.agentId = #{objectId} </if> </where> ORDER BY o.createTime </select> <select id="getCancelOrderList" resultType="com.stylefeng.guns.modular.system.controller.resp.TOrderResp"> select <include refid="Base_Column_Order"></include> from t_cancel_order co management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriver.java
@@ -209,6 +209,11 @@ @TableField("merchantIDCode") private String merchantIDCode; /** * 优惠券余额(订单优惠券支付的金额) */ @TableField("couponBalance") private BigDecimal couponBalance; /** * 是否打开下单二维码 */ @TableField("openOrderQRCode") @@ -606,6 +611,14 @@ this.openOrderQRCode = openOrderQRCode; } public BigDecimal getCouponBalance() { return couponBalance; } public void setCouponBalance(BigDecimal couponBalance) { this.couponBalance = couponBalance; } @Override protected Serializable pkVal() { return this.id; management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITCancelOrderService.java
@@ -18,6 +18,21 @@ public interface ITCancelOrderService extends IService<TCancelOrder> { /** * 查询取消订单列表 * @param createTime * @param code * @param source * @param userName * @param userPhone * @param state * @param driverName * @return */ List<TOrderResp> orderExceptionList(String createTime, String code, Integer source, String userName, String userPhone, Integer state, String driverName); /** * 查询取消订单列表 * @param createTime management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCancelOrderServiceImpl.java
@@ -32,6 +32,22 @@ @Autowired private ITOrderService tOrderService; @Override public List<TOrderResp> orderExceptionList(String createTime, String code, Integer source, String userName, String userPhone, Integer state, String driverName) { String startTime = null; String endTime = null; // 开始,结束时间 if(StringUtils.hasLength(createTime)){ String[] split = createTime.split(" - "); startTime = split[0]; endTime = split[1]; } Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); return tCancelOrderMapper.orderExceptionList(startTime,endTime,code,source,userName,userPhone,state,driverName,roleType,objectId); } @Override public List<TOrderResp> getCancelOrderList(String createTime, String code, Integer source, String userName, String userPhone, Integer state, String driverName) { String startTime = null; management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
@@ -127,6 +127,11 @@ for (TDriver tDriver : tDrivers) { TDriverResp tDriverResp = new TDriverResp(); BeanUtils.copyProperties(tDriver,tDriverResp); tDriverResp.setDriverAge(0); if(null != tDriver.getFirstCertificateTime()){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); tDriverResp.setDriverAge(Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(tDriver.getFirstCertificateTime()))); } if(Objects.nonNull(tDriver.getBackgroundBalance()) && Objects.nonNull(tDriver.getBalance())){ // 设置余额 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderServiceImpl.java
@@ -732,153 +732,189 @@ * 合适司:积分 > 评分 > 距离 * 3.司机没有接单直接将订单置入大厅 */ TSystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 1)); if(null == systemConfig){ return; } JSONObject jsonObject = JSON.parseObject(systemConfig.getContent()); Double num3 = jsonObject.getDouble("num3");//推单最大范围 Integer num4 = jsonObject.getInteger("num4");//接单时间 String startLat = order.getStartLat(); String startLng = order.getStartLng(); //1 //找到中心点 GeoJsonPoint geoJsonPoint = new GeoJsonPoint(Double.valueOf(startLng), Double.valueOf(startLat)); Double num = num3 / 1000;//范围公里 //构造半径 Distance distanceR = new Distance(num, Metrics.KILOMETERS); //画圆 Circle circle = new Circle(geoJsonPoint, distanceR); // 构造query对象 Query query = Query.query(Criteria.where("location").withinSphere(circle)); List<Location> locations = mongoTemplate.find(query, Location.class); List<Integer> driverIds = locations.stream().map(Location::getDriverId).collect(Collectors.toList()); Integer driver = null; TYouTuiDriver youTuiDriver1 = null; if(driverIds.size() > 0){ List<TYouTuiDriver> youTuiDrivers = youTuiDriverService.selectList(new EntityWrapper<TYouTuiDriver>().in("driverId", driverIds) .eq("state", 2).last(" and (surplusQuantity > 0 or now() < endTime) and now() < failureTime")); Double d = null; for (TYouTuiDriver youTuiDriver : youTuiDrivers) { String value = redisUtil.getValue("DRIVER" + youTuiDriver.getDriverId()); if(ToolUtil.isEmpty(value)){ continue; } TDriver driver1 = driverService.selectById(youTuiDriver.getDriverId()); if(driver1.getServerStatus() == 2 || driver1.getOpenOrderQRCode() == 1){ continue; } TDriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<TDriverWork>().eq("driverId", driver1.getId()).eq("status", 1)); if(null == driverWork){ continue; } Map<String, Double> distance = GeodesyUtil.getDistance(value, order.getStartLng() + "," + order.getStartLat()); Double wgs84 = distance.get("WGS84"); if(d == null || d.compareTo(wgs84) > 0){ d = wgs84; driver = youTuiDriver.getDriverId(); youTuiDriver1 = youTuiDriver; try { boolean lock = redisUtil.lock(5); if(!lock){ int num1 = 1; while (num1 <= 10){ Thread.sleep(3000);//等待3秒 lock = redisUtil.lock(5); if(lock){ break; }else{ num1++; } } } } if(!lock){ redisUtil.unlock(); order.setHallOrder(1); this.updateById(order); ExtraPushOrder(order); return; } TSystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 1)); if(null == systemConfig){ redisUtil.unlock(); return; } JSONObject jsonObject = JSON.parseObject(systemConfig.getContent()); Double num3 = jsonObject.getDouble("num3");//推单最大范围 Integer num4 = jsonObject.getInteger("num4");//接单时间 String startLat = order.getStartLat(); String startLng = order.getStartLng(); if(null != youTuiDriver1 && youTuiDriver1.getType() == 1){ youTuiDriver1.setSurplusQuantity(youTuiDriver1.getSurplusQuantity() - 1); youTuiDriverService.updateById(youTuiDriver1); } //开始范围查找 if(null == driver){ for (int i = 1; i < 4; i++) { if(null != driver){ break; } num = jsonObject.getDouble("num" + i) / 1000;//范围公里 //构造半径 distanceR = new Distance(num, Metrics.KILOMETERS); //画圆 circle = new Circle(geoJsonPoint, distanceR); // 构造query对象 query = Query.query(Criteria.where("location").withinSphere(circle)); locations = mongoTemplate.find(query, Location.class); driverIds = locations.stream().map(Location::getDriverId).collect(Collectors.toList()); if(driverIds.size() > 0){ List<TDriver> drivers = driverService.selectList(new EntityWrapper<TDriver>().eq("approvalStatus", 2) .eq("serverStatus", 1).eq("openOrderQRCode", 0).eq("status", 1).in("id", driverIds)); if(drivers.size() == 0){ //1 //找到中心点 GeoJsonPoint geoJsonPoint = new GeoJsonPoint(Double.valueOf(startLng), Double.valueOf(startLat)); Double num = num3 / 1000;//范围公里 //构造半径 Distance distanceR = new Distance(num, Metrics.KILOMETERS); //画圆 Circle circle = new Circle(geoJsonPoint, distanceR); // 构造query对象 Query query = Query.query(Criteria.where("location").withinSphere(circle)); List<Location> locations = mongoTemplate.find(query, Location.class); List<Integer> driverIds = locations.stream().map(Location::getDriverId).collect(Collectors.toList()); Integer driver = null; TYouTuiDriver youTuiDriver1 = null; if(driverIds.size() > 0){ List<TYouTuiDriver> youTuiDrivers = youTuiDriverService.selectList(new EntityWrapper<TYouTuiDriver>().in("driverId", driverIds) .eq("state", 2).last(" and (surplusQuantity > 0 or now() < endTime) and now() < failureTime")); Double d = null; for (TYouTuiDriver youTuiDriver : youTuiDrivers) { String value = redisUtil.getValue("DRIVER" + youTuiDriver.getDriverId()); if(ToolUtil.isEmpty(value)){ continue; } TDriver driver1 = driverService.selectById(youTuiDriver.getDriverId()); if(driver1.getServerStatus() == 2 || driver1.getOpenOrderQRCode() == 1){ continue; } TDriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<TDriverWork>().eq("driverId", driver1.getId()).eq("status", 1)); if(null == driverWork){ continue; } Map<String, Double> distance = GeodesyUtil.getDistance(value, order.getStartLng() + "," + order.getStartLat()); Double wgs84 = distance.get("WGS84"); if(d == null || d.compareTo(wgs84) > 0){ d = wgs84; driver = youTuiDriver.getDriverId(); youTuiDriver1 = youTuiDriver; } } } Integer integral = null; Double score = null; Double d = null; for (TDriver driver1 : drivers) { String value = redisUtil.getValue("DRIVER" + driver1.getId()); if(ToolUtil.isEmpty(value)){ continue; } TDriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<TDriverWork>().eq("driverId", driver1.getId()).eq("status", 1)); if(null == driverWork){ if(null != youTuiDriver1 && youTuiDriver1.getType() == 1){ youTuiDriver1.setSurplusQuantity(youTuiDriver1.getSurplusQuantity() - 1); youTuiDriverService.updateById(youTuiDriver1); } //开始范围查找 if(null == driver){ for (int i = 1; i < 4; i++) { if(null != driver){ break; } num = jsonObject.getDouble("num" + i) / 1000;//范围公里 //构造半径 distanceR = new Distance(num, Metrics.KILOMETERS); //画圆 circle = new Circle(geoJsonPoint, distanceR); // 构造query对象 query = Query.query(Criteria.where("location").withinSphere(circle)); locations = mongoTemplate.find(query, Location.class); driverIds = locations.stream().map(Location::getDriverId).collect(Collectors.toList()); if(driverIds.size() > 0){ List<TDriver> drivers = driverService.selectList(new EntityWrapper<TDriver>().eq("approvalStatus", 2) .eq("serverStatus", 1).eq("openOrderQRCode", 0).eq("status", 1).in("id", driverIds)); if(drivers.size() == 0){ continue; } if(integral == null || integral.compareTo(driver1.getIntegral()) < 0){//积分大 integral = driver1.getIntegral(); score = driver1.getScore(); driver = driver1.getId(); Map<String, Double> distance = GeodesyUtil.getDistance(value, order.getStartLng() + "," + order.getStartLat()); Double wgs84 = distance.get("WGS84"); d = wgs84; continue; } if(integral.compareTo(driver1.getIntegral()) == 0 && score.compareTo(driver1.getScore()) < 0){//积分相同对比评分 integral = driver1.getIntegral(); score = driver1.getScore(); driver = driver1.getId(); Map<String, Double> distance = GeodesyUtil.getDistance(value, order.getStartLng() + "," + order.getStartLat()); Double wgs84 = distance.get("WGS84"); d = wgs84; continue; } if(integral.compareTo(driver1.getIntegral()) == 0 && score.compareTo(driver1.getScore()) == 0){//积分相同/评分相同对比距离 Map<String, Double> distance = GeodesyUtil.getDistance(value, order.getStartLng() + "," + order.getStartLat()); Double wgs84 = distance.get("WGS84"); if(d.compareTo(wgs84) > 0){ d = wgs84; Integer integral = null; Double score = null; Double d = null; for (TDriver driver1 : drivers) { String value = redisUtil.getValue("DRIVER" + driver1.getId()); if(ToolUtil.isEmpty(value)){ continue; } TDriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<TDriverWork>().eq("driverId", driver1.getId()).eq("status", 1)); if(null == driverWork){ continue; } if(integral == null || integral.compareTo(driver1.getIntegral()) < 0){//积分大 integral = driver1.getIntegral(); score = driver1.getScore(); driver = driver1.getId(); Map<String, Double> distance = GeodesyUtil.getDistance(value, order.getStartLng() + "," + order.getStartLat()); Double wgs84 = distance.get("WGS84"); d = wgs84; continue; } if(integral.compareTo(driver1.getIntegral()) == 0 && score.compareTo(driver1.getScore()) < 0){//积分相同对比评分 integral = driver1.getIntegral(); score = driver1.getScore(); driver = driver1.getId(); Map<String, Double> distance = GeodesyUtil.getDistance(value, order.getStartLng() + "," + order.getStartLat()); Double wgs84 = distance.get("WGS84"); d = wgs84; continue; } if(integral.compareTo(driver1.getIntegral()) == 0 && score.compareTo(driver1.getScore()) == 0){//积分相同/评分相同对比距离 Map<String, Double> distance = GeodesyUtil.getDistance(value, order.getStartLng() + "," + order.getStartLat()); Double wgs84 = distance.get("WGS84"); if(d.compareTo(wgs84) > 0){ d = wgs84; integral = driver1.getIntegral(); score = driver1.getScore(); driver = driver1.getId(); continue; } } } } } } } } if(null != driver){ pushUtil.pushGrabOrder(driver, 2, order.getId(), num4); //创建定时任务处理订单到大厅 new Timer().schedule(new TimerTask() { @Override public void run() { TOrder order1 = TOrderServiceImpl.this.selectById(order.getId()); if(order1.getState() == 101 || order1.getState() == 201){ order1.setHallOrder(1); TOrderServiceImpl.this.updateById(order1); if(null != driver){ TDriver tDriver = driverService.selectById(driver); tDriver.setServerStatus(2); driverService.updateById(tDriver); ExtraPushOrder(order1); pushUtil.pushGrabOrder(driver, 2, order.getId(), num4); //创建定时任务处理订单到大厅 new Timer().schedule(new TimerTask() { @Override public void run() { TOrder order1 = TOrderServiceImpl.this.selectById(order.getId()); if(order1.getState() == 101 || order1.getState() == 201){ tDriver.setServerStatus(1); driverService.updateById(tDriver); order1.setHallOrder(1); TOrderServiceImpl.this.updateById(order1); ExtraPushOrder(order1); } } } }, num4 * 1000); }else{ order.setHallOrder(1); this.updateById(order); ExtraPushOrder(order); }, num4 * 1000); }else{ order.setHallOrder(1); this.updateById(order); ExtraPushOrder(order); } redisUtil.unlock(); }catch (Exception e){ redisUtil.unlock(); e.printStackTrace(); } } public void ExtraPushOrder(TOrder order){ management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java
@@ -70,7 +70,6 @@ @Scheduled(cron = "0 0 0 * * *") public void taskDay(){ try { locationService.updateFence();//更新线上电子围栏 }catch (Exception e){ e.printStackTrace(); } management/guns-admin/src/main/webapp/WEB-INF/view/blackboardBlank.html
@@ -366,7 +366,7 @@ queryOrderCount() break; case "map": map("",113.264434,23.129162); map("",102.709,25.0635); break; case "order": mapOrder(""); @@ -706,6 +706,13 @@ }) /** * 定时器 */ setInterval(function () { getData(); }, 30000); function getData(){ @@ -861,7 +868,7 @@ var map = new AMap.Map('containerOrder', { viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D', zoom:10, //初始化地图层级 center: [113.264434,23.129162] //初始化地图中心点 center: [102.709,25.0635] //初始化地图中心点 }); // map.clearMap(); // 清除地图覆盖物 // 经纬度坐标数组 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHomePage/tHomePageMap.html
@@ -194,7 +194,7 @@ var map = new AMap.Map('container', { viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D', zoom:10, //初始化地图层级 center: [104.043246,30.641849] //初始化地图中心点 center: [102.709,25.0635] //初始化地图中心点 }); // map.clearMap(); // 清除地图覆盖物 // 经纬度坐标数组 management/guns-admin/src/main/webapp/WEB-INF/view/system/tOrder/tOrder.html
@@ -64,9 +64,13 @@ @if(shiro.hasPermission("/tOrder/tOrder-exception")){ <#button name="异常" icon="" clickFun="TOrder.tOrderException()"/> @} <div style="border-radius: 20px;background-color: red;color: #ffffff;width: 20px;height: 20px;text-align: center;line-height: 20px;font-size: 8px;position: absolute;left: 200px;top: -10px;">${error}</div> @if(shiro.hasPermission("/tOrder/export")){ <#button name="导出" icon="" clickFun="TOrder.export()"/> @} @if(shiro.hasPermission("/tOrder/cancelOrderUpdate")){ <#button name="关闭订单" icon="" clickFun="TOrder.cancelOrderUpdate()"/> @} </div> <#table id="TOrderTable"/> </div> management/guns-admin/src/main/webapp/static/modular/system/tDriver/tDriver.js
@@ -29,6 +29,7 @@ } }}, {title: '驾驶证号码', field: 'driverLicenseNumber', visible: true, align: 'center', valign: 'middle'}, {title: '驾龄', field: 'driverAge', visible: true, align: 'center', valign: 'middle'}, {title: '身份证号码', field: 'idcard', visible: true, align: 'center', valign: 'middle'}, {title: '身份证', field: 'source', visible: true, align: 'center', valign: 'middle', formatter: function (value, row) { management/guns-admin/src/main/webapp/static/modular/system/tOrder/tOrder.js
@@ -217,6 +217,37 @@ this.layerIndex = index; }; /** * 后台取消订单 */ TOrder.cancelOrderUpdate = function () { if (this.check()) { var selected = $('#' + this.id).bootstrapTable('getSelections'); var id = selected[0].id var state = selected[0].state console.log(id) console.log(state) if (state != 101 && state != 102 && state != 103 && state != 104 && state != 105 && state != 106 && state != 107) { Feng.error("该订单当前状态不可取消!") return; } var ajax = new $ax(Feng.ctxPath + "/tOrder/cancelOrderUpdate", function (data) { Feng.success("取消订单成功!"); TOrder.table.refresh(); }, function (data) { Feng.error("取消订单失败!" + data.responseJSON.message + "!"); }); ajax.set("tOrderId", id); ajax.start(); } }; /** * 查询列表 */