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
07963575
Commit
07963575
authored
Jul 14, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改样品制备搜索条件;
添加检测项目字段 - 仪器中项目名称(instrument_item_name varchar(120));
parent
571122e9
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
181 additions
and
29 deletions
+181
-29
EntrustSampleController.java
...service/lims/hmhj/controller/EntrustSampleController.java
+5
-0
EntrustSampleItemController.java
...ice/lims/hmhj/controller/EntrustSampleItemController.java
+6
-0
EntrustSampleItemMapper.java
...oud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
+2
-0
IEntrustSampleItemService.java
.../service/lims/hmhj/service/IEntrustSampleItemService.java
+2
-0
IEntrustSampleService.java
...loud/service/lims/hmhj/service/IEntrustSampleService.java
+2
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+9
-1
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+87
-6
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+28
-21
EntrustSampleItemMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
+34
-1
20210714新增检测项目字段.sql
...test/java/resources/db_sql/hmhj/v147/20210714新增检测项目字段.sql
+6
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleController.java
View file @
07963575
...
@@ -214,6 +214,11 @@ public class EntrustSampleController extends ServiceController {
...
@@ -214,6 +214,11 @@ public class EntrustSampleController extends ServiceController {
return
success
(
entrustSampleService
.
obtainMakeInfo
(
ids
,
getAccount
()));
return
success
(
entrustSampleService
.
obtainMakeInfo
(
ids
,
getAccount
()));
}
}
@ApiOperation
(
"获取制备时的列表信息"
)
@PostMapping
(
"/get_make_info"
)
public
RestResult
<
List
<
EntrustSampleVO
>>
getMakeInfoList
(
EntrustSampleVO
entrustSampleVO
)
{
return
success
(
entrustSampleService
.
getMakeInfoList
(
entrustSampleVO
,
getAccount
()));
}
@ApiOperation
(
"样品接收分页列表"
)
@ApiOperation
(
"样品接收分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleItemController.java
View file @
07963575
...
@@ -487,6 +487,12 @@ public class EntrustSampleItemController extends ServiceController {
...
@@ -487,6 +487,12 @@ public class EntrustSampleItemController extends ServiceController {
return
success
(
entrustSampleItemService
.
getListBySampleId
(
sampleId
));
return
success
(
entrustSampleItemService
.
getListBySampleId
(
sampleId
));
}
}
@ApiOperation
(
"样品下检测项目列表"
)
@PostMapping
(
"/list_by_sample_ids"
)
public
RestResult
<
List
<
EntrustSampleItemVO
>>
getListBySampleIds
(
@RequestParam
(
"sampleIds"
)
Long
[]
sampleIds
)
{
return
success
(
entrustSampleItemService
.
listBySampleIds
(
sampleIds
));
}
@ApiOperation
(
"数据录入提交"
)
@ApiOperation
(
"数据录入提交"
)
@PostMapping
(
"/submit_test"
)
@PostMapping
(
"/submit_test"
)
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
View file @
07963575
...
@@ -58,4 +58,6 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem>
...
@@ -58,4 +58,6 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem>
List
<
LmsUserRelGroupVO
>
selectAllPersonWorkload
(
RowBounds
rowBounds
,
@Param
(
"rel"
)
LmsUserRelGroup
lmsUserRelGroup
);
List
<
LmsUserRelGroupVO
>
selectAllPersonWorkload
(
RowBounds
rowBounds
,
@Param
(
"rel"
)
LmsUserRelGroup
lmsUserRelGroup
);
List
<
EntrustSampleCalcResultVO
>
selectSampleCalcResult
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
List
<
EntrustSampleCalcResultVO
>
selectSampleCalcResult
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
boolean
updateItemJudgeByEntrustId
(
@Param
(
"entrustId"
)
Long
entrustId
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleItemService.java
View file @
07963575
...
@@ -88,4 +88,6 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
...
@@ -88,4 +88,6 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
List
<
EntrustSampleCalcResultVO
>
getSampleCalcResult
(
QueryDTO
queryDTO
);
List
<
EntrustSampleCalcResultVO
>
getSampleCalcResult
(
QueryDTO
queryDTO
);
Boolean
notWriteToReport
(
List
<
Long
>
ids
);
Boolean
notWriteToReport
(
List
<
Long
>
ids
);
boolean
updateItemComposeJudgeByEntrustId
(
Long
entrustId
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleService.java
View file @
07963575
...
@@ -85,4 +85,6 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
...
@@ -85,4 +85,6 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
boolean
scanReceive
(
String
sampleCode
,
Account
account
);
boolean
scanReceive
(
String
sampleCode
,
Account
account
);
boolean
makeSingleReport
(
Long
sampleId
,
Long
[]
itemIds
,
Long
templateId
,
Account
account
);
boolean
makeSingleReport
(
Long
sampleId
,
Long
[]
itemIds
,
Long
templateId
,
Account
account
);
List
<
EntrustSampleVO
>
getMakeInfoList
(
EntrustSampleVO
entrustSampleVO
,
Account
account
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
07963575
...
@@ -851,7 +851,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -851,7 +851,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
}
@Override
@Override
public
Page
<
LmsUserRelGroupVO
>
selectAllPersonWorkload
(
Page
<
LmsUserRelGroupVO
>
page
,
LmsUserRelGroup
rel
)
{
public
Page
<
LmsUserRelGroupVO
>
selectAllPersonWorkload
(
Page
<
LmsUserRelGroupVO
>
page
,
LmsUserRelGroup
rel
)
{
return
page
.
setRecords
(
baseMapper
.
selectAllPersonWorkload
(
page
,
rel
));
return
page
.
setRecords
(
baseMapper
.
selectAllPersonWorkload
(
page
,
rel
));
}
}
...
@@ -880,4 +880,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -880,4 +880,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
entrustSampleItemIndexService
.
list
(
Condition
.
create
()
return
entrustSampleItemIndexService
.
list
(
Condition
.
create
()
.
eq
(
"entrust_sample_item_id"
,
item
.
getId
())).
size
()
==
0
;
.
eq
(
"entrust_sample_item_id"
,
item
.
getId
())).
size
()
==
0
;
}
}
@Override
public
boolean
updateItemComposeJudgeByEntrustId
(
Long
entrustId
)
{
if
(
null
==
entrustId
||
0
==
entrustId
.
longValue
())
{
return
false
;
}
return
baseMapper
.
updateItemJudgeByEntrustId
(
entrustId
);
}
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
07963575
...
@@ -623,6 +623,87 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -623,6 +623,87 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
return
list
;
return
list
;
}
}
public
List
<
EntrustSampleVO
>
getMakeInfoList
(
EntrustSampleVO
entrustSampleVO
,
Account
account
)
{
String
makeType
=
entrustSampleVO
.
getMakeType
();
// 默认全部
boolean
bySample
=
true
,
sySample
=
true
;
if
(
StringUtils
.
isNotBlank
(
makeType
))
{
if
(
"备样"
.
equals
(
makeType
))
{
bySample
=
true
;
sySample
=
false
;
}
else
{
bySample
=
false
;
sySample
=
true
;
}
}
List
<
Long
>
sampleIdList
=
entrustSampleVO
.
getIds
();
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleIdList
),
"请选择要制备的样品"
);
List
<
EntrustSample
>
sampleList
=
getBatchIds
(
sampleIdList
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleList
),
"请选择要制备的样品"
);
List
<
EntrustSampleItem
>
itemList
=
entrustSampleItemService
.
list
(
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIdList
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
itemList
),
"所选择的样品不含检测项目,无法制备"
);
//
Set
<
Long
>
setSampleIds
=
itemList
.
stream
().
map
(
EntrustSampleItem:
:
getEntrustSampleId
).
collect
(
Collectors
.
toSet
());
if
(
sampleIdList
.
size
()
!=
setSampleIds
.
size
())
{
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
itemList
),
"所选择的样品有不含检测项目的,请确认"
);
}
Map
<
Long
,
Map
<
Long
,
String
>>
sampleGroupMap
=
new
HashMap
<>();
for
(
EntrustSampleItem
item
:
itemList
)
{
if
(
sampleGroupMap
.
containsKey
(
item
.
getEntrustSampleId
()))
{
Map
<
Long
,
String
>
groupMap
=
sampleGroupMap
.
get
(
item
.
getEntrustSampleId
());
groupMap
.
put
(
item
.
getGroupId
(),
item
.
getGroupName
());
sampleGroupMap
.
put
(
item
.
getEntrustSampleId
(),
groupMap
);
}
else
{
Map
<
Long
,
String
>
groupMap
=
new
HashMap
<>();
groupMap
.
put
(
item
.
getGroupId
(),
item
.
getGroupName
());
sampleGroupMap
.
put
(
item
.
getEntrustSampleId
(),
groupMap
);
}
}
List
<
EntrustSampleVO
>
list
=
new
ArrayList
<>();
for
(
EntrustSample
sample
:
sampleList
)
{
Map
<
Long
,
String
>
groupMap
=
sampleGroupMap
.
get
(
sample
.
getId
());
if
(
null
==
groupMap
)
{
continue
;
}
if
(
sySample
)
{
for
(
Map
.
Entry
<
Long
,
String
>
g
:
groupMap
.
entrySet
())
{
EntrustSampleVO
sampleVO
=
sample
.
convert
(
EntrustSampleVO
.
class
);
sampleVO
.
setId
(
null
);
sampleVO
.
setGroupId
(
g
.
getKey
());
sampleVO
.
setGroupName
(
g
.
getValue
());
sampleVO
.
setMakeType
(
"送检样"
);
Set
<
String
>
itemNameSet
=
new
HashSet
<>();
for
(
EntrustSampleItem
item
:
itemList
)
{
if
(
item
.
getEntrustSampleId
().
equals
(
sample
.
getId
())
&&
item
.
getGroupId
().
equals
(
g
.
getKey
()))
{
itemNameSet
.
add
(
item
.
getName
());
}
}
sampleVO
.
setItemNames
(
StringHandleUtils
.
join
(
itemNameSet
));
sampleVO
.
setEntrustSampleId
(
sample
.
getId
());
list
.
add
(
sampleVO
);
}
}
//备样
if
(
bySample
)
{
EntrustSampleVO
sampleVO
=
sample
.
convert
(
EntrustSampleVO
.
class
);
sampleVO
.
setMakeType
(
"备样"
);
list
.
add
(
sampleVO
);
}
}
return
list
;
}
@Override
@Override
public
Page
<
EntrustSampleVO
>
pageSampleReceive
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
)
{
public
Page
<
EntrustSampleVO
>
pageSampleReceive
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
)
{
return
page
.
setRecords
(
baseMapper
.
selectSampleReceiveList
(
page
,
entrustSample
));
return
page
.
setRecords
(
baseMapper
.
selectSampleReceiveList
(
page
,
entrustSample
));
...
@@ -1560,13 +1641,14 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -1560,13 +1641,14 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sampleCode
),
"请扫描二维码"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sampleCode
),
"请扫描二维码"
);
String
[]
codeArray
=
sampleCode
.
split
(
"~"
);
String
[]
codeArray
=
sampleCode
.
split
(
"~"
);
RestAssert
.
fail
(
codeArray
.
length
!=
3
,
"样品编号有误!"
);
RestAssert
.
fail
(
codeArray
.
length
!=
3
,
"样品编号有误!"
);
Long
groupId
=
Long
.
parseLong
(
codeArray
[
1
]);
Long
sampleId
=
Long
.
parseLong
(
codeArray
[
2
]);
// 样品编号ID,根据当前提供的样品编号和组号获取
// 样品编号ID,根据当前提供的样品编号和组号获取
EntrustSample
sample
=
getOne
(
Condition
.
create
().
setSqlSelect
(
"id"
).
eq
(
"code
"
,
codeArray
[
0
]).
last
(
"LIMIT 1"
));
// EntrustSample sample = getOne(Condition.create().setSqlSelect("id").eq("id
", codeArray[0]).last("LIMIT 1"));
List
<
EntrustSamplePrepare
>
prepareList
=
entrustSamplePrepareService
.
list
(
Condition
.
create
().
eq
(
"entrust_sample_id"
,
sample
.
getId
()).
eq
(
"group_id"
,
Long
.
parseLong
(
codeArray
[
1
])
));
List
<
EntrustSamplePrepare
>
prepareList
=
entrustSamplePrepareService
.
list
(
Condition
.
create
().
eq
(
"entrust_sample_id"
,
sample
Id
).
eq
(
"group_id"
,
groupId
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
prepareList
),
"暂未查询到样品下的接收信息!"
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
prepareList
),
"暂未查询到样品下的接收信息!"
);
Long
[]
sampleIds
=
prepareList
.
stream
().
map
(
EntrustSamplePrepare:
:
getEntrustSample
Id
).
toArray
(
size
->
new
Long
[
size
]);
Long
[]
prepareIds
=
prepareList
.
stream
().
map
(
EntrustSamplePrepare:
:
get
Id
).
toArray
(
size
->
new
Long
[
size
]);
return
entrustSamplePrepareService
.
submitSampleReceive
(
sampl
eIds
,
"扫码接收"
,
account
);
return
entrustSamplePrepareService
.
submitSampleReceive
(
prepar
eIds
,
"扫码接收"
,
account
);
}
}
}
}
\ No newline at end of file
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
07963575
...
@@ -455,6 +455,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -455,6 +455,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrustSampleItemService
.
saveBatch
(
saveItemList
);
entrustSampleItemService
.
saveBatch
(
saveItemList
);
}
}
}
}
entrustSampleItemService
.
updateItemComposeJudgeByEntrustId
(
entrust
.
getId
());
executor1
.
execute
(
new
Runnable
()
{
executor1
.
execute
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
...
@@ -653,9 +656,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -653,9 +656,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override
@Override
public
Page
<
EntrustVO
>
pageEntrustByItemHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
public
Page
<
EntrustVO
>
pageEntrustByItemHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
if
(
CollectionUtils
.
isEmpty
(
entrust
.
getItemStatusEnumList
()))
{
if
(
CollectionUtils
.
isEmpty
(
entrust
.
getItemStatusEnumList
()))
{
return
page
;
return
page
;
}
}
return
page
.
setRecords
(
baseMapper
.
selectEntrustVOHisList
(
page
,
entrust
));
return
page
.
setRecords
(
baseMapper
.
selectEntrustVOHisList
(
page
,
entrust
));
}
}
...
@@ -1079,6 +1082,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1079,6 +1082,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if
(
entrustSampleItemList
.
size
()
>
0
)
{
if
(
entrustSampleItemList
.
size
()
>
0
)
{
entrustSampleItemService
.
saveBatch
(
entrustSampleItemList
);
entrustSampleItemService
.
saveBatch
(
entrustSampleItemList
);
}
}
// 更新检测项目判定字段
for
(
Long
entrustId
:
ids
)
{
entrustSampleItemService
.
updateItemComposeJudgeByEntrustId
(
entrustId
);
}
// 操作记录
// 操作记录
entrustRecordService
.
record
(
ids
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
0
,
account
,
"复制初始化委托"
);
entrustRecordService
.
record
(
ids
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
0
,
account
,
"复制初始化委托"
);
...
@@ -1218,7 +1225,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1218,7 +1225,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
/* 导出检测委托书 */
/* 导出检测委托书 */
@Override
@Override
public
Boolean
exportEntrust
(
List
<
Long
>
ids
,
HttpServletResponse
response
)
{
public
Boolean
exportEntrust
(
List
<
Long
>
ids
,
HttpServletResponse
response
)
{
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
ids
),
"请选择至少一个委托"
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
ids
),
"请选择至少一个委托"
);
ByteArrayOutputStream
baos
=
getEntrustBaos
();
ByteArrayOutputStream
baos
=
getEntrustBaos
();
List
<
File
>
files
=
null
;
List
<
File
>
files
=
null
;
try
{
try
{
...
@@ -1263,16 +1270,16 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1263,16 +1270,16 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
private
ByteArrayOutputStream
getEntrustBaos
()
{
private
ByteArrayOutputStream
getEntrustBaos
()
{
InputStream
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
"\\templates.\\word.\\entrust.\\EntrustExportTemplate.docx"
);
InputStream
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
"\\templates.\\word.\\entrust.\\EntrustExportTemplate.docx"
);
RestAssert
.
fail
(
null
==
inputStream
,
"委托检测书模板获取失败"
);
RestAssert
.
fail
(
null
==
inputStream
,
"委托检测书模板获取失败"
);
byte
[]
buffer
=
new
byte
[
1024
];
byte
[]
buffer
=
new
byte
[
1024
];
int
len
;
int
len
;
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
try
{
try
{
while
((
len
=
inputStream
.
read
(
buffer
))
!=
-
1
)
{
while
((
len
=
inputStream
.
read
(
buffer
))
!=
-
1
)
{
baos
.
write
(
buffer
,
0
,
len
);
baos
.
write
(
buffer
,
0
,
len
);
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
logger
.
error
(
"读取inputStream异常:{}"
,
e
);
logger
.
error
(
"读取inputStream异常:{}"
,
e
);
}
finally
{
}
finally
{
IoUtils
.
close
(
inputStream
);
IoUtils
.
close
(
inputStream
);
}
}
...
@@ -1309,14 +1316,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1309,14 +1316,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
currItems
=
items
.
stream
()
currItems
=
items
.
stream
()
.
filter
(
i
->
currIds
.
contains
(
i
.
getEntrustSampleId
()))
.
filter
(
i
->
currIds
.
contains
(
i
.
getEntrustSampleId
()))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
dataMap
.
put
(
"sample"
,
samples
.
get
(
0
));
dataMap
.
put
(
"sample"
,
samples
.
get
(
0
));
}
else
{
}
else
{
dataMap
.
put
(
"sample"
,
new
EntrustSample
());
dataMap
.
put
(
"sample"
,
new
EntrustSample
());
}
}
/* 委托 */
/* 委托 */
entrustVO
.
setSampleQuantityTotal
(
Long
.
parseLong
(
String
.
valueOf
(
samples
.
size
())));
entrustVO
.
setSampleQuantityTotal
(
Long
.
parseLong
(
String
.
valueOf
(
samples
.
size
())));
entrustVO
.
setCodes
(
ListToStringUtils
.
listToString
(
codes
,
"、"
,
gangCode
));
entrustVO
.
setCodes
(
ListToStringUtils
.
listToString
(
codes
,
"、"
,
gangCode
));
dataMap
.
put
(
"entrust"
,
entrustVO
);
dataMap
.
put
(
"entrust"
,
entrustVO
);
/* 项目名 */
/* 项目名 */
Set
<
String
>
itemNames
=
currItems
.
stream
().
filter
(
i
->
StringUtils
.
isNotEmpty
(
i
.
getName
()))
Set
<
String
>
itemNames
=
currItems
.
stream
().
filter
(
i
->
StringUtils
.
isNotEmpty
(
i
.
getName
()))
.
map
(
i
->
i
.
getName
()).
collect
(
Collectors
.
toSet
());
.
map
(
i
->
i
.
getName
()).
collect
(
Collectors
.
toSet
());
...
@@ -1325,17 +1332,17 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1325,17 +1332,17 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
.
filter
(
i
->
StringUtils
.
isNotEmpty
(
i
.
getStandard
()))
.
filter
(
i
->
StringUtils
.
isNotEmpty
(
i
.
getStandard
()))
.
map
(
i
->
i
.
getStandard
()).
collect
(
Collectors
.
toSet
());
.
map
(
i
->
i
.
getStandard
()).
collect
(
Collectors
.
toSet
());
dataMap
.
put
(
"itemNames"
,
ListToStringUtils
.
listToString
(
itemNames
,
"、"
,
gangCode
));
dataMap
.
put
(
"itemNames"
,
ListToStringUtils
.
listToString
(
itemNames
,
"、"
,
gangCode
));
dataMap
.
put
(
"standards"
,
ListToStringUtils
.
listToString
(
standards
,
"、"
,
gangCode
));
dataMap
.
put
(
"standards"
,
ListToStringUtils
.
listToString
(
standards
,
"、"
,
gangCode
));
/* 委托时间和样品接收时间 */
/* 委托时间和样品接收时间 */
dataMap
.
put
(
"entrustTimeStr"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDay
(
entrust
.
getEntrustTime
()),
gangCode
));
dataMap
.
put
(
"entrustTimeStr"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDay
(
entrust
.
getEntrustTime
()),
gangCode
));
dataMap
.
put
(
"entrustTimeStrCn"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDayChinese
(
entrust
.
getEntrustTime
()),
gangCode
));
dataMap
.
put
(
"entrustTimeStrCn"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDayChinese
(
entrust
.
getEntrustTime
()),
gangCode
));
dataMap
.
put
(
"entrustTimeStrPoint"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDayPoint
(
entrust
.
getEntrustTime
()),
gangCode
));
dataMap
.
put
(
"entrustTimeStrPoint"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDayPoint
(
entrust
.
getEntrustTime
()),
gangCode
));
dataMap
.
put
(
"receiveTimeStr"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDay
(
entrust
.
getReceiveTime
()),
gangCode
));
dataMap
.
put
(
"receiveTimeStr"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDay
(
entrust
.
getReceiveTime
()),
gangCode
));
dataMap
.
put
(
"receiveTimeStrCn"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDayChinese
(
entrust
.
getReceiveTime
()),
gangCode
));
dataMap
.
put
(
"receiveTimeStrCn"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDayChinese
(
entrust
.
getReceiveTime
()),
gangCode
));
dataMap
.
put
(
"receiveTimeStrPoint"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDayPoint
(
entrust
.
getReceiveTime
()),
gangCode
));
dataMap
.
put
(
"receiveTimeStrPoint"
,
StringHandleUtils
.
parse
(
DateUtils
.
toYearMonthDayPoint
(
entrust
.
getReceiveTime
()),
gangCode
));
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
new
ByteArrayInputStream
(
baos
.
toByteArray
())).
setDefaultValue
(
"/"
).
render
(
dataMap
);
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
new
ByteArrayInputStream
(
baos
.
toByteArray
())).
setDefaultValue
(
"/"
).
render
(
dataMap
);
String
filePath
=
filePathPrefix
+
entrust
.
getCode
()
+
"检测委托书.docx"
;
String
filePath
=
filePathPrefix
+
entrust
.
getCode
()
+
"检测委托书.docx"
;
...
@@ -1357,7 +1364,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1357,7 +1364,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrustAnnexService
.
save
(
annex
);
entrustAnnexService
.
save
(
annex
);
files
.
add
(
file
);
files
.
add
(
file
);
IoUtils
.
close
(
fos
,
template
.
getXWPFDocument
());
IoUtils
.
close
(
fos
,
template
.
getXWPFDocument
());
}
}
return
files
;
return
files
;
}
}
...
...
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
View file @
07963575
...
@@ -176,7 +176,9 @@
...
@@ -176,7 +176,9 @@
<select
id=
"selectVOListBySampleIds"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO"
>
<select
id=
"selectVOListBySampleIds"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO"
>
SELECT i.id,i.name,i.agreed_value,i.test_value,i.entrust_sample_id,i.standard,s.code AS "sampleCode"
SELECT
i.*,s.code AS "sampleCode",s.sample_shape ,s.sample_quantity, s.standard,
s.sample_from, s.product_code,s.name_code
FROM
FROM
entrust_sample_item i
entrust_sample_item i
JOIN entrust_sample s ON i.entrust_sample_id = s.ID
JOIN entrust_sample s ON i.entrust_sample_id = s.ID
...
@@ -491,4 +493,35 @@
...
@@ -491,4 +493,35 @@
</if>
</if>
GROUP BY ug.user_id,ug.group_id,ug.realname
GROUP BY ug.user_id,ug.group_id,ug.realname
</select>
</select>
<!--更新委托下检测项目的组合判定状态-->
<update
id=
"updateItemJudgeByEntrustId"
>
update entrust_sample_item i
set compose_judge = spi.compose_judge
from (
SELECT
distinct
s.entrust_id,
s.id "sample_id",
gp.grading_standard_id,
gi.grading_product_id,
gi.NAME "item_name",
gi.compose_judge
FROM
entrust_sample s
JOIN grading_standard gs ON gs.ID = s.product_standard_id
JOIN grading_product gp ON gp.grading_standard_id = gs.ID
join grading_item gi on gi.grading_product_id = gp.id
WHERE
s.deleted = 0
AND gs.deleted = 0
AND gp.deleted = 0
AND gi.deleted = 0
AND gs.compose_judge = 1
) as spi
where i.deleted = 0
and spi.item_name = i.name
and spi.sample_id = i.entrust_sample_id
and spi.entrust_id = #{entrustId}
</update>
</mapper>
</mapper>
src/test/java/resources/db_sql/hmhj/v147/20210714新增检测项目字段.sql
0 → 100644
View file @
07963575
ALTER
TABLE
"public"
.
"qualification"
ALTER
TABLE
"public"
.
"qualification"
ADD
COLUMN
"instrument_item_name"
varchar
(
120
)
COLLATE
"pg_catalog"
.
"default"
;
COMMENT
ON
COLUMN
"public"
.
"qualification"
.
"instrument_item_name"
IS
'仪器中项目名称'
;
\ No newline at end of file
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