From 4cfaac76490c1391237483329719bc6abd4392af Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期二, 29 八月 2023 20:32:00 +0800
Subject: [PATCH] 调整代码
---
igds-inout/src/main/java/com/ld/igds/m/InoutManageUtil.java | 239 ++++++++++++++++++++++++++++++++---------------------------
1 files changed, 130 insertions(+), 109 deletions(-)
diff --git a/igds-inout/src/main/java/com/ld/igds/m/InoutManageUtil.java b/igds-inout/src/main/java/com/ld/igds/m/InoutManageUtil.java
index 14259de..de2ae06 100644
--- a/igds-inout/src/main/java/com/ld/igds/m/InoutManageUtil.java
+++ b/igds-inout/src/main/java/com/ld/igds/m/InoutManageUtil.java
@@ -2,128 +2,149 @@
import com.ld.igds.models.InoutPlan;
import com.ld.igds.util.ContextUtil;
+
import java.util.List;
/**
* 鍑哄叆搴�--绠$悊鍔熻兘鐩稿叧甯搁噺
- *
- * @author:
*
+ * @author:
*/
public class InoutManageUtil {
- /**
- * 璁″垝绫诲瀷-閲囪喘璁″垝
- */
- public static final String PLAN_TYPE_1 = "1";
- /**
- * 璁″垝绫诲瀷-閿�鍞鍒�
- */
- public static final String PLAN_TYPE_2 = "2";
- /**
- * 璁″垝绫诲瀷-杞崲璁″垝
- */
- public static final String PLAN_TYPE_3 = "3";
-
- /**
- * 璁″垝绫诲瀷-鍔犲伐璁″垝
- */
- public static final String PLAN_TYPE_4 = "4";
+ /**
+ * 璁″垝绫诲瀷-閲囪喘璁″垝
+ */
+ public static final String PLAN_TYPE_1 = "1";
+ /**
+ * 璁″垝绫诲瀷-閿�鍞鍒�
+ */
+ public static final String PLAN_TYPE_2 = "2";
+ /**
+ * 璁″垝绫诲瀷-杞崲璁″垝
+ */
+ public static final String PLAN_TYPE_3 = "3";
- /**
- * 璁″垝璇︾粏绫诲瀷-杞叆
- */
- public static final String PLAN_TYPE_TURN_IN = "2";
- /**
- * 璁″垝璇︾粏绫诲瀷-杞嚭
- */
- public static final String PLAN_TYPE_TURN_OUT = "1";
+ /**
+ * 璁″垝绫诲瀷-鍔犲伐璁″垝
+ */
+ public static final String PLAN_TYPE_4 = "4";
- /**
- * 瀹℃牳鐘舵��-寰呭鏍�
- */
- public static final String AUDIT_NONE = "NONE";
- /**
- * 瀹℃牳鐘舵��-閫氳繃
- */
- public static final String AUDIT_PASS = "PASS";
- /**
- * 瀹℃牳鐘舵��-鎷掔粷
- */
- public static final String AUDIT_UNPASS = "UNPASS";
+ /**
+ * 璁″垝璇︾粏绫诲瀷-杞叆
+ */
+ public static final String PLAN_TYPE_TURN_IN = "2";
+ /**
+ * 璁″垝璇︾粏绫诲瀷-杞嚭
+ */
+ public static final String PLAN_TYPE_TURN_OUT = "1";
- /**
- * 鍚堝悓绫诲瀷-浠e偍鍚堝悓
- */
- public static final String CONTRACT_TYPE_3 = "3";
- /**
- * 鍚堝悓绫诲瀷-閲囪喘鍚堝悓
- */
- public static final String CONTRACT_TYPE_2 = "2";
- /**
- * 鍚堝悓绫诲瀷-閿�鍞悎鍚�
- */
- public static final String CONTRACT_TYPE_1 = "1";
+ /**
+ * 瀹℃牳鐘舵��-寰呭鏍�
+ */
+ public static final String AUDIT_NONE = "NONE";
+ /**
+ * 瀹℃牳鐘舵��-閫氳繃
+ */
+ public static final String AUDIT_PASS = "PASS";
+ /**
+ * 瀹℃牳鐘舵��-鎷掔粷
+ */
+ public static final String AUDIT_UNPASS = "UNPASS";
- /**
- * 瀹㈡埛绫诲瀷 - 浼佷笟
- */
- public static final String CUSTOMER_TYPE_1 = "1";
- /**
- * 瀹㈡埛绫诲瀷 - 涓汉
- */
- public static final String CUSTOMER_TYPE_2 = "2";
+ /**
+ * 鍚堝悓绫诲瀷-浠e偍鍚堝悓
+ */
+ public static final String CONTRACT_TYPE_3 = "3";
+ /**
+ * 鍚堝悓绫诲瀷-閲囪喘鍚堝悓
+ */
+ public static final String CONTRACT_TYPE_2 = "2";
+ /**
+ * 鍚堝悓绫诲瀷-閿�鍞悎鍚�
+ */
+ public static final String CONTRACT_TYPE_1 = "1";
- /**
- * 鏍规嵁绫诲瀷鍒涘缓璁″垝ID
- *
- * @param type
- */
- public static String createPlanId(String type, String year, List<InoutPlan> list) {
- String index = "001";
- if(list != null && list.size() > 0){
- String[] arr = list.get(0).getId().split("_");
- int temp = Integer.valueOf(arr[2]) + 1;
- index = temp + "";
- }
- if(index.length() == 1){
- index = "00" + index;
- }
- if(index.length() == 2){
- index = "0" + index;
- }
- if (PLAN_TYPE_1.equals(type)) {
- return "CGJH_" + year + "_" + index;
- }
- if (PLAN_TYPE_2.equals(type)) {
- return "XSJH_" + year + "_" + index;
- }
- if (PLAN_TYPE_3.equals(type)) {
- return "LHJH_" + year + "_" + index;
- }
- if (PLAN_TYPE_4.equals(type)) {
- return "JGJH_" + year + "_" + index;
- }
- return "QTJH" + year + "_" + index;
- }
+ /**
+ * 瀹㈡埛绫诲瀷 - 浼佷笟
+ */
+ public static final String CUSTOMER_TYPE_1 = "1";
+ /**
+ * 瀹㈡埛绫诲瀷 - 涓汉
+ */
+ public static final String CUSTOMER_TYPE_2 = "2";
+ /**
+ * 缁撶畻涓庡悎鍚屼竴鑷存�� - 绗﹀悎
+ */
+ public static final String CONSISTENCY_1 = "1";
+ /**
+ * 缁撶畻涓庡悎鍚屼竴鑷存�� - 涓嶇鍚�
+ */
+ public static final String CONSISTENCY_2 = "2";
+ /**
+ * 缂撳瓨-鎬ц川杞彉ID
+ */
+ public static final String CACHE_STOCK_ID = "STOCK_ID";
+ /**
+ * 缂撳瓨-鎬ц川杞彉ID
+ */
+ public static final String CACHE_VARIETY_ID = "VARIETY_ID";
+ /**
+ * 缂撳瓨-鎹熸孩ID
+ */
+ public static final String CACHE_LOSS_OVER_ID = "LOSS_OVER_ID";
- /**
- * 鏍规嵁绫诲瀷鍒涘缓鍚堝悓ID
- * @param type
- * @return
- */
- public static String createContractId(String type) {
- String id = ContextUtil.getTimeId();
- if (CONTRACT_TYPE_1.equals(type)) {
- return "XSHT_" + id;
- }
- if (CONTRACT_TYPE_2.equals(type)) {
- return "CGHT_" + id;
- }
- if (CONTRACT_TYPE_3.equals(type)) {
- return "LHHT_" + id;
- }
- return id;
- }
+ /**
+ * 鏍规嵁绫诲瀷鍒涘缓璁″垝ID
+ *
+ * @param type
+ */
+ public static String createPlanId(String type, String year, List<InoutPlan> list) {
+ String index = "001";
+ if (list != null && list.size() > 0) {
+ String[] arr = list.get(0).getId().split("_");
+ int temp = Integer.valueOf(arr[2]) + 1;
+ index = temp + "";
+ }
+ if (index.length() == 1) {
+ index = "00" + index;
+ }
+ if (index.length() == 2) {
+ index = "0" + index;
+ }
+ if (PLAN_TYPE_1.equals(type)) {
+ return "CGJH_" + year + "_" + index;
+ }
+ if (PLAN_TYPE_2.equals(type)) {
+ return "XSJH_" + year + "_" + index;
+ }
+ if (PLAN_TYPE_3.equals(type)) {
+ return "LHJH_" + year + "_" + index;
+ }
+ if (PLAN_TYPE_4.equals(type)) {
+ return "JGJH_" + year + "_" + index;
+ }
+ return "QTJH" + year + "_" + index;
+ }
+
+ /**
+ * 鏍规嵁绫诲瀷鍒涘缓鍚堝悓ID
+ *
+ * @param type
+ * @return
+ */
+ public static String createContractId(String type) {
+ String id = ContextUtil.getTimeId();
+ if (CONTRACT_TYPE_1.equals(type)) {
+ return "XSHT_" + id;
+ }
+ if (CONTRACT_TYPE_2.equals(type)) {
+ return "CGHT_" + id;
+ }
+ if (CONTRACT_TYPE_3.equals(type)) {
+ return "LHHT_" + id;
+ }
+ return id;
+ }
}
--
Gitblit v1.9.3