Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
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
platform
hp-smart
Commits
18597cc5
Commit
18597cc5
authored
Apr 23, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.增加逻辑校验
parent
e7a56aad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
21 deletions
+50
-21
ServiceHPSC003.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC003.java
+50
-21
No files found.
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC003.java
View file @
18597cc5
...
@@ -292,28 +292,9 @@ public class ServiceHPSC003 extends ServiceBase {
...
@@ -292,28 +292,9 @@ public class ServiceHPSC003 extends ServiceBase {
AssertUtils
.
isNull
(
planInfoNo
,
"计划号不能为空"
);
AssertUtils
.
isNull
(
planInfoNo
,
"计划号不能为空"
);
// 查询计划主信息
// 查询计划主信息
HPSC003
dbSc003
=
HPSCTools
.
HpSc003
.
getByNo
(
planInfoNo
);
HPSC003
dbSc003
=
HPSCTools
.
HpSc003
.
getByNo
(
planInfoNo
);
// 查询计划明细信息
List
<
HPSC004
>
dbSc004s
=
HPSCTools
.
HpSc004
.
queryByParent
(
dbSc003
.
getPlanInfoNo
());
List
<
Map
>
dbSc004Maps
=
dbSc004s
.
stream
().
map
(
HPSC004:
:
toMap
).
collect
(
Collectors
.
toList
());
// 订单号
List
<
String
>
prodOrderNos
=
ObjectUtils
.
listEpKey
(
dbSc004s
,
HPSC004
.
FIELD_PROD_ORDER_NO
);
// 查询派工信息
List
<
HPSC005B
>
dbSc005bs
=
HPSCTools
.
HpSc005b
.
listByOrder
(
prodOrderNos
);
// 填充数据
Map
<
String
,
List
<
HPSC005B
>>
dbSc005bMap
=
dbSc005bs
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
HPSC005B:
:
getProdOrderNo
));
for
(
Map
dbSc004Map
:
dbSc004Maps
)
{
String
prodOrderNo
=
MapUtils
.
getString
(
dbSc004Map
,
HPSC004
.
FIELD_PROD_ORDER_NO
);
List
<
HPSC005B
>
dbSc005Items
=
dbSc005bMap
.
get
(
prodOrderNo
);
if
(
CollectionUtils
.
isNotEmpty
(
dbSc005Items
))
{
dbSc004Map
.
put
(
"prodOrders"
,
dbSc005Items
.
stream
().
map
(
HPSC005B:
:
toMap
)
.
collect
(
Collectors
.
toList
()));
}
else
{
dbSc004Map
.
put
(
"prodOrders"
,
new
ArrayList
<>());
}
}
Map
dbSc003Map
=
dbSc003
.
toMap
();
Map
dbSc003Map
=
dbSc003
.
toMap
();
dbSc003Map
.
put
(
"planDetail"
,
dbSc004Maps
);
// 查询计划明细信息
this
.
buildPlanDetail
(
dbSc003Map
);
inInfo
.
set
(
"planInfo"
,
dbSc003Map
);
inInfo
.
set
(
"planInfo"
,
dbSc003Map
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"查询计划详情失败"
);
LogUtils
.
setMsg
(
inInfo
,
e
,
"查询计划详情失败"
);
...
@@ -323,4 +304,52 @@ public class ServiceHPSC003 extends ServiceBase {
...
@@ -323,4 +304,52 @@ public class ServiceHPSC003 extends ServiceBase {
return
inInfo
;
return
inInfo
;
}
}
/**
* 计划明细
*
* @param dbSc003Map
*/
private
void
buildPlanDetail
(
Map
dbSc003Map
)
{
String
planInfoNo
=
MapUtils
.
getString
(
dbSc003Map
,
HPSC003
.
FIELD_PLAN_INFO_NO
);
// 查询计划明细信息
List
<
HPSC004
>
dbSc004s
=
HPSCTools
.
HpSc004
.
queryByParent
(
planInfoNo
);
if
(
CollectionUtils
.
isEmpty
(
dbSc004s
))
{
dbSc003Map
.
put
(
"planDetail"
,
new
ArrayList
<>());
return
;
}
List
<
Map
>
dbSc004Maps
=
dbSc004s
.
stream
().
map
(
HPSC004:
:
toMap
).
collect
(
Collectors
.
toList
());
// 派工信息
buildProdOrder
(
dbSc004Maps
);
}
/**
* 派工信息
*
* @param dbSc004Maps
*/
private
void
buildProdOrder
(
List
<
Map
>
dbSc004Maps
)
{
// 订单号
List
<
String
>
prodOrderNos
=
ObjectUtils
.
listKey
(
dbSc004Maps
,
HPSC004
.
FIELD_PROD_ORDER_NO
);
// 查询派工信息
List
<
HPSC005B
>
dbSc005bs
=
HPSCTools
.
HpSc005b
.
listByOrder
(
prodOrderNos
);
// 填充数据
Map
<
String
,
List
<
HPSC005B
>>
dbSc005bMap
=
CollectionUtils
.
isEmpty
(
dbSc005bs
)
?
null
:
dbSc005bs
.
stream
().
collect
(
Collectors
.
groupingBy
(
HPSC005B:
:
getProdOrderNo
));
for
(
Map
dbSc004Map
:
dbSc004Maps
)
{
String
prodOrderNo
=
MapUtils
.
getString
(
dbSc004Map
,
HPSC004
.
FIELD_PROD_ORDER_NO
);
if
(
dbSc005bMap
==
null
)
{
dbSc004Map
.
put
(
"prodOrders"
,
new
ArrayList
<>());
continue
;
}
List
<
HPSC005B
>
dbSc005Items
=
dbSc005bMap
.
get
(
prodOrderNo
);
if
(
CollectionUtils
.
isNotEmpty
(
dbSc005Items
))
{
dbSc004Map
.
put
(
"prodOrders"
,
dbSc005Items
.
stream
().
map
(
HPSC005B:
:
toMap
)
.
collect
(
Collectors
.
toList
()));
}
else
{
dbSc004Map
.
put
(
"prodOrders"
,
new
ArrayList
<>());
}
}
}
}
}
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