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 |  264 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 262 insertions(+), 2 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 20c9d1b..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;
 
@@ -65,6 +69,9 @@
     public static final String SIGN_APPSECRET = "SIGN_APPSECRET";
     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鍚庡彴瀵煎叆
@@ -92,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);
@@ -555,14 +571,13 @@
 
 
     public  enum DispatchUnitLogType {
-
         UPLOAD(0, "鎻愪氦鐢宠"),
         AUDIT_PASS(1, "娲鹃仯鍗曚綅閫氳繃"),
         AUDIT_UN_PASS(2, "娲鹃仯鍗曚綅涓嶉�氳繃"),
         EDIT_UNIT(3, "淇敼娲鹃仯鍗曚綅淇℃伅"),
         ADD_WORK_TYPE(4, "鎻愪氦娣诲姞宸ョ"),
         WORK_TYPE_AUDIT_PASS(5, "娣诲姞宸ョ瀹℃壒閫氳繃"),
-        WORK_TYPE_AUDIT_UN_PASS(5, "娣诲姞宸ョ瀹℃壒涓嶉�氳繃"),
+        WORK_TYPE_AUDIT_UN_PASS(6, "娣诲姞宸ョ瀹℃壒涓嶉�氳繃"),
         ;
         // 鎴愬憳鍙橀噺
         private String name;
@@ -603,6 +618,251 @@
 
     }
 
+
+    public  enum ApplyLogType {
+        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,String info) {
+            this.name = name;
+            this.info = info;
+            this.key = key;
+        }
+
+        // 鏅�氭柟娉�
+        public static String getName(int index) {
+            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;
+        }
+
+        // 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  enum InsuranceApplyStatus {
+        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;
+
+        // 鏋勯�犳柟娉�
+        ApplyChangeStatus(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;
+        }
+
+    }
+
+//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 {
 
         COM_EDITING(0, "浼佷笟淇濆瓨鏁版嵁", "鐢� ${param2} ${param3}淇濆瓨鎴愬姛锛屽綋鍓嶈繘搴︿负 銆�${param4}銆�"),

--
Gitblit v1.9.3