Prechádzať zdrojové kódy

1.修改未测温通知逻辑。
2.增加未测温统计。

zhengqiang 5 rokov pred
rodič
commit
1d2c5051db

+ 19 - 31
web/src/main/java/com/jpsoft/smart/modules/base/controller/PersonInfoController.java

@@ -282,7 +282,15 @@ public class PersonInfoController {
             personInfo.setFaceEnabled(false);
 
             int affectCount = personInfoService.update(personInfo);
-            lapiService.deletePerson(personInfo.getId());
+
+            new Thread(()->{
+                try {
+                    lapiService.deletePerson(personInfo.getId());
+                }
+                catch (Exception ex){
+                    logger.error(ex.getMessage(),ex);
+                }
+            }).start();
 
 //            HSSFWorkbook workbook = new HSSFWorkbook();
 //            HSSFSheet sheet = workbook.createSheet();
@@ -320,9 +328,6 @@ public class PersonInfoController {
         MessageResult<Boolean> msgResult = new MessageResult<>();
         msgResult.setData(true);
 
-        HSSFWorkbook workbook = new HSSFWorkbook();
-        HSSFSheet sheet = workbook.createSheet();
-
         try {
             int affectCount = 0;
 
@@ -335,37 +340,19 @@ public class PersonInfoController {
                 personInfo.setFaceEnabled(false);
 
                 affectCount += personInfoService.update(personInfo);
-                lapiService.deletePerson(personInfo.getId());
 
-//                ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
-//                for (int i = 0; i < 10; i++) {
-//                    final int index = i;
-//                    try {
-//                        Thread.sleep(index * 1000);
-//                    } catch (InterruptedException e) {
-//                        e.printStackTrace();
-//                    }
-//                    cachedThreadPool.execute(new Runnable() {
-//                        public void run() {
-//                            if(!deleteDevicePerson(personInfo, sheet)){
-//                                msgResult.setData(false);
-//                            }
-//                        }
-//                    });
-//                }
+                new Thread(()->{
+                    try {
+                        lapiService.deletePerson(personInfo.getId());
+                    }
+                    catch (Exception ex){
+                        logger.error(ex.getMessage(),ex);
+                    }
+                }).start();
             }
 
             if (affectCount > 0) {
                 msgResult.setResult(true);
-                if(!msgResult.getData()) {
-                    ByteArrayOutputStream output = new ByteArrayOutputStream();
-                    workbook.write(output);
-                    byte[] buffer = output.toByteArray();
-                    ByteArrayInputStream input = new ByteArrayInputStream(buffer);
-                    String downloadUrl = OSSUtil.upload(ossConfig,"import","error.xls",input);
-
-                    msgResult.setMessage(downloadUrl);
-                }
             } else {
                 msgResult.setResult(false);
                 msgResult.setMessage("删除失败");
@@ -422,7 +409,6 @@ public class PersonInfoController {
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("a.id_","asc"));
 
-
         if (StringUtils.isNotEmpty(name)) {
             String[] names = name.split(",");
                 List nameList = new ArrayList();
@@ -431,9 +417,11 @@ public class PersonInfoController {
                 }
                 searchParams.put("nameList", nameList);
         }
+
         if (StringUtils.isNotEmpty(idCard)) {
             searchParams.put("idCard","%" + idCard + "%");
         }
+
         if (StringUtils.isNotEmpty(phone)) {
             searchParams.put("phone","%" + phone + "%");
         }