|
|
@ -8,13 +8,11 @@ import com.hai.common.utils.DateUtil; |
|
|
|
import com.hai.common.utils.IDGenerator; |
|
|
|
import com.hai.common.utils.IDGenerator; |
|
|
|
import com.hai.dao.HighCouponCodeMapper; |
|
|
|
import com.hai.dao.HighCouponCodeMapper; |
|
|
|
import com.hai.dao.HighCouponCodeMapperExt; |
|
|
|
import com.hai.dao.HighCouponCodeMapperExt; |
|
|
|
import com.hai.entity.HighChildOrder; |
|
|
|
import com.hai.entity.*; |
|
|
|
import com.hai.entity.HighCouponCode; |
|
|
|
|
|
|
|
import com.hai.entity.HighCouponCodeExample; |
|
|
|
|
|
|
|
import com.hai.entity.HighOrder; |
|
|
|
|
|
|
|
import com.hai.model.UserInfoModel; |
|
|
|
import com.hai.model.UserInfoModel; |
|
|
|
import com.hai.service.HighCouponCodeService; |
|
|
|
import com.hai.service.HighCouponCodeService; |
|
|
|
import com.hai.service.HighOrderService; |
|
|
|
import com.hai.service.HighOrderService; |
|
|
|
|
|
|
|
import com.hai.service.HighUserCouponService; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -44,6 +42,9 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private HighOrderService highOrderService; |
|
|
|
private HighOrderService highOrderService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HighUserCouponService highUserCouponService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void insertCouponCode(HighCouponCode highCouponCode) { |
|
|
|
public void insertCouponCode(HighCouponCode highCouponCode) { |
|
|
|
highCouponCodeMapper.insert(highCouponCode); |
|
|
|
highCouponCodeMapper.insert(highCouponCode); |
|
|
@ -91,6 +92,14 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { |
|
|
|
salesCode.setStatus(3); |
|
|
|
salesCode.setStatus(3); |
|
|
|
updateCouponCode(salesCode); |
|
|
|
updateCouponCode(salesCode); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//修改 用户与卡卷的关系
|
|
|
|
|
|
|
|
HighUserCoupon userCoupon = highUserCouponService.getDetailByCodeId(salesCode.getId()); |
|
|
|
|
|
|
|
if (userCoupon == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "卡卷状态异常"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
userCoupon.setStatus(2); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
|
|
|
|
highUserCouponService.updateUserCoupon(userCoupon); |
|
|
|
|
|
|
|
|
|
|
|
highOrderService.childOrderComplete(salesCode.getChildOrderId()); |
|
|
|
highOrderService.childOrderComplete(salesCode.getChildOrderId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|