|
@@ -4,10 +4,7 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.dal.page.SporadicChargeInfoQueryInfo;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
@@ -53,6 +50,8 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
|
|
|
private DegreeRegistrationService degreeRegistrationService;
|
|
|
@Autowired
|
|
|
private ContractService contractService;
|
|
|
+ @Autowired
|
|
|
+ private LuckDrawCountService luckDrawCountService;
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
@@ -85,6 +84,13 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
|
|
|
|
|
|
//福袋活动,增加课程余额
|
|
|
if (info.getChargeType().getCode() == 6 || info.getChargeType().getCode() == 12) {
|
|
|
+ //第二单起每买一单增加一次抽奖机会
|
|
|
+ int num = studentPaymentOrderDao.getUserOrderNumByType(userId, OrderTypeEnum.DOUBLE_ELEVEN2020);
|
|
|
+ if (num > 1) {
|
|
|
+ if (!luckDrawCountService.updateTimes(userId.longValue(), 1)) {
|
|
|
+ throw new BizException("给用户增加抽奖次数失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
sysUserCashAccountService.appendCourseBalance(userId, studentPaymentOrder.getActualAmount(), PlatformCashAccountDetailTypeEnum.SPORADIC, "双11活动");
|
|
|
} else if (info.getChargeType().getCode() == 9) { //零星收费账户充值
|
|
|
sysUserCashAccountService.updateBalance(userId, studentPaymentOrder.getActualAmount(), PlatformCashAccountDetailTypeEnum.RECHARGE, "零星收费账户充值", studentPaymentOrder.getTransNo());
|