|
|
|
@ -1,16 +1,22 @@ |
|
|
|
|
package com.bellmann.service.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.map.MapUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.bellmann.common.base.IBaseEnum; |
|
|
|
|
import com.bellmann.common.constant.SecurityConstants; |
|
|
|
|
import com.bellmann.common.constant.StringUtilsConstants; |
|
|
|
|
import com.bellmann.common.enums.DevOnlineEnum; |
|
|
|
|
import com.bellmann.common.enums.DevStatusEnum; |
|
|
|
|
import com.bellmann.common.result.Result; |
|
|
|
|
import com.bellmann.converter.DeviceStaticConverter; |
|
|
|
|
import com.bellmann.manger.CustomerManager; |
|
|
|
|
import com.bellmann.manger.DeviceTypeManager; |
|
|
|
|
import com.bellmann.manger.IpAddressDomainManager; |
|
|
|
|
import com.bellmann.mapper.DeviceStaticMapper; |
|
|
|
|
import com.bellmann.model.bo.EquipmentBO; |
|
|
|
|
import com.bellmann.model.entity.DeviceStatic; |
|
|
|
|
import com.bellmann.model.form.EquipmentDetailForm; |
|
|
|
|
import com.bellmann.model.query.SelectQuery; |
|
|
|
|
import com.bellmann.model.vo.EquipmentCustomerVO; |
|
|
|
|
import com.bellmann.model.vo.EquipmentDetailVO; |
|
|
|
@ -18,6 +24,7 @@ import com.bellmann.model.vo.EquipmentTypeVO; |
|
|
|
|
import com.bellmann.model.vo.EquipmentVO; |
|
|
|
|
import com.bellmann.service.DeviceStaticService; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
@ -33,6 +40,11 @@ public class DeviceStaticServiceImpl implements DeviceStaticService { |
|
|
|
|
private final DeviceTypeManager deviceTypeManager; |
|
|
|
|
|
|
|
|
|
private final CustomerManager customerManager; |
|
|
|
|
|
|
|
|
|
private final IpAddressDomainManager ipAddressDomainManager; |
|
|
|
|
|
|
|
|
|
private final RedisTemplate<String, Object> redisTemplate; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Page<EquipmentVO> resourcePage(SelectQuery query) { |
|
|
|
|
int pageNum = query.getPageNum(); |
|
|
|
@ -64,12 +76,35 @@ public class DeviceStaticServiceImpl implements DeviceStaticService { |
|
|
|
|
}else { |
|
|
|
|
detailVO.setLoginId(detailVO.getDevRemark4()); |
|
|
|
|
} |
|
|
|
|
if(detailVO.getDevIp()!=null&& !detailVO.getDevIp().isEmpty()){ |
|
|
|
|
detailVO.setPlaceName(ipAddressDomainManager.getIpAddressDomain(detailVO.getDevIp())); |
|
|
|
|
}else { |
|
|
|
|
detailVO.setPlaceName("/"); |
|
|
|
|
} |
|
|
|
|
detailVO.setRegionAreaName( |
|
|
|
|
(String) redisTemplate.opsForHash() |
|
|
|
|
.get(SecurityConstants.DOMAIN_PREFIX, |
|
|
|
|
detailVO.getRegionAreaId().toString()) |
|
|
|
|
); |
|
|
|
|
return MapUtil |
|
|
|
|
.builder() |
|
|
|
|
.put("detailVO",detailVO) |
|
|
|
|
.put("typeVO",typeVO) |
|
|
|
|
.put("customerVO",customerVO) |
|
|
|
|
.put("detail",detailVO) |
|
|
|
|
.put("type",typeVO) |
|
|
|
|
.put("customer",customerVO) |
|
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<String> editResourceEquipment(EquipmentDetailForm form) { |
|
|
|
|
deviceStaticMapper.update(null,new LambdaUpdateWrapper<DeviceStatic>() |
|
|
|
|
.eq(DeviceStatic::getDevId,form.getDevId()) |
|
|
|
|
.set(DeviceStatic::getDevAdNo,form.getDevAdNo()) |
|
|
|
|
.set(DeviceStatic::getDevMac,form.getDevMac()) |
|
|
|
|
.set(DeviceStatic::getDevPppoe,form.getDevPppoe()) |
|
|
|
|
.set(DeviceStatic::getDevSno,form.getDevSno()) |
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|