| | |
| | | ResultUtil resultUtil = ResultUtil.success(""); |
| | | |
| | | if(null == orderTaxi){ |
| | | return ResultUtil.error((language == 1 ? "订单信息有误" : language == 2 ? "Incorrect order information" : "Informations de commande incorrectes"), ""); |
| | | return ResultUtil.error((language == 1 ? "订单信息有误" : language == 2 ? "Order-information error" : "Erreur d’information de commande"), ""); |
| | | } |
| | | if(orderTaxi.getState() != 12){ |
| | | return ResultUtil.error((language == 1 ? "订单取消失败" : language == 2 ? "Order cancellation failure" : "Annulation de commande échouée"), ""); |
| | | return ResultUtil.error((language == 1 ? "订单取消失败" : language == 2 ? "Failed to cancel order" : "Échec de l’annulation de la commande"), ""); |
| | | } |
| | | OrderCancel orderCancel = null; |
| | | if(null == cancleId){ |
| | |
| | | } |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() != null && userInfo.getBalance() < query.getMoney()){ |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde de compte insuffisant"); |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient balance" : "Solde insuffisant"); |
| | | } |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(query.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryCoupon(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | public List<Map<String, Object>> queryCoupon(Integer language, Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | OrderTaxi orderTaxi = this.selectById(orderId); |
| | | List<Map<String, Object>> list = userCouponRecordService.queryCoupon(uid, orderTaxi.getCompanyId(), 1, 2, orderTaxi.getOrderMoney(), pageNum, size); |
| | | List<Map<String, Object>> list1 = userCouponRecordService.queryCoupon(uid, orderTaxi.getCompanyId(), 1, 0, orderTaxi.getOrderMoney(), pageNum, size); |
| | | List<Map<String, Object>> list = userCouponRecordService.queryCoupon(language, uid, orderTaxi.getCompanyId(), 1, 2, orderTaxi.getOrderMoney(), pageNum, size); |
| | | List<Map<String, Object>> list1 = userCouponRecordService.queryCoupon(language, uid, orderTaxi.getCompanyId(), 1, 0, orderTaxi.getOrderMoney(), pageNum, size); |
| | | list.addAll(list1); |
| | | return list; |
| | | } |
| | |
| | | } |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){ |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde de compte insuffisant"); |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient balance" : "Solde insuffisant"); |
| | | } |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryMyOrderList(Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | public List<Map<String, Object>> queryMyOrderList(Integer language, Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Map<String, Object>> maps = orderTaxiMapper.queryMyOrderList(uid, pageNum, size); |
| | | for(Map<String, Object> map : maps){ |
| | | if(Integer.valueOf(String.valueOf(map.get("state"))) == 11){ |
| | | map.put("state", map.get("oldState")); |
| | | } |
| | | String orderTime = map.get("orderTime").toString(); |
| | | String time = map.get("time").toString(); |
| | | map.put("orderTime", DateUtil.conversionFormat(language, orderTime)); |
| | | map.put("time", DateUtil.conversionFormat1(language, time)); |
| | | } |
| | | return maps; |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryMyTravelRecord(Integer uid) throws Exception { |
| | | return orderTaxiMapper.queryMyTravelRecord(uid); |
| | | public List<Map<String, Object>> queryMyTravelRecord(Integer language, Integer uid) throws Exception { |
| | | List<Map<String, Object>> list = orderTaxiMapper.queryMyTravelRecord(uid); |
| | | for (Map<String, Object> map : list) { |
| | | String time = map.get("time").toString(); |
| | | map.put("time", DateUtil.conversionFormat(language, time)); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryRedEnvelope(Integer uid) throws Exception { |
| | | return orderTaxiMapper.queryRedEnvelope(uid); |
| | | public List<Map<String, Object>> queryRedEnvelope(Integer language, Integer uid) throws Exception { |
| | | List<Map<String, Object>> list = orderTaxiMapper.queryRedEnvelope(uid); |
| | | for (Map<String, Object> map : list) { |
| | | String time = map.get("time").toString(); |
| | | map.put("time", DateUtil.conversionFormat(language, time)); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryInvoiceOrder(Integer type, Date startTime, Date endTime, Double startMoney, |
| | | public List<Map<String, Object>> queryInvoiceOrder(Integer language, Integer type, Date startTime, Date endTime, Double startMoney, |
| | | Double endMoney, Integer uid) throws Exception { |
| | | startTime = dateUtil.getStartOrEndDate(startTime, "start"); |
| | | endTime = dateUtil.getStartOrEndDate(endTime, "end"); |
| | | return orderTaxiMapper.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | List<Map<String, Object>> list = orderTaxiMapper.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | for (Map<String, Object> map : list) { |
| | | String time = map.get("time").toString(); |
| | | map.put("time", DateUtil.conversionFormat(language, time)); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryOrderInfo(Integer orderId) throws Exception{ |
| | | public Map<String, Object> queryOrderInfo(Integer language, Integer orderId) throws Exception{ |
| | | Map<String, Object> map = orderTaxiMapper.queryOrderInfo(orderId); |
| | | if(null != map && null != map.get("reassignNotice") && Integer.valueOf(String.valueOf(map.get("reassignNotice"))) == 2){//改派完成,重新获取了新的司机数据,开始修改数据防止继续调用 |
| | | OrderTaxi orderTaxi = this.selectById(orderId); |
| | |
| | | String driverId = redisUtil.getValue("DEVICE_" + map.get("driverId")); |
| | | map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1); |
| | | map.put("orderType", 2); |
| | | |
| | | String insertTime = map.get("insertTime").toString(); |
| | | map.put("insertTime", DateUtil.conversionFormat(language, insertTime)); |
| | | String travelTime = map.get("travelTime").toString(); |
| | | map.put("travelTime", DateUtil.conversionFormat1(language, travelTime)); |
| | | String arriveTime = map.get("arriveTime").toString(); |
| | | map.put("arriveTime", DateUtil.conversionFormat(language, arriveTime)); |
| | | return map; |
| | | } |
| | | |