Commit b20a9465 by wuwenlong

续单支付回调与主订单冲突bugfix;

parent e7d70189
......@@ -1828,12 +1828,15 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
queryWrapper.eq(SOrder::getIsDelete, YesNoEnum.no.getIndex());
queryWrapper.eq(SOrder::getStoreId, sOrder.getStoreId());
queryWrapper.eq(SOrder::getRoomId, sOrder.getRoomId());
queryWrapper.apply("(IFNULL(start_date,pre_start_date) BETWEEN '"
String sql = "IFNULL(start_date,pre_start_date) BETWEEN '"
+ DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, sOrder.getPreStartDate())
+ "' AND '" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addMinutes(sOrder.getPreEndDate(), Constants.ROOM_LOCK_DELAY_MINUTE)) + "' " +
"OR IFNULL(end_date,pre_end_date) BETWEEN '"
+ "' AND '" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addMinutes(sOrder.getPreEndDate(), Constants.ROOM_LOCK_DELAY_MINUTE)) + "' ";
if(sOrder.getOrderType().compareTo(OrderTypeEnum.RENEW.getCode())!=0) {
sql += "OR IFNULL(end_date,pre_end_date) BETWEEN '"
+ DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addMinutes(sOrder.getPreStartDate(), -Constants.ROOM_LOCK_DELAY_MINUTE))
+ "' AND '" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, sOrder.getPreEndDate()) + "' )");
+ "' AND '" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, sOrder.getPreEndDate()) + "'";
}
queryWrapper.apply("("+ sql +")");
SOrder order = getOne(queryWrapper);
if (ObjectUtil.isNotEmpty(order)) {
baseMapper.updateSOrder(sOrder);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment