|
|
|
@ -65,14 +65,14 @@ public class StuExperimentTrainByCreditController {
|
|
|
|
|
@GetMapping("/preAllView")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
public ResponseEntity<byte[]> preViewByContract(
|
|
|
|
|
@RequestParam(required = true,name = "name")@NotBlank @ApiParam("文件类型名如:负债信息概要/参保信息样板") String name) throws IOException {
|
|
|
|
|
@RequestParam(required = true,name = "name")@NotBlank @ApiParam("文件类型名如:负债信息概要/参保信息样板/担保协议书") String name) throws IOException {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
|
|
|
map.put("负债信息概要","/credit/**");
|
|
|
|
|
map.put("参保信息样板","/credit/**");
|
|
|
|
|
map.put("个人信用信息查询及报送授权书","/credit/个人信用信息查询及报送授权书.pdf");
|
|
|
|
|
map.put("担保协议书","/credit/担保协议书.pdf");
|
|
|
|
|
map.put("个人信用信息查询及报送授权书","/个人信用信息查询及报送授权书.pdf");
|
|
|
|
|
map.put("担保协议书","/担保协议书.pdf");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String fileUrl = map.get(name);
|
|
|
|
@ -83,7 +83,7 @@ public class StuExperimentTrainByCreditController {
|
|
|
|
|
byte[] sealBytes = Files.readAllBytes(Paths.get(imagePath));
|
|
|
|
|
|
|
|
|
|
// 构建HTTP响应,设置Content-Type为image/png
|
|
|
|
|
return ResponseEntity.ok().contentType(MediaType.IMAGE_PNG).body(sealBytes);
|
|
|
|
|
return ResponseEntity.ok().contentType(MediaType.APPLICATION_PDF).body(sealBytes);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -94,7 +94,7 @@ public class StuExperimentTrainByCreditController {
|
|
|
|
|
@GetMapping("/downloadDoc")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@ApiOperation("文件下载")
|
|
|
|
|
public void download(HttpServletResponse response,@ApiParam("个人信用信息查询/数据说明表") String docName){
|
|
|
|
|
public void download(HttpServletResponse response,@ApiParam("个人信用信息查询/数据说明表/担保协议书") String docName){
|
|
|
|
|
|
|
|
|
|
String url = null;
|
|
|
|
|
if ("个人信用信息查询".equals(docName))
|
|
|
|
@ -106,7 +106,10 @@ public class StuExperimentTrainByCreditController {
|
|
|
|
|
url= "数据说明表.xls";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ("担保协议书".equals(docName))
|
|
|
|
|
{
|
|
|
|
|
url= "担保协议书.pdf";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
iFileUtil.download(response,url);
|
|
|
|
|