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
de2b762a
Commit
de2b762a
authored
Oct 16, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://111.203.232.171:8888/zhutianwei/tianjin-cement
parents
1d37edd7
39928e83
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
241 additions
and
70 deletions
+241
-70
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+0
-4
ReportController.java
.../wise/sc/cement/business/controller/ReportController.java
+23
-0
SampleCheckMapper.java
.../cn/wise/sc/cement/business/mapper/SampleCheckMapper.java
+10
-1
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+6
-7
SampleCheckMapper.xml
.../wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
+17
-1
IndustrialElementKey.java
...n/wise/sc/cement/business/model/IndustrialElementKey.java
+27
-0
IndustrialReport.java
...va/cn/wise/sc/cement/business/model/IndustrialReport.java
+55
-0
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+9
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+7
-0
report.ftl
cement-business/src/main/resources/templates/report.ftl
+87
-57
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
de2b762a
...
...
@@ -4,7 +4,6 @@ package cn.wise.sc.cement.business.controller;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.FileExt
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.ReportDetailVo
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.vo.EntrustVo
;
import
cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo
;
...
...
@@ -15,18 +14,15 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* <p>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ReportController.java
View file @
de2b762a
...
...
@@ -2,6 +2,8 @@ package cn.wise.sc.cement.business.controller;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.FileExt
;
import
cn.wise.sc.cement.business.model.IndustrialElementKey
;
import
cn.wise.sc.cement.business.model.IndustrialReport
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.ReportDetailVo
;
import
cn.wise.sc.cement.business.model.SixElementKey
;
...
...
@@ -88,6 +90,9 @@ public class ReportController {
//首页及封面导出
ReportDetailVo
rts
=
iEntrustService
.
getReportDetail
(
entrustId
);
if
(
rts
==
null
){
return
;
}
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
10
);
beanParams
.
put
(
"sendName"
,
rts
.
getSendName
());
beanParams
.
put
(
"sender"
,
rts
.
getSender
());
...
...
@@ -112,6 +117,11 @@ public class ReportController {
beanParams
.
put
(
"list1"
,
al2o3AndTio2List
);
beanParams
.
put
(
"list2"
,
al2o3SplitTio2List
);
//化学工业导出
List
<
IndustrialReport
>
list1
=
iEntrustService
.
getSampleIndustrialCheck
(
entrustId
);
list1
.
forEach
(
this
::
initMapStr2AlongPro
);
beanParams
.
put
(
"list3"
,
list1
);
WordUtil
.
writeWordReport
(
rts
.
getProjectName
()
+
"(报告)"
,
"report.ftl"
,
beanParams
,
response
,
FileExt
.
EXCL
);
...
...
@@ -148,6 +158,19 @@ public class ReportController {
sixElement
.
setSo3
(
countResultMap
.
getOrDefault
(
SixElementKey
.
SO3
.
getKey
(),
"0"
));
}
private
void
initMapStr2AlongPro
(
IndustrialReport
industrialReport
){
String
countResult
=
industrialReport
.
getCountResult
();
HashMap
<
String
,
String
>
countResultMap
=
JSON
.
parseObject
(
countResult
,
HashMap
.
class
);
industrialReport
.
setAad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Aad
.
getKey
(),
"0"
));
industrialReport
.
setJz
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
JZ
.
getKey
(),
"0"
));
industrialReport
.
setMad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Mad
.
getKey
(),
"0"
));
industrialReport
.
setMjkg
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
QnetAdMJkg
.
getKey
(),
"0"
));
industrialReport
.
setStad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
StAd
.
getKey
(),
"0"
));
industrialReport
.
setVad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Vad
.
getKey
(),
"0"
));
}
private
String
set2String
(
Set
<
String
>
source
)
{
if
(
source
.
size
()
==
0
)
{
return
""
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleCheckMapper.java
View file @
de2b762a
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.SampleCheck
;
import
cn.wise.sc.cement.business.model.IndustrialReport
;
import
cn.wise.sc.cement.business.model.SixElementReport
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -21,5 +23,12 @@ public interface SampleCheckMapper extends BaseMapper<SampleCheck> {
* @param entrustId 项目id
* @return SixElementReport
*/
List
<
SixElementReport
>
getSampleSixElementCheck
(
Integer
entrustId
);
List
<
SixElementReport
>
getSampleSixElementCheck
(
@Param
(
"entrustId"
)
Integer
entrustId
);
/**
* 获取样品工业检测结果
* @param entrustId 项目id
* @return IndustrialReport
*/
List
<
IndustrialReport
>
getSampleIndustrialCheck
(
@Param
(
"entrustId"
)
Integer
entrustId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
de2b762a
...
...
@@ -241,16 +241,15 @@
<select
id=
"getReportDetail"
resultType=
"cn.wise.sc.cement.business.entity.EntrustReport"
>
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
RIGHT JOIN
(SELECT id
as sample_id
,entrust_id,team_ids,method_numbers,name,scct.check_id,
(SELECT id,entrust_id,team_ids,method_numbers,name,scct.check_id,
scct.equipment_name,scct.user_id,create_time as send_time FROM sample s
RIGHT JOIN
(SELECT check_id,equipment_name,sample_id,user_id FROM sample_check_team sct
LEFT JOIN
(SELECT entrust_id,id FROM sample_check) sc
ON sct.check_id = sc.id) scct
ON s.sample_id = scct.sample_id) sscct
ON sscct.entrust_id = e.id AND e.id = #{entrustId}
WHERE id IS NOT NULL
RIGHT JOIN
(SELECT entrust_id,id FROM sample_check WHERE entrust_id = #{entrustId}) sc
ON sct.check_id = sc.id ) scct
ON s.id = scct.sample_id) sscct
ON sscct.entrust_id = e.id
</select>
<select
id=
"getQualityDetail"
resultType=
"cn.wise.sc.cement.business.entity.QualityDetail"
>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
View file @
de2b762a
...
...
@@ -13,7 +13,23 @@
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
ON s.id = sscct.sample_id AND entrust_id =
#{entrustId}
WHERE count_result IS NOT NULL;
</select>
<select
id=
"getSampleIndustrialCheck"
resultType=
"cn.wise.sc.cement.business.model.IndustrialReport"
>
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 = #{entrustId}
WHERE count_result IS NOT NULL;
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/model/IndustrialElementKey.java
0 → 100644
View file @
de2b762a
package
cn
.
wise
.
sc
.
cement
.
business
.
model
;
/**
* @description: 工业特性key
* @author: qh
* @create: 2020-10-16 14:33
**/
public
enum
IndustrialElementKey
{
//工业特性
Mad
(
"Mad"
),
Aad
(
"Aad"
),
Vad
(
"Vad"
),
QnetAdMJkg
(
"Qnet,ad(MJ/kg)"
),
JZ
(
"焦渣"
),
StAd
(
"St,ad"
);
private
String
key
;
IndustrialElementKey
(
String
key
){
this
.
key
=
key
;
}
public
String
getKey
()
{
return
key
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/IndustrialReport.java
0 → 100644
View file @
de2b762a
package
cn
.
wise
.
sc
.
cement
.
business
.
model
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @description: 工业分析报告
* @author: qh
* @create: 2020-10-16 14:06
**/
@Data
public
class
IndustrialReport
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
mad
;
private
String
aad
;
private
String
vad
;
private
String
mjkg
;
private
String
jz
;
private
String
qnetstad
;
private
String
stad
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
de2b762a
...
...
@@ -5,6 +5,7 @@ import cn.wise.sc.cement.business.entity.EntrustReport;
import
cn.wise.sc.cement.business.entity.SampleDistribution
;
import
cn.wise.sc.cement.business.entity.SampleHandleEnclosure
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.IndustrialReport
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.ReportDetailVo
;
import
cn.wise.sc.cement.business.model.SixElementReport
;
...
...
@@ -114,4 +115,12 @@ public interface IEntrustService extends IService<Entrust> {
* @return 六元素校核
*/
List
<
SixElementReport
>
getSampleSixElementCheck
(
Integer
entrustId
);
/**
* 查询工业特性
* @param entrustId 委托id
* @return 工业特征
*
*/
List
<
IndustrialReport
>
getSampleIndustrialCheck
(
Integer
entrustId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
de2b762a
...
...
@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
import
cn.wise.sc.cement.business.entity.*
;
import
cn.wise.sc.cement.business.mapper.*
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.IndustrialReport
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.ReportDetailVo
;
...
...
@@ -686,6 +687,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
@Override
public
List
<
IndustrialReport
>
getSampleIndustrialCheck
(
Integer
entrustId
)
{
return
sampleCheckMapper
.
getSampleIndustrialCheck
(
entrustId
);
}
/**
* 获取样品表里最大的平行样编号
...
...
cement-business/src/main/resources/templates/report.ftl
View file @
de2b762a
...
...
@@ -3000,53 +3000,57 @@
<Data
ss:Type=
"String"
>
1450℃
</Data>
</Cell>
</Row>
<Row
ss:Height=
"30.5"
>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s330"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s184"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s184"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s185"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s186"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
</Row>
<Row
ss:Height=
"30.5"
>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s330"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s184"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s184"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s185"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s186"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
></Data>
</Cell>
</Row>
<Row
ss:Height=
"15.5"
>
<Cell
ss:StyleID=
"s156"
/>
<Cell
ss:StyleID=
"s156"
/>
...
...
@@ -4125,26 +4129,52 @@
<Data
ss:Type=
"String"
>
出样率(%)
</Data>
</Cell>
</Row>
<
#-- 工业特性 -->
<
#list list3 as item>
<Row
ss:Height=
"15.5"
>
<Cell
ss:StyleID=
"s156"
/>
<Cell
ss:StyleID=
"s156"
/>
<Cell
ss:StyleID=
"s156"
/>
<Cell
ss:StyleID=
"s156"
/>
<Cell
ss:StyleID=
"s156"
/>
<Cell
ss:StyleID=
"s157"
/>
<Cell
ss:StyleID=
"s157"
/>
<Cell
ss:StyleID=
"s157"
/>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
>
${item.sampleName}
</Data>
</Cell>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
>
${item.sampleForm}
</Data>
</Cell>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
>
${item.sampleCode}
</Data>
</Cell>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
>
${item.weight}
</Data>
</Cell>
<Cell
ss:StyleID=
"s156"
>
<Data
ss:Type=
"String"
>
${item.cementCode}
</Data>
</Cell>
<Cell
ss:StyleID=
"s157"
>
<Data
ss:Type=
"String"
>
${item.mad}
</Data>
</Cell>
<Cell
ss:StyleID=
"s157"
>
<Data
ss:Type=
"String"
>
${item.aad}
</Data>
</Cell>
<Cell
ss:StyleID=
"s157"
>
<Data
ss:Type=
"String"
>
${item.vad}
</Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
>
—
</Data>
</Cell>
<Cell
ss:StyleID=
"s153"
/>
<Cell
ss:StyleID=
"s157"
/>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
>
${item.jz}
</Data>
</Cell>
<Cell
ss:StyleID=
"s157"
>
<Data
ss:Type=
"String"
>
${item.stad}
</Data>
</Cell>
<Cell
ss:StyleID=
"s153"
>
<Data
ss:Type=
"String"
>
—
</Data>
</Cell>
<Cell
ss:StyleID=
"s244"
/>
<Cell
ss:StyleID=
"s153"
/>
</Row>
<
/#list>
<Row
ss:Height=
"15.5"
>
<Cell
ss:StyleID=
"s156"
/>
<Cell
ss:StyleID=
"s156"
/>
...
...
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