修改转赠保存方式
This commit is contained in:
@@ -16,10 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -53,6 +50,7 @@ public class GiveUserAdminServiceImpl implements GiveUserAdminService {
|
||||
}
|
||||
String[] erBanNoArray = erBanNoStr.split(StrUtil.COMMA);
|
||||
Date now = new Date();
|
||||
List<GiveUser> giveUsers = new ArrayList<>();
|
||||
for (String erBanNo : erBanNoArray) {
|
||||
List<String> uidList = usersBaseService.getUidByErbanNo(Collections.singletonList(erBanNo));
|
||||
if (CollectionUtil.isEmpty(uidList)) {
|
||||
@@ -68,8 +66,9 @@ public class GiveUserAdminServiceImpl implements GiveUserAdminService {
|
||||
if (count > 0) {
|
||||
throw new ServiceException("添加失败," + erBanNo + "已存在");
|
||||
}
|
||||
giveUserService.save(giveUser);
|
||||
giveUsers.add(giveUser);
|
||||
}
|
||||
giveUserService.saveBatch(giveUsers);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user