Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
c433afe1
Commit
c433afe1
authored
Aug 25, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
20cde7d7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
36 deletions
+27
-36
FirefightersThought.java
...os/boot/module/common/api/entity/FirefightersThought.java
+1
-1
FailureDetailsController.java
...odule/common/biz/controller/FailureDetailsController.java
+26
-35
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/FirefightersThought.java
View file @
c433afe1
...
...
@@ -32,7 +32,7 @@ public class FirefightersThought extends BaseEntity {
@ApiModelProperty
(
value
=
"消防救援人员"
)
private
Long
firefightersId
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@ApiModelProperty
(
value
=
"谈话时间"
)
private
Date
talkingTime
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureDetailsController.java
View file @
c433afe1
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.module.common.api.dto.CurrentStatusDto
;
import
com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum
;
import
feign.Response
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.apache.commons.io.IOUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -33,20 +22,24 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.module.common.api.dto.CurrentStatusDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum
;
import
com.yeejoin.amos.boot.module.common.biz.constats.Constants
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FailureDetailsServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
feign.Response
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -241,31 +234,29 @@ public class FailureDetailsController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/downloadFile/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"流程图高亮图片"
,
notes
=
"流程图高亮图片"
)
public
void
downloadFile
(
@PathVariable
Long
sequenceNbr
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
public
ResponseEntity
<
String
>
downloadFile
(
@PathVariable
Long
sequenceNbr
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
String
processId
=
failureDetailsServiceImpl
.
queryBySeq
(
sequenceNbr
).
getProcessId
();
Response
feignResponse
=
workflowFeignService
.
thighLineImg
(
processId
);
OutputStream
out
=
null
;
try
{
out
=
response
.
getOutputStream
();
Response
.
Body
body
=
feignResponse
.
body
();
HttpHeaders
heads
=
new
HttpHeaders
();
heads
.
setContentType
(
MediaType
.
valueOf
(
MediaType
.
IMAGE_JPEG_VALUE
)
);
byte
[]
b
=
new
byte
[
1024
];
int
len
;
while
((
len
=
body
.
asInputStream
().
read
(
b
,
0
,
1024
))
!=
-
1
)
{
out
.
write
(
b
,
0
,
len
);
}
out
.
flush
()
;
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
out
!=
null
)
{
out
.
close
(
);
}
// response.setContentType("application/octet-stream");//
// response.setHeader("content-type", "application/octet-stream"
);
// response.setContentType("text/xml");//
// response.setHeader("content-type", "text/xml")
;
// response.setCharacterEncoding("utf-8");
// response.setHeader("Content-Disposition", "attachment;fileName=workflow.svg"
);
// response.reset();
// byte[] b = new byte[1024]
;
// int len;
// while ((len = body.asInputStream().read(b, 0, 1024)) != -1) {
// out.write(b, 0, len);
// }
// out.flush();
return
new
ResponseEntity
<
String
>(
IOUtils
.
toString
(
body
.
asInputStream
()),
HttpStatus
.
OK
);
//.toByteArray(body.asInputStream()), responseHeaders, HttpStatus.OK);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
throw
new
BaseException
(
"Error exporting diagram"
,
"500"
,
processId
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment