|
@@ -255,7 +255,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg saveAndProcessImage(ScreenshotVO screenshotvo) {
|
|
public HttpRespMsg saveAndProcessImage(ScreenshotVO screenshotvo) {
|
|
Map<String, Object> fileMap = UploadFileToFileNameUtil.uploadFile(screenshotvo.getFile(), path);
|
|
Map<String, Object> fileMap = UploadFileToFileNameUtil.uploadFile(screenshotvo.getFile(), path);
|
|
- String filePath = (String)fileMap.get("sqlFilePath");
|
|
|
|
|
|
+ String filePath = (String) fileMap.get("sqlFilePath");
|
|
Screenshot screenshot = new Screenshot();
|
|
Screenshot screenshot = new Screenshot();
|
|
BeanUtils.copyProperties(screenshotvo, screenshot);
|
|
BeanUtils.copyProperties(screenshotvo, screenshot);
|
|
screenshot.setPicUrl(filePath);
|
|
screenshot.setPicUrl(filePath);
|
|
@@ -291,8 +291,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
// //由于存入数据库的对象被序列化成了json字符串,所以从redis里拿方便
|
|
// //由于存入数据库的对象被序列化成了json字符串,所以从redis里拿方便
|
|
// members = redisUtil.members(Constant.COMMON_SOFTWARE_KEYWORDS);
|
|
// members = redisUtil.members(Constant.COMMON_SOFTWARE_KEYWORDS);
|
|
// }
|
|
// }
|
|
- File picFile = new File((String)fileMap.get("newFile"));
|
|
|
|
- System.out.println("File:"+picFile.getAbsolutePath());
|
|
|
|
|
|
+ File picFile = new File((String) fileMap.get("newFile"));
|
|
if (isNovel(textContents)) {
|
|
if (isNovel(textContents)) {
|
|
screenshot.setPicType(6);
|
|
screenshot.setPicType(6);
|
|
} else if (isDocument(textContents)) {
|
|
} else if (isDocument(textContents)) {
|
|
@@ -310,7 +309,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
File f = new File(prePath);
|
|
File f = new File(prePath);
|
|
if (f.exists()) {
|
|
if (f.exists()) {
|
|
ImageCompare comp = new ImageCompare();
|
|
ImageCompare comp = new ImageCompare();
|
|
- if (comp.isMoviePlay((String)fileMap.get("newFile"), prePath)) {
|
|
|
|
|
|
+ if (comp.isMoviePlay((String) fileMap.get("newFile"), prePath)) {
|
|
screenshot.setPicType(7);
|
|
screenshot.setPicType(7);
|
|
//前面那条也更新
|
|
//前面那条也更新
|
|
if (preShot.getPicType() != null && preShot.getPicType() != 7) {
|
|
if (preShot.getPicType() != null && preShot.getPicType() != 7) {
|
|
@@ -324,7 +323,10 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
if (screenshot.getPicType() == null) {
|
|
if (screenshot.getPicType() == null) {
|
|
//默认设置为查资料
|
|
//默认设置为查资料
|
|
try {
|
|
try {
|
|
- String browserName = isBrowser(picFile);
|
|
|
|
|
|
+ String browserName = isBrowser(new File((String) fileMap.get("newFile")));
|
|
|
|
+ System.out.println(
|
|
|
|
+ "找到浏览器==" + browserName
|
|
|
|
+ );
|
|
if (browserName != null) {
|
|
if (browserName != null) {
|
|
screenshot.setPicType(1);
|
|
screenshot.setPicType(1);
|
|
}
|
|
}
|
|
@@ -347,7 +349,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
File pic = new File(filePath);
|
|
File pic = new File(filePath);
|
|
String devName = isDevelop(pic);
|
|
String devName = isDevelop(pic);
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
- if(devName != null) {
|
|
|
|
|
|
+ if (devName != null) {
|
|
msg.data = devName;
|
|
msg.data = devName;
|
|
} else {
|
|
} else {
|
|
try {
|
|
try {
|
|
@@ -365,8 +367,8 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg updateRedisPicContentKeywords() {
|
|
public HttpRespMsg updateRedisPicContentKeywords() {
|
|
List<PicContentKeywords> picContentKeywords = picContentKeywordsMapper.selectList(null);
|
|
List<PicContentKeywords> picContentKeywords = picContentKeywordsMapper.selectList(null);
|
|
- for (PicContentKeywords keyWord : picContentKeywords) {
|
|
|
|
- redisUtil.sSetJsonString("keyWords",keyWord);
|
|
|
|
|
|
+ for (PicContentKeywords keyWord : picContentKeywords) {
|
|
|
|
+ redisUtil.sSetJsonString("keyWords", keyWord);
|
|
}
|
|
}
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
msg.data = redisUtil.members("keyWords");
|
|
msg.data = redisUtil.members("keyWords");
|
|
@@ -449,7 +451,6 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
private static boolean isPureColor(BufferedImage img, int colorPixel) {
|
|
private static boolean isPureColor(BufferedImage img, int colorPixel) {
|
|
int with = img.getWidth();
|
|
int with = img.getWidth();
|
|
int height = img.getHeight();
|
|
int height = img.getHeight();
|