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
624b9ace
Commit
624b9ace
authored
Mar 10, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校核平行样的误差和结果值 优化
parent
071dd8f3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
227 additions
and
16 deletions
+227
-16
TeamMapper.java
...in/java/cn/wise/sc/cement/business/mapper/TeamMapper.java
+2
-0
TeamMapper.xml
...java/cn/wise/sc/cement/business/mapper/xml/TeamMapper.xml
+10
-2
DataStatisticsServiceImpl.java
...ment/business/service/impl/DataStatisticsServiceImpl.java
+112
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+103
-14
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/TeamMapper.java
View file @
624b9ace
...
...
@@ -27,6 +27,8 @@ public interface TeamMapper extends BaseMapper<Team> {
List
<
TeamListVo
>
getList
();
List
<
String
>
getNameList
();
TeamVo
getDetail
(
Integer
id
);
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/TeamMapper.xml
View file @
624b9ace
...
...
@@ -30,7 +30,7 @@
FROM team t
left join team_group tg on tg.id = t.group_id
<include
refid=
"where"
/>
ORDER BY t.
create_time desc
ORDER BY t.
group_id, t.id ASC
</select>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
...
...
@@ -58,9 +58,17 @@
t.method_name as methodName, t.number as number
FROM team t
where t.status=1 and t.is_display = 1
ORDER BY t.id ASC
ORDER BY t.
group_id, t.
id ASC
</select>
<select
id=
"getNameList"
resultType=
"java.lang.String"
>
SELECT t.name as name
FROM team t
where t.status=1 and t.is_display = 1
ORDER BY t.group_id, t.id ASC
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.TeamVo"
>
SELECT t.*, tg.name as groupName,
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/DataStatisticsServiceImpl.java
View file @
624b9ace
...
...
@@ -354,6 +354,118 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
}
/**
* 委托单进展统计-列表导出(新)
* @param cycle
* @param startDate
* @param endDate
* @param clientId
* @param clientName
* @param fileName
* @param response
*/
public
void
exportEntrustIngList
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
,
String
fileName
,
HttpServletResponse
response
){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"cycle"
,
cycle
);
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"clientName"
,
clientName
);
List
<
Map
<
String
,
Object
>>
list
=
dataStatisticsMapper
.
exportEntrustList
(
params
);
List
<
String
>
teamNameList
=
teamMapper
.
getNameList
();
if
(
teamNameList
==
null
||
teamNameList
.
size
()<=
0
){
return
;
}
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
String
[]
headers
=
new
String
[
12
];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"委托单号"
;
headers
[
2
]
=
"项目名称"
;
headers
[
3
]
=
"项目编号"
;
headers
[
4
]
=
"项目类型"
;
headers
[
5
]
=
"委托人"
;
headers
[
6
]
=
"委托单位"
;
headers
[
7
]
=
"委托日期"
;
headers
[
8
]
=
"样品数量"
;
headers
[
9
]
=
"检测项目"
;
headers
[
10
]
=
"产值"
;
headers
[
11
]
=
"状态"
;
for
(
int
i
=
0
;
i
<
teamNameList
.
size
();
i
++){
headers
[
12
+
i
]
=
teamNameList
.
get
(
i
);
}
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
String
objj
=
m
.
get
(
"entrustId"
).
toString
();
Integer
entrustId
=
Integer
.
valueOf
(
objj
);
//只统计主样的信息
List
<
Sample
>
sampleList
=
sampleMapper
.
getSampleList
(
entrustId
);
//检测项目名称
List
<
Integer
>
teamIdList
=
new
ArrayList
<>();
Map
<
String
,
Integer
>
teamMap
=
new
HashMap
<>();
//所有样品主样的产值
BigDecimal
outputValue
=
new
BigDecimal
(
"0.00"
);
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
//样品名称 列表中的拼接
for
(
Sample
sample
:
sampleList
)
{
if
(
sample
.
getOutputValue
()
!=
null
){
outputValue
=
outputValue
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
sample
.
getOutputValue
()
:
(
outputValue
.
add
(
sample
.
getOutputValue
()));
}
String
teamIds
=
sample
.
getTeamIds
();
String
checkTeam
=
""
;
if
(
teamIds
!=
null
)
{
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
if
(!
teamIdList
.
contains
(
team
.
getId
())){
teamMap
.
put
(
team
.
getName
(),
1
);
teamIdList
.
add
(
team
.
getId
());
}
else
{
teamMap
.
put
(
team
.
getName
(),
teamMap
.
get
(
team
.
getName
())+
1
);
}
checkTeam
=
checkTeam
.
equals
(
""
)
?
team
.
getName
()
:
(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
}
}
// JSONArray checkElementArray = mapToJSONArray(teamMap);
// String teamString = JSON.toJSON(checkElementArray).toString();
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
""
;
if
(
j
==
9
){
objects
[
9
]
=
teamMap
;
}
else
if
(
j
==
10
){
objects
[
10
]
=
outputValue
;
}
else
{
obj
=
m
.
get
(
headers
[
j
]).
toString
();
if
(
j
==
0
)
{
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托单进展统计-列表导出"
:
fileName
,
headers
,
datas
,
response
);
}
}
/**
* 进行中任务数量统计
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
624b9ace
...
...
@@ -3611,6 +3611,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
Sample
sample_this
=
sampleMapper
.
selectById
(
query
.
getSmapleId
());
if
(
sample_this
==
null
){
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
entrust
.
setStatus
(
7
);
//校核中状态
//保存校核输入表信息
QueryWrapper
<
SampleDistributionCheckinput
>
checkinputQueryWrapper
=
new
QueryWrapper
<>();
...
...
@@ -3647,6 +3652,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleDistributionCheckinputMapper
.
insert
(
checkinput
);
}
//根据按钮判断
if
(
query
.
getIsAgree
()
==
0
){
//保存
//保存校核结果信息
...
...
@@ -3665,6 +3673,36 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleDistributionCheckMapper
.
updateById
(
disCheck
);
dis
.
setCheckId
(
disCheck
.
getId
());
}
else
{
//判断是否有平行样
List
<
Sample
>
otherSampleList
=
sampleMapper
.
getOtherSampleList
(
entrust
.
getId
(),
sample_this
.
getCementCode
(),
sample_this
.
getId
());
if
(
otherSampleList
!=
null
&&
otherSampleList
.
size
()
>
0
){
for
(
Sample
s
:
otherSampleList
){
QueryWrapper
<
SampleDistribution
>
ortherWrapper
=
new
QueryWrapper
<>();
ortherWrapper
.
eq
(
"entrust_id"
,
entrust
.
getId
());
ortherWrapper
.
eq
(
"sample_id"
,
s
.
getId
());
ortherWrapper
.
eq
(
"team_group_id"
,
dis
.
getTeamGroupId
());
ortherWrapper
.
eq
(
"team_id"
,
dis
.
getTeamId
());
List
<
SampleDistribution
>
ortherDdistributionList
=
distributionMapper
.
selectList
(
ortherWrapper
);
if
(
ortherDdistributionList
.
size
()
>
1
){
return
BaseResponse
.
errorMsg
(
"检测派发表检测项信息重复"
);
}
if
(
ortherDdistributionList
!=
null
&&
ortherDdistributionList
.
size
()>
0
){
SampleDistribution
other
=
ortherDdistributionList
.
get
(
0
);
if
(
other
.
getCheckId
()
!=
null
){
dis
.
setCheckId
(
other
.
getCheckId
());
}
}
}
//如果其他的平行样也都没有进行校核,则新增校核内容
if
(
dis
.
getCheckId
()
!=
null
){
SampleDistributionCheck
disCheck
=
sampleDistributionCheckMapper
.
selectById
(
dis
.
getCheckId
());
disCheck
.
setDistributionError
(
disQuery
.
getDistributionError
())
.
setLastResult
(
disQuery
.
getLastResult
())
.
setUpdateTime
(
LocalDateTime
.
now
());
sampleDistributionCheckMapper
.
updateById
(
disCheck
);
}
else
{
SampleDistributionCheck
disCheck
=
new
SampleDistributionCheck
();
disCheck
.
setDistributionError
(
disQuery
.
getDistributionError
())
.
setLastResult
(
disQuery
.
getLastResult
())
...
...
@@ -3673,6 +3711,16 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleDistributionCheckMapper
.
insert
(
disCheck
);
dis
.
setCheckId
(
disCheck
.
getId
());
}
}
else
{
SampleDistributionCheck
disCheck
=
new
SampleDistributionCheck
();
disCheck
.
setDistributionError
(
disQuery
.
getDistributionError
())
.
setLastResult
(
disQuery
.
getLastResult
())
.
setCreateTime
(
LocalDateTime
.
now
())
.
setUpdateTime
(
LocalDateTime
.
now
());
sampleDistributionCheckMapper
.
insert
(
disCheck
);
dis
.
setCheckId
(
disCheck
.
getId
());
}
}
distributionMapper
.
updateById
(
dis
);
}
...
...
@@ -3694,6 +3742,45 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleDistributionCheckMapper
.
updateById
(
disCheck
);
dis
.
setCheckId
(
disCheck
.
getId
());
}
else
{
//判断是否有平行样
List
<
Sample
>
otherSampleList
=
sampleMapper
.
getOtherSampleList
(
entrust
.
getId
(),
sample_this
.
getCementCode
(),
sample_this
.
getId
());
if
(
otherSampleList
!=
null
&&
otherSampleList
.
size
()
>
0
){
for
(
Sample
s
:
otherSampleList
){
QueryWrapper
<
SampleDistribution
>
ortherWrapper
=
new
QueryWrapper
<>();
ortherWrapper
.
eq
(
"entrust_id"
,
entrust
.
getId
());
ortherWrapper
.
eq
(
"sample_id"
,
s
.
getId
());
ortherWrapper
.
eq
(
"team_group_id"
,
dis
.
getTeamGroupId
());
ortherWrapper
.
eq
(
"team_id"
,
dis
.
getTeamId
());
List
<
SampleDistribution
>
ortherDdistributionList
=
distributionMapper
.
selectList
(
ortherWrapper
);
if
(
ortherDdistributionList
.
size
()
>
1
){
return
BaseResponse
.
errorMsg
(
"检测派发表检测项信息重复"
);
}
if
(
ortherDdistributionList
!=
null
&&
ortherDdistributionList
.
size
()>
0
){
SampleDistribution
other
=
ortherDdistributionList
.
get
(
0
);
if
(
other
.
getCheckId
()
!=
null
){
dis
.
setCheckId
(
other
.
getCheckId
());
}
}
}
//如果其他的平行样也都没有进行校核,则新增校核内容
if
(
dis
.
getCheckId
()
!=
null
){
SampleDistributionCheck
disCheck
=
sampleDistributionCheckMapper
.
selectById
(
dis
.
getCheckId
());
disCheck
.
setDistributionError
(
disQuery
.
getDistributionError
())
.
setLastResult
(
disQuery
.
getLastResult
())
.
setUpdateTime
(
LocalDateTime
.
now
());
sampleDistributionCheckMapper
.
updateById
(
disCheck
);
}
else
{
SampleDistributionCheck
disCheck
=
new
SampleDistributionCheck
();
disCheck
.
setDistributionError
(
disQuery
.
getDistributionError
())
.
setLastResult
(
disQuery
.
getLastResult
())
.
setCreateTime
(
LocalDateTime
.
now
())
.
setUpdateTime
(
LocalDateTime
.
now
());
sampleDistributionCheckMapper
.
insert
(
disCheck
);
dis
.
setCheckId
(
disCheck
.
getId
());
}
}
else
{
SampleDistributionCheck
disCheck
=
new
SampleDistributionCheck
();
disCheck
.
setDistributionError
(
disQuery
.
getDistributionError
())
.
setLastResult
(
disQuery
.
getLastResult
())
...
...
@@ -3702,6 +3789,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleDistributionCheckMapper
.
insert
(
disCheck
);
dis
.
setCheckId
(
disCheck
.
getId
());
}
}
distributionMapper
.
updateById
(
dis
);
}
...
...
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