| | |
| | | |
| | | import com.ld.igds.constant.DepotStatus; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | |
| | | @Component |
| | | public class ApiShUtil { |
| | | |
| | | /** |
| | | * 仓库状态转为货位状态 |
| | | * @param depotStatus |
| | | * @return |
| | | */ |
| | | public String getDepotStatus(String depotStatus){ |
| | | if(DepotStatus.STATUS_01.getCode().equals(depotStatus)){ |
| | | return "1"; |
| | | } |
| | | if(DepotStatus.STATUS_03.getCode().equals(depotStatus)){ |
| | | return "2"; |
| | | } |
| | | if(DepotStatus.STATUS_02.getCode().equals(depotStatus)){ |
| | | return "3"; |
| | | } |
| | | if(DepotStatus.STATUS_04.getCode().equals(depotStatus)){ |
| | | return "4"; |
| | | } |
| | | return "9"; |
| | | } |
| | | |
| | | /** |
| | | * 获取图片的二进制流 |
| | | * |
| | | * @param imgPath |
| | | * @return |
| | | */ |
| | | public String imgToIo(String imgPath){ |
| | | public String imgToIo(String imgPath) { |
| | | //图片转化为二进制 |
| | | byte[] imageBytes = null; |
| | | try { |
| | |
| | | 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(); |