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
8f760b2f
Commit
8f760b2f
authored
Oct 15, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://111.203.232.171:8888/zhutianwei/tianjin-cement
parents
7c153b78
61d593fd
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
5477 additions
and
640 deletions
+5477
-640
ReportController.java
.../wise/sc/cement/business/controller/ReportController.java
+60
-2
SampleCheckMapper.java
.../cn/wise/sc/cement/business/mapper/SampleCheckMapper.java
+9
-0
SampleCheckMapper.xml
.../wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
+14
-0
SixElementKey.java
.../java/cn/wise/sc/cement/business/model/SixElementKey.java
+30
-0
SixElementReport.java
...va/cn/wise/sc/cement/business/model/SixElementReport.java
+65
-0
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+7
-6
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+8
-0
report.ftl
cement-business/src/main/resources/templates/report.ftl
+5284
-629
report1.ftl
cement-business/src/main/resources/templates/report1.ftl
+0
-3
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ReportController.java
View file @
8f760b2f
...
@@ -3,9 +3,12 @@ package cn.wise.sc.cement.business.controller;
...
@@ -3,9 +3,12 @@ package cn.wise.sc.cement.business.controller;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
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.SixElementReport
;
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.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.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
;
...
@@ -19,10 +22,13 @@ import org.springframework.web.bind.annotation.PathVariable;
...
@@ -19,10 +22,13 @@ 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.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
/**
* @description: 报告管理
* @description: 报告管理
...
@@ -80,8 +86,8 @@ public class ReportController {
...
@@ -80,8 +86,8 @@ public class ReportController {
public
void
getReportDetail
(
@PathVariable
(
"entrustId"
)
Integer
entrustId
,
public
void
getReportDetail
(
@PathVariable
(
"entrustId"
)
Integer
entrustId
,
HttpServletResponse
response
)
{
HttpServletResponse
response
)
{
//首页及封面导出
ReportDetailVo
rts
=
iEntrustService
.
getReportDetail
(
entrustId
);
ReportDetailVo
rts
=
iEntrustService
.
getReportDetail
(
entrustId
);
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
10
);
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
10
);
beanParams
.
put
(
"sendName"
,
rts
.
getSendName
());
beanParams
.
put
(
"sendName"
,
rts
.
getSendName
());
beanParams
.
put
(
"sender"
,
rts
.
getSender
());
beanParams
.
put
(
"sender"
,
rts
.
getSender
());
...
@@ -94,11 +100,63 @@ public class ReportController {
...
@@ -94,11 +100,63 @@ public class ReportController {
beanParams
.
put
(
"projectName"
,
rts
.
getProjectName
());
beanParams
.
put
(
"projectName"
,
rts
.
getProjectName
());
beanParams
.
put
(
"printDate"
,
rts
.
getPrintDate
());
beanParams
.
put
(
"printDate"
,
rts
.
getPrintDate
());
//六元素导出
List
<
SixElementReport
>
list
=
iEntrustService
.
getSampleSixElementCheck
(
entrustId
);
list
.
forEach
(
this
::
initMapStr2AlongPro
);
List
<
SixElementReport
>
Al2O3AndTiO2List
=
list
.
stream
()
.
filter
(
arg
->
!
"-"
.
equals
(
arg
.
getAl2o3AndTio2
()))
.
collect
(
Collectors
.
toList
());
List
<
SixElementReport
>
Al2O3SplitTiO2List
=
list
.
stream
()
.
filter
(
arg
->
"-"
.
equals
(
arg
.
getAl2o3AndTio2
()))
.
collect
(
Collectors
.
toList
());
beanParams
.
put
(
"list1"
,
Al2O3AndTiO2List
);
beanParams
.
put
(
"list2"
,
Al2O3SplitTiO2List
);
WordUtil
.
writeWordReport
(
rts
.
getProjectName
()
+
"(报告).xls"
,
"report.ftl"
,
WordUtil
.
writeWordReport
(
rts
.
getProjectName
()
+
"(报告).xls"
,
"report.ftl"
,
beanParams
,
response
);
beanParams
,
response
);
}
}
/**
* 将样品六元素检测Map转换成单独属性
*
* @param sixElement 带转换的六元素检测结果
* @return 已转换结果
*/
private
SixElementReport
initMapStr2AlongPro
(
SixElementReport
sixElement
)
{
String
countResult
=
sixElement
.
getCountResult
();
HashMap
<
String
,
String
>
countResultMap
=
JSON
.
parseObject
(
countResult
,
HashMap
.
class
);
sixElement
.
setAl2o3
(
"-"
);
sixElement
.
setTio2
(
"-"
);
sixElement
.
setAl2o3AndTio2
(
"-"
);
//判断检测结果中六元素Al2O3是否包含TiO2
if
(
countResultMap
.
containsKey
(
SixElementKey
.
Al2O3AndTiO2
.
getKey
()))
{
sixElement
.
setAl2o3AndTio2
(
countResultMap
.
get
(
SixElementKey
.
Al2O3AndTiO2
.
getKey
()));
}
else
{
sixElement
.
setAl2o3
(!
countResultMap
.
containsKey
(
SixElementKey
.
Al2O3
.
getKey
())
?
"0"
:
countResultMap
.
get
(
SixElementKey
.
Al2O3
.
getKey
()));
sixElement
.
setTio2
(!
countResultMap
.
containsKey
(
SixElementKey
.
TiO2
.
getKey
())
?
"0"
:
countResultMap
.
get
(
SixElementKey
.
TiO2
.
getKey
()));
}
sixElement
.
setCao
(!
countResultMap
.
containsKey
(
SixElementKey
.
CaO
.
getKey
())
?
"0"
:
countResultMap
.
get
(
SixElementKey
.
CaO
.
getKey
()));
sixElement
.
setCl
(!
countResultMap
.
containsKey
(
SixElementKey
.
Cl
.
getKey
())
?
"0"
:
countResultMap
.
get
(
SixElementKey
.
Cl
.
getKey
()));
sixElement
.
setFe2o3
(!
countResultMap
.
containsKey
(
SixElementKey
.
Fe2O3
.
getKey
())
?
"0"
:
countResultMap
.
get
(
SixElementKey
.
Fe2O3
.
getKey
()));
sixElement
.
setLoi
(!
countResultMap
.
containsKey
(
SixElementKey
.
LOI
.
getKey
())
?
"0"
:
countResultMap
.
get
(
SixElementKey
.
LOI
.
getKey
()));
sixElement
.
setMgo
(!
countResultMap
.
containsKey
(
SixElementKey
.
MgO
.
getKey
())
?
"0"
:
countResultMap
.
get
(
SixElementKey
.
MgO
.
getKey
()));
sixElement
.
setSio2
(!
countResultMap
.
containsKey
(
SixElementKey
.
SiO2
.
getKey
())
?
"0"
:
countResultMap
.
get
(
SixElementKey
.
SiO2
.
getKey
()));
sixElement
.
setSo3
(!
countResultMap
.
containsKey
(
SixElementKey
.
SO3
.
getKey
())
?
"0"
:
countResultMap
.
get
(
SixElementKey
.
SO3
.
getKey
()));
return
sixElement
;
}
public
static
void
main
(
String
[]
args
)
{
String
str
=
"{\"Al2O3+TiO2\":\"-1488450.00\",\"CaO\":\"3650.00\",\"MgO\":\"0.00\",\"L.O.I\":\"10218.00\",\"SiO2\":\"2750.00\",\"Al2O3\":\"-1902250.00\",\"Fe2O3\":\"2100.00\"}"
;
Map
<
String
,
String
>
map
=
JSON
.
parseObject
(
str
,
HashMap
.
class
);
System
.
out
.
println
(
map
.
toString
());
}
private
String
set2String
(
Set
<
String
>
source
)
{
private
String
set2String
(
Set
<
String
>
source
)
{
if
(
source
.
size
()
==
0
)
{
if
(
source
.
size
()
==
0
)
{
return
""
;
return
""
;
...
@@ -119,6 +177,6 @@ public class ReportController {
...
@@ -119,6 +177,6 @@ public class ReportController {
strBuilder
.
append
(
" "
).
append
(
target
);
strBuilder
.
append
(
" "
).
append
(
target
);
}
}
return
strBuilder
.
replace
(
0
,
5
,
""
).
toString
();
return
strBuilder
.
replace
(
0
,
5
,
""
).
toString
();
}
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleCheckMapper.java
View file @
8f760b2f
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.SampleCheck
;
import
cn.wise.sc.cement.business.entity.SampleCheck
;
import
cn.wise.sc.cement.business.model.SixElementReport
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
/**
* <p>
* <p>
* Mapper 接口
* Mapper 接口
...
@@ -13,4 +16,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -13,4 +16,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
SampleCheckMapper
extends
BaseMapper
<
SampleCheck
>
{
public
interface
SampleCheckMapper
extends
BaseMapper
<
SampleCheck
>
{
/**
* 获取样品六元素检测结果
* @param entrustId 项目id
* @return SixElementReport
*/
List
<
SixElementReport
>
getSampleSixElementCheck
(
Integer
entrustId
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
View file @
8f760b2f
...
@@ -2,4 +2,18 @@
...
@@ -2,4 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.SampleCheckMapper"
>
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.SampleCheckMapper"
>
<select
id=
"getSampleSixElementCheck"
resultType=
"cn.wise.sc.cement.business.model.SixElementReport"
>
SELECT * FROM (SELECT count_result,entrust_id,team_group_name,sct.sample_id FROM sample_check sc
LEFT JOIN
(SELECT check_id,sample_id FROM sample_check_team) sct
ON sct.check_id = sc.id
AND sc. is_parallel = 0
WHERE sct.sample_id IS NOT NULL AND sc.team_group_name = '六元素' ) sscct
RIGHT JOIN
(SELECT cement_code,sample_code,sample_form,`name` as sample_name,weight,id
FROM sample) s
ON s.id = sscct.sample_id AND entrust_id =1
WHERE count_result IS NOT NULL;
</select>
</mapper>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/model/SixElementKey.java
0 → 100644
View file @
8f760b2f
package
cn
.
wise
.
sc
.
cement
.
business
.
model
;
/**
* @description: 六元素检测结果中的key
* @author: qh
* @create: 2020-10-15 14:03
**/
public
enum
SixElementKey
{
//六元素key
LOI
(
"L.O.I"
),
SiO2
(
"SiO2"
),
Al2O3
(
"Al2O3"
),
TiO2
(
"TiO2"
),
CaO
(
"CaO"
),
MgO
(
"MgO"
),
SO3
(
"So3"
),
Cl
(
"Cl"
),
Fe2O3
(
"Fe2O3"
),
Al2O3AndTiO2
(
"Al2O3+TiO2"
);
private
String
key
;
SixElementKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getKey
(){
return
this
.
key
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/SixElementReport.java
0 → 100644
View file @
8f760b2f
package
cn
.
wise
.
sc
.
cement
.
business
.
model
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @description: 六元素检测报告
* @author: qh
* @create: 2020-10-15 12:24
**/
@Data
public
class
SixElementReport
implements
Serializable
{
private
static
final
long
serialVersionUID
=
42L
;
/**
* 样品名称
*/
private
String
sampleName
;
/**
* 来样状态
*/
private
String
sampleForm
;
/**
* 来样编号
*/
private
String
sampleCode
;
/**
* 样品重量
*/
private
String
weight
;
/**
* 本所编号
*/
private
String
cementCode
;
/**
* 校核数据
*/
private
String
countResult
;
//下面为六元素
private
String
loi
=
""
;
private
String
sio2
=
""
;
private
String
fe2o3
=
""
;
private
String
cao
=
""
;
private
String
mgo
=
""
;
private
String
so3
=
""
;
private
String
cl
=
""
;
//情况一:Al2O3(含TiO3)
private
String
al2o3AndTio2
=
""
;
//情况二:Al2O3和TiO3单独分开
private
String
al2o3
=
""
;
private
String
tio2
=
""
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
8f760b2f
...
@@ -7,6 +7,7 @@ import cn.wise.sc.cement.business.entity.SampleHandleEnclosure;
...
@@ -7,6 +7,7 @@ import cn.wise.sc.cement.business.entity.SampleHandleEnclosure;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
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.SixElementReport
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.vo.*
;
import
cn.wise.sc.cement.business.model.vo.*
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
@@ -106,10 +107,10 @@ public interface IEntrustService extends IService<Entrust> {
...
@@ -106,10 +107,10 @@ public interface IEntrustService extends IService<Entrust> {
BaseResponse
<
List
<
SampleVo
>>
getSampleCheckDtail
(
Integer
id
);
BaseResponse
<
List
<
SampleVo
>>
getSampleCheckDtail
(
Integer
id
);
/**
* 查询六元素的检测结果
* @param entrustId 委托id
* @return 六元素校核
*/
List
<
SixElementReport
>
getSampleSixElementCheck
(
Integer
entrustId
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
8f760b2f
...
@@ -9,6 +9,7 @@ import cn.wise.sc.cement.business.model.BaseResponse;
...
@@ -9,6 +9,7 @@ import cn.wise.sc.cement.business.model.BaseResponse;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.PageQuery
;
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.SixElementReport
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.vo.*
;
import
cn.wise.sc.cement.business.model.vo.*
;
import
cn.wise.sc.cement.business.service.*
;
import
cn.wise.sc.cement.business.service.*
;
...
@@ -573,6 +574,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -573,6 +574,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
BaseResponse
.
okData
(
sampleVoList
);
return
BaseResponse
.
okData
(
sampleVoList
);
}
}
@Override
public
List
<
SixElementReport
>
getSampleSixElementCheck
(
Integer
entrustId
)
{
return
sampleCheckMapper
.
getSampleSixElementCheck
(
entrustId
);
}
/**
/**
* 获取样品表里最大的平行样编号
* 获取样品表里最大的平行样编号
...
...
cement-business/src/main/resources/templates/report.ftl
View file @
8f760b2f
This diff is collapsed.
Click to expand it.
cement-business/src/main/resources/templates/report1.ftl
deleted
100644 → 0
View file @
7c153b78
This diff is collapsed.
Click to expand it.
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