!112 fix(fixcontact): 修复归档网关缺省值、撤回回写状态及删除清理关联流程
Merge pull request !112 from wsm/fix/fix_contact_20260806
This commit is contained in:
+32
-3
@@ -133,6 +133,7 @@ public class FixedContact20260730Controller extends JeecgController<FixedContact
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
fixedContact20260730Service.delMain(id);
|
||||
terminateRelatedProcess(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@@ -141,7 +142,13 @@ public class FixedContact20260730Controller extends JeecgController<FixedContact
|
||||
@RequiresPermissions("bg.fixcontact:fixed_contact_20260730:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.fixedContact20260730Service.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
String[] idArr = ids.split(",");
|
||||
this.fixedContact20260730Service.delBatchMain(Arrays.asList(idArr));
|
||||
for (String id : idArr) {
|
||||
if (oConvertUtils.isNotEmpty(id)) {
|
||||
terminateRelatedProcess(id);
|
||||
}
|
||||
}
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -274,6 +281,29 @@ public class FixedContact20260730Controller extends JeecgController<FixedContact
|
||||
log.warn("【定点联系-删除关联流程】未找到关联流程, businessId: {}", id);
|
||||
return Result.error("未找到关联流程");
|
||||
}
|
||||
terminateRelatedProcess(id);
|
||||
FixedContact20260730 record = fixedContact20260730Service.getById(id);
|
||||
if (record != null) {
|
||||
FixedContact20260730 reset = new FixedContact20260730();
|
||||
reset.setId(id);
|
||||
reset.setBpmStatus(BpmStatus.NOT_START.getCode());
|
||||
fixedContact20260730Service.updateById(reset);
|
||||
log.info("【定点联系-删除关联流程】撤回后回写业务表单流程状态, businessId: {}, bpmStatus: {}",
|
||||
id, BpmStatus.NOT_START.getCode());
|
||||
}
|
||||
return Result.OK("删除关联流程成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 终止业务记录关联的运行中流程实例,并软删除关联的 taskTask 记录
|
||||
*/
|
||||
private void terminateRelatedProcess(String businessId) {
|
||||
LambdaQueryWrapper<TaskTask> queryWrapper = new LambdaQueryWrapper<TaskTask>()
|
||||
.eq(TaskTask::getBusinessId, businessId);
|
||||
List<TaskTask> taskTaskList = taskTaskServiceImpl.list(queryWrapper);
|
||||
if (taskTaskList == null || taskTaskList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (TaskTask taskTask : taskTaskList) {
|
||||
if (taskTask.getProcessInstId() != null) {
|
||||
long count = runtimeService.createProcessInstanceQuery()
|
||||
@@ -281,7 +311,7 @@ public class FixedContact20260730Controller extends JeecgController<FixedContact
|
||||
.count();
|
||||
if (count > 0) {
|
||||
runtimeService.deleteProcessInstance(taskTask.getProcessInstId(),
|
||||
"删除定点联系单关联流程, businessId: " + id);
|
||||
"删除定点联系单关联流程, businessId: " + businessId);
|
||||
log.info("【定点联系-删除关联流程】已中止运行中的流程实例: {}", taskTask.getProcessInstId());
|
||||
}
|
||||
}
|
||||
@@ -294,6 +324,5 @@ public class FixedContact20260730Controller extends JeecgController<FixedContact
|
||||
taskTaskServiceImpl.removeByIds(ids);
|
||||
log.info("【定点联系-删除关联流程】已清理关联的taskTask记录, ids: {}", ids);
|
||||
}
|
||||
return Result.OK("删除关联流程成功");
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -386,6 +386,11 @@ public class FixContactFlow {
|
||||
// ${fixContactFlow.getIsNeedLeaderApprove(execution)}
|
||||
public String getIsNeedLeaderApprove(DelegateExecution execution) {
|
||||
String value = this.getVar(execution, FixContactConstant.FlowVarName.IS_NEED_LEADER_APPROVE);
|
||||
if (StringUtils.isBlank(value)) {
|
||||
log.warn("【定点联系-流程表达式】流程未设置是否需要所领导审批变量, 默认按不需要处理, processInstanceId: {}",
|
||||
execution.getProcessInstanceId());
|
||||
return "0";
|
||||
}
|
||||
log.info("【定点联系-流程表达式】读取是否需要所领导审批, processInstanceId: {}, value: {}",
|
||||
execution.getProcessInstanceId(), value);
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user