|
@@ -1,18 +1,14 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.dao.SysUserCashAccountLogDao;
|
|
|
+import com.ym.mec.biz.dal.entity.SysUserCashAccountLog;
|
|
|
import com.ym.mec.biz.service.SysConfigService;
|
|
|
-import com.ym.mec.biz.service.SysTenantConfigService;
|
|
|
+import com.ym.mec.biz.service.SysUserCashAccountLogService;
|
|
|
import com.ym.mec.common.constant.CommonConstants;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
-import com.ym.mec.common.page.PageInfo;
|
|
|
-import com.ym.mec.common.page.QueryInfo;
|
|
|
-import com.ym.mec.common.tenant.TenantContextHolder;
|
|
|
+import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
-import com.ym.mec.biz.dal.entity.SysUserCashAccountLog;
|
|
|
-import com.ym.mec.biz.service.SysUserCashAccountLogService;
|
|
|
-import com.ym.mec.biz.dal.dao.SysUserCashAccountLogDao;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
@@ -22,8 +18,6 @@ public class SysUserCashAccountLogServiceImpl extends BaseServiceImpl<Long, SysU
|
|
|
|
|
|
@Autowired
|
|
|
private SysUserCashAccountLogDao sysUserCashAccountLogDao;
|
|
|
- @Autowired
|
|
|
- private SysTenantConfigService sysTenantConfigService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, SysUserCashAccountLog> getDAO() {
|
|
@@ -32,28 +26,26 @@ public class SysUserCashAccountLogServiceImpl extends BaseServiceImpl<Long, SysU
|
|
|
|
|
|
@Override
|
|
|
public BigDecimal musicReturnFeeCharges(BigDecimal returnFee, Integer size) {
|
|
|
- Integer tenantId = TenantContextHolder.getTenantId();
|
|
|
String configName = SysConfigService.MUSIC_COURSE_START_RETURN_FEE_CHARGES;
|
|
|
if(size == null || size == 0){
|
|
|
configName = SysConfigService.MUSIC_RETURN_FEE_CHARGES;
|
|
|
}
|
|
|
- return calcCharges(returnFee,sysTenantConfigService.getTenantConfigValue(configName, tenantId));
|
|
|
+ return calcCharges(returnFee,configName);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public BigDecimal vipReturnFeeCharges(BigDecimal returnFee, Integer size) {
|
|
|
- Integer tenantId = TenantContextHolder.getTenantId();
|
|
|
String configName = SysConfigService.VIP_1VN_COURSE_NOT_START_RETURN_FEE_CHARGES;
|
|
|
if(size == null || size <= 1){
|
|
|
configName = SysConfigService.VIP_1V1_COURSE_NOT_START_RETURN_FEE_CHARGES;
|
|
|
}
|
|
|
- return calcCharges(returnFee,sysTenantConfigService.getTenantConfigValue(configName, tenantId));
|
|
|
+ return calcCharges(returnFee,configName);
|
|
|
}
|
|
|
|
|
|
private BigDecimal calcCharges(BigDecimal returnFee,String configValue){
|
|
|
double returnFeeCharges = 1;
|
|
|
if(StringUtils.isNotEmpty(configValue)){
|
|
|
- returnFeeCharges = 1 - (Double.parseDouble(configValue) / 100);
|
|
|
+ returnFeeCharges = Double.parseDouble(configValue) / 100;
|
|
|
}
|
|
|
return returnFee.multiply(new BigDecimal(returnFeeCharges)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|