From dc2ed575ac5236f5100baac236254a434dcae8b9 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期五, 24 一月 2025 18:01:22 +0800
Subject: [PATCH] Merge branch '2.0.1' of http://139.186.142.91:10010/r/productDev/funingyunwei into 2.0.1
---
server/system_service/src/main/java/com/doumee/core/utils/Constants.java | 310 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 308 insertions(+), 2 deletions(-)
diff --git a/server/system_service/src/main/java/com/doumee/core/utils/Constants.java b/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
index 6bedf52..820bb4d 100644
--- a/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -1,7 +1,10 @@
package com.doumee.core.utils;
+import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -9,10 +12,16 @@
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import io.swagger.models.auth.In;
import org.apache.batik.util.Platform;
+import org.apache.commons.compress.archivers.zip.Zip64Mode;
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
+import java.io.OutputStream;
import java.math.BigDecimal;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
@@ -33,6 +42,7 @@
public static final String HK_TOKEN_VALIDITY = "HK_TOKEN_VALIDITY";
public static final String[] ALL_SPELL_LIST_FIRST = new String[]{"A", "B", "C", "D", "E", "F", "G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
public static final int ZERO = 0 ;
+ public static final int SIX = 6 ;
public static final int ONE = 1 ;
public static final int TWO = 2 ;
public static final String HK_PARAM ="HK_PARAM" ;
@@ -48,13 +58,17 @@
public static final String PLATFORM ="PLATFORM" ;
public static final String POWER_MINUTE ="POWER_MINUTE" ;
public static final String SPECIAL_COMPANY_ID ="SPECIAL_COMPANY_ID" ;
+ public static final String YW_DEVICE ="YW_DEVICE" ;
+ public static final String YW_PATROL ="YW_PATROL" ;
+ public static final String YW_CONTRACT_BILL ="YW_CONTRACT_BILL" ;
+ public static final String YW_MATERIAL ="YW_MATERIAL" ;
+ public static final String YW_PROBLEM ="YW_PROBLEM" ;
public static final String RESERVATION_TOTAL_NUM ="RESERVATION_TOTAL_NUM" ;
public static final String SIGN_IN_PLACE_LAT ="SIGN_IN_PLACE_LAT" ;
public static final String SIGN_IN_PLACE_LNT ="SIGN_IN_PLACE_LNT" ;
public static final String SIGN_IN_PLACE_DISTANCE ="SIGN_IN_PLACE_DISTANCE" ;
public static final String SIGN_IN_QRCODE ="SIGN_IN_QRCODE" ;
-
//琚嫓璁夸汉淇℃伅鏍¢獙鏂瑰紡锛�0鎵嬫満鍙峰崟鐙牎楠� 1鎵嬫満鍙峰拰濮撳悕缁勫悎鏍¢獙锛�
public static final String BEVISITED_USER_VALID = "BEVISITED_USER_VALID";
@@ -115,6 +129,7 @@
public static final String ERP ="ERP" ;
public static final Integer THREE =3 ;
public static final Integer FOUR =4 ;
+ public static final Integer SEVEN =7 ;
public static final Integer FIVE =5 ;
public static final String ORG_USER_ORIGIN = "ORG_USER_ORIGIN";
public static final String VIRTUAL_CARD_INDEX = "02098469790";
@@ -123,6 +138,7 @@
public static final String VISIT_TIPS = "VISIT_TIPS";
public static final String VISIT_GUIDEMAP = "VISIT_GUIDEMAP";
public static final String HIDDEN_DANGER_FILE = "HIDDEN_DANGER_FILE";
+ public static final String YW_WORKORDER_FILE = "YW_WORKORDER_FILE";
public static final String LOG_DEL_DAYS_LIMIT ="LOG_DEL_DAYS_LIMIT" ;
public static final String HK_LOG_DEL_DAYS_LIMIT ="HK_LOG_DEL_DAYS_LIMIT" ;
public static final String HK_NGINX_URL = "HK_NGINX_URL";
@@ -141,6 +157,7 @@
public static final String MYSQL_BACKUP_DIR ="MYSQL_BACKUP_DIR" ;
public static final String EVENT_FILES_PRIVATE_DOMAIN ="EVENT_FILES_PRIVATE_DOMAIN" ;
public static final String EVENT_FILES_PUBLIC_DOMAIN ="EVENT_FILES_PUBLIC_DOMAIN" ;
+ public static final String YW_CONTRACT_FILE = "YW_CONTRACT_FILE";
public static boolean DEALING_HK_SYNCPRIVILEGE= false;
public static boolean DEALING_HK_SYNCDEVICE = false;
public static boolean DEALING_HK_SYNCPLATFORM = false;
@@ -178,6 +195,48 @@
public static final String TIMEOUT_WARNING = "TIMEOUT_WARNING";
// FTP鏂囦欢鏈嶅姟鍣ㄨ祫婧愯闂湴鍧�
+ /**
+ * 浠樻鍛ㄦ湡绫诲瀷 0=鍏冩瘡骞崇背澶╋紱1=鍏冩瘡骞崇背鏈堬紱2=鍏冩瘡骞崇背骞达紱3=鍏冩瘡澶╋紱4=鍏冩瘡鏈堬紱5=鍏冩瘡骞达紱6=鍏冩瘡鍦猴紱
+ * @param circleType
+ * @return
+ */
+ public static String getUnitTypeByNum(Integer circleType) {
+
+ int zlPayType = Constants.formatIntegerNum(circleType);
+ if(zlPayType == 1){
+ return "鍏�/銕÷锋湀";
+ }else if(zlPayType == 2){
+ return "鍏�/銕÷峰ぉ";
+ }else if(zlPayType == 3){
+ return "鍏�/澶�";
+ }else if(zlPayType == 4){
+ return "鍏�/鏈�";
+ }else if(zlPayType == 5){
+ return "鍏�/骞�";
+ }else if(zlPayType == 6){
+ return "鍏�/鍦�";
+ }
+ return "鍏�/銕÷峰ぉ";
+ }
+
+ /**
+ * 鍛ㄦ湡鏀粯鏂瑰紡 0=涓�娆℃�т粯娆撅紱1=姣忎笁涓湀涓�浠橈紱2=鍏釜鏈堜竴浠橈紱3=涓�骞翠竴浠�
+ * @param zlPayType
+ * @return
+ */
+ public static String getPayTypeByNum(Integer zlPayType) {
+ if(zlPayType == null){
+ return "";
+ }
+ if(zlPayType == 1){
+ return "3涓湀涓�浠�";
+ }else if(zlPayType == 2){
+ return "6涓湀涓�浠�";
+ }else if(zlPayType == 3){
+ return "1骞翠竴浠�";
+ }
+ return "涓�娆℃�т粯娆�";
+ }
public static String getRandom6Num( ) {
Random random = new Random();
@@ -209,6 +268,19 @@
public static final int self = -1;
}
+
+ /**
+ * 璐﹀崟绫诲瀷 0绉熻祦鏉℃ 1鐗╀笟鏉℃ 2绉熻祦鎶奸噾 3鐗╀笟鎶奸噾 4鑷缓璐﹀崟
+ */
+ public interface contractBillType{
+ int lease = 0;
+ int property= 1;
+ int leaseDeposit = 2;
+ int propertyDeposit =3;
+ int create =4;
+ }
+
+
/**
* 浣滀笟绫诲瀷 0鑷湁杞﹀嵏璐� 1鑷湁杞﹁璐� 2澶栧崗杞﹀嵏璐� 3澶栧崗杞﹁璐� 4甯傚叕鍙稿鍗忚溅鍗歌揣
*/
@@ -220,7 +292,13 @@
int sgscxh = 4;
}
-
+ public interface patrolTaskStatus{
+ int waitStart = 0;
+ int working= 1;
+ int timeout = 2;
+ int finish =3;
+ int cancel =4;
+ }
public static Date getBirthdyByCardNo(String idCard){
if(idCard ==null || idCard.length()<14){
return null;
@@ -447,10 +525,14 @@
public static final long EXPIRE_TIME = 7200;
public static final String INTERNAL_TOKEN ="INTERNAL_TOKEN";
+ public static final String COM_OUTBOUND_OUT_KEY = "obout_";
+ public static final String COM_OUTBOUND_IN_KEY = "obin_";
+ public static final String COM_OUTBOUND_TAKING_KEY = "obtaking_";
public static final String GOODSORDER_KEY = "ordercode_";
public static final String ACTIVITY_SIGN_KEY = "actcode_";
public static final String AFTERSALE_KEY = "salecode_";
+ public static final String PATROL_SCHEME_CODE_KEY = "patrolSchemeCode";
}
@@ -468,6 +550,14 @@
}
//淇濈暀涓や綅灏忔暟涓斿洓鑸嶄簲鍏�
d = d.setScale(4, BigDecimal.ROUND_HALF_UP);
+ return d;
+ }
+ public static BigDecimal formatBigdecimal0Float(BigDecimal d) {
+ if (d == null) {
+ d = new BigDecimal(0.0);
+ }
+ //淇濈暀涓や綅灏忔暟涓斿洓鑸嶄簲鍏�
+ d = d.setScale(0, BigDecimal.ROUND_HALF_UP);
return d;
}
public static BigDecimal formatBigdecimal2Float(BigDecimal d) {
@@ -507,6 +597,7 @@
int driver = 0;//鍙告満浜哄憳
int visitor = 1;//鏅�氳瀹�
int internal = 2;//鍐呴儴浜哄憳
+ int customer = 3;//瀹㈡埛浜哄憳
}
@@ -563,6 +654,91 @@
int otherDeal = 5;//浠栦汉宸插鐞�
int otherUnPass = 6;//浠栦汉鎷掔粷
}
+
+
+
+ //绫诲瀷 0閲囪喘鍏ュ簱 1棰嗙敤閫�鍥� 2搴撳瓨璋冩暣鍏ュ簱 3鍏朵粬鍏ュ簱 4鐩樼泩鍏ュ簱 5棰嗙敤鍑哄簱 6浠撳簱鍑哄簱 7璋冩暣鍑哄簱 8閲囪喘鍑哄簱 9鍏朵粬鍑哄簱 10鐩樹簭鍑哄簱
+ public enum ywOutInType{
+ BUY_IN(0, 0),
+ USE_RETURN_IN(1, 0),
+ STOCK_IN(2, 0),
+ OTHER_IN(3, 0),
+ TAKING_IN(4, 0),
+ USE_OUT(5, 1),
+ HOUSE_OUT(6, 1),
+ STOCK_OUT(7, 1),
+ OTHER_UN_PASS_OUT(8, 1),
+ BUY_OUT(9, 1),
+ TAKING_OUT(10, 1)
+ ;
+ // 鎴愬憳鍙橀噺
+ private int key;
+ private int inOut;
+
+ // 鏋勯�犳柟娉�
+ ywOutInType(int key, int inOut) {
+ this.inOut = inOut;
+ this.key = key;
+ }
+
+ // 鏅�氭柟娉�
+ public static Integer getInOutValue(int index) {
+ for (ywOutInType c : ywOutInType.values()) {
+ if (c.getKey() == index) {
+ return c.getInOut();
+ }
+ }
+ return null;
+ }
+
+
+ // 鏅�氭柟娉�
+ public static ywOutInType getYwOutInType(int index) {
+ for (ywOutInType c : ywOutInType.values()) {
+ if (c.getKey() == index) {
+ return c;
+ }
+ }
+ return null;
+ }
+
+
+ /**
+ * 鏍规嵁鍑哄叆搴撶被鍨嬭幏鍙栨墍鏈夌殑鍏蜂綋绫诲瀷
+ * @param inOutType
+ * @return
+ */
+ public static List<Integer> getAllTypeKey(int inOutType) {
+ List<Integer> list = new ArrayList<>();
+ for (ywOutInType c : ywOutInType.values()) {
+ if (c.getInOut() == inOutType) {
+ list.add(c.getKey());
+ }
+ }
+ return list;
+ }
+
+ // get set 鏂规硶
+ public int getInOut() {
+ return inOut;
+ }
+
+ public void setInOut(int inOut) {
+ this.inOut = inOut;
+ }
+
+ public int getKey() {
+ return key;
+ }
+
+ public void setKey(int key) {
+ this.key = key;
+ }
+
+
+ }
+
+
/**
* 鑾峰彇杞︾墝绫诲瀷淇℃伅
@@ -1211,6 +1387,19 @@
HIDDEN_DANGER_SUBMIT(0, "闅愭偅闅忔墜鎷嶆彁鎶�", "闅愭偅闅忔墜鎷嶆彁鎶�"),
HIDDEN_DANGER_DEAL_BEFORE(1, "闅愭偅闅忔墜鎷嶅鐞嗗墠", "闅愭偅闅忔墜鎷嶅鐞嗗墠"),
HIDDEN_DANGER_DEAL_AFTER(2, "闅愭偅闅忔墜鎷嶅鐞嗗悗 ", "闅愭偅闅忔墜鎷嶅鐞嗗悗 "),
+ YW_WORKORDER_PROBLEM(3, "杩愮淮宸ュ崟闂闄勪欢 ", "杩愮淮宸ュ崟闂闄勪欢 "),
+ YW_WORKORDER_DEAL(4, "杩愮淮宸ュ崟澶勭悊闄勪欢 ", "杩愮淮宸ュ崟澶勭悊闄勪欢 "),
+ FN_DEVICE_FILE(5, "闃滃畞鏈嶅姟骞冲彴璁惧绫诲瀷鍥剧墖 ", "闃滃畞鏈嶅姟骞冲彴璁惧绫诲瀷鍥剧墖 "),
+ FN_DEVICE_RECORD_FILE(6, "闃滃畞鏈嶅姟骞冲彴杩愮淮璁板綍鍥剧墖 ", "闃滃畞鏈嶅姟骞冲彴杩愮淮璁板綍鍥剧墖 "),
+ FN_PATROL_POINT_FILE(7, "宸℃鐐归檮浠� ", "宸℃鐐归檮浠� "),
+ FN_CONTRACT_BILL_FILE(8, "鍚堝悓璐﹀崟闄勪欢 ", "鍚堝悓璐﹀崟闄勪欢 "),
+ YW_CONTRACT_FILE(9, "鍚堝悓闄勪欢 ", "鍚堝悓闄勪欢 "),
+ FN_CONTRACT_REVENUE_FILE(10, "鏀舵敮娴佹按闄勪欢 ", "鍚堝悓璐﹀崟闄勪欢 "),
+ FN_PATROL_TASK_RECORD_FILE(11, "宸℃浠诲姟鐐瑰鐞嗛檮浠� ", "宸℃浠诲姟鐐瑰鐞嗛檮浠� "),
+ MATERIAL_FILE(12, "璧勪骇闄勪欢 ", "璧勪骇闄勪欢 "),
+ PROBLEM_FILE(13, "闂闄勪欢 ", "闂闄勪欢 "),
+ FN_DEVICE_MAINTENANCE_FILE(14, "闃滃畞鏈嶅姟骞冲彴璁惧鏂囦欢 ", "闃滃畞鏈嶅姟骞冲彴璁惧鏂囦欢 "),
+
;
// 鎴愬憳鍙橀噺
private String name;
@@ -1265,7 +1454,124 @@
return noteinfo;
}
+ }
+
+ /**
+ * 杩愮淮鍚堝悓銆佸伐鍗曚俊鎭褰曠被鍨�
+ * 鎿嶄綔绫诲瀷 0宸ュ崟鍒涘缓 1鎸囨淳 2澶勭悊 3鍚堝悓鍒涘缓 4鍚堝悓鍙樻洿 5鍚堝悓閫�绉�
+ */
+ public enum YwLogType{
+ WORKORDER_CREATE(0, "鍒涘缓宸ュ崟", "鍒涘缓宸ュ崟"),
+ WORKORDER_DISPATCH(1, "鍒嗘淳宸ュ崟", "鍒嗘淳宸ュ崟"),
+ WORKORDER_DEAL(2, "澶勭悊宸ュ崟", "澶勭悊宸ュ崟"),
+ CONTRACT_CREATE(3, "鍚堝悓鏂板缓", "鏂板缓"),
+ CONTRACT_UPDATE(4, "鍚堝悓鍙樻洿", "鍙樻洿"),
+ CONTRACT_BACK(5, "鍚堝悓閫�绉�", "閫�绉�"),
+
+ ;
+ // 鎴愬憳鍙橀噺
+ private String name;
+ private int key;
+ private String noteinfo;// 鎻忚堪
+
+ // 鏋勯�犳柟娉�
+ YwLogType(int key, String name, String noteinfo) {
+ this.name = name;
+ this.key = key;
+ this.noteinfo = noteinfo;
+ }
+
+ // 鏅�氭柟娉�
+ public static String getName(int index) {
+ for (MultiFile c : MultiFile.values()) {
+ if (c.getKey() == index) {
+ return c.name;
+ }
+ }
+ return null;
+ }
+
+ // 鏅�氭柟娉�
+ public static String getInfo(int index) {
+ for (YwLogType c : YwLogType.values()) {
+ if (c.getKey() == index) {
+ return c.noteinfo;
+ }
+ }
+ 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 getNoteinfo() {
+ return noteinfo;
+ }
+
}
+
+ //閭鏍煎紡鐨勯獙璇�
+ public static boolean validEmail(String email) {
+ Pattern p = Pattern.compile("[a-zA-Z0-9]+@[A-Za-z0-9]+\\.[a-z0-9]");
+ Matcher m = p.matcher(email);
+ if(m.find()){
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public static void packFilesToZip(List<File> files, OutputStream os) throws IOException {
+ try {
+ ZipArchiveOutputStream zipOutputStream = new ZipArchiveOutputStream(os);
+ zipOutputStream.setUseZip64(Zip64Mode.AsNeeded);
+ for (File file : files) {
+ if(!file.exists()){
+ System.out.println("===鏂囦欢涓嶅瓨鍦�======="+file.getPath());
+ continue;
+ }else{
+ System.out.println("===鏂囦欢瀛樺湪======="+file.getPath());
+ }
+ ZipArchiveEntry entry = new ZipArchiveEntry(file.getName());
+ zipOutputStream.putArchiveEntry(entry);
+ FileInputStream fileInputStream = new FileInputStream(file);
+ byte[] buffer = new byte[1024];
+ int length;
+ while ((length = fileInputStream.read(buffer)) > 0) {
+ zipOutputStream.write(buffer, 0, length);
+ }
+ zipOutputStream.closeArchiveEntry();
+ zipOutputStream.flush();
+ IoUtil.close(fileInputStream);
+ file.delete();
+ }
+ }catch (Exception e){
+ throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR.getCode(),"瀵逛笉璧凤紝涓嬭浇鍘嬬缉鏂囦欢澶辫触");
+ }finally {
+ if (os != null) {
+ try {
+ os.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
}
--
Gitblit v1.9.3