|
@@ -104,6 +104,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
private ClassGroupService classGroupService;
|
|
|
@Autowired
|
|
|
private StudentPaymentOrderService studentPaymentOrderService;
|
|
|
+ @Autowired
|
|
|
+ private ContractService contractService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, VipGroup> getDAO() {
|
|
@@ -958,7 +960,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
BigDecimal amount=vipGroup.getTotalPrice();
|
|
|
|
|
|
if(vipGroupBuyParams.isUseBalancePayment() || amount.doubleValue() == 0){
|
|
|
- SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(vipGroupBuyParams.getUserId());
|
|
|
+ SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(user.getId());
|
|
|
if(userCashAccount == null){
|
|
|
throw new BizException("用户账户找不到");
|
|
|
}
|
|
@@ -967,28 +969,31 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
studentPaymentOrder.setBalancePaymentAmount(amount);
|
|
|
studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
|
|
|
studentPaymentOrder.setUpdateTime(date);
|
|
|
- studentPaymentOrderService.update(studentPaymentOrder);
|
|
|
- studentPaymentOrder.setVersion(studentPaymentOrder.getVersion()+1);
|
|
|
|
|
|
- sysUserCashAccountService.updateBalance(vipGroupBuyParams.getUserId(), amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
|
|
|
+ this.orderCallback(studentPaymentOrder);
|
|
|
+
|
|
|
+ sysUserCashAccountService.updateBalance(user.getId(), amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
|
|
|
|
|
|
- return null;
|
|
|
+ Map<String,Object> result=new HashMap<>();
|
|
|
+ result.put("orderNo",studentPaymentOrder.getOrderNo());
|
|
|
+
|
|
|
+ return result;
|
|
|
}else{
|
|
|
if (userCashAccount.getBalance().doubleValue() > 0) {
|
|
|
- sysUserCashAccountService.updateBalance(vipGroupBuyParams.getUserId(), userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
|
|
|
amount = amount.subtract(userCashAccount.getBalance());
|
|
|
studentPaymentOrder.setBalancePaymentAmount(userCashAccount.getBalance());
|
|
|
+ sysUserCashAccountService.updateBalance(user.getId(), userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
|
|
|
} else {
|
|
|
studentPaymentOrder.setBalancePaymentAmount(new BigDecimal(0));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// try {
|
|
|
-// contractService.register(user.getId(),user.getRealName(),user.getIdCardNo(),user.getPhone());
|
|
|
-// } catch (Exception e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
+ try {
|
|
|
+ contractService.register(user.getId(),user.getRealName(),user.getIdCardNo(),user.getPhone());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
try {
|
|
|
Map<String,Object> payMap = payService.getPayMap(
|
|
@@ -1073,11 +1078,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
vipGroup.setOrganIdList(organIdsString);
|
|
|
vipGroupDao.update(vipGroup);
|
|
|
|
|
|
-// try {
|
|
|
-// contractService.transferVipGroupCoursesContract(userId,vipGroupId);
|
|
|
-// } catch (Exception e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
+ try {
|
|
|
+ contractService.transferVipGroupCoursesContract(userId,vipGroupId);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -1678,4 +1683,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
vipGroupPayInfo.setBalance(sysUserCashAccount.getBalance());
|
|
|
return vipGroupPayInfo;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public VipBuyResultDto findVipBuyResultInfo(Integer vipGroupId) {
|
|
|
+ return vipGroupDao.getVipBuyResultInfo(vipGroupId);
|
|
|
+ }
|
|
|
}
|