|
|
|
@ -13,6 +13,7 @@ import com.weaver.verupgrade.conn.CONN_TYPE;
|
|
|
|
|
import com.weaver.verupgrade.conn.RecordSet;
|
|
|
|
|
import org.apache.axis.encoding.Base64;
|
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
|
import org.apache.hc.client5.http.utils.Hex;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -186,6 +187,8 @@ public class DocUtil {
|
|
|
|
|
"AND c.delete_type = 0 " +
|
|
|
|
|
"AND c.tenant_key = '"+tenantKey+"';";
|
|
|
|
|
rs.executeSql(sql, poolname);
|
|
|
|
|
log.error("sql--",sql);
|
|
|
|
|
|
|
|
|
|
if(rs.next()){
|
|
|
|
|
String imagefileid = Util.null2String(rs.getString("imagefileid"));
|
|
|
|
|
String filerealpath = Util.null2String(rs.getString("file_path"))+"/"+Util.null2String(rs.getString("file_url"));
|
|
|
|
@ -195,16 +198,20 @@ public class DocUtil {
|
|
|
|
|
InputStream fi = getFile(filerealpath,iszip);
|
|
|
|
|
docmap.put("imagefileid",imagefileid);
|
|
|
|
|
docmap.put("filename",imagefilename);
|
|
|
|
|
|
|
|
|
|
log.error("fi-- {}",fi);
|
|
|
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
|
|
|
byte[] buffer = new byte[1024];
|
|
|
|
|
int count = 0;
|
|
|
|
|
while((count = fi.read(buffer)) >= 0){
|
|
|
|
|
baos.write(buffer, 0, count);
|
|
|
|
|
}
|
|
|
|
|
log.error("baos-- {}", Hex.encodeHexString(baos.toByteArray()));
|
|
|
|
|
uploadBuffer = Base64.encode(baos.toByteArray());
|
|
|
|
|
docmap.put("base64str",uploadBuffer);
|
|
|
|
|
docmap.put("filesize",filesize);
|
|
|
|
|
|
|
|
|
|
log.error("docmap-- {}", docmap);
|
|
|
|
|
|
|
|
|
|
baos.close();
|
|
|
|
|
//这里就可以封装 文件名和文件内容 传给第三方系统
|
|
|
|
|
}
|
|
|
|
|