|
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.kdan.compdf.config.ExcelWidthStyleStrategy;
|
|
|
+import cn.kdan.compdf.constant.AssetTypeEnum;
|
|
|
import cn.kdan.compdf.constant.UserBalanceConstant;
|
|
|
import cn.kdan.compdf.dto.AddFreePlanDTO;
|
|
|
import cn.kdan.compdf.dto.Asset;
|
|
@@ -304,18 +305,19 @@ public class BackgroundUserBalanceServiceImpl extends ServiceImpl<BackgroundUser
|
|
|
BillVO billVO = new BillVO();
|
|
|
billVO.setAssetType(userRemain.getAssetType());
|
|
|
billVO.setTotalFiles(userRemain.getTotalFiles());
|
|
|
- switch (userRemain.getAssetType()) {
|
|
|
- case 3:
|
|
|
+ // 资产类型enum
|
|
|
+ switch (AssetTypeEnum.getByValue(userRemain.getAssetType())) {
|
|
|
+ case FREE:
|
|
|
LocalDateTime userFirstLogin = userService.getUSerFirstLogin(TokenUtil.getRequestHeader().getTenantId());
|
|
|
billVO.setStartDate(userFirstLogin.toLocalDate().compareTo(this.getFirstDayOfMonth()) < 0 ? this.getFirstDayOfMonth() : userFirstLogin.toLocalDate() );
|
|
|
billVO.setEndDate(this.getLastDayOfMonth());
|
|
|
break;
|
|
|
- case 1:
|
|
|
+ case SUBSCRIPTION:
|
|
|
billVO.setStartDate(ObjectUtil.isNotEmpty(userRemain.getStartDate()) ? userRemain.getStartDate().toLocalDate() : null);
|
|
|
billVO.setEndDate(ObjectUtil.isNotEmpty(userRemain.getEndDate()) ? userRemain.getEndDate().toLocalDate() : null);
|
|
|
billVO.setCycle(userRemain.getCycle());
|
|
|
break;
|
|
|
- case 2: break;
|
|
|
+ case PACKAGE: break;
|
|
|
default: throw new BusinessException(ResponseEnum.ERROR_ASSET_TYPE_IS_NOT_SUPPORTED_YET);
|
|
|
}
|
|
|
return billVO;
|