Merge branch 'dev'
This commit is contained in:
commit
1a60f96ad8
|
@ -16,6 +16,9 @@ import io.renren.modules.activiti.dto.ProcessInstanceDTO;
|
|||
import io.renren.modules.activiti.dto.ProcessStartDTO;
|
||||
import io.renren.modules.activiti.service.ActProcessService;
|
||||
import io.renren.modules.activiti.service.ActRunningService;
|
||||
import io.renren.modules.notice.dto.SysNoticeDTO;
|
||||
import io.renren.modules.notice.enums.NoticeStatusEnum;
|
||||
import io.renren.modules.notice.service.SysNoticeService;
|
||||
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
|
||||
import io.renren.modules.processForm.dto.TAbilityBatchApplicationDTO;
|
||||
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
||||
|
@ -83,6 +86,8 @@ public class AbilityCenterControllerV3 {
|
|||
private ResourceService resourceService;
|
||||
@Autowired
|
||||
private SysDeptService sysDeptService;
|
||||
@Autowired
|
||||
private SysNoticeService sysNoticeService;
|
||||
|
||||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
|
@ -181,6 +186,36 @@ public class AbilityCenterControllerV3 {
|
|||
// TODO 拆单进行审核 abilityprocess_v3
|
||||
private void deal(TAbilityBatchApplicationDTO abilityBatchApplicationDTO, Optional<SysDeptDTO> deptDTO, String applyFlag, UserDetail user) {
|
||||
SysUserDTO sysUserDTO = sysUserService.get(user.getId());
|
||||
List<String> resourceName = abilityBatchApplicationDTO.getSystem().stream().filter(index -> tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0)
|
||||
.map(index -> index.get("resourceName"))
|
||||
.collect(Collectors.toList()); // 获取已申请的资源名称
|
||||
if (!resourceName.isEmpty()) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
resourceName.stream().forEach(index -> {
|
||||
stringBuffer.append(index);
|
||||
stringBuffer.append(",");
|
||||
});
|
||||
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
|
||||
CompletableFuture.runAsync(() -> { // 发起人
|
||||
String content = "【通知】你本次申请的能力内 " + stringBuffer + " 已发起过申请";
|
||||
SysNoticeDTO dto = new SysNoticeDTO();
|
||||
Integer type = 10;
|
||||
dto.setType(type);
|
||||
dto.setApplyId(null);
|
||||
dto.setTitle("流程结束系统通知");
|
||||
dto.setContent(content); // 通知内容
|
||||
dto.setReceiverType(1);
|
||||
dto.setReceiverTypeIds(abilityBatchApplicationDTO.getUserId());
|
||||
dto.setStatus(NoticeStatusEnum.SEND.value());
|
||||
dto.setSenderName("流程系统");
|
||||
dto.setSenderDate(new Date());
|
||||
dto.setCreator(sysUserService.getByUsername("admin").getId());
|
||||
dto.setCreateDate(new Date());
|
||||
dto.setFrom("通知");
|
||||
dto.setApplyState(0);
|
||||
sysNoticeService.save(dto);
|
||||
}, executor);
|
||||
}
|
||||
List<TAbilityApplicationDTO> tAbilityApplicationDTOList = abilityBatchApplicationDTO.getSystem().stream().map(index -> {
|
||||
if (tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0) { // 防止重复发起申请
|
||||
logger.error("重复发起申请");
|
||||
|
|
|
@ -1877,7 +1877,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
resultMap.put("视频资源", Integer.parseInt(index.get("count").toString()));
|
||||
}
|
||||
});
|
||||
resultMap.put("感知资源", 0);
|
||||
resultMap.put("云资源", 0);
|
||||
return resultMap;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue