Commit 0c47bc7d by 林永健

fix(digitalmanagement): 修复圈人列表去重及互斥判断逻辑

- 修正新员工UUID列表去重,避免重复添加
- 增加轻量变更模板判定,支持更多模板互斥场景
- 合并互斥条件,统一处理特殊模板圈人逻辑
- 保持特殊模板唯一圈人记录,使用固定的GMT初始时间
- 修改时累加已有员工,完善员工绑定记录管理
1 parent f53b2152
......@@ -387,17 +387,21 @@ public class DigitalManagementTemplateService {
Date refTime = new Date();
DigitalManagementTemplateStaffRef data;
DigitalManagementTemplateStaffRefDTO exist;
List<String> newStaffUuidList = CollectionUtils.isEmpty(dto.getStaffUuidList()) ? new ArrayList<>() : dto.getStaffUuidList();;
if (dto.getTemplateDTO().getDisplaySummary() == 0) {
List<String> newStaffUuidList = CollectionUtils.isEmpty(dto.getStaffUuidList()) ?
new ArrayList<>() : dto.getStaffUuidList().stream().distinct().collect(Collectors.toList());
boolean isLightChangeTemplate = staffRecordService.isLightChangeTemplate(dto.getTemplateCode());
// 是否圈人互斥
boolean isMutuallyExclusive = dto.getTemplateDTO().getDisplaySummary() == 0 || isLightChangeTemplate;
if (isMutuallyExclusive) {
// 特殊模板只有一条圈人记录, 使用固定的GMT初始时间
refTime = new Date(0);
exist = templateStaffRefMapper.findByCodeAndTime(templateCode, refTime);
// 修改时,累加员工
if (Objects.nonNull(exist) && StringUtils.hasLength(exist.getStaffUuidListStr())){
if (Objects.nonNull(exist) && StringUtils.hasLength(exist.getStaffUuidListStr())) {
List<String> staffUuidList = exist.parseStaffUuidList().getStaffUuidList();
newStaffUuidList = new ArrayList<>(org.apache.commons.collections4.CollectionUtils.union(staffUuidList, newStaffUuidList));
}
}else {
} else {
// 检查新绑定列表是否存在其他模板管理
if (!CollectionUtils.isEmpty(dto.getStaffUuidList())) {
Collection<String> alreadyBindingTemplateStaff = this.getTemplateBindingStaff(dto.getTypeName(), newStaffUuidList);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!