|
@ -26,10 +26,7 @@ import org.dromara.workflow.api.RemoteWorkflowService; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.lang.reflect.Method; |
|
|
import java.lang.reflect.Method; |
|
|
import java.util.Collections; |
|
|
import java.util.*; |
|
|
import java.util.HashMap; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -109,7 +106,7 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
* @param flowStatus |
|
|
* @param flowStatus |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public void updateAlertStatus(String businessId, String flowStatus,Boolean isIllegal,String alertType) { |
|
|
public void updateAlertStatus(String businessId, String flowStatus,Boolean isIllegal,String alertType,String message,String assignName) { |
|
|
LambdaUpdateWrapper<BusinessAlert> wrapper = new LambdaUpdateWrapper<>(); |
|
|
LambdaUpdateWrapper<BusinessAlert> wrapper = new LambdaUpdateWrapper<>(); |
|
|
wrapper.set(BusinessAlert::getHandleType, BusinessStatusEnum.getByStatus(flowStatus).getStatus()); |
|
|
wrapper.set(BusinessAlert::getHandleType, BusinessStatusEnum.getByStatus(flowStatus).getStatus()); |
|
|
if (ObjectUtil.isNotEmpty(isIllegal)){ |
|
|
if (ObjectUtil.isNotEmpty(isIllegal)){ |
|
@ -118,6 +115,17 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
if (ObjectUtil.isNotEmpty(alertType)){ |
|
|
if (ObjectUtil.isNotEmpty(alertType)){ |
|
|
wrapper.set(BusinessAlert::getAlertType, alertType); |
|
|
wrapper.set(BusinessAlert::getAlertType, alertType); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(message)){ |
|
|
|
|
|
wrapper.set(BusinessAlert::getReason, message); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//判断指派人员是否为空
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(assignName)){ |
|
|
|
|
|
wrapper.set(BusinessAlert::getAssignUserId, assignName); |
|
|
|
|
|
wrapper.set(BusinessAlert::getAssignDate, new Date()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
wrapper.eq(BusinessAlert::getId, businessId); |
|
|
wrapper.eq(BusinessAlert::getId, businessId); |
|
|
|
|
|
|
|
|
this.baseMapper.update(wrapper); |
|
|
this.baseMapper.update(wrapper); |
|
@ -189,6 +197,45 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
return TableDataInfo.build(page); |
|
|
return TableDataInfo.build(page); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 查询当前用户待办预警 |
|
|
|
|
|
* @param bo |
|
|
|
|
|
* @param pageQuery |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public TableDataInfo<BusinessAlert> pageAlertAssign(BusinessAlertBo bo, PageQuery pageQuery) { |
|
|
|
|
|
QueryWrapper<BusinessAlert> wrapper = buildQueryWrapper(bo); |
|
|
|
|
|
|
|
|
|
|
|
// if (ObjectUtil.isEmpty(wrapper)){
|
|
|
|
|
|
// return new TableDataInfo<>();
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
buildCommonQueryWrapper(wrapper); |
|
|
|
|
|
|
|
|
|
|
|
wrapper.eq("uu.del_flag", 0); |
|
|
|
|
|
wrapper.in("uu.type", 1,2,3); |
|
|
|
|
|
|
|
|
|
|
|
wrapper.in("uu.processed_by", remoteWorkflowService.getPermissions()); |
|
|
|
|
|
wrapper.eq("b.flow_status", BusinessStatusEnum.DRAFT.getStatus()); |
|
|
|
|
|
|
|
|
|
|
|
Page<BusinessAlert> page = this.baseMapper.pageAlertTodo(pageQuery.build(), wrapper); |
|
|
|
|
|
|
|
|
|
|
|
List<BusinessAlert> records = page.getRecords(); |
|
|
|
|
|
if (CollUtil.isNotEmpty(records)) { |
|
|
|
|
|
List<Long> taskIds = StreamUtils.toList(records, BusinessAlert::getFlowTaskId); |
|
|
|
|
|
Map<Long, List<RemoteUserVo>> listMap = remoteWorkflowService.currentTaskAllUser(taskIds); |
|
|
|
|
|
records.forEach(t -> { |
|
|
|
|
|
List<RemoteUserVo> userList = listMap.getOrDefault(t.getId(), Collections.emptyList()); |
|
|
|
|
|
if (CollUtil.isNotEmpty(userList)) { |
|
|
|
|
|
t.setApprover(StreamUtils.join(userList, e -> String.valueOf(e.getUserId()))); |
|
|
|
|
|
t.setApproveName(StreamUtils.join(userList, RemoteUserVo::getNickName)); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
return TableDataInfo.build(page); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 查询当前用户待办预警 |
|
|
* 查询当前用户待办预警 |
|
|