From 1c7d3b4538dcd2ae6c0ec1ffc4a548088bb7b00b Mon Sep 17 00:00:00 2001 From: guyue <1721849008@qq.com> Date: 星期六, 26 七月 2025 09:09:01 +0800 Subject: [PATCH] 未支付订单查询接口 --- UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java | 86 ++++++++++++++++++++++++++++--------------- 1 files changed, 56 insertions(+), 30 deletions(-) diff --git a/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java b/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java index 8b6c8c1..197f3fe 100644 --- a/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java +++ b/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java @@ -18,16 +18,19 @@ import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; import com.stylefeng.guns.modular.system.dao.*; import com.stylefeng.guns.modular.system.model.*; +import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.*; import com.stylefeng.guns.modular.system.warpper.BaseWarpper; import com.stylefeng.guns.modular.system.warpper.CouponsListVo; +import com.stylefeng.guns.modular.system.warpper.DriverInfoWarpper; import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo; import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; import com.stylefeng.guns.modular.taxi.model.OrderTaxi; import com.stylefeng.guns.modular.taxi.model.PaymentRecord; import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.RedisTemplate; @@ -774,24 +777,24 @@ paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 2, orderMoney, "", 1);//添加预支付数据 } if(payType == 3){//余额支付 - if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){ + if (userInfo.getBalance() == null || userInfo.getBalance() < orderMoney) { return ResultUtil.error("余额不足,无法完成支付"); } - if(orderMoney>0) { - resultUtil = appOrderController.moneyPay(orderId, userInfo.getId(), orderMoney); - if (resultUtil.getCode() == 500) { - return ResultUtil.error("电子余额不足,无法完成支付"); - } - } +// if(orderMoney>0) { +// resultUtil = appOrderController.moneyPay(orderId, userInfo.getId(), orderMoney); +// if (resultUtil.getCode() == 500) { +// return ResultUtil.error("电子余额不足,无法完成支付"); +// } +// } userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); - + SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 - + //添加交易明细 transactionDetailsService.saveData(uid, (orderLogistics.getType() == 4 ? "同城" : "跨城") + "小件物流下单", orderMoney, 2, 1, 1, 4, orderId); userInfoService.updateById(userInfo); - + orderLogistics.setState(1);//小件物流先支付后司机抢单 orderLogistics.setPayType(3); orderLogistics.setPayMoney(orderMoney); @@ -863,24 +866,24 @@ resultUtil = payMoneyUtil.alipay("小件物流补差价", "小件物流补差价", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderLogisticsSpread"); paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 2, orderMoney, "", 1);//添加预支付数据 } - if(payType == 3){//余额支付 - if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){ + if(payType == 3) {//余额支付 + if (userInfo.getBalance() == null || userInfo.getBalance() < orderMoney) { return ResultUtil.error("余额不足,无法完成支付"); } - resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),orderMoney); - if(resultUtil.getCode()==500){ - return ResultUtil.error("电子余额不足,无法完成支付"); - } - +// resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),orderMoney); +// if(resultUtil.getCode()==500){ +// return ResultUtil.error("电子余额不足,无法完成支付"); +// } + userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); - + SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 - + //添加交易明细 transactionDetailsService.saveData(uid, (orderLogistics.getType() == 4 ? "同城" : "跨城") + "小件物流补差价", orderMoney, 2, 1, 1, 4, orderId); userInfoService.updateById(userInfo); - + orderLogistics.setState(12);//已支付差价 this.updateById(orderLogistics); @@ -1614,24 +1617,24 @@ resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee"); paymentRecordService.saveData(1, uid, 1, orderId, orderLogistics.getType(), 2, money, "", 1);//添加预支付数据 } - if(payType == 3){//余额支付 - if(userInfo.getBalance() == null || userInfo.getBalance() < money){ + if(payType == 3) {//余额支付 + if (userInfo.getBalance() == null || userInfo.getBalance() < money) { return ResultUtil.error("余额不足,无法完成支付"); } - resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),money); - if(resultUtil.getCode()==500){ - return ResultUtil.error("电子余额不足,无法完成支付"); - } - +// resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),money); +// if(resultUtil.getCode()==500){ +// return ResultUtil.error("电子余额不足,无法完成支付"); +// } + userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); - + SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分 - + //添加交易明细 transactionDetailsService.saveData(uid, (orderLogistics.getType() == 4 ? "同城小件物流-" : "跨城小件物流-") + "感谢费", money, 2, 1, 1, orderLogistics.getType(), orderId); userInfoService.updateById(userInfo); - + orderLogistics.setThankYouFee(money); this.updateById(orderLogistics); @@ -1682,4 +1685,27 @@ driverService.updateById(driver); systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : (payType==2?"支付宝":"云闪付")) + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1); } + + @Override + public List<UnPayOrderVO> getUnpayLogisticsOrders(Integer uid) { + EntityWrapper<OrderLogistics> wrapper = new EntityWrapper<>(); + wrapper.eq("userId", uid); + wrapper.eq("state", 7); + List<OrderLogistics> orderLogisticsList = this.selectList(wrapper); + List<UnPayOrderVO> unPayOrderVOList = new ArrayList<>(); + for (OrderLogistics orderLogistics:orderLogisticsList) { + + UnPayOrderVO unPayOrderVO = new UnPayOrderVO(); + //添加司机信息 + DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); + Driver driver = driverService.selectById(orderLogistics.getDriverId()); + BeanUtils.copyProperties(driver, driverInfoWarpper); unPayOrderVO.setDriverInfoWarpper(driverInfoWarpper); + //其余信息 + BeanUtils.copyProperties(orderLogistics, unPayOrderVO); + unPayOrderVOList.add(unPayOrderVO); + + } + return unPayOrderVOList; + + } } -- Gitblit v1.7.1