|
|
@ -16,6 +16,7 @@ import com.digiwin.athena.opt.common.security.SecurityUtil; |
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
@ -62,15 +63,19 @@ public class StaffUpdateEAIService extends AbsEAIService { |
|
|
|
staffService.saveBatch(staffList); |
|
|
|
} else if (OptionEnums.BASIC.getValue().equals(option)) { |
|
|
|
//区分是否有id没有则新增 |
|
|
|
Map<Boolean, List<StaffEntity>> collect = staffList.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId()))); |
|
|
|
Map<Boolean, List<StaffEntity>> collect = staffList.stream().collect(Collectors.groupingBy(item -> ObjectUtils.isEmpty(item.getId()))); |
|
|
|
List<StaffEntity> insert = collect.get(true); |
|
|
|
insert.forEach(item ->{ |
|
|
|
item.setStatus(StatusEnums.TOBEREPORTED.getValue()); |
|
|
|
item.setTabStatus(TabStatusEnums.NOSET.getValue()); |
|
|
|
}); |
|
|
|
staffService.saveBatch(insert); |
|
|
|
if (!CollectionUtils.isEmpty(insert)){ |
|
|
|
insert.forEach(item ->{ |
|
|
|
item.setStatus(StatusEnums.TOBEREPORTED.getValue()); |
|
|
|
item.setTabStatus(TabStatusEnums.NOSET.getValue()); |
|
|
|
}); |
|
|
|
staffService.saveBatch(insert); |
|
|
|
} |
|
|
|
List<StaffEntity> update = collect.get(false); |
|
|
|
staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid()); |
|
|
|
if (!CollectionUtils.isEmpty(update)){ |
|
|
|
staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid()); |
|
|
|
} |
|
|
|
} else if (OptionEnums.TASK.getValue().equals(option)) { |
|
|
|
staffRepository.updateStatusAndDate(staffList, SecurityUtil.getUserProfile().getTenantSid()); |
|
|
|
} else if (OptionEnums.FLOW.getValue().equals(option)) { |
|
|
|