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
c5c848bd
Commit
c5c848bd
authored
Oct 26, 2022
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理原铝重取添加多个的情况;
parent
19b1d411
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
13 deletions
+40
-13
IEntrustSampleService.java
...loud/service/lims/hmhj/service/IEntrustSampleService.java
+2
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+30
-13
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+8
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleService.java
View file @
c5c848bd
...
@@ -147,4 +147,6 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
...
@@ -147,4 +147,6 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
String
getCompatibleCode
(
EntrustSample
sample
);
String
getCompatibleCode
(
EntrustSample
sample
);
Long
getEntrustIdBySampleCode
(
String
sampleCode
);
Long
getEntrustIdBySampleCode
(
String
sampleCode
);
List
<
Long
>
getEntrustIdsBySampleCodes
(
List
<
String
>
sampleCodes
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
c5c848bd
...
@@ -1513,23 +1513,19 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1513,23 +1513,19 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
//Y2201086159C1
//Y2201086159C1
//Y2112052110C2
//Y2112052110C2
//测试环境中,原铝重取可能并不是同一天生成的,"Y" + DateUtils.dateTransfer(sample.getCtime(), "yyMMdd") + "-" + sample.getSlotNo().trim();
//测试环境中,原铝重取可能并不是同一天生成的,"Y" + DateUtils.dateTransfer(sample.getCtime(), "yyMMdd") + "-" + sample.getSlotNo().trim();
String
sampleCode
=
sample
.
getCode
(),
prefix
=
"Y"
;
List
<
String
>
sampleCodes
=
getSampleCodes
(
sampleList
);
// == 只有旧数据会有这种情况,可以不去考虑
logger
.
error
(
"sample code is : {}"
,
sampleCodes
);
if
(
StringUtils
.
isBlank
(
sampleCode
))
{
sampleCode
=
"Y"
+
DateUtils
.
dateTransfer
(
sample
.
getCtime
(),
"yyMMdd"
)
+
"-"
+
sample
.
getSlotNo
().
trim
();
}
else
{
sampleCode
=
sampleCode
.
startsWith
(
prefix
)
?
sampleCode
:
(
prefix
+
sampleCode
);
sampleCode
=
sampleCode
.
substring
(
0
,
7
)
+
"-"
+
sample
.
getSlotNo
().
trim
();
}
//根据样品编号,查询出委托id
//根据样品编号,查询出委托id
Long
entrustId
=
entrustSampleService
.
getEntrustIdBySampleCode
(
sampleCode
);
List
<
Long
>
entrustIds
=
entrustSampleService
.
getEntrustIdsBySampleCodes
(
sampleCodes
);
logger
.
error
(
"entrust id is : {}"
,
entrustIds
);
// 基本上不可能为空的
// 基本上不可能为空的
if
(
Objects
.
isNull
(
entrustId
))
{
if
(
CollectionUtils
.
isEmpty
(
entrustIds
))
{
log
(
"根据样品编号获取委托id失败"
);
log
(
"根据样品编号获取委托id失败"
);
return
;
return
;
}
}
// 根据委托去查询,也只能根据委托去查询
// 根据委托去查询,也只能根据委托去查询
dataList
=
entrustSampleItemIndexService
.
listSampleItemIndex
(
Collections
.
singletonList
(
entrustId
)
,
null
);
dataList
=
entrustSampleItemIndexService
.
listSampleItemIndex
(
entrustIds
,
null
);
}
else
{
}
else
{
dataList
=
entrustSampleItemIndexService
.
listCpSampleItemIndex
(
null
,
ids
);
dataList
=
entrustSampleItemIndexService
.
listCpSampleItemIndex
(
null
,
ids
);
}
}
...
@@ -1538,8 +1534,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1538,8 +1534,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// == search data loop
// == search data loop
dataList
.
forEach
(
t
->
{
dataList
.
forEach
(
t
->
{
// 根据有无ID判断是属于哪一种数据来源
// 根据有无ID判断是属于哪一种数据来源
Object
oid
=
t
.
get
(
"id"
);
Object
oid
=
t
.
get
(
"id"
)
,
obrand
=
t
.
get
(
"brand"
)
;
if
(
Objects
.
nonNull
(
oid
))
{
if
(
Objects
.
nonNull
(
oid
)
&&
Objects
.
isNull
(
obrand
)
)
{
Long
sampleId
=
Long
.
valueOf
(
oid
.
toString
());
Long
sampleId
=
Long
.
valueOf
(
oid
.
toString
());
t
.
put
(
"brand"
,
sampleBrandMap
.
get
(
sampleId
));
t
.
put
(
"brand"
,
sampleBrandMap
.
get
(
sampleId
));
t
.
remove
(
"id"
);
t
.
remove
(
"id"
);
...
@@ -1560,6 +1556,27 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1560,6 +1556,27 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
}
}
}
private
List
<
String
>
getSampleCodes
(
List
<
EntrustSample
>
sampleList
)
{
List
<
String
>
sampleCodes
=
new
ArrayList
<
String
>();
for
(
EntrustSample
sample
:
sampleList
)
{
String
sampleCode
=
getSampleCode
(
sample
);
sampleCodes
.
add
(
sampleCode
);
}
return
sampleCodes
;
}
private
String
getSampleCode
(
EntrustSample
sample
)
{
String
sampleCode
=
sample
.
getCode
(),
prefix
=
"Y"
;
// == 只有旧数据会有这种情况,可以不去考虑
if
(
StringUtils
.
isBlank
(
sampleCode
))
{
sampleCode
=
"Y"
+
DateUtils
.
dateTransfer
(
sample
.
getCtime
(),
"yyMMdd"
)
+
"-"
+
sample
.
getSlotNo
().
trim
();
}
else
{
sampleCode
=
sampleCode
.
startsWith
(
prefix
)
?
sampleCode
:
(
prefix
+
sampleCode
);
sampleCode
=
sampleCode
.
substring
(
0
,
7
)
+
"-"
+
sample
.
getSlotNo
().
trim
();
}
return
sampleCode
;
}
private
void
log
(
String
str
)
{
private
void
log
(
String
str
)
{
logger
.
error
(
"HMHJ====>ERP===={}...."
,
str
);
logger
.
error
(
"HMHJ====>ERP===={}...."
,
str
);
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
c5c848bd
...
@@ -2376,6 +2376,14 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -2376,6 +2376,14 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
return
(
Long
)
super
.
getObj
(
Condition
.
create
().
setSqlSelect
(
"entrust_id"
).
eq
(
"code"
,
sampleCode
.
trim
()));
return
(
Long
)
super
.
getObj
(
Condition
.
create
().
setSqlSelect
(
"entrust_id"
).
eq
(
"code"
,
sampleCode
.
trim
()));
}
}
@Override
public
List
<
Long
>
getEntrustIdsBySampleCodes
(
List
<
String
>
sampleCodes
)
{
if
(
CollectionUtils
.
isEmpty
(
sampleCodes
))
{
return
null
;
}
return
super
.
getObjs
(
Condition
.
create
().
setSqlSelect
(
"entrust_id"
).
in
(
"code"
,
sampleCodes
));
}
private
List
<
EntrustSampleItemIndex
>
getIndexList
(
Long
sampleId
)
{
private
List
<
EntrustSampleItemIndex
>
getIndexList
(
Long
sampleId
)
{
if
(
null
==
sampleId
)
{
if
(
null
==
sampleId
)
{
...
...
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