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
be2dfeca
Commit
be2dfeca
authored
Oct 27, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
26c9d30e
0cff4e7d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
159 additions
and
136 deletions
+159
-136
ReportController.java
.../wise/sc/cement/business/controller/ReportController.java
+19
-11
EntrustReport.java
...java/cn/wise/sc/cement/business/entity/EntrustReport.java
+6
-1
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+2
-2
SampleCheckMapper.xml
.../wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
+5
-6
SixElementReport.java
...va/cn/wise/sc/cement/business/model/SixElementReport.java
+6
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+88
-88
PlanTrainingServiceImpl.java
...cement/business/service/impl/PlanTrainingServiceImpl.java
+33
-28
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ReportController.java
View file @
be2dfeca
...
@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.PathVariable;
...
@@ -25,6 +25,7 @@ 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.List
;
...
@@ -90,7 +91,7 @@ public class ReportController {
...
@@ -90,7 +91,7 @@ public class ReportController {
//首页及封面导出
//首页及封面导出
ReportDetailVo
rts
=
iEntrustService
.
getReportDetail
(
entrustId
);
ReportDetailVo
rts
=
iEntrustService
.
getReportDetail
(
entrustId
);
if
(
rts
==
null
){
if
(
rts
==
null
)
{
return
;
return
;
}
}
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
10
);
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
10
);
...
@@ -121,7 +122,7 @@ public class ReportController {
...
@@ -121,7 +122,7 @@ public class ReportController {
//化学工业导出
//化学工业导出
List
<
IndustrialReport
>
list1
=
iEntrustService
.
getSampleIndustrialCheck
(
entrustId
);
List
<
IndustrialReport
>
list1
=
iEntrustService
.
getSampleIndustrialCheck
(
entrustId
);
list1
.
forEach
(
this
::
initMapStr2AlongPro
);
list1
.
forEach
(
this
::
initMapStr2AlongPro
);
beanParams
.
put
(
"list3"
,
list1
);
beanParams
.
put
(
"list3"
,
list1
);
WordUtil
.
writeWordReport
(
rts
.
getProjectName
()
+
"(报告)"
,
"report.ftl"
,
WordUtil
.
writeWordReport
(
rts
.
getProjectName
()
+
"(报告)"
,
"report.ftl"
,
beanParams
,
response
,
FileExt
.
EXCL
);
beanParams
,
response
,
FileExt
.
EXCL
);
...
@@ -137,7 +138,10 @@ public class ReportController {
...
@@ -137,7 +138,10 @@ public class ReportController {
private
void
initMapStr2AlongPro
(
SixElementReport
sixElement
)
{
private
void
initMapStr2AlongPro
(
SixElementReport
sixElement
)
{
String
countResult
=
sixElement
.
getCountResults
();
String
countResult
=
sixElement
.
getCountResults
();
HashMap
<
String
,
String
>
countResultMap
=
JSON
.
parseObject
(
countResult
,
HashMap
.
class
);
List
<
SixElementReport
.
Element
>
list
=
JSON
.
parseArray
(
countResult
,
SixElementReport
.
Element
.
class
);
HashMap
<
String
,
String
>
countResultMap
=
new
HashMap
<>(
list
.
size
());
list
.
forEach
(
arg
->
countResultMap
.
put
(
arg
.
getName
(),
arg
.
getValue
()));
sixElement
.
setAl2o3
(
"-"
);
sixElement
.
setAl2o3
(
"-"
);
sixElement
.
setTio2
(
"-"
);
sixElement
.
setTio2
(
"-"
);
...
@@ -159,16 +163,19 @@ public class ReportController {
...
@@ -159,16 +163,19 @@ public class ReportController {
sixElement
.
setSo3
(
countResultMap
.
getOrDefault
(
SixElementKey
.
SO3
.
getKey
(),
"0"
));
sixElement
.
setSo3
(
countResultMap
.
getOrDefault
(
SixElementKey
.
SO3
.
getKey
(),
"0"
));
}
}
private
void
initMapStr2AlongPro
(
IndustrialReport
industrialReport
){
private
void
initMapStr2AlongPro
(
IndustrialReport
industrialReport
)
{
String
countResult
=
industrialReport
.
getCountResults
();
String
countResult
=
industrialReport
.
getCountResults
();
HashMap
<
String
,
String
>
countResultMap
=
JSON
.
parseObject
(
countResult
,
HashMap
.
class
);
List
<
SixElementReport
.
Element
>
list
=
JSON
.
parseArray
(
countResult
,
SixElementReport
.
Element
.
class
);
industrialReport
.
setAad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Aad
.
getKey
(),
"0"
));
HashMap
<
String
,
String
>
countResultMap
=
new
HashMap
<>(
list
.
size
());
industrialReport
.
setJz
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
JZ
.
getKey
(),
"0"
));
list
.
forEach
(
arg
->
countResultMap
.
put
(
arg
.
getName
(),
arg
.
getValue
()));
industrialReport
.
setMad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Mad
.
getKey
(),
"0"
));
industrialReport
.
setMjkg
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
QnetAdMJkg
.
getKey
(),
"0"
));
industrialReport
.
setAad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Aad
.
getKey
(),
"0"
));
industrialReport
.
setStad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
StAd
.
getKey
(),
"0"
));
industrialReport
.
setJz
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
JZ
.
getKey
(),
"0"
));
industrialReport
.
setVad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Vad
.
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"
));
}
}
...
@@ -194,4 +201,5 @@ public class ReportController {
...
@@ -194,4 +201,5 @@ 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/entity/EntrustReport.java
View file @
be2dfeca
...
@@ -72,7 +72,7 @@ public class EntrustReport {
...
@@ -72,7 +72,7 @@ public class EntrustReport {
/**
/**
* 机械仪器名字
* 机械仪器名字
*/
*/
private
String
equipmentName
;
private
String
equipmentName
;
/**
/**
* 用户id
* 用户id
...
@@ -93,4 +93,9 @@ public class EntrustReport {
...
@@ -93,4 +93,9 @@ public class EntrustReport {
* 样品创建时间
* 样品创建时间
*/
*/
private
Date
sendTime
;
private
Date
sendTime
;
/**
* 器械id
*/
private
Integer
equipmentId
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
be2dfeca
...
@@ -229,9 +229,9 @@
...
@@ -229,9 +229,9 @@
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
RIGHT JOIN
RIGHT JOIN
(SELECT 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
scct.equipment_name,scct.user_id,create_time as send_time
,scct.equipment_id
FROM sample s
RIGHT JOIN
RIGHT JOIN
(SELECT check_id,equipment_name,sample_id,user_id FROM sample_check_team sct
(SELECT check_id,equipment_name,sample_id,user_id
,equipment_id
FROM sample_check_team sct
RIGHT JOIN
RIGHT JOIN
(SELECT entrust_id,id FROM sample_check WHERE entrust_id = #{entrustId}) sc
(SELECT entrust_id,id FROM sample_check WHERE entrust_id = #{entrustId}) sc
ON sct.check_id = sc.id ) scct
ON sct.check_id = sc.id ) scct
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
View file @
be2dfeca
...
@@ -4,17 +4,16 @@
...
@@ -4,17 +4,16 @@
<select
id=
"getSampleSixElementCheck"
resultType=
"cn.wise.sc.cement.business.model.SixElementReport"
>
<select
id=
"getSampleSixElementCheck"
resultType=
"cn.wise.sc.cement.business.model.SixElementReport"
>
SELECT * FROM (SELECT count_results,entrust_id,team_group_name,sct.sample_id FROM sample_check sc
SELECT * FROM (SELECT count_results,entrust_id,team_group_name,sct.sample_id
,sc.id
FROM sample_check sc
LEFT JOIN
LEFT JOIN
(SELECT check_id,sample_id FROM sample_check_team) sct
(SELECT check_id,sample_id FROM sample_check_team) sct
ON sct.check_id = sc.id
ON sct.check_id = sc.id
AND sc. is_parallel = 0
WHERE sample_id IS NOT NULL AND sc.team_group_name = '六元素' ) sscct
WHERE sct.sample_id IS NOT NULL AND sc.team_group_name = '六元素' ) sscct
RIGHT JOIN
RIGHT JOIN
(SELECT cement_code,sample_code,sample_form,`name` as sample_nam
e,weight,id
(SELECT cement_code,sample_code,sample_form,`name` as sample_name,parallel_cod
e,weight,id
FROM sample) s
FROM sample) s
ON s.id = sscct.sample_id AND entrust_id = #{entrustId}
ON s.id = sscct.sample_id AND entrust_id = #{entrustId}
WHERE count_results IS NOT NULL;
WHERE count_results IS NOT NULL
AND s.parallel_code = cement_code
;
</select>
</select>
<select
id=
"getSampleIndustrialCheck"
resultType=
"cn.wise.sc.cement.business.model.IndustrialReport"
>
<select
id=
"getSampleIndustrialCheck"
resultType=
"cn.wise.sc.cement.business.model.IndustrialReport"
>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/SixElementReport.java
View file @
be2dfeca
...
@@ -62,4 +62,10 @@ public class SixElementReport implements Serializable {
...
@@ -62,4 +62,10 @@ public class SixElementReport implements Serializable {
private
String
al2o3
=
""
;
private
String
al2o3
=
""
;
private
String
tio2
=
""
;
private
String
tio2
=
""
;
@Data
public
static
class
Element
implements
Serializable
{
private
String
name
;
private
String
value
;
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
be2dfeca
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanTrainingServiceImpl.java
View file @
be2dfeca
...
@@ -94,35 +94,15 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
...
@@ -94,35 +94,15 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
if
(
save
)
{
if
(
save
)
{
Integer
planId
=
cama
.
getId
();
Integer
planId
=
cama
.
getId
();
//todo 培训关联表对象 ==>plant + 基本用户信息
//todo 培训关联表对象 ==>plant + 基本用户信息
//拆分用户id
String
userIds
=
query
.
getUserIds
();
String
[]
split
=
userIds
.
split
(
"、"
);
List
<
PlanPeople
>
batchAdd
=
new
ArrayList
<>();
List
<
PlanPeople
>
batchAdd
=
new
ArrayList
<>();
//为每个用户id创建关联表信息s
if
(
query
.
getUserIds
()!=
null
)
{
for
(
String
userId
:
split
)
{
//拆分用户id
Integer
id
=
Integer
.
parseInt
(
userId
);
String
userIds
=
query
.
getUserIds
();
UserVo
user
=
sysUserMapper
.
getById
(
id
);
String
[]
split
=
userIds
.
split
(
"、"
);
PlanPeople
planPeople
=
new
PlanPeople
();
//为每个用户id创建关联表信息s
planPeople
.
setPlanId
(
planId
);
for
(
String
userId
:
split
)
{
planPeople
.
setUserId
(
user
.
getId
());
Integer
id
=
Integer
.
parseInt
(
userId
);
planPeople
.
setName
(
user
.
getName
());
UserVo
user
=
sysUserMapper
.
getById
(
id
);
planPeople
.
setAccount
(
user
.
getUsername
());
planPeople
.
setGroupId
(
user
.
getGroupId
());
batchAdd
.
add
(
planPeople
);
cama
.
setPlanObject
(
cama
.
getPlanObject
()
+
user
.
getName
()
+
"、"
);
}
//传的GroupIds
String
groupIds
=
query
.
getGroupIds
();
String
[]
split1
=
groupIds
.
split
(
"、"
);
List
<
PlanPeople
>
batchAdd1
=
new
ArrayList
<>();
for
(
String
groupId
:
split1
)
{
int
gpId
=
Integer
.
parseInt
(
groupId
);
QueryWrapper
<
SysUser
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"group_id"
,
gpId
);
List
<
SysUser
>
sysUsers
=
sysUserMapper
.
selectList
(
qw
);
for
(
SysUser
user
:
sysUsers
)
{
PlanPeople
planPeople
=
new
PlanPeople
();
PlanPeople
planPeople
=
new
PlanPeople
();
planPeople
.
setPlanId
(
planId
);
planPeople
.
setPlanId
(
planId
);
planPeople
.
setUserId
(
user
.
getId
());
planPeople
.
setUserId
(
user
.
getId
());
...
@@ -131,6 +111,31 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
...
@@ -131,6 +111,31 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
planPeople
.
setGroupId
(
user
.
getGroupId
());
planPeople
.
setGroupId
(
user
.
getGroupId
());
batchAdd
.
add
(
planPeople
);
batchAdd
.
add
(
planPeople
);
cama
.
setPlanObject
(
cama
.
getPlanObject
()
+
user
.
getName
()
+
"、"
);
}
}
if
(
query
.
getGroupIds
()!=
null
)
{
//传的GroupIds
String
groupIds
=
query
.
getGroupIds
();
String
[]
split1
=
groupIds
.
split
(
"、"
);
List
<
PlanPeople
>
batchAdd1
=
new
ArrayList
<>();
for
(
String
groupId
:
split1
)
{
int
gpId
=
Integer
.
parseInt
(
groupId
);
QueryWrapper
<
SysUser
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"group_id"
,
gpId
);
List
<
SysUser
>
sysUsers
=
sysUserMapper
.
selectList
(
qw
);
for
(
SysUser
user
:
sysUsers
)
{
PlanPeople
planPeople
=
new
PlanPeople
();
planPeople
.
setPlanId
(
planId
);
planPeople
.
setUserId
(
user
.
getId
());
planPeople
.
setName
(
user
.
getName
());
planPeople
.
setAccount
(
user
.
getUsername
());
planPeople
.
setGroupId
(
user
.
getGroupId
());
batchAdd
.
add
(
planPeople
);
cama
.
setPlanObject
(
cama
.
getPlanObject
()
+
user
.
getName
()
+
"、"
);
}
}
}
}
}
iPlantPeopleService
.
saveBatch
(
batchAdd
);
iPlantPeopleService
.
saveBatch
(
batchAdd
);
...
...
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