|
|
|
@ -1,14 +1,20 @@ |
|
|
|
|
package com.hai.service.impl; |
|
|
|
|
|
|
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
|
import com.hai.common.utils.DateUtil; |
|
|
|
|
import com.hai.dao.HighOrderPreMapper; |
|
|
|
|
import com.hai.entity.HighOrder; |
|
|
|
|
import com.hai.entity.HighOrderPre; |
|
|
|
|
import com.hai.entity.HighOrderPreExample; |
|
|
|
|
import com.hai.service.HighOrderPreService; |
|
|
|
|
import com.hai.service.HighOrderService; |
|
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.util.Date; |
|
|
|
@ -21,6 +27,9 @@ public class HighOrderPreServiceImpl implements HighOrderPreService { |
|
|
|
|
@Resource |
|
|
|
|
private HighOrderPreMapper highOrderPreMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighOrderService highOrderService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<HighOrderPre> getListOrderPre(Map<String, Object> map) { |
|
|
|
|
HighOrderPreExample example = new HighOrderPreExample(); |
|
|
|
@ -112,4 +121,22 @@ public class HighOrderPreServiceImpl implements HighOrderPreService { |
|
|
|
|
public void updateOrderPre(HighOrderPre highOrderPre) { |
|
|
|
|
highOrderPreMapper.updateByPrimaryKey(highOrderPre); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(propagation= Propagation.REQUIRES_NEW) |
|
|
|
|
public void orderComplete(Long preOrderId) { |
|
|
|
|
// 查询预约订单详情
|
|
|
|
|
HighOrderPre orderPre = findByOrderId(preOrderId); |
|
|
|
|
if (orderPre == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到预约订单"); |
|
|
|
|
} |
|
|
|
|
if (orderPre.getStatus() != 2) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
orderPre.setStatus(3); |
|
|
|
|
orderPre.setUpdateTime(new Date()); |
|
|
|
|
updateOrderPre(orderPre); |
|
|
|
|
|
|
|
|
|
highOrderService.childOrderComplete(orderPre.getChildOrderId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|