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
51730006
Commit
51730006
authored
Oct 26, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-10-24 添加打包单及其功能
parent
f3f747f1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
14 deletions
+30
-14
ServiceHGKC004.java
.../java/com/baosight/hggp/hg/kc/service/ServiceHGKC004.java
+9
-7
ServiceHGKC017.java
.../java/com/baosight/hggp/hg/kc/service/ServiceHGKC017.java
+2
-2
HGKCTools.java
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
+2
-1
ServiceHGYX001.java
.../java/com/baosight/hggp/hg/yx/service/ServiceHGYX001.java
+15
-2
HGKC017.js
src/main/webapp/HG/KC/HGKC017.js
+2
-2
No files found.
src/main/java/com/baosight/hggp/hg/kc/service/ServiceHGKC004.java
View file @
51730006
...
...
@@ -8,10 +8,7 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.cw.tools.HGCWTools
;
import
com.baosight.hggp.hg.kc.domain.HGKC004
;
import
com.baosight.hggp.hg.kc.domain.HGKC004A
;
import
com.baosight.hggp.hg.kc.domain.HGKC010
;
import
com.baosight.hggp.hg.kc.domain.HGKC016A
;
import
com.baosight.hggp.hg.kc.domain.*
;
import
com.baosight.hggp.hg.kc.tools.HGKCTools
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
...
...
@@ -185,12 +182,17 @@ public class ServiceHGKC004 extends ServiceEPBase {
if
(
hgkc004A
.
getSource
()
==
2
){
List
<
HGKC016A
>
hgkc016as1
=
Optional
.
ofNullable
(
hgkc016as
).
orElse
(
new
ArrayList
<>()).
stream
().
filter
(
hgkc016a
->
hgkc016a
.
getId
().
equals
(
hgkc004A
.
getSourceId
())).
collect
(
Collectors
.
toList
());
AssertUtils
.
isEmpty
(
hgkc016as1
,
"打包单明细库存不存在,无法保存!"
);
hgkc016as1
.
forEach
(
hgkc016a
->
{
for
(
HGKC016A
hgkc016a:
hgkc016as1
)
{
HGKC016
hgkc016
=
HGKCTools
.
HgKc016
.
getById
(
hgkc016a
.
getParentId
());
hgkc016a
.
setInvQty
(
hgkc016a
.
getInvQty
().
subtract
(
hgkc004A
.
getQuantity
()));
hgkc016a
.
setInvWeight
(
hgkc016a
.
getInvQty
().
multiply
(
hgkc004A
.
getUnitWeight
()));
DaoUtils
.
update
(
HGKC016A
.
UPDATE_INV
,
hgkc016a
);
});
if
(
hgkc016
!=
null
){
hgkc016
.
setInvQty
(
hgkc016
.
getInvQty
().
subtract
(
hgkc004A
.
getQuantity
()));
hgkc016
.
setInvWeight
(
hgkc016
.
getInvQty
().
multiply
(
hgkc004A
.
getUnitWeight
()));
DaoUtils
.
update
(
HGKC016
.
UPDATE
,
hgkc016
);
}
}
}
else
{
HGKC010
hgkc010
=
HGKCTools
.
HgKc010
.
get
(
kc004
.
getCompanyCode
(),
kc004
.
getWhCode
(),
hgkc004A
.
getInventCode
());
if
(
hgkc010
==
null
)
{
...
...
src/main/java/com/baosight/hggp/hg/kc/service/ServiceHGKC017.java
View file @
51730006
...
...
@@ -134,7 +134,7 @@ public class ServiceHGKC017 extends ServiceEPBase {
AssertUtils
.
isTrue
(
hgkc017
.
getStatus
().
equals
(
HgKcConst
.
HgKc017
.
Status
.
S1
),
"打包单已提交,不能重复提交!"
);
List
<
HGKC017A
>
hgkc017As
=
Optional
.
ofNullable
(
hgkc017aList
).
orElse
(
new
ArrayList
<>()).
stream
().
filter
(
hgkc017a
->
hgkc017a
.
getParentId
().
equals
(
hgkc017
.
getId
())).
collect
(
Collectors
.
toList
());
AssertUtils
.
isTrue
(
hgkc017As
.
size
()
<=
0
,
"打包单明细为空,不能提交!"
);
AssertUtils
.
isEmpty
(
hgkc017aList
,
"打包单明细为空,不能提交!"
);
//明细总数
BigDecimal
totalInvQty
=
hgkc017As
.
stream
().
map
(
HGKC017A:
:
getInvQty
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
List
<
HGKC010
>
hgkc010s
=
Optional
.
ofNullable
(
hgkc010List
).
orElse
(
new
ArrayList
<>()).
stream
().
filter
(
kc010
->
...
...
@@ -157,7 +157,7 @@ public class ServiceHGKC017 extends ServiceEPBase {
hgkc017
.
getInventCode
(),
qty
,
invUnitWeight
,
invWeight
);
}
//添加打包库存
HGKCTools
.
HgKc016
.
add
(
hgkc017
,
hgkc017As
,
totalInvQty
);
HGKCTools
.
HgKc016
.
add
(
hgkc017
,
hgkc017As
,
totalInvQty
);
hgkc017
.
setStatus
(
HgKcConst
.
HgKc017
.
Status
.
S1
);
DaoUtils
.
update
(
HGKC017
.
UPDATE_STATUS
,
hgkc017
);
...
...
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
View file @
51730006
...
...
@@ -1803,11 +1803,12 @@ public class HGKCTools {
public
static
void
add
(
HGKC017
hgkc017
,
List
<
HGKC017A
>
hgkc017Detail
,
BigDecimal
totalInvQty
)
{
HGKC016
hgkc016Old
=
HGKCTools
.
HgKc016
.
get
(
hgkc017
.
getCompanyCode
(),
hgkc017
.
getWhCode
(),
hgkc017
.
getInventCode
());
Long
id
=
0L
;
Long
id
;
if
(
hgkc016Old
!=
null
){
hgkc016Old
.
setInvQty
(
hgkc016Old
.
getInvQty
().
add
(
totalInvQty
));
hgkc016Old
.
setInvWeight
(
hgkc016Old
.
getInvWeight
().
add
(
totalInvQty
.
multiply
(
hgkc017
.
getInvUnitWeight
())));
DaoUtils
.
update
(
HGKC016
.
UPDATE
,
hgkc016Old
);
id
=
hgkc016Old
.
getId
();
}
else
{
HGKC016
hgkc016
=
new
HGKC016
();
hgkc016
.
fromMap
(
hgkc017
.
toMap
());
...
...
src/main/java/com/baosight/hggp/hg/yx/service/ServiceHGYX001.java
View file @
51730006
...
...
@@ -116,6 +116,9 @@ public class ServiceHGYX001 extends ServiceEPBase {
try
{
List
<
Map
>
queryBlock
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
).
getRows
();
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
List
<
Long
>
sourceIds
=
resultRows
.
stream
().
map
(
map
->
Long
.
valueOf
(
map
.
get
(
"sourceId"
).
toString
())).
collect
(
Collectors
.
toList
());
List
<
HGKC016A
>
hgkc016as
=
HGKCTools
.
HgKc016a
.
getById
(
sourceIds
,
true
);
for
(
Map
queryRow:
queryBlock
)
{
HGYX001
hgyx001
=
new
HGYX001
();
hgyx001
.
fromMap
(
queryRow
);
...
...
@@ -125,6 +128,10 @@ public class ServiceHGYX001 extends ServiceEPBase {
HGYX001A
hgyx001A
=
new
HGYX001A
();
hgyx001A
.
fromMap
(
resultRow
);
hgyx001A
.
setParentId
(
hgyx001
.
getId
());
if
(
hgyx001A
.
getSource
()
==
2
){
List
<
HGKC016A
>
hgkc016as1
=
Optional
.
ofNullable
(
hgkc016as
).
orElse
(
new
ArrayList
<>()).
stream
().
filter
(
hgkc016a
->
hgkc016a
.
getId
().
equals
(
hgyx001A
.
getSourceId
())).
collect
(
Collectors
.
toList
());
AssertUtils
.
isEmpty
(
hgkc016as1
,
"打包单明细库存不存在,无法保存!"
);
}
else
{
HGKC010
hgkc010
=
HGKCTools
.
HgKc010
.
get
(
hgyx001
.
getCompanyCode
(),
hgyx001
.
getConsWhCode
(),
hgyx001A
.
getInventCode
());
if
(
hgkc010
==
null
)
{
throw
new
PlatException
(
"库存不足!"
);
...
...
@@ -132,6 +139,7 @@ public class ServiceHGYX001 extends ServiceEPBase {
if
(
hgkc010
.
getInvQty
().
compareTo
(
hgyx001A
.
getQuantity
())
<
0
)
{
throw
new
PlatException
(
"库存不足,无法保存!"
);
}
}
if
(
hgyx001A
.
getId
()
==
null
||
hgyx001A
.
getId
()
==
0
)
{
this
.
addDatail
(
hgyx001A
);
}
...
...
@@ -142,6 +150,10 @@ public class ServiceHGYX001 extends ServiceEPBase {
HGYX001A
hgyx001A
=
new
HGYX001A
();
hgyx001A
.
fromMap
(
resultRow
);
hgyx001A
.
setParentId
(
hgyx001
.
getId
());
if
(
hgyx001A
.
getSource
()
==
2
){
List
<
HGKC016A
>
hgkc016as1
=
Optional
.
ofNullable
(
hgkc016as
).
orElse
(
new
ArrayList
<>()).
stream
().
filter
(
hgkc016a
->
hgkc016a
.
getId
().
equals
(
hgyx001A
.
getSourceId
())).
collect
(
Collectors
.
toList
());
AssertUtils
.
isEmpty
(
hgkc016as1
,
"打包单明细库存不存在,无法保存!"
);
}
else
{
HGKC010
hgkc010
=
HGKCTools
.
HgKc010
.
get
(
hgyx001
.
getCompanyCode
(),
hgyx001
.
getConsWhCode
(),
hgyx001A
.
getInventCode
());
if
(
hgkc010
==
null
)
{
throw
new
PlatException
(
"库存不足!"
);
...
...
@@ -149,6 +161,7 @@ public class ServiceHGYX001 extends ServiceEPBase {
if
(
hgkc010
.
getInvQty
().
compareTo
(
hgyx001A
.
getQuantity
())
<
0
)
{
throw
new
PlatException
(
"库存不足,无法保存!"
);
}
}
if
(
hgyx001A
.
getId
()
==
null
||
hgyx001A
.
getId
()
==
0
)
{
this
.
addDatail
(
hgyx001A
);
}
else
{
...
...
@@ -316,8 +329,8 @@ public class ServiceHGYX001 extends ServiceEPBase {
List
<
Map
>
queryBlock
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
).
getRows
();
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
//查询打包单明细
List
<
Long
>
sourceIds
=
resultRows
.
stream
().
map
(
map
->
(
Long
)
map
.
get
(
"sourceIds"
)).
collect
(
Collectors
.
toList
());
List
<
HGKC016A
>
hgkc016as
=
HGKCTools
.
HgKc016a
.
getById
(
sourceIds
,
true
);
List
<
Long
>
sourceIds
=
resultRows
.
stream
().
map
(
map
->
Long
.
parseLong
(
map
.
get
(
"sourceId"
).
toString
()
)).
collect
(
Collectors
.
toList
());
List
<
HGKC016A
>
hgkc016as
=
HGKCTools
.
HgKc016a
.
getById
(
sourceIds
);
for
(
Map
queryRow:
queryBlock
)
{
HGYX001
hgyx001
=
new
HGYX001
();
hgyx001
.
fromMap
(
queryRow
);
...
...
src/main/webapp/HG/KC/HGKC017.js
View file @
51730006
...
...
@@ -148,8 +148,8 @@ $(function () {
for
(
let
i
=
0
;
i
<
inventRecordBox
.
length
;
i
++
)
{
if
(
inventRecordBox
[
i
][
'valueField'
]
===
item
[
'inventCode'
])
{
resultGrid
.
setCellValue
(
item
,
'inventName'
,
inventRecordBox
[
i
][
'textField'
]);
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'inventType
Detail
'
,
inventRecordBox
[
i
][
'param1Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'inventType'
,
inventRecordBox
[
i
][
'param10Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'inventType'
,
inventRecordBox
[
i
][
'param1Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'inventType
Detail
'
,
inventRecordBox
[
i
][
'param10Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'specId'
,
inventRecordBox
[
i
][
'param2Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'spec'
,
inventRecordBox
[
i
][
'param3Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'length'
,
inventRecordBox
[
i
][
'param4Field'
])
...
...
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