| | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.GpsCoordinateUtils; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LinePriceMapper; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LineShiftDriverMapper; |
| | |
| | | import org.springframework.transaction.annotation.Isolation; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | |
| | | import static com.stylefeng.guns.modular.taxi.service.impl.OrderTaxiServiceImpl.orderIds; |
| | |
| | | if(null == query){ |
| | | return ResultUtil.error("订单还未进行支付"); |
| | | } |
| | | // Map<String, Object> merrefund = icbcPayUtil.merrefund(query.getCode(), "", query.getAmount(), id + "_3", orderCrossCity.getOrderNum()); |
| | | // if(Integer.valueOf(merrefund.get("code").toString()) == 0){ |
| | | // Map<String, Object> refundqry = icbcPayUtil.refundqry("", query.getCode(), orderCrossCity.getOrderNum()); |
| | | // if(Integer.valueOf(refundqry.get("code").toString()) == 0 && Integer.valueOf(refundqry.get("pay_status").toString()) == 0){//成功 |
| | | // //添加交易明细 |
| | | // transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城订单取消退款", query.getAmount(), 1, 1, 1, 3, id); |
| | | // } |
| | | // if(Integer.valueOf(refundqry.get("code").toString()) == 0 && Integer.valueOf(refundqry.get("pay_status").toString()) == 1){//失败 |
| | | // return ResultUtil.error("订单取消失败(退款不成功)"); |
| | | // } |
| | | // if(Integer.valueOf(refundqry.get("code").toString()) == 0 && Integer.valueOf(refundqry.get("pay_status").toString()) == 2){//未知 |
| | | // return ResultUtil.error("退款返回未知异常"); |
| | | // } |
| | | // } |
| | | Map<String, String> merrefund = payMoneyUtil.wxRefund(query.getCode(), orderCrossCity.getOrderNum(), String.valueOf(query.getAmount()), String.valueOf(query.getAmount()), ""); |
| | | System.err.println("跨城退款数据:::"+merrefund); |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城订单取消退款", query.getAmount(), 1, 1, 1, 3, id); |
| | | integer = orderCancelService.saveData(id, 3, reason, remark, null, null, 2, 1, uid); |
| | | } |
| | | |
| | |
| | | orderServerWarpper.setState(orderCrossCity.getState()); |
| | | orderServerWarpper.setLon(null != value ? value.split(",")[0] : "0.0"); |
| | | orderServerWarpper.setLat(null != value ? value.split(",")[1] : "0.0"); |
| | | value = value == null ? "0.0,0.0" : value; |
| | | double[] doubles = GpsCoordinateUtils.calBD09toGCJ02(Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0])); |
| | | orderServerWarpper.setNextLongitude(String.valueOf(doubles[0])); |
| | | orderServerWarpper.setNextLatitude(String.valueOf(doubles[1])); |
| | | // 起点地址转换 |
| | | doubles = GpsCoordinateUtils.calBD09toGCJ02(orderCrossCity.getStartLat(), orderCrossCity.getStartLon()); |
| | | orderServerWarpper.setStartLat(String.valueOf(doubles[0])); |
| | | orderServerWarpper.setStartLon(String.valueOf(doubles[1])); |
| | | // 终点地址转换 |
| | | doubles = GpsCoordinateUtils.calBD09toGCJ02(orderCrossCity.getEndLat(), orderCrossCity.getEndLon()); |
| | | orderServerWarpper.setEndLat(String.valueOf(doubles[0])); |
| | | orderServerWarpper.setEndLon(String.valueOf(doubles[1])); |
| | | orderServerWarpper.setReassignNotice(orderCrossCity.getReassignNotice()); |
| | | if(orderCrossCity.getState() == 2 || orderCrossCity.getState() == 3){//前往预约地 |
| | | orderServerWarpper.setReservationMileage(d); |
| | |
| | | return orderCrossCityMapper.queryListOrder(driverId, lineShiftId, state, day); |
| | | } |
| | | |
| | | @Override |
| | | public void autoCancelOrder() { |
| | | LocalDateTime localDateTime = LocalDateTime.now(); |
| | | LocalDateTime dateTime = localDateTime.minusMinutes(30); |
| | | String time = dateUtil.localDateTimeToStringHHmm(dateTime); |
| | | List<OrderCrossCity> orderCrossCities = this.selectList(new EntityWrapper<OrderCrossCity>().eq("state", 7).like("insertTime", time)); |
| | | if(!CollectionUtils.isEmpty(orderCrossCities)){ |
| | | for (OrderCrossCity orderCrossCity : orderCrossCities) { |
| | | orderCrossCity.setState(10); |
| | | } |
| | | this.updateBatchById(orderCrossCities); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取订单编号 |
| | | * @return |