|
@@ -64,11 +64,11 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
|
|
otherReferences = this.getById(id);
|
|
otherReferences = this.getById(id);
|
|
BeanUtils.copyProperties(otherReferencesDTO, otherReferences);
|
|
BeanUtils.copyProperties(otherReferencesDTO, otherReferences);
|
|
otherReferences.updateById();
|
|
otherReferences.updateById();
|
|
|
|
+ //先删除 后添加
|
|
|
|
+ LambdaQueryWrapper<AssoOtherReferencesFile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.eq(AssoOtherReferencesFile::getOtherReferencesId, id);
|
|
|
|
+ assoReferencesFileService.remove(queryWrapper);
|
|
if (!fileGuids.isEmpty()) {
|
|
if (!fileGuids.isEmpty()) {
|
|
- //先删除 后添加
|
|
|
|
- LambdaQueryWrapper<AssoOtherReferencesFile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- queryWrapper.eq(AssoOtherReferencesFile::getOtherReferencesId, id);
|
|
|
|
- assoReferencesFileService.remove(queryWrapper);
|
|
|
|
List<Integer> fileIds = this.addFile(otherReferences.getId(), fileGuids);
|
|
List<Integer> fileIds = this.addFile(otherReferences.getId(), fileGuids);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -89,6 +89,12 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
|
|
return otherReferences.getId();
|
|
return otherReferences.getId();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 新增文件与其他参考资料关联
|
|
|
|
+ * @param id
|
|
|
|
+ * @param fileGuids
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
public List<Integer> addFile(Integer id, List<String> fileGuids){
|
|
public List<Integer> addFile(Integer id, List<String> fileGuids){
|
|
List<Integer> ids = new ArrayList<>();
|
|
List<Integer> ids = new ArrayList<>();
|
|
if (!fileGuids.isEmpty()) {
|
|
if (!fileGuids.isEmpty()) {
|
|
@@ -130,6 +136,11 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
|
|
return otherReferencesVOS;
|
|
return otherReferencesVOS;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 装载查询其他参考资料
|
|
|
|
+ * @param otherReferencesVOS
|
|
|
|
+ * @throws IOException
|
|
|
|
+ */
|
|
public void loadOtherReferencesVOS(List<OtherReferencesVO> otherReferencesVOS) throws IOException {
|
|
public void loadOtherReferencesVOS(List<OtherReferencesVO> otherReferencesVOS) throws IOException {
|
|
List<String> createIds = new ArrayList<>();
|
|
List<String> createIds = new ArrayList<>();
|
|
otherReferencesVOS.forEach(item -> {
|
|
otherReferencesVOS.forEach(item -> {
|
|
@@ -162,8 +173,17 @@ public class OtherReferencesService extends ServiceImpl<OtherReferencesMapper, O
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 删除其他参考资料
|
|
|
|
+ * @param ids
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
public List<Integer> deleteOtherReferences(List<Integer> ids) {
|
|
public List<Integer> deleteOtherReferences(List<Integer> ids) {
|
|
if (!ids.isEmpty()) {
|
|
if (!ids.isEmpty()) {
|
|
|
|
+ //先删除附件
|
|
|
|
+ LambdaQueryWrapper<AssoOtherReferencesFile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.in(AssoOtherReferencesFile::getOtherReferencesId, ids);
|
|
|
|
+ assoReferencesFileService.remove(queryWrapper);
|
|
this.removeBatchByIds(ids);
|
|
this.removeBatchByIds(ids);
|
|
}
|
|
}
|
|
return ids;
|
|
return ids;
|