公告结构化

This commit is contained in:
zhangqinbin
2023-12-21 16:57:06 +08:00
parent 69de0f39fa
commit 00d1b6c654
2 changed files with 11 additions and 8 deletions

View File

@ -11,6 +11,7 @@ import com.chinaunicom.mall.ebtp.common.exception.common.CommonExceptionEnum;
import com.chinaunicom.mall.ebtp.common.log.OperationLogDetail; import com.chinaunicom.mall.ebtp.common.log.OperationLogDetail;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule; import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType; import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType;
import com.chinaunicom.mall.ebtp.extend.crypconfigure.crypto.tenderfee.test;
import com.chinaunicom.mall.ebtp.extend.feign.client.UnicomOAuthClient; import com.chinaunicom.mall.ebtp.extend.feign.client.UnicomOAuthClient;
import com.chinaunicom.mall.ebtp.extend.shortmessage.utils.RSA; import com.chinaunicom.mall.ebtp.extend.shortmessage.utils.RSA;
import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftFileSaveVo; import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftFileSaveVo;
@ -273,9 +274,12 @@ public class WpsController {
String text = " "; String text = " ";
byte buf[] = text.getBytes(); byte buf[] = text.getBytes();
try { try {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("text.doc")); URL crt = test.class.getClassLoader().getResource("text.doc");
File file = new File(crt.getPath());
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
buf = IOUtils.toByteArray(bis); buf = IOUtils.toByteArray(bis);
}catch (Exception e){ }catch (Exception e){
log.error("读取异常",e);
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("模板文件读取异常",true); CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("模板文件读取异常",true);
} }

View File

@ -19,6 +19,7 @@ import com.chinaunicom.mall.ebtp.common.log.service.OperationLogService;
import com.chinaunicom.mall.ebtp.common.uniBss.constant.UniBssConstant; import com.chinaunicom.mall.ebtp.common.uniBss.constant.UniBssConstant;
import com.chinaunicom.mall.ebtp.common.uniBss.entity.UniBssAttached; import com.chinaunicom.mall.ebtp.common.uniBss.entity.UniBssAttached;
import com.chinaunicom.mall.ebtp.common.util.HttpContextUtils; import com.chinaunicom.mall.ebtp.common.util.HttpContextUtils;
import com.chinaunicom.mall.ebtp.extend.crypconfigure.crypto.tenderfee.test;
import com.chinaunicom.mall.ebtp.extend.crypconfigure.util.SslUtil; import com.chinaunicom.mall.ebtp.extend.crypconfigure.util.SslUtil;
import com.chinaunicom.mall.ebtp.extend.feign.client.UnicomOAuthClient; import com.chinaunicom.mall.ebtp.extend.feign.client.UnicomOAuthClient;
import com.chinaunicom.mall.ebtp.extend.shortmessage.utils.RSA; import com.chinaunicom.mall.ebtp.extend.shortmessage.utils.RSA;
@ -800,12 +801,10 @@ public class WpsServiceImpl implements WpsService {
//System.out.println(URLEncoder.encode("hVLFkQhQkXI8w4RFE25zvCP9TKRZwT8Dqhxmi/PgDalGayE5SIjtyFBRpu6wuEqr7HvAIHm2Kc8+ahIUF7l8sc1PHYeCuEmgYEwzeosl1pT1yDyQ+KV6Q8REiufarAbZ1W9LEx70SBrtTXPKnEPi82njSv+CVrYqZCf6XZ/BINU=","utf-8")); //System.out.println(URLEncoder.encode("hVLFkQhQkXI8w4RFE25zvCP9TKRZwT8Dqhxmi/PgDalGayE5SIjtyFBRpu6wuEqr7HvAIHm2Kc8+ahIUF7l8sc1PHYeCuEmgYEwzeosl1pT1yDyQ+KV6Q8REiufarAbZ1W9LEx70SBrtTXPKnEPi82njSv+CVrYqZCf6XZ/BINU=","utf-8"));
URL crt = test.class.getClassLoader().getResource("text.doc");
String file = "17377117066807000001.doc"; File file = new File(crt.getPath());
System.out.println("file"+file.split("\\.")[0]); BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
byte[] result = IOUtils.toByteArray(bis);
// BufferedInputStream bis = new BufferedInputStream(new FileInputStream("E:\\工作\\联通\\文档\\3.0\\公告结构化\\文字文稿1.docx")); System.out.println(result.length);
// byte[] result = IOUtils.toByteArray(bis);
// System.out.println(result.length);
} }
} }