Quellcode durchsuchen

修改人脸对比结果

tongfeng vor 2 Jahren
Ursprung
Commit
39499a34a7

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/application/admin/controller/AdminOrderController.java

@@ -274,7 +274,7 @@ public class AdminOrderController {
 		} catch (Exception e) {
 			throw new RuntimeException(e);
 		}
-		FileInfoEntity fileInfo = notaryDomain.uploadFaceFile(fileHandleVo);
+		FileInfoEntity fileInfo = notaryDomain.uploadFaceFile(filePath);
 		return ResultCode.SUCCESS;
 	}
 

+ 2 - 0
eladmin-system/src/main/java/me/zhengjie/base/util/FileUploadUtil.java

@@ -137,6 +137,8 @@ public class FileUploadUtil {
 				if (base64Prefix != null && base64Prefix.length > 1) {
 					imgStr = base64Prefix[1];
 				}
+			}else {
+				suffix = "jpeg";
 			}
 			// Base64解码
 			byte[] b = Base64.decodeBase64(imgStr);

+ 9 - 8
eladmin-system/src/main/java/me/zhengjie/domain/notary/impl/NotaryDomainImpl.java

@@ -121,7 +121,6 @@ public class NotaryDomainImpl implements NotaryDomain {
         }
 
 
-        FileUploadUtil.saveFaceImage(base64);
         FileInfoEntity fileInfo = uploadFaceFile(base64);
         boolean redisFlag = (count != null && count >= 2);
         if (ObjectUtils.isEmpty(id) || redisFlag) {
@@ -246,7 +245,7 @@ public class NotaryDomainImpl implements NotaryDomain {
                 }
                 //说明客户经理需要做人脸核身
                 FileInfoEntity fileInfo = uploadFaceFile(base64);
-                ThirdPartyInterfaceEntity thirdPartyInterfaceEntity = JuheServiceUtil.URLPost(idCard, nickName, base64);
+                FaceCompareEntity thirdPartyInterfaceEntity = JuheServiceUtil.URLPost(idCard, nickName, base64);
                 thirdPartyInterfaceEntity.setFileId(fileInfo.getId() + "");
                 thirdPartyInterfaceEntity.setConsultNo(contractOrder.getConsultNo());
                 thirdPartyInterfaceEntity.setBusinessNo(compareImageDomain.getBusinessNo());
@@ -269,9 +268,10 @@ public class NotaryDomainImpl implements NotaryDomain {
             if (! imageCenter(base)){
                 return ResultCode.IMAGE_NOT_STANDARD;
             }
+
             //说明当事人需要做人脸核身
             FileInfoEntity fileInfo = uploadFaceFile(base64);
-            ThirdPartyInterfaceEntity thirdPartyInterfaceEntity = JuheServiceUtil.URLPost(idCard, nickName, base64);
+            FaceCompareEntity thirdPartyInterfaceEntity = JuheServiceUtil.URLPost(idCard, nickName, base64);
             thirdPartyInterfaceEntity.setFileId(fileInfo.getId() + "");
             thirdPartyInterfaceEntity.setBusinessNo(compareImageDomain.getBusinessNo());
             thirdPartyInterfaceEntity.setConsultNo(contractOrder.getConsultNo());
@@ -543,27 +543,28 @@ public class NotaryDomainImpl implements NotaryDomain {
      * 上传对比照片到minio
      * @param base64
      */
-    public void uploadFile(String base64){
+    public void uploadFile(String base64,String filePath){
         JSONObject params = new JSONObject();
         params.put("base64", base64);
+        params.put("filePath",filePath);
         HttpClientUtil httpClientUtil = new HttpClientUtil();
-        String xmlData = httpClientUtil.doPost("https://fqgz.flowbb.cn:6001/sp/upload/uploadFaceImage",params.toString(),"utf-8");
+        String http = "https://fqgz.flowbb.cn:6001/sp/upload/uploadFaceImage";
+        String xmlData = httpClientUtil.doPost("http://192.168.0.140:8831/sp/upload/uploadFaceImage",params.toString(),"utf-8");
         JSONObject result = JSONObject.parseObject(xmlData);
         String code = result.getString("code");
         if ("100".equals(code)){
             log.info("上传成功");
         }
     }
-
     public FileInfoEntity uploadFaceFile(String base64){
+        String s = FileUploadUtil.saveFaceImage(base64);
         Thread t = new Thread(new Runnable() {
             @Override
             public void run() {
-                uploadFile(base64);
+                uploadFile(base64,s);
             }
         });
         t.start();
-        String s = FileUploadUtil.saveFaceImage(base64);
         String[] split = s.split("/");
         FileInfoEntity fileInfo = new FileInfoEntity();
         fileInfo.setLoanNo(split[0]);