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
2a4e3b7c
Commit
2a4e3b7c
authored
Oct 14, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://git.pseer.com:8800/platform/hg-smart
into dev-ly
parents
0f73fa72
4c8fca2d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
48 deletions
+39
-48
ServiceHGKC008.java
.../java/com/baosight/hggp/hg/kc/service/ServiceHGKC008.java
+29
-39
HGKCTools.java
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
+5
-5
HGKCUtils.java
src/main/java/com/baosight/hggp/hg/kc/utils/HGKCUtils.java
+2
-1
HGKC008.js
src/main/webapp/HG/KC/HGKC008.js
+3
-3
No files found.
src/main/java/com/baosight/hggp/hg/kc/service/ServiceHGKC008.java
View file @
2a4e3b7c
...
...
@@ -176,47 +176,37 @@ public class ServiceHGKC008 extends ServiceBase {
AssertUtils
.
isEmpty
(
hgkc008
.
getWhCode
(),
"请选择仓库信息!"
);
AssertUtils
.
isEmpty
(
hgkc008
.
getWhName
(),
"请选择仓库信息!"
);
}
/**
* 修改启用状态
* @param inInfo
* @return
*/
/**
* 修改启用状态
*
* @param inInfo
* @return
*/
public
EiInfo
updateStatus
(
EiInfo
inInfo
){
int
i
=
0
;
try
{
HGKC008
hgkc008
=
new
HGKC008
();
EiBlock
eiBlock
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
);
for
(
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
hgkc008
.
fromMap
(
map
);
//查看是否能获取到账期,获取不到就提示
HGKC008
getKc008
=
HGKCTools
.
HgKc008
.
getById
(
hgkc008
.
getId
());
HGCWTools
.
HgCw001
.
getAccountPeriod
(
getKc008
.
getCompanyCode
(),
getKc008
.
getReceiptDate
());
DaoUtils
.
update
(
HGKC008
.
UPDATE_STATUS
,
hgkc008
.
toMap
());
}
List
<
HGKC008A
>
hgkc008AList
=
HGKCTools
.
HgKc008A
.
getHgkc008aList
(
hgkc008
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
hgkc008AList
)){
for
(
HGKC008A
hgkc008A
:
hgkc008AList
)
{
// 更新明细状态
HGKCTools
.
HgKc008A
.
updateStatus
(
hgkc008A
.
getApplyLineCode
(),
HgKcConst
.
HgKc008
.
Status
.
S1
);
//领料如果是正数则为出库,需要减少库存,如果是退回则要加库存
BigDecimal
qty
=
hgkc008A
.
getInvQty
().
multiply
(
new
BigDecimal
(-
1
));
BigDecimal
invUnitWeight
=
hgkc008A
.
getInvUnitWeight
().
multiply
(
new
BigDecimal
(-
1
));
BigDecimal
invWeight
=
hgkc008A
.
getInvWeight
().
multiply
(
new
BigDecimal
(-
1
));
//增加库存
HGKCUtils
.
HgKc010
.
updateInv
(
hgkc008A
.
getCompanyCode
(),
hgkc008A
.
getWhCode
(),
hgkc008A
.
getInventCode
(),
qty
,
invUnitWeight
,
invWeight
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
i
),
I18nMessages
.
getText
(
"label.update"
,
"修改"
)});
}
catch
(
PlatException
e
)
{
e
.
printStackTrace
();
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
ErrorCodeUtils
.
handleUpdateException
(
inInfo
,
i
,
e
);
logError
(
"修改失败"
,
e
.
getMessage
());
return
inInfo
;
HGKC008
fKc008
=
MapUtils
.
toDaoEPBase
(
inInfo
,
HGKC008
.
class
);
//查看是否能获取到账期,获取不到就提示
HGKC008
getKc008
=
HGKCTools
.
HgKc008
.
getById
(
fKc008
.
getId
());
HGCWTools
.
HgCw001
.
getAccountPeriod
(
getKc008
.
getCompanyCode
(),
getKc008
.
getReceiptDate
());
HGKCTools
.
HgKc008
.
updateStatus
(
fKc008
.
getApplyCode
(),
HgKcConst
.
HgKc008
.
Status
.
S1
);
List
<
HGKC008A
>
dbKc008As
=
HGKCTools
.
HgKc008A
.
getHgkc008aList
(
fKc008
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
dbKc008As
))
{
for
(
HGKC008A
dbKc008A
:
dbKc008As
)
{
// 更新明细状态
HGKCTools
.
HgKc008A
.
updateStatus
(
dbKc008A
.
getApplyLineCode
(),
HgKcConst
.
HgKc008
.
Status
.
S1
);
// 领料如果是正数则为出库,需要减少库存,如果是退回则要加库存
BigDecimal
qty
=
dbKc008A
.
getInvQty
().
negate
();
BigDecimal
invUnitWeight
=
dbKc008A
.
getInvUnitWeight
();
BigDecimal
invWeight
=
dbKc008A
.
getInvWeight
().
negate
();
// 增加库存
HGKCUtils
.
HgKc010
.
updateInv
(
dbKc008A
.
getCompanyCode
(),
dbKc008A
.
getWhCode
(),
dbKc008A
.
getInventCode
(),
qty
,
invUnitWeight
,
invWeight
);
}
}
inInfo
.
setMsg
(
"提交成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"提交失败"
);
}
return
inInfo
;
}
...
...
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
View file @
2a4e3b7c
...
...
@@ -966,7 +966,7 @@ public class HGKCTools {
}
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
"applyCodes"
,
applyCodes
);
Dao
Base
.
getInstance
()
.
update
(
HgKcSqlConst
.
HgKc008
.
LOCK
,
paramMap
);
Dao
Utils
.
update
(
HgKcSqlConst
.
HgKc008
.
LOCK
,
paramMap
);
}
/**
...
...
@@ -981,7 +981,7 @@ public class HGKCTools {
}
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
"ids"
,
ids
);
Dao
Base
.
getInstance
()
.
update
(
HgKcSqlConst
.
HgKc008
.
LOCK
,
paramMap
);
Dao
Utils
.
update
(
HgKcSqlConst
.
HgKc008
.
LOCK
,
paramMap
);
}
/**
...
...
@@ -997,7 +997,7 @@ public class HGKCTools {
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
HGKC008
.
FIELD_APPLY_CODE
,
applyCode
);
paramMap
.
put
(
HGKC008
.
FIELD_STATUS
,
status
);
Dao
Base
.
getInstance
()
.
update
(
HgKcSqlConst
.
HgKc008
.
UPDATE_STATUS
,
paramMap
);
Dao
Utils
.
update
(
HgKcSqlConst
.
HgKc008
.
UPDATE_STATUS
,
paramMap
);
}
public
static
HGKC008
getById
(
Long
id
)
{
...
...
@@ -1144,7 +1144,7 @@ public class HGKCTools {
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
HGKC008A
.
FIELD_APPLY_LINE_CODE
,
applyLineCode
);
paramMap
.
put
(
HGKC008A
.
FIELD_STATUS
,
status
);
Dao
Base
.
getInstance
()
.
update
(
HgKcSqlConst
.
HgKc008A
.
UPDATE_STATUS
,
paramMap
);
Dao
Utils
.
update
(
HgKcSqlConst
.
HgKc008A
.
UPDATE_STATUS
,
paramMap
);
}
/**
...
...
@@ -1160,7 +1160,7 @@ public class HGKCTools {
Map
paramMap
=
new
HashMap
();
paramMap
.
put
(
HGKC008A
.
FIELD_APPLY_LINE_CODE
,
applyLineCode
);
paramMap
.
put
(
HGKC008A
.
FIELD_STATUS
,
status
);
Dao
Base
.
getInstance
()
.
update
(
HgKcSqlConst
.
HgKc008A
.
UPDATE_STATUS
,
paramMap
);
Dao
Utils
.
update
(
HgKcSqlConst
.
HgKc008A
.
UPDATE_STATUS
,
paramMap
);
}
/**
...
...
src/main/java/com/baosight/hggp/hg/kc/utils/HGKCUtils.java
View file @
2a4e3b7c
...
...
@@ -462,7 +462,8 @@ public class HGKCUtils {
*/
private
static
void
updateInvData
(
HGKC010
newKc010
,
HGKC010
dbKc010
)
{
BigDecimal
newQty
=
newKc010
.
getInvQty
().
add
(
dbKc010
.
getInvQty
());
AssertUtils
.
isGt
(
BigDecimal
.
ZERO
,
newQty
,
String
.
format
(
"更新后的库存数量小于0(%s),请检查"
,
newQty
));
AssertUtils
.
isGt
(
BigDecimal
.
ZERO
,
newQty
,
String
.
format
(
"更新后的库存数量小于0(%s),请检查"
,
newQty
.
stripTrailingZeros
().
toPlainString
()));
BigDecimal
newWeight
=
newQty
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
BigDecimal
.
ZERO
:
newKc010
.
getInvWeight
().
add
(
dbKc010
.
getInvWeight
());
BigDecimal
newUnitWeight
=
newQty
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
BigDecimal
.
ZERO
...
...
src/main/webapp/HG/KC/HGKC008.js
View file @
2a4e3b7c
...
...
@@ -35,7 +35,7 @@ $(function (){
+
item
.
applyCode
+
'
\'
)" >领料详情</a>'
;
if
(
status
==
0
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="updateStatus('
+
item
.
id
+
',
1
)" >提交</a>'
;
+
'onclick="updateStatus('
+
item
.
id
+
',
\'
'
+
item
.
applyCode
+
'
\'
)" >提交</a>'
;
}
}
return
template
;
...
...
@@ -233,10 +233,10 @@ let save = function (btnNode) {
}
}
function
updateStatus
(
id
,
status
)
{
function
updateStatus
(
id
,
applyCode
)
{
let
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"result-0-id"
,
id
);
inEiInfo
.
set
(
"result-0-
status"
,
status
);
inEiInfo
.
set
(
"result-0-
applyCode"
,
applyCode
);
JSUtils
.
confirm
(
"确定提交此生产领料单吗? "
,
{
ok
:
function
()
{
EiCommunicator
.
send
(
'HGKC008'
,
'updateStatus'
,
inEiInfo
,
{
...
...
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