Compare commits
2 Commits
51b0c0bb21
...
227a591da7
| Author | SHA1 | Date |
|---|---|---|
|
|
227a591da7 | |
|
|
46557a9a19 |
|
|
@ -76,10 +76,10 @@ public class SM4EncryptUtils {
|
|||
// System.out.println(sm4Encrypt("13866134935"));
|
||||
// System.out.println(sm4Decrypt("29G1AUHDmLvPe1tt0t12Dw==##encrypted"));
|
||||
|
||||
String src = decryptBySm4("eNAwpvN8VcbRXal9POGGV5X5y4Pa9oPNn8ewmFkmn9q/EQavDKPbUSpHRc9iI8Yu\n",
|
||||
String src = decryptBySm4("pr2IC0qcQR8qdVvkdVdyT/zx+NaKimm76M9FRfkop5+U/B2Crl8/Rq5VIHJACwfX",
|
||||
Base64Decoder.decode("StqtdHhleMKClUGbmBqdrg=="));
|
||||
System.out.println(src);
|
||||
String src1 = decryptBySm4("Bkv90NIOHy70kV/ex7l6gaNx7Ir+L61MXjuTr55tXpRZtOOX8XKXqMqBAjBbGLLTlEBycUwDSHAq0Ndu6cEIOyqGLK5ClvqZjWiL/iwPnQ+IEEqA6uV4rWzFtNa9NanlpIo6kzNCXzxiQgFOxgHmI+8Sw8cAyzN7bKZ2dryLQLUD+B68YHwGnGKYuQObIebCPj/wIO1UhoTp9WZqLHog+JTF72cG4nd45JV1xsCbeV8zljplgDlzogWXwhyZHiaphu2O7Si2yfz9/7sIZNyHSF+3SW1OuBgobS5Ia3oxCsKQP+PeJt3P/iPULVJiJDssGVIdFUg9sLkkP6DluszK2T5BMInEutLwqtwwopX97uFLhisKr1LqTKODbnbMWPvJ5hL4GivwWNJVKvBqoYjN7UhupWcTvTAUsd4P0B9rECRB0zut2M2VbkmyQmZsgxoiU5mYoEaoxYunkShHeFZEv6aMpACa9M++7eOk6IAs4b4TUbTV75omnpa7H2g6mR+RKCN0oLhDmJ2LHmsJx/0nZsBmKiKZOTPpGJYJPmxVLT9SZPor2Bj7mO/KK5Hbzklbqn4Lv9l6nx3Xmrjs+LGighfMCBQQyPK2gwJDZapnhphkbTeFY50V60XVdvOZIPCiDzqAm/CkF7NuVSUSy0M24Kd9kYl3Sx+b4v3qTmT0zgaFHiHmkrooz/r1T5pLi3U5/OFAs0gTtYw+KH+hYlFJiAtNm47mBYBCECPfAlB0o1qdluMRDV5L/jv3Pa6hVUgUWhvxnhkX9lEcZgoirqRX6dTYFxYIC/oanmG+CYUnsc7vclvMwzIiDLDt1G6/U0a/hxwIo+kyYvH0EkaFPuT7/9t/hFOjAKfPRUpSzTP+2R6X92meYSMLsUodjW+YaiLre13mMyJ9XUhEnwXn1LxZS8w6L1HIa20UwQ+D6kSWgVp4BpSsAbATKXD5pe650Ky46RIhyEn9cIe0uTOjyoGeQG35so0ChJQE1aCUbipR6wm1THMl8ZqFBkPBQrj+TxvmweNMh99zzqiOeuUPdK4YSthCEzXR7Quby0IxN0pnTIs0Z+FCVdp6pEWoQaRhwIrXZ+bVjRH9XAD7lZbG7Ns2ZfNxah+iIOFdFA4xR/wEXF+31HUXAp+yZqZ61g7lBfhOO7wxyeqUAKlI897G8VpgU2APlwBfTVMTMFwx4HAA9basU6mZcS5UdP8MPJf3ChX25SbYVM3mJvZhdLyD4PoXhuRSQxp3JVgRwlKHEfwSqloGC1fm4WF53fdtHJGl4IIaBeMpoXNWddRe/YTRvi5ljl5Wrhidvu7xkDMXe8WyRQFEsRCR9vbv1z41guFb9bWCh5xbDdy9hQ2dV5J0j2JJnd+LmKf6Fv03Xz8kXxPkpONMVLSk1414P2gdavTgVBFqKKZORdhCCJXPgNy9dZ6ceL/SHG3rgoo8fz/BLhIvtW3OP3Kk+K1hTiKpFnZSc2iKXYRpK2nFikvN/glEgO8xeMtW/Zw3Uz3RhhP0Coqqne4yeNUnBSQLDPkNzoApj2fb983OERVfzs/dcnipJcLhgXFfvbg6vZwHg03EUQ5LALJmjCnJKG0Ubtxe0WPrnFuKafGv8A0RJ4m2kjaMm3M7VEnkNMUpX15RZt6Tm3KWMYejvMMfrTb+hBqFRYhDQ7gK8p2PgK+CuKfAFLWXva3TRI8R09EPqj49kQDHBSMpNgAVRf+3xByImQBufYr37z18ZkEb3ObhWHmc3krdgjJOVmu0sSUz/orEtaxh6CgJh36BQy4tg4Zs2SncFxTTDht84kH1+UJkl3BptHEZvo7pyRVmmCoRgHXSoB+fgNj0spgt/rWkId5KtuLf4L497qoGGMv24G7dElFJq4nrQmn12c76DvELpzKveNffMX/PDCVCqF2NuVH5scEMRt/RjikICzMkh/93L6QhuP/KuBYlisxNWAg3kTp7JE4gS8hoFN6YxMRNPVMAX3zY0DDr6Z4rbObCcnIrHpQGwcofPbpIhJsPxIn7Slig7SFWR9EBfiW5F7TxrF4WVYMowcWKsBJPcn6BHcjljdQ5KFtMFjt6suJxOEjcXl/8CQewd8jZ9uEyzyE6q+sWB4t7rxt7xVOswrLBXZncXdZVi3/a4HvJ46y8ev7I6IBVcvfSEAXQyt0Jny2M5lTlBUOHPmDzU18nYPSkSQmDlbk01XfjOwk0gYgSaCaBpADFYXviw3+8FdKHz46ijLt82X3gzxQDFbEa4iBDFy+z6COprPOuHNviqirh3NGyyGDyohgAaWyGNERxhtxY5WBq21B5ULXRFoRks1ai24NKcDU3EaeorD1hrabdbQ674Mx64y6siaDv2k7wfK7B8nEbnJoVoB1Nvd/9NmCT6sW+HHoqTQGX0pyV7TJYkvK2orUcfGXd/3GQ8G2xTLKrS6TZkPGtZnk+bumWjS1XVSLILFaEc1278p7Uu+lPrnLl/6gdJRO744IUFKfHzdpNAcXcQIhg/YBEKGVy/fNa0VrrFinsmZ/aan+ZropwYqx1YOoeNwzYBSogKP3rdHLO38xcCpqxMtfTDwFdvxBEiMyjRel4HETzo2H1PAmv20ZhoFCCc7Gha/mMUgCnMiuR7EbKPj9tihE7mMPZn00hbZ+5wubdqS6A7AAOUKp2Ns3sDZC/qDm7F4aYZThYWH8mx7oWPngwM9omVLsvy/04IUH8LuJZeGp5H2Bc/MqNMAV34hDa6scIiW5iQn4=",
|
||||
String src1 = decryptBySm4("pqiIyu7z2qPvINrf73938NyUAqooHQl3cm3gyZtdgY1+t/1HnHININ0DEO35gmnvu1XHp00JQGTkCpYAWqO6XFIUAR/TbHSKBamffOQ0VtE2a3sgYlVs21gC19B/wKKB1xd3x1jIt8svXYd4SWOlAW1gnVSSgvXxa5nqoTZeH1sARkx46xV4U/g+sJ1yi8snW9pNey1fUORzl4VD7D+ojSRuhQYUUfUDXlYX5zQMJCX+MmzzNv/OMq5+mBpgsn2P",
|
||||
Base64Decoder.decode(src));
|
||||
System.out.println(src1);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
package com.bonus.canteen.core.allocation.api;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bonus.canteen.core.common.enums.AllocBusinessStateEnum;
|
||||
import com.bonus.canteen.core.order.utils.LeNumUtil;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.houqin.constant.LeConstants;
|
||||
import com.bonus.canteen.core.allocation.canteen.model.AllocCanteen;
|
||||
import com.bonus.canteen.core.allocation.canteen.model.AllocMealLine;
|
||||
|
|
@ -11,12 +15,14 @@ import com.bonus.canteen.core.allocation.canteen.service.AllocCanteenService;
|
|||
import com.bonus.canteen.core.allocation.canteen.service.AllocMealLineService;
|
||||
import com.bonus.canteen.core.allocation.canteen.vo.AllocAreaFullNameVO;
|
||||
import com.bonus.canteen.core.menu.vo.AppletReserveCanteenVO;
|
||||
import com.bonus.common.houqin.i18n.I18n;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -78,30 +84,30 @@ public class AllocCanteenApi {
|
|||
public AllocCanteen getAllocCanteen(Long canteenId) {
|
||||
return this.allocCanteenService.getAllocCanteenCache(canteenId);
|
||||
}
|
||||
//
|
||||
// public void checkCanteenBusinessState(Long canteenId, LocalTime checkTime) {
|
||||
// if (!LeNumUtil.isValidId(canteenId)) {
|
||||
// log.warn("食堂id不合法,无法校验营业状态");
|
||||
// } else {
|
||||
// AllocCanteen allocCanteen = this.getAllocCanteen(canteenId);
|
||||
// if (!LeConstants.COMMON_YES.equals(allocCanteen.getIfDel()) && AllocBusinessStateEnum.OPEN.getKey().equals(allocCanteen.getBusinessState())) {
|
||||
// if (!ObjectUtil.isNull(checkTime)) {
|
||||
// if (!ObjectUtil.isNull(allocCanteen.getStartBusinessTime()) && !ObjectUtil.isNull(allocCanteen.getEndBusinessTime())) {
|
||||
// if (allocCanteen.getStartBusinessTime().isAfter(allocCanteen.getEndBusinessTime())) {
|
||||
// if (checkTime.isBefore(allocCanteen.getStartBusinessTime()) && checkTime.isAfter(allocCanteen.getEndBusinessTime())) {
|
||||
// throw new LeException(I18n.getMessage("alloc_canteen_is_rest", new Object[]{allocCanteen.getCanteenName()}));
|
||||
// }
|
||||
// } else if (checkTime.isBefore(allocCanteen.getStartBusinessTime()) || checkTime.isAfter(allocCanteen.getEndBusinessTime())) {
|
||||
// throw new LeException(I18n.getMessage("alloc_canteen_is_rest", new Object[]{allocCanteen.getCanteenName()}));
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// throw new LeException(I18n.getMessage("alloc_canteen_is_rest", new Object[]{allocCanteen.getCanteenName()}));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
public void checkCanteenBusinessState(Long canteenId, LocalTime checkTime) {
|
||||
if (!LeNumUtil.isValidId(canteenId)) {
|
||||
log.warn("食堂id不合法,无法校验营业状态");
|
||||
} else {
|
||||
AllocCanteen allocCanteen = this.getAllocCanteen(canteenId);
|
||||
if (!LeConstants.COMMON_YES.equals(allocCanteen.getIfDel()) && AllocBusinessStateEnum.OPEN.getKey().equals(allocCanteen.getBusinessState())) {
|
||||
if (!ObjectUtil.isNull(checkTime)) {
|
||||
if (!ObjectUtil.isNull(allocCanteen.getStartBusinessTime()) && !ObjectUtil.isNull(allocCanteen.getEndBusinessTime())) {
|
||||
if (allocCanteen.getStartBusinessTime().isAfter(allocCanteen.getEndBusinessTime())) {
|
||||
if (checkTime.isBefore(allocCanteen.getStartBusinessTime()) && checkTime.isAfter(allocCanteen.getEndBusinessTime())) {
|
||||
throw new ServiceException(I18n.getMessage("alloc_canteen_is_rest", allocCanteen.getCanteenName()));
|
||||
}
|
||||
} else if (checkTime.isBefore(allocCanteen.getStartBusinessTime()) || checkTime.isAfter(allocCanteen.getEndBusinessTime())) {
|
||||
throw new ServiceException(I18n.getMessage("alloc_canteen_is_rest", allocCanteen.getCanteenName()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new ServiceException(I18n.getMessage("alloc_canteen_is_rest", allocCanteen.getCanteenName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// public AllocStall getAllocStall(Long stallId) {
|
||||
// return this.allocStallService.getAllocStallCache(stallId);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
package com.bonus.canteen.core.common.constant;
|
||||
|
||||
public interface OrderConstant {
|
||||
Integer DEFAULT_APPLET_BOOK_TIME_LIMIT = 24;
|
||||
Integer DEFAULT_APPLET_BOOK_DAY_LIMIT = 7;
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ import com.bonus.canteen.core.order.common.vo.OrderRefundResultVO;
|
|||
import java.util.List;
|
||||
|
||||
public interface OrderRefundBusiness {
|
||||
// void orderCancel(OrderInfo orderInfo);
|
||||
void orderCancel(OrderInfo orderInfo);
|
||||
|
||||
OrderRefundResultVO orderRefund(OrderRefundParam refundParam, OrderRefundBizEnum biz);
|
||||
|
||||
|
|
|
|||
|
|
@ -134,20 +134,20 @@ public class OrderRefundBusinessImpl implements OrderRefundBusiness {
|
|||
@Lazy
|
||||
protected AllocHolidayApi allocHolidayApi;
|
||||
|
||||
// public void orderCancel(OrderInfo orderInfo) {
|
||||
// if (!this.orderCustomBusiness.refund().willCancelOrder(orderInfo)) {
|
||||
// this.orderCustomBusiness.refund().didCancelOrder(orderInfo);
|
||||
// } else {
|
||||
// orderInfo.setOrderState(OrderStateEnum.CANCEL.getKey());
|
||||
// orderInfo.setPayState(PayStateEnum.PAY_CLOSE.getKey());
|
||||
// this.orderInfoService.updateOrderState(orderInfo.getOrderId(), orderInfo.getOrderDate(), orderInfo.getPayState(), orderInfo.getOrderState(), (Integer)null, (String)null);
|
||||
// List<OrderDetail> orderDetailList = this.orderDetailService.getOrderDetailList(orderInfo.getOrderId(), orderInfo.getOrderDate());
|
||||
// this.marketApi.disableMarketRecord(CollUtil.toList(new Long[]{orderInfo.getOrderId()}));
|
||||
// this.orderPlaceBusiness.inventoryRestore(orderInfo, orderDetailList);
|
||||
// OrderMessageSend.orderV3Canceled(orderInfo, orderDetailList);
|
||||
// this.orderCustomBusiness.refund().didCancelOrder(orderInfo);
|
||||
// }
|
||||
// }
|
||||
public void orderCancel(OrderInfo orderInfo) {
|
||||
if (!this.orderCustomBusiness.refund().willCancelOrder(orderInfo)) {
|
||||
this.orderCustomBusiness.refund().didCancelOrder(orderInfo);
|
||||
} else {
|
||||
orderInfo.setOrderState(OrderStateEnum.CANCEL.getKey());
|
||||
orderInfo.setPayState(PayStateEnum.PAY_CLOSE.getKey());
|
||||
this.orderInfoService.updateOrderState(orderInfo.getOrderId(), orderInfo.getOrderDate(), orderInfo.getPayState(), orderInfo.getOrderState(), (Integer)null, (String)null);
|
||||
List<OrderDetail> orderDetailList = this.orderDetailService.getOrderDetailList(orderInfo.getOrderId(), orderInfo.getOrderDate());
|
||||
this.marketApi.disableMarketRecord(CollUtil.toList(new Long[]{orderInfo.getOrderId()}));
|
||||
this.orderPlaceBusiness.inventoryRestore(orderInfo, orderDetailList);
|
||||
OrderMessageSend.orderV3Canceled(orderInfo, orderDetailList);
|
||||
this.orderCustomBusiness.refund().didCancelOrder(orderInfo);
|
||||
}
|
||||
}
|
||||
|
||||
public OrderRefundResultVO orderRefund(OrderRefundParam refundParam, OrderRefundBizEnum biz) {
|
||||
LogUtil.info("[订单退款]入参:", refundParam, biz);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.canteen.core.order.mobile.business;
|
|||
|
||||
|
||||
import com.bonus.canteen.core.order.common.dto.RequestHeaderDTO;
|
||||
import com.bonus.canteen.core.order.mobile.dto.OrderPayMobileDTO;
|
||||
import com.bonus.canteen.core.order.mobile.dto.OrderReserveMealTotalDTO;
|
||||
import com.bonus.canteen.core.order.mobile.vo.OrderPayMobileVO;
|
||||
|
||||
|
|
@ -15,8 +16,8 @@ public interface OrderPlaceMobileBusiness {
|
|||
// OrderPayMobileVO addShopMealOrder(RequestHeaderDTO headerDTO, OrderShopDTO orderShopDTO);
|
||||
//
|
||||
// OrderPayMobileVO addSacnOrder(RequestHeaderDTO headerDTO, OrderMobileScanDTO scanDTO);
|
||||
//
|
||||
// OrderPayMobileVO orderPayByOrderId(RequestHeaderDTO headerDTO, OrderPayMobileDTO orderPayDTO);
|
||||
|
||||
OrderPayMobileVO orderPayByOrderId(RequestHeaderDTO headerDTO, OrderPayMobileDTO orderPayDTO);
|
||||
//
|
||||
// OrderPayMobileVO orderMixPayByTradeId(RequestHeaderDTO headerDTO, OrderMixPayMobileDTO orderMixPayMobileDTO);
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,8 +1,14 @@
|
|||
package com.bonus.canteen.core.order.mobile.business.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.canteen.core.common.constant.OrderConstant;
|
||||
import com.bonus.canteen.core.order.common.constants.*;
|
||||
import com.bonus.canteen.core.order.common.service.OrderAmountChangeService;
|
||||
import com.bonus.canteen.core.order.common.service.OrderDeliveryService;
|
||||
import com.bonus.canteen.core.order.common.service.OrderDetailService;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.houqin.constant.LeConstants;
|
||||
import com.bonus.common.houqin.constant.RetCodeEnum;
|
||||
|
|
@ -26,9 +32,6 @@ import com.bonus.canteen.core.order.client.po.MetaDataValueParam;
|
|||
import com.bonus.canteen.core.order.client.po.OrderConfigQueryParam;
|
||||
import com.bonus.canteen.core.order.common.business.OrderPlaceBusiness;
|
||||
import com.bonus.canteen.core.order.common.business.OrderResultBusiness;
|
||||
import com.bonus.canteen.core.order.common.constants.ChangeDetailTypeEnum;
|
||||
import com.bonus.canteen.core.order.common.constants.OrderCacheConstants;
|
||||
import com.bonus.canteen.core.order.common.constants.OrderTips;
|
||||
import com.bonus.canteen.core.order.common.dto.OrderDetailPayDTO;
|
||||
import com.bonus.canteen.core.order.common.dto.RequestHeaderDTO;
|
||||
import com.bonus.canteen.core.order.common.model.OrderAmountChange;
|
||||
|
|
@ -94,15 +97,15 @@ public class OrderPlaceMobileBusinessImplV3 implements OrderPlaceMobileBusiness
|
|||
@Autowired
|
||||
@Lazy
|
||||
protected OrderInfoService orderInfoService;
|
||||
// @Autowired
|
||||
// @Lazy
|
||||
// protected OrderDetailService orderDetailService;
|
||||
// @Autowired
|
||||
// @Lazy
|
||||
// protected OrderAmountChangeService orderAmountChangeService;
|
||||
// @Autowired
|
||||
// @Lazy
|
||||
// protected OrderDeliveryService orderDeliveryService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
protected OrderDetailService orderDetailService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
protected OrderAmountChangeService orderAmountChangeService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
protected OrderDeliveryService orderDeliveryService;
|
||||
// @Autowired
|
||||
// @Lazy
|
||||
// protected OrderPreBookService orderPreBookService;
|
||||
|
|
@ -295,38 +298,40 @@ public class OrderPlaceMobileBusinessImplV3 implements OrderPlaceMobileBusiness
|
|||
// orderSavePO.setAmountChangeList(amountChangeList);
|
||||
// return LeConstants.COMMON_YES.equals(orderShopDTO.getIfTrial()) ? this.trialPay(orderSavePO, (OrderDeliveryResultVO)null) : this.saveAndPay(orderSavePO, true, false);
|
||||
// }
|
||||
//
|
||||
// public OrderPayMobileVO orderPayByOrderId(RequestHeaderDTO headerDTO, OrderPayMobileDTO orderPayDTO) {
|
||||
// LogUtil.info("订单支付|入参", orderPayDTO);
|
||||
// JavaxValidateUtils.validate(orderPayDTO);
|
||||
// if (!LeConstants.COMMON_YES.equals(orderPayDTO.getIfTrial())) {
|
||||
// this.checkOrderRepeated(headerDTO.getOpenid(), (Long)null);
|
||||
// }
|
||||
//
|
||||
// OrderInfo orderInfo = this.orderInfoService.checkAndGetOrderInfo(orderPayDTO.getOrderId());
|
||||
// OrderSavePO orderSavePO = OrderSavePO.byOrderInfo(CollUtil.toList(new OrderInfo[]{orderInfo}), this.orderDetailService.getOrderDetailList(orderInfo.getOrderId(), orderInfo.getOrderDate()), this.orderDeliveryService.listOrderDeliveryByOrderIds(CollUtil.toList(new Long[]{orderInfo.getOrderId()}), CollUtil.toList(new LocalDate[]{orderInfo.getOrderDate()})));
|
||||
// CustPayVO custInfo = this.getCustInfo(orderInfo.getCustId(), headerDTO.getSourceType());
|
||||
// this.orderPayForIdCheck(CollUtil.toList(new OrderInfo[]{orderInfo}), orderSavePO.getOrderDetailList(), orderSavePO.getOrderDeliveryList());
|
||||
// if (LeConstants.COMMON_NO.equals(orderPayDTO.getIfTrial())) {
|
||||
// this.orderPlaceBusiness.orderHandlerLock(orderSavePO.getMacOrderId(), OrderCacheConstants.MOBILE_PAY_INTERVAL);
|
||||
// }
|
||||
//
|
||||
// orderSavePO.setPayDTO(this.createPay(orderPayDTO.getPayType(), orderPayDTO.getCouponId(), headerDTO.getSourceType(), orderInfo.getCanteenId(), orderInfo.getStallId(), headerDTO.getOpenid(), custInfo, orderPayDTO));
|
||||
// this.updateOrderField(CollUtil.toList(new OrderInfo[]{orderInfo}), orderSavePO.getPayDTO());
|
||||
// orderSavePO.getPayDTO().setAmount(orderInfo.calcNeedPayAmount());
|
||||
// List<OrderAmountChange> amountChangeList = (List)this.orderAmountChangeService.listByOrderIds(CollUtil.toList(new Long[]{orderInfo.getOrderId()}), CollUtil.toList(new LocalDate[]{orderInfo.getOrderDate()})).stream().filter((s) -> {
|
||||
// return !ChangeDetailTypeEnum.ifFromRule(s.getChangeDetailType());
|
||||
// }).collect(Collectors.toList());
|
||||
// orderInfo.setDiscountsAmount(LeNumUtil.sumField(amountChangeList, OrderAmountChange::getChangeAmount));
|
||||
// List<OrderAmountChange> amountChangeListRole = this.orderPlaceBusiness.calcRuleAmount(orderSavePO.getPayDTO(), orderSavePO.getOrderInfoList(), orderSavePO.getOrderDetailList(), LeConstants.COMMON_YES.equals(orderPayDTO.getIfTrial()));
|
||||
// amountChangeList.addAll(amountChangeListRole);
|
||||
// if (OrderTypeEnum.isCanteenCategory(orderInfo.getOrderType())) {
|
||||
// this.orderPlaceBusiness.checkCoupon(orderSavePO.getPayDTO(), CollUtil.toList(new OrderInfo[]{orderInfo}));
|
||||
// }
|
||||
//
|
||||
// orderSavePO.setAmountChangeList(amountChangeList);
|
||||
// return LeConstants.COMMON_YES.equals(orderPayDTO.getIfTrial()) ? this.trialPay(orderSavePO, (OrderDeliveryResultVO)null) : this.saveAndPay(orderSavePO, false, true);
|
||||
// }
|
||||
|
||||
public OrderPayMobileVO orderPayByOrderId(RequestHeaderDTO headerDTO, OrderPayMobileDTO orderPayDTO) {
|
||||
LogUtil.info("订单支付|入参", orderPayDTO);
|
||||
JavaxValidateUtils.validate(orderPayDTO);
|
||||
if (!LeConstants.COMMON_YES.equals(orderPayDTO.getIfTrial())) {
|
||||
this.checkOrderRepeated(headerDTO.getOpenid(), (Long)null);
|
||||
}
|
||||
|
||||
OrderInfo orderInfo = this.orderInfoService.checkAndGetOrderInfo(orderPayDTO.getOrderId());
|
||||
OrderSavePO orderSavePO = OrderSavePO.byOrderInfo(CollUtil.toList(orderInfo),
|
||||
this.orderDetailService.getOrderDetailList(orderInfo.getOrderId(), orderInfo.getOrderDate()),
|
||||
this.orderDeliveryService.listOrderDeliveryByOrderIds(CollUtil.toList(orderInfo.getOrderId()), CollUtil.toList(orderInfo.getOrderDate())));
|
||||
CustPayVO custInfo = this.getCustInfo(orderInfo.getCustId(), headerDTO.getSourceType());
|
||||
this.orderPayForIdCheck(CollUtil.toList(new OrderInfo[]{orderInfo}), orderSavePO.getOrderDetailList(), orderSavePO.getOrderDeliveryList());
|
||||
if (LeConstants.COMMON_NO.equals(orderPayDTO.getIfTrial())) {
|
||||
this.orderPlaceBusiness.orderHandlerLock(orderSavePO.getMacOrderId(), OrderCacheConstants.MOBILE_PAY_INTERVAL);
|
||||
}
|
||||
|
||||
orderSavePO.setPayDTO(this.createPay(orderPayDTO.getPayType(), orderPayDTO.getCouponId(), headerDTO.getSourceType(), orderInfo.getCanteenId(), orderInfo.getStallId(), headerDTO.getOpenid(), custInfo, orderPayDTO));
|
||||
this.updateOrderField(CollUtil.toList(orderInfo), orderSavePO.getPayDTO());
|
||||
orderSavePO.getPayDTO().setAmount(orderInfo.calcNeedPayAmount());
|
||||
List<OrderAmountChange> amountChangeList = this.orderAmountChangeService.listByOrderIds(CollUtil.toList(new Long[]{orderInfo.getOrderId()}), CollUtil.toList(new LocalDate[]{orderInfo.getOrderDate()})).stream().filter((s) -> {
|
||||
return !ChangeDetailTypeEnum.ifFromRule(s.getChangeDetailType());
|
||||
}).collect(Collectors.toList());
|
||||
orderInfo.setDiscountsAmount(LeNumUtil.sumField(amountChangeList, OrderAmountChange::getChangeAmount));
|
||||
List<OrderAmountChange> amountChangeListRole = this.orderPlaceBusiness.calcRuleAmount(orderSavePO.getPayDTO(), orderSavePO.getOrderInfoList(), orderSavePO.getOrderDetailList(), LeConstants.COMMON_YES.equals(orderPayDTO.getIfTrial()));
|
||||
amountChangeList.addAll(amountChangeListRole);
|
||||
if (OrderTypeEnum.isCanteenCategory(orderInfo.getOrderType())) {
|
||||
this.orderPlaceBusiness.checkCoupon(orderSavePO.getPayDTO(), CollUtil.toList(new OrderInfo[]{orderInfo}));
|
||||
}
|
||||
|
||||
orderSavePO.setAmountChangeList(amountChangeList);
|
||||
return LeConstants.COMMON_YES.equals(orderPayDTO.getIfTrial()) ? this.trialPay(orderSavePO, (OrderDeliveryResultVO)null) : this.saveAndPay(orderSavePO, false, true);
|
||||
}
|
||||
//
|
||||
// public OrderPayMobileVO orderMixPayByTradeId(RequestHeaderDTO headerDTO, OrderMixPayMobileDTO orderMixPayMobileDTO) {
|
||||
// LogUtil.info("订单混合支付|入参", orderMixPayMobileDTO);
|
||||
|
|
@ -451,33 +456,33 @@ public class OrderPlaceMobileBusinessImplV3 implements OrderPlaceMobileBusiness
|
|||
|
||||
}
|
||||
}
|
||||
//
|
||||
// protected void currentMealOrderPlaceCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
// if (this.orderCustomBusiness.mobile().willOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList)) {
|
||||
// Iterator var4 = orderInfoList.iterator();
|
||||
//
|
||||
// while(var4.hasNext()) {
|
||||
// OrderInfo orderInfo = (OrderInfo)var4.next();
|
||||
// LocalTime nowTime = LocalTime.now();
|
||||
// if (LeNumUtil.isValidId(orderInfo.getStallId())) {
|
||||
// this.allocStallApi.checkStallBusinessState(orderInfo.getStallId(), nowTime);
|
||||
// }
|
||||
//
|
||||
// if (orderInfo.getDeliveryType() == null) {
|
||||
// throw new LeException(OrderTips.mobileNoDelivery());
|
||||
// }
|
||||
//
|
||||
// AllocMealtimeModel mealtime = this.orderPlaceBusiness.checkMealtime(orderInfo.getMealtimeType(), orderInfo.getCanteenId(), orderInfo.getStallId());
|
||||
// if (mealtime.getCurrStartTime() != null && nowTime.compareTo(mealtime.getCurrStartTime()) < 0 || mealtime.getCurrEndTime() != null && nowTime.compareTo(mealtime.getCurrEndTime()) > 0) {
|
||||
// throw new LeException(I18n.getMessage("order.mobile.out-of-curr-time", new Object[0]));
|
||||
// }
|
||||
//
|
||||
// orderInfo.setMealtimeType(mealtime.getMealtimeType());
|
||||
// orderInfo.setMealtimeName(mealtime.getMealtimeName());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
protected void currentMealOrderPlaceCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
if (this.orderCustomBusiness.mobile().willOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList)) {
|
||||
Iterator var4 = orderInfoList.iterator();
|
||||
|
||||
while(var4.hasNext()) {
|
||||
OrderInfo orderInfo = (OrderInfo)var4.next();
|
||||
LocalTime nowTime = LocalTime.now();
|
||||
if (LeNumUtil.isValidId(orderInfo.getStallId())) {
|
||||
this.allocStallApi.checkStallBusinessState(orderInfo.getStallId(), nowTime);
|
||||
}
|
||||
|
||||
if (orderInfo.getDeliveryType() == null) {
|
||||
throw new ServiceException(OrderTips.mobileNoDelivery());
|
||||
}
|
||||
|
||||
AllocMealtimeModel mealtime = this.orderPlaceBusiness.checkMealtime(orderInfo.getMealtimeType(), orderInfo.getCanteenId(), orderInfo.getStallId());
|
||||
if (mealtime.getCurrStartTime() != null && nowTime.compareTo(mealtime.getCurrStartTime()) < 0 || mealtime.getCurrEndTime() != null && nowTime.compareTo(mealtime.getCurrEndTime()) > 0) {
|
||||
throw new ServiceException(I18n.getMessage("order.mobile.out-of-curr-time", new Object[0]));
|
||||
}
|
||||
|
||||
orderInfo.setMealtimeType(mealtime.getMealtimeType());
|
||||
orderInfo.setMealtimeName(mealtime.getMealtimeName());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void reserveMealOrderPlaceCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
if (this.orderCustomBusiness.mobile().willOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList)) {
|
||||
|
|
@ -575,147 +580,147 @@ public class OrderPlaceMobileBusinessImplV3 implements OrderPlaceMobileBusiness
|
|||
|
||||
}
|
||||
}
|
||||
//
|
||||
// protected void bookMealOrderPlaceCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
// if (this.orderCustomBusiness.mobile().willOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList)) {
|
||||
// LocalDate nowDate = LocalDate.now();
|
||||
// LocalTime nowTime = LocalTime.now();
|
||||
// LocalDate tomorrow = nowDate.plusDays(1L);
|
||||
// String repeatReserveCheck = this.orderModuleClient.metadataGetValue(MetaDataValueParam.ofMerchant(MetadataModelTypeEnum.MOBILE, "repeatReserveCheck"));
|
||||
// boolean repeatReserveFlag = "1".equals(repeatReserveCheck);
|
||||
// Map<String, OrderInfo> goodsDateIntervalMap = new HashMap();
|
||||
// if (repeatReserveFlag) {
|
||||
// goodsDateIntervalMap = this.getOrderMapByCustId(((OrderInfo)orderInfoList.get(0)).getCustId(), nowDate);
|
||||
// }
|
||||
//
|
||||
// Map<String, AllocMealtimeModel> mealtimeMap = MapUtil.newHashMap();
|
||||
// Map<String, AllocCanteenOrderDTO> orderDTOMap = MapUtil.newHashMap();
|
||||
// Iterator var12 = orderInfoList.iterator();
|
||||
//
|
||||
// while(var12.hasNext()) {
|
||||
// OrderInfo orderInfo = (OrderInfo)var12.next();
|
||||
// if (LeNumUtil.isValidId(orderInfo.getStallId())) {
|
||||
// this.allocStallApi.checkStallBusinessState(orderInfo.getStallId(), (LocalTime)null);
|
||||
// }
|
||||
//
|
||||
// String mealtimeKey = CharSequenceUtil.join("_", new Object[]{orderInfo.getCanteenId(), orderInfo.getStallId(), orderInfo.getMealtimeType()});
|
||||
// String orderDTOKey = CharSequenceUtil.join("_", new Object[]{orderInfo.getCanteenId(), orderInfo.getStallId()});
|
||||
// AllocMealtimeModel mealtime = mealtimeMap.get(mealtimeKey) != null ? (AllocMealtimeModel)mealtimeMap.get(mealtimeKey) : this.orderPlaceBusiness.checkMealtime(orderInfo.getMealtimeType(), orderInfo.getCanteenId(), orderInfo.getStallId());
|
||||
// mealtimeMap.put(mealtimeKey, mealtime);
|
||||
// AllocCanteenOrderDTO canteenOrderDTO = orderDTOMap.get(orderDTOKey) != null ? (AllocCanteenOrderDTO)orderDTOMap.get(orderDTOKey) : this.orderModuleClient.metadataQueryOrderConfig(OrderConfigQueryParam.of(orderInfo.getCanteenId(), orderInfo.getStallId()));
|
||||
// orderDTOMap.put(orderDTOKey, canteenOrderDTO);
|
||||
// if (nowDate.isAfter(orderInfo.getOrderDate())) {
|
||||
// throw new LeException(I18n.getMessage("order.mobile.out-of-reverse-time", new Object[0]));
|
||||
// }
|
||||
//
|
||||
// if (nowDate.equals(orderInfo.getOrderDate())) {
|
||||
// if (ObjectUtil.isNotNull(mealtime.getBookCurrDeadline()) && LocalTime.now().isAfter(mealtime.getBookCurrDeadline())) {
|
||||
// String var10002 = I18n.getMessage("order.mobile.book-time-limit", new Object[0]);
|
||||
// throw new LeException(var10002 + mealtime.getBookCurrDeadline().toString());
|
||||
// }
|
||||
// } else {
|
||||
// boolean ifBookTomorrow = true;
|
||||
// String bookEndTime = canteenOrderDTO.getBookEndTime();
|
||||
// if (CharSequenceUtil.isNotBlank(bookEndTime) && nowTime.isAfter(LocalTime.parse(bookEndTime))) {
|
||||
// ifBookTomorrow = false;
|
||||
// }
|
||||
//
|
||||
// if (tomorrow.equals(orderInfo.getOrderDate()) && !ifBookTomorrow) {
|
||||
// throw new LeException(I18n.getMessage("order.mobile.not-allow-reverse-tomorrow", new Object[0]));
|
||||
// }
|
||||
//
|
||||
// String limitDay = canteenOrderDTO.getReportMealLimitDay();
|
||||
// int dayNum = CharSequenceUtil.isBlank(limitDay) ? OrderConstant.DEFAULT_APPLET_BOOK_DAY_LIMIT : Integer.parseInt(limitDay);
|
||||
// LocalDate limitDate = nowDate.plusDays((long)dayNum);
|
||||
// if (orderInfo.getOrderDate().isAfter(limitDate)) {
|
||||
// throw new LeException(I18n.getMessage("order.mobile.book-day-limit", new Object[]{dayNum}));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// String var10000 = orderInfo.getOrderDate().toString();
|
||||
// String orderKey = var10000 + orderInfo.getCanteenId() + orderInfo.getStallId() + orderInfo.getMealtimeType();
|
||||
// OrderInfo targetOrderInfo = (OrderInfo)((Map)goodsDateIntervalMap).get(orderKey);
|
||||
// this.reserveOrBookCheck(targetOrderInfo);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// protected void shopOrderPlaceCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
// if (this.orderCustomBusiness.mobile().willOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList)) {
|
||||
// Iterator var4 = orderInfoList.iterator();
|
||||
//
|
||||
// OrderInfo orderInfo;
|
||||
// do {
|
||||
// if (!var4.hasNext()) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// orderInfo = (OrderInfo)var4.next();
|
||||
// if (orderInfo.getDeliveryType() == null) {
|
||||
// throw new LeException(OrderTips.mobileNoDelivery());
|
||||
// }
|
||||
// } while(this.supermarketApi.ifBusiness(orderInfo.getCanteenId()));
|
||||
//
|
||||
// throw new LeException(I18n.getMessage("order.mobile.shop-not-in-time", new Object[0]));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public void scanOrderPlaceCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
// if (this.orderCustomBusiness.mobile().willOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList)) {
|
||||
// Iterator var4 = orderInfoList.iterator();
|
||||
//
|
||||
// while(var4.hasNext()) {
|
||||
// OrderInfo orderInfo = (OrderInfo)var4.next();
|
||||
// LocalTime nowTime = LocalTime.now();
|
||||
// if (OrderTypeEnum.isMobileScanType(orderInfo.getOrderType())) {
|
||||
// if (LeNumUtil.isValidId(orderInfo.getCanteenId())) {
|
||||
// this.allocCanteenApi.checkCanteenBusinessState(orderInfo.getCanteenId(), nowTime);
|
||||
// }
|
||||
//
|
||||
// if (LeNumUtil.isValidId(orderInfo.getStallId())) {
|
||||
// this.allocStallApi.checkStallBusinessState(orderInfo.getStallId(), nowTime);
|
||||
// }
|
||||
//
|
||||
// AllocMealtimeModel mealtimeModel = this.orderPlaceBusiness.checkMealtime((Integer)null, orderInfo.getCanteenId(), orderInfo.getStallId());
|
||||
// orderInfo.setMealtimeType(mealtimeModel.getMealtimeType());
|
||||
// orderInfo.setMealtimeName(mealtimeModel.getMealtimeName());
|
||||
// } else if (OrderTypeEnum.isMobileScanShopType(orderInfo.getOrderType()) && !this.supermarketApi.ifBusiness(orderInfo.getCanteenId())) {
|
||||
// throw new LeException(I18n.getMessage("order.mobile.shop-not-in-time", new Object[0]));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// protected void orderPayForIdCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
// Iterator var4 = orderInfoList.iterator();
|
||||
//
|
||||
// OrderInfo orderInfo;
|
||||
// do {
|
||||
// if (!var4.hasNext()) {
|
||||
// if (OrderTypeEnum.isCurrMealType(((OrderInfo)orderInfoList.get(0)).getOrderType())) {
|
||||
// this.currentMealOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList);
|
||||
// } else if (OrderTypeEnum.isReserveMealType(((OrderInfo)orderInfoList.get(0)).getOrderType())) {
|
||||
// this.reserveMealOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList);
|
||||
// } else if (OrderTypeEnum.isBookMealCategory(((OrderInfo)orderInfoList.get(0)).getOrderType())) {
|
||||
// this.bookMealOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList);
|
||||
// } else if (OrderTypeEnum.isShopCategory(((OrderInfo)orderInfoList.get(0)).getOrderType())) {
|
||||
// this.shopOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList);
|
||||
// } else if (OrderTypeEnum.isMobileScanCategory(((OrderInfo)orderInfoList.get(0)).getOrderType())) {
|
||||
// this.scanOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList);
|
||||
// }
|
||||
//
|
||||
// this.orderPlaceBusiness.checkOrderPermission(orderInfoList, orderDetailList);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// orderInfo = (OrderInfo)var4.next();
|
||||
// } while(PayStateEnum.isUnPayState(orderInfo.getPayState()) && !OrderStateEnum.isCancelState(orderInfo.getOrderState()));
|
||||
//
|
||||
// log.info("[根据订单id支付]订单{}状态为{}", orderInfo.getOrderId(), orderInfo.getPayState());
|
||||
// throw new LeException(I18n.getMessage("order.mobile.not-allow-pay", new Object[0]));
|
||||
// }
|
||||
|
||||
protected void bookMealOrderPlaceCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
if (this.orderCustomBusiness.mobile().willOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList)) {
|
||||
LocalDate nowDate = LocalDate.now();
|
||||
LocalTime nowTime = LocalTime.now();
|
||||
LocalDate tomorrow = nowDate.plusDays(1L);
|
||||
String repeatReserveCheck = this.orderModuleClient.metadataGetValue(MetaDataValueParam.ofMerchant(MetadataModelTypeEnum.MOBILE, "repeatReserveCheck"));
|
||||
boolean repeatReserveFlag = "1".equals(repeatReserveCheck);
|
||||
Map<String, OrderInfo> goodsDateIntervalMap = new HashMap();
|
||||
if (repeatReserveFlag) {
|
||||
goodsDateIntervalMap = this.getOrderMapByCustId(((OrderInfo)orderInfoList.get(0)).getCustId(), nowDate);
|
||||
}
|
||||
|
||||
Map<String, AllocMealtimeModel> mealtimeMap = MapUtil.newHashMap();
|
||||
Map<String, AllocCanteenOrderDTO> orderDTOMap = MapUtil.newHashMap();
|
||||
Iterator var12 = orderInfoList.iterator();
|
||||
|
||||
while(var12.hasNext()) {
|
||||
OrderInfo orderInfo = (OrderInfo)var12.next();
|
||||
if (LeNumUtil.isValidId(orderInfo.getStallId())) {
|
||||
this.allocStallApi.checkStallBusinessState(orderInfo.getStallId(), (LocalTime)null);
|
||||
}
|
||||
|
||||
String mealtimeKey = CharSequenceUtil.join("_", new Object[]{orderInfo.getCanteenId(), orderInfo.getStallId(), orderInfo.getMealtimeType()});
|
||||
String orderDTOKey = CharSequenceUtil.join("_", new Object[]{orderInfo.getCanteenId(), orderInfo.getStallId()});
|
||||
AllocMealtimeModel mealtime = mealtimeMap.get(mealtimeKey) != null ? (AllocMealtimeModel)mealtimeMap.get(mealtimeKey) : this.orderPlaceBusiness.checkMealtime(orderInfo.getMealtimeType(), orderInfo.getCanteenId(), orderInfo.getStallId());
|
||||
mealtimeMap.put(mealtimeKey, mealtime);
|
||||
AllocCanteenOrderDTO canteenOrderDTO = orderDTOMap.get(orderDTOKey) != null ? (AllocCanteenOrderDTO)orderDTOMap.get(orderDTOKey) : this.orderModuleClient.metadataQueryOrderConfig(OrderConfigQueryParam.of(orderInfo.getCanteenId(), orderInfo.getStallId()));
|
||||
orderDTOMap.put(orderDTOKey, canteenOrderDTO);
|
||||
if (nowDate.isAfter(orderInfo.getOrderDate())) {
|
||||
throw new ServiceException(I18n.getMessage("order.mobile.out-of-reverse-time", new Object[0]));
|
||||
}
|
||||
|
||||
if (nowDate.equals(orderInfo.getOrderDate())) {
|
||||
if (ObjectUtil.isNotNull(mealtime.getBookCurrDeadline()) && LocalTime.now().isAfter(mealtime.getBookCurrDeadline())) {
|
||||
String var10002 = I18n.getMessage("order.mobile.book-time-limit", new Object[0]);
|
||||
throw new ServiceException(var10002 + mealtime.getBookCurrDeadline().toString());
|
||||
}
|
||||
} else {
|
||||
boolean ifBookTomorrow = true;
|
||||
String bookEndTime = canteenOrderDTO.getBookEndTime();
|
||||
if (CharSequenceUtil.isNotBlank(bookEndTime) && nowTime.isAfter(LocalTime.parse(bookEndTime))) {
|
||||
ifBookTomorrow = false;
|
||||
}
|
||||
|
||||
if (tomorrow.equals(orderInfo.getOrderDate()) && !ifBookTomorrow) {
|
||||
throw new ServiceException(I18n.getMessage("order.mobile.not-allow-reverse-tomorrow", new Object[0]));
|
||||
}
|
||||
|
||||
String limitDay = canteenOrderDTO.getReportMealLimitDay();
|
||||
int dayNum = CharSequenceUtil.isBlank(limitDay) ? OrderConstant.DEFAULT_APPLET_BOOK_DAY_LIMIT : Integer.parseInt(limitDay);
|
||||
LocalDate limitDate = nowDate.plusDays((long)dayNum);
|
||||
if (orderInfo.getOrderDate().isAfter(limitDate)) {
|
||||
throw new ServiceException(I18n.getMessage("order.mobile.book-day-limit", dayNum));
|
||||
}
|
||||
}
|
||||
|
||||
String var10000 = orderInfo.getOrderDate().toString();
|
||||
String orderKey = var10000 + orderInfo.getCanteenId() + orderInfo.getStallId() + orderInfo.getMealtimeType();
|
||||
OrderInfo targetOrderInfo = (OrderInfo)((Map)goodsDateIntervalMap).get(orderKey);
|
||||
this.reserveOrBookCheck(targetOrderInfo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void shopOrderPlaceCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
if (this.orderCustomBusiness.mobile().willOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList)) {
|
||||
Iterator var4 = orderInfoList.iterator();
|
||||
|
||||
OrderInfo orderInfo;
|
||||
do {
|
||||
if (!var4.hasNext()) {
|
||||
return;
|
||||
}
|
||||
|
||||
orderInfo = (OrderInfo)var4.next();
|
||||
if (orderInfo.getDeliveryType() == null) {
|
||||
throw new ServiceException(OrderTips.mobileNoDelivery());
|
||||
}
|
||||
} while(this.supermarketApi.ifBusiness(orderInfo.getCanteenId()));
|
||||
|
||||
throw new ServiceException(I18n.getMessage("order.mobile.shop-not-in-time", new Object[0]));
|
||||
}
|
||||
}
|
||||
|
||||
public void scanOrderPlaceCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
if (this.orderCustomBusiness.mobile().willOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList)) {
|
||||
Iterator var4 = orderInfoList.iterator();
|
||||
|
||||
while(var4.hasNext()) {
|
||||
OrderInfo orderInfo = (OrderInfo)var4.next();
|
||||
LocalTime nowTime = LocalTime.now();
|
||||
if (OrderTypeEnum.isMobileScanType(orderInfo.getOrderType())) {
|
||||
if (LeNumUtil.isValidId(orderInfo.getCanteenId())) {
|
||||
this.allocCanteenApi.checkCanteenBusinessState(orderInfo.getCanteenId(), nowTime);
|
||||
}
|
||||
|
||||
if (LeNumUtil.isValidId(orderInfo.getStallId())) {
|
||||
this.allocStallApi.checkStallBusinessState(orderInfo.getStallId(), nowTime);
|
||||
}
|
||||
|
||||
AllocMealtimeModel mealtimeModel = this.orderPlaceBusiness.checkMealtime((Integer)null, orderInfo.getCanteenId(), orderInfo.getStallId());
|
||||
orderInfo.setMealtimeType(mealtimeModel.getMealtimeType());
|
||||
orderInfo.setMealtimeName(mealtimeModel.getMealtimeName());
|
||||
} else if (OrderTypeEnum.isMobileScanShopType(orderInfo.getOrderType()) && !this.supermarketApi.ifBusiness(orderInfo.getCanteenId())) {
|
||||
throw new ServiceException(I18n.getMessage("order.mobile.shop-not-in-time", new Object[0]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void orderPayForIdCheck(List<OrderInfo> orderInfoList, List<OrderDetail> orderDetailList, List<OrderDelivery> orderDeliveryList) {
|
||||
Iterator var4 = orderInfoList.iterator();
|
||||
|
||||
OrderInfo orderInfo;
|
||||
do {
|
||||
if (!var4.hasNext()) {
|
||||
if (OrderTypeEnum.isCurrMealType(((OrderInfo)orderInfoList.get(0)).getOrderType())) {
|
||||
this.currentMealOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList);
|
||||
} else if (OrderTypeEnum.isReserveMealType(((OrderInfo)orderInfoList.get(0)).getOrderType())) {
|
||||
this.reserveMealOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList);
|
||||
} else if (OrderTypeEnum.isBookMealCategory(((OrderInfo)orderInfoList.get(0)).getOrderType())) {
|
||||
this.bookMealOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList);
|
||||
} else if (OrderTypeEnum.isShopCategory(((OrderInfo)orderInfoList.get(0)).getOrderType())) {
|
||||
this.shopOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList);
|
||||
} else if (OrderTypeEnum.isMobileScanCategory(((OrderInfo)orderInfoList.get(0)).getOrderType())) {
|
||||
this.scanOrderPlaceCheck(orderInfoList, orderDetailList, orderDeliveryList);
|
||||
}
|
||||
|
||||
this.orderPlaceBusiness.checkOrderPermission(orderInfoList, orderDetailList);
|
||||
return;
|
||||
}
|
||||
|
||||
orderInfo = (OrderInfo)var4.next();
|
||||
} while(PayStateEnum.isUnPayState(orderInfo.getPayState()) && !OrderStateEnum.isCancelState(orderInfo.getOrderState()));
|
||||
|
||||
log.info("[根据订单id支付]订单{}状态为{}", orderInfo.getOrderId(), orderInfo.getPayState());
|
||||
throw new ServiceException(I18n.getMessage("order.mobile.not-allow-pay", new Object[0]));
|
||||
}
|
||||
|
||||
protected void checkOrderRepeated(String openid, Long custId) {
|
||||
if (this.orderCustomBusiness.mobile().willCheckOrderRepeated(OrderCustomMobileCheckRepeatPO.of(openid, custId))) {
|
||||
|
|
@ -749,23 +754,23 @@ public class OrderPlaceMobileBusinessImplV3 implements OrderPlaceMobileBusiness
|
|||
|
||||
return orderMap;
|
||||
}
|
||||
//
|
||||
// protected void updateOrderField(List<OrderInfo> orderInfoList, UnifyPayDTO unifyPayDTO) {
|
||||
// Iterator var3 = orderInfoList.iterator();
|
||||
//
|
||||
// while(var3.hasNext()) {
|
||||
// OrderInfo orderInfo = (OrderInfo)var3.next();
|
||||
// orderInfo.setSourceType(unifyPayDTO.getSourceType());
|
||||
// orderInfo.setPayType(unifyPayDTO.getPayType());
|
||||
// orderInfo.fillCustInfo(unifyPayDTO);
|
||||
// if (unifyPayDTO.getCouponId() != null) {
|
||||
// orderInfo.setCouponId(unifyPayDTO.getCouponId().toString());
|
||||
// } else {
|
||||
// orderInfo.setCouponId("");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
protected void updateOrderField(List<OrderInfo> orderInfoList, UnifyPayDTO unifyPayDTO) {
|
||||
Iterator var3 = orderInfoList.iterator();
|
||||
|
||||
while(var3.hasNext()) {
|
||||
OrderInfo orderInfo = (OrderInfo)var3.next();
|
||||
orderInfo.setSourceType(unifyPayDTO.getSourceType());
|
||||
orderInfo.setPayType(unifyPayDTO.getPayType());
|
||||
orderInfo.fillCustInfo(unifyPayDTO);
|
||||
if (unifyPayDTO.getCouponId() != null) {
|
||||
orderInfo.setCouponId(unifyPayDTO.getCouponId().toString());
|
||||
} else {
|
||||
orderInfo.setCouponId("");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected UnifyPayDTO createPay(Integer payType, String couponId, Integer sourceType, Long canteenId, Long stallId, String openid, CustPayVO custInfo, OrderMobilePayParam requestParam) {
|
||||
PayChannelSelectDTO payChannelSelectDTO = new PayChannelSelectDTO();
|
||||
|
|
|
|||
|
|
@ -20,11 +20,13 @@ import com.bonus.canteen.core.order.mobile.vo.OrderListMobileVO;
|
|||
import com.bonus.canteen.core.order.mobile.vo.OrderShoppingCartAddResultVO;
|
||||
import com.bonus.canteen.core.order.mobile.vo.OrderShoppingCartListMobileVO;
|
||||
import com.bonus.canteen.core.pay.api.vo.UnifyPaySelectVO;
|
||||
import com.bonus.common.houqin.utils.LeRequest;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -93,16 +95,16 @@ public class OrderInfoMobileController extends BaseController {
|
|||
// OrderInfoMobileVO orderInfo = this.orderInfoMobileBusiness.weightOrderInfo((OrderInfoWeightMobileDTO)request.getContent());
|
||||
// return LeResponse.succ(orderInfo);
|
||||
// }
|
||||
//
|
||||
// @PostMapping({"/pay/cancel"})
|
||||
// @ApiOperation(
|
||||
// value = "取消支付",
|
||||
// notes = "cmt-取消支付"
|
||||
// )
|
||||
// public LeResponse<Object> orderPayCancel(@RequestBody @Valid LeRequest<OrderIdMobileDTO> request) {
|
||||
// this.orderInfoMobileBusiness.orderPayCancel(((OrderIdMobileDTO)request.getContent()).getOrderId());
|
||||
// return LeResponse.succ();
|
||||
// }
|
||||
|
||||
@PostMapping({"/pay/cancel"})
|
||||
@ApiOperation(
|
||||
value = "取消支付",
|
||||
notes = "cmt-取消支付"
|
||||
)
|
||||
public AjaxResult orderPayCancel(@RequestBody @Valid LeRequest<OrderIdMobileDTO> request) {
|
||||
this.orderInfoMobileBusiness.orderPayCancel(((OrderIdMobileDTO)request.getContent()).getOrderId());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
//
|
||||
// @PostMapping({"/part/refund"})
|
||||
// @ApiOperation(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.canteen.core.order.mobile.controller;
|
||||
|
||||
import com.bonus.canteen.core.order.mobile.dto.OrderPayMobileDTO;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.houqin.constant.RetCodeEnum;
|
||||
|
|
@ -8,6 +9,7 @@ import com.bonus.canteen.core.order.common.dto.RequestHeaderDTO;
|
|||
import com.bonus.canteen.core.order.mobile.business.OrderPlaceMobileBusiness;
|
||||
import com.bonus.canteen.core.order.mobile.dto.OrderReserveMealTotalDTO;
|
||||
import com.bonus.canteen.core.order.mobile.vo.OrderPayMobileVO;
|
||||
import com.bonus.common.houqin.utils.LeRequest;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -110,21 +112,22 @@ public class OrderPlaceMobileController {
|
|||
// LogUtil.info("[到店扫码下单]支付耗时", System.currentTimeMillis() - startTime, mobileVO);
|
||||
// return mobileVO.success() ? LeResponse.succ(mobileVO) : LeResponse.fail(mobileVO.getCode(), mobileVO.getMsg(), mobileVO);
|
||||
// }
|
||||
//
|
||||
// @PostMapping({"/pay/by/orderId"})
|
||||
// @ApiOperation(
|
||||
// value = "根据订单id支付",
|
||||
// notes = "cmt-根据订单id支付"
|
||||
// )
|
||||
// public LeResponse<OrderPayMobileVO> orderPayByOrderId(@RequestHeader Map<String, String> headers, @RequestBody LeRequest<OrderPayMobileDTO> request) {
|
||||
// long startTime = System.currentTimeMillis();
|
||||
// RequestHeaderDTO headerDTO = RequestHeaderDTO.of(headers);
|
||||
// OrderPayMobileDTO orderPayDTO = (OrderPayMobileDTO)request.getContent();
|
||||
// orderPayDTO.setCustId(headerDTO.getCustId());
|
||||
// OrderPayMobileVO mobileVO = this.orderPlaceMobileBusiness.orderPayByOrderId(headerDTO, orderPayDTO);
|
||||
// LogUtil.info("[根据订单id支付]支付耗时", System.currentTimeMillis() - startTime, mobileVO);
|
||||
// return !mobileVO.success() ? LeResponse.fail(mobileVO.getCode(), mobileVO.getMsg(), mobileVO) : LeResponse.succ(mobileVO);
|
||||
// }
|
||||
|
||||
@PostMapping({"/pay/by/orderId"})
|
||||
@ApiOperation(
|
||||
value = "根据订单id支付",
|
||||
notes = "cmt-根据订单id支付"
|
||||
)
|
||||
public AjaxResult orderPayByOrderId(@RequestHeader Map<String, String> headers,
|
||||
@RequestBody LeRequest<OrderPayMobileDTO> request) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
RequestHeaderDTO headerDTO = RequestHeaderDTO.of(headers);
|
||||
OrderPayMobileDTO orderPayDTO = (OrderPayMobileDTO)request.getContent();
|
||||
orderPayDTO.setCustId(headerDTO.getCustId());
|
||||
OrderPayMobileVO mobileVO = this.orderPlaceMobileBusiness.orderPayByOrderId(headerDTO, orderPayDTO);
|
||||
LogUtil.info("[根据订单id支付]支付耗时", System.currentTimeMillis() - startTime, mobileVO);
|
||||
return !mobileVO.success() ? AjaxResult.error( mobileVO.getMsg(), mobileVO) : AjaxResult.success(mobileVO);
|
||||
}
|
||||
//
|
||||
// @PostMapping({"/mixPay/by/orderId"})
|
||||
// @ApiOperation(
|
||||
|
|
|
|||
|
|
@ -0,0 +1,101 @@
|
|||
package com.bonus.canteen.core.order.mobile.dto;
|
||||
|
||||
import com.bonus.common.houqin.constant.LeConstants;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("移动端根据订单号支付DTO")
|
||||
public class OrderPayMobileDTO implements OrderMobilePayParam {
|
||||
@ApiModelProperty("是否为订单试算")
|
||||
private Integer ifTrial;
|
||||
@ApiModelProperty("订单id")
|
||||
private @NotNull Long orderId;
|
||||
@ApiModelProperty("支付方式")
|
||||
private @NotNull Integer payType;
|
||||
@ApiModelProperty("餐券id")
|
||||
private String couponId;
|
||||
@ApiModelProperty("支付密码")
|
||||
private String payPassword;
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
@ApiModelProperty("扩展字段")
|
||||
private JsonNode extParam;
|
||||
@ApiModelProperty("人员Id")
|
||||
private Long custId;
|
||||
|
||||
public OrderPayMobileDTO() {
|
||||
this.ifTrial = LeConstants.COMMON_NO;
|
||||
}
|
||||
|
||||
public Integer getIfTrial() {
|
||||
return this.ifTrial;
|
||||
}
|
||||
|
||||
public Long getOrderId() {
|
||||
return this.orderId;
|
||||
}
|
||||
|
||||
public Integer getPayType() {
|
||||
return this.payType;
|
||||
}
|
||||
|
||||
public String getCouponId() {
|
||||
return this.couponId;
|
||||
}
|
||||
|
||||
public String getPayPassword() {
|
||||
return this.payPassword;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return this.remark;
|
||||
}
|
||||
|
||||
public JsonNode getExtParam() {
|
||||
return this.extParam;
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public void setIfTrial(final Integer ifTrial) {
|
||||
this.ifTrial = ifTrial;
|
||||
}
|
||||
|
||||
public void setOrderId(final Long orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public void setPayType(final Integer payType) {
|
||||
this.payType = payType;
|
||||
}
|
||||
|
||||
public void setCouponId(final String couponId) {
|
||||
this.couponId = couponId;
|
||||
}
|
||||
|
||||
public void setPayPassword(final String payPassword) {
|
||||
this.payPassword = payPassword;
|
||||
}
|
||||
|
||||
public void setRemark(final String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public void setExtParam(final JsonNode extParam) {
|
||||
this.extParam = extParam;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Integer var10000 = this.getIfTrial();
|
||||
return "OrderPayMobileDTO(ifTrial=" + var10000 + ", orderId=" + this.getOrderId() + ", payType=" + this.getPayType() + ", couponId=" + this.getCouponId() + ", payPassword=" + this.getPayPassword() + ", remark=" + this.getRemark() + ", extParam=" + String.valueOf(this.getExtParam()) + ", custId=" + this.getCustId() + ")";
|
||||
}
|
||||
}
|
||||
|
|
@ -11,8 +11,8 @@ import com.bonus.canteen.core.pay.api.vo.UnifyPaySelectVO;
|
|||
import java.util.List;
|
||||
|
||||
public interface OrderInfoMobileBusiness {
|
||||
// void orderPayCancel(Long orderId);
|
||||
//
|
||||
void orderPayCancel(Long orderId);
|
||||
|
||||
UnifyPaySelectVO orderSyncPayState(OrderSyncPayStateMobileDTO dto);
|
||||
|
||||
PageVO<OrderListMobileVO> orderList(OrderListMobileDTO orderListDTO, RequestHeaderDTO headerDTO);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,16 @@ import cn.hutool.core.collection.ListUtil;
|
|||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.canteen.core.common.redis.RedisUtil;
|
||||
import com.bonus.canteen.core.common.utils.AesEncryptUtil;
|
||||
import com.bonus.canteen.core.common.utils.TenantContextHolder;
|
||||
import com.bonus.canteen.core.order.common.business.OrderRefundBusiness;
|
||||
import com.bonus.canteen.core.order.common.constants.*;
|
||||
import com.bonus.canteen.core.order.common.model.OrderInfo;
|
||||
import com.bonus.canteen.core.pay.api.PayApi;
|
||||
import com.bonus.canteen.core.pay.api.dto.UnifyPayCancelDTO;
|
||||
import com.bonus.canteen.core.pay.common.constants.PayStateEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.houqin.constant.LeConstants;
|
||||
import com.bonus.canteen.core.common.page.PageVO;
|
||||
import com.bonus.canteen.core.device.api.DeviceApi;
|
||||
|
|
@ -14,9 +23,6 @@ import com.bonus.canteen.core.device.manage.model.DeviceInfo;
|
|||
import com.bonus.canteen.core.menu.api.MenuDishesApi;
|
||||
import com.bonus.canteen.core.menu.utils.NutritionEntity;
|
||||
import com.bonus.canteen.core.order.common.business.OrderResultBusiness;
|
||||
import com.bonus.canteen.core.order.common.constants.CheckStateEnum;
|
||||
import com.bonus.canteen.core.order.common.constants.DetailTypeEnum;
|
||||
import com.bonus.canteen.core.order.common.constants.OrderTypeEnum;
|
||||
import com.bonus.canteen.core.order.common.dto.RequestHeaderDTO;
|
||||
import com.bonus.canteen.core.order.common.model.OrderDelivery;
|
||||
import com.bonus.canteen.core.order.common.model.OrderRefund;
|
||||
|
|
@ -40,6 +46,7 @@ import com.bonus.canteen.core.pay.api.TradeRecordApi;
|
|||
import com.bonus.canteen.core.pay.api.vo.UnifyPaySelectVO;
|
||||
import com.bonus.canteen.core.pay.common.model.TradeRecord;
|
||||
import com.bonus.canteen.core.menu.model.MenuDishesTypeModel;
|
||||
import com.bonus.common.houqin.i18n.I18n;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -92,6 +99,12 @@ public class OrderInfoMobileBusinessImpl implements OrderInfoMobileBusiness {
|
|||
@Lazy
|
||||
@Autowired
|
||||
protected TradeRecordApi tradeRecordApi;
|
||||
@Lazy
|
||||
@Autowired
|
||||
protected OrderRefundBusiness orderRefundBusiness;
|
||||
@Lazy
|
||||
@Autowired
|
||||
protected PayApi payApi;
|
||||
|
||||
@Override
|
||||
public PageVO<OrderListMobileVO> orderList(OrderListMobileDTO orderListDTO, RequestHeaderDTO headerDTO) {
|
||||
|
|
@ -274,5 +287,40 @@ public class OrderInfoMobileBusinessImpl implements OrderInfoMobileBusiness {
|
|||
return UnifyPaySelectVO.of(tradeRecord);
|
||||
}
|
||||
}
|
||||
public void orderPayCancel(Long orderId) {
|
||||
OrderInfo orderInfo = this.getAndCheckOrderInfo(orderId);
|
||||
if (OrderStateEnum.isWaitPlaceState(orderInfo.getOrderState()) && !PayStateEnum.isFinishedState(orderInfo.getPayState())) {
|
||||
this.orderRefundBusiness.orderCancel(orderInfo);
|
||||
List<TradeRecord> tradeRecords = this.tradeRecordApi.listTradeRecordByOrderRechargeId(orderInfo.getOrderId(), PayStateEnum.PAY_INPROCESS.getKey());
|
||||
Iterator var4 = tradeRecords.iterator();
|
||||
|
||||
while(var4.hasNext()) {
|
||||
TradeRecord tradeRecord = (TradeRecord)var4.next();
|
||||
UnifyPayCancelDTO payCancelDTO = new UnifyPayCancelDTO();
|
||||
payCancelDTO.setTradeId(tradeRecord.getId());
|
||||
this.payApi.payCancel(payCancelDTO);
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new ServiceException(I18n.getMessage("order.cancel-failed", new Object[0]));
|
||||
}
|
||||
}
|
||||
protected OrderInfo getAndCheckOrderInfo(Long orderId) {
|
||||
Long var10000 = TenantContextHolder.getTenantId();
|
||||
String cancelKey = "yst:" + var10000 + ":order:cancel:" + orderId;
|
||||
if (!RedisUtil.setNx(cancelKey, LeConstants.COMMON_YES, OrderCacheConstants.TWO_SECONDS)) {
|
||||
throw new ServiceException(I18n.getMessage("order.mobile.order-processing", new Object[0]));
|
||||
} else {
|
||||
OrderInfo orderInfo = this.orderInfoService.checkAndGetOrderInfo(orderId);
|
||||
if (!PayStateEnum.UN_PAY.getKey().equals(orderInfo.getPayState())) {
|
||||
log.info("[取消支付]订单{}支付状态为:{}", orderId, orderInfo.getPayState());
|
||||
throw new ServiceException(I18n.getMessage("order.mobile.not-allow-cancel", new Object[0]));
|
||||
} else if (!DishesStateEnum.UN_MAKE.getKey().equals(orderInfo.getDishesState())) {
|
||||
log.info("[取消支付]订单{}菜品状态为:{}", orderId, orderInfo.getDishesState());
|
||||
throw new ServiceException(I18n.getMessage("order.mobile.not-allow-cancel-dishes-make", new Object[0]));
|
||||
} else {
|
||||
return orderInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,7 @@ import com.bonus.canteen.core.common.utils.LogUtil;
|
|||
import com.bonus.canteen.core.common.utils.TenantContextHolder;
|
||||
import com.bonus.canteen.core.order.android.dto.MacOrderImageSaveDTO;
|
||||
import com.bonus.canteen.core.order.common.model.*;
|
||||
import com.bonus.canteen.core.order.mq.po.OrderCancelPO;
|
||||
import com.bonus.canteen.core.order.mq.po.OrderDishesStateUpdatePO;
|
||||
import com.bonus.canteen.core.order.mq.po.OrderRefundPO;
|
||||
import com.bonus.canteen.core.order.mq.po.OrderPlacedPO;
|
||||
import com.bonus.canteen.core.order.mq.po.*;
|
||||
import com.bonus.canteen.core.pay.common.po.PayResultPO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -191,21 +188,21 @@ public class OrderMessageSend {
|
|||
|
||||
}
|
||||
|
||||
// public static void orderV3Canceled(OrderInfo orderInfo, List<OrderDetail> detailList) {
|
||||
// log.info("[订单MQv3]发送订单已取消通知");
|
||||
// OrderCanceledPO po = new OrderCanceledPO();
|
||||
// po.setTraceId(LogUtil.getCurrentTraceId());
|
||||
// po.setTenantId(TenantContextHolder.getTenantId());
|
||||
// po.setOrderInfo(orderInfo);
|
||||
// po.setDetailList(detailList);
|
||||
//
|
||||
// try {
|
||||
// MqUtil.sendByTxEnd(JacksonUtil.writeValueAsString(po), LeMqConstant.Topic.ORDER_V3_CANCELED);
|
||||
// } catch (Exception var4) {
|
||||
// log.error("发送MQ消息失败", var4);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
public static void orderV3Canceled(OrderInfo orderInfo, List<OrderDetail> detailList) {
|
||||
log.info("[订单MQv3]发送订单已取消通知");
|
||||
OrderCanceledPO po = new OrderCanceledPO();
|
||||
po.setTraceId(LogUtil.getCurrentTraceId());
|
||||
po.setTenantId(TenantContextHolder.getTenantId());
|
||||
po.setOrderInfo(orderInfo);
|
||||
po.setDetailList(detailList);
|
||||
|
||||
try {
|
||||
MqUtil.sendByTxEnd(JacksonUtil.writeValueAsString(po), LeMqConstant.Topic.ORDER_V3_CANCELED);
|
||||
} catch (Exception var4) {
|
||||
log.error("发送MQ消息失败", var4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void orderV3DishesStateUpdated(OrderInfo orderInfo, Integer dishesStateBeforeUpdated) {
|
||||
OrderDishesStateUpdatePO orderStateUpdatePO = OrderDishesStateUpdatePO.of(orderInfo);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
package com.bonus.canteen.core.order.mq.po;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.canteen.core.order.common.model.OrderDetail;
|
||||
import com.bonus.canteen.core.order.common.model.OrderInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class OrderCanceledPO {
|
||||
private String traceId;
|
||||
private Long tenantId;
|
||||
private OrderInfo orderInfo;
|
||||
private List<OrderDetail> detailList = CollUtil.newArrayList(new OrderDetail[0]);
|
||||
|
||||
public String getTraceId() {
|
||||
return this.traceId;
|
||||
}
|
||||
|
||||
public Long getTenantId() {
|
||||
return this.tenantId;
|
||||
}
|
||||
|
||||
public OrderInfo getOrderInfo() {
|
||||
return this.orderInfo;
|
||||
}
|
||||
|
||||
public List<OrderDetail> getDetailList() {
|
||||
return this.detailList;
|
||||
}
|
||||
|
||||
public void setTraceId(final String traceId) {
|
||||
this.traceId = traceId;
|
||||
}
|
||||
|
||||
public void setTenantId(final Long tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public void setOrderInfo(final OrderInfo orderInfo) {
|
||||
this.orderInfo = orderInfo;
|
||||
}
|
||||
|
||||
public void setDetailList(final List<OrderDetail> detailList) {
|
||||
this.detailList = detailList;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
String var10000 = this.getTraceId();
|
||||
return "OrderCanceledPO(traceId=" + var10000 + ", tenantId=" + this.getTenantId() + ", orderInfo=" + String.valueOf(this.getOrderInfo()) + ", detailList=" + String.valueOf(this.getDetailList()) + ")";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
package com.bonus.canteen.core.pay.api;
|
||||
import com.bonus.canteen.core.pay.api.dto.UnifyPayCancelDTO;
|
||||
import com.bonus.canteen.core.pay.api.dto.UnifyPayDTO;
|
||||
import com.bonus.canteen.core.pay.api.dto.UnifyPaySelectDTO;
|
||||
import com.bonus.canteen.core.pay.api.dto.UnifyRefundDTO;
|
||||
import com.bonus.canteen.core.pay.api.vo.UnifyPayCancelVO;
|
||||
import com.bonus.canteen.core.pay.api.vo.UnifyPaySelectVO;
|
||||
import com.bonus.canteen.core.pay.api.vo.UnifyPayVO;
|
||||
import com.bonus.canteen.core.pay.api.vo.UnifyRefundVO;
|
||||
|
|
@ -44,9 +46,11 @@ public class PayApi {
|
|||
public UnifyPaySelectVO paySelect(UnifyPaySelectDTO paySelectDTO) {
|
||||
return this.payBusiness.unifyPaySelect(paySelectDTO);
|
||||
}
|
||||
|
||||
public UnifyRefundVO refund(UnifyRefundDTO refundDTO) {
|
||||
return this.refundBusiness.unifyRefund(refundDTO);
|
||||
}
|
||||
public UnifyPayCancelVO payCancel(UnifyPayCancelDTO payCancelDTO) {
|
||||
return this.refundBusiness.unifyPayCancel(payCancelDTO);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,4 +95,8 @@ public class TradeRecordApi {
|
|||
public TradeRecord getLastTradeRecordByOrderId(Long orderId) {
|
||||
return (TradeRecord)this.tradeRecordService.queryTradeRecordInfoList((String)null, orderId, (Integer)null, (Integer)null).stream().sorted(Comparator.comparing(TradeRecord::getId).reversed()).findFirst().orElse((TradeRecord) null);
|
||||
}
|
||||
|
||||
public List<TradeRecord> listTradeRecordByOrderRechargeId(Long orderRechargeId, Integer... tradeState) {
|
||||
return this.tradeRecordService.listTradeRecordByOrderRechargeId(orderRechargeId, tradeState);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.bonus.canteen.core.pay.api.dto;
|
||||
|
||||
public class UnifyPayCancelDTO {
|
||||
private Long tradeId;
|
||||
private Long orderRechargeId;
|
||||
|
||||
public Long getTradeId() {
|
||||
return this.tradeId;
|
||||
}
|
||||
|
||||
public Long getOrderRechargeId() {
|
||||
return this.orderRechargeId;
|
||||
}
|
||||
|
||||
public void setTradeId(final Long tradeId) {
|
||||
this.tradeId = tradeId;
|
||||
}
|
||||
|
||||
public void setOrderRechargeId(final Long orderRechargeId) {
|
||||
this.orderRechargeId = orderRechargeId;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Long var10000 = this.getTradeId();
|
||||
return "UnifyPayCancelDTO(tradeId=" + var10000 + ", orderRechargeId=" + this.getOrderRechargeId() + ")";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.bonus.canteen.core.pay.api.vo;
|
||||
|
||||
public class UnifyPayCancelVO {
|
||||
private Integer code;
|
||||
private Integer payState;
|
||||
private String msg;
|
||||
|
||||
public Integer getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public Integer getPayState() {
|
||||
return this.payState;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return this.msg;
|
||||
}
|
||||
|
||||
public void setCode(final Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setPayState(final Integer payState) {
|
||||
this.payState = payState;
|
||||
}
|
||||
|
||||
public void setMsg(final String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Integer var10000 = this.getCode();
|
||||
return "UnifyPayCancelVO(code=" + var10000 + ", payState=" + this.getPayState() + ", msg=" + this.getMsg() + ")";
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,15 @@ import cn.hutool.core.collection.CollUtil;
|
|||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.canteen.core.pay.api.dto.UnifyPayCancelDTO;
|
||||
import com.bonus.canteen.core.pay.api.vo.UnifyPayCancelVO;
|
||||
import com.bonus.canteen.core.pay.common.constants.CancelResultEnum;
|
||||
import com.bonus.canteen.core.pay.common.dto.MixPayResultDTO;
|
||||
import com.bonus.canteen.core.pay.common.dto.PayCancelDTO;
|
||||
import com.bonus.canteen.core.pay.common.dto.PayChannelSplitDTO;
|
||||
import com.bonus.canteen.core.pay.common.service.*;
|
||||
import com.bonus.canteen.core.pay.common.vo.PayCancelVO;
|
||||
import com.bonus.canteen.core.pay.common.vo.PayChannelSplitVO;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.canteen.core.account.v3.api.AccBusinessApi;
|
||||
import com.bonus.canteen.core.account.v3.constants.AccExceptionRecordStatusEnum;
|
||||
|
|
@ -22,10 +31,6 @@ import com.bonus.canteen.core.pay.common.dto.PayRefundDTO;
|
|||
import com.bonus.canteen.core.pay.common.model.TradeChannel;
|
||||
import com.bonus.canteen.core.pay.common.model.TradeOrderRecharge;
|
||||
import com.bonus.canteen.core.pay.common.model.TradeRecord;
|
||||
import com.bonus.canteen.core.pay.common.service.PayService;
|
||||
import com.bonus.canteen.core.pay.common.service.PayTradeService;
|
||||
import com.bonus.canteen.core.pay.common.service.TradeChannelService;
|
||||
import com.bonus.canteen.core.pay.common.service.TradeRecordService;
|
||||
import com.bonus.canteen.core.pay.common.vo.PayRefundVO;
|
||||
import com.bonus.canteen.core.pay.common.vo.TradeChannelVO;
|
||||
import com.bonus.canteen.core.pay.custom.PayCustomBusiness;
|
||||
|
|
@ -73,6 +78,9 @@ public class RefundBusiness {
|
|||
@Lazy
|
||||
@Autowired
|
||||
protected PayTradeService payTradeService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
protected PayChannelSelectService payChannelSelectService;
|
||||
|
||||
@Transactional(
|
||||
propagation = Propagation.NOT_SUPPORTED
|
||||
|
|
@ -534,4 +542,143 @@ public class RefundBusiness {
|
|||
protected String tradeNotExistsMsg() {
|
||||
return I18n.getMessage("pay.trade-not-exist", new Object[0]);
|
||||
}
|
||||
|
||||
@Transactional(
|
||||
propagation = Propagation.NOT_SUPPORTED
|
||||
)
|
||||
public UnifyPayCancelVO unifyPayCancel(UnifyPayCancelDTO payCancelDTO) {
|
||||
UnifyPayCancelVO cancelResultVO = new UnifyPayCancelVO();
|
||||
this.payCustomBusiness.willPayCancelV2(payCancelDTO);
|
||||
TradeRecord tradeRecord = payCancelDTO.getTradeId() != null ? this.tradeRecordService.getTradeRecordById(payCancelDTO.getTradeId()) : this.tradeRecordService.getTradeRecordByOrderRechargeId(payCancelDTO.getOrderRechargeId());
|
||||
if (ObjectUtil.isNull(tradeRecord)) {
|
||||
log.info("[支付取消]交易记录不存在,orderRechargeId:{}", payCancelDTO);
|
||||
cancelResultVO.setCode(CancelResultEnum.CANCEL_FAIL.getKey());
|
||||
cancelResultVO.setMsg(CancelResultEnum.CANCEL_FAIL.getDesc());
|
||||
return cancelResultVO;
|
||||
} else if (!PayStateEnum.isPayingState(tradeRecord.getTradeState())) {
|
||||
log.error("交易记录状态不是支付中,tradeId={},tradeState={}", tradeRecord.getId(), tradeRecord.getTradeState());
|
||||
cancelResultVO.setCode(CancelResultEnum.CANCEL_FAIL.getKey());
|
||||
cancelResultVO.setMsg(CancelResultEnum.CANCEL_FAIL.getDesc());
|
||||
return cancelResultVO;
|
||||
} else if (!PayCacheConstants.lockTrade(tradeRecord.getId())) {
|
||||
log.warn("[统一支付]交易锁定失败");
|
||||
cancelResultVO.setCode(CancelResultEnum.CANCEL_FAIL.getKey());
|
||||
cancelResultVO.setMsg(CancelResultEnum.CANCEL_FAIL.getDesc());
|
||||
return cancelResultVO;
|
||||
} else {
|
||||
UnifyPayCancelVO var5;
|
||||
try {
|
||||
cancelResultVO = this.startCancelFlow(tradeRecord);
|
||||
log.info("[支付取消]返回结果:{}", JacksonUtil.valueToTreeIgnoreNull(cancelResultVO));
|
||||
Integer payState;
|
||||
if (CancelResultEnum.CANCEL_SUCCESS.getKey().equals(cancelResultVO.getCode())) {
|
||||
payState = PayStateEnum.PAY_CLOSE.getKey();
|
||||
} else {
|
||||
payState = PayStateEnum.PAY_INPROCESS.getKey();
|
||||
}
|
||||
|
||||
this.tradeRecordService.updateTradeRecordState(tradeRecord.getId(), payState, cancelResultVO.getMsg());
|
||||
cancelResultVO.setPayState(payState);
|
||||
this.payCustomBusiness.didPayCancelV2(payCancelDTO, cancelResultVO);
|
||||
var5 = cancelResultVO;
|
||||
} finally {
|
||||
PayCacheConstants.unlockTrade(tradeRecord.getId());
|
||||
}
|
||||
|
||||
return var5;
|
||||
}
|
||||
}
|
||||
|
||||
protected UnifyPayCancelVO startCancelFlow(TradeRecord tradeRecord) {
|
||||
UnifyPayCancelVO unifyPayCancelVO = new UnifyPayCancelVO();
|
||||
List<TradeChannelVO> tradeChannels = this.tradeChannelService.listChannelDetailByTradeId(tradeRecord.getId());
|
||||
if (CollUtil.isEmpty(tradeChannels)) {
|
||||
unifyPayCancelVO.setCode(CancelResultEnum.CANCEL_SUCCESS.getKey());
|
||||
unifyPayCancelVO.setMsg(CancelResultEnum.CANCEL_SUCCESS.getDesc());
|
||||
return unifyPayCancelVO;
|
||||
} else {
|
||||
TradeChannelVO lastTradeChannel = (TradeChannelVO)CollUtil.getLast(tradeChannels);
|
||||
if (!PayStateEnum.isPayingState(lastTradeChannel.getTradeState())) {
|
||||
unifyPayCancelVO.setCode(CancelResultEnum.CANCEL_FAIL.getKey());
|
||||
unifyPayCancelVO.setMsg(CancelResultEnum.CANCEL_FAIL.getDesc());
|
||||
return unifyPayCancelVO;
|
||||
} else {
|
||||
UnifyPayDTO unifyPayDTO = UnifyPayDTO.of(tradeRecord);
|
||||
List<PayChannelSplitVO> payChannelSplits = unifyPayDTO.getPayChannelSplits();
|
||||
|
||||
try {
|
||||
if (CollUtil.isEmpty(payChannelSplits)) {
|
||||
payChannelSplits = this.payChannelSelectService.splitChannelDetails(PayChannelSplitDTO.of(tradeRecord.getPayType(), tradeRecord.getPayChannel(), unifyPayDTO.getCouponId(), tradeRecord.getCanteenId()));
|
||||
}
|
||||
} catch (Exception var12) {
|
||||
log.error("[渠道支付取消]拆解支付渠道异常", var12);
|
||||
unifyPayCancelVO.setCode(CancelResultEnum.CANCEL_FAIL.getKey());
|
||||
unifyPayCancelVO.setMsg(CancelResultEnum.CANCEL_FAIL.getDesc());
|
||||
return unifyPayCancelVO;
|
||||
}
|
||||
|
||||
PayChannelSplitVO lastPayChannelSplit = (PayChannelSplitVO)CollUtil.getLast(payChannelSplits);
|
||||
|
||||
for(int i = tradeChannels.size() - 1; i >= 0; --i) {
|
||||
TradeChannelVO tradeChannel = (TradeChannelVO)tradeChannels.get(i);
|
||||
if (tradeChannel.getPayType().equals(lastPayChannelSplit.getPayType()) && tradeChannel.getPayChannel().equals(lastPayChannelSplit.getPayChannel())) {
|
||||
PayCancelDTO channelPayCancelDTO = new PayCancelDTO();
|
||||
this.fillPayCancelDTO(channelPayCancelDTO, unifyPayDTO);
|
||||
PayCancelVO channelPayCancelVO = this.channelPayCancel(tradeChannel, channelPayCancelDTO);
|
||||
unifyPayCancelVO.setPayState(channelPayCancelVO.getPayState());
|
||||
unifyPayCancelVO.setCode(channelPayCancelVO.getCode());
|
||||
unifyPayCancelVO.setMsg(channelPayCancelVO.getMsg());
|
||||
if (!CancelResultEnum.CANCEL_SUCCESS.getKey().equals(channelPayCancelVO.getCode())) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
MixPayResultDTO mixPayResultDTO = new MixPayResultDTO();
|
||||
mixPayResultDTO.setTradeChannelId(tradeChannel.getTradeChannelId());
|
||||
mixPayResultDTO.setCode(PayStateEnum.PAY_CLOSE.getKey());
|
||||
mixPayResultDTO.setUnpaidBalance(tradeRecord.getAmount());
|
||||
this.payBusiness.mixPayResultProcess(tradeChannel, mixPayResultDTO);
|
||||
}
|
||||
}
|
||||
|
||||
return unifyPayCancelVO;
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void fillPayCancelDTO(PayCancelDTO cancelDTO, UnifyPayDTO unifyPayDTO) {
|
||||
cancelDTO.setCanteenId(unifyPayDTO.getCanteenId());
|
||||
cancelDTO.setStallId((Long)unifyPayDTO.reduceOrderField(UnifyPayDTO.Order::getStallId, (Object)null));
|
||||
cancelDTO.setMachineSn(unifyPayDTO.getMachineSn());
|
||||
cancelDTO.setCouponId(unifyPayDTO.getCouponId());
|
||||
}
|
||||
protected PayCancelVO channelPayCancel(TradeChannelVO tradeChannel, PayCancelDTO payCancelDTO) {
|
||||
this.payCustomBusiness.willChannelPayCancel(payCancelDTO);
|
||||
PayCancelVO cancelResultVO = new PayCancelVO();
|
||||
cancelResultVO.setCode(CancelResultEnum.CANCEL_FAIL.getKey());
|
||||
cancelResultVO.setMsg(CancelResultEnum.CANCEL_FAIL.getDesc());
|
||||
payCancelDTO.setTradeChannelId(tradeChannel.getTradeChannelId());
|
||||
payCancelDTO.setPayType(tradeChannel.getPayType());
|
||||
payCancelDTO.setPayChannel(tradeChannel.getPayChannel());
|
||||
payCancelDTO.setTradeTime(tradeChannel.getTradeTime());
|
||||
|
||||
try {
|
||||
PayService payService = this.channelBusiness.beanOfChannel(tradeChannel.getPayChannel());
|
||||
cancelResultVO = payService.payCancel(payCancelDTO);
|
||||
} catch (Exception var5) {
|
||||
log.error("[渠道支付取消]异常", var5);
|
||||
cancelResultVO.setCode(CancelResultEnum.CANCEL_FAIL_RESET.getKey());
|
||||
cancelResultVO.setMsg(CancelResultEnum.CANCEL_FAIL_RESET.getDesc());
|
||||
}
|
||||
|
||||
log.info("[渠道支付取消]返回结果:{}", cancelResultVO);
|
||||
Integer payState = cancelResultVO.getCode();
|
||||
if (CancelResultEnum.CANCEL_SUCCESS.getKey().equals(payState)) {
|
||||
payState = PayStateEnum.PAY_CLOSE.getKey();
|
||||
this.tradeChannelService.updateTradeRecordChannelState(tradeChannel.getTradeChannelId(), payState, CancelResultEnum.CANCEL_SUCCESS.getDesc(), (String)null, (BigDecimal)null, (JsonNode)null, (LocalDateTime)null);
|
||||
} else {
|
||||
payState = PayStateEnum.PAY_INPROCESS.getKey();
|
||||
}
|
||||
|
||||
cancelResultVO.setPayState(payState);
|
||||
return cancelResultVO;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ package com.bonus.canteen.core.pay.common.service;
|
|||
import com.bonus.canteen.core.allocation.alloc.model.AllocPayModel;
|
||||
import com.bonus.canteen.core.order.utils.LeNumUtil;
|
||||
import com.bonus.canteen.core.pay.channel.cmb.dto.QrCodeApplyDTO;
|
||||
import com.bonus.canteen.core.pay.common.constants.CancelResultEnum;
|
||||
import com.bonus.canteen.core.pay.common.constants.PayChannelEnum;
|
||||
import com.bonus.canteen.core.pay.common.constants.PayChannelSelectEnum;
|
||||
import com.bonus.canteen.core.pay.common.constants.PayStateEnum;
|
||||
|
|
@ -127,4 +128,11 @@ public interface PayService {
|
|||
payRefundVO.setMsg("当前渠道暂不支持退款功能");
|
||||
return payRefundVO;
|
||||
}
|
||||
|
||||
default PayCancelVO payCancel(PayCancelDTO payCancelDTO) {
|
||||
PayCancelVO payCancelVO = new PayCancelVO();
|
||||
payCancelVO.setCode(CancelResultEnum.CANCEL_FAIL.getKey());
|
||||
payCancelVO.setMsg("当前渠道暂不支持取消功能");
|
||||
return payCancelVO;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ public interface TradeRecordService {
|
|||
|
||||
void updateTradeRecordState(Long tradeId, UnifyPayVO payVO);
|
||||
|
||||
void updateTradeRecordState(Long tradeId, Integer tradeState, String tradeResult);
|
||||
|
||||
void updateTradeRecordState(Long tradeId, UnifyRefundVO refundVO);
|
||||
|
||||
TradeRecord getTradeRecordById(Long tradeId);
|
||||
|
|
@ -32,4 +34,6 @@ public interface TradeRecordService {
|
|||
void deleteOrderRechargeTrade(Long tradeId);
|
||||
|
||||
List<TradeRecord> queryTradeRecordInfoList(String macOrderId, Long orderRechargeId, Integer tradeState, Integer tradeType);
|
||||
List<TradeRecord> listTradeRecordByOrderRechargeId(@Param("orderRechargeId") Long orderRechargeId, @Param("tradeState") Integer... tradeState);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,10 @@ public class TradeRecordServiceImpl extends ServiceImpl<TradeRecordMapper, Trade
|
|||
this.updateTradeRecordState(tradeId, payVO.getCode(), payVO.getMsg(), payVO.getOutTradeNo(), payVO.getPayChannel(), payVO.getPayType(), payVO.getPayTime(), payVO.getCustId());
|
||||
}
|
||||
|
||||
public void updateTradeRecordState(Long tradeId, Integer tradeState, String tradeResult) {
|
||||
this.updateTradeRecordState(tradeId, tradeState, tradeResult, (String)null, (Integer)null, (Integer)null, (LocalDateTime)null, (Long)null);
|
||||
}
|
||||
|
||||
protected void updateTradeRecordState(Long tradeId, Integer tradeState, String tradeResult, String outTradeNo, Integer payChannel, Integer payType, LocalDateTime tradeTime, Long custId) {
|
||||
log.info("[交易记录] updateTradeRecordState 开始");
|
||||
List<LocalDateTime> timeRange = LeOrderUtil.queryCreateTimeRange(tradeId);
|
||||
|
|
@ -135,5 +139,11 @@ public class TradeRecordServiceImpl extends ServiceImpl<TradeRecordMapper, Trade
|
|||
return tradeRecordList;
|
||||
}
|
||||
}
|
||||
|
||||
public List<TradeRecord> listTradeRecordByOrderRechargeId(@Param("orderRechargeId") Long orderRechargeId, @Param("tradeState") Integer... tradeState) {
|
||||
log.info("[交易记录] listTradeRecordByOrderRechargeId 开始");
|
||||
List<LocalDateTime> timeRange = LeOrderUtil.queryCreateTimeRange();
|
||||
List<TradeRecord> tradeRecords = ((TradeRecordMapper)this.baseMapper).listTradeRecordByOrderRechargeId(orderRechargeId, (LocalDateTime)timeRange.get(0), (LocalDateTime)timeRange.get(1), tradeState);
|
||||
log.info("[交易记录] listTradeRecordByOrderRechargeId 结束");
|
||||
return tradeRecords;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
package com.bonus.canteen.core.pay.custom;
|
||||
import com.bonus.canteen.core.common.custom.business.CustomBusiness;
|
||||
import com.bonus.canteen.core.pay.api.dto.UnifyPayCancelDTO;
|
||||
import com.bonus.canteen.core.pay.api.dto.UnifyPayDTO;
|
||||
import com.bonus.canteen.core.pay.api.dto.UnifyPaySelectDTO;
|
||||
import com.bonus.canteen.core.pay.api.dto.UnifyRefundDTO;
|
||||
import com.bonus.canteen.core.pay.api.vo.UnifyPayCancelVO;
|
||||
import com.bonus.canteen.core.pay.api.vo.UnifyPaySelectVO;
|
||||
import com.bonus.canteen.core.pay.api.vo.UnifyPayVO;
|
||||
import com.bonus.canteen.core.pay.api.vo.UnifyRefundVO;
|
||||
import com.bonus.canteen.core.pay.common.constants.PayChannelSelectEnum;
|
||||
import com.bonus.canteen.core.pay.common.dto.ChannelPayDTO;
|
||||
import com.bonus.canteen.core.pay.common.dto.PayCancelDTO;
|
||||
import com.bonus.canteen.core.pay.common.service.PayService;
|
||||
import com.bonus.canteen.core.pay.common.vo.PayChannelSelectDTO;
|
||||
import com.bonus.canteen.core.pay.common.vo.PayChannelSelectResultVO;
|
||||
|
|
@ -64,5 +67,13 @@ public class PayCustomBusiness implements CustomBusiness {
|
|||
|
||||
public void didPayRefundV2(UnifyRefundDTO payRefundDTO, UnifyRefundVO payRefundVO) {
|
||||
}
|
||||
public void willPayCancelV2(UnifyPayCancelDTO payCancelDTO) {
|
||||
}
|
||||
public void willChannelPayCancel(PayCancelDTO payCancelDTO) {
|
||||
}
|
||||
|
||||
public void didPayCancelV2(UnifyPayCancelDTO payCancelDTO, UnifyPayCancelVO payCancelVO) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import cn.hutool.core.util.ObjectUtil;
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bonus.canteen.core.supermarket.mapper.SupermarketConfigMapper;
|
||||
import com.bonus.canteen.core.supermarket.po.BusinessConfigModel;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.houqin.constant.DelFlagEnum;
|
||||
import com.bonus.common.houqin.constant.LeConstants;
|
||||
|
|
@ -36,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -55,9 +58,9 @@ public class SupermarketApi {
|
|||
@Autowired
|
||||
@Lazy
|
||||
private SupermarketProductMapper supermarketProductMapper;
|
||||
// @Autowired
|
||||
// @Lazy
|
||||
// private SupermarketConfigMapper supermarketConfigMapper;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private SupermarketConfigMapper supermarketConfigMapper;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private DrpServiceApi drpServiceApi;
|
||||
|
|
@ -159,19 +162,19 @@ public class SupermarketApi {
|
|||
}
|
||||
|
||||
}
|
||||
//
|
||||
// public boolean ifBusiness(Long supermarketId) {
|
||||
// int weekDay = LocalDate.now().getDayOfWeek().getValue();
|
||||
// BusinessConfigModel businessInfo = this.supermarketConfigMapper.getBusinessInfo(supermarketId, weekDay);
|
||||
// if (ObjectUtil.isEmpty(businessInfo)) {
|
||||
// throw new LeException(I18n.getMessage("supermarket.config-not-exit", new Object[0]));
|
||||
// } else if (businessInfo.getIfBusiness().equals(LeConstants.COMMON_NO)) {
|
||||
// return false;
|
||||
// } else {
|
||||
// LocalTime nowTime = LocalTime.now();
|
||||
// return nowTime.isAfter(businessInfo.getOpeningTime()) && nowTime.isBefore(businessInfo.getClosingTime());
|
||||
// }
|
||||
// }
|
||||
|
||||
public boolean ifBusiness(Long supermarketId) {
|
||||
int weekDay = LocalDate.now().getDayOfWeek().getValue();
|
||||
BusinessConfigModel businessInfo = this.supermarketConfigMapper.getBusinessInfo(supermarketId, weekDay);
|
||||
if (ObjectUtil.isEmpty(businessInfo)) {
|
||||
throw new ServiceException(I18n.getMessage("supermarket.config-not-exit", new Object[0]));
|
||||
} else if (businessInfo.getIfBusiness().equals(LeConstants.COMMON_NO)) {
|
||||
return false;
|
||||
} else {
|
||||
LocalTime nowTime = LocalTime.now();
|
||||
return nowTime.isAfter(businessInfo.getOpeningTime()) && nowTime.isBefore(businessInfo.getClosingTime());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean ifAllowRefund(Long supermarketId, LocalDateTime ordTime) {
|
||||
LocalDate ordDate = ordTime.toLocalDate();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package com.bonus.canteen.core.supermarket.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.canteen.core.supermarket.model.SupermarketConfig;
|
||||
import com.bonus.canteen.core.supermarket.po.BusinessConfigModel;
|
||||
import com.bonus.canteen.core.supermarket.vo.SupermarketConfigPageVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupermarketConfigMapper extends BaseMapper<SupermarketConfig> {
|
||||
List<SupermarketConfigPageVO> listConfig(Long supermarketId);
|
||||
|
||||
List<Integer> listReserveWeek(@Param("supermarketId") Long supermarketId, @Param("trueConfig") Integer trueConfig);
|
||||
|
||||
BusinessConfigModel getBusinessInfo(@Param("supermarketId") Long supermarketId, @Param("weekDay") Integer weekDay);
|
||||
}
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
package com.bonus.canteen.core.supermarket.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
@ApiModel(
|
||||
value = "超市营业配置表",
|
||||
description = "超市营业配置表"
|
||||
)
|
||||
public class SupermarketConfig {
|
||||
@ApiModelProperty("一周id")
|
||||
private Long weekId;
|
||||
@ApiModelProperty("超市id")
|
||||
private Long supermarketId;
|
||||
@ApiModelProperty("一周名称")
|
||||
private String weekName;
|
||||
@ApiModelProperty("一周类型 1:周一 2:周二 3:周三 4:周四 5:周五 6:周六 7:周日")
|
||||
private Integer weekType;
|
||||
@ApiModelProperty("营业开始时间")
|
||||
private LocalTime openingTime;
|
||||
@ApiModelProperty("营业结束时间")
|
||||
private LocalTime closingTime;
|
||||
@ApiModelProperty("是否营业 (1营业, 2休息)")
|
||||
private Integer ifBusiness;
|
||||
@ApiModelProperty("是否预定取货日(1是,2否)")
|
||||
private Integer ifReserveFetch;
|
||||
@ApiModelProperty("乐观锁")
|
||||
private Integer revision;
|
||||
@TableField(
|
||||
value = "crtime",
|
||||
fill = FieldFill.INSERT
|
||||
)
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime crtime;
|
||||
@TableField(
|
||||
value = "uptime",
|
||||
fill = FieldFill.UPDATE
|
||||
)
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime uptime;
|
||||
@TableField(
|
||||
value = "crby",
|
||||
fill = FieldFill.INSERT
|
||||
)
|
||||
@ApiModelProperty("创建人")
|
||||
private String crby;
|
||||
@TableField(
|
||||
value = "upby",
|
||||
fill = FieldFill.UPDATE
|
||||
)
|
||||
@ApiModelProperty("更新人")
|
||||
private String upby;
|
||||
|
||||
public Long getWeekId() {
|
||||
return this.weekId;
|
||||
}
|
||||
|
||||
public Long getSupermarketId() {
|
||||
return this.supermarketId;
|
||||
}
|
||||
|
||||
public String getWeekName() {
|
||||
return this.weekName;
|
||||
}
|
||||
|
||||
public Integer getWeekType() {
|
||||
return this.weekType;
|
||||
}
|
||||
|
||||
public LocalTime getOpeningTime() {
|
||||
return this.openingTime;
|
||||
}
|
||||
|
||||
public LocalTime getClosingTime() {
|
||||
return this.closingTime;
|
||||
}
|
||||
|
||||
public Integer getIfBusiness() {
|
||||
return this.ifBusiness;
|
||||
}
|
||||
|
||||
public Integer getIfReserveFetch() {
|
||||
return this.ifReserveFetch;
|
||||
}
|
||||
|
||||
public Integer getRevision() {
|
||||
return this.revision;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public String getCrby() {
|
||||
return this.crby;
|
||||
}
|
||||
|
||||
public String getUpby() {
|
||||
return this.upby;
|
||||
}
|
||||
|
||||
public SupermarketConfig setWeekId(final Long weekId) {
|
||||
this.weekId = weekId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setSupermarketId(final Long supermarketId) {
|
||||
this.supermarketId = supermarketId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setWeekName(final String weekName) {
|
||||
this.weekName = weekName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setWeekType(final Integer weekType) {
|
||||
this.weekType = weekType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setOpeningTime(final LocalTime openingTime) {
|
||||
this.openingTime = openingTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setClosingTime(final LocalTime closingTime) {
|
||||
this.closingTime = closingTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setIfBusiness(final Integer ifBusiness) {
|
||||
this.ifBusiness = ifBusiness;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setIfReserveFetch(final Integer ifReserveFetch) {
|
||||
this.ifReserveFetch = ifReserveFetch;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setRevision(final Integer revision) {
|
||||
this.revision = revision;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setCrby(final String crby) {
|
||||
this.crby = crby;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SupermarketConfig setUpby(final String upby) {
|
||||
this.upby = upby;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Long var10000 = this.getWeekId();
|
||||
return "SupermarketConfig(weekId=" + var10000 + ", supermarketId=" + this.getSupermarketId() + ", weekName=" + this.getWeekName() + ", weekType=" + this.getWeekType() + ", openingTime=" + String.valueOf(this.getOpeningTime()) + ", closingTime=" + String.valueOf(this.getClosingTime()) + ", ifBusiness=" + this.getIfBusiness() + ", ifReserveFetch=" + this.getIfReserveFetch() + ", revision=" + this.getRevision() + ", crtime=" + String.valueOf(this.getCrtime()) + ", uptime=" + String.valueOf(this.getUptime()) + ", crby=" + this.getCrby() + ", upby=" + this.getUpby() + ")";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.bonus.canteen.core.supermarket.po;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.time.LocalTime;
|
||||
|
||||
@ApiModel
|
||||
public class BusinessConfigModel {
|
||||
@ApiModelProperty("是否营业")
|
||||
private Integer ifBusiness;
|
||||
@ApiModelProperty("营业开始时间")
|
||||
private LocalTime openingTime;
|
||||
@ApiModelProperty("营业结束时间")
|
||||
private LocalTime closingTime;
|
||||
|
||||
public Integer getIfBusiness() {
|
||||
return this.ifBusiness;
|
||||
}
|
||||
|
||||
public LocalTime getOpeningTime() {
|
||||
return this.openingTime;
|
||||
}
|
||||
|
||||
public LocalTime getClosingTime() {
|
||||
return this.closingTime;
|
||||
}
|
||||
|
||||
public void setIfBusiness(final Integer ifBusiness) {
|
||||
this.ifBusiness = ifBusiness;
|
||||
}
|
||||
|
||||
public void setOpeningTime(final LocalTime openingTime) {
|
||||
this.openingTime = openingTime;
|
||||
}
|
||||
|
||||
public void setClosingTime(final LocalTime closingTime) {
|
||||
this.closingTime = closingTime;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Integer var10000 = this.getIfBusiness();
|
||||
return "BusinessConfigModel(ifBusiness=" + var10000 + ", openingTime=" + String.valueOf(this.getOpeningTime()) + ", closingTime=" + String.valueOf(this.getClosingTime()) + ")";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package com.bonus.canteen.core.supermarket.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.time.LocalTime;
|
||||
|
||||
@ApiModel(
|
||||
value = "超市营业配置表",
|
||||
description = "超市营业配置表"
|
||||
)
|
||||
public class SupermarketConfigPageVO {
|
||||
@ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
@ApiModelProperty("一周id")
|
||||
private Long weekId;
|
||||
@ApiModelProperty("超市id")
|
||||
private Long supermarketId;
|
||||
@ApiModelProperty("一周名称")
|
||||
private String weekName;
|
||||
@ApiModelProperty("一周类型 1:周一 2:周二 3:周三 4:周四 5:周五 6:周六 7:周日")
|
||||
private Integer weekType;
|
||||
@ApiModelProperty("营业开始时间")
|
||||
private LocalTime openingTime;
|
||||
@ApiModelProperty("营业结束时间")
|
||||
private LocalTime closingTime;
|
||||
@ApiModelProperty("是否营业 (1营业, 2休息)")
|
||||
private Integer ifBusiness;
|
||||
@ApiModelProperty("是否预定取货日(1是,2否)")
|
||||
private Integer ifReserveFetch;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getWeekId() {
|
||||
return this.weekId;
|
||||
}
|
||||
|
||||
public Long getSupermarketId() {
|
||||
return this.supermarketId;
|
||||
}
|
||||
|
||||
public String getWeekName() {
|
||||
return this.weekName;
|
||||
}
|
||||
|
||||
public Integer getWeekType() {
|
||||
return this.weekType;
|
||||
}
|
||||
|
||||
public LocalTime getOpeningTime() {
|
||||
return this.openingTime;
|
||||
}
|
||||
|
||||
public LocalTime getClosingTime() {
|
||||
return this.closingTime;
|
||||
}
|
||||
|
||||
public Integer getIfBusiness() {
|
||||
return this.ifBusiness;
|
||||
}
|
||||
|
||||
public Integer getIfReserveFetch() {
|
||||
return this.ifReserveFetch;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setWeekId(final Long weekId) {
|
||||
this.weekId = weekId;
|
||||
}
|
||||
|
||||
public void setSupermarketId(final Long supermarketId) {
|
||||
this.supermarketId = supermarketId;
|
||||
}
|
||||
|
||||
public void setWeekName(final String weekName) {
|
||||
this.weekName = weekName;
|
||||
}
|
||||
|
||||
public void setWeekType(final Integer weekType) {
|
||||
this.weekType = weekType;
|
||||
}
|
||||
|
||||
public void setOpeningTime(final LocalTime openingTime) {
|
||||
this.openingTime = openingTime;
|
||||
}
|
||||
|
||||
public void setClosingTime(final LocalTime closingTime) {
|
||||
this.closingTime = closingTime;
|
||||
}
|
||||
|
||||
public void setIfBusiness(final Integer ifBusiness) {
|
||||
this.ifBusiness = ifBusiness;
|
||||
}
|
||||
|
||||
public void setIfReserveFetch(final Integer ifReserveFetch) {
|
||||
this.ifReserveFetch = ifReserveFetch;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Long var10000 = this.getId();
|
||||
return "SupermarketConfigPageVO(id=" + var10000 + ", weekId=" + this.getWeekId() + ", supermarketId=" + this.getSupermarketId() + ", weekName=" + this.getWeekName() + ", weekType=" + this.getWeekType() + ", openingTime=" + String.valueOf(this.getOpeningTime()) + ", closingTime=" + String.valueOf(this.getClosingTime()) + ", ifBusiness=" + this.getIfBusiness() + ", ifReserveFetch=" + this.getIfReserveFetch() + ")";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.canteen.core.supermarket.mapper.SupermarketConfigMapper">
|
||||
|
||||
<select id="listConfig" resultType="com.bonus.canteen.core.supermarket.vo.SupermarketConfigPageVO">
|
||||
SELECT
|
||||
week_id,
|
||||
supermarket_id,
|
||||
week_name,
|
||||
week_type,
|
||||
opening_time,
|
||||
closing_time,
|
||||
if_business,
|
||||
if_reserve_fetch
|
||||
FROM
|
||||
supermarket_config
|
||||
WHERE
|
||||
supermarket_id = #{supermarketId}
|
||||
</select>
|
||||
<select id="listReserveWeek" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
week_type
|
||||
FROM
|
||||
supermarket_config
|
||||
WHERE
|
||||
supermarket_id = #{supermarketId}
|
||||
AND if_business = #{trueConfig}
|
||||
AND if_reserve_fetch = #{trueConfig}
|
||||
ORDER BY
|
||||
week_type
|
||||
</select>
|
||||
<select id="getBusinessInfo" resultType="com.bonus.canteen.core.supermarket.po.BusinessConfigModel">
|
||||
SELECT
|
||||
if_business,
|
||||
opening_time,
|
||||
closing_time
|
||||
FROM
|
||||
supermarket_config
|
||||
WHERE
|
||||
supermarket_id = #{supermarketId}
|
||||
AND week_type = #{weekDay}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue