|
@@ -6,6 +6,7 @@ import com.maxmind.db.CHMCache;
|
|
|
import com.maxmind.geoip2.DatabaseReader;
|
|
|
import com.maxmind.geoip2.exception.GeoIp2Exception;
|
|
|
import com.maxmind.geoip2.model.CityResponse;
|
|
|
+import com.maxmind.geoip2.record.City;
|
|
|
import com.maxmind.geoip2.record.Country;
|
|
|
import com.maxmind.geoip2.record.Location;
|
|
|
import com.maxmind.geoip2.record.Subdivision;
|
|
@@ -135,10 +136,17 @@ public class MemberEnquiryModel {
|
|
|
if ("台湾".equals(country.getNames().get("zh-CN"))) {
|
|
|
dto.setCountryZhCN("中国台湾");
|
|
|
}
|
|
|
+ if ("中华民国".equals(country.getNames().get("zh-CN"))) {
|
|
|
+ dto.setCountryZhCN("中国台湾");
|
|
|
+ }
|
|
|
if ("澳门".equals(country.getNames().get("zh-CN"))) {
|
|
|
dto.setCountryZhCN("中国澳门");
|
|
|
}
|
|
|
dto.setCountryIsoCode(country.getIsoCode());
|
|
|
+ //城市
|
|
|
+ City city = response.getCity();
|
|
|
+ dto.setCityZhCN(city.getNames().get("zh-CN"));
|
|
|
+ dto.setCityIsoCode(StringUtil.isEmpty(city.getName()) ? country.getIsoCode() : city.getName());
|
|
|
//省份
|
|
|
Subdivision subdivision = response.getMostSpecificSubdivision();
|
|
|
dto.setSubdivisionIsoCode(subdivision.getIsoCode());
|
|
@@ -597,10 +605,10 @@ public class MemberEnquiryModel {
|
|
|
try {
|
|
|
String[] siteParam = {siteName};
|
|
|
//定义参数值
|
|
|
- if(StringUtil.isEmpty(enquiry.getPhone())){
|
|
|
+ if (StringUtil.isEmpty(enquiry.getPhone())) {
|
|
|
enquiry.setPhoneCode("");
|
|
|
}
|
|
|
- String[] templateArray = {enquiry.getName(), enquiry.getEmail(), enquiry.getCountry(),enquiry.getPhoneCode(), enquiry.getPhone(), enquiry.getQuantity() == null ? "-" : String.valueOf(enquiry.getQuantity()), enquiry.getMessage(), enquiry.getPageUrl()};
|
|
|
+ String[] templateArray = {enquiry.getName(), enquiry.getEmail(), enquiry.getCountry(), enquiry.getPhoneCode(), enquiry.getPhone(), enquiry.getQuantity() == null ? "-" : String.valueOf(enquiry.getQuantity()), enquiry.getMessage(), enquiry.getPageUrl()};
|
|
|
sendHtmlMail(storeTpl.getEmailContent(), tos, siteParam, templateArray, pattern);
|
|
|
} catch (Exception e) {
|
|
|
log.error("[sendEnquiryInfo][发送邮件]:", e);
|