Ver código fonte

获取上一条记录的时间条件修改为id

Reiskuchen 5 anos atrás
pai
commit
95ab2d1999

+ 10 - 9
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ScreenshotServiceImpl.java

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