chenendian пре 2 месеци
родитељ
комит
4413dfbc1a

+ 1 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/ProjectAttachmentInfoMapper.java

@@ -91,7 +91,7 @@ public interface ProjectAttachmentInfoMapper {
     void deleteByProjectId(String projectId);
 
 
-    void deleteByIds(List<String> ids);
+    void deleteByIds(@Param("ids") List<String> ids);
 
 
 

+ 2 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/NodeAttachmentImpl.java

@@ -649,13 +649,13 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
                     logger.info("全文检索根目录路径,rootPath: {}", rootPath);
                     //先进行删除
                     List<ProjectAttachmentInfo> projectAttachmentInfoList =  projectAttachmentInfoMapper.selectByProjectIdNodeId(projectId,nodeId);
-                    if(CollectionUtils.isEmpty(projectAttachmentInfoList)){
+                    if(CollectionUtils.isNotEmpty(projectAttachmentInfoList)){
                         List<String> ids =  projectAttachmentInfoList.stream().map(BaseId::getId).collect(Collectors.toList());
                         projectAttachmentInfoMapper.deleteByIds(ids);
                     }
                     //再进行更新
                     List<Path> fileList = ServiceFileUtil.getDirectoryFileList(rootPath);
-                    if(CollectionUtils.isEmpty(fileList)){
+                    if(CollectionUtils.isNotEmpty(fileList)){
                         for(Path path : fileList){
                             ProjectAttachmentInfo projectAttachmentInfo = new ProjectAttachmentInfo();
                             projectAttachmentInfo.generateId();

+ 3 - 3
siwei-modules/siwei-apply/src/main/resources/mapper/ProjectAttachmentInfoMapper.xml

@@ -52,10 +52,10 @@
         FROM t_project_attachment_info
         <where>
             <if test="projectId != null">
-                project_id = #{projectId}
+                AND project_id = #{projectId}
             </if>
             <if test="nodeId != null">
-                node_id = #{nodeId}
+                AND node_id = #{nodeId}
             </if>
         </where>
 
@@ -137,7 +137,7 @@
         DELETE FROM t_project_attachment_info WHERE project_id = #{projectId}
     </delete>
 
-    <delete id="deleteByIds" parameterType="List">
+    <delete id="deleteByIds">
         DELETE FROM t_project_attachment_info
         <where>
             <if test="ids != null and ids.size() > 0">