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
cd6434a7
Commit
cd6434a7
authored
Sep 24, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-09-24 生产订单增加撤销派工功能
parent
2a121af0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
6 deletions
+74
-6
ServiceHGSC006A.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC006A.java
+21
-4
HGSCTools.java
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
+12
-2
HGSC006A.js
src/main/webapp/HG/SC/HGSC006A.js
+41
-0
No files found.
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC006A.java
View file @
cd6434a7
...
...
@@ -13,10 +13,7 @@ import com.baosight.hggp.hg.sc.domain.HGSC007;
import
com.baosight.hggp.hg.sc.domain.HGSC008
;
import
com.baosight.hggp.hg.sc.tools.HGSCTools
;
import
com.baosight.hggp.hg.sc.util.HgScUtils
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.BeanUtils
;
import
com.baosight.hggp.util.CommonMethod
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.*
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
...
...
@@ -161,6 +158,26 @@ public class ServiceHGSC006A extends ServiceBase {
return
inInfo
;
}
public
EiInfo
revocation
(
EiInfo
inInfo
){
try
{
List
<
HGSC006A
>
hgsc006aList
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGSC006A
.
class
);
List
<
Long
>
orderIds
=
hgsc006aList
.
stream
().
map
(
HGSC006A:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
HGSC007
>
hgsc007List
=
HGSCTools
.
THGSC007
.
listByOrderDetailId
(
orderIds
);
if
(
hgsc007List
.
size
()
>
0
)
{
List
<
Long
>
taskIds
=
hgsc007List
.
stream
().
map
(
HGSC007:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
HGSC008
>
hgsc008List
=
HGSCTools
.
THGSC008
.
getByTaskId
(
taskIds
);
AssertUtils
.
isNotEmpty
(
hgsc008List
,
"生产任务存在已报工,撤回失败!"
);
hgsc007List
.
forEach
(
hgsc007
->
DaoUtils
.
update
(
HGSC007
.
DELETE
,
hgsc007
));
}
hgsc006aList
.
forEach
(
HGSCTools
.
THGSC006A
::
revocation
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
hgsc006aList
.
size
()
+
"]条数据撤回成功!"
);
}
catch
(
Exception
e
){
LogUtils
.
setMsg
(
inInfo
,
e
,
"撤销失败"
);
}
return
inInfo
;
}
private
void
cleanBaseInfo
(
HGSC007
hgsc007
){
hgsc007
.
setCreatedBy
(
null
);
hgsc007
.
setCreatedName
(
null
);
...
...
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
View file @
cd6434a7
...
...
@@ -1522,6 +1522,16 @@ public class HGSCTools {
List
<
HGSC006A
>
results
=
DaoBase
.
getInstance
().
query
(
HGSC006A
.
QUERY_OTHER
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
public
static
void
revocation
(
HGSC006A
hgsc006a
)
{
AssertUtils
.
isTrue
(
Objects
.
isNull
(
hgsc006a
)
||
Objects
.
isNull
(
hgsc006a
.
getId
())
||
hgsc006a
.
getId
()
<=
0
,
"生产订单明细ID不能为空!"
);
hgsc006a
.
setAssignStatus
(
UNASSIGN
.
getCode
());
hgsc006a
.
setAssignQuantity
(
BigDecimal
.
ZERO
);
hgsc006a
.
setAssignWeight
(
BigDecimal
.
ZERO
);
hgsc006a
.
setUnassignQuantity
(
hgsc006a
.
getQuantity
());
hgsc006a
.
setUnassignWeight
(
hgsc006a
.
getTotalWeight
());
DaoBase
.
getInstance
().
update
(
HGSC006A
.
UPDATE
,
hgsc006a
);
}
}
/**
...
...
@@ -1577,7 +1587,7 @@ public class HGSCTools {
* @param orderDetailIds
* @return
*/
public
static
List
<
HGSC007
>
listByOrderDetailId
(
List
<
String
>
orderDetailIds
)
{
public
static
List
<
HGSC007
>
listByOrderDetailId
(
List
orderDetailIds
)
{
if
(
CollectionUtils
.
isEmpty
(
orderDetailIds
))
{
return
null
;
}
...
...
@@ -1585,7 +1595,7 @@ public class HGSCTools {
queryMap
.
put
(
"orderDetailIds"
,
orderDetailIds
);
return
DaoBase
.
getInstance
().
query
(
HGSC007
.
QUERY
,
queryMap
);
}
}
/**
...
...
src/main/webapp/HG/SC/HGSC006A.js
View file @
cd6434a7
...
...
@@ -28,6 +28,8 @@ $(function () {
$
(
"#BNT_ASSIGN"
).
on
(
"click"
,
assign
);
// 批量改派
$
(
"#BNT_ASSIGN_CHANGE"
).
on
(
"click"
,
assignChange
);
$
(
"#BNT_REVOCA"
).
on
(
"click"
,
revocate
)
},
onSuccess
:
function
(
e
)
{
if
(
e
.
eiInfo
.
extAttr
.
methodName
==
'save'
||
e
.
eiInfo
.
extAttr
.
methodName
==
'delete'
){
...
...
@@ -114,6 +116,9 @@ function assign() {
}
}
/**
* 批量改派
*/
function
assignChange
()
{
//重置全局变量
ids
=
[];
...
...
@@ -175,6 +180,42 @@ function assignChange() {
}
}
/**
* 撤销派工
*/
let
revocate
=
function
()
{
//重置全局变量
let
rows
=
resultGrid
.
getCheckedRows
()
if
(
rows
.
length
<
1
)
{
message
(
"请至少选择一条需要撤销的数据"
);
return
;
}
let
flag
=
true
;
$
.
each
(
rows
,
function
(
index
,
item
)
{
if
(
item
.
assignStatus
==
0
){
message
(
`选中第
${
index
+
1
}
行的生产订单未派工,无法撤销!`
)
flag
=
false
;
return
false
;
}
});
if
(
flag
)
{
JSUtils
.
confirm
(
"确定撤销派工?"
,
{
ok
:
function
()
{
JSUtils
.
submitGrid
(
"result"
,
"HGSC006A"
,
"revocation"
,
{
onSuccessCallback
:
function
(
ei
){
if
(
ei
[
"status"
]
==
-
1
)
{
NotificationUtil
(
ei
,
"error"
);
}
else
{
NotificationUtil
({
msg
:
ei
.
msg
},
"success"
);
query
();
}
}}
)
}
})
}
};
function
separateAssign
(
orderDetailId
){
JSColorbox
.
open
({
...
...
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