diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java index 6372b54..0589868 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java @@ -97,8 +97,22 @@ public class AssetCurrentController extends BaseController { @PostMapping @Transactional(rollbackFor = Exception.class) public AjaxResult insert(@RequestBody AssetCurrent assetCurrent) { - assetCurrent.setGlym(String.join(",",assetCurrent.getGlymList())); - assetCurrent.setGlIp(String.join(",",assetCurrent.getGlIpList())); + StringBuilder a = new StringBuilder(); + if(!assetCurrent.getGlymList().isEmpty()){ + assetCurrent.getGlymList().forEach(x->{ + a.append(x); + a.append(","); + }); + } + assetCurrent.setGlym(a.toString()); + StringBuilder b = new StringBuilder(); + if(!assetCurrent.getGlIpList().isEmpty()){ + assetCurrent.getGlymList().forEach(x->{ + b.append(x); + b.append(","); + }); + } + assetCurrent.setGlIp(b.toString()); assetCurrentService.save(assetCurrent); //新增新监管业务形态 if (assetCurrent.getXjgywxt() != null) { @@ -138,8 +152,22 @@ public class AssetCurrentController extends BaseController { @ApiOperation(value = "修改数据") @PutMapping public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) { - assetCurrent.setGlym(String.join(",",assetCurrent.getGlymList())); - assetCurrent.setGlIp(String.join(",",assetCurrent.getGlIpList())); + StringBuilder a = new StringBuilder(); + if(!assetCurrent.getGlymList().isEmpty()){ + assetCurrent.getGlymList().forEach(x->{ + a.append(x); + a.append(","); + }); + } + assetCurrent.setGlym(a.toString()); + StringBuilder b = new StringBuilder(); + if(!assetCurrent.getGlIpList().isEmpty()){ + assetCurrent.getGlymList().forEach(x->{ + b.append(x); + b.append(","); + }); + } + assetCurrent.setGlIp(b.toString()); assetCurrentService.updateById(assetCurrent); if (assetCurrent.getXjgywxt() != null) { assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetBasicNetwork.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetBasicNetwork.java index 89acd9d..24d3c26 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetBasicNetwork.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetBasicNetwork.java @@ -48,6 +48,12 @@ public class AssetBasicNetwork extends BaseClass implements Serializable { */ @ApiModelProperty("设备IP") private String sbIp; + + /** + * 设备IP类型 + */ + @ApiModelProperty("设备IP类型") + private String ipType; /** * 操作系统 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetCurrent.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetCurrent.java index c70c21f..536e3e5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetCurrent.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetCurrent.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.ruoyi.common.annotation.Excel; import com.ruoyi.tc.baseClass.BaseClass; +import com.ruoyi.tc.entity.request.Acomma; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -110,12 +111,12 @@ public class AssetCurrent extends BaseClass implements Serializable { @ApiModelProperty("关联域名list") @TableField(exist = false) - private List glymList; + private List glymList; @ApiModelProperty("关联iplist)") @TableField(exist = false) - private List glIpList; + private List glIpList; /** * 关联ip(多个用,分隔) @@ -225,12 +226,12 @@ public class AssetCurrent extends BaseClass implements Serializable { */ @ApiModelProperty("存活率(字典)") private String chl; - /** - * 地理位置 - */ - @Size(max= 255,message="地理位置长度不能超过255") - @ApiModelProperty("地理位置") - private String dlwz; +// /** +// * 地理位置 +// */ +// @Size(max= 255,message="地理位置长度不能超过255") +// @ApiModelProperty("地理位置") +// private String dlwz; /** * 经度 */ @@ -693,17 +694,14 @@ public class AssetCurrent extends BaseClass implements Serializable { @ApiModelProperty("地理位置-省") @Excel(name = "地理位置-省",sort = 46) - @TableField(exist = false) private String sheng; @ApiModelProperty("地理位置-市") @Excel(name = "地理位置-市",sort = 47) - @TableField(exist = false) private String shi; @ApiModelProperty("地理位置-区(县)") @Excel(name = "地理位置-区(县)",sort = 48) - @TableField(exist = false) private String qu; /** * 等保信息-测评得分 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/Acomma.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/Acomma.java new file mode 100644 index 0000000..07a3ef3 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/Acomma.java @@ -0,0 +1,15 @@ +package com.ruoyi.tc.entity.request; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author du + * @since 2024/11/20 13:52 + */ +@Data +public class Acomma { + + @ApiModelProperty("key") + private String key; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java index 7284e71..8b3bfcd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.tc.service.impl; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.tc.entity.*; +import com.ruoyi.tc.entity.request.Acomma; import com.ruoyi.tc.entity.request.AssetCurrentPageRequest; import com.ruoyi.tc.mapper.AssetCurrentMapper; import com.ruoyi.tc.service.*; @@ -10,6 +11,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.io.Serializable; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -69,8 +71,20 @@ public class AssetCurrentServiceImpl extends ServiceImpl a1 = new ArrayList<>(); + Arrays.asList(byId.getGlym().split(",")).forEach(x->{ + Acomma acomma = new Acomma(); + acomma.setKey(x); + a1.add(acomma); + }); + byId.setGlymList(a1); + List a2 = new ArrayList<>(); + Arrays.asList(byId.getGlIp().split(",")).forEach(x->{ + Acomma acomma = new Acomma(); + acomma.setKey(x); + a2.add(acomma); + }); + byId.setGlIpList(a2); return byId; }