Bladeren bron

账单添加周期

wangPH 1 jaar geleden
bovenliggende
commit
17b980e664

+ 2 - 0
background-common/src/main/java/cn/kdan/compdf/enums/ResponseEnum.java

@@ -21,6 +21,8 @@ public enum ResponseEnum {
     ERROR_INCOMPLETE_BILLING_INFORMATION("709","需要完善账单信息后进行申请开票"),
     ERROR_NEW_NAME_CANNOT_BE_EMPTY("710","新名称不能为空"),
 
+    ERROR_ASSET_TYPE_IS_NOT_SUPPORTED_YET("711","资产类型暂不支持"),
+
     SYSTEM_ERROR("500","系统内部异常"),
 
     ;

+ 6 - 0
background-user/src/main/java/cn/kdan/compdf/entity/BackgroundUserRemain.java

@@ -49,4 +49,10 @@ public class BackgroundUserRemain extends BaseEntity {
 
     private LocalDateTime endDate;
 
+
+    /**
+     * 周期 1:月  2:年
+     */
+    private Integer cycle;
+
 }

+ 4 - 0
background-user/src/main/java/cn/kdan/compdf/service/impl/BackgroundUserBalanceServiceImpl.java

@@ -12,6 +12,8 @@ import cn.kdan.compdf.dto.PlanStatisticsDTO;
 import cn.kdan.compdf.entity.BackgroundUserBalance;
 import cn.kdan.compdf.entity.BackgroundUserRemain;
 import cn.kdan.compdf.enums.DateTImeFormatEnum;
+import cn.kdan.compdf.enums.ResponseEnum;
+import cn.kdan.compdf.exception.BusinessException;
 import cn.kdan.compdf.mapper.BackgroundUserBalanceMapper;
 import cn.kdan.compdf.service.BackgroundUserBalanceService;
 import cn.kdan.compdf.service.BackgroundUserRemainService;
@@ -311,8 +313,10 @@ public class BackgroundUserBalanceServiceImpl extends ServiceImpl<BackgroundUser
                 case 1:
                     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;
+                default: throw new BusinessException(ResponseEnum.ERROR_ASSET_TYPE_IS_NOT_SUPPORTED_YET);
             }
             return billVO;
         }).collect(Collectors.toList());

+ 5 - 0
background-user/src/main/java/cn/kdan/compdf/vo/BillVO.java

@@ -27,6 +27,11 @@ public class BillVO {
 
     private LocalDate endDate;
 
+    /**
+     * 周期 1:月  2:年
+     */
+    private Integer cycle;
+
 
 
 }