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
44424c15
Commit
44424c15
authored
Jan 25, 2024
by
wanghang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务流转
parent
04f2a44b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
62 deletions
+45
-62
TasksExecute.js
huigou-xt/src/main/webapp/system/taskCenter/TasksExecute.js
+1
-0
BsnMessageApplicationImpl.java
...bsnMessage/appliction/impl/BsnMessageApplicationImpl.java
+43
-43
SapPurchaseOrderApplicationImpl.java
...der/application/impl/SapPurchaseOrderApplicationImpl.java
+1
-19
No files found.
huigou-xt/src/main/webapp/system/taskCenter/TasksExecute.js
View file @
44424c15
...
...
@@ -12,6 +12,7 @@ function bindTaskEvent() {
$
(
"#trackTaskContent"
).
on
(
'click'
,
function
(
e
)
{
var
$clicked
=
$
(
e
.
target
||
e
.
srcElement
);
if
(
$clicked
.
is
(
'a.aLink'
))
{
debugger
var
taskId
=
$clicked
.
attr
(
'taskId'
);
$clicked
=
$
(
'#task_'
+
taskId
);
showTrackingTask
(
$clicked
.
attr
(
'taskId'
),
$clicked
.
attr
(
'bizId'
),
$clicked
.
attr
(
'name'
),
$clicked
.
attr
(
'url'
));
...
...
topsun/src/main/java/com/huigou/topsun/base/bsnMessage/appliction/impl/BsnMessageApplicationImpl.java
View file @
44424c15
...
...
@@ -14,10 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.data.domain.Sort
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -38,7 +35,9 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
public
String
keepTasks
(
BsnMessageSponsor
bsnMessageSponsor
)
{
//删除对应表单已有的任务
BsnMessageSponsor
sponsor
=
this
.
getSponsorByBId
(
bsnMessageSponsor
.
getBusinessId
());
if
(
sponsor
!=
null
){
if
(
sponsor
!=
null
)
{
BsnMessageExecute
systemExecute
=
this
.
getSystemExecuteByMsId
(
sponsor
.
getId
());
sponsor
.
addExecute
(
systemExecute
);
this
.
deleteBsnMessageSponsor
(
sponsor
);
}
//封装任务发布人自己的审批任务
...
...
@@ -55,18 +54,22 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
@Override
public
void
publishTasks
(
String
bId
)
{
BsnMessageSponsor
sponsor
=
messageSponsorRepository
.
findByBusinessId
(
bId
);
if
(
sponsor
==
null
)
{
if
(
sponsor
==
null
)
{
throw
new
RuntimeException
(
"不存在该业务"
);
}
List
<
BsnMessageExecute
>
executes
=
this
.
getExecutesByMsId
(
sponsor
.
getId
());
this
.
updateActiveStatus
(
executes
,
ActiveStatus
.
UNFINISHED
.
getValue
());
for
(
BsnMessageExecute
execute
:
executes
)
{
execute
.
setActive
(
ActiveStatus
.
UNFINISHED
.
getValue
());
}
this
.
saveBsnMessageExecute
(
executes
);
}
@Override
public
void
keepAndPublishTasks
(
BsnMessageSponsor
bsnMessageSponsor
)
{
this
.
updateActiveStatus
(
bsnMessageSponsor
.
getExecutes
(),
ActiveStatus
.
UNFINISHED
.
getValue
());
for
(
BsnMessageExecute
execute
:
bsnMessageSponsor
.
getExecutes
())
{
execute
.
setActive
(
ActiveStatus
.
UNFINISHED
.
getValue
());
}
this
.
keepTasks
(
bsnMessageSponsor
);
}
...
...
@@ -74,14 +77,16 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
public
void
authorizeTasks
(
String
bId
)
{
BsnMessageSponsor
sponsor
=
this
.
getSponsorByBId
(
bId
);
sponsor
.
setStatus
(
2
);
this
.
updateActiveStatus
(
sponsor
.
getExecutes
(),
ActiveStatus
.
FINISHED
.
getValue
());
for
(
BsnMessageExecute
execute
:
sponsor
.
getExecutes
())
{
execute
.
setActive
(
ActiveStatus
.
FINISHED
.
getValue
());
}
this
.
saveBsnMessageSponsor
(
sponsor
);
}
@Override
public
void
rejectTasks
(
Map
<
String
,
Object
>
exMap
,
String
bId
)
{
public
void
rejectTasks
(
Map
<
String
,
Object
>
exMap
,
String
bId
)
{
BsnMessageSponsor
sponsor
=
this
.
getSponsorByBId
(
bId
);
if
(
sponsor
!=
null
)
{
if
(
sponsor
!=
null
)
{
List
<
BsnMessageExecute
>
brotherExecuteAll
=
sponsor
.
getExecutes
();
Map
<
String
,
BsnMessageExecute
>
executeMap
=
new
HashMap
<>();
Date
date
=
new
Date
();
...
...
@@ -126,12 +131,12 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
// @Override
public
Map
<
String
,
Object
>
circulate
(
String
meId
)
{
BsnMessageExecute
execute
=
this
.
getExecuteByMeId
(
meId
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"deptCode"
,
execute
.
getBusinessCode
());
paramMap
.
put
(
"active"
,
execute
.
getActive
());
paramMap
.
put
(
"meId"
,
execute
.
getId
());
paramMap
.
put
(
"isReadOnly"
,
"false"
);
if
(
"system"
.
equals
(
execute
.
getBusinessCode
()))
{
paramMap
.
put
(
"active"
,
execute
.
getActive
());
paramMap
.
put
(
"meId"
,
execute
.
getId
());
paramMap
.
put
(
"isReadOnly"
,
"false"
);
if
(
"system"
.
equals
(
execute
.
getBusinessCode
()))
{
//获取该业务流程下其他执行部门
List
<
BsnMessageExecute
>
executeAll
=
this
.
getExecutesByMsId
(
execute
.
getMessageSponsorId
());
Map
<
String
,
String
>
map
=
executeAll
.
stream
()
...
...
@@ -150,7 +155,7 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
queryModel
.
setPageSize
(
10
);
queryModel
.
setSortFieldName
(
"updateDate"
);
queryModel
.
setSortOrder
(
"desc"
);
queryModel
.
putParam
(
"taskExecute"
,
this
.
getOperator
().
getUserId
());
queryModel
.
putParam
(
"taskExecute"
,
this
.
getOperator
().
getUserId
());
queryModel
.
putParam
(
"addText"
,
"[驳回]"
);
return
this
.
sqlExecutorDao
.
executeSlicedQuery
(
queryModel
);
}
...
...
@@ -158,34 +163,35 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
@Override
public
List
<
BsnMessageSponsor
>
queryFinishBsnMessageSponsor
()
{
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"queryFinishBsnMessageSponsor"
);
return
this
.
sqlExecutorDao
.
queryToList
(
queryDescriptor
.
getSql
(),
BsnMessageSponsor
.
class
,
this
.
getOperator
().
getUserId
());
return
this
.
sqlExecutorDao
.
queryToList
(
queryDescriptor
.
getSql
(),
BsnMessageSponsor
.
class
,
this
.
getOperator
().
getUserId
());
}
@Override
public
BsnMessageExecute
isExecutesReady
(
String
msId
)
{
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"queryIsExecutesReady"
);
return
this
.
sqlExecutorDao
.
queryToObject
(
queryDescriptor
.
getSql
(),
BsnMessageExecute
.
class
,
msId
,
msId
);
return
this
.
sqlExecutorDao
.
queryToObject
(
queryDescriptor
.
getSql
(),
BsnMessageExecute
.
class
,
msId
,
msId
);
}
public
String
saveBsnMessageSponsor
(
BsnMessageSponsor
entity
){
public
String
saveBsnMessageSponsor
(
BsnMessageSponsor
entity
)
{
String
keyId
=
messageSponsorRepository
.
save
(
entity
).
getId
();
if
(
isNotEmpty
(
entity
.
getExecutes
()))
{
entity
.
getExecutes
().
forEach
(
item
->
item
.
setMessageSponsorId
(
keyId
));
if
(
isNotEmpty
(
entity
.
getExecutes
()))
{
entity
.
getExecutes
().
forEach
(
item
->
item
.
setMessageSponsorId
(
keyId
));
messageExecuteRepository
.
save
(
entity
.
getExecutes
());
}
return
keyId
;
}
public
void
saveBsnMessageExecute
(
List
<
BsnMessageExecute
>
all
){
public
void
saveBsnMessageExecute
(
List
<
BsnMessageExecute
>
all
)
{
messageExecuteRepository
.
save
(
all
);
}
public
String
saveBsnMessageExecute
(
BsnMessageExecute
entity
){
public
String
saveBsnMessageExecute
(
BsnMessageExecute
entity
)
{
String
keyId
=
messageExecuteRepository
.
save
(
entity
).
getId
();
if
(
isNotEmpty
(
entity
.
getRejects
()))
{
entity
.
getRejects
().
forEach
(
item
->
item
.
setBsnExecuteId
(
keyId
));
if
(
isNotEmpty
(
entity
.
getRejects
()))
{
entity
.
getRejects
().
forEach
(
item
->
item
.
setBsnExecuteId
(
keyId
));
messageRejectRepository
.
save
(
entity
.
getRejects
());
}
return
keyId
;
...
...
@@ -193,7 +199,7 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
public
void
deleteBsnMessageSponsor
(
BsnMessageSponsor
entity
)
{
if
(
isNotEmpty
(
entity
.
getExecutes
()))
{
if
(
isNotEmpty
(
entity
.
getExecutes
()))
{
messageExecuteRepository
.
delete
(
entity
.
getExecutes
());
}
messageSponsorRepository
.
delete
(
entity
);
...
...
@@ -202,14 +208,17 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
/**
* 获取流程下的执行人,不含审批任务
*
* @param msId
* @return
*/
public
List
<
BsnMessageExecute
>
getExecutesByMsId
(
String
msId
)
{
List
<
BsnMessageExecute
>
exList
=
messageExecuteRepository
.
findAllByMessageSponsorId
(
msId
);
for
(
BsnMessageExecute
execute
:
exList
)
{
if
(
"system"
.
equals
(
execute
.
getBusinessCode
())){
exList
.
remove
(
execute
);
List
<
BsnMessageExecute
>
exList
=
messageExecuteRepository
.
findAllByMessageSponsorId
(
msId
);
Iterator
<
BsnMessageExecute
>
iterator
=
exList
.
iterator
();
while
(
iterator
.
hasNext
())
{
BsnMessageExecute
execute
=
iterator
.
next
();
if
(
"system"
.
equals
(
execute
.
getBusinessCode
()))
{
iterator
.
remove
();
}
}
return
exList
;
...
...
@@ -229,14 +238,14 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
@Override
public
List
<
BsnMessageReject
>
getRejectDetail
(
String
meId
)
{
Sort
sort
=
new
Sort
(
Sort
.
Direction
.
DESC
,
"rejectDate"
);
return
messageRejectRepository
.
findAllByBsnExecuteId
(
meId
,
sort
);
return
messageRejectRepository
.
findAllByBsnExecuteId
(
meId
,
sort
);
}
public
BsnMessageSponsor
getSponsorByBId
(
String
bId
)
{
BsnMessageSponsor
sponsor
=
messageSponsorRepository
.
findByBusinessId
(
bId
);
if
(
sponsor
!=
null
)
{
List
<
BsnMessageExecute
>
executeList
=
this
.
getExecutesByMsId
(
sponsor
.
getId
());
if
(
sponsor
!=
null
)
{
List
<
BsnMessageExecute
>
executeList
=
this
.
getExecutesByMsId
(
sponsor
.
getId
());
sponsor
.
setExecutes
(
executeList
);
}
return
sponsor
;
...
...
@@ -246,13 +255,4 @@ public class BsnMessageApplicationImpl extends BaseApplication implements BsnMes
return
list
!=
null
&&
!
list
.
isEmpty
();
}
public
void
updateActiveStatus
(
List
<
BsnMessageExecute
>
executes
,
Integer
status
)
{
//将除审批任务外状态为保存未分发的全部修改
for
(
BsnMessageExecute
execute
:
executes
)
{
if
(!
"system"
.
equals
(
execute
.
getBusinessCode
())){
execute
.
setActive
(
status
);
}
}
}
}
topsun/src/main/java/com/huigou/topsun/sap/purchaseOrder/application/impl/SapPurchaseOrderApplicationImpl.java
View file @
44424c15
...
...
@@ -5,15 +5,10 @@ import com.fasterxml.jackson.core.type.TypeReference;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.context.Operator
;
import
com.huigou.context.OrgUnit
;
import
com.huigou.context.ThreadLocalUtil
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.topsun.sap.common.DefaultHttpClient
;
import
com.huigou.topsun.sap.purchaseApproval.application.SapPurchaseApprovalApplication
;
import
com.huigou.topsun.sap.purchaseApproval.application.impl.SapPurchaseApprovalApplicationImpl
;
import
com.huigou.topsun.sap.purchaseApproval.domain.SapPurchaseApproval
;
import
com.huigou.topsun.sap.purchaseApproval.domain.SapPurchaseApprovalItem
;
import
com.huigou.topsun.sap.purchaseApproval.domain.vo.SapPurchaseApprovalItemVo
;
import
com.huigou.topsun.sap.purchaseOrder.application.SapPurchaseOrderApplication
;
import
com.huigou.topsun.sap.purchaseOrder.application.SapPurchaseOrderItemApplication
;
import
com.huigou.topsun.sap.purchaseOrder.domain.SapPurchaseOrder
;
...
...
@@ -23,32 +18,19 @@ import com.huigou.topsun.sap.purchaseOrder.domain.vo.SapPurchaseOrderDto;
import
com.huigou.topsun.sap.purchaseOrder.domain.vo.SapPurchaseOrderItemVo
;
import
com.huigou.topsun.sap.purchaseOrder.domain.vo.SapPurchaseOrderVo
;
import
com.huigou.topsun.sap.purchaseOrder.repository.SapPurchaseOrderRepository
;
import
com.huigou.topsun.sap.statsIndicators.domain.SapStatsIndicators
;
import
com.huigou.topsun.sap.statsIndicators.domain.SapStatsIndicatorsDetail
;
import
com.huigou.topsun.sap.statsIndicators.domain.SapStatsIndicatorsResult
;
import
com.huigou.topsun.util.MyBaseUtil
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bmp.operator.OperatorApplication
;
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.ClassHelper
;
import
com.huigou.util.Constants
;
import
com.huigou.util.SDO
;
import
org.activiti.engine.delegate.DelegateExecution
;
import
org.activiti.engine.delegate.DelegateTask
;
import
org.activiti.engine.runtime.ProcessInstance
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
* @Auther: xin.lu
...
...
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