优化交换机数据采集、脚本策略、agent更新优化、注册增加路由信息
This commit is contained in:
		@@ -112,7 +112,7 @@ public interface RemoteRevenueConfigService
 | 
				
			|||||||
     * @param source
 | 
					     * @param source
 | 
				
			||||||
     * @return
 | 
					     * @return
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @PostMapping("/registration/innerupdateRegist")
 | 
					    @PostMapping("/registration/innerUpdateRegist")
 | 
				
			||||||
    public R<Integer> innerUpdateRegist(@RequestBody RmResourceRegistrationRemote rmResourceRegistrationRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 | 
					    public R<Integer> innerUpdateRegist(@RequestBody RmResourceRegistrationRemote rmResourceRegistrationRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -86,4 +86,13 @@ public interface RemoteRocketMqService {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    @PostMapping("/monitorPolicy/updatePolicyMsgInner")
 | 
					    @PostMapping("/monitorPolicy/updatePolicyMsgInner")
 | 
				
			||||||
    public R<Integer> updatePolicyMsgInner(@RequestBody RmMonitorPolicyRemote rmMonitorPolicyRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 | 
					    public R<Integer> updatePolicyMsgInner(@RequestBody RmMonitorPolicyRemote rmMonitorPolicyRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 下发优先级为0的策略
 | 
				
			||||||
 | 
					     * @param clientId
 | 
				
			||||||
 | 
					     * @param source
 | 
				
			||||||
 | 
					     * @return
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    @GetMapping("/monitorPolicy/issueDefaultPolicyByClientId")
 | 
				
			||||||
 | 
					    public R<Integer> issueDefaultPolicyByClientId(String clientId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					package com.ruoyi.system.api.domain;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Data
 | 
				
			||||||
 | 
					public class RouteMsg {
 | 
				
			||||||
 | 
					    /** 网卡名称 */
 | 
				
			||||||
 | 
					    private String name;
 | 
				
			||||||
 | 
					    /** 网关地址 */
 | 
				
			||||||
 | 
					    private String gateway;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -72,6 +72,11 @@ public class RemoteRocketMqFallbackFactory implements FallbackFactory<RemoteRock
 | 
				
			|||||||
            public R<Integer> updatePolicyMsgInner(RmMonitorPolicyRemote rmMonitorPolicyRemote, String source) {
 | 
					            public R<Integer> updatePolicyMsgInner(RmMonitorPolicyRemote rmMonitorPolicyRemote, String source) {
 | 
				
			||||||
                return R.fail(throwable.getMessage());
 | 
					                return R.fail(throwable.getMessage());
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public R<Integer> issueDefaultPolicyByClientId(String clientId, String source) {
 | 
				
			||||||
 | 
					                return R.fail(throwable.getMessage());
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -209,7 +209,7 @@ public class RmResourceRegistrationController extends BaseController
 | 
				
			|||||||
    @PostMapping("/bindBusinessPubulicIp")
 | 
					    @PostMapping("/bindBusinessPubulicIp")
 | 
				
			||||||
    public AjaxResult bindBusinessPubulicIp(@RequestBody RmResourceRegistration rmResourceRegistration)
 | 
					    public AjaxResult bindBusinessPubulicIp(@RequestBody RmResourceRegistration rmResourceRegistration)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        int rows = rmResourceRegistrationService.bindBusinessPubulicIp(rmResourceRegistration);
 | 
					        int rows = rmResourceRegistrationService.bindBusinessPublicIp(rmResourceRegistration);
 | 
				
			||||||
        return toAjax(rows);
 | 
					        return toAjax(rows);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,8 @@ public class RmEpsTopologyManagement extends BaseEntity
 | 
				
			|||||||
    /** 交换机硬件SN */
 | 
					    /** 交换机硬件SN */
 | 
				
			||||||
    @Excel(name = "交换机硬件SN")
 | 
					    @Excel(name = "交换机硬件SN")
 | 
				
			||||||
    private String switchSn;
 | 
					    private String switchSn;
 | 
				
			||||||
 | 
					    /** 交换机clientId */
 | 
				
			||||||
 | 
					    private String clientId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /** 接口名称 */
 | 
					    /** 接口名称 */
 | 
				
			||||||
    @Excel(name = "接口名称")
 | 
					    @Excel(name = "接口名称")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,9 +7,11 @@ import java.time.Instant;
 | 
				
			|||||||
@Data
 | 
					@Data
 | 
				
			||||||
public class RspVo {
 | 
					public class RspVo {
 | 
				
			||||||
    /** 状态码,0、失败;1、成功*/
 | 
					    /** 状态码,0、失败;1、成功*/
 | 
				
			||||||
    private int resCode;
 | 
					    private Integer resCode;
 | 
				
			||||||
    /** 描述 */
 | 
					    /** 描述 */
 | 
				
			||||||
    private String resMag;
 | 
					    private String resMag;
 | 
				
			||||||
 | 
					    /** 路由 */
 | 
				
			||||||
 | 
					    private String addRoute;
 | 
				
			||||||
    /** 时间戳 */
 | 
					    /** 时间戳 */
 | 
				
			||||||
    private long timestamp = Instant.now().getEpochSecond();
 | 
					    private long timestamp = Instant.now().getEpochSecond();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -112,5 +112,5 @@ public interface IRmResourceRegistrationService
 | 
				
			|||||||
     * @param rmResourceRegistration
 | 
					     * @param rmResourceRegistration
 | 
				
			||||||
     * @return
 | 
					     * @return
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    int bindBusinessPubulicIp(RmResourceRegistration rmResourceRegistration);
 | 
					    int bindBusinessPublicIp(RmResourceRegistration rmResourceRegistration);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,10 +9,7 @@ import com.ruoyi.common.core.utils.StringUtils;
 | 
				
			|||||||
import com.ruoyi.common.core.web.domain.AjaxResult;
 | 
					import com.ruoyi.common.core.web.domain.AjaxResult;
 | 
				
			||||||
import com.ruoyi.common.security.utils.SecurityUtils;
 | 
					import com.ruoyi.common.security.utils.SecurityUtils;
 | 
				
			||||||
import com.ruoyi.system.api.RemoteRocketMqService;
 | 
					import com.ruoyi.system.api.RemoteRocketMqService;
 | 
				
			||||||
import com.ruoyi.system.api.domain.NetworkInfo;
 | 
					import com.ruoyi.system.api.domain.*;
 | 
				
			||||||
import com.ruoyi.system.api.domain.RmNetworkInterfaceRemote;
 | 
					 | 
				
			||||||
import com.ruoyi.system.api.domain.RmRegisterMsgRemote;
 | 
					 | 
				
			||||||
import com.ruoyi.system.api.domain.RmResourceRegistrationRemote;
 | 
					 | 
				
			||||||
import com.ruoyi.system.domain.*;
 | 
					import com.ruoyi.system.domain.*;
 | 
				
			||||||
import com.ruoyi.system.domain.vo.MessageVo;
 | 
					import com.ruoyi.system.domain.vo.MessageVo;
 | 
				
			||||||
import com.ruoyi.system.domain.vo.ResourceVo;
 | 
					import com.ruoyi.system.domain.vo.ResourceVo;
 | 
				
			||||||
@@ -25,10 +22,7 @@ import org.springframework.stereotype.Service;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import java.math.BigDecimal;
 | 
					import java.math.BigDecimal;
 | 
				
			||||||
import java.math.RoundingMode;
 | 
					import java.math.RoundingMode;
 | 
				
			||||||
import java.util.Date;
 | 
					import java.util.*;
 | 
				
			||||||
import java.util.HashMap;
 | 
					 | 
				
			||||||
import java.util.List;
 | 
					 | 
				
			||||||
import java.util.Map;
 | 
					 | 
				
			||||||
import java.util.stream.Collectors;
 | 
					import java.util.stream.Collectors;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -530,6 +524,24 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
 | 
				
			|||||||
                        content.append("流量网口设置为").append(networkInfo.getName());
 | 
					                        content.append("流量网口设置为").append(networkInfo.getName());
 | 
				
			||||||
                        recordAddData.setChangeContent(content.toString());
 | 
					                        recordAddData.setChangeContent(content.toString());
 | 
				
			||||||
                        epsMethodChangeRecordMapper.insertEpsMethodChangeRecord(recordAddData);
 | 
					                        epsMethodChangeRecordMapper.insertEpsMethodChangeRecord(recordAddData);
 | 
				
			||||||
 | 
					                        // 设置路由信息
 | 
				
			||||||
 | 
					                        RouteMsg routeMsg = new RouteMsg();
 | 
				
			||||||
 | 
					                        routeMsg.setName(networkInfo.getName());
 | 
				
			||||||
 | 
					                        routeMsg.setGateway(networkInfo.getGateway());
 | 
				
			||||||
 | 
					                        // 构建注册应答信息
 | 
				
			||||||
 | 
					                        MessageVo messageVo = new MessageVo();
 | 
				
			||||||
 | 
					                        messageVo.setClientId(registerMsg.getClientId());
 | 
				
			||||||
 | 
					                        messageVo.setDataType(MsgEnum.注册应答.getValue());
 | 
				
			||||||
 | 
					                        RspVo rspVo = new RspVo();
 | 
				
			||||||
 | 
					                        rspVo.setResCode(1);
 | 
				
			||||||
 | 
					                        rspVo.setResMag("注册成功");
 | 
				
			||||||
 | 
					                        rspVo.setAddRoute(JSONObject.toJSONString(routeMsg));
 | 
				
			||||||
 | 
					                        messageVo.setData(JSONObject.toJSONString(rspVo));
 | 
				
			||||||
 | 
					                        remoteRocketMqService.sendAsyncProducerMessage(
 | 
				
			||||||
 | 
					                                "tr_agent_down", "", "regist_rsp", JSONObject.toJSONString(messageVo), SecurityConstants.INNER
 | 
				
			||||||
 | 
					                        );
 | 
				
			||||||
 | 
					                        // 第一次注册
 | 
				
			||||||
 | 
					                        return 2;
 | 
				
			||||||
                    }else{
 | 
					                    }else{
 | 
				
			||||||
                        insertData.setClientId(registerMsg.getClientId());
 | 
					                        insertData.setClientId(registerMsg.getClientId());
 | 
				
			||||||
                        insertData.setHardwareSn(registerMsg.getSn());
 | 
					                        insertData.setHardwareSn(registerMsg.getSn());
 | 
				
			||||||
@@ -539,32 +551,8 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
 | 
				
			|||||||
                        insertData.setCreateTime(createTime);
 | 
					                        insertData.setCreateTime(createTime);
 | 
				
			||||||
                        rmResourceRegistrationMapper.insertRmResourceRegistration(insertData);
 | 
					                        rmResourceRegistrationMapper.insertRmResourceRegistration(insertData);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    // 构建注册应答信息
 | 
					 | 
				
			||||||
                    MessageVo messageVo = new MessageVo();
 | 
					 | 
				
			||||||
                    messageVo.setClientId(registerMsg.getClientId());
 | 
					 | 
				
			||||||
                    messageVo.setDataType(MsgEnum.注册应答.getValue());
 | 
					 | 
				
			||||||
                    RspVo rspVo = new RspVo();
 | 
					 | 
				
			||||||
                    rspVo.setResCode(1);
 | 
					 | 
				
			||||||
                    rspVo.setResMag("注册成功");
 | 
					 | 
				
			||||||
                    messageVo.setData(JSONObject.toJSONString(rspVo));
 | 
					 | 
				
			||||||
                    remoteRocketMqService.sendAsyncProducerMessage(
 | 
					 | 
				
			||||||
                            "tr_agent_down", "", "", JSONObject.toJSONString(messageVo), SecurityConstants.INNER
 | 
					 | 
				
			||||||
                    );
 | 
					 | 
				
			||||||
                    // 第一次注册
 | 
					 | 
				
			||||||
                    return 2;
 | 
					 | 
				
			||||||
                }catch (Exception e){
 | 
					                }catch (Exception e){
 | 
				
			||||||
                    log.error("注册服务器失败:{}",e.getMessage());
 | 
					                    log.error("注册服务器失败:{}",e.getMessage());
 | 
				
			||||||
                    // 构建注册应答信息
 | 
					 | 
				
			||||||
                    MessageVo messageVo = new MessageVo();
 | 
					 | 
				
			||||||
                    messageVo.setClientId(registerMsg.getClientId());
 | 
					 | 
				
			||||||
                    messageVo.setDataType(MsgEnum.注册应答.getValue());
 | 
					 | 
				
			||||||
                    RspVo rspVo = new RspVo();
 | 
					 | 
				
			||||||
                    rspVo.setResCode(1);
 | 
					 | 
				
			||||||
                    rspVo.setResMag("平台错误信息:" + e.getMessage());
 | 
					 | 
				
			||||||
                    messageVo.setData(JSONObject.toJSONString(rspVo));
 | 
					 | 
				
			||||||
                    remoteRocketMqService.sendAsyncProducerMessage(
 | 
					 | 
				
			||||||
                            "tr_agent_down", "", "", JSONObject.toJSONString(messageVo), SecurityConstants.INNER
 | 
					 | 
				
			||||||
                    );
 | 
					 | 
				
			||||||
                    return 0;
 | 
					                    return 0;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@@ -601,34 +589,78 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public int bindBusinessPubulicIp(RmResourceRegistration rmResourceRegistration) {
 | 
					    public int bindBusinessPublicIp(RmResourceRegistration rmResourceRegistration) {
 | 
				
			||||||
        List<Map> bindMsgMap = rmResourceRegistration.getBindNetworkMsg();
 | 
					        // 参数校验
 | 
				
			||||||
        for (Map map : bindMsgMap) {
 | 
					        if (rmResourceRegistration == null || StringUtils.isEmpty(rmResourceRegistration.getClientId())) {
 | 
				
			||||||
            // id
 | 
					            throw new IllegalArgumentException("参数不合法");
 | 
				
			||||||
            Long id = (Long) map.get("id");
 | 
					 | 
				
			||||||
            String status = map.get("status").toString();
 | 
					 | 
				
			||||||
            String interfaceName = map.get("interfaceName").toString();
 | 
					 | 
				
			||||||
            // 绑定ip
 | 
					 | 
				
			||||||
            RmNetworkInterfaceRemote rmNetworkInterfaceRemote = new RmNetworkInterfaceRemote();
 | 
					 | 
				
			||||||
            rmNetworkInterfaceRemote.setId(id);
 | 
					 | 
				
			||||||
            rmNetworkInterfaceRemote.setBindIp(status);
 | 
					 | 
				
			||||||
            remoteRocketMqService.bindPublicIp(rmNetworkInterfaceRemote, SecurityConstants.INNER);
 | 
					 | 
				
			||||||
            // 添加业务变更记录
 | 
					 | 
				
			||||||
            EpsMethodChangeRecord recordAddData = new EpsMethodChangeRecord();
 | 
					 | 
				
			||||||
            recordAddData.setClientId(rmResourceRegistration.getClientId());
 | 
					 | 
				
			||||||
            recordAddData.setTrafficPort(interfaceName);
 | 
					 | 
				
			||||||
            recordAddData.setUpdateTime(DateUtils.getNowDate());
 | 
					 | 
				
			||||||
            recordAddData.setUpdateBy(SecurityUtils.getUsername());
 | 
					 | 
				
			||||||
            recordAddData.setCreatBy(SecurityUtils.getUsername());
 | 
					 | 
				
			||||||
            StringBuilder content = new StringBuilder();
 | 
					 | 
				
			||||||
            content.append("流量网口设置为").append(interfaceName);
 | 
					 | 
				
			||||||
            recordAddData.setChangeContent(content.toString());
 | 
					 | 
				
			||||||
            epsMethodChangeRecordMapper.insertEpsMethodChangeRecord(recordAddData);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // 修改多公网IP状态为已绑定
 | 
					
 | 
				
			||||||
 | 
					        String clientId = rmResourceRegistration.getClientId();
 | 
				
			||||||
 | 
					        String username = SecurityUtils.getUsername();
 | 
				
			||||||
 | 
					        Date now = DateUtils.getNowDate();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 1. 处理IP绑定和记录
 | 
				
			||||||
 | 
					        rmResourceRegistration.getBindNetworkMsg().forEach(map -> {
 | 
				
			||||||
 | 
					            // 绑定IP
 | 
				
			||||||
 | 
					            RmNetworkInterfaceRemote network = new RmNetworkInterfaceRemote();
 | 
				
			||||||
 | 
					            network.setId((Long) map.get("id"));
 | 
				
			||||||
 | 
					            network.setBindIp(map.get("status").toString());
 | 
				
			||||||
 | 
					            remoteRocketMqService.bindPublicIp(network, SecurityConstants.INNER);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 添加变更记录
 | 
				
			||||||
 | 
					            EpsMethodChangeRecord record = new EpsMethodChangeRecord();
 | 
				
			||||||
 | 
					            record.setClientId(clientId);
 | 
				
			||||||
 | 
					            record.setTrafficPort(map.get("interfaceName").toString());
 | 
				
			||||||
 | 
					            record.setUpdateTime(now);
 | 
				
			||||||
 | 
					            record.setUpdateBy(username);
 | 
				
			||||||
 | 
					            record.setCreatBy(username);
 | 
				
			||||||
 | 
					            record.setChangeContent("流量网口设置为" + map.get("interfaceName"));
 | 
				
			||||||
 | 
					            epsMethodChangeRecordMapper.insertEpsMethodChangeRecord(record);
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 2. 更新注册状态
 | 
				
			||||||
        RmResourceRegistration updateData = new RmResourceRegistration();
 | 
					        RmResourceRegistration updateData = new RmResourceRegistration();
 | 
				
			||||||
        updateData.setId(rmResourceRegistration.getId());
 | 
					        updateData.setId(rmResourceRegistration.getId());
 | 
				
			||||||
        updateData.setMultiPublicIpStatus("1");
 | 
					        updateData.setMultiPublicIpStatus("1");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 处理未注册情况
 | 
				
			||||||
 | 
					        RmResourceRegistration isRegist = rmResourceRegistrationMapper.selectRmResourceRegistrationById(rmResourceRegistration.getId());
 | 
				
			||||||
 | 
					        if (isRegist != null && "0".equals(isRegist.getRegistrationStatus())) {
 | 
				
			||||||
 | 
					            RmNetworkInterfaceRemote queryParam = new RmNetworkInterfaceRemote();
 | 
				
			||||||
 | 
					            queryParam.setClientId(clientId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            Optional.ofNullable(remoteRocketMqService.getNetworkInterfaceList(queryParam, SecurityConstants.INNER))
 | 
				
			||||||
 | 
					                    .map(R::getData)
 | 
				
			||||||
 | 
					                    .flatMap(list -> list.stream()
 | 
				
			||||||
 | 
					                            .filter(ni -> "1".equals(ni.getBindIp()) || "3".equals(ni.getBindIp()))
 | 
				
			||||||
 | 
					                            .findFirst())
 | 
				
			||||||
 | 
					                    .ifPresent(network -> {
 | 
				
			||||||
 | 
					                        updateData.setRegistrationStatus("1");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        // 发送注册响应
 | 
				
			||||||
 | 
					                        RouteMsg routeMsg = new RouteMsg();
 | 
				
			||||||
 | 
					                        routeMsg.setName(network.getInterfaceName());
 | 
				
			||||||
 | 
					                        routeMsg.setGateway(network.getGateway());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        MessageVo messageVo = new MessageVo();
 | 
				
			||||||
 | 
					                        messageVo.setClientId(clientId);
 | 
				
			||||||
 | 
					                        messageVo.setDataType(MsgEnum.注册应答.getValue());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        RspVo rspVo = new RspVo();
 | 
				
			||||||
 | 
					                        rspVo.setResCode(1);
 | 
				
			||||||
 | 
					                        rspVo.setResMag("注册成功");
 | 
				
			||||||
 | 
					                        rspVo.setAddRoute(JSONObject.toJSONString(routeMsg));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        messageVo.setData(JSONObject.toJSONString(rspVo));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        remoteRocketMqService.sendAsyncProducerMessage(
 | 
				
			||||||
 | 
					                                "tr_agent_down", "", "regist_rsp", JSONObject.toJSONString(messageVo), SecurityConstants.INNER
 | 
				
			||||||
 | 
					                        );
 | 
				
			||||||
 | 
					                        // 注册成功,下发优先级为0的策略
 | 
				
			||||||
 | 
					                        remoteRocketMqService.issueDefaultPolicyByClientId(clientId, SecurityConstants.INNER);
 | 
				
			||||||
 | 
					                    });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        rmResourceRegistrationMapper.updateRmResourceRegistration(updateData);
 | 
					        rmResourceRegistrationMapper.updateRmResourceRegistration(updateData);
 | 
				
			||||||
        return 1;
 | 
					        return 1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
    <resultMap type="RmEpsTopologyManagement" id="RmEpsTopologyManagementResult">
 | 
					    <resultMap type="RmEpsTopologyManagement" id="RmEpsTopologyManagementResult">
 | 
				
			||||||
        <result property="id"    column="id"    />
 | 
					        <result property="id"    column="id"    />
 | 
				
			||||||
        <result property="switchName"    column="switch_name"    />
 | 
					        <result property="switchName"    column="switch_name"    />
 | 
				
			||||||
 | 
					        <result property="clientId"    column="client_Id"    />
 | 
				
			||||||
        <result property="switchSn"    column="switch_sn"    />
 | 
					        <result property="switchSn"    column="switch_sn"    />
 | 
				
			||||||
        <result property="interfaceName"    column="interface_name"    />
 | 
					        <result property="interfaceName"    column="interface_name"    />
 | 
				
			||||||
        <result property="connectedDeviceType"    column="connected_device_type"    />
 | 
					        <result property="connectedDeviceType"    column="connected_device_type"    />
 | 
				
			||||||
@@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
    </resultMap>
 | 
					    </resultMap>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <sql id="selectRmEpsTopologyManagementVo">
 | 
					    <sql id="selectRmEpsTopologyManagementVo">
 | 
				
			||||||
        select id, switch_name, switch_sn, interface_name, connected_device_type, server_name, server_sn, server_port, create_time, update_time, creator_id, creator_name, updater_id, updater_name, switch_ip_address, peer_switch_name, peer_switch_interface, server_client_id from rm_eps_topology_management
 | 
					        select id, switch_name, client_id, switch_sn, interface_name, connected_device_type, server_name, server_sn, server_port, create_time, update_time, creator_id, creator_name, updater_id, updater_name, switch_ip_address, peer_switch_name, peer_switch_interface, server_client_id from rm_eps_topology_management
 | 
				
			||||||
    </sql>
 | 
					    </sql>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <select id="selectRmEpsTopologyManagementList" parameterType="RmEpsTopologyManagement" resultMap="RmEpsTopologyManagementResult">
 | 
					    <select id="selectRmEpsTopologyManagementList" parameterType="RmEpsTopologyManagement" resultMap="RmEpsTopologyManagementResult">
 | 
				
			||||||
@@ -48,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
            <if test="peerSwitchName != null  and peerSwitchName != ''"> and peer_switch_name like concat('%', #{peerSwitchName}, '%')</if>
 | 
					            <if test="peerSwitchName != null  and peerSwitchName != ''"> and peer_switch_name like concat('%', #{peerSwitchName}, '%')</if>
 | 
				
			||||||
            <if test="peerSwitchInterface != null  and peerSwitchInterface != ''"> and peer_switch_interface = #{peerSwitchInterface}</if>
 | 
					            <if test="peerSwitchInterface != null  and peerSwitchInterface != ''"> and peer_switch_interface = #{peerSwitchInterface}</if>
 | 
				
			||||||
            <if test="serverClientId != null  and serverClientId != ''"> and server_client_id = #{serverClientId}</if>
 | 
					            <if test="serverClientId != null  and serverClientId != ''"> and server_client_id = #{serverClientId}</if>
 | 
				
			||||||
 | 
					            <if test="clientId != null  and clientId != ''"> and client_id = #{clientId}</if>
 | 
				
			||||||
        </where>
 | 
					        </where>
 | 
				
			||||||
    </select>
 | 
					    </select>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -60,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
        insert into rm_eps_topology_management
 | 
					        insert into rm_eps_topology_management
 | 
				
			||||||
        <trim prefix="(" suffix=")" suffixOverrides=",">
 | 
					        <trim prefix="(" suffix=")" suffixOverrides=",">
 | 
				
			||||||
            <if test="switchName != null">switch_name,</if>
 | 
					            <if test="switchName != null">switch_name,</if>
 | 
				
			||||||
 | 
					            <if test="clientId != null">client_id,</if>
 | 
				
			||||||
            <if test="switchSn != null">switch_sn,</if>
 | 
					            <if test="switchSn != null">switch_sn,</if>
 | 
				
			||||||
            <if test="interfaceName != null">interface_name,</if>
 | 
					            <if test="interfaceName != null">interface_name,</if>
 | 
				
			||||||
            <if test="connectedDeviceType != null">connected_device_type,</if>
 | 
					            <if test="connectedDeviceType != null">connected_device_type,</if>
 | 
				
			||||||
@@ -79,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
        </trim>
 | 
					        </trim>
 | 
				
			||||||
        <trim prefix="values (" suffix=")" suffixOverrides=",">
 | 
					        <trim prefix="values (" suffix=")" suffixOverrides=",">
 | 
				
			||||||
            <if test="switchName != null">#{switchName},</if>
 | 
					            <if test="switchName != null">#{switchName},</if>
 | 
				
			||||||
 | 
					            <if test="clientId != null">#{clientId},</if>
 | 
				
			||||||
            <if test="switchSn != null">#{switchSn},</if>
 | 
					            <if test="switchSn != null">#{switchSn},</if>
 | 
				
			||||||
            <if test="interfaceName != null">#{interfaceName},</if>
 | 
					            <if test="interfaceName != null">#{interfaceName},</if>
 | 
				
			||||||
            <if test="connectedDeviceType != null">#{connectedDeviceType},</if>
 | 
					            <if test="connectedDeviceType != null">#{connectedDeviceType},</if>
 | 
				
			||||||
@@ -102,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
        update rm_eps_topology_management
 | 
					        update rm_eps_topology_management
 | 
				
			||||||
        <trim prefix="SET" suffixOverrides=",">
 | 
					        <trim prefix="SET" suffixOverrides=",">
 | 
				
			||||||
            <if test="switchName != null">switch_name = #{switchName},</if>
 | 
					            <if test="switchName != null">switch_name = #{switchName},</if>
 | 
				
			||||||
 | 
					            <if test="clientId != null">client_id = #{clientId},</if>
 | 
				
			||||||
            <if test="switchSn != null">switch_sn = #{switchSn},</if>
 | 
					            <if test="switchSn != null">switch_sn = #{switchSn},</if>
 | 
				
			||||||
            <if test="interfaceName != null">interface_name = #{interfaceName},</if>
 | 
					            <if test="interfaceName != null">interface_name = #{interfaceName},</if>
 | 
				
			||||||
            <if test="connectedDeviceType != null">connected_device_type = #{connectedDeviceType},</if>
 | 
					            <if test="connectedDeviceType != null">connected_device_type = #{connectedDeviceType},</if>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -187,5 +187,15 @@ public class RmMonitorPolicyController extends BaseController
 | 
				
			|||||||
        int rows = rmMonitorPolicyService.updatePolicyMsgInner(rmMonitorPolicy);
 | 
					        int rows = rmMonitorPolicyService.updatePolicyMsgInner(rmMonitorPolicy);
 | 
				
			||||||
        return R.ok(rows);
 | 
					        return R.ok(rows);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 修改资源监控策略
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    @GetMapping("/issueDefaultPolicyByClientId")
 | 
				
			||||||
 | 
					    @InnerAuth
 | 
				
			||||||
 | 
					    public R<Integer> issueDefaultPolicyByClientId(String clientId)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        int rows = rmMonitorPolicyService.issueDefaultPolicyByClientId(clientId);
 | 
				
			||||||
 | 
					        return R.ok(rows);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
 | 
				
			|||||||
import lombok.Data;
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.Date;
 | 
					import java.util.Date;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 服务器脚本策略对象 rm_deployment_policy
 | 
					 * 服务器脚本策略对象 rm_deployment_policy
 | 
				
			||||||
@@ -89,4 +90,16 @@ public class RmDeploymentPolicy extends BaseEntity
 | 
				
			|||||||
    private String scriptPath;
 | 
					    private String scriptPath;
 | 
				
			||||||
    /** 业务脚本参数 */
 | 
					    /** 业务脚本参数 */
 | 
				
			||||||
    private String defaultParams;
 | 
					    private String defaultParams;
 | 
				
			||||||
 | 
					    /** 不在线数量 */
 | 
				
			||||||
 | 
					    private Integer offlineNum;
 | 
				
			||||||
 | 
					    /** 执行成功数量 */
 | 
				
			||||||
 | 
					    private Integer sucessNum;
 | 
				
			||||||
 | 
					    /** 执行失败数量 */
 | 
				
			||||||
 | 
					    private Integer failNum;
 | 
				
			||||||
 | 
					    /** 不在线服务器clientId集合 */
 | 
				
			||||||
 | 
					    private List<String> offlineClientIds;
 | 
				
			||||||
 | 
					    /** 执行成功clientId集合 */
 | 
				
			||||||
 | 
					    private List<String> sucessClientIds;
 | 
				
			||||||
 | 
					    /** 执行失败clientIdji和 */
 | 
				
			||||||
 | 
					    private List<String> failClientIds;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -59,5 +59,7 @@ public class RmNetworkInterface extends BaseEntity
 | 
				
			|||||||
    private String gateway;
 | 
					    private String gateway;
 | 
				
			||||||
    /** 绑定ip 1业务IP,2管理ip */
 | 
					    /** 绑定ip 1业务IP,2管理ip */
 | 
				
			||||||
    private String bindIp;
 | 
					    private String bindIp;
 | 
				
			||||||
 | 
					    /** 是否为新信息 */
 | 
				
			||||||
 | 
					    private String newFlag;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -55,4 +55,10 @@ public class RmResourceRemote extends BaseEntity
 | 
				
			|||||||
    private String connectionMethod;
 | 
					    private String connectionMethod;
 | 
				
			||||||
    /** 脚本执行结果 */
 | 
					    /** 脚本执行结果 */
 | 
				
			||||||
    private String commandResult;
 | 
					    private String commandResult;
 | 
				
			||||||
 | 
					    /** 客户端id */
 | 
				
			||||||
 | 
					    private String clientId;
 | 
				
			||||||
 | 
					    /** 执行结果标识(0 失败  1成功) */
 | 
				
			||||||
 | 
					    private Integer resultFlag;
 | 
				
			||||||
 | 
					    /** 脚本id */
 | 
				
			||||||
 | 
					    private Long scriptId;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,8 @@ import lombok.Data;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
@Data
 | 
					@Data
 | 
				
			||||||
public class ServerScriptPolicyVo {
 | 
					public class ServerScriptPolicyVo {
 | 
				
			||||||
 | 
					    /** 服务器脚本策略id */
 | 
				
			||||||
 | 
					    private String scriptId;
 | 
				
			||||||
    /** 策略名称 */
 | 
					    /** 策略名称 */
 | 
				
			||||||
    private String policyName;
 | 
					    private String policyName;
 | 
				
			||||||
    /** 外网Http(s)地址 */
 | 
					    /** 外网Http(s)地址 */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -90,12 +90,12 @@ public class MessageHandler {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    @PostConstruct
 | 
					    @PostConstruct
 | 
				
			||||||
    public void init() {
 | 
					    public void init() {
 | 
				
			||||||
//        registerHandler(MsgEnum.执行脚本策略应答.getValue(), this::handleScriptRspMessage);
 | 
					        registerHandler(MsgEnum.执行脚本策略应答.getValue(), this::handleScriptRspMessage);
 | 
				
			||||||
//        registerHandler(MsgEnum.Agent版本更新应答.getValue(), this::handleAgentUpdateRspMessage);
 | 
					//        registerHandler(MsgEnum.Agent版本更新应答.getValue(), this::handleAgentUpdateRspMessage);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 其他类型消息可以单独注册处理器
 | 
					        // 其他类型消息可以单独注册处理器
 | 
				
			||||||
        registerHandler(MsgEnum.注册.getValue(), this::handleRegisterMessage);
 | 
					        registerHandler(MsgEnum.注册.getValue(), this::handleRegisterMessage);
 | 
				
			||||||
//        registerHandler(MsgEnum.获取最新策略.getValue(), this::handleNewPolicyMessage);
 | 
					        registerHandler(MsgEnum.获取最新策略.getValue(), this::handleNewPolicyMessage);
 | 
				
			||||||
//        registerHandler(MsgEnum.CPU上报.getValue(), this::handleCpuMessage);
 | 
					//        registerHandler(MsgEnum.CPU上报.getValue(), this::handleCpuMessage);
 | 
				
			||||||
//        registerHandler(MsgEnum.磁盘上报.getValue(), this::handleDiskMessage);
 | 
					//        registerHandler(MsgEnum.磁盘上报.getValue(), this::handleDiskMessage);
 | 
				
			||||||
//        registerHandler(MsgEnum.容器上报.getValue(), this::handleDockerMessage);
 | 
					//        registerHandler(MsgEnum.容器上报.getValue(), this::handleDockerMessage);
 | 
				
			||||||
@@ -116,7 +116,7 @@ public class MessageHandler {
 | 
				
			|||||||
            RegisterMsgVo registerMsgVo = interfaces.get(0);
 | 
					            RegisterMsgVo registerMsgVo = interfaces.get(0);
 | 
				
			||||||
            String clientId = registerMsgVo.getClientId();
 | 
					            String clientId = registerMsgVo.getClientId();
 | 
				
			||||||
            // 如果未下发监控策略,下发
 | 
					            // 如果未下发监控策略,下发
 | 
				
			||||||
            rmMonitorPolicyService.issuePolicyMsgByClientId(clientId);
 | 
					//            rmMonitorPolicyService.issuePolicyMsgByClientId(clientId);
 | 
				
			||||||
            // 如果未下发服务器脚本策略,下发
 | 
					            // 如果未下发服务器脚本策略,下发
 | 
				
			||||||
            rmDeploymentPolicyService.issueDeployPolicyMsgByClientId(clientId);
 | 
					            rmDeploymentPolicyService.issueDeployPolicyMsgByClientId(clientId);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -654,19 +654,15 @@ public class MessageHandler {
 | 
				
			|||||||
            Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
 | 
					            Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
 | 
				
			||||||
            // 查询资源信息
 | 
					            // 查询资源信息
 | 
				
			||||||
            RmResourceRegistrationRemote queryParam = new RmResourceRegistrationRemote();
 | 
					            RmResourceRegistrationRemote queryParam = new RmResourceRegistrationRemote();
 | 
				
			||||||
            queryParam.setHardwareSn(message.getClientId());
 | 
					            queryParam.setClientId(message.getClientId());
 | 
				
			||||||
            R<RmResourceRegistrationRemote> resourceMsg = remoteRevenueConfigService.getListByHardwareSn(queryParam, SecurityConstants.INNER);
 | 
					            R<RmResourceRegistrationRemote> resourceMsg = remoteRevenueConfigService.getListByHardwareSn(queryParam, SecurityConstants.INNER);
 | 
				
			||||||
            RmResourceRegistrationRemote resourceMsgData = resourceMsg.getData();
 | 
					            RmResourceRegistrationRemote resourceMsgData = resourceMsg.getData();
 | 
				
			||||||
            if(rsp.getResCode() == 1){
 | 
					            if(rsp.getResCode() == 1){
 | 
				
			||||||
                if(rsp.getResult() != null){
 | 
					                if(rsp.getResult() != null){
 | 
				
			||||||
                    // 构建脚本执行结果实体类
 | 
					                    // 构建脚本执行结果实体类
 | 
				
			||||||
                    RmResourceRemote insertData = new RmResourceRemote();
 | 
					                    RmResourceRemote insertData = new RmResourceRemote();
 | 
				
			||||||
                    insertData.setHardwareSn(message.getClientId());
 | 
					                    insertData.setClientId(message.getClientId());
 | 
				
			||||||
                    insertData.setResourceName(resourceMsgData.getResourceName());
 | 
					                    insertData.setResultFlag(1);
 | 
				
			||||||
                    insertData.setExternalIp(resourceMsgData.getIpAddress());
 | 
					 | 
				
			||||||
                    insertData.setManagementPort(22);
 | 
					 | 
				
			||||||
                    insertData.setConnectionMethod("1");
 | 
					 | 
				
			||||||
                    insertData.setResourceType(resourceMsgData.getResourceType());
 | 
					 | 
				
			||||||
                    insertData.setDescription(rsp.getResult());
 | 
					                    insertData.setDescription(rsp.getResult());
 | 
				
			||||||
                    insertData.setCreateTime(createTime);
 | 
					                    insertData.setCreateTime(createTime);
 | 
				
			||||||
                    // 执行插入sql
 | 
					                    // 执行插入sql
 | 
				
			||||||
@@ -674,6 +670,16 @@ public class MessageHandler {
 | 
				
			|||||||
                    log.info("脚本执行结果入库成功:{}",rsp);
 | 
					                    log.info("脚本执行结果入库成功:{}",rsp);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }else{
 | 
					            }else{
 | 
				
			||||||
 | 
					                // 构建脚本执行结果实体类
 | 
				
			||||||
 | 
					                RmResourceRemote insertData = new RmResourceRemote();
 | 
				
			||||||
 | 
					                insertData.setClientId(message.getClientId());
 | 
				
			||||||
 | 
					                insertData.setResultFlag(0);
 | 
				
			||||||
 | 
					                if(rsp.getResult() != null){
 | 
				
			||||||
 | 
					                    insertData.setDescription(rsp.getResult());
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                insertData.setCreateTime(createTime);
 | 
				
			||||||
 | 
					                // 执行插入sql
 | 
				
			||||||
 | 
					                rmResourceRemoteService.insertRmResourceRemote(insertData);
 | 
				
			||||||
                log.error("脚本执行失败:{}", rsp);
 | 
					                log.error("脚本执行失败:{}", rsp);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -110,9 +110,16 @@ public class InitialSystemOtherCollectDataServiceImpl implements IInitialSystemO
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public Map getMonitorMsg(InitialSystemOtherCollectData initialSystemOtherCollectData) {
 | 
					    public Map getMonitorMsg(InitialSystemOtherCollectData initialSystemOtherCollectData) {
 | 
				
			||||||
        Map map = initialSystemOtherCollectDataMapper.getMonitorMsg(initialSystemOtherCollectData);
 | 
					        Map<String, Object> map = initialSystemOtherCollectDataMapper.getMonitorMsg(initialSystemOtherCollectData);
 | 
				
			||||||
 | 
					        // 如果返回null,初始化一个空的Map
 | 
				
			||||||
 | 
					        if (map == null) {
 | 
				
			||||||
 | 
					            map = new HashMap<>();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        // 获取cpu数量
 | 
					        // 获取cpu数量
 | 
				
			||||||
        InitialCpuInfo cpuInfo = initialCpuInfoMapper.getCpuInfoByClientId(initialSystemOtherCollectData.getClientId());
 | 
					        InitialCpuInfo cpuInfo = initialCpuInfoMapper.getCpuInfoByClientId(initialSystemOtherCollectData.getClientId());
 | 
				
			||||||
 | 
					        if (cpuInfo == null) {
 | 
				
			||||||
 | 
					            cpuInfo = new InitialCpuInfo();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        map.put("systemCpuNum", cpuInfo.getNum());
 | 
					        map.put("systemCpuNum", cpuInfo.getNum());
 | 
				
			||||||
        return map;
 | 
					        return map;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,11 +8,13 @@ import com.ruoyi.common.core.utils.DateUtils;
 | 
				
			|||||||
import com.ruoyi.common.core.utils.StringUtils;
 | 
					import com.ruoyi.common.core.utils.StringUtils;
 | 
				
			||||||
import com.ruoyi.rocketmq.domain.DeviceMessage;
 | 
					import com.ruoyi.rocketmq.domain.DeviceMessage;
 | 
				
			||||||
import com.ruoyi.rocketmq.domain.RmDeploymentPolicy;
 | 
					import com.ruoyi.rocketmq.domain.RmDeploymentPolicy;
 | 
				
			||||||
 | 
					import com.ruoyi.rocketmq.domain.RmResourceRemote;
 | 
				
			||||||
import com.ruoyi.rocketmq.domain.vo.PolicyTypeVo;
 | 
					import com.ruoyi.rocketmq.domain.vo.PolicyTypeVo;
 | 
				
			||||||
import com.ruoyi.rocketmq.domain.vo.PolicyVo;
 | 
					import com.ruoyi.rocketmq.domain.vo.PolicyVo;
 | 
				
			||||||
import com.ruoyi.rocketmq.domain.vo.ScriptPolicyVo;
 | 
					import com.ruoyi.rocketmq.domain.vo.ScriptPolicyVo;
 | 
				
			||||||
import com.ruoyi.rocketmq.domain.vo.ServerScriptPolicyVo;
 | 
					import com.ruoyi.rocketmq.domain.vo.ServerScriptPolicyVo;
 | 
				
			||||||
import com.ruoyi.rocketmq.mapper.RmDeploymentPolicyMapper;
 | 
					import com.ruoyi.rocketmq.mapper.RmDeploymentPolicyMapper;
 | 
				
			||||||
 | 
					import com.ruoyi.rocketmq.mapper.RmResourceRemoteMapper;
 | 
				
			||||||
import com.ruoyi.rocketmq.model.ProducerMode;
 | 
					import com.ruoyi.rocketmq.model.ProducerMode;
 | 
				
			||||||
import com.ruoyi.rocketmq.producer.MessageProducer;
 | 
					import com.ruoyi.rocketmq.producer.MessageProducer;
 | 
				
			||||||
import com.ruoyi.rocketmq.service.IRmDeploymentPolicyService;
 | 
					import com.ruoyi.rocketmq.service.IRmDeploymentPolicyService;
 | 
				
			||||||
@@ -45,6 +47,8 @@ public class RmDeploymentPolicyServiceImpl implements IRmDeploymentPolicyService
 | 
				
			|||||||
    private DataProcessUtil dataProcessUtil;
 | 
					    private DataProcessUtil dataProcessUtil;
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
    private ProducerMode producerMode;
 | 
					    private ProducerMode producerMode;
 | 
				
			||||||
 | 
					    @Autowired
 | 
				
			||||||
 | 
					    private RmResourceRemoteMapper rmResourceRemoteMapper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 查询服务器脚本策略
 | 
					     * 查询服务器脚本策略
 | 
				
			||||||
@@ -74,6 +78,30 @@ public class RmDeploymentPolicyServiceImpl implements IRmDeploymentPolicyService
 | 
				
			|||||||
        // 包含设备名称赋值
 | 
					        // 包含设备名称赋值
 | 
				
			||||||
        deploymentPolicyList.forEach(policy -> {
 | 
					        deploymentPolicyList.forEach(policy -> {
 | 
				
			||||||
            getIncludeNameById(policy);
 | 
					            getIncludeNameById(policy);
 | 
				
			||||||
 | 
					            // 不在线数量赋值
 | 
				
			||||||
 | 
					            String deviceMsg = policy.getDeployDevice();
 | 
				
			||||||
 | 
					            if (deviceMsg != null) {
 | 
				
			||||||
 | 
					                List<String> offOnlineList = new ArrayList<>();
 | 
				
			||||||
 | 
					                List<String> successList = new ArrayList<>();
 | 
				
			||||||
 | 
					                List<String> failList = new ArrayList<>();
 | 
				
			||||||
 | 
					                for (String clientId : deviceMsg.split("\n")) {
 | 
				
			||||||
 | 
					                    RmResourceRemote query = new RmResourceRemote();
 | 
				
			||||||
 | 
					                    query.setScriptId(policy.getId());
 | 
				
			||||||
 | 
					                    query.setClientId(clientId);
 | 
				
			||||||
 | 
					                    List<RmResourceRemote> resultList = rmResourceRemoteMapper.selectRmResourceRemoteList(query);
 | 
				
			||||||
 | 
					                    if (resultList.isEmpty()) {
 | 
				
			||||||
 | 
					                        offOnlineList.add(clientId);
 | 
				
			||||||
 | 
					                        continue;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    resultList.forEach(resourceRemote -> {
 | 
				
			||||||
 | 
					                        if (resourceRemote.getResultFlag() == 0) {
 | 
				
			||||||
 | 
					                            failList.add(clientId);
 | 
				
			||||||
 | 
					                        } else if (resourceRemote.getResultFlag() == 1) {
 | 
				
			||||||
 | 
					                            successList.add(clientId);
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    });
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return deploymentPolicyList;
 | 
					        return deploymentPolicyList;
 | 
				
			||||||
@@ -279,6 +307,7 @@ public class RmDeploymentPolicyServiceImpl implements IRmDeploymentPolicyService
 | 
				
			|||||||
                for (RmDeploymentPolicy policy : policyList) {
 | 
					                for (RmDeploymentPolicy policy : policyList) {
 | 
				
			||||||
                    // 构建并发送脚本配置
 | 
					                    // 构建并发送脚本配置
 | 
				
			||||||
                    ServerScriptPolicyVo scriptPolicyVo = new ServerScriptPolicyVo();
 | 
					                    ServerScriptPolicyVo scriptPolicyVo = new ServerScriptPolicyVo();
 | 
				
			||||||
 | 
					                    scriptPolicyVo.setScriptId(policy.getId().toString());
 | 
				
			||||||
                    scriptPolicyVo.setPolicyName(policy.getPolicyName());
 | 
					                    scriptPolicyVo.setPolicyName(policy.getPolicyName());
 | 
				
			||||||
                    scriptPolicyVo.setFileUrl(policy.getScriptPath());
 | 
					                    scriptPolicyVo.setFileUrl(policy.getScriptPath());
 | 
				
			||||||
                    scriptPolicyVo.setCommandParams(policy.getDefaultParams());
 | 
					                    scriptPolicyVo.setCommandParams(policy.getDefaultParams());
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -101,7 +101,8 @@ public class DynamicOidCollector {
 | 
				
			|||||||
            // 判断是否需要索引处理
 | 
					            // 判断是否需要索引处理
 | 
				
			||||||
            boolean needIndex = needIndexProcessing(oidParams, deviceType);
 | 
					            boolean needIndex = needIndexProcessing(oidParams, deviceType);
 | 
				
			||||||
            // 获取过滤条件
 | 
					            // 获取过滤条件
 | 
				
			||||||
            List<String> filterValues = switchVo.getFilterByType(deviceType);
 | 
					            String filterType = deviceType + "OID";
 | 
				
			||||||
 | 
					            List<String> filterValues = switchVo.getFilterByType(filterType);
 | 
				
			||||||
            log.info("采集交换机 {} 的 {} 设备信息,筛选条件: {}",
 | 
					            log.info("采集交换机 {} 的 {} 设备信息,筛选条件: {}",
 | 
				
			||||||
                    switchVo.getIp(), deviceType, filterValues);
 | 
					                    switchVo.getIp(), deviceType, filterValues);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -156,7 +157,9 @@ public class DynamicOidCollector {
 | 
				
			|||||||
                "1.3.6.1.2.1.1.4.0",  // sysContact
 | 
					                "1.3.6.1.2.1.1.4.0",  // sysContact
 | 
				
			||||||
                "1.3.6.1.2.1.1.5.0",  // sysName
 | 
					                "1.3.6.1.2.1.1.5.0",  // sysName
 | 
				
			||||||
                "1.3.6.1.2.1.1.6.0",  // sysLocation
 | 
					                "1.3.6.1.2.1.1.6.0",  // sysLocation
 | 
				
			||||||
                "1.3.6.1.4.1.2011.5.25.183.1.4.0"  // hwStackSystemMac
 | 
					                "1.3.6.1.4.1.2011.5.25.183.1.4.0",  // hwStackSystemMac
 | 
				
			||||||
 | 
					                "1.3.6.1.4.1.2011.6.157.1.3.0",  // hwAveragePower
 | 
				
			||||||
 | 
					                "1.3.6.1.4.1.2011.6.157.1.6.0"  // hwCurrentPower
 | 
				
			||||||
        ));
 | 
					        ));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 检查所有配置的OID
 | 
					        // 检查所有配置的OID
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -156,7 +156,6 @@ public class MultiSwitchCollectionScheduler {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        // OID配置(复制所有OID Map)
 | 
					        // OID配置(复制所有OID Map)
 | 
				
			||||||
        resultMap.setNetOID(new LinkedHashMap<>(switchVo.getNetOID()));
 | 
					        resultMap.setNetOID(new LinkedHashMap<>(switchVo.getNetOID()));
 | 
				
			||||||
        resultMap.setEntityOID(new LinkedHashMap<>(switchVo.getEntityOID()));
 | 
					 | 
				
			||||||
        resultMap.setPwrOID(new LinkedHashMap<>(switchVo.getPwrOID()));
 | 
					        resultMap.setPwrOID(new LinkedHashMap<>(switchVo.getPwrOID()));
 | 
				
			||||||
        resultMap.setFanOID(new LinkedHashMap<>(switchVo.getFanOID()));
 | 
					        resultMap.setFanOID(new LinkedHashMap<>(switchVo.getFanOID()));
 | 
				
			||||||
        resultMap.setMpuOID(new LinkedHashMap<>(switchVo.getMpuOID()));
 | 
					        resultMap.setMpuOID(new LinkedHashMap<>(switchVo.getMpuOID()));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -157,7 +157,7 @@
 | 
				
			|||||||
        <where>
 | 
					        <where>
 | 
				
			||||||
            <if test="policyStatus != null  and policyStatus != ''"> and policy_status = #{policyStatus}</if>
 | 
					            <if test="policyStatus != null  and policyStatus != ''"> and policy_status = #{policyStatus}</if>
 | 
				
			||||||
            <if test="deployDevice != null ">
 | 
					            <if test="deployDevice != null ">
 | 
				
			||||||
                FIND_IN_SET(#{deployDevice}, REPLACE(deploy_device, '\n', ',')) > 0
 | 
					                and FIND_IN_SET(#{deployDevice}, REPLACE(deploy_device, '\n', ',')) > 0
 | 
				
			||||||
            </if>
 | 
					            </if>
 | 
				
			||||||
        </where>
 | 
					        </where>
 | 
				
			||||||
    </select>
 | 
					    </select>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,10 +21,11 @@
 | 
				
			|||||||
        <result property="createBy"    column="create_by"    />
 | 
					        <result property="createBy"    column="create_by"    />
 | 
				
			||||||
        <result property="updateBy"    column="update_by"    />
 | 
					        <result property="updateBy"    column="update_by"    />
 | 
				
			||||||
        <result property="bindIp"    column="bind_ip"    />
 | 
					        <result property="bindIp"    column="bind_ip"    />
 | 
				
			||||||
 | 
					        <result property="newFlag"    column="new_flag"    />
 | 
				
			||||||
    </resultMap>
 | 
					    </resultMap>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <sql id="selectRmNetworkInterfaceVo">
 | 
					    <sql id="selectRmNetworkInterfaceVo">
 | 
				
			||||||
        select id, client_id, isp, province, city, public_ip, interface_name, mac_address, interface_type, ipv4_address, gateway, create_time, update_time, create_by, update_by, bind_ip from rm_network_interface
 | 
					        select id, client_id, isp, province, city, public_ip, interface_name, mac_address, interface_type, ipv4_address, gateway, create_time, update_time, create_by, update_by, bind_ip, new_flag from rm_network_interface
 | 
				
			||||||
    </sql>
 | 
					    </sql>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <select id="selectRmNetworkInterfaceList" parameterType="RmNetworkInterface" resultMap="RmNetworkInterfaceResult">
 | 
					    <select id="selectRmNetworkInterfaceList" parameterType="RmNetworkInterface" resultMap="RmNetworkInterfaceResult">
 | 
				
			||||||
@@ -41,6 +42,7 @@
 | 
				
			|||||||
            <if test="ipv4Address != null  and ipv4Address != ''"> and ipv4_address = #{ipv4Address}</if>
 | 
					            <if test="ipv4Address != null  and ipv4Address != ''"> and ipv4_address = #{ipv4Address}</if>
 | 
				
			||||||
            <if test="gateway != null  and gateway != ''"> and gateway = #{gateway}</if>
 | 
					            <if test="gateway != null  and gateway != ''"> and gateway = #{gateway}</if>
 | 
				
			||||||
            <if test="bindIp != null  and bindIp != ''"> and bind_ip = #{bindIp}</if>
 | 
					            <if test="bindIp != null  and bindIp != ''"> and bind_ip = #{bindIp}</if>
 | 
				
			||||||
 | 
					            <if test="newFlag != null "> and new_flag = #{newFlag}</if>
 | 
				
			||||||
        </where>
 | 
					        </where>
 | 
				
			||||||
    </select>
 | 
					    </select>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -67,6 +69,7 @@
 | 
				
			|||||||
            <if test="createBy != null">create_by,</if>
 | 
					            <if test="createBy != null">create_by,</if>
 | 
				
			||||||
            <if test="updateBy != null">update_by,</if>
 | 
					            <if test="updateBy != null">update_by,</if>
 | 
				
			||||||
            <if test="bindIp != null">bind_ip,</if>
 | 
					            <if test="bindIp != null">bind_ip,</if>
 | 
				
			||||||
 | 
					            <if test="newFlag != null">new_flag,</if>
 | 
				
			||||||
        </trim>
 | 
					        </trim>
 | 
				
			||||||
        <trim prefix="values (" suffix=")" suffixOverrides=",">
 | 
					        <trim prefix="values (" suffix=")" suffixOverrides=",">
 | 
				
			||||||
            <if test="clientId != null and clientId != ''">#{clientId},</if>
 | 
					            <if test="clientId != null and clientId != ''">#{clientId},</if>
 | 
				
			||||||
@@ -84,6 +87,7 @@
 | 
				
			|||||||
            <if test="createBy != null">#{createBy},</if>
 | 
					            <if test="createBy != null">#{createBy},</if>
 | 
				
			||||||
            <if test="updateBy != null">#{updateBy},</if>
 | 
					            <if test="updateBy != null">#{updateBy},</if>
 | 
				
			||||||
            <if test="bindIp != null">#{bindIp},</if>
 | 
					            <if test="bindIp != null">#{bindIp},</if>
 | 
				
			||||||
 | 
					            <if test="newFlag != null">#{newFlag},</if>
 | 
				
			||||||
        </trim>
 | 
					        </trim>
 | 
				
			||||||
    </insert>
 | 
					    </insert>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -105,9 +109,21 @@
 | 
				
			|||||||
            <if test="createBy != null">create_by = #{createBy},</if>
 | 
					            <if test="createBy != null">create_by = #{createBy},</if>
 | 
				
			||||||
            <if test="updateBy != null">update_by = #{updateBy},</if>
 | 
					            <if test="updateBy != null">update_by = #{updateBy},</if>
 | 
				
			||||||
            <if test="bindIp != null">bind_ip = #{bindIp},</if>
 | 
					            <if test="bindIp != null">bind_ip = #{bindIp},</if>
 | 
				
			||||||
 | 
					            <if test="newFlag != null">new_flag = #{newFlag},</if>
 | 
				
			||||||
        </trim>
 | 
					        </trim>
 | 
				
			||||||
        where id = #{id}
 | 
					        where id = #{id}
 | 
				
			||||||
    </update>
 | 
					    </update>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <delete id="deleteRmNetworkInterfaceById" parameterType="Long">
 | 
				
			||||||
 | 
					        delete from rm_network_interface where id = #{id}
 | 
				
			||||||
 | 
					    </delete>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <delete id="deleteRmNetworkInterfaceByIds" parameterType="String">
 | 
				
			||||||
 | 
					        delete from rm_network_interface where id in
 | 
				
			||||||
 | 
					        <foreach item="id" collection="array" open="(" separator="," close=")">
 | 
				
			||||||
 | 
					            #{id}
 | 
				
			||||||
 | 
					        </foreach>
 | 
				
			||||||
 | 
					    </delete>
 | 
				
			||||||
    <update id="updateRmNetworkInterfaceByMac" parameterType="RmNetworkInterface">
 | 
					    <update id="updateRmNetworkInterfaceByMac" parameterType="RmNetworkInterface">
 | 
				
			||||||
        update rm_network_interface
 | 
					        update rm_network_interface
 | 
				
			||||||
        <trim prefix="SET" suffixOverrides=",">
 | 
					        <trim prefix="SET" suffixOverrides=",">
 | 
				
			||||||
@@ -125,18 +141,8 @@
 | 
				
			|||||||
            <if test="createBy != null">create_by = #{createBy},</if>
 | 
					            <if test="createBy != null">create_by = #{createBy},</if>
 | 
				
			||||||
            <if test="updateBy != null">update_by = #{updateBy},</if>
 | 
					            <if test="updateBy != null">update_by = #{updateBy},</if>
 | 
				
			||||||
            <if test="bindIp != null">bind_ip = #{bindIp},</if>
 | 
					            <if test="bindIp != null">bind_ip = #{bindIp},</if>
 | 
				
			||||||
 | 
					            <if test="newFlag != null">new_flag = #{newFlag},</if>
 | 
				
			||||||
        </trim>
 | 
					        </trim>
 | 
				
			||||||
        where mac_address = #{macAddress}
 | 
					        where mac_address = #{macAddress}
 | 
				
			||||||
    </update>
 | 
					    </update>
 | 
				
			||||||
 | 
					 | 
				
			||||||
    <delete id="deleteRmNetworkInterfaceById" parameterType="Long">
 | 
					 | 
				
			||||||
        delete from rm_network_interface where id = #{id}
 | 
					 | 
				
			||||||
    </delete>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    <delete id="deleteRmNetworkInterfaceByIds" parameterType="String">
 | 
					 | 
				
			||||||
        delete from rm_network_interface where id in
 | 
					 | 
				
			||||||
        <foreach item="id" collection="array" open="(" separator="," close=")">
 | 
					 | 
				
			||||||
            #{id}
 | 
					 | 
				
			||||||
        </foreach>
 | 
					 | 
				
			||||||
    </delete>
 | 
					 | 
				
			||||||
</mapper>
 | 
					</mapper>
 | 
				
			||||||
@@ -19,10 +19,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
        <result property="updateTime"    column="update_time"    />
 | 
					        <result property="updateTime"    column="update_time"    />
 | 
				
			||||||
        <result property="createBy"    column="create_by"    />
 | 
					        <result property="createBy"    column="create_by"    />
 | 
				
			||||||
        <result property="updateBy"    column="update_by"    />
 | 
					        <result property="updateBy"    column="update_by"    />
 | 
				
			||||||
 | 
					        <result property="clientId"    column="client_id"    />
 | 
				
			||||||
 | 
					        <result property="resultFlag"    column="result_flag"    />
 | 
				
			||||||
 | 
					        <result property="scriptId"    column="script_id"    />
 | 
				
			||||||
    </resultMap>
 | 
					    </resultMap>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <sql id="selectRmResourceRemoteVo">
 | 
					    <sql id="selectRmResourceRemoteVo">
 | 
				
			||||||
        select id, hardware_sn, resource_type, resource_name, description, internal_ip, external_ip, management_port, online_status, connection_method, create_time, update_time, create_by, update_by from rm_resource_remote
 | 
					        select id, hardware_sn, resource_type, resource_name, description, internal_ip, external_ip, management_port, online_status, connection_method, create_time, update_time, create_by, update_by, client_id, result_flag, script_id from rm_resource_remote
 | 
				
			||||||
    </sql>
 | 
					    </sql>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <select id="selectRmResourceRemoteList" parameterType="RmResourceRemote" resultMap="RmResourceRemoteResult">
 | 
					    <select id="selectRmResourceRemoteList" parameterType="RmResourceRemote" resultMap="RmResourceRemoteResult">
 | 
				
			||||||
@@ -37,6 +40,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
            <if test="managementPort != null "> and management_port = #{managementPort}</if>
 | 
					            <if test="managementPort != null "> and management_port = #{managementPort}</if>
 | 
				
			||||||
            <if test="onlineStatus != null  and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
 | 
					            <if test="onlineStatus != null  and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
 | 
				
			||||||
            <if test="connectionMethod != null  and connectionMethod != ''"> and connection_method = #{connectionMethod}</if>
 | 
					            <if test="connectionMethod != null  and connectionMethod != ''"> and connection_method = #{connectionMethod}</if>
 | 
				
			||||||
 | 
					            <if test="clientId != null  and clientId != ''"> and client_id = #{clientId}</if>
 | 
				
			||||||
 | 
					            <if test="resultFlag != null "> and result_flag = #{resultFlag}</if>
 | 
				
			||||||
 | 
					            <if test="scriptId != null "> and script_id = #{scriptId}</if>
 | 
				
			||||||
        </where>
 | 
					        </where>
 | 
				
			||||||
    </select>
 | 
					    </select>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -46,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
    </select>
 | 
					    </select>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <insert id="insertRmResourceRemote" parameterType="RmResourceRemote" useGeneratedKeys="true" keyProperty="id">
 | 
					    <insert id="insertRmResourceRemote" parameterType="RmResourceRemote" useGeneratedKeys="true" keyProperty="id">
 | 
				
			||||||
        insert IGNORE into rm_resource_remote
 | 
					        insert into rm_resource_remote
 | 
				
			||||||
        <trim prefix="(" suffix=")" suffixOverrides=",">
 | 
					        <trim prefix="(" suffix=")" suffixOverrides=",">
 | 
				
			||||||
            <if test="hardwareSn != null and hardwareSn != ''">hardware_sn,</if>
 | 
					            <if test="hardwareSn != null and hardwareSn != ''">hardware_sn,</if>
 | 
				
			||||||
            <if test="resourceType != null and resourceType != ''">resource_type,</if>
 | 
					            <if test="resourceType != null and resourceType != ''">resource_type,</if>
 | 
				
			||||||
@@ -61,6 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
            <if test="updateTime != null">update_time,</if>
 | 
					            <if test="updateTime != null">update_time,</if>
 | 
				
			||||||
            <if test="createBy != null">create_by,</if>
 | 
					            <if test="createBy != null">create_by,</if>
 | 
				
			||||||
            <if test="updateBy != null">update_by,</if>
 | 
					            <if test="updateBy != null">update_by,</if>
 | 
				
			||||||
 | 
					            <if test="clientId != null">client_id,</if>
 | 
				
			||||||
 | 
					            <if test="resultFlag != null">result_flag,</if>
 | 
				
			||||||
 | 
					            <if test="scriptId != null">script_id,</if>
 | 
				
			||||||
        </trim>
 | 
					        </trim>
 | 
				
			||||||
        <trim prefix="values (" suffix=")" suffixOverrides=",">
 | 
					        <trim prefix="values (" suffix=")" suffixOverrides=",">
 | 
				
			||||||
            <if test="hardwareSn != null and hardwareSn != ''">#{hardwareSn},</if>
 | 
					            <if test="hardwareSn != null and hardwareSn != ''">#{hardwareSn},</if>
 | 
				
			||||||
@@ -76,6 +85,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
            <if test="updateTime != null">#{updateTime},</if>
 | 
					            <if test="updateTime != null">#{updateTime},</if>
 | 
				
			||||||
            <if test="createBy != null">#{createBy},</if>
 | 
					            <if test="createBy != null">#{createBy},</if>
 | 
				
			||||||
            <if test="updateBy != null">#{updateBy},</if>
 | 
					            <if test="updateBy != null">#{updateBy},</if>
 | 
				
			||||||
 | 
					            <if test="clientId != null">#{clientId},</if>
 | 
				
			||||||
 | 
					            <if test="resultFlag != null">#{resultFlag},</if>
 | 
				
			||||||
 | 
					            <if test="scriptId != null">#{scriptId},</if>
 | 
				
			||||||
        </trim>
 | 
					        </trim>
 | 
				
			||||||
    </insert>
 | 
					    </insert>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -95,6 +107,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			|||||||
            <if test="updateTime != null">update_time = #{updateTime},</if>
 | 
					            <if test="updateTime != null">update_time = #{updateTime},</if>
 | 
				
			||||||
            <if test="createBy != null">create_by = #{createBy},</if>
 | 
					            <if test="createBy != null">create_by = #{createBy},</if>
 | 
				
			||||||
            <if test="updateBy != null">update_by = #{updateBy},</if>
 | 
					            <if test="updateBy != null">update_by = #{updateBy},</if>
 | 
				
			||||||
 | 
					            <if test="clientId != null">client_id = #{clientId},</if>
 | 
				
			||||||
 | 
					            <if test="resultFlag != null">result_flag = #{resultFlag},</if>
 | 
				
			||||||
 | 
					            <if test="scriptId != null">script_id = #{scriptId},</if>
 | 
				
			||||||
        </trim>
 | 
					        </trim>
 | 
				
			||||||
        where id = #{id}
 | 
					        where id = #{id}
 | 
				
			||||||
    </update>
 | 
					    </update>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user