Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-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
hg-smart
Commits
cd84a3e2
Commit
cd84a3e2
authored
Sep 14, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-09-14 优化批量派工
parent
8746e620
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
3 deletions
+30
-3
ServiceHGSC006A.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC006A.java
+5
-3
HGSC006A.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC006A.xml
+3
-0
HGSCTools.java
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
+22
-0
No files found.
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC006A.java
View file @
cd84a3e2
...
...
@@ -69,11 +69,13 @@ public class ServiceHGSC006A extends ServiceBase {
String
groupName
=
inInfo
.
getString
(
"groupName"
);
HGSC006
hgsc006
=
HGSCTools
.
THGSC006
.
getByOrderCode
(
orderCode
);
List
<
HGPZ005
>
hgpz005List
=
DaoBase
.
getInstance
().
query
(
HGPZ005
.
QUERY
,
new
HashMap
<>());
for
(
String
orderDetailId
:
orderDetailIds
)
{
// 校验主订单是否已分派
HGSC006A
hgsc006A
=
HGSCTools
.
THGSC006A
.
getById
(
Long
.
parseLong
(
orderDetailId
));
List
<
HGSC006A
>
hgsc006As
=
HGSCTools
.
THGSC006A
.
listByIds
(
Arrays
.
asList
(
orderDetailIds
));
// 锁主单号
HGSCTools
.
THGSC006A
.
lock
(
hgsc006A
.
getId
());
HGSCTools
.
THGSC006A
.
lock
(
Arrays
.
asList
(
orderDetailIds
));
for
(
HGSC006A
hgsc006A
:
hgsc006As
)
{
// 校验主订单是否已分派
//HGSC006A hgsc006A = HGSCTools.THGSC006A.getById(Long.parseLong(orderDetailId));
AssignStatusEnum
assignStatusEnum
=
AssignStatusEnum
.
getEnumByCode
(
hgsc006A
.
getAssignStatus
());
Integer
assignQuantity
=
new
Integer
(
0
);
switch
(
assignStatusEnum
){
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC006A.xml
View file @
cd84a3e2
...
...
@@ -153,6 +153,9 @@
<isNotEmpty
prepend=
" AND "
property=
"updatedTime"
>
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"ids"
>
id IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"ids"
>
#ids[]#
</iterate>
</isNotEmpty>
</sql>
<select
id=
"query_other"
parameterClass=
"java.util.HashMap"
...
...
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
View file @
cd84a3e2
...
...
@@ -1434,6 +1434,20 @@ public class HGSCTools {
queryMap
.
put
(
HGSC006A
.
FIELD_id
,
orderDetailId
);
DaoBase
.
getInstance
().
update
(
HGSqlConstant
.
HGSC006A
.
LOCK
,
queryMap
);
}
/**
* 锁
*
* @param orderDetailIds
* @return
*/
public
static
void
lock
(
List
<
String
>
orderDetailIds
)
{
if
(
orderDetailIds
.
size
()
<=
0
)
{
return
;
}
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"ids"
,
orderDetailIds
);
DaoBase
.
getInstance
().
update
(
HGSqlConstant
.
HGSC006A
.
LOCK
,
queryMap
);
}
public
static
HGSC006A
getById
(
Long
orderDetailId
)
{
AssertUtils
.
isTrue
(
Objects
.
isNull
(
orderDetailId
)
||
orderDetailId
<=
0
,
"订单明细ID不能为空!"
);
...
...
@@ -1441,6 +1455,14 @@ public class HGSCTools {
return
results
;
}
public
static
List
<
HGSC006A
>
listByIds
(
List
<
String
>
orderDetailIds
)
{
AssertUtils
.
isEmpty
(
orderDetailIds
,
"订单明细ID不能为空!"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"ids"
,
orderDetailIds
);
List
<
HGSC006A
>
results
=
DaoBase
.
getInstance
().
query
(
HGSC006A
.
QUERY
,
queryMap
);
return
CollectionUtils
.
isEmpty
(
results
)?
null
:
results
;
}
public
static
List
<
HGSC006A
>
constructObj
(
HGSC006
hgsc006
,
List
<
HGSC005A
>
hgsc005AList
)
{
List
<
HGSC006A
>
result
=
new
ArrayList
<>();
hgsc005AList
.
forEach
(
o
->
{
...
...
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