|
|
@@ -1,12 +1,14 @@
|
|
|
package com.doc.scanner.service.impl;
|
|
|
|
|
|
-import java.util.List;
|
|
|
- import com.doc.common.utils.DateUtils;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import com.doc.scanner.mapper.ScannerInfoMapper;
|
|
|
+import com.doc.common.utils.DateUtils;
|
|
|
import com.doc.scanner.domain.ScannerInfo;
|
|
|
+import com.doc.scanner.mapper.ScannerInfoMapper;
|
|
|
import com.doc.scanner.service.IScannerInfoService;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 扫描仪管理Service业务层处理
|
|
|
@@ -49,8 +51,8 @@ public class ScannerInfoServiceImpl implements IScannerInfoService {
|
|
|
*/
|
|
|
@Override
|
|
|
public int insertScannerInfo(ScannerInfo scannerInfo) {
|
|
|
- scannerInfo.setCreateTime(DateUtils.getNowDate());
|
|
|
- return scannerInfoMapper.insertScannerInfo(scannerInfo);
|
|
|
+ scannerInfo.setCreateTime(DateUtils.getNowDate());
|
|
|
+ return scannerInfoMapper.insertScannerInfo(scannerInfo);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -61,7 +63,7 @@ public class ScannerInfoServiceImpl implements IScannerInfoService {
|
|
|
*/
|
|
|
@Override
|
|
|
public int updateScannerInfo(ScannerInfo scannerInfo) {
|
|
|
- scannerInfo.setUpdateTime(DateUtils.getNowDate());
|
|
|
+ scannerInfo.setUpdateTime(DateUtils.getNowDate());
|
|
|
return scannerInfoMapper.updateScannerInfo(scannerInfo);
|
|
|
}
|
|
|
|
|
|
@@ -86,4 +88,16 @@ public class ScannerInfoServiceImpl implements IScannerInfoService {
|
|
|
public int deleteScannerInfoByScannerId(Long scannerId) {
|
|
|
return scannerInfoMapper.deleteScannerInfoByScannerId(scannerId);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询所有扫描仪IP列表
|
|
|
+ *
|
|
|
+ * @return IP列表
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<String> selectIpList() {
|
|
|
+ List<ScannerInfo> list = selectScannerInfoList(new ScannerInfo());
|
|
|
+ List<String> ipList = list.stream().map(ScannerInfo::getScannerIp).collect(Collectors.toList());
|
|
|
+ return ipList;
|
|
|
+ }
|
|
|
}
|