cxd 7 hónapja
szülő
commit
b34d816a11

+ 9 - 0
gqy-admin/src/main/java/com/gqy/web/controller/document/DcSystemController.java

@@ -45,6 +45,15 @@ public class DcSystemController extends BaseController {
         return iDcSystemService.updateDcSystem(dcSystem);
     }
 
+    /**
+     * 删除系统工程
+     */
+    @GetMapping("/dele/{sysId}")
+    public @ResponseBody AjaxResult delete(@PathVariable Long sysId) {
+        return iDcSystemService.deleteDcSystem(sysId);
+    }
+
+
 
     /**
      * 查询列表信息

+ 8 - 0
gqy-system/src/main/java/com/gqy/document/mapper/DcSystemMapper.java

@@ -21,6 +21,12 @@ public interface DcSystemMapper {
      */
     public List<DcSystem> selectDcSystemList(DcSystem dcSystem);
 
+    /**
+     * 查询Id
+     * @param id
+     * @return
+     */
+    public DcSystem selectDcSystemById(Long id);
 
     /**
      * 更新
@@ -29,4 +35,6 @@ public interface DcSystemMapper {
      */
     public int updateDcSystem(DcSystem dcSystem);
 
+
+
 }

+ 6 - 0
gqy-system/src/main/java/com/gqy/document/service/IDcSystemService.java

@@ -28,5 +28,11 @@ public interface IDcSystemService {
      */
     public AjaxResult updateDcSystem(DcSystem dcSystem);
 
+    /**
+     * 删除
+     * @param Long
+     * @return
+     */
+    public AjaxResult deleteDcSystem(Long sysId);
 
 }

+ 14 - 1
gqy-system/src/main/java/com/gqy/document/service/impl/DcSystemServiceImpl.java

@@ -1,8 +1,10 @@
 package com.gqy.document.service.impl;
 
 import com.gqy.common.core.domain.AjaxResult;
+import com.gqy.common.enums.UserStatus;
 import com.gqy.common.utils.SecurityUtils;
 import com.gqy.document.domain.DcSystem;
+import com.gqy.document.domain.DcWork;
 import com.gqy.document.mapper.DcSystemMapper;
 import com.gqy.document.service.IDcSystemService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -48,7 +50,18 @@ public class DcSystemServiceImpl implements IDcSystemService {
         return AjaxResult.success("新增系统配置成功");
     }
 
-
+    /**
+     * 删除系统
+     * @param Long id
+     * @return
+     */
+    public AjaxResult deleteDcSystem(Long id) {
+        DcSystem dcsystem = dcSystemMapper.selectDcSystemById(id);
+        if(dcsystem != null){
+            dcsystem.setSysStatus(Integer.valueOf(UserStatus.DELETED.getCode()));
+        }
+        return updateDcSystem(dcsystem);
+    }
 
 
     /**

+ 4 - 0
gqy-system/src/main/resources/mapper/document/DcSystemMapper.xml

@@ -19,6 +19,9 @@
     <select id="selectDcSystemList" parameterType="DcSystem" resultMap="DcSystemResult">
         <include refid="selectDcSystemVo"/>
         <where>
+            <if test="sysId!= null">
+                AND sys_id = #{sysId}
+            </if>
             <if test="sysName != null and sysName != ''">
                 AND sys_name like concat('%', #{sysName}, '%')
             </if>
@@ -59,6 +62,7 @@
             <if test="sysNo != null">sys_no = #{sysNo},</if>
             <if test="sysRemark != null">sys_remark = #{sysRemark},</if>
             <if test="sysProducts != null">sys_products = #{sysProducts}</if>
+            <if test="sysStatus != null">sys_status = #{sysStatus}</if>
         </set>
         where sys_id = #{sysId}
     </update>