|
|
|
|
@ -367,13 +367,13 @@ public class lastVerifyController {
|
|
|
|
|
try {
|
|
|
|
|
List<Archive_DetailPdfPathDto> pdfPathList = archiveDetailService.getPdfPathByMasterId(masterId);
|
|
|
|
|
if (!CollectionUtils.isEmpty(pdfPathList)) {
|
|
|
|
|
|
|
|
|
|
String departId="";
|
|
|
|
|
//判断该部门是否存在签章
|
|
|
|
|
CaDepartIdVo caDepartIdVo = caDepartIdMapper.getDepartId(user.getRemark());
|
|
|
|
|
//没有保存部门签章id时需要请求获取一个新的departId
|
|
|
|
|
if (caDepartIdVo==null){
|
|
|
|
|
//请求医院科室在医网信标识id
|
|
|
|
|
String departId = getDepartId(user);
|
|
|
|
|
departId = getDepartId(user);
|
|
|
|
|
caDepartIdMapper.addDepartId(user.getRemark(),departId);
|
|
|
|
|
return Msg.fail("该用户科室没有在医信网平台申请部门签章请联系医信网人员");
|
|
|
|
|
}
|
|
|
|
|
@ -396,7 +396,6 @@ public class lastVerifyController {
|
|
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
|
|
//签章失败文件id集合
|
|
|
|
|
List<String> failIdList = new ArrayList<>();
|
|
|
|
|
System.out.println("11");
|
|
|
|
|
//遍历文件集合
|
|
|
|
|
for (Archive_DetailPdfPathDto dto : pdfPathList) {
|
|
|
|
|
SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
|
|
|
|
@ -407,11 +406,9 @@ public class lastVerifyController {
|
|
|
|
|
//获取文件路径
|
|
|
|
|
String pdfPath = dto.getPdfPath();
|
|
|
|
|
File file = new File(pdfPath);
|
|
|
|
|
System.out.println("22:");
|
|
|
|
|
if (file.isFile()) {
|
|
|
|
|
String pdfPathString = pdfToBase64(pdfPath);
|
|
|
|
|
PdfReader pdfReader = new PdfReader(pdfPath);
|
|
|
|
|
System.out.println("44");
|
|
|
|
|
int pageCount = pdfReader.getNumberOfPages();
|
|
|
|
|
Msg msg = sign(pdfPathString, dataId,caReqParam,pageCount);
|
|
|
|
|
if (msg.getCode()!=100){
|
|
|
|
|
@ -425,6 +422,7 @@ public class lastVerifyController {
|
|
|
|
|
} else {
|
|
|
|
|
return Msg.fail();
|
|
|
|
|
}
|
|
|
|
|
dto.setCaFlag(departId);
|
|
|
|
|
list.add(dto);
|
|
|
|
|
}
|
|
|
|
|
//添加签章记录
|
|
|
|
|
@ -747,7 +745,6 @@ public class lastVerifyController {
|
|
|
|
|
// 读取文件内容到字节数组
|
|
|
|
|
byte[] fileContent = Files.readAllBytes(file.toPath());
|
|
|
|
|
// 将字节数组编码为Base64字符串
|
|
|
|
|
System.out.println("33");
|
|
|
|
|
return Base64.getEncoder().encodeToString(fileContent);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -773,10 +770,8 @@ public class lastVerifyController {
|
|
|
|
|
//签章接口
|
|
|
|
|
private Msg sign(String pdfPathString,String departId,Archive_Detail_ca_reqParam caReqParam,int pageCount) {
|
|
|
|
|
try {
|
|
|
|
|
System.out.println("55");
|
|
|
|
|
// 创建OkHttpClient实例
|
|
|
|
|
OkHttpClient client = HttpClientUtil.getClient();
|
|
|
|
|
System.out.println("10");
|
|
|
|
|
// 定义请求的URL
|
|
|
|
|
String url = signUrl;
|
|
|
|
|
String pdfSignBase64="";
|
|
|
|
|
@ -803,7 +798,6 @@ public class lastVerifyController {
|
|
|
|
|
|
|
|
|
|
log.info("签章传参“:"+json);
|
|
|
|
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), json);
|
|
|
|
|
System.out.println("77");
|
|
|
|
|
// 创建Request
|
|
|
|
|
Request request = new Request.Builder()
|
|
|
|
|
.url(url)
|
|
|
|
|
|