| | |
| | | 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; |
| | |
| | | */ |
| | | @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; |
| | | } |
| | |
| | | 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; |
| | | } |
| | | } |