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.dao.HighApproveMapper; import com.hai.entity.HighApprove; import com.hai.entity.HighCoupon; import com.hai.enum_type.ApproveType; import com.hai.model.HighCouponModel; import com.hai.service.HighApproveService; import com.hai.service.HighCouponService; 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; import java.util.Objects; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/14 20:47 */ @Service("highApproveService") public class HighApproveServiceImpl implements HighApproveService { @Resource private HighApproveMapper highApproveMapper; @Resource private HighCouponService highCouponService; @Override @Transactional(propagation= Propagation.REQUIRES_NEW) public void insertApprove(HighApprove highApprove) { // 卡卷上架审批 if (Objects.equals(highApprove.getObjectType(), ApproveType.UP_SHELF_APPROVE.getType())) { highCouponService.upShelfApprove(highApprove.getObjectId()); } highApproveMapper.insert(highApprove); } }