Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-soil
Overview
Overview
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
wangweidong
patzn-cloud-service-soil
Commits
324f778e
Commit
324f778e
authored
Jan 12, 2021
by
wangweidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
土工平台修改
parent
e3b15eda
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
323 additions
and
35 deletions
+323
-35
SoilExperimentMapper.java
.../cloud/service/lims/soil/mapper/SoilExperimentMapper.java
+2
-0
ISoilExperimentService.java
...oud/service/lims/soil/service/ISoilExperimentService.java
+2
-0
SoilEntrustServiceImpl.java
...ervice/lims/soil/service/impl/SoilEntrustServiceImpl.java
+226
-5
SoilExperimentServiceImpl.java
...ice/lims/soil/service/impl/SoilExperimentServiceImpl.java
+27
-2
SoilEntrustSummaryDTO.java
...tzn/cloud/service/lims/summary/SoilEntrustSummaryDTO.java
+10
-26
SoilSummaryDTO.java
.../com/patzn/cloud/service/lims/summary/SoilSummaryDTO.java
+36
-0
SoilEntrustMapper.xml
src/main/resources/mapper/soil/SoilEntrustMapper.xml
+6
-2
SoilExperimentMapper.xml
src/main/resources/mapper/soil/SoilExperimentMapper.xml
+14
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/soil/mapper/SoilExperimentMapper.java
View file @
324f778e
...
...
@@ -45,4 +45,6 @@ public interface SoilExperimentMapper extends BaseMapper<SoilExperiment> {
List
<
SoilExperimentVO
>
listTestByExpBath
(
Page
<
SoilExperimentVO
>
page
,
SoilExperimentQueryDTO
dto
);
List
<
SoilExperimentVO
>
listExpRightBath
(
Page
<
SoilExperimentVO
>
page
,
@Param
(
"vo"
)
SoilExperimentQueryDTO
dto
);
List
<
SoilExperimentVO
>
listGroupVOListByEntrustIds
(
@Param
(
"entrustIdList"
)
List
<
Long
>
entrustIdList
);
}
src/main/java/com/patzn/cloud/service/lims/soil/service/ISoilExperimentService.java
View file @
324f778e
...
...
@@ -93,4 +93,6 @@ public interface ISoilExperimentService extends IBaseService<SoilExperiment> {
Page
<
SoilExperimentVO
>
pageTestByExpBath
(
Page
<
SoilExperimentVO
>
page
,
SoilExperimentQueryDTO
dto
);
Page
<
SoilExperimentVO
>
pageExpRightBath
(
Page
<
SoilExperimentVO
>
page
,
SoilExperimentQueryDTO
dto
);
List
<
SoilExperimentVO
>
listGroupVOListByEntrustIds
(
List
<
Long
>
entrustIdList
);
}
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilEntrustServiceImpl.java
View file @
324f778e
...
...
@@ -6,6 +6,7 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.baomidou.mybatisplus.toolkit.IdWorker
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
...
...
@@ -24,6 +25,7 @@ import com.patzn.cloud.service.lims.common.service.ILmsMsgService;
import
com.patzn.cloud.service.lims.soil.service.*
;
import
com.patzn.cloud.service.lims.summary.KeyValueEntity
;
import
com.patzn.cloud.service.lims.summary.SoilEntrustSummaryDTO
;
import
com.patzn.cloud.service.lims.summary.SoilSummaryDTO
;
import
com.patzn.cloud.service.soil.dto.SoilEntrustDTO
;
import
com.patzn.cloud.service.soil.dto.SoilSampleDTO
;
import
com.patzn.cloud.service.soil.entity.*
;
...
...
@@ -32,6 +34,7 @@ import com.patzn.cloud.commons.service.impl.BaseServiceImpl;
import
com.patzn.cloud.service.soil.enums.SoilEntrustStatusEnum
;
import
com.patzn.cloud.service.soil.enums.SoilExpStatusEnum
;
import
com.patzn.cloud.service.soil.enums.SoilPrepareStatusEnum
;
import
com.patzn.cloud.service.soil.enums.SoilReportStatusEnum
;
import
com.patzn.cloud.service.soil.statistics.*
;
import
com.patzn.cloud.service.soil.vo.SoilEntrustVO
;
import
com.patzn.cloud.service.soil.vo.SoilExperimentVO
;
...
...
@@ -95,6 +98,9 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
private
ISoilExperimentService
soilExperimentService
;
@Autowired
private
ISoilExpReportService
soilExpReportService
;
@Autowired
private
ISoilExperimentOperationService
soilExperimentOperationService
;
@Autowired
...
...
@@ -1168,13 +1174,77 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
@Override
public
List
<
SoilEntrustSummaryDTO
>
listSummaryQuery
(
SoilEntrustVO
soilEntrust
)
{
List
<
SoilEntrustVO
>
voList
=
baseMapper
.
selectListForSummaryQuery
(
soilEntrust
);
if
(
CollectionUtils
.
isEmpty
(
voList
)){
return
Lists
.
newArrayList
();
}
List
<
Long
>
entrustIdList
=
new
ArrayList
<>();
for
(
SoilEntrustVO
entrustVO:
voList
){
entrustIdList
.
add
(
entrustVO
.
getId
());
}
List
<
SoilExperimentVO
>
getGroupList
=
soilExperimentService
.
listGroupVOListByEntrustIds
(
entrustIdList
);
Map
<
Long
,
List
<
SoilExperiment
>>
entrustExpMap
=
new
HashMap
<>();
for
(
SoilExperimentVO
vo:
getGroupList
)
{
if
(
entrustExpMap
.
containsKey
(
vo
.
getEntrustId
())){
List
<
SoilExperiment
>
experimentList
=
entrustExpMap
.
get
(
vo
.
getEntrustId
());
experimentList
.
add
(
vo
);
entrustExpMap
.
put
(
vo
.
getEntrustId
(),
experimentList
);
}
else
{
List
<
SoilExperiment
>
experimentList
=
Lists
.
newArrayList
();
experimentList
.
add
(
vo
);
entrustExpMap
.
put
(
vo
.
getEntrustId
(),
experimentList
);
}
}
List
<
SoilExpReport
>
expReportList
=
soilExpReportService
.
list
(
Condition
.
create
().
setSqlSelect
(
"id"
,
"entrust_id"
,
"group_id"
,
"group_name"
).
in
(
"entrust_id"
,
entrustIdList
));
List
<
SoilReport
>
reportList
=
soilReportService
.
list
(
Condition
.
create
().
setSqlSelect
(
"id"
,
"entrust_id"
,
"status"
).
in
(
"entrust_id"
,
entrustIdList
));
Map
<
Long
,
List
<
SoilReport
>>
entrustReportMap
=
new
HashMap
<>();
for
(
SoilReport
vo:
reportList
)
{
if
(
entrustReportMap
.
containsKey
(
vo
.
getEntrustId
())){
List
<
SoilReport
>
soilReportList
=
entrustReportMap
.
get
(
vo
.
getEntrustId
());
soilReportList
.
add
(
vo
);
entrustReportMap
.
put
(
vo
.
getEntrustId
(),
soilReportList
);
}
else
{
List
<
SoilReport
>
soilReportList
=
Lists
.
newArrayList
();
soilReportList
.
add
(
vo
);
entrustReportMap
.
put
(
vo
.
getEntrustId
(),
soilReportList
);
}
}
List
<
SoilEntrustSummaryDTO
>
dtoList
=
new
ArrayList
<>();
for
(
SoilEntrustVO
entrustVO:
voList
)
{
SoilEntrustSummaryDTO
dto
=
new
SoilEntrustSummaryDTO
();
dto
.
setEntrustVO
(
entrustVO
);
SoilSummaryDTO
summaryDTO
=
new
SoilSummaryDTO
();
List
<
Map
<
String
,
Object
>>
data
=
new
ArrayList
<>();
List
<
KeyValueEntity
>
entityList
=
new
ArrayList
<>();
List
<
KeyValueEntity
>
endList
=
new
ArrayList
<>();
List
<
List
<
KeyValueEntity
>>
branchList
=
new
ArrayList
<>();
summaryDTO
.
setStart
(
entityList
);
summaryDTO
.
setBranch
(
branchList
);
summaryDTO
.
setEnd
(
endList
);
dto
.
setSoilSummaryDTO
(
summaryDTO
);
dto
.
setData
(
data
);
dtoList
.
add
(
dto
);
if
(
StringUtils
.
isNotBlank
(
entrustVO
.
getReSubmitter
())){
KeyValueEntity
keyValueEntity
=
new
KeyValueEntity
();
...
...
@@ -1188,7 +1258,7 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
data
.
add
(
map
);
}
else
{
break
;
continue
;
}
...
...
@@ -1204,12 +1274,163 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
data
.
add
(
map
);
}
else
{
break
;
continue
;
}
dto
.
setStart
(
entityList
);
dto
.
setData
(
data
);
dtoList
.
add
(
dto
);
if
(
entrustVO
.
getSampleCount
()>
0
&&
entrustVO
.
getMakeNoCount
()==
0
){
KeyValueEntity
keyValueEntity
=
new
KeyValueEntity
();
keyValueEntity
.
setKey
(
"开土"
);
keyValueEntity
.
setName
(
"openSoil"
);
entityList
.
add
(
keyValueEntity
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"openSoil"
,
true
);
data
.
add
(
map
);
}
else
{
continue
;
}
List
<
SoilExperiment
>
expList
=
entrustExpMap
.
get
(
entrustVO
.
getId
());
Set
<
String
>
groupSet
=
new
HashSet
<>();
for
(
SoilExperiment
exp:
expList
)
{
groupSet
.
add
(
exp
.
getGroupName
());
}
for
(
String
group:
groupSet
)
{
List
<
KeyValueEntity
>
groupBranch
=
new
ArrayList
<>();
KeyValueEntity
keValue
=
new
KeyValueEntity
();
keValue
.
setName
(
group
);
if
(
group
.
contains
(
"力学"
)){
keValue
.
setKey
(
"lixue"
);
}
else
if
(
group
.
contains
(
"物性"
)){
keValue
.
setKey
(
"wuxing"
);
}
else
if
(
group
.
contains
(
"高级"
)){
keValue
.
setKey
(
"gaoji"
);
}
else
{
keValue
.
setKey
(
group
);
}
groupBranch
.
add
(
keValue
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
keValue
.
getKey
(),
true
);
data
.
add
(
map
);
int
ok
=
0
;
int
all
=
0
;
for
(
SoilExperiment
t:
expList
)
{
if
(
t
.
getGroupName
().
equals
(
group
)&&
t
.
getStatus
().
equals
(
SoilExpStatusEnum
.
END
)){
ok
++;
}
if
(
t
.
getGroupName
().
equals
(
group
)){
all
++;
}
}
int
expExpReportNum
=
0
;
for
(
SoilExpReport
t:
expReportList
)
{
if
(
t
.
getGroupName
().
equals
(
group
)&&
t
.
getEntrustId
().
equals
(
entrustVO
.
getId
())){
expExpReportNum
++;
}
}
KeyValueEntity
endRate
=
new
KeyValueEntity
();
endRate
.
setName
(
"完成率"
+(
ok
+
"/"
+
all
));
endRate
.
setKey
(
keValue
.
getKey
()+
"End"
);
groupBranch
.
add
(
endRate
);
Map
<
String
,
Object
>
mapEnd
=
new
HashMap
<>();
map
.
put
(
keValue
.
getKey
()+
"End"
,
true
);
data
.
add
(
mapEnd
);
Map
<
String
,
Object
>
mapEndRate
=
new
HashMap
<>();
map
.
put
(
keValue
.
getKey
()+
"EndRate"
,(
ok
+
"/"
+
all
));
data
.
add
(
mapEndRate
);
KeyValueEntity
zijiaoban
=
new
KeyValueEntity
();
zijiaoban
.
setName
(
"自校版"
+
keValue
.
getKey
());
zijiaoban
.
setKey
(
keValue
.
getKey
()+
"ZiJiao"
);
groupBranch
.
add
(
zijiaoban
);
Map
<
String
,
Object
>
mapZhijiaobanCheck
=
new
HashMap
<>();
mapZhijiaobanCheck
.
put
(
keValue
.
getKey
()+
"ZiJiaoCheck"
,
true
);
data
.
add
(
mapZhijiaobanCheck
);
Map
<
String
,
Object
>
mapZhijiaoban
=
new
HashMap
<>();
mapZhijiaoban
.
put
(
keValue
.
getKey
()+
"ZiJiao"
,
"数量:"
+
expExpReportNum
);
data
.
add
(
mapZhijiaoban
);
}
List
<
SoilReport
>
reportListMy
=
entrustReportMap
.
get
(
entrustVO
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
reportListMy
)){
KeyValueEntity
reportMake
=
new
KeyValueEntity
();
reportMake
.
setName
(
"报告编制"
);
reportMake
.
setKey
(
"reportMake"
);
endList
.
add
(
reportMake
);
Map
<
String
,
Object
>
reportMakeMap
=
new
HashMap
<>();
reportMakeMap
.
put
(
"reportMake"
,
true
);
data
.
add
(
reportMakeMap
);
Set
<
Integer
>
statusSet
=
new
HashSet
<>();
for
(
SoilReport
soilReport:
reportListMy
)
{
if
(
null
!=
soilReport
.
getStatus
()){
statusSet
.
add
((
Integer
)
soilReport
.
getStatus
().
getValue
());
}
}
if
(!
statusSet
.
contains
((
Integer
)
SoilReportStatusEnum
.
DRAFT
.
getValue
())){
KeyValueEntity
reportCheck
=
new
KeyValueEntity
();
reportCheck
.
setName
(
"报告审核"
);
reportCheck
.
setKey
(
"reportCheck"
);
endList
.
add
(
reportCheck
);
Map
<
String
,
Object
>
reportCheckMap
=
new
HashMap
<>();
reportCheckMap
.
put
(
"reportCheck"
,
true
);
data
.
add
(
reportCheckMap
);
}
else
if
(!
statusSet
.
contains
((
Integer
)
SoilReportStatusEnum
.
DRAFT
.
getValue
())&&!
statusSet
.
contains
((
Integer
)
SoilReportStatusEnum
.
CHECK
.
getValue
())){
KeyValueEntity
reportIssue
=
new
KeyValueEntity
();
reportIssue
.
setName
(
"报告批准"
);
reportIssue
.
setKey
(
"reportIssue"
);
endList
.
add
(
reportIssue
);
Map
<
String
,
Object
>
reportIssueMap
=
new
HashMap
<>();
reportIssueMap
.
put
(
"reportIssue"
,
true
);
data
.
add
(
reportIssueMap
);
}
else
if
(!
statusSet
.
contains
((
Integer
)
SoilReportStatusEnum
.
DRAFT
.
getValue
())&&!
statusSet
.
contains
((
Integer
)
SoilReportStatusEnum
.
CHECK
.
getValue
())&&!
statusSet
.
contains
((
Integer
)
SoilReportStatusEnum
.
ISSUE
.
getValue
())){
KeyValueEntity
reportEnd
=
new
KeyValueEntity
();
reportEnd
.
setName
(
"报告签发"
);
reportEnd
.
setKey
(
"reportEnd"
);
endList
.
add
(
reportEnd
);
Map
<
String
,
Object
>
reportEndMap
=
new
HashMap
<>();
reportEndMap
.
put
(
"reportEnd"
,
true
);
data
.
add
(
reportEndMap
);
}
}
else
{
continue
;
}
}
return
dtoList
;
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilExperimentServiceImpl.java
View file @
324f778e
...
...
@@ -588,6 +588,28 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
else
{
int
index
=
0
;
XSSFSheet
xssfSheet
=
xssfWorkbook
.
getSheetAt
(
0
);
int
rowNum
=
xssfSheet
.
getLastRowNum
();
for
(
int
i
=
0
;
i
<
rowNum
;
i
++)
{
XSSFRow
row
=
xssfSheet
.
getRow
(
i
);
int
cellNum
=
row
.
getLastCellNum
();
for
(
int
j
=
0
;
j
<
cellNum
;
j
++)
{
XSSFCell
cell
=
row
.
getCell
(
j
);
if
(
cell
.
getCellType
().
equals
(
CellType
.
FORMULA
)){
String
formula
=
cell
.
getCellFormula
();
if
(
StringUtils
.
isNotBlank
(
formula
)){
cell
.
setCellFormula
(
formula
);
}
}
}
}
xssfSheet
.
setForceFormulaRecalculation
(
true
);
for
(
SoilExperimentVO
vo:
voList
)
{
if
(
index
==
0
){
xssfWorkbook
.
setSheetName
(
index
,
vo
.
getSampleCode
());
...
...
@@ -597,8 +619,6 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
XSSFSheet
sheet
=
xssfWorkbook
.
cloneSheet
(
0
);
xssfWorkbook
.
setSheetName
(
index
,
vo
.
getSampleCode
());
sheet
.
setForceFormulaRecalculation
(
true
);
index
++;
}
...
...
@@ -1055,6 +1075,11 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
@Override
public
List
<
SoilExperimentVO
>
listGroupVOListByEntrustIds
(
List
<
Long
>
entrustIdList
)
{
return
baseMapper
.
listGroupVOListByEntrustIds
(
entrustIdList
);
}
@Override
public
Page
<
SoilExperimentVO
>
pageBySampleIds
(
Page
<
SoilExperimentVO
>
page
,
Long
[]
sampleIds
,
SoilExperimentVO
vo
)
{
...
...
src/main/java/com/patzn/cloud/service/lims/summary/SoilEntrustSummaryDTO.java
View file @
324f778e
...
...
@@ -6,9 +6,8 @@ import java.util.List;
import
java.util.Map
;
public
class
SoilEntrustSummaryDTO
{
private
List
<
KeyValueEntity
>
start
=
new
ArrayList
<>();
private
List
<
List
<
KeyValueEntity
>>
branch
=
new
ArrayList
<>();
private
List
<
KeyValueEntity
>
end
=
new
ArrayList
<>();
private
SoilSummaryDTO
soilSummaryDTO
=
new
SoilSummaryDTO
();
...
...
@@ -26,29 +25,6 @@ public class SoilEntrustSummaryDTO {
this
.
entrustVO
=
entrustVO
;
}
public
List
<
KeyValueEntity
>
getStart
()
{
return
start
;
}
public
void
setStart
(
List
<
KeyValueEntity
>
start
)
{
this
.
start
=
start
;
}
public
List
<
List
<
KeyValueEntity
>>
getBranch
()
{
return
branch
;
}
public
void
setBranch
(
List
<
List
<
KeyValueEntity
>>
branch
)
{
this
.
branch
=
branch
;
}
public
List
<
KeyValueEntity
>
getEnd
()
{
return
end
;
}
public
void
setEnd
(
List
<
KeyValueEntity
>
end
)
{
this
.
end
=
end
;
}
public
List
<
Map
<
String
,
Object
>>
getData
()
{
return
data
;
...
...
@@ -57,4 +33,12 @@ public class SoilEntrustSummaryDTO {
public
void
setData
(
List
<
Map
<
String
,
Object
>>
data
)
{
this
.
data
=
data
;
}
public
SoilSummaryDTO
getSoilSummaryDTO
()
{
return
soilSummaryDTO
;
}
public
void
setSoilSummaryDTO
(
SoilSummaryDTO
soilSummaryDTO
)
{
this
.
soilSummaryDTO
=
soilSummaryDTO
;
}
}
src/main/java/com/patzn/cloud/service/lims/summary/SoilSummaryDTO.java
0 → 100644
View file @
324f778e
package
com
.
patzn
.
cloud
.
service
.
lims
.
summary
;
import
com.patzn.cloud.service.soil.vo.SoilEntrustVO
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
public
class
SoilSummaryDTO
{
private
List
<
KeyValueEntity
>
start
=
new
ArrayList
<>();
private
List
<
List
<
KeyValueEntity
>>
branch
=
new
ArrayList
<>();
private
List
<
KeyValueEntity
>
end
=
new
ArrayList
<>();
public
List
<
KeyValueEntity
>
getStart
()
{
return
start
;
}
public
void
setStart
(
List
<
KeyValueEntity
>
start
)
{
this
.
start
=
start
;
}
public
List
<
List
<
KeyValueEntity
>>
getBranch
()
{
return
branch
;
}
public
void
setBranch
(
List
<
List
<
KeyValueEntity
>>
branch
)
{
this
.
branch
=
branch
;
}
public
List
<
KeyValueEntity
>
getEnd
()
{
return
end
;
}
public
void
setEnd
(
List
<
KeyValueEntity
>
end
)
{
this
.
end
=
end
;
}
}
src/main/resources/mapper/soil/SoilEntrustMapper.xml
View file @
324f778e
...
...
@@ -353,12 +353,16 @@
SELECT count(1) FROM soil_sample WHERE entrust_id = e.id AND deleted = 0
),(
)
AS sample_count
,(
SELECT count(1) FROM soil_sample WHERE entrust_id = e.id AND deleted = 0 AND status IN (0,10,15,20,22)
) AS make_no FROM soil_entrust e JOIN soil_entrust_operation o ON e.id = o.entrust_id
) AS make_no_count FROM soil_entrust e JOIN soil_entrust_operation o ON e.id = o.entrust_id
WHERE e.deleted = 0
<include
refid=
"sqlWhere"
/>
</select>
</mapper>
src/main/resources/mapper/soil/SoilExperimentMapper.xml
View file @
324f778e
...
...
@@ -408,5 +408,19 @@
<select
id=
"listGroupVOListByEntrustIds"
resultType=
"com.patzn.cloud.service.soil.vo.SoilExperimentVO"
>
SELECT
t.id,t.group_id,t.group_name,t.status,t.progress ,e.id AS entrust_id
FROM
soil_experiment
t JOIN soil_sample s ON T.sample_id = s.ID
JOIN soil_entrust e ON s.entrust_id = e.id
WHERE t.deleted = 0 AND s.deleted = 0 AND e.deleted = 0 AND t.group_name IS NOT NULL AND t.group_id IS NOT NULL
AND e.id IN
<foreach
collection=
"entrustIdList"
index=
"index"
item=
"entrustId"
open=
"("
separator=
","
close=
")"
>
#{entrustId}
</foreach>
</select>
</mapper>
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