From f6b0e262db2af5ca2e5ed76f95e746c1dd3c58e3 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 01 二月 2024 15:17:47 +0800
Subject: [PATCH] 开发业务接口

---
 server/service/src/main/java/com/doumee/core/utils/Constants.java |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/server/service/src/main/java/com/doumee/core/utils/Constants.java b/server/service/src/main/java/com/doumee/core/utils/Constants.java
index f2b834f..14fe22d 100644
--- a/server/service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -3,6 +3,7 @@
 import com.doumee.core.constants.ResponseStatus;
 import com.doumee.core.exception.BusinessException;
 import com.doumee.dao.business.model.Solutions;
+import com.doumee.dao.business.vo.CountCyclePriceVO;
 import io.swagger.models.auth.In;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
@@ -159,6 +160,23 @@
         LocalDate currentDate = LocalDate.now();
         long age = ChronoUnit.YEARS.between(birthDate, currentDate);
         return age;
+    }
+
+
+    public static CountCyclePriceVO countPriceVO(Date startDate, Solutions solutions){
+        CountCyclePriceVO countCyclePriceVO = new CountCyclePriceVO();
+        if(solutions.getInsureCycleUnit().equals(Constants.ZERO)){
+            countCyclePriceVO.setEndDate(DateUtil.afterDateByType(startDate,0,solutions.getInsureCycle()));
+        }else if(solutions.getInsureCycleUnit().equals(Constants.TWO)){
+            Integer monthDays = DateUtil.monthDays(startDate);
+            Date afterDate = DateUtil.afterDateByType(startDate,0,monthDays);
+            countCyclePriceVO.setEndDate(DateUtil.afterDateByType(afterDate,0,-1));
+        }else if(solutions.getInsureCycleUnit().equals(Constants.THREE)){
+            Date afterDate = DateUtil.afterDateByType(startDate,2,solutions.getInsureCycle());
+            countCyclePriceVO.setEndDate(DateUtil.afterDateByType(afterDate,0,-1));
+        }
+        countCyclePriceVO.setCyclePrice(Constants.countDetailFee(solutions,countCyclePriceVO.getEndDate(),startDate));
+        return countCyclePriceVO;
     }
 
     public static Integer getSexByIdCard(String idCard){
@@ -1402,6 +1420,7 @@
                     }
                 }
                 zipOutputStream.closeArchiveEntry();
+                file.delete();
             }
         }
     }

--
Gitblit v1.9.3