Browse Source

修改发改委项目进度附件删除会删除别的附件的问题

Administrator 2 năm trước cách đây
mục cha
commit
d3f08f15c7

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/mapper/fgw/FgwFjMapper.java

@@ -55,7 +55,7 @@ public interface FgwFjMapper
      */
     public int deleteFgwFjById(Long id);
 
-    public int deleteFgwFjByXmId(Long id);
+    public int deleteFgwFjByXmId(Long id,Long type);
 
     /**
      * 批量删除发改委_附件

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwJzqkServiceImpl.java

@@ -111,7 +111,7 @@ public class FgwJzqkServiceImpl implements IFgwJzqkService {
     public int updateFgwJzqk(FgwJzqk fgwJzqk) {
         fgwJzqk.setUpdateTime(DateUtils.getNowDate());
         List<FgwFj> fjList = fgwJzqk.getFjList();
-        fgwFjMapper.deleteFgwFjByXmId(fgwJzqk.getXmId());
+        fgwFjMapper.deleteFgwFjByXmId(fgwJzqk.getXmId(),18L);
         if (fjList != null && fjList.size() > 0) {
             for (FgwFj fgwFj : fjList) {
                 fgwFj.setType("18");

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwXmsbServiceImpl.java

@@ -114,7 +114,7 @@ public class FgwXmsbServiceImpl implements IFgwXmsbService
         fgwXmsb.setStatus(ONE);
         List<FgwFj> fjList = fgwXmsb.getFjList();
         //删除之前的
-        fgwFjMapper.deleteFgwFjByXmId(fgwXmsb.getId());
+        fgwFjMapper.deleteFgwFjByXmId(fgwXmsb.getId(),1L);
         if (fjList != null && fjList.size() > 0){
             //保存当前的
             for (FgwFj fgwFj : fjList) {

+ 2 - 0
ruoyi-system/src/main/resources/mapper/system/fgw/FgwFjMapper.xml

@@ -91,5 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
     <delete id="deleteFgwFjByXmId" parameterType="Long">
                 delete from fgw_fj where xm_id = #{id}
+        <if test="type != null and type == 18"> and type = #{type}</if>
+        <if test="type != null and type != 18"> and type != 18</if>
     </delete>
 </mapper>