From ac1c48e5ae523ec6f62366542478bc5d451326a0 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 22 一月 2024 18:18:21 +0800
Subject: [PATCH] 开发业务接口

---
 server/service/src/main/java/com/doumee/core/utils/Constants.java |  198 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 177 insertions(+), 21 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 b8bf63d..8cf62e0 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
@@ -1,5 +1,8 @@
 package com.doumee.core.utils;
 
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
+import com.doumee.dao.business.model.Solutions;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 
@@ -7,6 +10,7 @@
 import java.math.BigDecimal;
 import java.net.URLDecoder;
 import java.util.*;
+import java.util.Date;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -66,6 +70,8 @@
     public static final String COMPANY_FILE ="COMPANY_FILE" ;
     public static final String SMS_COMNAME = "SMS_COMNAME";
     public static final String TAXES_FILE = "TAXES_FILE";
+    public static final String APPLY_FILE ="APPLY_FILE" ;
+    public static final String SETTLE_FILE ="SETTLE_FILE" ;
 
     /**
      * 浼佷笟鏁版嵁鏉ユ簮 0骞冲彴娉ㄥ唽 1鍚庡彴瀵煎叆
@@ -93,6 +99,15 @@
 //        d = d.setScale(2, BigDecimal.ROUND_HALF_UP);
         return  d;
     }
+    public static BigDecimal formatBigdecimal2Float(BigDecimal d) {
+        if (d == null) {
+            d = new BigDecimal(0.0);
+        }
+        //淇濈暀涓や綅灏忔暟涓斿洓鑸嶄簲鍏�
+        d = d.setScale(2, BigDecimal.ROUND_HALF_UP);
+        return  d;
+    }
+
     public static BigDecimal formatBigdecimal4Float(BigDecimal d) {
         if (d == null) {
             d = new BigDecimal(0.0);
@@ -605,24 +620,28 @@
 
 
     public  enum ApplyLogType {
-        UPLOAD(0, "鎻愪氦鎶曚繚鐢宠"),
-        PLATFORM_RETURN(1, "骞冲彴閫�鍥炰繚鍗�"),
-        WAIT_SIGNATURE(2, "宸蹭笂浼犱唬绛剧敵璇疯〃寰呬紒涓氱绔�"),
-        SIGNATURE(3, "宸茬绔犲緟涓婁紶淇濋櫓鍗�"),
-        FAIL_RETURN(4, "淇濆崟鍑哄叿澶辫触閫�鍥�"),
-        UPLOAD_INSURANCE(5, "宸蹭笂浼犱繚鍗�"),
-        COMPANY_APPLY_RETURN(6, "浼佷笟鐢宠閫�鍥�"),
-        COMPANY_APPLY_CLOSE(7, "浼佷笟鍏抽棴鐢宠"),
-        PLATFORM_AGREE(8, "骞冲彴鍚屾剰浼佷笟閫�鍥炵敵璇�"),
-        PLATFORM_UN_AGREE(9, "骞冲彴鎷掔粷浼佷笟閫�鍥炵敵璇�"),
+        UPLOAD(0, "鎻愪氦鎶曚繚","鎻愪氦鎰忚锛�${param}"),
+        PLATFORM_RETURN(1, "閫�鍥炴姇淇�","鎻愪氦鎰忚锛�${param}"),
+        WAIT_SIGNATURE(2, "涓婁紶鎶曚繚鍗�","鎻愪氦鎰忚锛�${param}"),
+        SIGNATURE(3, "浼佷笟绛剧珷",""),
+        FAIL_RETURN(4, "淇濆崟鍑哄叿澶辫触閫�鍥�","鎻愪氦鎰忚锛�${param}"),
+        UPLOAD_INSURANCE(5, "淇濆崟瀹屾垚","淇濋櫓鐢熸晥璧锋湡锛�${param1}鍙樻洿涓�${param2}"),
+        COMPANY_APPLY_RETURN(6, "鐢宠閫�鍥�","鎻愪氦鎰忚锛�${param}"),
+        COMPANY_APPLY_CLOSE(7, "鍏抽棴鐢宠",""),
+        PLATFORM_AGREE_BACK(8, "鍚屾剰閫�鍥炵敵璇�",""),
+        PLATFORM_UN_AGREE_BACK(9, "椹冲洖閫�鍥炵敵璇�","鎻愪氦鎰忚锛�${param}"),
+        COMPANY_EDIT(10, "淇濆崟淇敼","鎻愪氦鎰忚锛�${param1}\n${param2}"),
+        PLATFORM_CHECK_PASS(11, "鎶曚繚瀹℃牳閫氳繃",""),
         ;
         // 鎴愬憳鍙橀噺
         private String name;
+        private String info;
         private int key;
 
         // 鏋勯�犳柟娉�
-        ApplyLogType(int key, String name) {
+        ApplyLogType(int key, String name,String info) {
             this.name = name;
+            this.info = info;
             this.key = key;
         }
 
@@ -631,6 +650,14 @@
             for (ApplyLogType c : ApplyLogType.values()) {
                 if (c.getKey() == index) {
                     return c.name;
+                }
+            }
+            return null;
+        }
+        public static String getInfo(int index) {
+            for (ApplyLogType c : ApplyLogType.values()) {
+                if (c.getKey() == index) {
+                    return c.info;
                 }
             }
             return null;
@@ -653,25 +680,109 @@
             this.key = key;
         }
 
+        public String getInfo() {
+            return info;
+        }
+
+        public void setInfo(String info) {
+            this.info = info;
+        }
     }
 
     public  enum InsuranceApplyStatus {
-        UPLOAD(0, "鎻愪氦鎶曚繚鐢宠"),
-        PLATFORM_RETURN(1, "骞冲彴閫�鍥炰繚鍗�"),
-        WAIT_SIGNATURE(2, "宸蹭笂浼犱唬绛剧敵璇疯〃寰呬紒涓氱绔�"),
-        SIGNATURE(3, "宸茬绔犲緟涓婁紶淇濋櫓鍗�"),
-        FAIL_RETURN(4, "淇濆崟鍑哄叿澶辫触閫�鍥�"),
-        UPLOAD_INSURANCE(5, "宸蹭笂浼犱繚鍗�"),
-        COMPANY_APPLY_RETURN(6, "浼佷笟鐢宠閫�鍥�"),
-        COMPANY_APPLY_CLOSE(7, "浼佷笟鍏抽棴鐢宠"),
-        CLOSE(8, "璁㈠崟鍏抽棴"),
+        UPLOAD(0, "鎻愪氦鎶曚繚",""),
+        PLATFORM_RETURN(1, "瀹℃牳涓嶉�氳繃","鎻愪氦鎰忚锛�${param}"),
+        WAIT_SIGNATURE(2, "宸蹭笂浼犱唬绛剧敵璇疯〃寰呬紒涓氱绔�",""),
+        SIGNATURE(3, "宸茬绔犲緟涓婁紶淇濋櫓鍗�",""),
+        FAIL_RETURN(4, "淇濆崟鍑哄叿澶辫触閫�鍥�",""),
+        UPLOAD_INSURANCE(5, "淇濆崟瀹屾垚","淇濋櫓鐢熸晥璧锋湡锛�${param}鍙樻洿涓�${param1}"),
+        COMPANY_APPLY_RETURN(6, "浼佷笟鐢宠閫�鍥�(涓嶅彲椹冲洖)","鎻愪氦鎰忚锛�${param}"),
+        COMPANY_APPLY_RETURN_SELECT(7, "浼佷笟鐢宠閫�鍥�(鍙┏鍥�)","鎻愪氦鎰忚锛�${param}"),
+        CLOSE(8, "璁㈠崟鍏抽棴",""),
+        PLATFORM_CHECK_PASS(9,"骞冲彴鎶曚繚瀹℃牳閫氳繃",""),
+        ;
+        // 鎴愬憳鍙橀噺
+        private String name;
+        private String info;
+        private int key;
+
+        // 鏋勯�犳柟娉�
+        InsuranceApplyStatus(int key, String name,String info) {
+            this.name = name;
+            this.key = key;
+            this.info = info;
+        }
+
+        // 鏅�氭柟娉�
+        public static String getName(int index) {
+            for (InsuranceApplyStatus c : InsuranceApplyStatus.values()) {
+                if (c.getKey() == index) {
+                    return c.name;
+                }
+            }
+            return null;
+        }
+        public static String getInfo(int index) {
+            for (InsuranceApplyStatus c : InsuranceApplyStatus.values()) {
+                if (c.getKey() == index) {
+                    return c.info;
+                }
+            }
+            return null;
+        }
+
+        // get set 鏂规硶
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public int getKey() {
+            return key;
+        }
+
+        public void setKey(int key) {
+            this.key = key;
+        }
+
+        public String getInfo() {
+            return info;
+        }
+
+        public void setInfo(String info) {
+            this.info = info;
+        }
+    }
+
+    public static BigDecimal countDetailFee(Solutions solutions,Date startDate, Date endDate){
+        //鏌ヨ淇濋櫓瀹為檯鍛ㄦ湡
+        Integer cycle = DateUtil.calculateBetween(endDate,startDate,solutions.getDataType());
+        if(cycle==-1){
+            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鏃ユ湡淇℃伅閿欒!");
+        }
+        return solutions.getPrice().multiply(new BigDecimal(cycle));
+    }
+
+
+    public  enum ApplyChangeStatus {
+        UPLOAD(0, "鎻愪氦鍔犲噺淇�/鎹㈠巶鐢宠"),
+        SIGNATURE(1, "宸茬绔�"),
+        APPROVE(2, "宸蹭笂浼犲鎵�"),
+        RETURN_APPLY(3, "鍙戣捣閫�鍥炵敵璇�"),
+        PLATFORM_AGREE(4, "骞冲彴鍚屾剰锛堝凡閫�鍥烇級"),
+        CLOSE(5, "宸插叧闂�"),
+        PALTFORM_CHECK_PASS(6, "瀹℃牳涓嶉�氳繃"),
+        PALTFORM_CHECK_PASS_NO(7, "瀹℃牳閫氳繃"),
         ;
         // 鎴愬憳鍙橀噺
         private String name;
         private int key;
 
         // 鏋勯�犳柟娉�
-        InsuranceApplyStatus(int key, String name) {
+        ApplyChangeStatus(int key, String name) {
             this.name = name;
             this.key = key;
         }
@@ -705,7 +816,52 @@
 
     }
 
+//3=閫�鍥炵敵璇凤紱4=骞冲彴瀹℃壒閫氳繃锛�0=瀹℃壒椹冲洖;5=骞冲彴瀹℃壒椹冲洖
+    public  enum ApplyChangeLogStatus {
+        UPLOAD(0, "鍙戣捣鐢宠"),
+        RETURN_APPLY(3, "鍙戣捣閫�鍥炵敵璇�"),
+        PLATFORM_AGREE(4, "骞冲彴瀹℃壒閫氳繃"),
+        PLATFORM_UN_AGREE(0, "瀹℃壒椹冲洖"),
+        CLOSE(5, "鍏抽棴"),
+        ;
+        // 鎴愬憳鍙橀噺
+        private String name;
+        private int key;
 
+        // 鏋勯�犳柟娉�
+        ApplyChangeLogStatus(int key, String name) {
+            this.name = name;
+            this.key = key;
+        }
+
+        // 鏅�氭柟娉�
+        public static String getName(int index) {
+            for (ApplyLogType c : ApplyLogType.values()) {
+                if (c.getKey() == index) {
+                    return c.name;
+                }
+            }
+            return null;
+        }
+
+        // get set 鏂规硶
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public int getKey() {
+            return key;
+        }
+
+        public void setKey(int key) {
+            this.key = key;
+        }
+
+    }
 
     public  enum ProjectRecord {
 

--
Gitblit v1.9.3