|
|
|
@ -691,7 +691,8 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void updateFlow(UserEntity userEntity, BiddingProjectSubscribeEntity entity, Boolean add) { |
|
|
|
public void updateFlow(UserEntity userEntity, BiddingProjectSubscribeEntity entity, Boolean add) { |
|
|
|
UserEntity leaderInfo = querySuperiorLeader(userEntity); |
|
|
|
// UserEntity leaderInfo = querySuperiorLeader(userEntity);
|
|
|
|
|
|
|
|
List<UserEntity> userEntityList = querySuperiorLeader(userEntity); |
|
|
|
//添加根子单数据
|
|
|
|
//添加根子单数据
|
|
|
|
OrganizeEntity organization = organizeService.getInfoById(userEntity.getOrganizeId()); |
|
|
|
OrganizeEntity organization = organizeService.getInfoById(userEntity.getOrganizeId()); |
|
|
|
String hierarchy = checkOrganizationHierarchy(userEntity); |
|
|
|
String hierarchy = checkOrganizationHierarchy(userEntity); |
|
|
|
@ -738,6 +739,7 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (UserEntity leaderInfo : userEntityList) { |
|
|
|
//添加子单数据即派单到上级领导
|
|
|
|
//添加子单数据即派单到上级领导
|
|
|
|
BiddingProjectSubscribeChild build = BiddingProjectSubscribeChild.builder() |
|
|
|
BiddingProjectSubscribeChild build = BiddingProjectSubscribeChild.builder() |
|
|
|
.childId(UUID.randomUUID().toString().replace("-", "")) |
|
|
|
.childId(UUID.randomUUID().toString().replace("-", "")) |
|
|
|
@ -755,7 +757,6 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
.createUserId(userEntity.getId()) |
|
|
|
.createUserId(userEntity.getId()) |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
iBiddingProjectSubscribeChildService.saveOrUpdate(build); |
|
|
|
iBiddingProjectSubscribeChildService.saveOrUpdate(build); |
|
|
|
|
|
|
|
|
|
|
|
//添加步骤数据
|
|
|
|
//添加步骤数据
|
|
|
|
iBiddingProjectSubscribeStepService.saveOrUpdate(BiddingProjectSubscribeStep.builder() |
|
|
|
iBiddingProjectSubscribeStepService.saveOrUpdate(BiddingProjectSubscribeStep.builder() |
|
|
|
.relationMainId(entity.getId().toString()) |
|
|
|
.relationMainId(entity.getId().toString()) |
|
|
|
@ -771,6 +772,9 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
.createTime(LocalDateTime.now()) |
|
|
|
.createTime(LocalDateTime.now()) |
|
|
|
.build() |
|
|
|
.build() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BiddingProjectEnum.MainStatusEnum mainStatusEnum = null; |
|
|
|
BiddingProjectEnum.MainStatusEnum mainStatusEnum = null; |
|
|
|
switch (hierarchy) { |
|
|
|
switch (hierarchy) { |
|
|
|
case "1": |
|
|
|
case "1": |
|
|
|
@ -813,7 +817,7 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
// return "3";
|
|
|
|
// return "3";
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private UserEntity querySuperiorLeader(UserEntity userEntity) { |
|
|
|
private List<UserEntity> querySuperiorLeader(UserEntity userEntity) { |
|
|
|
//查询上级组织
|
|
|
|
//查询上级组织
|
|
|
|
OrganizeEntity currentOrganization = organizeService.getInfoById(userEntity.getOrganizeId()); |
|
|
|
OrganizeEntity currentOrganization = organizeService.getInfoById(userEntity.getOrganizeId()); |
|
|
|
//校验是否为公司
|
|
|
|
//校验是否为公司
|
|
|
|
@ -852,17 +856,20 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
if (!shyRole.isPresent()) { |
|
|
|
if (!shyRole.isPresent()) { |
|
|
|
throw new DataException("数据错误,请联系管理员[1]"); |
|
|
|
throw new DataException("数据错误,请联系管理员[1]"); |
|
|
|
} |
|
|
|
} |
|
|
|
Optional<String> leaderId = userRelationService.getListByUserIdAll(userIdList) |
|
|
|
List<String> list = userRelationService.getListByUserIdAll(userIdList) |
|
|
|
.stream() |
|
|
|
.stream() |
|
|
|
.filter(userRelationEntity -> userRelationEntity.getObjectType().equals(PermissionConst.ROLE)) |
|
|
|
.filter(userRelationEntity -> userRelationEntity.getObjectType().equals(PermissionConst.ROLE)) |
|
|
|
.filter(userRelationEntity -> shyRole.get().getId().equals(userRelationEntity.getObjectId())) |
|
|
|
.filter(userRelationEntity -> shyRole.get().getId().equals(userRelationEntity.getObjectId())) |
|
|
|
.map(UserRelationEntity::getUserId) |
|
|
|
.map(UserRelationEntity::getUserId).collect(Collectors.toList()); |
|
|
|
.findFirst(); |
|
|
|
if (CollectionUtil.isEmpty(list)) { |
|
|
|
if (!leaderId.isPresent()) { |
|
|
|
|
|
|
|
throw new DataException("该人员上级无领导"); |
|
|
|
throw new DataException("该人员上级无领导"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<UserEntity> userEntityList = new ArrayList<>(); |
|
|
|
|
|
|
|
for (String userId : list) { |
|
|
|
|
|
|
|
userEntityList.add(userService.getInfoById(userId)); |
|
|
|
|
|
|
|
} |
|
|
|
//查询领导详情
|
|
|
|
//查询领导详情
|
|
|
|
return userService.getInfoById(leaderId.get()); |
|
|
|
return userEntityList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@ -986,6 +993,13 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.update(); |
|
|
|
.update(); |
|
|
|
|
|
|
|
//将其他待审批子单删除
|
|
|
|
|
|
|
|
iBiddingProjectSubscribeChildService.lambdaUpdate() |
|
|
|
|
|
|
|
//提交人状态设为待提交
|
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getChildStatus, selfChild.getChildStatus()) |
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getMainId, biddingProjectSubscribeEntity.getId()) |
|
|
|
|
|
|
|
.ne(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
|
|
|
|
.remove(); |
|
|
|
//修改主状态
|
|
|
|
//修改主状态
|
|
|
|
this.lambdaUpdate() |
|
|
|
this.lambdaUpdate() |
|
|
|
.set(BiddingProjectSubscribeEntity::getMainStatus, BiddingProjectEnum.MainStatusEnum.RETURNED.getCode()) |
|
|
|
.set(BiddingProjectSubscribeEntity::getMainStatus, BiddingProjectEnum.MainStatusEnum.RETURNED.getCode()) |
|
|
|
@ -1166,13 +1180,19 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
updateFlow(userService.getInfoById(userInfo.getUserId()), biddingProjectSubscribeEntity, false); |
|
|
|
updateFlow(userService.getInfoById(userInfo.getUserId()), biddingProjectSubscribeEntity, false); |
|
|
|
//审批领导状态改为已审批
|
|
|
|
//审批领导状态改为已审批
|
|
|
|
iBiddingProjectSubscribeChildService.lambdaUpdate() |
|
|
|
iBiddingProjectSubscribeChildService.lambdaUpdate() |
|
|
|
//提交人状态设为待提交
|
|
|
|
|
|
|
|
.set(BiddingProjectSubscribeChild::getChildStatus, BiddingProjectEnum.ChildStatusEnum.PASS.getCode()) |
|
|
|
.set(BiddingProjectSubscribeChild::getChildStatus, BiddingProjectEnum.ChildStatusEnum.PASS.getCode()) |
|
|
|
.set(BiddingProjectSubscribeChild::getChildStatusName, BiddingProjectEnum.ChildStatusEnum.PASS.getDescribe()) |
|
|
|
.set(BiddingProjectSubscribeChild::getChildStatusName, BiddingProjectEnum.ChildStatusEnum.PASS.getDescribe()) |
|
|
|
.set(BiddingProjectSubscribeChild::getRemake, param.getRemake()) |
|
|
|
.set(BiddingProjectSubscribeChild::getRemake, param.getRemake()) |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.update(); |
|
|
|
.update(); |
|
|
|
|
|
|
|
//将其他待审批子单删除
|
|
|
|
|
|
|
|
iBiddingProjectSubscribeChildService.lambdaUpdate() |
|
|
|
|
|
|
|
//提交人状态设为待提交
|
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getChildStatus, selfChild.getChildStatus()) |
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getMainId, biddingProjectSubscribeEntity.getId()) |
|
|
|
|
|
|
|
.ne(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
|
|
|
|
.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
@ -1195,6 +1215,13 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.update(); |
|
|
|
.update(); |
|
|
|
|
|
|
|
//将其他待审批子单删除
|
|
|
|
|
|
|
|
iBiddingProjectSubscribeChildService.lambdaUpdate() |
|
|
|
|
|
|
|
//提交人状态设为待提交
|
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getChildStatus, selfChild.getChildStatus()) |
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getMainId, biddingProjectSubscribeEntity.getId()) |
|
|
|
|
|
|
|
.ne(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
|
|
|
|
.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1225,7 +1252,10 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.update(); |
|
|
|
.update(); |
|
|
|
UserEntity leader = querySuperiorLeader(userService.getInfoById(userInfo.getUserId())); |
|
|
|
// UserEntity leader = querySuperiorLeader(userService.getInfoById(userInfo.getUserId()));
|
|
|
|
|
|
|
|
List<UserEntity> userEntityList = querySuperiorLeader(userService.getInfoById(userInfo.getUserId())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (UserEntity leader : userEntityList) { |
|
|
|
//领导的待归档
|
|
|
|
//领导的待归档
|
|
|
|
BiddingProjectSubscribeChild build = BiddingProjectSubscribeChild.builder() |
|
|
|
BiddingProjectSubscribeChild build = BiddingProjectSubscribeChild.builder() |
|
|
|
.childStatus(BiddingProjectEnum.ChildStatusEnum.TO_BE_ARCHIVED.getCode()) |
|
|
|
.childStatus(BiddingProjectEnum.ChildStatusEnum.TO_BE_ARCHIVED.getCode()) |
|
|
|
@ -1243,6 +1273,8 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
.updateTime(LocalDateTime.now()) |
|
|
|
.updateTime(LocalDateTime.now()) |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
iBiddingProjectSubscribeChildService.saveOrUpdate(build); |
|
|
|
iBiddingProjectSubscribeChildService.saveOrUpdate(build); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//审批领导状态改为已审批
|
|
|
|
//审批领导状态改为已审批
|
|
|
|
@ -1294,7 +1326,16 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.update(); |
|
|
|
.update(); |
|
|
|
UserEntity leader = getFirstLeader(userService.getInfoById(userInfo.getUserId())); |
|
|
|
//将其他待审批子单删除
|
|
|
|
|
|
|
|
iBiddingProjectSubscribeChildService.lambdaUpdate() |
|
|
|
|
|
|
|
//提交人状态设为待提交
|
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getChildStatus, selfChild.getChildStatus()) |
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getMainId, biddingProjectSubscribeEntity.getId()) |
|
|
|
|
|
|
|
.ne(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
|
|
|
|
.remove(); |
|
|
|
|
|
|
|
// UserEntity leader = getFirstLeader(userService.getInfoById(userInfo.getUserId()));
|
|
|
|
|
|
|
|
List<UserEntity> userEntityList = getFirstLeader(userService.getInfoById(userInfo.getUserId())); |
|
|
|
|
|
|
|
for (UserEntity leader : userEntityList) { |
|
|
|
//领导的待归档
|
|
|
|
//领导的待归档
|
|
|
|
BiddingProjectSubscribeChild build = BiddingProjectSubscribeChild.builder() |
|
|
|
BiddingProjectSubscribeChild build = BiddingProjectSubscribeChild.builder() |
|
|
|
.childStatus(BiddingProjectEnum.ChildStatusEnum.TO_BE_ARCHIVED.getCode()) |
|
|
|
.childStatus(BiddingProjectEnum.ChildStatusEnum.TO_BE_ARCHIVED.getCode()) |
|
|
|
@ -1312,6 +1353,8 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
.updateTime(LocalDateTime.now()) |
|
|
|
.updateTime(LocalDateTime.now()) |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
iBiddingProjectSubscribeChildService.saveOrUpdate(build); |
|
|
|
iBiddingProjectSubscribeChildService.saveOrUpdate(build); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//审批领导状态改为已审批
|
|
|
|
//审批领导状态改为已审批
|
|
|
|
@ -1323,6 +1366,13 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.update(); |
|
|
|
.update(); |
|
|
|
|
|
|
|
//将其他待审批子单删除
|
|
|
|
|
|
|
|
iBiddingProjectSubscribeChildService.lambdaUpdate() |
|
|
|
|
|
|
|
//提交人状态设为待提交
|
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getChildStatus, selfChild.getChildStatus()) |
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getMainId, biddingProjectSubscribeEntity.getId()) |
|
|
|
|
|
|
|
.ne(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
|
|
|
|
.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//审批类型审核通过去上传招标结果,添加子单到提交人 用于查询
|
|
|
|
//审批类型审核通过去上传招标结果,添加子单到提交人 用于查询
|
|
|
|
@ -1362,6 +1412,13 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.set(BiddingProjectSubscribeChild::getUpdateTime, LocalDateTime.now()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.eq(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
.update(); |
|
|
|
.update(); |
|
|
|
|
|
|
|
//将其他待审批子单删除
|
|
|
|
|
|
|
|
iBiddingProjectSubscribeChildService.lambdaUpdate() |
|
|
|
|
|
|
|
//提交人状态设为待提交
|
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getChildStatus, selfChild.getChildStatus()) |
|
|
|
|
|
|
|
.eq(BiddingProjectSubscribeChild::getMainId, biddingProjectSubscribeEntity.getId()) |
|
|
|
|
|
|
|
.ne(BiddingProjectSubscribeChild::getChildId, selfChild.getChildId()) |
|
|
|
|
|
|
|
.remove(); |
|
|
|
//todo 审批通过添加到抽签表中
|
|
|
|
//todo 审批通过添加到抽签表中
|
|
|
|
//查询根子单
|
|
|
|
//查询根子单
|
|
|
|
Optional<BiddingProjectSubscribeChild> rootChild = iBiddingProjectSubscribeChildService.lambdaQuery() |
|
|
|
Optional<BiddingProjectSubscribeChild> rootChild = iBiddingProjectSubscribeChildService.lambdaQuery() |
|
|
|
@ -1416,12 +1473,15 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje |
|
|
|
iBiddingProjectSubscribeStepService.saveOrUpdate(step); |
|
|
|
iBiddingProjectSubscribeStepService.saveOrUpdate(step); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private UserEntity getFirstLeader(UserEntity userEntity) { |
|
|
|
private List<UserEntity> getFirstLeader(UserEntity userEntity) { |
|
|
|
UserEntity leader = querySuperiorLeader(userEntity); |
|
|
|
// UserEntity leader = querySuperiorLeader(userEntity);
|
|
|
|
if (!StrUtil.equals("1", checkOrganizationHierarchy(leader))) { |
|
|
|
List<UserEntity> userEntityList = querySuperiorLeader(userEntity); |
|
|
|
getFirstLeader(leader); |
|
|
|
UserEntity leaderInfo = userEntityList.stream().findFirst().get(); |
|
|
|
|
|
|
|
if (!StrUtil.equals("1", checkOrganizationHierarchy(leaderInfo))) { |
|
|
|
|
|
|
|
getFirstLeader(leaderInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
return leader; |
|
|
|
|
|
|
|
|
|
|
|
return userEntityList; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|