Browse Source

会员增加经纬度

Gaosheng 2 days ago
parent
commit
f4c7f27291

+ 6 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/member/pojo/Member.java

@@ -148,6 +148,12 @@ public class Member implements Serializable {
     @ApiModelProperty("会员类型 1:海外门户 2:国内分销门户 ")
     private String webSite;
 
+    @ApiModelProperty("经度")
+    private Double longitude;
+
+    @ApiModelProperty("纬度")
+    private Double latitude;
+
     /**
      * 获取账户余额
      */

+ 19 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/system/dto/CountryAreaApiDto.java

@@ -14,6 +14,25 @@ public class CountryAreaApiDto {
     private String subdivisionIsoCode;
     private String timeZone;
 
+    public Double getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(Double latitude) {
+        this.latitude = latitude;
+    }
+
+    public Double getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(Double longitude) {
+        this.longitude = longitude;
+    }
+
+    private Double latitude;
+    private Double longitude;
+
     public String getCountryZhCN() {
         return countryZhCN;
     }

+ 2 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/member/front/advich/MemberEmailActiveController.java

@@ -457,6 +457,8 @@ public class MemberEmailActiveController extends BaseController {
         CountryAreaApiDto countryAreaApiDto = memberEnquiryModel.getCountryAndAreaByIp(ip);
         memberNew.setCountry(countryAreaApiDto.getCountryIsoCode());
         memberNew.setCity(countryAreaApiDto.getCityIsoCode());
+        memberNew.setLatitude(countryAreaApiDto.getLatitude());
+        memberNew.setLongitude(countryAreaApiDto.getLongitude());
 
         memberModel.updateMember(memberNew);
         return memberNew;

+ 3 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/member/advich/MemberEnquiryModel.java

@@ -157,6 +157,8 @@ public class MemberEnquiryModel {
             if (!StringUtil.isEmpty(location.getTimeZone())) {
                 dto.setTimeZone(location.getTimeZone());
             }
+            dto.setLatitude(location.getLatitude());
+            dto.setLongitude(location.getLongitude());
             dto.setCityIsoCode(StringUtil.isEmpty(city.getName()) ? subdivision.getNames().get("en") : city.getName());
         } catch (IOException | GeoIp2Exception e) {
             e.printStackTrace();
@@ -713,6 +715,7 @@ public class MemberEnquiryModel {
      * @return
      */
     public List<ScreenEnquiryDistribution> getEnquiryDistribution(String webSite) {
+        System.out.println(getCountryAndAreaByIp("97.64.105.122"));
         return memberEnquiryReadMapper.getEnquiryDistribution(webSite);
     }
 }

+ 7 - 1
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/statistics/ScreenMemberDistribution.java

@@ -12,6 +12,12 @@ public class ScreenMemberDistribution {
     @ApiModelProperty("城市")
     private String city;
 
-    @ApiModelProperty("询盘次数")
+    @ApiModelProperty("经度")
+    private Double longitude;
+
+    @ApiModelProperty("纬度")
+    private Double latitude;
+
+    @ApiModelProperty("会员数")
     private Integer memberNum;
 }

+ 2 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/member/MemberReadMapper.xml

@@ -46,6 +46,8 @@
         <result column="member_main_product" property="memberMainProduct" />
         <result column="country" property="country" />
         <result column="city" property="city" />
+        <result column="latitude" property="latitude" />
+        <result column="longitude" property="longitude" />
         <result column="web_site" property="webSite" />
     </resultMap>
     <!--按照主键值进行操作-->

+ 14 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/write/member/MemberWriteMapper.xml

@@ -46,6 +46,8 @@
     <result column="member_main_product" property="memberMainProduct" />
     <result column="country" property="country" />
     <result column="city" property="city" />
+    <result column="latitude" property="latitude" />
+    <result column="longitude" property="longitude" />
     <result column="web_site" property="webSite" />
   </resultMap>
   <!--除主键外的所有字段,用于插入操作-->
@@ -180,6 +182,12 @@
       <if test="city != null">
         `city`,
       </if>
+      <if test="latitude != null">
+        `latitude`,
+      </if>
+      <if test="longitude != null">
+        `longitude`,
+      </if>
       <if test="webSite != null">
         `web_site`,
       </if>
@@ -606,6 +614,12 @@
       <if test="city != null">
         #{city},
       </if>
+      <if test="latitude != null">
+        #{latitude},
+      </if>
+      <if test="longitude != null">
+        #{longitude},
+      </if>
       <if test="webSite != null">
         #{webSite},
       </if>

+ 4 - 0
xinkeaboard-server/doc/DDL/update.sql

@@ -363,6 +363,10 @@ update sys_setting set `value`='1' where name = 'verification_code_check_is_enab
 
 ALTER TABLE sys_pc_navigation ADD COLUMN create_time DATETIME NOT NULL DEFAULT NOW() COMMENT '创建时间' AFTER data;
 
+ALTER TABLE member ADD COLUMN  latitude  DECIMAL(10, 6) NULL  COMMENT '纬度' AFTER city;
+
+ALTER TABLE member ADD COLUMN  longitude  DECIMAL(10, 6) NULL  COMMENT '经度' AFTER latitude;
+