From 72dc1197ebfe2159f1f59b9f46577523cf31f9eb Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Thu, 8 Aug 2024 15:12:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B6=89=E5=AF=86=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../property/TdPropertyNetController.java | 48 +++++++++---------- .../mapper/TdPropertyNetinfoMapper.java | 5 +- .../service/ITdPropertyNetinfoService.java | 5 +- .../impl/TdPropertyNetinfoServiceImpl.java | 5 +- 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyNetController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyNetController.java index 25c068d..030db09 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyNetController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyNetController.java @@ -2,7 +2,9 @@ package com.ruoyi.web.controller.system.property; import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.common.utils.uuid.Seq; +import com.ruoyi.system.service.ITdPropertyNetinfoService; import com.ruoyi.web.controller.manager.SysAreaManager; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -26,26 +28,27 @@ import javax.annotation.Resource; /** * 涉密网络设备Controller - * + * * @author ruoyi * @date 2024-05-09 */ @Controller @RequestMapping("/system/network") -public class TdPropertyNetController extends BaseController -{ +public class TdPropertyNetController extends BaseController { private String prefix = "system/network/network"; @Autowired private ITdPropertyNetService tdPropertyNetService; + @Autowired + private ITdPropertyNetinfoService tdPropertyNetinfoService; + @Resource private SysAreaManager sysAreaManager; @RequiresPermissions("system:network:view") @GetMapping() - public String network() - { + public String network() { return prefix + "/network"; } @@ -55,8 +58,7 @@ public class TdPropertyNetController extends BaseController @RequiresPermissions("system:network:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(TdPropertyNet tdPropertyNet) - { + public TableDataInfo list(TdPropertyNet tdPropertyNet) { startPage(); List list = tdPropertyNetService.selectTdPropertyNetList(tdPropertyNet); return getDataTable(list); @@ -69,8 +71,7 @@ public class TdPropertyNetController extends BaseController @Log(title = "涉密网络设备", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(TdPropertyNet tdPropertyNet) - { + public AjaxResult export(TdPropertyNet tdPropertyNet) { List list = tdPropertyNetService.selectTdPropertyNetList(tdPropertyNet); list.forEach(tdPropertyNet1 -> { tdPropertyNet1.setFramework(sysAreaManager.getAreaName(tdPropertyNet1.getFramework())); @@ -84,9 +85,8 @@ public class TdPropertyNetController extends BaseController * 新增涉密网络设备 */ @GetMapping("/add") - public String add(ModelMap mmap) - { - mmap.put("sysuser",getSysUser()); + public String add(ModelMap mmap) { + mmap.put("sysuser", getSysUser()); return prefix + "/add"; } @@ -97,9 +97,8 @@ public class TdPropertyNetController extends BaseController @Log(title = "涉密网络设备", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(TdPropertyNet tdPropertyNet) - { - tdPropertyNet.setNetId("Net_"+ Seq.getId(Seq.commSeqType)); + public AjaxResult addSave(TdPropertyNet tdPropertyNet) { + tdPropertyNet.setNetId("Net_" + Seq.getId(Seq.commSeqType)); return toAjax(tdPropertyNetService.insertTdPropertyNet(tdPropertyNet)); } @@ -108,8 +107,7 @@ public class TdPropertyNetController extends BaseController */ @RequiresPermissions("system:network:edit") @GetMapping("/edit/{netId}") - public String edit(@PathVariable("netId") String netId, ModelMap mmap) - { + public String edit(@PathVariable("netId") String netId, ModelMap mmap) { TdPropertyNet tdPropertyNet = tdPropertyNetService.selectTdPropertyNetByNetId(netId); mmap.put("tdPropertyNet", tdPropertyNet); return prefix + "/edit"; @@ -122,8 +120,7 @@ public class TdPropertyNetController extends BaseController @Log(title = "涉密网络设备", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(TdPropertyNet tdPropertyNet) - { + public AjaxResult editSave(TdPropertyNet tdPropertyNet) { return toAjax(tdPropertyNetService.updateTdPropertyNet(tdPropertyNet)); } @@ -132,10 +129,12 @@ public class TdPropertyNetController extends BaseController */ @RequiresPermissions("system:network:remove") @Log(title = "涉密网络设备", businessType = BusinessType.DELETE) - @PostMapping( "/remove") + @PostMapping("/remove") @ResponseBody - public AjaxResult remove(String ids) - { + public AjaxResult remove(String ids) { + QueryWrapper queryWrapper= new QueryWrapper(); + queryWrapper.in("net_id",ids.split(",")); + tdPropertyNetinfoService.remove(queryWrapper); return toAjax(tdPropertyNetService.deleteTdPropertyNetByNetIds(ids)); } @@ -144,9 +143,8 @@ public class TdPropertyNetController extends BaseController */ @RequiresPermissions("system:network:list") @GetMapping("/detail/{netId}") - public String detail(@PathVariable("netId") String netId, ModelMap mmap) - { - mmap.put("netId",netId); + public String detail(@PathVariable("netId") String netId, ModelMap mmap) { + mmap.put("netId", netId); return "system/network/netinfo/netinfo"; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyNetinfoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyNetinfoMapper.java index 9c66530..e8ca876 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyNetinfoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyNetinfoMapper.java @@ -1,6 +1,9 @@ package com.ruoyi.system.mapper; import java.util.List; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.domain.TdPropertyNetinfo; /** @@ -9,7 +12,7 @@ import com.ruoyi.system.domain.TdPropertyNetinfo; * @author ruoyi * @date 2024-05-09 */ -public interface TdPropertyNetinfoMapper +public interface TdPropertyNetinfoMapper extends BaseMapper { /** * 查询涉密网络登记 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyNetinfoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyNetinfoService.java index 075e8fa..f33cd51 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyNetinfoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyNetinfoService.java @@ -1,6 +1,9 @@ package com.ruoyi.system.service; import java.util.List; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.domain.TdPropertyNetinfo; /** @@ -9,7 +12,7 @@ import com.ruoyi.system.domain.TdPropertyNetinfo; * @author ruoyi * @date 2024-05-09 */ -public interface ITdPropertyNetinfoService +public interface ITdPropertyNetinfoService extends IService { /** * 查询涉密网络登记 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyNetinfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyNetinfoServiceImpl.java index 4524a66..7102514 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyNetinfoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyNetinfoServiceImpl.java @@ -1,6 +1,8 @@ package com.ruoyi.system.service.impl; import java.util.List; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.TdPropertyNetinfoMapper; @@ -15,7 +17,8 @@ import com.ruoyi.common.core.text.Convert; * @date 2024-05-09 */ @Service -public class TdPropertyNetinfoServiceImpl implements ITdPropertyNetinfoService +public class TdPropertyNetinfoServiceImpl extends ServiceImpl implements ITdPropertyNetinfoService + { @Autowired private TdPropertyNetinfoMapper tdPropertyNetinfoMapper;