dongdingding 2 months ago
commit 7c4eff528e

@ -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());

@ -48,6 +48,12 @@ public class AssetBasicNetwork extends BaseClass implements Serializable {
*/
@ApiModelProperty("设备IP")
private String sbIp;
/**
* IP
*/
@ApiModelProperty("设备IP类型")
private String ipType;
/**
*
*/

@ -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<String> glymList;
private List<Acomma> glymList;
@ApiModelProperty("关联iplist")
@TableField(exist = false)
private List<String> glIpList;
private List<Acomma> 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;
/**
* -

@ -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;
}

@ -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<AssetCurrentMapper, Ass
byId.setJcwlList(assetBasicNetworkService.lambdaQuery().eq(AssetBasicNetwork::getAssetId,id).eq(AssetBasicNetwork::getDelFlag,"0").list());
byId.setXjgywxt(assetBusinessFormService.lambdaQuery().eq(AssetBusinessForm::getAssetId,id).eq(AssetBusinessForm::getDelFlag,"0").one());
byId.setOtherConcat(unitOtherConcatService.lambdaQuery().eq(UnitOtherConcat::getAssetId,id).eq(UnitOtherConcat::getDelFlag,"0").list());
byId.setGlymList(Arrays.asList(byId.getGlym().split(",")));
byId.setGlIpList(Arrays.asList(byId.getGlIp().split(",")));
List<Acomma> a1 = new ArrayList<>();
Arrays.asList(byId.getGlym().split(",")).forEach(x->{
Acomma acomma = new Acomma();
acomma.setKey(x);
a1.add(acomma);
});
byId.setGlymList(a1);
List<Acomma> 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;
}

Loading…
Cancel
Save