Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
9564c3f9
Commit
9564c3f9
authored
Jan 08, 2024
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
安装告知工作流信息
parent
6770ab6c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
175 additions
and
97 deletions
+175
-97
IJgInstallationNoticeService.java
...t/module/jg/api/service/IJgInstallationNoticeService.java
+2
-1
JgInstallationNoticeController.java
...ule/jg/biz/controller/JgInstallationNoticeController.java
+2
-1
PublicWorkFlowMessage.java
...os/boot/module/jg/biz/listener/PublicWorkFlowMessage.java
+73
-0
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+98
-95
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IJgInstallationNoticeService.java
View file @
9564c3f9
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
netscape.javascript.JSObject
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Map
;
...
...
@@ -58,7 +59,7 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot
* @param model 数据
* @param submitType 保存类型
*/
void
saveNotice
(
String
submitType
,
Map
<
String
,
J
gInstallationNoticeDto
>
model
,
ReginParams
reginParams
);
void
saveNotice
(
String
submitType
,
Map
<
String
,
J
SObject
>
model
,
ReginParams
reginParams
);
/**
* 打印告知单
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgInstallationNoticeController.java
View file @
9564c3f9
...
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
netscape.javascript.JSObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
...
...
@@ -46,7 +47,7 @@ public class JgInstallationNoticeController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增安装告知"
,
notes
=
"新增安装告知"
)
public
ResponseModel
<
String
>
save
(
@RequestParam
String
submitType
,
@RequestBody
Map
<
String
,
J
gInstallationNoticeDto
>
model
)
{
public
ResponseModel
<
String
>
save
(
@RequestParam
String
submitType
,
@RequestBody
Map
<
String
,
J
SObject
>
model
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
iJgInstallationNoticeService
.
saveNotice
(
submitType
,
model
,
reginParams
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/listener/PublicWorkFlowMessage.java
0 → 100644
View file @
9564c3f9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
listener
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeServiceImpl
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
javax.annotation.PostConstruct
;
import
java.util.List
;
@Slf4j
@Component
public
class
PublicWorkFlowMessage
extends
EmqxListener
{
@Autowired
protected
EmqKeeper
emqKeeper
;
/**
* 创建任务主题
*/
public
static
final
String
WORKFLOW_TASK_CREATED
=
"workflow/task/created"
;
/**
* 执行完成任务主题
*/
public
static
final
String
WORKFLOW_TASK_COMPLETED
=
"workflow/task/completed"
;
// /**
// * 流程执行结束主题
// */
// public static final String WORKFLOW_PROCESS_COMPLETE = "workflow/process/complete";
@Autowired
private
JgInstallationNoticeServiceImpl
jgInstallationNoticeService
;
@PostConstruct
void
init
()
throws
Exception
{
emqKeeper
.
subscript
(
WORKFLOW_TASK_CREATED
,
2
,
this
);
emqKeeper
.
subscript
(
WORKFLOW_TASK_COMPLETED
,
2
,
this
);
// emqKeeper.subscript(WORKFLOW_PROCESS_COMPLETE, 2, this);
}
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
JSONObject
messageObject
=
JSON
.
parseObject
(
new
String
(
message
.
getPayload
()));
String
businessKey
=
messageObject
.
get
(
"businessKey"
).
toString
();
String
[]
s
=
businessKey
.
split
(
"_"
);
String
businessId
=
s
[
0
];
String
type
=
s
[
1
];
messageObject
.
put
(
"businessId"
,
businessId
);
if
(
topic
.
equals
(
WORKFLOW_TASK_CREATED
))
{
if
(
"installationNotice"
.
equals
(
type
))
{
jgInstallationNoticeService
.
updateByWorkFlow
(
messageObject
);
}
}
else
if
(
topic
.
equals
(
WORKFLOW_TASK_COMPLETED
))
{
if
(
"installationNotice"
.
equals
(
type
))
{
jgInstallationNoticeService
.
completeWorkFlow
(
messageObject
);
}
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
View file @
9564c3f9
...
...
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
...
...
@@ -40,6 +41,7 @@ import com.yeejoin.amos.feign.workflow.model.AjaxResult;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
fr.opensagres.xdocreport.core.io.IOUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
netscape.javascript.JSObject
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -419,10 +421,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Override
@SuppressWarnings
({
"Duplicates"
,
"rawtypes"
})
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
saveNotice
(
String
submitType
,
Map
<
String
,
J
gInstallationNoticeDto
>
jgInstallationNoticeDtoMap
,
ReginParams
reginParams
)
{
public
void
saveNotice
(
String
submitType
,
Map
<
String
,
J
SObject
>
jgInstallationNoticeDtoMap
,
ReginParams
reginParams
)
{
String
[]
taskName
=
new
String
[]{
"流程结束"
};
JgInstallationNoticeDto
model
=
jgInstallationNoticeDtoMap
.
get
(
TABLE_PAGE_ID
);
JgInstallationNoticeDto
model
=
JSON
.
parseObject
(
jgInstallationNoticeDtoMap
.
get
(
TABLE_PAGE_ID
).
toString
(),
JgInstallationNoticeDto
.
class
);
// 字段转换
convertField
(
model
);
...
...
@@ -444,66 +446,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
throw
new
BadRequest
(
"告知单生成失败!"
);
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListSecond
=
new
ArrayList
<>();
// 判断当前是否为提交
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
// 发起流程
// ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
deviceList
.
size
()
;
i
++
)
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
i
));
// dto.setCompleteFirstTask(true);
list
.
add
(
dto
);
}
actWorkflowBatchDTO
.
setProcess
(
list
);
try
{
FeignClientResult
result
=
Workflow
.
taskV2Client
.
startByVariableBatch
(
actWorkflowBatchDTO
);
List
<
Object
>
returnList
=
(
List
<
Object
>)
result
.
getResult
();
for
(
Object
obj
:
returnList
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
instanceId
=
jsonObject
.
getString
(
"id"
);
instanceIdList
.
add
(
instanceId
);
// 查询下节点任务
if
(
returnList
.
get
(
0
).
equals
(
obj
))
{
getNext
(
roleListFirst
,
instanceId
,
taskName
);
}
// 推动下一个节点
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskId
=
dataObject
.
getString
(
"id"
);
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setTaskId
(
taskId
);
dto
.
setComment
(
""
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
"0"
);
dto
.
setVariable
(
map
);
//执行流程
AjaxResult
ajaxResult1
=
null
;
try
{
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
if
(
ajaxResult1
.
get
(
"code"
).
equals
(
200
))
{
getNext
(
roleListSecond
,
instanceId
,
taskName
);
}
else
{
log
.
error
(
"提交失败"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
}
List
<
JgInstallationNotice
>
list
=
new
ArrayList
<>();
List
<
JgInstallationNoticeEq
>
equipList
=
new
ArrayList
<>();
...
...
@@ -516,10 +458,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
dto
.
setApplyNo
(
applyNo
);
dto
.
setNoticeDate
(
new
Date
());
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
dto
.
setNextExecuteIds
(
String
.
join
(
","
,
roleListSecond
));
dto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
dto
.
set
Status
(
taskName
[
0
]
);
dto
.
set
NoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
())
);
}
dto
.
setInstallUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
dto
.
setInstallUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
...
...
@@ -530,44 +470,59 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
dto
.
setEquAddress
(
buffer
.
toString
());
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
applyNo
);
if
(!
CollectionUtils
.
isEmpty
(
instanceIdList
))
{
dto
.
setInstanceId
(
instanceIdList
.
get
(
i
));
dto
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
}
else
{
dto
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
()));
}
list
.
add
(
dto
);
equipList
.
add
(
jgRelationEquip
);
});
jgInstallationNoticeMapper
.
insertBatchSomeColumn
(
list
);
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
workflowStartDTOS
=
new
ArrayList
<>();
list
.
forEach
(
item
->
{
// 代办业务
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
TaskV2Model
taskV2Model
=
new
TaskV2Model
();
//获取待办任务执行人
List
<
AgencyUserModel
>
userList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
item
.
getNextExecuteIds
(),
null
,
Boolean
.
FALSE
).
getResult
();
List
<
String
>
userIds
=
userList
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
taskV2Model
.
setExecuteUserIds
(
CollectionUtils
.
isEmpty
(
userIds
)?
""
:
String
.
join
(
","
,
userIds
));
taskV2Model
.
setExtras
(
JSON
.
toJSONString
(
item
));
taskV2Model
.
setRelationId
(
item
.
getInstanceId
());
Map
<
String
,
Object
>
userOrgRoleMap
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
userOrgRoleClient
.
getme
());
List
<
String
>
userOrgRoleList
=
(
List
<
String
>)
userOrgRoleMap
.
get
(
"roleId"
);
String
roleIds
=
String
.
join
(
","
,
userOrgRoleList
);
taskV2Model
.
setTaskType
(
"installNotice"
);
taskV2Model
.
setTaskTypeLabel
(
"安装告知"
);
String
url
=
getUrl
(
taskV2Model
.
getTaskType
(),
"look"
);
String
format
=
String
.
format
(
url
,
item
.
getSequenceNbr
(),
item
.
getNextExecuteIds
(),
item
.
getNextExecuteIds
(),
item
.
getNoticeStatus
(),
item
.
getInstanceId
());
taskV2Model
.
setRoutePath
(
format
);
taskV2Model
.
setTaskTitle
(
item
.
getStatus
());
taskV2Model
.
setTaskName
(
item
.
getStatus
());
taskV2Model
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
taskV2Model
.
setTaskStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskV2Model
.
setTaskCode
(
item
.
getApplyNo
());
buildTaskModel
(
taskV2Model
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
// 发起流程
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
item
.
getSequenceNbr
()
+
"_"
+
"installationNotice"
);
dto
.
setCompleteFirstTask
(
Boolean
.
TRUE
);
workflowStartDTOS
.
add
(
dto
);
}
});
try
{
actWorkflowBatchDTO
.
setProcess
(
workflowStartDTOS
);
Workflow
.
taskV2Client
.
startByVariableBatch
(
actWorkflowBatchDTO
);
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
// list.forEach(item -> {
// // 代办业务
// if(SUBMIT_TYPE_FLOW.equals(submitType)) {
// TaskV2Model taskV2Model = new TaskV2Model();
// //获取待办任务执行人
// List<AgencyUserModel> userList = Privilege.agencyUserClient
// .queryByRoleId(item.getNextExecuteIds(), null,Boolean.FALSE).getResult();
// List<String> userIds = userList.stream().map(AgencyUserModel::getUserId).collect(Collectors.toList());
// taskV2Model.setExecuteUserIds(CollectionUtils.isEmpty(userIds)?"": String.join(",", userIds));
// taskV2Model.setExtras(JSON.toJSONString(item));
// taskV2Model.setRelationId(item.getInstanceId());
// Map<String, Object> userOrgRoleMap = FeignUtil.remoteCall(() -> Privilege.userOrgRoleClient.getme());
// List<String> userOrgRoleList = (List<String>) userOrgRoleMap.get("roleId");
// String roleIds = String.join(",", userOrgRoleList);
// taskV2Model.setTaskType("installNotice");
// taskV2Model.setTaskTypeLabel("安装告知");
// String url = getUrl(taskV2Model.getTaskType(), "look");
// String format = String.format(url, item.getSequenceNbr(), item.getNextExecuteIds(), item.getNextExecuteIds(), item.getNoticeStatus(), item.getInstanceId());
// taskV2Model.setRoutePath(format);
// taskV2Model.setTaskTitle(item.getStatus());
// taskV2Model.setTaskName(item.getStatus());
// taskV2Model.setTaskStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode());
// taskV2Model.setTaskStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName());
// taskV2Model.setTaskCode(item.getApplyNo());
// buildTaskModel(taskV2Model);
// }
// });
List
<
JgInstallationNoticeEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
{
List
<
JgInstallationNotice
>
collect
=
list
.
stream
().
filter
(
jgInstallationNotice
->
jgRelationEquip
.
getEquipTransferId
().
equals
(
jgInstallationNotice
.
getApplyNo
())).
collect
(
Collectors
.
toList
());
...
...
@@ -964,4 +919,51 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
return
url
;
}
public
void
updateByWorkFlow
(
JSONObject
jsonObject
)
{
JgInstallationNotice
jgInstallationNotice
=
this
.
getById
(
jsonObject
.
get
(
"businessId"
).
toString
());
List
<
String
>
list
=
(
List
<
String
>)
jsonObject
.
get
(
"candidateGroups"
);
jgInstallationNotice
.
setInstanceId
(
jsonObject
.
get
(
"processInstanceId"
).
toString
());
jgInstallationNotice
.
setNextExecuteIds
(
String
.
join
(
","
,
list
));
jgInstallationNotice
.
setInstanceStatus
(
jgInstallationNotice
.
getInstanceStatus
()
+
","
+
String
.
join
(
","
,
list
));
jgInstallationNotice
.
setStatus
(
jsonObject
.
get
(
"nodeName"
).
toString
());
this
.
updateById
(
jgInstallationNotice
);
// 代办业务
TaskV2Model
taskV2Model
=
new
TaskV2Model
();
//获取待办任务执行人
List
<
AgencyUserModel
>
userList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
jgInstallationNotice
.
getNextExecuteIds
(),
null
,
Boolean
.
FALSE
).
getResult
();
List
<
String
>
userIds
=
userList
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
taskV2Model
.
setExecuteUserIds
(
CollectionUtils
.
isEmpty
(
userIds
)?
""
:
String
.
join
(
","
,
userIds
));
taskV2Model
.
setExtras
(
JSON
.
toJSONString
(
jgInstallationNotice
));
taskV2Model
.
setRelationId
(
jgInstallationNotice
.
getInstanceId
());
taskV2Model
.
setTaskType
(
"installNotice"
);
taskV2Model
.
setTaskTypeLabel
(
"安装告知"
);
String
url
=
getUrl
(
taskV2Model
.
getTaskType
(),
"look"
);
String
format
=
String
.
format
(
url
,
jgInstallationNotice
.
getSequenceNbr
(),
jgInstallationNotice
.
getNextExecuteIds
(),
jgInstallationNotice
.
getNextExecuteIds
(),
jgInstallationNotice
.
getNoticeStatus
(),
jgInstallationNotice
.
getInstanceId
());
taskV2Model
.
setRoutePath
(
format
);
taskV2Model
.
setTaskTitle
(
jgInstallationNotice
.
getStatus
());
taskV2Model
.
setTaskName
(
jgInstallationNotice
.
getStatus
());
taskV2Model
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
taskV2Model
.
setTaskStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskV2Model
.
setTaskCode
(
jgInstallationNotice
.
getApplyNo
());
buildTaskModel
(
taskV2Model
);
}
public
void
completeWorkFlow
(
JSONObject
jsonObject
)
{
JgInstallationNotice
jgInstallationNotice
=
this
.
getById
(
jsonObject
.
get
(
"businessId"
).
toString
());
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
jgInstallationNotice
.
getInstanceId
()).
getResult
();
TaskV2Model
model
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getCreateDate
().
compareTo
(
r1
.
getCreateDate
()))
// 按时间降序排序
.
findFirst
()
.
orElse
(
null
);
// model.setTaskStatus(Integer.valueOf(jsonObject.get("nodeName").toString()));
model
.
setRoutePath
(
model
.
getRoutePath
().
replace
(
"nextExecuteIds"
,
"nextExecuteIdsOld"
));
model
.
setTaskStatusLabel
(
jsonObject
.
get
(
"nodeName"
).
toString
());
model
.
setEndDate
(
new
Date
());
model
.
setFinishStatus
(
Boolean
.
TRUE
);
JSONObject
userJson
=
JSON
.
parseObject
(
jsonObject
.
get
(
"user"
).
toString
());
model
.
setEndUserId
(
userJson
.
get
(
"userId"
).
toString
());
Systemctl
.
taskV2Client
.
update
(
model
,
model
.
getSequenceNbr
());
}
}
\ No newline at end of file
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