Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-hmhj
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-hmhj
Commits
d254ebab
Commit
d254ebab
authored
Jul 22, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部分测试问题;
parent
8edf2d9c
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
308 additions
and
85 deletions
+308
-85
HmhjServiceApplication.java
.../com/patzn/cloud/service/lims/HmhjServiceApplication.java
+1
-1
EntrustSampleController.java
...service/lims/hmhj/controller/EntrustSampleController.java
+12
-5
StandardSampleController.java
...ervice/lims/hmhj/controller/StandardSampleController.java
+1
-1
EntrustSampleMapper.java
...n/cloud/service/lims/hmhj/mapper/EntrustSampleMapper.java
+2
-0
StatisticsMapper.java
...atzn/cloud/service/lims/hmhj/mapper/StatisticsMapper.java
+15
-0
IEntrustSampleService.java
...loud/service/lims/hmhj/service/IEntrustSampleService.java
+5
-1
IStatisticsService.java
...n/cloud/service/lims/hmhj/service/IStatisticsService.java
+43
-0
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+73
-19
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+6
-29
StatisticsServiceImpl.java
...service/lims/hmhj/service/impl/StatisticsServiceImpl.java
+74
-0
EntrustMapper.xml
src/main/resources/mapper/hmhj/EntrustMapper.xml
+15
-10
StatisticsMapper.xml
src/main/resources/mapper/hmhj/StatisticsMapper.xml
+38
-0
20210722新增标准样品表.sql
src/test/java/resources/db_sql/hmhj/v148/20210722新增标准样品表.sql
+23
-19
No files found.
src/main/java/com/patzn/cloud/service/lims/HmhjServiceApplication.java
View file @
d254ebab
...
...
@@ -33,7 +33,7 @@ public class HmhjServiceApplication {
SpringApplication
application
=
new
SpringApplication
(
HmhjServiceApplication
.
class
);
application
.
setBannerMode
(
Banner
.
Mode
.
CONSOLE
);
SpringHelper
.
setApplicationContext
(
application
.
run
(
args
));
System
.
out
.
println
(
"
Soil
Service start!\thttp://api.dev.patzn.com:7000/hmhj/swagger-ui.html"
);
System
.
out
.
println
(
"
Hmhj
Service start!\thttp://api.dev.patzn.com:7000/hmhj/swagger-ui.html"
);
}
catch
(
Throwable
t
)
{
t
.
printStackTrace
();
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleController.java
View file @
d254ebab
...
...
@@ -185,7 +185,7 @@ public class EntrustSampleController extends ServiceController {
@PutMapping
(
"/{id}"
)
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
EntrustSample
entrustSample
)
{
entrustSample
.
setId
(
id
);
return
success
(
entrustSampleService
.
update
ById
(
entrustSample
));
return
success
(
entrustSampleService
.
update
SampleInfo
(
entrustSample
));
}
@ApiOperation
(
"根据 id 修改信息"
)
...
...
@@ -209,13 +209,20 @@ public class EntrustSampleController extends ServiceController {
return
success
(
entrustSampleService
.
removeByIds
(
ids
));
}
@ApiOperation
(
"根据 ids 删除标样"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键列表"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataTypeClass
=
Long
.
class
),
})
@PostMapping
(
"/delStandardByIds"
)
public
RestResult
<
Boolean
>
delStandardSampleByIds
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
entrustSampleService
.
delStandardSampleByIds
(
ids
));
}
@ApiOperation
(
value
=
"增加标样"
,
notes
=
"增加标样"
)
@PostMapping
(
"/add_standard_sample"
)
public
RestResult
<
Boolean
>
addStandardSample
(
@RequestBody
EntrustSampleDTO
dto
)
{
dto
.
setStatus
(
EntrustSampleStatusEnum
.
TEST
);
dto
.
setProgress
(
EntrustSampleStatusEnum
.
TEST
);
return
success
(
entrustSampleService
.
addStandardSampleDTO
(
dto
,
getAccount
()));
public
RestResult
<
Boolean
>
addStandardSample
(
@RequestBody
String
sampleJson
)
{
return
success
(
entrustSampleService
.
addStandardSampleDTO
(
sampleJson
,
getAccount
()));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/StandardSampleController.java
View file @
d254ebab
...
...
@@ -61,7 +61,7 @@ public class StandardSampleController extends ServiceController {
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
StandardSample
standardSample
)
{
standardSample
.
set
C
id
(
getAccount
().
getUserId
());
standardSample
.
set
U
id
(
getAccount
().
getUserId
());
return
success
(
standardSampleService
.
save
(
standardSample
));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustSampleMapper.java
View file @
d254ebab
...
...
@@ -13,6 +13,7 @@ import org.apache.ibatis.annotations.Param;
import
org.apache.ibatis.session.RowBounds
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -38,4 +39,5 @@ public interface EntrustSampleMapper extends BatchMapper<EntrustSample> {
List
<
PMakeFeStatsVO
>
selectPMakeFeStats
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
Map
<
String
,
Object
>
selectAlBrandsRateStatus
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/StatisticsMapper.java
0 → 100644
View file @
d254ebab
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
mapper
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.entity.Statistics
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
StatisticsMapper
extends
BatchMapper
<
Statistics
>
{
List
<
Statistics
>
selectAlBrandsRateStats
(
@Param
(
"vo"
)
QueryDTO
dto
);
Statistics
selectOutTestFinishStats
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleService.java
View file @
d254ebab
...
...
@@ -72,7 +72,7 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
boolean
updateSamplePrevFlowInfo
(
Entrust
entrust
,
EntrustFlowEnum
prevFlowStatus
,
Account
account
);
boolean
addStandardSampleDTO
(
EntrustSampleDTO
dto
,
Account
account
);
boolean
addStandardSampleDTO
(
String
sampleJson
,
Account
account
);
List
<
EntrustSample
>
getByEntrustId
(
Long
entrustId
);
...
...
@@ -105,4 +105,8 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
Page
<
EntrustSampleVO
>
pageVOForMakeHis
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
);
boolean
makeReportFromHis
(
ReportDTO
dto
,
Account
account
);
boolean
delStandardSampleByIds
(
List
<
Long
>
ids
);
boolean
updateSampleInfo
(
EntrustSample
entrustSample
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IStatisticsService.java
0 → 100644
View file @
d254ebab
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.entity.Statistics
;
import
java.util.List
;
public
interface
IStatisticsService
extends
IBaseService
<
Statistics
>
{
/**
* 当日原铝质量统计
* @param queryDTO
* @return
*/
List
<
Statistics
>
getAlBrandsRate
(
QueryDTO
queryDTO
);
/**
* 外检完成量统计
* @param queryDTO
* @return
*/
Statistics
getOutTestFinishNumStatsQuery
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getEntrustedQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getAnodeInspectionQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getReportSendQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getItemQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getSamplingQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getOutTestFinishQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getOutTestItemQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getWorkloadQuantity
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getCurWeekAcceptanceQualified
(
QueryDTO
queryDTO
);
List
<
Statistics
>
getCurWeekCarbonBlocksStats
(
QueryDTO
queryDTO
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
d254ebab
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
...
...
@@ -43,6 +44,7 @@ import java.io.FileOutputStream;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -539,32 +541,43 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
}
@Override
public
boolean
addStandardSampleDTO
(
EntrustSampleDTO
dto
,
Account
account
)
{
if
(
null
==
dto
)
{
public
boolean
addStandardSampleDTO
(
String
sampleJson
,
Account
account
)
{
if
(
StringUtils
.
isBlank
(
sampleJson
)
)
{
return
false
;
}
List
<
EntrustSampleDTO
>
sampleDTOList
=
null
;
try
{
sampleDTOList
=
JSONArray
.
parseArray
(
sampleJson
,
EntrustSampleDTO
.
class
);
}
catch
(
Exception
e
)
{
RestAssert
.
fail
(
"数据转换失败"
);
}
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleDTOList
),
"标样数据为空"
);
// 添加后排序,不论是否成功添加标样
List
<
EntrustSample
>
sampleList
=
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
dto
.
getEntrustId
())
List
<
EntrustSample
>
sampleList
=
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
sampleDTOList
.
get
(
0
)
.
getEntrustId
())
.
orderBy
(
"order_by"
,
true
).
orderBy
(
"ctime"
,
false
));
// 若为一个样品,则不进行排序处理
if
(
CollectionUtils
.
isNotEmpty
(
sampleList
)
&&
sampleList
.
size
()
>
1
)
{
for
(
int
i
=
0
;
i
<
sampleList
.
size
();
i
++)
{
sampleList
.
get
(
i
).
setOrderBy
(
i
);
}
updateBatchById
(
sampleList
);
//
List
<
Integer
>
orderByList
=
sampleList
.
stream
().
map
(
EntrustSample:
:
getOrderBy
).
collect
(
Collectors
.
toList
());
AtomicReference
<
String
>
sampleCodeAtomic
=
new
AtomicReference
<>();
AtomicReference
<
Integer
>
orderByAtomic
=
new
AtomicReference
<>();
RestAssert
.
fail
(
sampleDTOList
.
stream
().
anyMatch
(
t
->
{
// 完全匹配数据
if
(
orderByList
.
contains
(
t
.
getOrderBy
()))
{
orderByAtomic
.
set
(
t
.
getOrderBy
());
sampleCodeAtomic
.
set
(
t
.
getCode
());
return
true
;
}
return
false
;
}),
String
.
format
(
"样品【%s】存在相同的顺序号【%d】"
,
sampleCodeAtomic
.
get
(),
orderByAtomic
.
get
()));
EntrustSample
sample
=
dto
.
convert
(
EntrustSample
.
class
);
//标样
sample
.
setType
(
1
);
Integer
orderBy
=
sample
.
getOrderBy
();
sample
.
setOrderBy
(
orderBy
=
null
==
orderBy
?
0
:
orderBy
.
intValue
()
-
1
);
if
(
save
(
sample
))
{
List
<
EntrustSampleItem
>
itemList
=
dto
.
getItemList
();
sampleDTOList
.
forEach
(
t
->
{
EntrustSample
entrustSample
=
t
.
convert
(
EntrustSample
.
class
);
entrustSample
.
setStatus
(
EntrustSampleStatusEnum
.
TEST
).
setProgress
(
EntrustSampleStatusEnum
.
TEST
).
setType
(
1
);
save
(
entrustSample
);
List
<
EntrustSampleItem
>
itemList
=
t
.
getItemList
();
if
(
CollectionUtils
.
isNotEmpty
(
itemList
))
{
for
(
EntrustSampleItem
item
:
itemList
)
{
item
.
setEntrustSampleId
(
s
ample
.
getId
());
item
.
setEntrustSampleId
(
entrustS
ample
.
getId
());
item
.
setStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
item
.
setProgress
(
EntrustSampleItemStatusEnum
.
TEST
);
item
.
setTester
(
account
.
getUserName
());
...
...
@@ -572,7 +585,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
}
entrustSampleItemService
.
saveBatch
(
itemList
);
}
}
}
);
return
true
;
}
...
...
@@ -1801,4 +1814,44 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
makeReport
(
dto
,
account
);
return
entrustReportService
.
updateLastFlowCheckByEntrustId
(
dto
.
getEntrustId
(),
account
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
delStandardSampleByIds
(
List
<
Long
>
ids
)
{
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
ids
),
"删除的数据为空"
);
List
<
EntrustSample
>
entrustSampleList
=
getBatchIds
(
ids
);
AtomicReference
<
String
>
sampleCodeAtomic
=
new
AtomicReference
<>();
RestAssert
.
fail
(
entrustSampleList
.
stream
().
anyMatch
(
t
->
{
if
(
null
==
t
.
getType
()
||
0
==
t
.
getType
().
intValue
())
{
sampleCodeAtomic
.
set
(
t
.
getCode
());
return
true
;
}
return
false
;
}),
String
.
format
(
"样品【%s】非标样,无法删除!"
,
sampleCodeAtomic
.
get
()));
entrustSampleItemService
.
remove
(
Condition
.
create
().
in
(
"entrust_sample_id"
,
ids
));
return
removeByIds
(
ids
);
}
@Override
public
boolean
updateSampleInfo
(
EntrustSample
entrustSample
)
{
RestAssert
.
fail
(
null
==
entrustSample
.
getId
(),
"样品ID为空"
);
EntrustSample
sample
=
getById
(
entrustSample
.
getId
());
RestAssert
.
fail
(
null
==
entrustSample
.
getOrderBy
(),
String
.
format
(
"样品编号【%s】的顺序号为空"
,
sample
.
getCode
()));
List
<
EntrustSample
>
entrustSampleList
=
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
sample
.
getEntrustId
()));
if
(
CollectionUtils
.
isEmpty
(
entrustSampleList
))
{
return
updateById
(
entrustSample
);
}
AtomicReference
<
String
>
sampleCodeAtomic
=
new
AtomicReference
<>();
AtomicReference
<
Integer
>
orderByAtomic
=
new
AtomicReference
<>();
RestAssert
.
fail
(
entrustSampleList
.
stream
().
anyMatch
(
t
->
{
if
(
null
!=
t
.
getOrderBy
()
&&
null
!=
entrustSample
.
getOrderBy
()
&&
t
.
getOrderBy
().
intValue
()
==
entrustSample
.
getOrderBy
().
intValue
())
{
sampleCodeAtomic
.
set
(
t
.
getCode
());
orderByAtomic
.
set
(
t
.
getOrderBy
());
return
true
;
}
return
false
;
}),
String
.
format
(
"样品编号【%s】的顺序号【%d】已存在"
,
sampleCodeAtomic
.
get
(),
orderByAtomic
.
get
()));
return
updateById
(
entrustSample
);
}
}
\ No newline at end of file
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
d254ebab
...
...
@@ -243,15 +243,16 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
List
<
EntrustSample
>
saveSampleList
=
new
ArrayList
<>();
List
<
EntrustSampleItem
>
saveEntrustSampleItemList
=
new
ArrayList
<>();
for
(
int
x
=
0
;
x
<
sampleDTOList
.
size
();
x
++)
{
EntrustSampleDTO
sampleDTO
=
sampleDTOList
.
get
(
x
);
int
incNum
=
0
;
for
(
EntrustSampleDTO
sampleDTO
:
sampleDTOList
)
{
EntrustSample
sample
=
sampleDTO
.
convert
(
EntrustSample
.
class
);
sample
.
setEntrustId
(
entrust
.
getId
());
//生成样品编号
initSampleCode
(
sample
);
sample
.
setId
(
IdWorker
.
getId
());
sample
.
setOrderBy
(
x
);
sample
.
setOrderBy
(
incNum
);
saveSampleList
.
add
(
sample
);
incNum
+=
10
;
List
<
EntrustSampleItem
>
experiments
=
sampleDTO
.
getItemList
();
if
(
CollectionUtils
.
isEmpty
(
experiments
))
{
continue
;
...
...
@@ -632,30 +633,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if
(
null
==
entrust
.
getItemStatus
())
{
return
page
;
}
List
<
EntrustSampleItem
>
itemList
=
entrustSampleItemService
.
list
(
Condition
.
create
().
eq
(
"status"
,
entrust
.
getItemStatus
()));
if
(
CollectionUtils
.
isEmpty
(
itemList
))
{
return
page
;
}
List
<
Long
>
sampleIdsList
=
itemList
.
stream
().
map
(
i
->
{
return
i
.
getEntrustSampleId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
sampleIdsList
))
{
return
page
;
}
List
<
EntrustSample
>
sampleList
=
entrustSampleService
.
list
(
Condition
.
create
().
in
(
"id"
,
sampleIdsList
));
if
(
CollectionUtils
.
isEmpty
(
sampleList
))
{
return
page
;
}
List
<
Long
>
ids
=
sampleList
.
stream
().
map
(
s
->
{
return
s
.
getEntrustId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
page
;
}
entrust
.
setIdsList
(
ids
);
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
}
...
...
@@ -1169,7 +1146,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrustSampleItemService
.
update
(
entrustSampleItem
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
));
}
// 删除委托下样品备样
entrustSampleBackupService
.
remove
(
Condition
.
create
().
eq
(
"entrust_id"
,
e
.
getId
()));
entrustSampleBackupService
.
remove
(
Condition
.
create
().
eq
(
"entrust_id"
,
e
.
getId
()));
}
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品接收退回,请及时查看退回原因并处理"
,
"新的样品接收退回任务!"
,
account
,
null
);
return
true
;
...
...
@@ -1272,7 +1249,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
/* 修改检测委托书的状态 */
@Override
public
Boolean
updatePrintStatus
(
List
<
Long
>
ids
,
Long
userId
)
{
public
Boolean
updatePrintStatus
(
List
<
Long
>
ids
,
Long
userId
)
{
if
(
CollectionUtils
.
isNotEmpty
(
ids
))
{
List
<
Entrust
>
entrusts
=
ids
.
stream
().
map
(
id
->
{
Entrust
entrust
=
new
Entrust
();
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/StatisticsServiceImpl.java
0 → 100644
View file @
d254ebab
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.entity.Statistics
;
import
com.patzn.cloud.service.lims.hmhj.mapper.StatisticsMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.IStatisticsService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
StatisticsServiceImpl
extends
BaseServiceImpl
<
StatisticsMapper
,
Statistics
>
implements
IStatisticsService
{
@Override
public
List
<
Statistics
>
getAlBrandsRate
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectAlBrandsRateStats
(
queryDTO
);
}
@Override
public
Statistics
getOutTestFinishNumStatsQuery
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectOutTestFinishStats
(
queryDTO
);
}
@Override
public
List
<
Statistics
>
getEntrustedQuantity
(
QueryDTO
queryDTO
)
{
return
null
;
}
@Override
public
List
<
Statistics
>
getAnodeInspectionQuantity
(
QueryDTO
queryDTO
)
{
return
null
;
}
@Override
public
List
<
Statistics
>
getReportSendQuantity
(
QueryDTO
queryDTO
)
{
return
null
;
}
@Override
public
List
<
Statistics
>
getItemQuantity
(
QueryDTO
queryDTO
)
{
return
null
;
}
@Override
public
List
<
Statistics
>
getSamplingQuantity
(
QueryDTO
queryDTO
)
{
return
null
;
}
@Override
public
List
<
Statistics
>
getOutTestFinishQuantity
(
QueryDTO
queryDTO
)
{
return
null
;
}
@Override
public
List
<
Statistics
>
getOutTestItemQuantity
(
QueryDTO
queryDTO
)
{
return
null
;
}
@Override
public
List
<
Statistics
>
getWorkloadQuantity
(
QueryDTO
queryDTO
)
{
return
null
;
}
@Override
public
List
<
Statistics
>
getCurWeekAcceptanceQualified
(
QueryDTO
queryDTO
)
{
return
null
;
}
@Override
public
List
<
Statistics
>
getCurWeekCarbonBlocksStats
(
QueryDTO
queryDTO
)
{
return
null
;
}
}
src/main/resources/mapper/hmhj/EntrustMapper.xml
View file @
d254ebab
...
...
@@ -26,39 +26,44 @@
<select
id=
"selectVOList"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
SELECT
* FROM entrust WHERE
deleted = 0
SELECT
e.* FROM entrust e WHERE e.
deleted = 0
<if
test=
"null!=vo.idsList"
>
AND id IN
AND
e.
id IN
<foreach
collection=
"vo.idsList"
index=
"index"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
<if
test=
"null!=vo.client"
>
AND client LIKE CONCAT('%',#{vo.client},'%')
AND
e.
client LIKE CONCAT('%',#{vo.client},'%')
</if>
<if
test=
"null!=vo.code"
>
AND code LIKE CONCAT('%',#{vo.code},'%')
AND
e.
code LIKE CONCAT('%',#{vo.code},'%')
</if>
<if
test=
"null!=vo.testSide"
>
AND test_side LIKE CONCAT('%',#{vo.testSide},'%')
AND
e.
test_side LIKE CONCAT('%',#{vo.testSide},'%')
</if>
<if
test=
"null!=vo.statusList"
>
AND status IN
AND
e.
status IN
<foreach
collection=
"vo.statusList"
index=
"index"
item=
"status"
open=
"("
separator=
","
close=
")"
>
#{status}
</foreach>
</if>
<if
test=
"null != vo.itemStatus"
>
AND exists (
select 1 from entrust_sample_item i join entrust_sample s on i.entrust_sample_id = s.id
where s.deleted = 0 and i.deleted = 0 and s.entrust_id = e.id and i.status = #{vo.itemStatus}
)
</if>
<if
test=
"null!=vo.groupNameList"
>
AND test_side IN
AND
e.
test_side IN
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
#{groupName}
</foreach>
</if>
<if
test=
"null != vo.uid"
>
AND uid = #{vo.uid}
AND
e.
uid = #{vo.uid}
</if>
order by entrust_time desc
order by e
.e
ntrust_time desc
</select>
<!--查询委托历史数据-->
...
...
src/main/resources/mapper/hmhj/StatisticsMapper.xml
0 → 100644
View file @
d254ebab
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.patzn.cloud.service.lims.hmhj.mapper.StatisticsMapper"
>
<!--当日原铝质量统计-->
<select
id=
"selectAlBrandsRateStatus"
resultType=
"com.patzn.cloud.service.hmhj.entity.Statistics"
>
SELECT
s.sample_grading "brand",
A.total,
count (1) "brand_num",
round(count(1)::numeric / a.total_num,2) "ratio"
FROM
entrust_sample s,
(
SELECT COUNT ( 1 ) "total" FROM entrust_sample s WHERE s.deleted = 0 AND s.sample_grading IS NOT NULL
-- AND to_char(s.judge_time, 'yyyy-MM-dd') = to_char( now(), 'yyyy-MM-dd')
) A
WHERE
s.deleted = 0
AND s.sample_grading IS NOT NULL -- AND to_char( s.judge_time, 'yyyy-MM-dd' ) = to_char(now(), 'yyyy-MM-dd')
GROUP BY
A.total_num,
s.sample_grading
ORDER BY
s.sample_grading DESC
</select>
<!--外委完成量统计-->
<select
id=
"selectOutTestFinishStats"
resultType=
"com.patzn.cloud.service.hmhj.entity.Statistics"
>
SELECT
count(1) "total",
sum(case when s.status = 70 and s.judge_status = 2 then 1 else 0 end) "finish_num"
FROM
contract_sample c, entrust_sample s
WHERE
c.deleted = 0 and s.deleted = 0 and c.id = s.contract_sample_id
and c.type = 1
</select>
</mapper>
src/test/java/resources/db_sql/hmhj/v148/20210722新增标准样品表.sql
View file @
d254ebab
-- ghx
-- ghx
-- ----------------------------
-- Table structure for standard_sample
-- ----------------------------
DROP
TABLE
IF
EXISTS
"public"
.
"standard_sample"
;
CREATE
TABLE
"public"
.
"standard_sample"
(
"id"
int8
NOT
NULL
,
"name"
varchar
(
255
),
"num"
varchar
(
255
),
"cid"
int8
,
"ctime"
timestamp
(
0
),
"deleted"
int2
,
"company_id"
int8
,
PRIMARY
KEY
(
"id"
)
"name"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"num"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"ctime"
date
,
"uid"
int8
,
"lid"
int8
,
"ltime"
timestamp
(
0
),
"deleted"
int2
DEFAULT
0
,
"company_id"
int8
)
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"id"
IS
'主键'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"name"
IS
'标样名称'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"num"
IS
'标样编号'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"cid"
IS
'创建人id'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"ctime"
IS
'创建时间'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"deleted"
IS
'是否删除(0否1是)'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"company_id"
IS
'公司id'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"uid"
IS
'创建人ID'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"lid"
IS
'最后修改人ID'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"ltime"
IS
'最后修改时间'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"deleted"
IS
'是否删除0否1是'
;
COMMENT
ON
COLUMN
"public"
.
"standard_sample"
.
"company_id"
IS
'企业ID'
;
-- ----------------------------
-- Primary Key structure for table standard_sample
-- ----------------------------
ALTER
TABLE
"public"
.
"standard_sample"
ADD
CONSTRAINT
"standard_sample_pkey"
PRIMARY
KEY
(
"id"
);
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