Browse Source

界面新增修改逻辑分开

master
郑贵龙 1 year ago
parent
commit
2fa2af513d
1 changed files with 2 additions and 6 deletions
  1. +2
    -6
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java

+ 2
- 6
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java View File

@ -52,12 +52,8 @@ public class StaffUpdateEAIService extends AbsEAIService {
//界面
if (OptionEnums.BASIC.getValue().equals(option)){
if (!CollectionUtils.isEmpty(staffList)){
//区分是否有id没有则新增
Map<Boolean, List<StaffEntity>> collect = staffList.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId())));
List<StaffEntity> insert = collect.get(true);
staffService.saveBatch(insert);
List<StaffEntity> update = collect.get(false);
staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid());
//修改
staffRepository.updateStaffList(staffList, SecurityUtil.getUserProfile().getTenantSid());
}
}else if (OptionEnums.TASK.getValue().equals(option)){
if (!CollectionUtils.isEmpty(staffList)){


Loading…
Cancel
Save