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
43c680d9
Commit
43c680d9
authored
Aug 11, 2024
by
江和松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
仓库增加物料类别
parent
53543b26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
2 deletions
+57
-2
HGKCTools.java
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
+48
-2
HGPZTools.java
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
+9
-0
No files found.
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
View file @
43c680d9
...
...
@@ -12,7 +12,10 @@ import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.kc.domain.*
;
import
com.baosight.hggp.hg.kc.utils.HGKCUtils
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005A
;
import
com.baosight.hggp.hg.pz.domain.HGPZ007
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
import
com.baosight.hggp.hg.sc.domain.HGSC008
;
import
com.baosight.hggp.hg.sc.tools.HGSCTools
;
...
...
@@ -260,6 +263,24 @@ public class HGKCTools {
putInStorageCheckData
(
hgzl002List
);
setHgkc003Data
(
hgzl002List
,
hgkc003List
,
null
,
null
);
DaoUtils
.
insertBatch
(
HGKC003
.
INSERT
,
hgkc003List
);
//可能全部不合格
if
(!
CollectionUtils
.
isEmpty
(
hgkc003List
)){
List
<
String
>
inventCodes
=
hgkc003List
.
stream
().
map
(
HGKC003:
:
getPrdtCode
).
collect
(
Collectors
.
toList
());
List
<
HGPZ005A
>
hgpz005AList
=
HGPZTools
.
HgPz005A
.
queryByInventCodes
(
inventCodes
);
hgkc003List
.
forEach
(
hgkc003
->{
//修改计划生产任务完工数量
HGSCTools
.
complete
(
hgkc003
.
getQualityId
(),
hgkc003
.
getInvQty
().
intValue
(),
hgkc003
.
getRectificationId
(),
HGConstant
.
StorageType
.
RK
);
//查询当前工序
HGPZ005A
hgpz005A
=
hgpz005AList
.
stream
().
filter
(
o
->
o
.
getInventCode
().
equals
(
hgkc003
.
getPrdtCode
())).
findAny
().
orElse
(
null
);
//查询比当前工序靠后的工序是否存在,不存在说明是最后工序,修改实时库存
List
<
HGPZ005A
>
nextHgpz005AList
=
hgpz005AList
.
stream
().
filter
(
o
->
o
.
getProcessOrder
().
compareTo
(
hgpz005A
.
getProcessOrder
())
==
1
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
nextHgpz005AList
)){
// 修改库存
HGKCUtils
.
HgKc010
.
updateInv
(
hgkc003
.
getCompanyCode
(),
hgkc003
.
getWhCode
(),
hgkc003
.
getPrdtCode
(),
hgkc003
.
getInvQty
(),
hgkc003
.
getInvWeight
());
}
});
}
}
/**
* 对象赋值(工序质检单)
...
...
@@ -270,7 +291,7 @@ public class HGKCTools {
private
static
void
setHgkc003Data
(
List
<
HGZL002
>
hgzl002List
,
List
<
HGKC003
>
hgkc003List
,
Integer
code
,
List
<
HGZL004
>
hgzl004List
)
{
List
<
String
>
inventCodes
=
hgzl002List
.
stream
().
map
(
HGZL002:
:
getProductCode
).
collect
(
Collectors
.
toList
());
List
<
HGPZ005
>
hgpz005List
=
HGPZTools
.
HgPz005
.
listByInventCodes
(
inventCodes
);
List
<
HGPZ007
>
hgpz007List
=
HGPZTools
.
HgPz007
.
allList
();
hgzl002List
.
forEach
(
o
->{
HGPZ005
hgpz005
=
hgpz005List
.
stream
().
filter
(
h
->
h
.
getInventCode
().
equals
(
o
.
getProductCode
())).
findAny
().
orElse
(
null
);
HGSC008
hgsc008
=
HGSCTools
.
THGSC008
.
getById
(
o
.
getWorkId
());
...
...
@@ -279,7 +300,6 @@ public class HGKCTools {
BeanUtil
.
copyProperties
(
o
,
hgkc003
,
"id"
);
hgkc003
.
setDepositNo
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
PROD_DEPOSIT_NO
));
hgkc003
.
setQualityId
(
o
.
getId
());
hgkc003
.
setSubmitStatus
(
HGConstant
.
ProductStatus
.
WTJ
);
if
(
Objects
.
nonNull
(
code
)){
HGZL004
hgzl004
=
hgzl004List
.
stream
().
filter
(
h
->
h
.
getCheckId
().
equals
(
o
.
getId
())).
findAny
().
orElse
(
null
);
//整改通知单
...
...
@@ -307,10 +327,20 @@ public class HGKCTools {
hgkc003
.
setPrdtWidth
(
hgpz005
.
getWidth
());
hgkc003
.
setPrdtThick
(
hgpz005
.
getThick
());
hgkc003
.
setInventTypeDetail
(
hgpz005
.
getInventTypeDetail
());
//获取仓库信息
HGPZ007
hgpz007
=
hgpz007List
.
stream
().
filter
(
wh
->
wh
.
getInventTypeDetail
()
!=
null
&&
wh
.
getInventTypeDetail
().
intValue
()
==
hgpz005
.
getInventTypeDetail
()).
findAny
().
orElse
(
null
);
if
(
Objects
.
nonNull
(
hgpz007
)){
hgkc003
.
setWhCode
(
hgpz007
.
getWhCode
());
hgkc003
.
setWhName
(
hgpz007
.
getWhName
());
}
else
{
AssertUtils
.
isNull
(
hgpz007
.
getId
(),
"仓库信息未获取到,请检查仓库档案是否维护存货大类!"
);
}
hgkc003
.
setDepositDate
(
DateUtils
.
shortDate
());
hgkc003
.
setStorageType
(
HGConstant
.
StorageType
.
RK
);
hgkc003
.
setIsReturn
(
CommonConstant
.
YesNo
.
NO_0
);
hgkc003
.
setDeleteFlag
(
DeleteFlagEnum
.
UN_REMOVE
.
getCode
());
//默认已提交
hgkc003
.
setSubmitStatus
(
HGConstant
.
ProductStatus
.
YTJ
);
hgkc003List
.
add
(
hgkc003
);
}
});
...
...
@@ -335,6 +365,22 @@ public class HGKCTools {
//赋值
setHgkc003Data
(
hgzl002List
,
hgkc003List
,
CheckTypeEnum
.
PROCESS_CHECK
.
getCode
(),
hgzl004List
);
DaoUtils
.
insertBatch
(
HGKC003
.
INSERT
,
hgkc003List
);
//查看是否为最后工序,如果最后工序则不需要再进行提交
List
<
String
>
inventCodes
=
hgkc003List
.
stream
().
map
(
HGKC003:
:
getPrdtCode
).
collect
(
Collectors
.
toList
());
List
<
HGPZ005A
>
hgpz005AList
=
HGPZTools
.
HgPz005A
.
queryByInventCodes
(
inventCodes
);
hgkc003List
.
forEach
(
hgkc003
->{
//修改计划生产任务完工数量
HGSCTools
.
complete
(
hgkc003
.
getQualityId
(),
hgkc003
.
getInvQty
().
intValue
(),
hgkc003
.
getRectificationId
(),
HGConstant
.
StorageType
.
RK
);
//查询当前工序
HGPZ005A
hgpz005A
=
hgpz005AList
.
stream
().
filter
(
o
->
o
.
getInventCode
().
equals
(
hgkc003
.
getPrdtCode
())).
findAny
().
orElse
(
null
);
//查询比当前工序靠后的工序是否存在,不存在说明是最后工序,修改实时库存
List
<
HGPZ005A
>
nextHgpz005AList
=
hgpz005AList
.
stream
().
filter
(
o
->
o
.
getProcessOrder
().
compareTo
(
hgpz005A
.
getProcessOrder
())
==
1
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
nextHgpz005AList
)){
// 修改库存
HGKCUtils
.
HgKc010
.
updateInv
(
hgkc003
.
getCompanyCode
(),
hgkc003
.
getWhCode
(),
hgkc003
.
getPrdtCode
(),
hgkc003
.
getInvQty
(),
hgkc003
.
getInvWeight
());
}
});
}
}
...
...
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
View file @
43c680d9
...
...
@@ -178,6 +178,15 @@ public class HGPZTools {
/**
* 查询仓库信息
*
* @return
*/
public
static
List
<
HGPZ007
>
allList
()
{
Map
queryMap
=
new
HashMap
();
return
DaoBase
.
getInstance
().
query
(
"HGPZ007.query"
,
queryMap
);
}
/**
* 查询仓库信息
*
* @param whCodes
* @return
*/
...
...
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