Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
Project
Project
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
鲁鑫
topsun-bpm
Commits
404d8c98
Commit
404d8c98
authored
Jun 25, 2024
by
鲁鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购申请和采购订单审批的撤销审批功能注释;接收人改为宝绅组织下的物控人员
parent
4479574c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
44 deletions
+54
-44
sapPurchaseApprovalList.js
...iz/topsun/sap/purchaseApproval/sapPurchaseApprovalList.js
+18
-18
sapPurchaseOrderList.js
...bapp/biz/topsun/sap/purchaseOrder/sapPurchaseOrderList.js
+18
-18
SapPurchaseApprovalApplicationImpl.java
.../application/impl/SapPurchaseApprovalApplicationImpl.java
+7
-2
SapPurchaseOrderApplicationImpl.java
...der/application/impl/SapPurchaseOrderApplicationImpl.java
+11
-6
No files found.
topsun-xt/src/main/webapp/biz/topsun/sap/purchaseApproval/sapPurchaseApprovalList.js
View file @
404d8c98
...
...
@@ -11,24 +11,24 @@ function initUI() {
function
initPurchaseListGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
revokeApproveHandler
:
{
id
:
'revokeApproveHandler'
,
text
:
'撤销审批'
,
img
:
'fa-trash'
,
click
:
function
()
{
var
rows
=
purchaseApprovalGridManager
.
getSelectedRows
();
if
(
rows
.
length
==
0
||
rows
.
length
>
1
)
{
Public
.
tip
(
"请选择一条已完成的数据!"
);
return
;
}
if
(
rows
[
0
].
status
!=
3
)
{
Public
.
tip
(
"请选择一条已完成的数据!"
);
return
;
}
UICtrl
.
confirm
(
'确定要把当前单据撤销审批吗?'
,
function
()
{
Public
.
ajax
(
web_app
.
name
+
'/sapPurchaseApproval/revokeApproval.ajax'
,
{
id
:
rows
[
0
].
id
},
function
(
msg
)
{
purchaseApprovalGridManager
.
loadData
();
});
});
}
}
//
revokeApproveHandler: {
//
id: 'revokeApproveHandler', text: '撤销审批', img: 'fa-trash', click: function () {
//
var rows = purchaseApprovalGridManager.getSelectedRows();
//
if (rows.length == 0 || rows.length > 1) {
//
Public.tip("请选择一条已完成的数据!");
//
return;
//
}
//
if (rows[0].status != 3) {
//
Public.tip("请选择一条已完成的数据!");
//
return;
//
}
//
UICtrl.confirm('确定要把当前单据撤销审批吗?', function () {
//
Public.ajax(web_app.name + '/sapPurchaseApproval/revokeApproval.ajax', {id: rows[0].id}, function (msg) {
//
purchaseApprovalGridManager.loadData();
//
});
//
});
//
}
//
}
});
purchaseApprovalGridManager
=
UICtrl
.
grid
(
'#purchaseApprovalGrid'
,
{
columns
:
[
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/purchaseOrder/sapPurchaseOrderList.js
View file @
404d8c98
...
...
@@ -11,24 +11,24 @@ function initUI() {
function
loadGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
revokeApproveHandler
:
{
id
:
'revokeApproveHandler'
,
text
:
'撤销审批'
,
img
:
'fa-trash'
,
click
:
function
()
{
var
rows
=
purchaseOrderGridManager
.
getSelectedRows
();
if
(
rows
.
length
==
0
||
rows
.
length
>
1
)
{
Public
.
tip
(
"请选择一条已完成的数据!"
);
return
;
}
if
(
rows
[
0
].
status
!=
3
)
{
Public
.
tip
(
"请选择一条已完成的数据!"
);
return
;
}
UICtrl
.
confirm
(
'确定要把当前单据撤销审批吗?'
,
function
()
{
Public
.
ajax
(
web_app
.
name
+
'/sapPurchaseOrder/revokeApproval.ajax'
,
{
id
:
rows
[
0
].
id
},
function
(
msg
)
{
purchaseOrderGridManager
.
loadData
();
});
});
}
}
//
revokeApproveHandler: {
//
id: 'revokeApproveHandler', text: '撤销审批', img: 'fa-trash', click: function () {
//
var rows = purchaseOrderGridManager.getSelectedRows();
//
if (rows.length == 0 || rows.length > 1) {
//
Public.tip("请选择一条已完成的数据!");
//
return;
//
}
//
if (rows[0].status != 3) {
//
Public.tip("请选择一条已完成的数据!");
//
return;
//
}
//
UICtrl.confirm('确定要把当前单据撤销审批吗?', function () {
//
Public.ajax(web_app.name + '/sapPurchaseOrder/revokeApproval.ajax', {id: rows[0].id}, function (msg) {
//
purchaseOrderGridManager.loadData();
//
});
//
});
//
}
//
}
});
//debugger
purchaseOrderGridManager
=
UICtrl
.
grid
(
'#purchaseOrderGrid'
,
{
...
...
topsun/src/main/java/com/huigou/topsun/sap/purchaseApproval/application/impl/SapPurchaseApprovalApplicationImpl.java
View file @
404d8c98
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.cache.SystemCache
;
import
com.huigou.context.Operator
;
import
com.huigou.context.OrgUnit
;
import
com.huigou.context.ThreadLocalUtil
;
...
...
@@ -195,7 +196,7 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
SapPurchaseApproval
sapPurchaseApproval
=
sapPurchaseApprovalRepository
.
findOne
(
bizId
);
sapPurchaseApproval
.
setStatusId
(
BizBillStatus
.
APPLYING
.
getId
());
sapPurchaseApprovalRepository
.
save
(
sapPurchaseApproval
);
sendSapData
(
sapPurchaseApproval
,
"N"
);
//
sendSapData(sapPurchaseApproval,"N");
//终止
//workflowApplication.abortProcessInstance(delegateTask.getProcessInstanceId());
}
...
...
@@ -234,6 +235,10 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
//根据SAP传过来的创建人编码,映射流程发起人
String
ernam
=
purchaseApprovalVo
.
getErnam
();
Org
org
=
orgApplication
.
loadMainOrgByLoginName
(
ernam
);
String
acceptPersonCode
=
SystemCache
.
getParameter
(
"acceptPersonCode"
,
String
.
class
);
if
(
ObjectUtil
.
isNull
(
org
)){
org
=
orgApplication
.
loadMainOrgByLoginName
(
acceptPersonCode
);
}
if
(
ObjectUtil
.
isNotNull
(
org
)){
Operator
operator
=
operatorApplication
.
createOperatorByPersonMemberId
(
org
.
getId
());
ThreadLocalUtil
.
putOperator
(
operator
);
...
...
@@ -299,7 +304,7 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
}
//在审批中,更新明细数据的(先删除,再新增)
if
(
purchaseApproval
.
getStatusId
()
==
BizBillStatus
.
APPROVING
.
getId
()){
if
(
purchaseApproval
.
getStatusId
()
==
BizBillStatus
.
APPROVING
.
getId
()
||
purchaseApproval
.
getStatusId
()
==
BizBillStatus
.
APPLYING
.
getId
()
){
List
<
SapPurchaseApprovalItem
>
itemList
=
sapPurchaseApprovalItemApplication
.
querySapPurchaseApprovalItems
(
purchaseApproval
.
getId
());
List
<
String
>
collect
=
itemList
.
stream
().
map
(
SapPurchaseApprovalItem:
:
getId
).
collect
(
Collectors
.
toList
());
sapPurchaseApprovalItemApplication
.
deleteByIds
(
collect
);
...
...
topsun/src/main/java/com/huigou/topsun/sap/purchaseOrder/application/impl/SapPurchaseOrderApplicationImpl.java
View file @
404d8c98
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.util.ObjectUtil
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.cache.SystemCache
;
import
com.huigou.context.Operator
;
import
com.huigou.context.OrgUnit
;
import
com.huigou.context.ThreadLocalUtil
;
...
...
@@ -34,10 +35,7 @@ import com.huigou.uasp.bpm.FlowBroker;
import
com.huigou.uasp.bpm.ProcessAction
;
import
com.huigou.uasp.bpm.ProcessStartModel
;
import
com.huigou.uasp.bpm.engine.application.WorkflowApplication
;
import
com.huigou.util.ApplicationContextWrapper
;
import
com.huigou.util.ClassHelper
;
import
com.huigou.util.Constants
;
import
com.huigou.util.SDO
;
import
com.huigou.util.*
;
import
org.activiti.engine.delegate.DelegateExecution
;
import
org.activiti.engine.delegate.DelegateTask
;
import
org.activiti.engine.impl.persistence.entity.ExecutionEntity
;
...
...
@@ -173,7 +171,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
SapPurchaseOrder
sapPurchaseOrder
=
sapPurchaseOrderRepository
.
findOne
(
bizId
);
sapPurchaseOrder
.
setStatusId
(
BizBillStatus
.
APPLYING
.
getId
());
SapPurchaseOrder
save
=
sapPurchaseOrderRepository
.
save
(
sapPurchaseOrder
);
this
.
sendSapDate
(
save
,
"N"
);
//
this.sendSapDate(save, "N");
// 调用 onEnd 方法
// DelegateExecution execution = delegateTask.getExecution();
// onEnd(execution);
...
...
@@ -213,6 +211,10 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
BeanUtil
.
copyProperties
(
sapPurchaseOrderVo
,
sapPurchaseOrder
);
String
ernam
=
sapPurchaseOrderVo
.
getErnam
();
Org
org
=
orgApplication
.
loadMainOrgByLoginName
(
ernam
);
String
acceptPersonCode
=
SystemCache
.
getParameter
(
"acceptPersonCode"
,
String
.
class
);
if
(
ObjectUtil
.
isNull
(
org
)){
org
=
orgApplication
.
loadMainOrgByLoginName
(
acceptPersonCode
);
}
if
(
ObjectUtil
.
isNotNull
(
org
)){
Operator
operator
=
operatorApplication
.
createOperatorByPersonMemberId
(
org
.
getId
());
ThreadLocalUtil
.
putOperator
(
operator
);
...
...
@@ -230,6 +232,9 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
purchaseOrderItems
.
add
(
sapPurchaseApprovalItem
);
if
(
"X"
.
equals
(
approvalItemVo
.
getRetpo
())){
retpo
=
"X"
;
}
else
{
//审批要素不能为空,赋值E
retpo
=
"E"
;
}
}
sapPurchaseOrder
.
setRetpo
(
retpo
);
...
...
@@ -263,7 +268,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
purchaseOrderId
=
mannualStartWorkApplication
.
startWorkflow
(
sapPurchaseOrder
,
PROCESS_DEFINITION_KEY
,
"sapPurchaseOrder"
);
}
//在审批中,更新明细数据的(先删除,再新增)
if
(
purchaseOrder
.
getStatusId
()
==
BizBillStatus
.
APPROVING
.
getId
()){
if
(
purchaseOrder
.
getStatusId
()
==
BizBillStatus
.
APPROVING
.
getId
()
||
purchaseOrder
.
getStatusId
()
==
BizBillStatus
.
APPLYING
.
getId
()
){
List
<
SapPurchaseOrderItem
>
itemList
=
sapPurchaseOrderItemApplication
.
getPurchaseOrderItems
(
purchaseOrder
.
getId
());
sapPurchaseOrderItemApplication
.
deletePurchaseOrderItems
(
itemList
);
purchaseOrderId
=
purchaseOrder
.
getId
();
...
...
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