From 5a8389338e7ae54049e2ff7b01e431a568910610 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期三, 01 十一月 2023 14:19:26 +0800
Subject: [PATCH] 药剂Id生成--三位顺序号
---
igds-api-inte/src/main/java/com/ld/igds/sh/util/ApiShUtil.java | 45 ++++++++++++++++++++++++++++++++++++---------
1 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/igds-api-inte/src/main/java/com/ld/igds/sh/util/ApiShUtil.java b/igds-api-inte/src/main/java/com/ld/igds/sh/util/ApiShUtil.java
index 8d4fe41..10cd8fe 100644
--- a/igds-api-inte/src/main/java/com/ld/igds/sh/util/ApiShUtil.java
+++ b/igds-api-inte/src/main/java/com/ld/igds/sh/util/ApiShUtil.java
@@ -2,6 +2,7 @@
import com.ld.igds.constant.DepotStatus;
import org.springframework.stereotype.Component;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -20,27 +21,53 @@
* @return
*/
public String getDepotStatus(String depotStatus){
- if(DepotStatus.STATUS_01.getCode().equals(depotStatus)){
+ if(DepotStatus.STATUS_1.getCode().equals(depotStatus)){
return "1";
}
- if(DepotStatus.STATUS_03.getCode().equals(depotStatus)){
- return "2";
- }
- if(DepotStatus.STATUS_02.getCode().equals(depotStatus)){
+ if(DepotStatus.STATUS_3.getCode().equals(depotStatus)){
return "3";
}
- if(DepotStatus.STATUS_04.getCode().equals(depotStatus)){
+ if(DepotStatus.STATUS_2.getCode().equals(depotStatus)){
+ return "2";
+ }
+ if(DepotStatus.STATUS_4.getCode().equals(depotStatus)){
return "4";
}
return "9";
}
+ public static String getGbDepotId(String depotId){
+ switch (depotId) {
+ case "0P01":
+ return "91310114703439394M0020001001";
+ case "0P02":
+ return "91310114703439394M0020002001";
+ case "0P03":
+ return "91310114703439394M0020003001";
+ case "0P04":
+ return "91310114703439394M0020004001";
+ case "0P05":
+ return "91310114703439394M0020005001";
+ case "0P06":
+ return "91310114703439394M0020006001";
+ case "0P07":
+ return "91310114703439394M0020007001";
+ case "0P08":
+ return "91310114703439394M0020005001";
+ case "0P09":
+ return "91310114703439394M0020006001";
+ default:
+ return depotId;
+ }
+ }
+
/**
* 鑾峰彇鍥剧墖鐨勪簩杩涘埗娴�
+ *
* @param imgPath
* @return
*/
- public String imgToIo(String imgPath){
+ public String imgToIo(String imgPath) {
//鍥剧墖杞寲涓轰簩杩涘埗
byte[] imageBytes = null;
try {
@@ -56,9 +83,9 @@
return UnicodeByteToStr(imageBytes);
}
- private static String UnicodeByteToStr(byte[] b){
+ private static String UnicodeByteToStr(byte[] b) {
StringBuilder sb = new StringBuilder();
- for(int i=0;i<b.length;i++) {
+ for (int i = 0; i < b.length; i++) {
sb.append(String.format("%02x", b[i]));
}
return sb.toString();
--
Gitblit v1.9.3