feat: 故障管理

master
李小林 6 months ago
parent 171e1bfbe1
commit 0cd9ca6da4
  1. 7
      src/main/java/com/bellmann/controller/DeviceStaticController.java
  2. 2
      src/main/java/com/bellmann/controller/FaultController.java
  3. 8
      src/main/java/com/bellmann/controller/ServiceController.java
  4. 5
      src/main/java/com/bellmann/mapper/DeviceStaticMapper.java
  5. 9
      src/main/java/com/bellmann/model/form/AlgForm.java
  6. 53
      src/main/java/com/bellmann/model/query/EquipmentAdvanceQuery.java
  7. 5
      src/main/java/com/bellmann/model/query/FaultQuery.java
  8. 2
      src/main/java/com/bellmann/service/DeviceStaticService.java
  9. 4
      src/main/java/com/bellmann/service/ServiceService.java
  10. 3
      src/main/java/com/bellmann/service/impl/AuthServiceImpl.java
  11. 12
      src/main/java/com/bellmann/service/impl/DeviceStaticServiceImpl.java
  12. 2
      src/main/java/com/bellmann/service/impl/FaultServiceImpl.java
  13. 6
      src/main/java/com/bellmann/service/impl/RemoteOperateTaskServiceImpl.java
  14. 12
      src/main/java/com/bellmann/service/impl/ServiceServiceImpl.java
  15. 175
      src/main/resources/mapper/DeviceStaticMapper.xml

@ -11,6 +11,7 @@ import com.bellmann.common.result.Result;
import com.bellmann.common.result.ResultCode;
import com.bellmann.model.form.*;
import com.bellmann.model.query.DevOuiSnoQuery;
import com.bellmann.model.query.EquipmentAdvanceQuery;
import com.bellmann.model.query.SelectQuery;
import com.bellmann.model.vo.*;
import com.bellmann.plugin.dupsubmit.annotation.PreventDuplicateSubmit;
@ -53,6 +54,12 @@ public class DeviceStaticController {
Page<EquipmentVO> page = deviceStaticService.resourcePage(query);
return PageResult.success(page);
}
@PostMapping("advance-query-page")
@Operation(summary = "资源管理-设备管理高级查询接口")
public PageResult<EquipmentVO> advanceQueryPage(@RequestBody EquipmentAdvanceQuery query) {
Page<EquipmentVO> page = deviceStaticService.advanceQueryPage(query);
return PageResult.success(page);
}
@GetMapping("resource-detail/{devId}")
@Operation(summary = "资源管理-设备管理详细信息接口")

@ -44,7 +44,7 @@ public class FaultController {
@Operation(summary = "基本信息查询")
@PostMapping("/basic_info")
public Result<FaultBasicInfoVO> basicInfoQuery(@RequestBody FaultQuery query){
public Result<FaultBasicInfoVO> basicInfoQuery(@RequestBody @Valid FaultQuery query){
FaultBasicInfoVO faultBasicInfoVO = faultService.basicInfoQuery(query);
return Result.success(faultBasicInfoVO);
}

@ -2,6 +2,7 @@ package com.bellmann.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.common.base.BasePageQuery;
import com.bellmann.common.model.Option;
import com.bellmann.common.result.PageResult;
import com.bellmann.common.result.Result;
import com.bellmann.model.form.BusinessForm;
@ -108,5 +109,10 @@ public class ServiceController {
List<DeviceBusinessVO> list = serviceService.tabs(devId);
return Result.success(list);
}
@GetMapping("/options")
@Operation(summary = "已开通的业务选择框")
public Result<List<Option<Long>>> options(){
List<Option<Long>> list = serviceService.optionTab();
return Result.success(list);
}
}

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.model.bo.*;
import com.bellmann.model.dto.DeviceDetail;
import com.bellmann.model.entity.DeviceStatic;
import com.bellmann.model.query.EquipmentAdvanceQuery;
import com.bellmann.model.query.SoftMergeReportQuery;
import com.bellmann.model.vo.*;
import org.apache.ibatis.annotations.Mapper;
@ -44,5 +45,7 @@ public interface DeviceStaticMapper extends BaseMapper<DeviceStatic> {
List<FaultQueryVO> faultQueryList(@Param("column") String column, @Param("value") String value );
FaultBasicInfoVO faultBasicInfoQuery(@Param("column") String column, @Param("value") String value);
FaultBasicInfoVO faultBasicInfoQuery(@Param("column") String column, @Param("value") Long value);
Page<EquipmentBO> advanceQueryPage(Page<EquipmentBO> page, @Param("form") EquipmentAdvanceQuery query);
}

@ -1,26 +1,25 @@
package com.bellmann.model.form;
import lombok.Data;
import lombok.ToString;
import javax.validation.constraints.NotBlank;
@Data
@ToString
public class AlgForm {
@NotBlank(message = "必填参数不能为空")
private String h323Enable;
@NotBlank(message = "必填参数不能为空")
private String sIPEnable;
private String sipEnable;
@NotBlank(message = "必填参数不能为空")
private String rTSPEnable;
private String rtspEnable;
@NotBlank(message = "必填参数不能为空")
private String l2TPEnable;
@NotBlank(message = "必填参数不能为空")
private String iPSECEnable;
private String ipsecEnable;
}

@ -0,0 +1,53 @@
package com.bellmann.model.query;
import com.bellmann.common.base.BasePageQuery;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
public class EquipmentAdvanceQuery extends BasePageQuery {
private String devSno;
private String devMac;
private String devAdNo;
private String devPppoe;
private String logicId;
private String startTime;
private String endTime;
private Long regionAreaId;
private String devVendorName;
private String devTypeName;
private String devHardVer;
private String softVer;
private String devAccessType;
private String devType;
private String devOnline;
private String devStatus;
private String devIp;
private Long service;
private String voipPhone;
private String sortColumn;
private String sortRules;
}

@ -2,9 +2,12 @@ package com.bellmann.model.query;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class FaultQuery {
private String value;
@NotNull(message = "参数不能为空")
private String value;
private String label;

@ -6,6 +6,7 @@ import com.bellmann.common.result.PageResult;
import com.bellmann.common.result.Result;
import com.bellmann.model.form.*;
import com.bellmann.model.query.DevOuiSnoQuery;
import com.bellmann.model.query.EquipmentAdvanceQuery;
import com.bellmann.model.query.SelectQuery;
import com.bellmann.model.vo.EquipmentVO;
import com.bellmann.model.vo.RemoteDevInfoVO;
@ -83,4 +84,5 @@ public interface DeviceStaticService {
boolean deleteInstanceNode(Long devId, String nodePath);
boolean taskIsSuccess(Long taskId);
Page<EquipmentVO> advanceQueryPage(EquipmentAdvanceQuery query);
}

@ -2,6 +2,7 @@ package com.bellmann.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.common.base.BasePageQuery;
import com.bellmann.common.model.Option;
import com.bellmann.common.result.Result;
import com.bellmann.model.form.BusinessForm;
import com.bellmann.model.form.FileRecordForm;
@ -39,4 +40,7 @@ public interface ServiceService {
Result<String> deleteBusinessFile(Long fileId, Long servId);
List<DeviceBusinessVO> tabs(Long devId);
List<Option<Long>> optionTab();
}

@ -86,7 +86,6 @@ public class AuthServiceImpl implements AuthService {
@Override
public LoginResult login(String code) {
//HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
//String code4A = request.getParameter("code");
log.info("start login ... {}", code);
@ -103,7 +102,7 @@ public class AuthServiceImpl implements AuthService {
String res = HttpUtil.doPost(config4A.getHttpTokenAuthUrl(), map);
BsOrCsResponeResult bsOrCsResponeResult = null;
bsOrCsResponeResult = JSONObject.parseObject(res, BsOrCsResponeResult.class);
log.info("res:{}",res);
String token = bsOrCsResponeResult.getAccess_token();
try {
token = RSAUtils.decryptByPrivateKeyStr(token, config4A.getSecurity());

@ -27,6 +27,7 @@ import com.bellmann.model.dto.OperationTask;
import com.bellmann.model.entity.*;
import com.bellmann.model.form.*;
import com.bellmann.model.query.DevOuiSnoQuery;
import com.bellmann.model.query.EquipmentAdvanceQuery;
import com.bellmann.model.query.SelectQuery;
import com.bellmann.model.vo.*;
import com.bellmann.runner.UIService;
@ -118,6 +119,15 @@ public class DeviceStaticServiceImpl implements DeviceStaticService {
return deviceStaticConverter.resourceBOPage2VOPage(boPage);
}
@Override
public Page<EquipmentVO> advanceQueryPage(EquipmentAdvanceQuery query) {
int pageNum = query.getPageNum();
int pageSize = query.getPageSize();
Page<EquipmentBO> page = new Page<>(pageNum, pageSize);
Page<EquipmentBO> boPage = deviceStaticMapper.advanceQueryPage(page,query);
return deviceStaticConverter.resourceBOPage2VOPage(boPage);
}
@Override
public Map<Object, Object> resourceDeviceDetail(Long devId) {
EquipmentDetailVO detailVO = deviceStaticMapper.detailInfo(devId);
@ -1487,7 +1497,7 @@ public class DeviceStaticServiceImpl implements DeviceStaticService {
@Override
public boolean taskIsSuccess(Long taskId) {
int attempt = 0;
while (attempt < 10) {
while (attempt < 15) {
OperateResult2 operateResult2 = operateResult2Mapper.selectOne(
new QueryWrapper<OperateResult2>()
.eq("oper_task_id", taskId)

@ -60,7 +60,7 @@ public class FaultServiceImpl implements FaultService {
@Override
public FaultBasicInfoVO basicInfoQuery(FaultQuery query) {
FaultBasicInfoVO faultBasicInfoQuery = deviceStaticMapper.faultBasicInfoQuery(query.getLabel(), query.getValue());
FaultBasicInfoVO faultBasicInfoQuery = deviceStaticMapper.faultBasicInfoQuery(query.getLabel(), Long.parseLong(query.getValue()));
Long customId = faultBasicInfoQuery.getCustId();
if (customId != null) {
Customer customer = customerManager.findByCustomId(customId);

@ -235,12 +235,12 @@ public class RemoteOperateTaskServiceImpl implements RemoteOperateTaskService {
argsStructs[1] = new DOperTaskArgsStruct();
argsStructs[1].argsName = "InternetGatewayDevice.DeviceInfo.X_CT-COM_ALGAbility.SIPEnable";
argsStructs[1].argsValue = algForm.getSIPEnable(); //SIP开关
argsStructs[1].argsValue = algForm.getSipEnable(); //SIP开关
argsStructs[1].operTaskId = Utils.LONG_NULL;
argsStructs[2] = new DOperTaskArgsStruct();
argsStructs[2].argsName = "InternetGatewayDevice.DeviceInfo.X_CT-COM_ALGAbility.RTSPEnable";
argsStructs[2].argsValue = algForm.getRTSPEnable(); //RTSP开关
argsStructs[2].argsValue = algForm.getRtspEnable(); //RTSP开关
argsStructs[2].operTaskId = Utils.LONG_NULL;
argsStructs[3] = new DOperTaskArgsStruct();
@ -250,7 +250,7 @@ public class RemoteOperateTaskServiceImpl implements RemoteOperateTaskService {
argsStructs[4] = new DOperTaskArgsStruct();
argsStructs[4].argsName = "InternetGatewayDevice.DeviceInfo.X_CT-COM_ALGAbility.IPSECEnable";
argsStructs[4].argsValue = algForm.getIPSECEnable(); //IPSEV开关
argsStructs[4].argsValue = algForm.getIpsecEnable(); //IPSEV开关
argsStructs[4].operTaskId = Utils.LONG_NULL;
detailStruct.operTaskArgsList = argsStructs;

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.common.base.BasePageQuery;
import com.bellmann.common.base.IBaseEnum;
import com.bellmann.common.enums.ServiceMapStatusEnum;
import com.bellmann.common.model.Option;
import com.bellmann.common.result.Result;
import com.bellmann.common.result.ResultCode;
import com.bellmann.converter.FileRecordConverter;
@ -198,6 +199,17 @@ public class ServiceServiceImpl implements ServiceService {
});
}
return tabs;
}
@Override
public List<Option<Long>> optionTab() {
List<Business> list = serviceMapper.selectList(new LambdaQueryWrapper<>());
return list.stream().map(obj->{
Option<Long> option = new Option<>();
option.setLabel(obj.getServName()+"("+obj.getServVerName()+")");
option.setValue(obj.getServId());
return option;
}).collect(Collectors.toList());
}
}

@ -44,41 +44,119 @@
</if>
</where>
</select>
<select id="advanceQueryPage" resultType="com.bellmann.model.bo.EquipmentBO">
SELECT
s.dev_id,
s.dev_sno,
s.dev_ad_no,
s.dev_pppoe,
s.dev_status,
v.soft_ver,
T.dev_hard_ver,
T.dev_type_id,
T.dev_type_name,
T.dev_vendor_name,
T.dev_vendor_oui,
d.dev_type_name_new,
dy.dev_online,
dy.dev_online_time
FROM
itms_device_static s
INNER JOIN ITMS_DEVICE_DYNAMIC dy ON s.DEV_ID = dy.DEV_ID
INNER JOIN itms_device_type_ver v ON s.type_and_ver_id = v.type_and_ver_id
INNER JOIN itms_device_type T ON v.dev_type_id = T.dev_type_id
INNER JOIN itms_device_type_ver_detail d ON v.type_and_ver_id = d.type_and_ver_id
<if test="form.service!=null">
inner join itms_tr069_service_map itsm on itsm.tr069_ver_id = v.tr069_ver_id
</if>
<where>
<if test="form.devSno!=null and form.devSno!=''">
and s.dev_sno = #{form.devSno}
</if>
<if test="form.devMac!=null and form.devMac!=''">
and s.dev_mac = #{form.devMac}
</if>
<if test="form.devAdNo!=null and form.devAdNo!=''">
and s.dev_ad_no = #{form.devAdNo}
</if>
<if test="form.logicId!=null and form.logicId!=''">
and s.DEV_REMARK4 LIKE CONCAT('%',#{form.logicId},'^%')
</if>
<if test="form.devPppoe!=null and form.devPppoe!=''">
and s.dev_pppoe = #{form.devPppoe}
</if>
<if test="form.regionAreaId!=null">
and s.region_area_id = #{form.regionAreaId}
</if>
<if test="form.devVendorName!=null and form.devVendorName!=''">
and T.dev_vendor_name = #{form.devVendorName}
</if>
<if test="form.devTypeName!=null and form.devTypeName!=''">
and T.dev_type_name = #{form.devTypeName}
</if>
<if test="form.softVer!=null and form.softVer!=''">
and v.soft_ver = #{form.softVer}
</if>
<if test="form.devAccessType!=null and form.devAccessType!=''">
and d.dev_access_type = #{form.devAccessType}
</if>
<if test="form.devType!=null and form.devType!=''">
and d.dev_type_name = #{form.devType}
</if>
<if test="form.devOnline!=null and form.devOnline!=''">
and dy.dev_online = #{form.devOnline}
</if>
<if test="form.devIp!=null and form.devIp!=''">
and dy.dev_ip = #{form.devIp}
</if>
<if test="form.devStatus!=null and form.devStatus!=''">
and s.dev_status = #{form.devStatus}
</if>
<if test="form.service!=null">
and itsm.serv_id = #{form.service}
</if>
<if test="form.startTime!=null and form.startTime!=''">
and s.dev_create_time >= to_date(#{fo
rm.startTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="form.endTime!=null and form.endTime!=''">
and s.dev_create_time = to_date(#{form.endTime},'yyyy-MM-dd HH24:mi:ss')
</if>
</where>
</select>
<select id="detailInfo" resultType="com.bellmann.model.vo.EquipmentDetailVO">
SELECT DISTINCT
s.DEV_ID,
s.TYPE_AND_VER_ID,
s.CUST_ID as customId,
s.REGION_AREA_ID,
s.CORP_AREA_ID,
s.DEV_SNO,
s.DEV_MAC,
s.DEV_PPPOE,
s.DEV_AD_NO,
s.DEV_STATUS,
s.DEV_CREATE_TIME,
s.DEV_MODIFY_TIME,
s.DEV_SOAP_FLAG,
s.DEV_INFORM_FLAG,
s.DEV_REMARK1,
s.DEV_REMARK2,
s.DEV_REMARK3,
s.DEV_REMARK4,
s.DEV_REMARK5,
d.CONNECT_REQ_URL,
d.DEV_IP,
d.DEV_ONLINE,
d.DEV_ONLINE_TIME,
e.band_access,
e.iptv_access,
e.USER_SN_NO as loginId
FROM
ITMS_DEVICE_STATIC s
LEFT JOIN ITMS_DEVICE_DYNAMIC d ON s.DEV_ID = d.DEV_ID
LEFT JOIN itms_device_static_detail e on e.dev_id=s.dev_id
WHERE
s.DEV_ID = #{devId};
SELECT DISTINCT s.DEV_ID,
s.TYPE_AND_VER_ID,
s.CUST_ID as customId,
s.REGION_AREA_ID,
s.CORP_AREA_ID,
s.DEV_SNO,
s.DEV_MAC,
s.DEV_PPPOE,
s.DEV_AD_NO,
s.DEV_STATUS,
s.DEV_CREATE_TIME,
s.DEV_MODIFY_TIME,
s.DEV_SOAP_FLAG,
s.DEV_INFORM_FLAG,
s.DEV_REMARK1,
s.DEV_REMARK2,
s.DEV_REMARK3,
s.DEV_REMARK4,
s.DEV_REMARK5,
d.CONNECT_REQ_URL,
d.DEV_IP,
d.DEV_ONLINE,
d.DEV_ONLINE_TIME,
e.band_access,
e.iptv_access,
e.USER_SN_NO as loginId
FROM ITMS_DEVICE_STATIC s
LEFT JOIN ITMS_DEVICE_DYNAMIC d ON s.DEV_ID = d.DEV_ID
LEFT JOIN itms_device_static_detail e on e.dev_id = s.dev_id
WHERE s.DEV_ID = #{devId};
</select>
<select id="countJoinDevVerDomain" resultType="java.lang.Long">
@ -454,19 +532,26 @@
</select>
<select id="faultQueryList" resultType="com.bellmann.model.vo.FaultQueryVO">
SELECT
aa.dev_id,
aa.dev_sno,
aa.dev_pppoe,
cc.dev_vendor_oui,
aa.dev_ad_no
aa.dev_id,
aa.dev_sno,
aa.dev_pppoe,
cc.dev_vendor_oui,
aa.dev_ad_no
FROM
itms_device_static aa
INNER JOIN itms_device_type_ver bb ON aa.type_and_ver_id = bb.type_and_ver_id
INNER JOIN itms_device_type cc ON bb.dev_type_id = cc.dev_type_id
WHERE
itms_device_static aa
INNER JOIN itms_device_type_ver bb ON aa.type_and_ver_id = bb.type_and_ver_id
INNER JOIN itms_device_type cc ON bb.dev_type_id = cc.dev_type_id
<where>
<if test="column=='devSno'and column!=null and column!=''">
aa.dev_sno = #{value};
and aa.dev_sno = #{value};
</if>
<if test="column=='adNo'and column!=null and column!=''">
and aa.dev_ad_no = #{value};
</if>
<if test="column=='pppoeAccount'and column!=null and column!=''">
and aa.dev_pppoe = #{value};
</if>
</where>
</select>
@ -491,8 +576,8 @@
LEFT JOIN ITMS_DEVICE_DYNAMIC dd ON aa.DEV_ID = dd.DEV_ID
LEFT JOIN itms_device_static_detail ff ON aa.dev_id = ff.dev_id
WHERE
<if test="column=='devSno'and column!=null and column!=''">
aa.dev_sno = #{value};
<if test="column=='devId'and column!=null">
aa.dev_id = #{value};
</if>
</select>
</mapper>

Loading…
Cancel
Save