Parcourir la source

Merge remote-tracking branch 'origin/master'

Administrator il y a 2 ans
Parent
commit
05e6993448

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/fgw/FgwLdpsController.java

@@ -119,8 +119,8 @@ public class FgwLdpsController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('fgw:ldps:remove')")
     @GetMapping("delete")
-    public AjaxResult remove(Long id)
+    public AjaxResult remove(Long id,Long xmId)
     {
-        return toAjax(fgwLdpsService.deleteFgwLdpsById(id));
+        return toAjax(fgwLdpsService.deleteFgwLdpsById(id,xmId));
     }
 }

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/projectV2/ZsyzLdpsController.java

@@ -118,8 +118,8 @@ public class ZsyzLdpsController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:ldps:delete')")
     @GetMapping("delete")
-    public AjaxResult remove(Long id)
+    public AjaxResult remove(Long id,Long xmId)
     {
-        return toAjax(zsyzLdpsService.deleteZsyzLdpsById(id));
+        return toAjax(zsyzLdpsService.deleteZsyzLdpsById(id,xmId));
     }
 }

+ 23 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/projectV2/ZsyzLdpsServiceImpl.java

@@ -10,6 +10,8 @@ import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.framework.manager.AsyncManager;
 import com.ruoyi.framework.manager.factory.AsyncFactory;
+import com.ruoyi.system.domain.fgw.FgwLdps;
+import com.ruoyi.system.domain.fgw.FgwXmsb;
 import com.ruoyi.system.domain.projectV2.ZsyzDbd;
 import com.ruoyi.system.domain.projectV2.ZsyzSbbzb;
 import com.ruoyi.system.domain.projectV2.common.SendSmsConfig;
@@ -174,8 +176,28 @@ public class ZsyzLdpsServiceImpl implements IZsyzLdpsService
      * @return 结果
      */
     @Override
-    public int deleteZsyzLdpsById(Long id)
+    public int deleteZsyzLdpsById(Long id,Long xmId)
     {
+
+
+        //查询最新的领导批示信息
+        List<ZsyzLdps> zsyzLdpsList = zsyzLdpsMapper.selectZsyzLdpsNew(xmId);
+        if(zsyzLdpsList.size()==1){
+            //如果只有一条数据,则说明当前删除的就是最新的
+            ZsyzSbbzb zsyzSbbzb = new ZsyzSbbzb();
+            zsyzSbbzb.setId(xmId);
+            zsyzSbbzb.setPsnr("");
+            zsyzSbbzbMapper.updateZsyzSbbzb(zsyzSbbzb);
+        }else{
+            //判断第一条是否与要删除的ID相同
+            if(zsyzLdpsList.get(0).getId().equals(id)){
+                //将主表中的批示内容换成第二条
+                ZsyzSbbzb zsyzSbbzb = new ZsyzSbbzb();
+                zsyzSbbzb.setId(xmId);
+                zsyzSbbzb.setPsnr(zsyzLdpsList.get(1).getPsnr());
+                zsyzSbbzbMapper.updateZsyzSbbzb(zsyzSbbzb);
+            }
+        }
         return zsyzLdpsMapper.deleteZsyzLdpsById(id);
     }
 

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

@@ -1,6 +1,7 @@
 package com.ruoyi.system.mapper.fgw;
 
 import com.ruoyi.system.domain.fgw.FgwFj;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -55,7 +56,7 @@ public interface FgwFjMapper
      */
     public int deleteFgwFjById(Long id);
 
-    public int deleteFgwFjByXmId(Long id,Long type);
+    public int deleteFgwFjByXmId(@Param("id") Long id, @Param("type")Long type);
 
     /**
      * 批量删除发改委_附件

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/fgw/FgwLdpsMapper.java

@@ -60,4 +60,6 @@ public interface FgwLdpsMapper
     public int deleteFgwLdpsByIds(Long[] ids);
 
     FgwLdps getInfoZc(FgwLdps fgwLdps);
+
+    List<FgwLdps> selectFgwLdpsNew(Long xmId);
 }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/projectV2/ZsyzLdpsMapper.java

@@ -60,4 +60,6 @@ public interface ZsyzLdpsMapper
     public int deleteZsyzLdpsByIds(Long[] ids);
 
     ZsyzLdps getInfoZc(ZsyzLdps zsyzLdps);
+
+    List<ZsyzLdps> selectZsyzLdpsNew(Long xmId);
 }

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

@@ -57,7 +57,7 @@ public interface IFgwLdpsService
      * @param id 发改委_领导批示主键
      * @return 结果
      */
-    public int deleteFgwLdpsById(Long id);
+    public int deleteFgwLdpsById(Long id,Long xmId);
 
     FgwLdps getInfoZc(FgwLdps fgwLdps);
 }

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

@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
 import com.ruoyi.system.mapper.fgw.FgwLdpsMapper;
 import com.ruoyi.system.domain.fgw.FgwLdps;
 import com.ruoyi.system.service.fgw.IFgwLdpsService;
+import org.springframework.transaction.annotation.Transactional;
 
 import static com.ruoyi.common.constant.CommonConstants.LEADER;
 
@@ -147,8 +148,27 @@ public class FgwLdpsServiceImpl implements IFgwLdpsService
      * @return 结果
      */
     @Override
-    public int deleteFgwLdpsById(Long id)
+    @Transactional
+    public int deleteFgwLdpsById(Long id,Long xmId)
     {
+        //查询最新的领导批示信息
+        List<FgwLdps> fgwLdpsList = fgwLdpsMapper.selectFgwLdpsNew(xmId);
+        if(fgwLdpsList.size()==1){
+            //如果只有一条数据,则说明当前删除的就是最新的
+            FgwXmsb fgwXmsb = new FgwXmsb();
+            fgwXmsb.setId(xmId);
+            fgwXmsb.setPsnr("");
+            fgwXmsbMapper.updateFgwXmsb(fgwXmsb);
+        }else{
+            //判断第一条是否与要删除的ID相同
+            if(fgwLdpsList.get(0).getId().equals(id)){
+                //将主表中的批示内容换成第二条
+                FgwXmsb fgwXmsb = new FgwXmsb();
+                fgwXmsb.setId(xmId);
+                fgwXmsb.setPsnr(fgwLdpsList.get(1).getPsnr());
+                fgwXmsbMapper.updateFgwXmsb(fgwXmsb);
+            }
+        }
         return fgwLdpsMapper.deleteFgwLdpsById(id);
     }
 

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/projectV2/IZsyzLdpsService.java

@@ -57,7 +57,7 @@ public interface IZsyzLdpsService
      * @param id 招商引资_领导批示主键
      * @return 结果
      */
-    public int deleteZsyzLdpsById(Long id);
+    public int deleteZsyzLdpsById(Long id,Long xmId);
 
     public ZsyzLdps getInfoZc(ZsyzLdps zsyzLdps);
 }

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

@@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <select id="selectFgwFjByXmId" parameterType="Long" resultMap="FgwFjResult">
         <include refid="selectFgwFjVo"/>
-        where xm_id = #{id}
+        where xm_id = #{id} and type != '18'
     </select>
     <select id="selectFgwFjBySourceId" parameterType="Long" resultMap="FgwFjResult">
         <include refid="selectFgwFjVo"/>

+ 6 - 0
ruoyi-system/src/main/resources/mapper/system/fgw/FgwLdpsMapper.xml

@@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="xgr != null  and xgr != ''"> and xgr = #{xgr}</if>
             <if test="xgsj != null "> and xgsj = #{xgsj}</if>
         </where>
+        order by cjsj desc
     </select>
     
     <select id="selectFgwLdpsById" parameterType="Long" resultMap="FgwLdpsResult">
@@ -54,6 +55,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and zcpsnr is not null
         and (psnr = '' or psnr is null)
     </select>
+    <select id="selectFgwLdpsNew" resultMap="FgwLdpsResult">
+        <include refid="selectFgwLdpsVo"/>
+        where xm_id = #{xmId} and psnr is not null
+        order by xgsj desc limit 2;
+    </select>
 
     <insert id="insertFgwLdps" parameterType="FgwLdps" useGeneratedKeys="true" keyProperty="id">
         insert into fgw_ldps

+ 1 - 0
ruoyi-system/src/main/resources/mapper/system/fgw/FgwXmsbMapper.xml

@@ -85,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </where>
         ${params.dataScope}
+        order by create_time desc
     </select>
     
     <select id="selectFgwXmsbById" parameterType="Long" resultMap="FgwXmsbResult">

+ 6 - 0
ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzLdpsMapper.xml

@@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             <if test="psnrId != null "> and psnr_id = #{psnrId}</if>
         </where>
+        order by cjsj desc
     </select>
     
     <select id="selectZsyzLdpsById" parameterType="Long" resultMap="ZsyzLdpsResult">
@@ -47,6 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and zcpsnr is not null
         and (psnr = '' or psnr is null)
     </select>
+    <select id="selectZsyzLdpsNew" resultMap="ZsyzLdpsResult">
+        <include refid="selectZsyzLdpsVo"/>
+        where xm_id = #{xmId}  and psnr is not null
+        order by xgsj desc limit 2;
+    </select>
 
     <insert id="insertZsyzLdps" parameterType="ZsyzLdps" useGeneratedKeys="true" keyProperty="id">
         insert into zsyz_ldps