| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.RequestSeqUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.controller.AppOrderController; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LinePriceMapper; |
| | |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper; |
| | | import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil; |
| | | import com.stylefeng.guns.modular.huifu.biz.DouGongRefundBiz; |
| | | import com.stylefeng.guns.modular.huifu.biz.DouGongWithdrawBiz; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | |
| | | |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | |
| | | @Autowired |
| | | private DouGongRefundBiz douGongRefundBiz; |
| | | |
| | | |
| | | @Value("${callbackPath}") |
| | |
| | | |
| | | if(query.getPayType() == 1){//微信 |
| | | |
| | | Map<String, String> map = payMoneyUtil.wxRefund(query.getCode(), id + "_3", query.getAmount().toString(), query.getAmount().toString(), "/base/cancleOrderWXPay"); |
| | | if(!"SUCCESS".equals(map.get("return_code"))){ |
| | | return ResultUtil.error(map.get("return_msg")); |
| | | //Map<String, String> map = payMoneyUtil.wxRefund(query.getCode(), id + "_3", query.getAmount().toString(), query.getAmount().toString(), "/base/cancleOrderWXPay"); |
| | | //if(!"SUCCESS".equals(map.get("return_code"))){ |
| | | // return ResultUtil.error(map.get("return_msg")); |
| | | //} |
| | | String refundReqSeqId = RequestSeqUtil.generate("TK"); |
| | | Map<String, Object> refund = douGongRefundBiz.refund(refundReqSeqId, BigDecimal.valueOf(query.getAmount()), com.stylefeng.guns.core.util.DateUtil.format(query.getInsertTime(), "yyyyMMdd"), orderCrossCity.getOutTradeNo(), 2); |
| | | orderCrossCity.setRefundReqSeqId(refundReqSeqId); |
| | | if ("00000000".equals(refund.get("resp_code")) && "S".equals(refund.get("trans_stat"))) { |
| | | orderCrossCity.setState(10); |
| | | }else if (!"00000000".equals(refund.get("resp_code"))) { |
| | | return ResultUtil.error("订单取消失败:" + refund.get("resp_desc").toString()); |
| | | } |
| | | }else if(query.getPayType()==4){ // 云闪付 |
| | | orderCrossCityMapper.updateById(orderCrossCity); |
| | | }/*else if(query.getPayType()==4){ // 云闪付 |
| | | // TODO 退款 |
| | | UserInfo userInfo = userInfoService.selectById(orderCrossCity.getUserId()); |
| | | userInfo.setBalance(userInfo.getBalance() + orderCrossCity.getPayMoney()); |
| | |
| | | }else { |
| | | appOrderController.createAllocationReqUser(1, orderCrossCity.getUserId(), 1,orderCrossCity.getPayMoney()); |
| | | } |
| | | }else{//支付宝 |
| | | Map<String, String> map = payMoneyUtil.aliRefund(query.getCode(), query.getAmount().toString()); |
| | | if(!"10000".equals(map.get("code"))){ |
| | | return ResultUtil.error(map.get("msg")); |
| | | }*/else{//支付宝 |
| | | //Map<String, String> map = payMoneyUtil.aliRefund(query.getCode(), query.getAmount().toString()); |
| | | //if(!"10000".equals(map.get("code"))){ |
| | | // return ResultUtil.error(map.get("msg")); |
| | | //} |
| | | String refundReqSeqId = RequestSeqUtil.generate("TK"); |
| | | Map<String, Object> refund = douGongRefundBiz.refund(refundReqSeqId, BigDecimal.valueOf(query.getAmount()), com.stylefeng.guns.core.util.DateUtil.format(query.getInsertTime(), "yyyyMMdd"), orderCrossCity.getOutTradeNo(), 2); |
| | | orderCrossCity.setRefundReqSeqId(refundReqSeqId); |
| | | if ("00000000".equals(refund.get("resp_code")) && "S".equals(refund.get("trans_stat"))) { |
| | | orderCrossCity.setState(10); |
| | | }else if (!"00000000".equals(refund.get("resp_code"))) { |
| | | return ResultUtil.error("订单取消失败:" + refund.get("resp_desc").toString()); |
| | | } |
| | | orderCrossCityMapper.updateById(orderCrossCity); |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城出行取消退款", query.getAmount(), 1, 1, 1, 3, id); |
| | | } |