| | |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | @Autowired |
| | | private ChinaMobileUtil chinaMobileUtil; |
| | | // @Autowired |
| | | // private ChinaMobileUtil chinaMobileUtil; |
| | | |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | |
| | | @Autowired |
| | | private IAssignOrderService assignOrderService; |
| | | |
| | | @Autowired |
| | | private ALiSendSms aLiSendSms; |
| | | // @Autowired |
| | | // private ALiSendSms aLiSendSms; |
| | | |
| | | |
| | | @Value("${filePath}") |
| | |
| | | //调用移动的小号接口 |
| | | /* Map<String, String> geocode1 = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode1.get("districtCode"));*/ |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), null); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), null); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | |
| | | driver.setState(3); |
| | | driverService.updateById(driver); |
| | |
| | | } |
| | | double amount = 0; |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, orderPrivateCar.getCompanyId()); |
| | | if(null != orderPrivateCar.getDriverId() && orderPrivateCar.getArriveTime()!=null && |
| | | (orderPrivateCar.getArriveTime().getTime() + query.getMinuteNum() * 60 * 1000) < new Date().getTime()){//收费的情况 |
| | | if(null != orderPrivateCar.getDriverId() && orderPrivateCar.getSnatchOrderTime()!=null && |
| | | (orderPrivateCar.getSnatchOrderTime().getTime() + query.getMinuteNum() * 60 * 1000) < new Date().getTime()){//收费的情况 |
| | | if(null != query){ |
| | | amount += query.getMoney(); |
| | | } |
| | |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | //解除小号绑定 |
| | | if(orderPrivateCar.getBindId() != null){ |
| | | chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX()); |
| | | } |
| | | // if(orderPrivateCar.getBindId() != null){ |
| | | // chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX()); |
| | | // } |
| | | |
| | | orderPrivateCar.setState(10); |
| | | orderPrivateCar.setTelX(""); |
| | |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | map.put("balance", userInfo.getBalance()); |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | int i = userCouponRecordService.queryAvailable(uid, orderPrivateCar.getCompanyId(), 1, 1, orderPrivateCar.getOrderMoney()); |
| | | i = i + userCouponRecordService.queryAvailable(uid, orderPrivateCar.getCompanyId(), 1, 0, orderPrivateCar.getOrderMoney()); |
| | | Double orderMoney = orderPrivateCar.getOrderMoney(); |
| | | //计算折扣 |
| | | UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderPrivateCar.getCompanyId()); |
| | | if(null != query2){ |
| | | Integer orderNum=this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("userId",orderPrivateCar.getUserId()).eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())")); |
| | | if(query2.getDistance()*1000>orderPrivateCar.getMileage() && query2.getOrderNum()>orderNum){ |
| | | Double special = query2.getSpecial(); |
| | | orderPrivateCar.setDiscount(special); |
| | | double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | if(orderMoney.compareTo(v) > 0){ |
| | | orderPrivateCar.setDiscountMoney(orderMoney - v); |
| | | orderPrivateCar.setActivityId(query2.getId()); |
| | | orderMoney = v; |
| | | } |
| | | } |
| | | |
| | | } |
| | | int i = userCouponRecordService.queryAvailable(uid, orderPrivateCar.getCompanyId(), 1, 1, orderMoney); |
| | | i = i + userCouponRecordService.queryAvailable(uid, orderPrivateCar.getCompanyId(), 1, 0, orderMoney); |
| | | map.put("coupon", i); |
| | | return map; |
| | | } |
| | |
| | | @Override |
| | | public List<Map<String, Object>> queryCoupon(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | List<Map<String, Object>> list = userCouponRecordService.queryCoupon(uid, orderPrivateCar.getCompanyId(), 1, 1, orderPrivateCar.getOrderMoney(), pageNum, size); |
| | | List<Map<String, Object>> list1 = userCouponRecordService.queryCoupon(uid, orderPrivateCar.getCompanyId(), 1, 0, orderPrivateCar.getOrderMoney(), pageNum, size); |
| | | Double orderMoney = orderPrivateCar.getOrderMoney(); |
| | | //计算折扣 |
| | | UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderPrivateCar.getCompanyId()); |
| | | if(null != query2){ |
| | | Integer orderNum=this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("userId",orderPrivateCar.getUserId()).eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())")); |
| | | if(query2.getDistance()*1000>orderPrivateCar.getMileage() && query2.getOrderNum()>orderNum){ |
| | | Double special = query2.getSpecial(); |
| | | orderPrivateCar.setDiscount(special); |
| | | double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | if(orderMoney.compareTo(v) > 0){ |
| | | orderPrivateCar.setDiscountMoney(orderMoney - v); |
| | | orderPrivateCar.setActivityId(query2.getId()); |
| | | orderMoney = v; |
| | | } |
| | | } |
| | | |
| | | } |
| | | List<Map<String, Object>> list = userCouponRecordService.queryCoupon(uid, orderPrivateCar.getCompanyId(), 1, 1, orderMoney, pageNum, size); |
| | | List<Map<String, Object>> list1 = userCouponRecordService.queryCoupon(uid, orderPrivateCar.getCompanyId(), 1, 0, orderMoney, pageNum, size); |
| | | list.addAll(list1); |
| | | return list; |
| | | } |
| | |
| | | transactionDetailsService.saveData(orderPrivateCar.getUserId(), "取消订单", query.getAmount(), 2, 1, 1, 1, query.getOrderId()); |
| | | orderPrivateCar.setState(10); |
| | | //解除小号绑定 |
| | | if(orderPrivateCar.getBindId() != null){ |
| | | chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX()); |
| | | } |
| | | // if(orderPrivateCar.getBindId() != null){ |
| | | // chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX()); |
| | | // } |
| | | orderPrivateCar.setBindId(""); |
| | | orderPrivateCar.setTelX(""); |
| | | this.updateById(orderPrivateCar); |