Browse Source

功能优化

qzy 5 months ago
parent
commit
add3586607

+ 9 - 0
sp-core/sp-api/src/main/java/com/pj/api/dto/AppUserDto.java

@@ -25,6 +25,7 @@ public class AppUserDto {
      * 姓名
      */
     private String name;
+    private String faceId;
     /**
      * 创建单位
      */
@@ -273,4 +274,12 @@ public class AppUserDto {
     public void setPassword(String password) {
         this.password = password;
     }
+
+    public String getFaceId() {
+        return faceId;
+    }
+
+    public void setFaceId(String faceId) {
+        this.faceId = faceId;
+    }
 }

+ 2 - 0
sp-core/sp-base/src/main/java/com/pj/face/handler/IFaceHandler.java

@@ -28,6 +28,8 @@ public interface IFaceHandler {
      */
     void createPersonByBase(String faceId, String name, String imageBase);
 
+    void deletePerson(String faceId);
+
     /**
      * 检查校验
      * @param faceId 人脸ID

+ 17 - 2
sp-core/sp-base/src/main/java/com/pj/face/handler/impl/TencenFaceHandlerImpl.java

@@ -50,8 +50,8 @@ public class TencenFaceHandlerImpl implements IFaceHandler {
             vo.setMsg(e.getMessage());
             return vo;
         }
-        boolean result=resp != null && resp.getIsMatch();
-        vo.setMsg(result?"成功":"不匹配");
+        boolean result = resp != null && resp.getIsMatch();
+        vo.setMsg(result ? "成功" : "不匹配");
         vo.setSuccess(result);
         return vo;
     }
@@ -106,6 +106,21 @@ public class TencenFaceHandlerImpl implements IFaceHandler {
 
     }
 
+    @Override
+    public void deletePerson(String faceId) {
+        IaiClient client = this.createClient();
+        DeleteFaceRequest request = new DeleteFaceRequest();
+        request.setPersonId(faceId);
+        request.setFaceIds(new String[]{faceId});
+        try {
+            DeleteFaceResponse response = client.DeleteFace(request);
+           Long num= response.getSucDeletedNum();
+        } catch (TencentCloudSDKException e) {
+            log.error("delete face fail,{}", e.getMessage());
+        }
+        log.info("delete face : {}", faceId);
+    }
+
     public boolean checkIsLive(String baseImg) {
         IaiClient client = this.createClient();
         DetectLiveFaceRequest req = new DetectLiveFaceRequest();

+ 1 - 1
sp-core/sp-nacos/src/main/resources/logback.xml

@@ -114,7 +114,7 @@
     <logger name="java.sql.PreparedStatement" level="DEBUG"/>
 
     <!-- 生产环境下,将此级别配置为适合的级别,以免日志文件太多或影响程序性能 -->
-    <root level="debug">
+    <root level="info">
         <!-- 生产环境将请stdout,testfile去掉 -->
         <appender-ref ref="STDOUT"/>
         <appender-ref ref="FILE_DEBUG"/>

+ 1 - 0
sp-service/level-one-server/src/main/java/com/pj/ht_trade_settlement/HtTradeSettlementMapper.xml

@@ -56,6 +56,7 @@
 			<if test=' this.has("enterpriseId") '> and enterprise_id = #{enterpriseId} </if>
 			<if test=' this.has("returns") '> and returns = #{returns} </if>
 			<if test=' this.has("chargebacks") '> and chargebacks = #{chargebacks} </if>
+			<if test=' this.has("hzsConfirmStatus") '> and hzs_confirm_status = #{hzsConfirmStatus} </if>
 			<if test=' this.has("id") '> and id = #{id} </if>
 		</where>
 		order by

+ 25 - 11
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleController.java

@@ -3,9 +3,11 @@ package com.pj.tb_people;
 import java.io.IOException;
 import java.util.List;
 
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import cn.hutool.log.StaticLog;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.pj.api.consts.FeignFactory;
 import com.pj.api.dto.AppUserDto;
 import com.pj.api.dto.HtPeopleDto;
 import com.pj.api.dto.PeopleDto;
@@ -95,6 +97,7 @@ public class TbPeopleController {
         tbPeopleService.bindShop(shopVO);
         return AjaxJson.getSuccess();
     }
+
     @RequestMapping("removeBind")
     @SaCheckPermission(TbPeople.PERMISSION_CODE_BIND_SHOP)
     public AjaxJson removeBind(String id) {
@@ -102,7 +105,9 @@ public class TbPeopleController {
         return AjaxJson.getSuccess();
     }
 
-    /** 移除组内边民 */
+    /**
+     * 移除组内边民
+     */
     @RequestMapping("leaveGroup")
     @SaCheckPermission(TbPeople.PERMISSION_CODE_EDIT)
     public AjaxJson leaveGroup(@Validated LeaveGroupDto leaveGroupDto) {
@@ -113,7 +118,7 @@ public class TbPeopleController {
      * 查 - 根据id
      */
     @RequestMapping("getById")
-	@SaCheckPermission(TbPeople.PERMISSION_CODE)
+    @SaCheckPermission(TbPeople.PERMISSION_CODE)
     public AjaxJson getById(String id) {
         TbPeople t = tbPeopleService.getById(id);
         return AjaxJson.getSuccessData(t);
@@ -190,7 +195,7 @@ public class TbPeopleController {
     @RequestMapping("applyAddGroup")
     public AjaxJson addAppleGroup(@RequestParam("peopleIds") String peopleIds, @RequestParam("groupId") Long groupId) {
         String[] peopleIdarr = peopleIds.split(",");
-        for (String peopleId: peopleIdarr) {
+        for (String peopleId : peopleIdarr) {
             tbPeopleService.applyAddGroup(Long.valueOf(peopleId), groupId);
         }
         return AjaxJson.getSuccess("申请成功等待组长批准");
@@ -210,6 +215,8 @@ public class TbPeopleController {
         return ajaxJson;
     }
 
+
+
     /**
      * 组长是否同意申请
      *
@@ -220,7 +227,7 @@ public class TbPeopleController {
     public AjaxJson passApply(@RequestParam("groupId") Long groupId, @RequestParam("peopleIds") String peopleIds, @RequestParam("approve") int approve) {
         approve = 1;//同意
         String[] peopleIdarr = peopleIds.split(",");
-        for (String peopleId: peopleIdarr) {
+        for (String peopleId : peopleIdarr) {
             tbPeopleService.passApply(groupId, Long.valueOf(peopleId), approve);
         }
         return AjaxJson.getSuccess("边民加入互助组成功");
@@ -228,24 +235,29 @@ public class TbPeopleController {
 
     /**
      * 边民扫脸确认进境申报
+     *
      * @param orderID
      * @return
      */
     @PostMapping("entryDeclaration")
-    public AjaxJson entryDeclaration(Long orderID){
+    public AjaxJson entryDeclaration(Long orderID) {
         boolean declaration = tbPeopleService.entryDeclaration(orderID);
-        if(declaration)return AjaxJson.getSuccess();
+        if (declaration) return AjaxJson.getSuccess();
         return AjaxJson.getError();
     }
-    /** 保存银行卡信息 */
+
+    /**
+     * 保存银行卡信息
+     */
     @RequestMapping("saveBankInfo")
-    public AjaxJson saveBankByPeople(@RequestParam("id")Long id, @RequestParam("bankName")String bankName, @RequestParam("bankAccount")String bankAccount) {
+    public AjaxJson saveBankByPeople(@RequestParam("id") Long id, @RequestParam("bankName") String bankName, @RequestParam("bankAccount") String bankAccount) {
         boolean result = tbPeopleService.saveBankByPeople(id, bankName, bankAccount);
         if (result) {
             return AjaxJson.getSuccess("修改成功!");
         }
         return AjaxJson.getError("修改失败!");
     }
+
     /**
      * 数据导入接口
      *
@@ -285,7 +297,7 @@ public class TbPeopleController {
     @RequestMapping("getPeopleForGroup")
     @SaCheckPermission(TbPeople.PERMISSION_CODE)
     public AjaxJson getPeopleForGroup(@RequestParam Long tradeAreaId) {
-        return AjaxJson.getSuccessData(tbPeopleService.getPeopleForGroup(tradeAreaId,1));
+        return AjaxJson.getSuccessData(tbPeopleService.getPeopleForGroup(tradeAreaId, 1));
     }
 
 
@@ -319,9 +331,11 @@ public class TbPeopleController {
         return list;
     }
 
-    /** 根据航通主键查询appUser */
+    /**
+     * 根据航通主键查询appUser
+     */
     @RequestMapping("rpc/getAppUserByBorderPutrecNo")
-    public AppUserDto getAppUserByPlatSeqNo(@RequestParam("borderPutrecNo") String borderPutrecNo){
+    public AppUserDto getAppUserByPlatSeqNo(@RequestParam("borderPutrecNo") String borderPutrecNo) {
         AppUserDto appUserByPlatSeqNo = tbPeopleService.getAppUserByBorderPutrecNo(borderPutrecNo);
         return appUserByPlatSeqNo;
     }

+ 2 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleService.java

@@ -807,4 +807,6 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
 
 
     }
+
+
 }

+ 2 - 1
sp-service/level-one-server/src/main/java/com/pj/tb_shop/TbShopMapper.xml

@@ -37,7 +37,8 @@
 			<if test=' this.has("area") '> and area = #{area} </if>
 			<if test=' this.has("status") '> and status = #{status} </if>
 			<if test=' this.has("remark") '> and remark = #{remark} </if>
-			<if test=' this.has("enterpriseName") '> and enterprise_name = #{enterpriseName} </if>
+			<if test=' this.has("enterpriseName") '> and enterprise_name like cancat('%',#{enterpriseName},'%')  </if>
+			<if test=' this.has("ownerName") '> and owner_name like cancat('%',#{ownerName},'%')  </if>
 			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
 		</where>
 		order by

+ 21 - 1
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserController.java

@@ -3,9 +3,11 @@ package com.pj.project.app_user;
 import java.util.Date;
 import java.util.List;
 
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import cn.hutool.log.StaticLog;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.pj.api.consts.FeignFactory;
 import com.pj.api.dto.*;
 
 import com.pj.api.dto.BindShopDTO;
@@ -123,6 +125,25 @@ public class AppUserController {
         return appUserService.updateRole(appRoleId);
     }
 
+    @RequestMapping("cleanFace")
+    public AjaxJson cleanFace(@RequestParam("id") Long id) {
+        AppUserDto appUserDto = FeignFactory.adminInterface.getByFkId(id);
+        String faceId = appUserDto.getFaceId();
+        if (StrUtil.isEmpty(faceId)) {
+            return AjaxJson.getSuccess();
+        }
+        AppUser db = appUserService.getById(appUserDto.getId());
+        db.setFaceId(null).setFace(0).setFaceTime(null);
+        appUserService.updateById(db);
+        appUserService.cleanFace(faceId);
+        return AjaxJson.getSuccess();
+    }
+
+
+
+
+
+
     /*-----               正常业务接口👆👆    不越界     rpc远程调用 👇👇                     -----*/
 
 
@@ -217,5 +238,4 @@ public class AppUserController {
     }
 
 
-
 }

+ 4 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserService.java

@@ -871,4 +871,8 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
         appUser.setFkId(fkId);
         return this.updateById(appUser);
     }
+
+    public void cleanFace(String faceId) {
+        faceFactory.handler().deletePerson(faceId);
+    }
 }

+ 1 - 1
sp-service/sp-admin/src/main/java/com/pj/project4sp/utils/ImageUtils.java

@@ -54,7 +54,7 @@ public class ImageUtils {
         long imageSizeBytes = Long.MAX_VALUE;
 
         // 使用缩放和调整图片质量的循环,直到图片小于指定大小
-        while (imageSizeBytes / (1024 * 1024) >= 5) {
+        while (imageSizeBytes / (1024 * 1024) >= 4) {
 
             baos.reset(); // 重置输出流
             try {