| | |
| | | if(orderLogistics.getState() == 1){ |
| | | this.pushOrder(orderLogistics); |
| | | }else{ |
| | | //接单后定时任务判断司机是否去接乘客,没有则推送提醒 |
| | | CancleOrder cancleOrder = cancleOrderService.query(orderLogistics.getCompanyId()); |
| | | if(null != cancleOrder){ |
| | | JSONObject object = JSON.parseObject(cancleOrder.getContent()); |
| | | long time = object.getInteger("driverTimeout") * 60000L; |
| | | new Timer().schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | OrderLogistics orderLogistics1 = OrderLogisticsServiceImpl.this.selectById(orderLogistics.getId()); |
| | | if(orderLogistics1.getState() == 2){ |
| | | pushUtil.pushDriverTimeOut(1, orderLogistics1.getUserId(), orderLogistics1.getId(), 4); |
| | | } |
| | | } |
| | | }, time); |
| | | } |
| | | // //接单后定时任务判断司机是否去接乘客,没有则推送提醒 |
| | | // CancleOrder cancleOrder = cancleOrderService.query(orderLogistics.getCompanyId()); |
| | | // if(null != cancleOrder){ |
| | | // JSONObject object = JSON.parseObject(cancleOrder.getContent()); |
| | | // long time = object.getInteger("driverTimeout") * 60000L; |
| | | // new Timer().schedule(new TimerTask() { |
| | | // @Override |
| | | // public void run() { |
| | | // OrderLogistics orderLogistics1 = OrderLogisticsServiceImpl.this.selectById(orderLogistics.getId()); |
| | | // if(orderLogistics1.getState() == 2){ |
| | | // pushUtil.pushDriverTimeOut(1, orderLogistics1.getUserId(), orderLogistics1.getId(), 4); |
| | | // } |
| | | // } |
| | | // }, time); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | orderLogistics.setGetoffAddress(address); |
| | | orderLogistics.setGetoffTime(new Date()); |
| | | orderLogistics.setEndServiceTime(new Date()); |
| | | orderLogistics.setCancelMidway(1); |
| | | }else{ |
| | | orderLogistics.setState(10); |
| | | } |
| | |
| | | orderLogistics.setGetoffAddress(address); |
| | | orderLogistics.setGetoffTime(new Date()); |
| | | orderLogistics.setEndServiceTime(new Date()); |
| | | orderLogistics.setCancelMidway(1); |
| | | } |
| | | orderLogistics.setOldState(orderLogistics.getState()); |
| | | orderLogistics.setState(12); |
| | |
| | | if(state == 11){ |
| | | map.put("state", map.get("oldState")); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("state"))) != 8 && Integer.valueOf(String.valueOf(map.get("state"))) != 9){ |
| | | map.put("redPacketMoney", null); |
| | | map.put("couponMoney", null); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("state"))) == 7){ |
| | | UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(Integer.valueOf(String.valueOf(map.get("companyId")))); |
| | | if(null != query2){ |
| | | Integer orderNum=this.selectCount(new EntityWrapper<OrderLogistics>().eq("userId",orderLogistics.getUserId()).eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())")); |
| | | if(query2.getDistance()*1000>orderLogistics.getMileage() && query2.getOrderNum()>orderNum){ |
| | | Double special = query2.getSpecial(); |
| | | orderLogistics.setDiscount(special); |
| | | Double orderMoney = orderLogistics.getOrderMoney(); |
| | | double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | if(orderMoney.compareTo(v) > 0){ |
| | | map.put("discountMoney",orderMoney - v); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(map.get("startLon").toString(), map.get("startLat").toString()); |
| | | map.put("startCity", geocode.get("city")); |
| | | geocode = gdMapGeocodingUtil.geocode(map.get("endLon").toString(), map.get("endLat").toString()); |