Browse Source

交易明细付款单ID处理

turborao 1 month ago
parent
commit
b1ff480c9a

+ 0 - 51
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/webapi/AttachmentFileUtil.java

@@ -247,57 +247,6 @@ public class AttachmentFileUtil {
         return attObj;
         return attObj;
     }
     }
 
 
-    /**
-     * 根据地址获得数据的字节流并转换成大小
-     * @param strUrl 网络连接地址
-     * @return
-     */
-    public static int getFileSizeByUrl(String strUrl){
-        InputStream inStream=null;
-        ByteArrayOutputStream outStream=null;
-        int size = 0;
-        try {
-            URL url = new URL(strUrl);
-            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
-            conn.setRequestMethod("GET");
-            conn.setConnectTimeout(5 * 1000);
-            inStream = conn.getInputStream();
-
-            outStream = new ByteArrayOutputStream();
-            byte[] buffer = new byte[1024];
-            int len = 0;
-            while( (len=inStream.read(buffer)) != -1 ){
-                outStream.write(buffer, 0, len);
-            }
-            byte[] bt =  outStream.toByteArray();
-
-            if(null != bt && bt.length > 0){
-                DecimalFormat df = new DecimalFormat("#");
-                size = Integer.parseInt(df.format((double) bt.length));
-
-                System.out.println("文件大小=:" + size);
-            }else{
-                System.out.println("没有从该连接获得内容");
-            }
-            inStream.close();
-            outStream.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }finally{
-            try{
-                if(inStream !=null){
-                    inStream.close();
-                }
-                if(outStream !=null){
-                    outStream.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return size;
-    }
-
     private static InputStream getInputStreamFromURL(String urlString) throws IOException {
     private static InputStream getInputStreamFromURL(String urlString) throws IOException {
         URL url = null;
         URL url = null;
         try {
         try {

+ 5 - 5
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/webapi/TransDetailApiPlugin.java

@@ -381,7 +381,7 @@ public class TransDetailApiPlugin implements Serializable {
         if(StringUtils.isEmpty(casBillID)){
         if(StringUtils.isEmpty(casBillID)){
             errMsg.append("付款单ID为空;");
             errMsg.append("付款单ID为空;");
         }else {
         }else {
-            String billid  = extractBillID(casBillID);
+            String billid  = casBillID;
             //获取 付款单号
             //获取 付款单号
             QFilter qFilter = new QFilter("id", QCP.equals, billid);
             QFilter qFilter = new QFilter("id", QCP.equals, billid);
             paybillDyn = BusinessDataServiceHelper.loadSingle("cas_paybill", new QFilter[]{qFilter});
             paybillDyn = BusinessDataServiceHelper.loadSingle("cas_paybill", new QFilter[]{qFilter});
@@ -524,14 +524,14 @@ public class TransDetailApiPlugin implements Serializable {
         // Extract the substring after the last slash
         // Extract the substring after the last slash
         return address.substring(lastSlashIndex + 1);
         return address.substring(lastSlashIndex + 1);
     }
     }
-    public static String extractBillID(String address) {
+    public static String extractBillID(String billid) {
         // Find the last slash in the URL
         // Find the last slash in the URL
-        int lastSlashIndex = address.lastIndexOf('-');
+        int lastSlashIndex = billid.lastIndexOf('-');
         if (lastSlashIndex == -1) {
         if (lastSlashIndex == -1) {
-            return null; // No slash found, invalid URL
+            return billid; // No slash found, invalid URL
         }
         }
         // Extract the substring after the last slash
         // Extract the substring after the last slash
-        return address.substring(lastSlashIndex + 1);
+        return billid.substring(lastSlashIndex + 1);
     }
     }
 
 
     /**
     /**