|
@@ -38,11 +38,12 @@ public class IotMeasureBookServiceImpl implements IotMeasureBookService {
|
|
|
private DeptService deptService;
|
|
private DeptService deptService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public UserImportRespVO importBookList(List<IotMeasureBookRespVO> importBooks, boolean isUpdateSupport) {
|
|
|
|
|
|
|
+ public UserImportRespVO importBookList(List<IotMeasureBookRespVO> importBooks) {
|
|
|
// 1.1 参数校验
|
|
// 1.1 参数校验
|
|
|
if (CollUtil.isEmpty(importBooks)) {
|
|
if (CollUtil.isEmpty(importBooks)) {
|
|
|
throw exception(USER_IMPORT_LIST_IS_EMPTY);
|
|
throw exception(USER_IMPORT_LIST_IS_EMPTY);
|
|
|
}
|
|
}
|
|
|
|
|
+ List<IotMeasureBookDO> bookDOList = new ArrayList<>();
|
|
|
// 2. 遍历,逐个创建 or 更新
|
|
// 2. 遍历,逐个创建 or 更新
|
|
|
UserImportRespVO respVO = UserImportRespVO.builder().createUsernames(new ArrayList<>()).updateUsernames(new ArrayList<>()).failureUsernames(new LinkedHashMap<>()).build();
|
|
UserImportRespVO respVO = UserImportRespVO.builder().createUsernames(new ArrayList<>()).updateUsernames(new ArrayList<>()).failureUsernames(new LinkedHashMap<>()).build();
|
|
|
Long loginUserDeptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
|
Long loginUserDeptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
|
@@ -51,8 +52,9 @@ public class IotMeasureBookServiceImpl implements IotMeasureBookService {
|
|
|
BeanUtils.copyProperties(importBook, iotMeasureBookDO);
|
|
BeanUtils.copyProperties(importBook, iotMeasureBookDO);
|
|
|
iotMeasureBookDO.setDeleted(false);
|
|
iotMeasureBookDO.setDeleted(false);
|
|
|
iotMeasureBookDO.setDeptId(loginUserDeptId);
|
|
iotMeasureBookDO.setDeptId(loginUserDeptId);
|
|
|
-
|
|
|
|
|
|
|
+ bookDOList.add(iotMeasureBookDO);
|
|
|
});
|
|
});
|
|
|
|
|
+ iotMeasureBookMapper.insertBatch(bookDOList);
|
|
|
return respVO;
|
|
return respVO;
|
|
|
}
|
|
}
|
|
|
|
|
|