qzy 6 місяців тому
батько
коміт
bcd4b52a06

+ 1 - 1
sp-service/level-two-server/src/main/java/com/pj/tb_orders/TbOrdersService.java

@@ -504,7 +504,7 @@ public class TbOrdersService extends ServiceImpl<TbOrdersMapper, TbOrders> imple
                 feeDTOList.add(feeDTO);
             }
         }
-        vo.setTotalFee(chargesPrice).setFeeList(feeDTOList);
+        vo.setTotalFee(chargesPrice).setFeeList(feeDTOList).setTitle("交易服务费用明细");
         return vo;
     }
 

+ 1 - 0
sp-service/level-two-server/src/main/java/com/pj/tb_orders/vo/OrderFeeItemVO.java

@@ -10,6 +10,7 @@ import java.util.List;
 @Accessors(chain = true)
 public class OrderFeeItemVO {
 
+    private String title;
     private BigDecimal totalFee;
     private String companyName;
     private List<FeeDTO>feeList;

+ 2 - 2
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserApiController.java

@@ -61,8 +61,8 @@ public class AppUserApiController {
 
     /** 边民首次使用APP人脸认证 */
     @PostMapping("face")
-    public AjaxJson face(@RequestPart MultipartFile file){
-        appUserService.authFace(StpAPPUserUtil.getAPPLoginInfo().getLoginId(),file);
+    public AjaxJson face(@RequestPart MultipartFile file,Integer type){
+        appUserService.authFace(StpAPPUserUtil.getAPPLoginInfo().getLoginId(),file,type);
         return AjaxJson.getSuccess();
     }
     @PostMapping("faceLogin")

+ 14 - 7
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserService.java

@@ -636,18 +636,25 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
     }
 
 
-    public void authFace(Long loginId, MultipartFile file) {
+    public void authFace(Long loginId, MultipartFile file,Integer type) {
         String img;
         try (InputStream is = file.getInputStream()) {
             img = Base64.encode(is);
-            boolean isLive = faceFactory.handler().checkIsLive(img);
-            if (!isLive) {
-                log.error("人脸注册为非活体人脸:{}", loginId);
-                // throw new AjaxError("非活体人脸");
-            }
+
         } catch (IOException e) {
             throw new AjaxError("识别失败");
         }
+        if (type==2){
+            String faceId = faceFactory.handler().faceSearch(img);
+            if (StrUtil.isEmpty(faceId)) {
+                throw  new AjaxError("人脸不匹配");
+            }
+            AppUser appUser = findByFaceId(faceId);
+            if (appUser == null) {
+                throw  new AjaxError("人员信息未找到");
+            }
+            return;
+        }
         String faceId = RandomUtil.randomString(32);
         AppUser appUser = this.getById(loginId);
         appUser.setFace(1);
@@ -676,7 +683,7 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
             img = Base64.encode(is);
             boolean isLive = faceFactory.handler().checkIsLive(img);
             if (!isLive) {
-                throw new AjaxError("非活体人脸");
+               // throw new AjaxError("非活体人脸");
             }
         } catch (IOException e) {
             throw new AjaxError("识别失败");