Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
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
竹天卫
tianjin-cement
Commits
4e6761f3
Commit
4e6761f3
authored
Nov 03, 2020
by
qinhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报告上传
parent
e8f51016
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
1 deletion
+56
-1
ReportController.java
.../wise/sc/cement/business/controller/ReportController.java
+54
-0
FileExt.java
...c/main/java/cn/wise/sc/cement/business/model/FileExt.java
+2
-1
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ReportController.java
View file @
4e6761f3
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.wise.sc.cement.business.entity.EntityEnclosure
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.FileExt
;
import
cn.wise.sc.cement.business.model.FileExt
;
import
cn.wise.sc.cement.business.model.IndustrialElementKey
;
import
cn.wise.sc.cement.business.model.IndustrialElementKey
;
...
@@ -8,24 +10,33 @@ import cn.wise.sc.cement.business.model.PageQuery;
...
@@ -8,24 +10,33 @@ import cn.wise.sc.cement.business.model.PageQuery;
import
cn.wise.sc.cement.business.model.ReportDetailVo
;
import
cn.wise.sc.cement.business.model.ReportDetailVo
;
import
cn.wise.sc.cement.business.model.SixElementKey
;
import
cn.wise.sc.cement.business.model.SixElementKey
;
import
cn.wise.sc.cement.business.model.SixElementReport
;
import
cn.wise.sc.cement.business.model.SixElementReport
;
import
cn.wise.sc.cement.business.model.query.SampleHandleEnclosureQuery
;
import
cn.wise.sc.cement.business.model.vo.EntrustVo
;
import
cn.wise.sc.cement.business.model.vo.EntrustVo
;
import
cn.wise.sc.cement.business.service.IEntityEnclosureService
;
import
cn.wise.sc.cement.business.service.IEntrustService
;
import
cn.wise.sc.cement.business.service.IEntrustService
;
import
cn.wise.sc.cement.business.util.WordUtil
;
import
cn.wise.sc.cement.business.util.WordUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.Assert
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -46,6 +57,8 @@ public class ReportController {
...
@@ -46,6 +57,8 @@ public class ReportController {
final
final
IEntrustService
iEntrustService
;
IEntrustService
iEntrustService
;
@Autowired
IEntityEnclosureService
iEntityEnclosureService
;
public
ReportController
(
IEntrustService
iEntrustService
)
{
public
ReportController
(
IEntrustService
iEntrustService
)
{
this
.
iEntrustService
=
iEntrustService
;
this
.
iEntrustService
=
iEntrustService
;
...
@@ -128,6 +141,45 @@ public class ReportController {
...
@@ -128,6 +141,45 @@ public class ReportController {
}
}
@PostMapping
(
"/upload"
)
@ApiOperation
(
"上传报告"
)
public
BaseResponse
<
Boolean
>
uploadReport
(
@RequestBody
SampleHandleEnclosureQuery
query
){
Assert
.
notNull
(
query
.
getId
(),
"委托id不能为空!"
);
QueryWrapper
<
EntityEnclosure
>
qw
=
new
QueryWrapper
();
qw
.
eq
(
"entity_type"
,
5
);
qw
.
eq
(
"entity_id"
,
query
.
getId
());
if
(
FileExt
.
EXCL
.
getName
().
equals
(
query
.
getExtName
())
||
FileExt
.
EXCLX
.
getName
().
equals
(
query
.
getExtName
())){
EntityEnclosure
one
=
iEntityEnclosureService
.
getOne
(
qw
);
if
(
BeanUtil
.
isEmpty
(
one
)){
EntityEnclosure
entityEnclosure
=
new
EntityEnclosure
();
entityEnclosure
.
setEntityId
(
query
.
getId
());
entityEnclosure
.
setExtName
(
query
.
getExtName
());
entityEnclosure
.
setCreateTime
(
LocalDateTime
.
now
());
entityEnclosure
.
setUpdateTime
(
LocalDateTime
.
now
());
entityEnclosure
.
setEnclosureUrl
(
query
.
getEnclosureUrl
());
entityEnclosure
.
setAlias
(
query
.
getAlias
());
entityEnclosure
.
setEntityType
(
5
);
iEntityEnclosureService
.
save
(
entityEnclosure
);
return
BaseResponse
.
okData
(
true
);
}
else
{
one
.
setAlias
(
query
.
getAlias
());
one
.
setEnclosureUrl
(
query
.
getEnclosureUrl
());
one
.
setExtName
(
query
.
getExtName
());
one
.
setUpdateTime
(
LocalDateTime
.
now
());
iEntityEnclosureService
.
updateById
(
one
);
return
BaseResponse
.
okData
(
true
);
}
}
else
{
return
BaseResponse
.
errorMsg
(
"文件类型只能是excel!"
);
}
}
/**
/**
* 将样品六元素检测Map转换成单独属性
* 将样品六元素检测Map转换成单独属性
*
*
...
@@ -201,4 +253,6 @@ public class ReportController {
...
@@ -201,4 +253,6 @@ public class ReportController {
return
strBuilder
.
replace
(
0
,
5
,
""
).
toString
();
return
strBuilder
.
replace
(
0
,
5
,
""
).
toString
();
}
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/FileExt.java
View file @
4e6761f3
...
@@ -10,7 +10,8 @@ public enum FileExt {
...
@@ -10,7 +10,8 @@ public enum FileExt {
//office后缀名
//office后缀名
DOC
(
".doc"
),
DOC
(
".doc"
),
EXCL
(
".xls"
);
EXCL
(
".xls"
),
EXCLX
(
".xlsx"
);
private
String
name
;
private
String
name
;
...
...
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