| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.controller.general.TDriverController; |
| | | import com.stylefeng.guns.modular.system.controller.util.GetOpenBodySig; |
| | | import com.stylefeng.guns.modular.system.dao.LineShiftDriverMapper; |
| | | import com.stylefeng.guns.modular.system.dao.OrderCancelMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | |
| | | |
| | | @Resource |
| | | private MongoTemplate mongoTemplate; |
| | | @Autowired |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | model.addAttribute("tOrderCrossCityId",tOrderCrossCityId); |
| | | return PREFIX + "tOrderCrossCity_track.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取订单轨迹 |
| | | * |
| | | * @param orderDetailId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/getOrderTrack", method = RequestMethod.POST) |
| | | public ResultUtil getOrderTrack(String orderDetailId){ |
| | | if(ToolUtil.isNotEmpty(orderDetailId)){ |
| | | public ResultUtil getOrderTrack(Integer orderDetailId) { |
| | | if (ToolUtil.isNotEmpty(orderDetailId)) { |
| | | try { |
| | | Query query = new Query() |
| | | .addCriteria(Criteria.where("orderId").is(orderDetailId).and("orderType").is(3)) |
| | | .with(new Sort(Sort.Direction.ASC, "insertTime")); |
| | | List<TOrderPosition> positions = mongoTemplate.find(query, TOrderPosition.class); |
| | | resultUtil = ResultUtil.success(positions); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | resultUtil = ResultUtil.runErr(); |
| | | } |
| | | }else { |
| | | } else { |
| | | resultUtil = ResultUtil.paranErr(); |
| | | } |
| | | return resultUtil; |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tOrderCrossCityService.getCrossCityOrderList(page, beginTime, endTime, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), orderNum, orderSource, userName, userPhone, passengers, passengersPhone, serverCarModelId, driver, lineId, state)); |
| | | page.setRecords(tOrderCrossCityService.getCrossCityOrderList(page, beginTime, endTime, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), orderNum, orderSource, userName, userPhone, passengers, passengersPhone, serverCarModelId, driver, lineId, state)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | | |
| | | @Autowired |
| | | private TDriverController tDriverController; |
| | | |
| | | |
| | | /** |
| | | * 取消跨城出行订单 |
| | |
| | | @ResponseBody |
| | | public Object cancel(@RequestParam Integer tOrderCrossCityId) throws Exception { |
| | | TOrderCrossCity tOrderCrossCity = tOrderCrossCityService.selectById(tOrderCrossCityId); |
| | | ShiroUser user = ShiroExtUtil.getUser(); |
| | | |
| | | ShiroUser user = shiroExtUtil.getUser(); |
| | | |
| | | TOrderCrossCity orderCrossCity = tOrderCrossCityService.selectById(tOrderCrossCityId); |
| | | if(orderCrossCity.getState() > 5 && orderCrossCity.getState() != 11 && orderCrossCity.getState() != 7){ |
| | | if (orderCrossCity.getState() > 5 && orderCrossCity.getState() != 11 && orderCrossCity.getState() != 7) { |
| | | return ResultUtil.error("订单状态不在可取消范围内"); |
| | | } |
| | | orderCrossCity.setState(10); |
| | | tOrderCrossCityService.updateById(orderCrossCity); |
| | | |
| | | if(orderCrossCity.getDriverId() != null){ |
| | | |
| | | if (orderCrossCity.getDriverId() != null) { |
| | | //修改司机信息 |
| | | LineShiftDriver lineShiftDriver = lineShiftDriverMapper.selectById(orderCrossCity.getLineShiftDriverId()); |
| | | lineShiftDriver.setLaveSeat(lineShiftDriver.getLaveSeat() + orderCrossCity.getPeopleNumber() > lineShiftDriver.getTotalSeat() ? |
| | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | |
| | | public static ResultUtil cancleMoney(BigDecimal amount,String no) throws Exception { |
| | | JSONObject json = new JSONObject(); |
| | | json.put("requestTimestamp", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); // 报文请求时间 |
| | | // json.put("merOrderId", Util.getMerOrderId("34U0")); // 商户订单号 |
| | | json.put("merOrderId", no); // 商户订单号 |
| | | json.put("mid", "898150841210108"); // 商户号 |
| | | json.put("tid", "84UJWSE8"); // 终端号 |
| | | json.put("instMid", "QRPAYDEFAULT"); // 业务类型 |
| | | BigDecimal multiply = amount.multiply(new BigDecimal(100)); |
| | | int money = multiply.intValue(); |
| | | json.put("refundAmount",money); // 支付总金额 |
| | | System.err.println("请求报文json:\n" + json); |
| | | String url = "https://test-api-open.chinaums.com/v1/netpay/refund"; |
| | | // String url = "https://api-mop.chinaums.com/v1/netpay/refund"; |
| | | //OPEN-BODY-SIG 方式 |
| | | String result = GetOpenBodySig.sendOpenBodySig(url, json.toString()); |
| | | System.err.println("响应报文json:\n" + result); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | Object appPayRequest = jsonObject.get("appPayRequest"); |
| | | System.out.println(appPayRequest); |
| | | return ResultUtil.success(appPayRequest); |
| | | } |
| | | |
| | | @Autowired |
| | | private ITEnterpriseWithdrawalService tEnterpriseWithdrawalService; |
| | | @Autowired |
| | | private IUserWithdrawalService userWithdrawalService; |
| | | |
| | | |
| | | } |