From d99a56e37cf9109b46ee68d34a06594ef5615ed3 Mon Sep 17 00:00:00 2001
From: 张天森 <1292933220@qq.com>
Date: 星期四, 10 十一月 2022 16:06:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test

---
 springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyRepairApi.java |   37 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 36 insertions(+), 1 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyRepairApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyRepairApi.java
index 9aad64f..a28e9c6 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyRepairApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyRepairApi.java
@@ -1,9 +1,11 @@
 package com.panzhihua.service_property.api;
 
 
+import com.panzhihua.common.constants.Constants;
 import com.panzhihua.common.model.dtos.property.CommonPage;
 import com.panzhihua.common.model.vos.R;
 import com.panzhihua.common.model.vos.property.ComPropertyRepairVO;
+import com.panzhihua.common.utlis.RSAUtils;
 import com.panzhihua.service_property.entity.ComPropertyRepair;
 import com.panzhihua.service_property.service.ComPropertyRepairService;
 import org.springframework.beans.BeanUtils;
@@ -36,15 +38,39 @@
     }
 
     /**
+     * 分页查询所有数据 脱敏
+     * @return 所有数据
+     */
+    @PostMapping("queryAllDesensitize")
+    public R selectAllDesensitize(@RequestBody CommonPage commonPage) {
+        return this.comPropertyRepairService.pageListDesensitize(commonPage);
+    }
+
+
+
+    /**
      * 通过主键查询单条数据
      *
      * @param id 主键
      * @return 单条数据
      */
     @GetMapping("{id}")
-    public R selectOne(@PathVariable("id") Integer id) {
+    public R selectOne(@PathVariable("id") Long id) {
         return this.comPropertyRepairService.selectDetail(id);
     }
+
+
+    /**
+     * 通过主键查询单条数据 脱敏
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("desensitize/{id}")
+    public R selectOneDesensitize(@PathVariable("id") Long id) {
+        return this.comPropertyRepairService.selectDetailDesensitize(id);
+    }
+
 
     /**
      * 新增数据
@@ -58,6 +84,15 @@
         if(comPropertyRepairVO!=null){
             BeanUtils.copyProperties(comPropertyRepairVO,comPropertyRepair);
         }
+        ComPropertyRepairVO vo=comPropertyRepairVO;
+        try {
+            comPropertyRepair.setRepairName(RSAUtils.decrypt(comPropertyRepairVO.getRepairName(), Constants.PRIVATE_KEY));
+            comPropertyRepair.setRepairPhone(RSAUtils.decrypt(comPropertyRepairVO.getRepairPhone(), Constants.PRIVATE_KEY));
+        } catch (Exception e) {
+            e.printStackTrace();
+            comPropertyRepair.setRepairName(comPropertyRepairVO.getRepairName());
+            comPropertyRepair.setRepairPhone(comPropertyRepairVO.getRepairPhone());
+        }
         return R.ok(this.comPropertyRepairService.save(comPropertyRepair));
     }
 

--
Gitblit v1.7.1