Ver Fonte

电话号码加密

cgp há 8 horas atrás
pai
commit
b5e192b8ca

+ 10 - 1
fs-admin/src/main/java/com/fs/crm/controller/HandwriteCollectionController.java

@@ -36,6 +36,11 @@ public class HandwriteCollectionController extends BaseController
     {
         startPage();
         List<HandwriteCollection> list = handwriteCollectionService.selectHandwriteCollectionList(handwriteCollection);
+        for (HandwriteCollection item : list) {
+            if (item.getPatientPhone() != null) {
+                item.setPatientPhone(item.getPatientPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            }
+        }
         return getDataTable(list);
     }
 
@@ -55,7 +60,11 @@ public class HandwriteCollectionController extends BaseController
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Integer id)
     {
-        return AjaxResult.success(handwriteCollectionService.selectHandwriteCollectionById(id));
+        HandwriteCollection handwriteCollection = handwriteCollectionService.selectHandwriteCollectionById(id);
+        if (handwriteCollection.getPatientPhone() != null) {
+            handwriteCollection.setPatientPhone(handwriteCollection.getPatientPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+        }
+        return AjaxResult.success(handwriteCollection);
     }
 
 

+ 2 - 1
fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java

@@ -403,7 +403,8 @@ public class FsStoreOrderController extends BaseController
         if (userPhone!=null&&userPhone.length()>11){
             userPhone=decryptPhone(userPhone);
         }
-        return R.ok().put("userPhone",userPhone);
+//        return R.ok().put("userPhone",userPhone);
+        return R.ok();
     }
 
     /**

+ 10 - 1
fs-company/src/main/java/com/fs/company/controller/handwrite/HandwriteCollectionController.java

@@ -45,6 +45,11 @@ public class HandwriteCollectionController extends BaseController
     {
         startPage();
         List<HandwriteCollection> list = handwriteCollectionService.selectHandwriteCollectionList(handwriteCollection);
+        for (HandwriteCollection item : list) {
+            if (item.getPatientPhone() != null) {
+                item.setPatientPhone(item.getPatientPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            }
+        }
         return getDataTable(list);
     }
 
@@ -64,7 +69,11 @@ public class HandwriteCollectionController extends BaseController
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Integer id)
     {
-        return AjaxResult.success(handwriteCollectionService.selectHandwriteCollectionById(id));
+        HandwriteCollection handwriteCollection = handwriteCollectionService.selectHandwriteCollectionById(id);
+        if (handwriteCollection.getPatientPhone() != null) {
+            handwriteCollection.setPatientPhone(handwriteCollection.getPatientPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+        }
+        return AjaxResult.success(handwriteCollection);
     }
 
     /**

+ 2 - 1
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreOrderScrmController.java

@@ -238,7 +238,8 @@ public class FsStoreOrderScrmController extends BaseController
     {
         FsStoreOrderScrm order = fsStoreOrderService.selectFsStoreOrderById(id);
         String userPhone = order.getUserPhone();
-        return R.ok().put("userPhone",userPhone);
+//        return R.ok().put("userPhone",userPhone);
+        return R.ok();
     }
 
     @PreAuthorize("@ss.hasPermi('store:storeOrder:express')")

+ 6 - 0
fs-service/src/main/java/com/fs/handwrite/service/impl/HandwriteCollectionServiceImpl.java

@@ -152,6 +152,9 @@ public class HandwriteCollectionServiceImpl implements IHandwriteCollectionServi
     @Transactional(rollbackFor = Exception.class)
     public int addCollectionAndUpdateOrderStatus(HandwriteCollection handwriteCollection)
     {
+        if (handwriteCollection.getPatientPhone()!=null&&handwriteCollection.getPatientPhone().contains("*")){
+            handwriteCollection.setPatientPhone(null);
+        }
         Date currentTime = DateUtils.getNowDate();
         handwriteCollection.setCreateTime(currentTime);
         handwriteCollection.setUpdateTime(currentTime);
@@ -173,6 +176,9 @@ public class HandwriteCollectionServiceImpl implements IHandwriteCollectionServi
     public int updateHandwriteCollection(HandwriteCollection handwriteCollection)
     {
         handwriteCollection.setUpdateTime(new Date());
+        if (handwriteCollection.getPatientPhone()!=null&&handwriteCollection.getPatientPhone().contains("*")){
+            handwriteCollection.setPatientPhone(null);
+        }
         return handwriteCollectionMapper.updateHandwriteCollection(handwriteCollection);
     }