Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-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
hp-smart
Commits
b90a3719
Commit
b90a3719
authored
Sep 24, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-09-24 生产订单增加撤销功能
parent
d787e9af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
47 deletions
+45
-47
ServiceHPSC005A.java
...java/com/baosight/hpjx/hp/sc/service/ServiceHPSC005A.java
+11
-14
HPSC005.js
src/main/webapp/HP/SC/HPSC005.js
+34
-33
No files found.
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC005A.java
View file @
b90a3719
...
...
@@ -318,24 +318,21 @@ public class ServiceHPSC005A extends ServiceBase {
@OperationLogAnnotation
(
operModul
=
"拆单派工"
,
operType
=
"撤销"
,
operDesc
=
"生产订单-拆单派工A-撤销"
)
public
EiInfo
revocation
(
EiInfo
inInfo
)
{
try
{
String
prodOrderNo
=
inInfo
.
getString
(
"prodOrderNo"
);
//生产订单号
List
<
HPSC005
>
hgsc005List
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HPSC005
.
class
);
List
<
String
>
prodOrderNos
=
hgsc005List
.
stream
().
map
(
HPSC005:
:
getProdOrderNo
).
collect
(
Collectors
.
toList
());
// 校验主订单是否已分派
HPSC005
hgsc005
=
HPSCTools
.
HpSc005
.
get
(
prodOrderNo
);
AssertUtils
.
isEmpty
(
Collections
.
singleton
(
hgsc005
),
"未找到生产订单信息"
);
//List<String> prodOrderNos = hgsc005List.stream().map(HPSC005::getProdOrderNo).collect(Collectors.toList());
List
<
HPSC005A
>
hgsc005AList
=
HPSCTools
.
HpSc005a
.
getByProdOrderNo
(
prodOrderNo
);
List
<
HPZL001
>
hpzl001List
=
HPZLTools
.
getByprodOrderNos
(
Arrays
.
asList
(
prodOrderNo
));
List
<
HPZL001
>
hpzl001List
=
HPZLTools
.
getByprodOrderNos
(
prodOrderNos
);
AssertUtils
.
isTrue
(
CollectionUtils
.
isNotEmpty
(
hpzl001List
),
"生产订单已经进入质检环节,无法撤销"
);
hgsc005
.
setStatus
(
ProdOrderStatusEnum
.
NOT_ASSIGN
.
getCode
()
);
hgsc005
.
setAssignedNum
(
BigDecimal
.
ZERO
);
hgsc005
.
setUnassignedNum
(
hgsc005
.
getNum
());
DaoUtils
.
update
(
HPSC005
.
UPDATE
,
hgsc005
);
for
(
HPSC005A
hgsc005A:
hgsc005AList
)
{
DaoUtils
.
update
(
HPSC005
A
.
DELETE
,
hgsc005A
);
List
<
HPSC005A
>
hgsc005AList
=
HPSCTools
.
HpSc005a
.
getByProdOrderNo
(
prodOrderNos
);
for
(
HPSC005
hgsc005:
hgsc005List
)
{
hgsc005
.
setStatus
(
ProdOrderStatusEnum
.
NOT_ASSIGN
.
getCode
());
hgsc005
.
setAssignedNum
(
BigDecimal
.
ZERO
);
hgsc005
.
setUnassignedNum
(
hgsc005
.
getNum
());
DaoUtils
.
update
(
HPSC005
.
UPDATE
,
hgsc005
);
}
hgsc005AList
.
forEach
(
hgsc005A
->
DaoUtils
.
update
(
HPSC005A
.
DELETE
,
hgsc005A
));
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
1
+
"]条数据撤销成功!"
);
}
catch
(
Exception
e
)
{
...
...
src/main/webapp/HP/SC/HPSC005.js
View file @
b90a3719
...
...
@@ -32,10 +32,6 @@ $(function () {
}
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showGroupDetail(
\'
'
+
prodOrderNo
+
'
\'
)" >任务详情</a>'
;
if
(
status
>
0
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="revocation(
\'
'
+
prodOrderNo
+
'
\'
)" >撤销</a>'
;
}
if
(
filePath1
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showUploadFile('
+
filePath1
+
')" >附件</a>'
;
...
...
@@ -55,8 +51,11 @@ $(function () {
}
}
],
loadComplete
:
function
(
grid
)
{
$
(
"#BNT_REVOCA"
).
on
(
"click"
,
revocation
)
}
]
}
});
...
...
@@ -234,36 +233,38 @@ function assignChange() {
}
}
function
revocation
(
prodOrderNo
)
{
JSUtils
.
confirm
(
" 确定要撤销派工吗?"
,
{
ok
:
function
()
{
var
info
=
new
EiInfo
();
info
.
set
(
"prodOrderNo"
,
prodOrderNo
)
EiCommunicator
.
send
(
"HPSC005A"
,
"revocation"
,
info
,
{
onSuccess
:
function
(
ei
)
{
if
(
ei
.
getStatus
()
>=
0
)
{
try
{
}
catch
(
e
)
{
// TODO: handle exception
}
if
(
ei
.
getStatus
()
==
0
)
{
NotificationUtil
(
ei
,
'warning'
);
}
else
{
NotificationUtil
(
ei
);
}
query
();
}
else
{
NotificationUtil
(
ei
,
"error"
);
}
},
onFail
:
function
(
ei
)
{
// 发生异常
NotificationUtil
(
"操作失败,原因["
+
ei
+
"]"
,
"error"
);
}
});
function
revocation
()
{
let
rows
=
resultGrid
.
getCheckedRows
()
if
(
rows
.
length
<
1
)
{
message
(
"请至少选择一条需要撤销的数据"
);
return
;
}
let
flag
=
true
;
$
.
each
(
rows
,
function
(
index
,
item
)
{
if
(
item
.
status
==
0
){
message
(
`选中第
${
index
+
1
}
行的生产订单未派工,无法撤销!`
)
flag
=
false
;
return
false
;
}
});
if
(
flag
){
JSUtils
.
confirm
(
" 确定要撤销派工吗?"
,
{
ok
:
function
()
{
JSUtils
.
submitGrid
(
"result"
,
"HPSC005A"
,
"revocation"
,
{
onSuccessCallback
:
function
(
ei
){
if
(
ei
[
"status"
]
==
-
1
)
{
NotificationUtil
(
ei
,
"error"
);
}
else
{
NotificationUtil
({
msg
:
ei
.
msg
},
"success"
);
query
();
}
}
}
)
}
});
}
}
/**
...
...
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