feat: 设备管理新增,其他模块bug修复

master
李小林 9 months ago
parent d681d1add3
commit 607ca5e8d0
  1. 1
      src/main/java/com/bellmann/common/constant/SecurityConstants.java
  2. 22
      src/main/java/com/bellmann/common/enums/CustomStatusEnum.java
  3. 22
      src/main/java/com/bellmann/common/enums/CustomTypeEnum.java
  4. 34
      src/main/java/com/bellmann/common/enums/EquipmentTypeEnum.java
  5. 8
      src/main/java/com/bellmann/controller/DeviceStaticController.java
  6. 1
      src/main/java/com/bellmann/manger/FileRecordManager.java
  7. 6
      src/main/java/com/bellmann/manger/IpAddressDomainManager.java
  8. 20
      src/main/java/com/bellmann/manger/impl/CustomerManagerImpl.java
  9. 2
      src/main/java/com/bellmann/manger/impl/DeviceTypeManagerImpl.java
  10. 12
      src/main/java/com/bellmann/manger/impl/FileRecordManagerImpl.java
  11. 18
      src/main/java/com/bellmann/manger/impl/IpAddressDomainManagerImpl.java
  12. 7
      src/main/java/com/bellmann/mapper/FileRecordMapper.java
  13. 10
      src/main/java/com/bellmann/mapper/IpAddressDomainMapper.java
  14. 1
      src/main/java/com/bellmann/model/bo/DeviceTypeToVerBO.java
  15. 8
      src/main/java/com/bellmann/model/entity/FileRecord.java
  16. 14
      src/main/java/com/bellmann/model/entity/IpAddressDomain.java
  17. 19
      src/main/java/com/bellmann/model/form/EquipmentDetailForm.java
  18. 12
      src/main/java/com/bellmann/model/vo/EquipmentCustomerVO.java
  19. 8
      src/main/java/com/bellmann/model/vo/EquipmentDetailVO.java
  20. 2
      src/main/java/com/bellmann/model/vo/EquipmentTypeVO.java
  21. 5
      src/main/java/com/bellmann/service/DeviceStaticService.java
  22. 2
      src/main/java/com/bellmann/service/DomainService.java
  23. 41
      src/main/java/com/bellmann/service/impl/DeviceStaticServiceImpl.java
  24. 21
      src/main/java/com/bellmann/service/impl/DeviceTypeVerServiceImpl.java
  25. 32
      src/main/java/com/bellmann/service/impl/DomainServiceImpl.java
  26. 7
      src/main/java/com/bellmann/service/impl/FileRecordServiceImpl.java
  27. 4
      src/main/java/com/bellmann/service/impl/ServiceServiceImpl.java
  28. 3
      src/main/resources/mapper/DeviceTypeMapper.xml
  29. 5
      src/main/resources/mapper/DeviceTypeVerMapper.xml
  30. 14
      src/main/resources/mapper/FileRecordMapper.xml
  31. 16
      src/main/resources/mapper/IpaddressDomainMapper.xml

@ -23,5 +23,6 @@ public interface SecurityConstants {
*/
String BLACKLIST_TOKEN_PREFIX = "token:blacklist:";
String DOMAIN_PREFIX = "domain:";
}

@ -0,0 +1,22 @@
package com.bellmann.common.enums;
import com.bellmann.common.base.IBaseEnum;
import lombok.Getter;
public enum CustomStatusEnum implements IBaseEnum<String> {
NORMAL("0","正常"),
SIGN_OUT("1","注销"),
;
@Getter
private String value;
@Getter
private String label;
CustomStatusEnum(String value, String label){
this.label = label;
this.value = value;
}
}

@ -0,0 +1,22 @@
package com.bellmann.common.enums;
import com.bellmann.common.base.IBaseEnum;
import lombok.Getter;
public enum CustomTypeEnum implements IBaseEnum<String> {
ITMS("0","家庭"),
BBMS("1","政企"),
;
@Getter
private String value;
@Getter
private String label;
CustomTypeEnum(String value, String label){
this.label = label;
this.value = value;
}
}

@ -0,0 +1,34 @@
package com.bellmann.common.enums;
import com.bellmann.common.base.IBaseEnum;
import lombok.Getter;
public enum EquipmentTypeEnum implements IBaseEnum<String> {
A8C("A8C","A8-C"),
FTTR("FTTR","FTTR"),
E8C("E8C","E8-C"),
RH("RH","融合网关"),
OTHER("OTHER","其他网关"),
ME1("ME1","天翼网关1.0"),
ME2("ME2","天翼网关2.0"),
ME3("ME3","天翼网关3.0"),
ME4("ME4","天翼网关4.0"),
;
@Getter
private String value;
@Getter
private String label;
EquipmentTypeEnum(String value, String label){
this.label = label;
this.value = value;
}
}

@ -3,6 +3,7 @@ package com.bellmann.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.common.result.PageResult;
import com.bellmann.common.result.Result;
import com.bellmann.model.form.EquipmentDetailForm;
import com.bellmann.model.query.SelectQuery;
import com.bellmann.model.vo.EquipmentVO;
import com.bellmann.service.DeviceStaticService;
@ -30,11 +31,16 @@ public class DeviceStaticController {
return PageResult.success(page);
}
@PostMapping("resource-detail/{devId}")
@GetMapping("resource-detail/{devId}")
@Operation(summary = "资源管理-设备管理详细信息接口")
public Result<Map<Object,Object>> resourceDeviceDetail(@PathVariable Long devId){
Map<Object,Object> map = deviceStaticService.resourceDeviceDetail(devId);
return Result.success(map);
}
@PostMapping("resource-edit")
@Operation(summary = "资源管理-设备详细信息保存接口")
public Result<String> editResourceEquipment(@RequestBody EquipmentDetailForm form){
return deviceStaticService.editResourceEquipment(form);
}
//--------------资源管理API结束--------------------
}

@ -20,4 +20,5 @@ public interface FileRecordManager {
Long addBusinessFile(FileRecord fileRecord);
FileRecord fileRecordJoinFileVerMap(Long typeAndVerId);
}

@ -0,0 +1,6 @@
package com.bellmann.manger;
public interface IpAddressDomainManager {
String getIpAddressDomain(String ip);
}

@ -1,12 +1,17 @@
package com.bellmann.manger.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bellmann.common.base.IBaseEnum;
import com.bellmann.common.constant.SecurityConstants;
import com.bellmann.common.enums.CustomStatusEnum;
import com.bellmann.common.enums.CustomTypeEnum;
import com.bellmann.converter.CustomerConverter;
import com.bellmann.manger.CustomerManager;
import com.bellmann.mapper.CustomerMapper;
import com.bellmann.model.entity.Customer;
import com.bellmann.model.vo.EquipmentCustomerVO;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
@Component
@ -16,11 +21,24 @@ public class CustomerManagerImpl implements CustomerManager {
private final CustomerMapper customerMapper;
private final CustomerConverter customerConverter;
private final RedisTemplate<String, Object> redisTemplate;
@Override
public EquipmentCustomerVO equipmentCustomer(Long customId) {
Customer customer = customerMapper.selectOne(new LambdaQueryWrapper<Customer>()
.eq(Customer::getCustId, customId)
);
return customerConverter.entityE2EquipmentVO(customer);
if(customer==null){
return null;
}
EquipmentCustomerVO customerVO = customerConverter.entityE2EquipmentVO(customer);
customerVO.setCustomType(IBaseEnum.getLabelByValue(customerVO.getCustomType(), CustomTypeEnum.class));
customerVO.setCustomStatus(IBaseEnum.getLabelByValue(customerVO.getCustomStatus(), CustomStatusEnum.class));
customerVO.setRegionAreaName(
(String) redisTemplate.opsForHash()
.get(SecurityConstants.DOMAIN_PREFIX,
customer.getRegionAreaId().toString()));
return customerVO;
}
}

@ -3,6 +3,7 @@ package com.bellmann.manger.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bellmann.common.base.IBaseEnum;
import com.bellmann.common.enums.DevAccessTypeEnum;
import com.bellmann.common.enums.EquipmentTypeEnum;
import com.bellmann.common.enums.OldCASeparationEnum;
import com.bellmann.manger.DeviceTypeManager;
import com.bellmann.mapper.DeviceTypeMapper;
@ -32,6 +33,7 @@ public class DeviceTypeManagerImpl implements DeviceTypeManager {
EquipmentTypeVO equipmentType = deviceTypeMapper.findEquipmentType(typeAndVerId);
equipmentType.setOldCASeparation(IBaseEnum.getLabelByValue(equipmentType.getOldCASeparation(), OldCASeparationEnum.class));
equipmentType.setDevAccessType(IBaseEnum.getLabelByValue(equipmentType.getDevAccessType(), DevAccessTypeEnum.class));
equipmentType.setEquipmentTypeVer(IBaseEnum.getLabelByValue(equipmentType.getEquipmentTypeVer(), EquipmentTypeEnum.class));
return equipmentType;
}
}

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bellmann.common.constant.StringUtilsConstants;
import com.bellmann.common.enums.FileTypeEnum;
import com.bellmann.common.enums.FileUrlEnum;
import com.bellmann.common.result.Result;
import com.bellmann.manger.FileRecordManager;
import com.bellmann.mapper.FileRecordMapper;
import com.bellmann.model.bo.DevTypeVerFileBO;
@ -12,7 +11,7 @@ import com.bellmann.model.entity.FileRecord;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.time.LocalDateTime;
import java.util.List;
@Component
@ -26,7 +25,7 @@ public class FileRecordManagerImpl implements FileRecordManager {
fileRecord.setFileName(devTypeVerFileBO.getFileName());
fileRecord.setFileDesc(StringUtilsConstants.STRING_BLANK);
fileRecord.setFileType(FileTypeEnum.SOFT_VER_FILE.getValue());
fileRecord.setFileCreateTime(new Date());
fileRecord.setFileCreateTime(LocalDateTime.now());
fileRecord.setFileUrl(String.format(FileUrlEnum.SOFT_VER_FILE_URL.getLabel(),devTypeVerFileBO.getTypeAndVerId()));
fileRecord.setUserName(StringUtilsConstants.STRING_BLANK);
fileRecord.setFileServId(1L);
@ -55,7 +54,7 @@ public class FileRecordManagerImpl implements FileRecordManager {
@Override
public List<FileRecord> listVendorProfile(Long typeAndVerId) {
return fileRecordMapper.listVendorProfile(typeAndVerId);
return fileRecordMapper.listVendorProfile(typeAndVerId,FileTypeEnum.CORP_CONF_FILE.getValue());
}
@Override
@ -70,4 +69,9 @@ public class FileRecordManagerImpl implements FileRecordManager {
fileRecordMapper.insert(fileRecord);
return fileRecord.getFileId();
}
@Override
public FileRecord fileRecordJoinFileVerMap(Long typeAndVerId) {
return fileRecordMapper.fileRecordJoinFileVerMap(typeAndVerId,FileTypeEnum.SOFT_VER_FILE.getValue());
}
}

@ -0,0 +1,18 @@
package com.bellmann.manger.impl;
import com.bellmann.manger.IpAddressDomainManager;
import com.bellmann.mapper.IpAddressDomainMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
@Component
@RequiredArgsConstructor
public class IpAddressDomainManagerImpl implements IpAddressDomainManager {
private final IpAddressDomainMapper ipAddressDomainMapper;
@Override
public String getIpAddressDomain(String ip) {
String placeName = ipAddressDomainMapper.getIpAddressDomain(ip);
return placeName==null?"/":placeName;
}
}

@ -1,8 +1,7 @@
package com.bellmann.mapper;
import com.bellmann.model.entity.FileRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bellmann.model.vo.FileRecordVO;
import com.bellmann.model.entity.FileRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -19,5 +18,7 @@ import java.util.List;
@Mapper
public interface FileRecordMapper extends BaseMapper<FileRecord> {
List<FileRecord> listVendorProfile(@Param("typeAndVerId") Long typeAndVerId);
List<FileRecord> listVendorProfile(@Param("typeAndVerId") Long typeAndVerId, @Param("fileType") String fileType);
FileRecord fileRecordJoinFileVerMap(@Param("typeAndVerId") Long typeAndVerId, @Param("fileType") String fileType);
}

@ -0,0 +1,10 @@
package com.bellmann.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bellmann.model.entity.IpAddressDomain;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IpAddressDomainMapper extends BaseMapper<IpAddressDomain> {
String getIpAddressDomain(String ip);
}

@ -1,6 +1,5 @@
package com.bellmann.model.bo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;

@ -1,14 +1,14 @@
package com.bellmann.model.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
*
@ -48,7 +48,7 @@ public class FileRecord implements Serializable {
/**
* 文件上传时间
*/
private Date fileCreateTime;
private LocalDateTime fileCreateTime;
/**
* 文件描述

@ -0,0 +1,14 @@
package com.bellmann.model.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("itms_ipaddress_domain")
public class IpAddressDomain {
private String ipCopeStart;
private String ipCopeEnd;
private String placeName;
}

@ -0,0 +1,19 @@
package com.bellmann.model.form;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "设备详细信息编辑表单")
public class EquipmentDetailForm {
private Long devId;
private String devSno;
private String devAdNo;
private String devPppoe;
private String devMac;
}

@ -1,5 +1,6 @@
package com.bellmann.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.time.LocalDateTime;
@ -9,10 +10,6 @@ public class EquipmentCustomerVO {
private Long custId;
private Long regionAreaId;
private Long corpAreaId;
private String customAccount;
private String customAddr;
@ -22,13 +19,16 @@ public class EquipmentCustomerVO {
private String customType;
private String customStatus;
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private LocalDateTime customCreateTime;
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private LocalDateTime customModifyTime;
private String customRemark1;
private String customRemark2;
private String regionAreaName;
}

@ -26,6 +26,8 @@ public class EquipmentDetailVO {
private Long regionAreaId;
private String regionAreaName;
private Long corpAreaId;
private String devMac;
@ -54,4 +56,10 @@ public class EquipmentDetailVO {
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private LocalDateTime devOnlineTime;
private String bandAccess;
private String iptvAccess;
private String placeName;
}

@ -30,4 +30,6 @@ public class EquipmentTypeVO {
@Schema(description = "设备网络侧接口")
private String devAccessType;
private String equipmentTypeVer;
}

@ -1,6 +1,8 @@
package com.bellmann.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.common.result.Result;
import com.bellmann.model.form.EquipmentDetailForm;
import com.bellmann.model.query.SelectQuery;
import com.bellmann.model.vo.EquipmentVO;
@ -10,4 +12,7 @@ public interface DeviceStaticService {
Page<EquipmentVO> resourcePage(SelectQuery query);
Map<Object, Object> resourceDeviceDetail(Long devId);
Result<String> editResourceEquipment(EquipmentDetailForm form);
}

@ -53,4 +53,6 @@ public interface DomainService {
*/
Result<List<TransferOption<Long>>> transferOption();
void refreshDomainCache();
}

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

@ -34,15 +34,11 @@ import com.bellmann.service.FileOptionService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.concurrent.Future;
import java.util.stream.Collectors;
@Service
@ -81,9 +77,24 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService {
Long devTypeId = query.getDevTypeId();
Page<DeviceTypeToVerBO> page = new Page<>(pageNum, pageSize);
Page<DeviceTypeToVerBO> boPage = deviceTypeVerMapper.deviceTypeToVerPage(page, devTypeId);
List<DeviceTypeToVerBO> records = getDeviceTypeToVerBOS(boPage);
boPage.setRecords(records);
return deviceTypeVerConverter.bo2PageVo(boPage);
}
private List<DeviceTypeToVerBO> getDeviceTypeToVerBOS(Page<DeviceTypeToVerBO> boPage) {
List<DeviceTypeToVerBO> records = boPage.getRecords();
records.forEach(deviceTypeToVerBO -> {
FileRecord fileRecord = fileRecordManager.fileRecordJoinFileVerMap(deviceTypeToVerBO.getTypeAndVerId());
if(fileRecord!=null){
deviceTypeToVerBO.setFileId(fileRecord.getFileId());
deviceTypeToVerBO.setFileName(fileRecord.getFileName());
deviceTypeToVerBO.setFileCreateTime(fileRecord.getFileCreateTime());
}
});
return records;
}
@Override
public Result<String> updateTypeAndVersionState(Long typeAndVerId) {
@ -280,7 +291,7 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService {
fileRecord.setFileServId(1L);
fileRecord.setFileUrl(form.getFileUrl());
fileRecord.setFileDesc(form.getFileDesc());
fileRecord.setFileCreateTime(new Date());
fileRecord.setFileCreateTime(LocalDateTime.now());
fileRecord.setUserName(SecurityUtils.getUsername());
fileRecordManager.addVendorProfile(fileRecord);
fileDevTypeMapManager.insertFileDevTypeVerMap(fileRecord.getFileId(), form.getTypeAndVerId());

@ -2,6 +2,7 @@ package com.bellmann.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bellmann.common.constant.SecurityConstants;
import com.bellmann.common.model.Option;
import com.bellmann.common.result.Result;
import com.bellmann.common.util.PathUtils;
@ -15,11 +16,11 @@ import com.bellmann.model.vo.DomainVO;
import com.bellmann.service.DomainService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import javax.annotation.PostConstruct;
import java.util.*;
import java.util.stream.Collectors;
@Service
@ -30,6 +31,28 @@ public class DomainServiceImpl implements DomainService {
private final DomainConverter domainConverter;
private final RedisTemplate<String, Object> redisTemplate;
/**
* 初始化权限缓存
*/
@PostConstruct
public void initDomainCache() {
refreshDomainCache();
}
@Override
public void refreshDomainCache() {
redisTemplate.delete(SecurityConstants.DOMAIN_PREFIX);
List<Domain> list = domainMapper.selectList(new LambdaQueryWrapper<>());
List<Domain> newDomains = PathUtils.objBuildPath(list);
Map<String,String> map = new HashMap<>();
for (Domain domain:newDomains){
map.put(String.valueOf(domain.getGroupId()), domain.getGroupName());
}
redisTemplate.opsForHash().putAll(SecurityConstants.DOMAIN_PREFIX,map);
}
@Override
public List<DomainVO> list(DomainQuery domainQuery) {
String keywords = domainQuery.getKeywords();
@ -114,6 +137,7 @@ public class DomainServiceImpl implements DomainService {
}
Domain domain = domainConverter.form2Entity(domainForm);
int rows = domainMapper.insert(domain);
refreshDomainCache();
return rows>0?Result.success():Result.failed();
}
@ -124,6 +148,7 @@ public class DomainServiceImpl implements DomainService {
new LambdaQueryWrapper<Domain>()
.eq(Domain::getGroupId, groupId)
);
refreshDomainCache();
return rows>0? Result.success() :Result.failed();
}
@ -143,6 +168,7 @@ public class DomainServiceImpl implements DomainService {
}
Domain domain = domainConverter.form2Entity(domainForm);
int row = domainMapper.update(domain, new LambdaQueryWrapper<Domain>().eq(Domain::getId, domain.getId()));
refreshDomainCache();
return row>0?Result.success():Result.failed();
}

@ -3,19 +3,18 @@ package com.bellmann.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.converter.FileRecordConverter;
import com.bellmann.model.entity.FileRecord;
import com.bellmann.mapper.FileRecordMapper;
import com.bellmann.model.entity.FileRecord;
import com.bellmann.model.form.FileRecordForm;
import com.bellmann.model.query.FileRecordQuery;
import com.bellmann.model.vo.FileRecordVO;
import com.bellmann.security.util.SecurityUtils;
import com.bellmann.service.FileRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.time.LocalDateTime;
/**
* <p>
@ -56,7 +55,7 @@ public class FileRecordServiceImpl implements FileRecordService {
public Integer addFileRecord(FileRecordForm form) {
FileRecord fileRecord = fileRecordConverter.form2Entity(form);
fileRecord.setUserName(SecurityUtils.getUsername());
fileRecord.setFileCreateTime(new Date());
fileRecord.setFileCreateTime(LocalDateTime.now());
fileRecord.setFileServId(1L);
return fileRecordMapper.insert(fileRecord);
}

@ -25,7 +25,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;
@ -105,7 +105,7 @@ public class ServiceServiceImpl implements ServiceService {
public Result<Long> addBusinessFile(FileRecordForm form) {
FileRecord fileRecord = fileRecordConverter.form2Entity(form);
fileRecord.setFileServId(1L);
fileRecord.setFileCreateTime(new Date());
fileRecord.setFileCreateTime(LocalDateTime.now());
fileRecord.setUserName(SecurityUtils.getUsername());
return Result.success(fileRecordManager.addBusinessFile(fileRecord));
}

@ -143,7 +143,8 @@
itms_device_type.dev_vendor_oui,
itms_device_type_ver_detail.dev_access_type,
itms_device_type_ver.soft_ver,
itms_device_type_ver_detail.old_jkfl as oldCASeparation
itms_device_type_ver_detail.old_jkfl as oldCASeparation,
itms_device_type_ver_detail.dev_type_name as equipmentTypeVer
FROM
itms_device_type
INNER JOIN itms_device_type_ver ON itms_device_type.dev_type_id = itms_device_type_ver.dev_type_id

@ -6,9 +6,6 @@
SELECT
idtv.type_and_ver_id,
idtv.soft_ver,
itms_file.file_name,
itms_file.file_id,
itms_file.file_create_time,
idtv.audit_time,
idtv.audit_user_name,
idtv.dev_type_ver_status,
@ -16,8 +13,6 @@
FROM
itms_device_type_ver idtv
LEFT JOIN itms_device_type_ver_detail idtvd ON idtv.type_and_ver_id = idtvd.type_and_ver_id
LEFT JOIN itms_file_dev_type_ver_map ifdtvm ON ifdtvm.type_and_ver_id = idtv.type_and_ver_id
LEFT JOIN itms_file ON itms_file.file_id = ifdtvm.file_id
WHERE
idtv.dev_type_id = #{devTypeId}
</select>

@ -29,6 +29,18 @@
WHERE
itms_file_dev_type_ver_map.type_and_ver_id = #{typeAndVerId}
and itms_file.file_type = '1'
and itms_file.file_type = #{fileType}
</select>
<select id="fileRecordJoinFileVerMap" resultType="com.bellmann.model.entity.FileRecord">
SELECT
itms_file.*
FROM
itms_file
INNER JOIN itms_file_dev_type_ver_map ON itms_file.file_id = itms_file_dev_type_ver_map.file_id
WHERE
itms_file_dev_type_ver_map.type_and_ver_id = #{typeAndVerId}
and itms_file.file_type = #{fileType}
</select>
</mapper>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bellmann.mapper.IpAddressDomainMapper">
<select id="getIpAddressDomain" resultType="java.lang.String">
SELECT place_name
FROM itms_ipaddress_domain
WHERE
inet(#{ip}) >= inet(ip_scope_start::text)
AND inet(#{ip}) &lt;= inet(ip_scope_end::text)
</select>
</mapper>
Loading…
Cancel
Save