From 78851285202a040f8ddf998c067cd462874c1cb9 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期四, 19 十月 2023 14:55:27 +0800
Subject: [PATCH] 配置修改
---
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java | 29 +++++++++++++++++------------
1 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java b/UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java
index 301b635..06da8b8 100644
--- a/UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java
+++ b/UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java
@@ -5,6 +5,8 @@
import com.stylefeng.guns.modular.system.dao.PhoneMapper;
import com.stylefeng.guns.modular.system.model.Phone;
import com.stylefeng.guns.modular.system.service.IPhoneService;
+import com.stylefeng.guns.modular.system.util.AESUtil;
+import com.stylefeng.guns.modular.system.util.DESUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -27,18 +29,21 @@
*/
@Override
public List<Phone> queryPhones(String code) throws Exception {
- List<Phone> list = new ArrayList<>();
- if(ToolUtil.isNotEmpty(code)){
- String province = code.substring(0, 2) + "0000";
- String city = code.substring(0, 4) + "00";
+ if(ToolUtil.isEmpty(code)){
+ return new ArrayList<>();
+ }
+ String province = code.substring(0, 2) + "0000";
+ String city = code.substring(0, 4) + "00";
- list = phoneMapper.queryPhones(province, city, code);
- if(list.size() == 0){
- list = phoneMapper.queryPhones(province, city, null);
- }
- if(list.size() == 0){
- list = phoneMapper.queryPhones(province, null, null);
- }
+ List<Phone> list = phoneMapper.queryPhones(province, city, code);
+ if(list.size() == 0){
+ list = phoneMapper.queryPhones(province, city, null);
+ }
+ if(list.size() == 0){
+ list = phoneMapper.queryPhones(province, null, null);
+ }
+ for (Phone phone : list) {
+ phone.setPhone(phone.getPhone());
}
return list;
}
@@ -68,7 +73,7 @@
if(query == null){
query = phoneMapper.query(2, 2, province, null, null);
}
- map.put("company", null != query ? query.getPhone() : "");
+ map.put("company", null != query ? AESUtil.encrypt(query.getPhone()) : "");
return map;
}
}
--
Gitblit v1.7.1