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
0e73e9b1
Commit
0e73e9b1
authored
Jun 12, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-06-11 库存盘点单
parent
7f40fb81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
276 additions
and
92 deletions
+276
-92
HGSqlConstant.java
...ain/java/com/baosight/hggp/hg/constant/HGSqlConstant.java
+16
-0
HGKCTools.java
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
+99
-0
HGPZTools.java
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
+161
-92
No files found.
src/main/java/com/baosight/hggp/hg/constant/HGSqlConstant.java
View file @
0e73e9b1
...
@@ -110,6 +110,22 @@ public class HGSqlConstant {
...
@@ -110,6 +110,22 @@ public class HGSqlConstant {
// 锁
// 锁
public
static
final
String
LOCK
=
MODULE_NAME
+
"lock"
;
public
static
final
String
LOCK
=
MODULE_NAME
+
"lock"
;
}
}
/**
* HPKC005 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public
class
HgKc005
{
// 查询
public
static
final
String
QUERY_SUM
=
"HGKC005.querySum"
;
// 锁
public
static
final
String
LOCK
=
"HGKC005.lock"
;
// 统计
public
static
final
String
STAT_DATE
=
"HGKC005.statDate"
;
}
/**
/**
* HGKC010 SQL 定义
* HGKC010 SQL 定义
...
...
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
View file @
0e73e9b1
...
@@ -15,6 +15,10 @@ import com.baosight.hggp.hg.zl.domain.HGZL004;
...
@@ -15,6 +15,10 @@ import com.baosight.hggp.hg.zl.domain.HGZL004;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.DateUtils
;
import
com.baosight.hggp.util.DateUtils
;
import
com.baosight.hggp.util.StringUtils
;
import
com.baosight.hggp.util.StringUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.soa.XLocalManager
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
@@ -455,6 +459,101 @@ public class HGKCTools {
...
@@ -455,6 +459,101 @@ public class HGKCTools {
}
}
}
}
/**
* HGKC005公共DAO方法定义
*
* @author:songx
* @date:2024/1/31,16:36
*/
public
static
class
HpKc005
{
/**
* 锁
*
* @param checkNos
* @return
*/
public
static
void
lock
(
List
<
String
>
checkNos
)
{
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
checkNos
))
{
return
;
}
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"checkNos"
,
checkNos
);
DaoBase
.
getInstance
().
update
(
HGSqlConstant
.
HgKc005
.
LOCK
,
queryMap
);
}
/**
* 查询盘点单信息
*
* @param checkNos
* @return
*/
public
static
List
<
HGKC005
>
list
(
List
<
String
>
checkNos
)
{
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
checkNos
))
{
return
null
;
}
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"checkNos"
,
checkNos
);
return
DaoBase
.
getInstance
().
query
(
HGKC005
.
QUERY
,
queryMap
);
}
/**
* 查询盘点单信息
*
* @param checkNos
* @return
*/
public
static
Map
<
String
,
HGKC005
>
map
(
List
<
String
>
checkNos
)
{
List
<
HGKC005
>
results
=
list
(
checkNos
);
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
results
))
{
return
null
;
}
return
results
.
stream
().
collect
(
Collectors
.
toMap
(
HGKC005:
:
getCheckNo
,
item
->
item
));
}
}
/**
* 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param weight
*/
public
static
void
updateStock
(
String
whCode
,
Long
inventRecordId
,
BigDecimal
amount
,
BigDecimal
weight
,
String
factCode
)
{
updateStock
(
whCode
,
inventRecordId
,
amount
,
weight
,
weight
,
factCode
);
}
/**
* 更新库存
*
* @param whCode
* @param inventRecordId
* @param amount
* @param unitWeight
* @param weight
*/
public
static
void
updateStock
(
String
whCode
,
Long
inventRecordId
,
BigDecimal
amount
,
BigDecimal
unitWeight
,
BigDecimal
weight
,
String
factoryCode
)
{
if
(
amount
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
throw
new
PlatException
(
"入库数量不能为空"
);
}
EiInfo
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"whCode"
,
whCode
);
inInfo
.
set
(
"inventRecordId"
,
inventRecordId
);
inInfo
.
set
(
"amount"
,
amount
);
inInfo
.
set
(
"unitWeight"
,
unitWeight
);
inInfo
.
set
(
"weight"
,
weight
);
inInfo
.
set
(
"factoryCode"
,
factoryCode
);
inInfo
.
set
(
EiConstant
.
serviceName
,
"HGKC010"
);
inInfo
.
set
(
EiConstant
.
methodName
,
"updateStock"
);
EiInfo
outInfo
=
XLocalManager
.
call
(
inInfo
);
if
(
outInfo
.
getStatus
()
<
0
)
{
throw
new
PlatException
(
"跟新库存失败:"
+
outInfo
.
getMsg
());
}
}
public
static
class
HgKc006
{
public
static
class
HgKc006
{
public
static
HGKC006
getById
(
Long
id
)
{
public
static
HGKC006
getById
(
Long
id
)
{
AssertUtils
.
isEmpty
(
Collections
.
singleton
(
id
),
"ID为空!"
);
AssertUtils
.
isEmpty
(
Collections
.
singleton
(
id
),
"ID为空!"
);
...
...
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
View file @
0e73e9b1
This diff is collapsed.
Click to expand it.
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