ZHOUTD 1 anno fa
parent
commit
8d0956c107

+ 14 - 0
xzl-admin/src/main/java/com/xzl/web/controller/MonitorAreaController.java

@@ -39,5 +39,19 @@ public class MonitorAreaController {
         return monitorAreaService.deleteArea(ids);
     }
 
+    @RequestMapping(value = "/getRegionMonitorInfo",method = RequestMethod.GET)
+    public List<Map> getRegionMonitorInfo(){
+        return monitorAreaService.getRegionMonitorInfo();
+    }
+
+    @RequestMapping(value = "/computeMonitorClient")
+    public void computeMonitorClient(){
+        monitorAreaService.computeMonitorClient();
+    }
+
+    @RequestMapping(value = "/getWarnClientList",method = RequestMethod.GET)
+    public List<Map> getWarnClientList(){
+        return monitorAreaService.getWarnClientList();
+    }
 
 }

+ 20 - 1
xzl-admin/src/main/java/com/xzl/web/mapper/MonitorAreaMapper.java

@@ -1,17 +1,36 @@
 package com.xzl.web.mapper;
 
+import com.xzl.web.model.monitorArea.entity.ClientPositionInfo;
 import com.xzl.web.model.monitorArea.entity.MonitorArea;
+import com.xzl.web.model.monitorArea.entity.MonitorClient;
 import com.xzl.web.model.monitorArea.entity.WarnClient;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 @Mapper
 public interface MonitorAreaMapper {
-    List<MonitorArea> listArea(@Param(value = "id")String id,@Param(value = "areaType")String areaType);
+    List<MonitorArea> listArea(@Param(value = "id") String id, @Param(value = "areaType") String areaType);
+
     List<WarnClient> noWarnClient();
+
     List<WarnClient> areaWarnClient();
+
     void saveArea(MonitorArea monitorArea);
+
     void deleteArea(List<String> list);
+
+    List<Map> getRegionMonitorInfo();
+
+    List<ClientPositionInfo> getClientPositionList();
+
+    List<MonitorClient> getClientRegionMonitorList();
+
+    void deleteMonitorClientList();
+
+    void saveMonitorClientList(List<MonitorClient> list);
+
+    List<Map> getWarnClientList();
 }

+ 39 - 0
xzl-admin/src/main/java/com/xzl/web/model/monitorArea/entity/ClientPositionInfo.java

@@ -0,0 +1,39 @@
+package com.xzl.web.model.monitorArea.entity;
+
+import lombok.Data;
+
+import java.util.Objects;
+
+@Data
+public class ClientPositionInfo {
+    private String clientCode;
+    private Double latitude;
+    private Double longitude;
+    private Integer businessType;
+    private Integer regionType;
+
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof ClientPositionInfo)) return false;
+        ClientPositionInfo that = (ClientPositionInfo) o;
+        return Objects.equals(getClientCode(), that.getClientCode()) && Objects.equals(getLatitude(), that.getLatitude()) && Objects.equals(getLongitude(), that.getLongitude()) && Objects.equals(getBusinessType(), that.getBusinessType()) && Objects.equals(getRegionType(), that.getRegionType());
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(getClientCode(), getLatitude(), getLongitude(), getBusinessType(), getRegionType());
+    }
+
+    @Override
+    public String toString() {
+        return "ClientPositionInfo{" +
+                "clientCode='" + clientCode + '\'' +
+                ", latitude=" + latitude +
+                ", longitude=" + longitude +
+                ", businessType=" + businessType +
+                ", regionType=" + regionType +
+                '}';
+    }
+}

+ 35 - 0
xzl-admin/src/main/java/com/xzl/web/model/monitorArea/entity/MonitorClient.java

@@ -0,0 +1,35 @@
+package com.xzl.web.model.monitorArea.entity;
+
+import lombok.Data;
+
+import java.util.Objects;
+
+@Data
+public class MonitorClient {
+
+    private String clientCode;
+    private String monitorInfo;
+
+
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof MonitorClient)) return false;
+        MonitorClient that = (MonitorClient) o;
+        return getClientCode().equals(that.getClientCode()) && Objects.equals(getMonitorInfo(), that.getMonitorInfo());
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(getClientCode(), getMonitorInfo());
+    }
+
+    @Override
+    public String toString() {
+        return "MonitorClient{" +
+                "clientCode='" + clientCode + '\'' +
+                ", monitorInfo='" + monitorInfo + '\'' +
+                '}';
+    }
+}

+ 6 - 0
xzl-admin/src/main/java/com/xzl/web/service/MonitorAreaService.java

@@ -14,4 +14,10 @@ public interface MonitorAreaService {
     Map<String,String> saveArea(MonitorArea monitorArea);
 
     Map<String, String> deleteArea(List<String> ids);
+
+    List<Map> getRegionMonitorInfo();
+
+    void computeMonitorClient();
+
+    List<Map> getWarnClientList();
 }

+ 48 - 3
xzl-admin/src/main/java/com/xzl/web/service/impl/MonitorAreaServiceImpl.java

@@ -4,15 +4,18 @@ package com.xzl.web.service.impl;
 import am.lodge.util.UUIDUtils;
 import com.alibaba.fastjson.JSON;
 import com.xzl.web.mapper.MonitorAreaMapper;
+import com.xzl.web.model.monitorArea.entity.ClientPositionInfo;
 import com.xzl.web.model.monitorArea.entity.MonitorArea;
+import com.xzl.web.model.monitorArea.entity.MonitorClient;
 import com.xzl.web.model.monitorArea.vo.InfoListVO;
 import com.xzl.web.service.MonitorAreaService;
+import com.xzl.web.utils.MapToolUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.logging.Logger;
 
 @Service
 public class MonitorAreaServiceImpl implements MonitorAreaService {
@@ -29,6 +32,7 @@ public class MonitorAreaServiceImpl implements MonitorAreaService {
         return infoListVO;
     }
 
+
     @Override
     public Map<String,String> saveArea(MonitorArea monitorArea) {
         monitorArea.setId(UUIDUtils.uuid());
@@ -61,4 +65,45 @@ public class MonitorAreaServiceImpl implements MonitorAreaService {
         map.put("message","删除成功!");
         return map;
     }
+
+    @Override
+    public List<Map> getRegionMonitorInfo() {
+        return monitorAreaMapper.getRegionMonitorInfo();
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void computeMonitorClient(){
+        List<ClientPositionInfo> list = monitorAreaMapper.getClientPositionList();
+        Set<MonitorClient> monitorList=new HashSet<>();
+        list.forEach(client->{
+            if(client.getBusinessType()==1){
+                return;
+            }
+            list.forEach(clientTemp->{
+                if(clientTemp.getBusinessType()==1||clientTemp.getClientCode().equals(client.getClientCode())){
+                    return;
+                }
+                double distance = MapToolUtils.getDistance(client.getLatitude(), client.getLongitude(), clientTemp.getLatitude(), clientTemp.getLongitude());
+                MonitorClient monitorClient=new MonitorClient();
+                monitorClient.setClientCode(clientTemp.getClientCode());
+                if(client.getRegionType()==1&&clientTemp.getRegionType()==1&&distance<=0.1D){
+                    monitorClient.setMonitorInfo("城区100米内有其他零售户");
+                    monitorList.add(monitorClient);
+                }else if(client.getRegionType()==2&&clientTemp.getRegionType()==2&&distance<=0.2D){
+                    monitorClient.setMonitorInfo("乡镇200米内有其他零售户");
+                    monitorList.add(monitorClient);
+                }
+            });
+        });
+        List<MonitorClient> monitorClientList = monitorAreaMapper.getClientRegionMonitorList();
+        monitorClientList.addAll(monitorList);
+        monitorAreaMapper.deleteMonitorClientList();
+        monitorAreaMapper.saveMonitorClientList(monitorClientList);
+    }
+
+    @Override
+    public List<Map> getWarnClientList() {
+        return monitorAreaMapper.getWarnClientList();
+    }
 }

+ 65 - 0
xzl-admin/src/main/java/com/xzl/web/utils/MapToolUtils.java

@@ -0,0 +1,65 @@
+package com.xzl.web.utils;
+
+public class MapToolUtils {
+    /**
+     * 地球半径
+     */
+    private static final double EarthRadius = 6370.996;
+
+    /**
+     * 经纬度转化成弧度
+     * Add by 成长的小猪(Jason.Song) on 2017/11/01
+     * http://blog.csdn.net/jasonsong2008
+     *
+     * @param d 经度/纬度
+     * @return
+     */
+    private static double rad(double d) {
+        return d * Math.PI / 180.0;
+    }
+
+    /**
+     * 计算两个坐标点之间的距离
+     * @param firstLatitude   第一个坐标的纬度
+     * @param firstLongitude  第一个坐标的经度
+     * @param secondLatitude  第二个坐标的纬度
+     * @param secondLongitude 第二个坐标的经度
+     * @return 返回两点之间的距离,单位:公里/千米
+     */
+    public static double getDistance(double firstLatitude, double firstLongitude,
+                                     double secondLatitude, double secondLongitude) {
+        double firstRadLat = rad(firstLatitude);
+        double firstRadLng = rad(firstLongitude);
+        double secondRadLat = rad(secondLatitude);
+        double secondRadLng = rad(secondLongitude);
+
+        double a = firstRadLat - secondRadLat;
+        double b = firstRadLng - secondRadLng;
+        double cal = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(firstRadLat)
+                * Math.cos(secondRadLat) * Math.pow(Math.sin(b / 2), 2))) * EarthRadius;
+        double result = Math.round(cal * 10000d) / 10000d;
+        return result;
+    }
+
+    /**
+     * 计算两个坐标点之间的距离
+     * @param firstPoint  第一个坐标点的(纬度,经度) 例如:"31.2553210000,121.4620020000"
+     * @param secondPoint 第二个坐标点的(纬度,经度) 例如:"31.2005470000,121.3269970000"
+     * @return 返回两点之间的距离,单位:公里/千米
+     */
+    public static double GetPointDistance(String firstPoint, String secondPoint) {
+        String[] firstArray = firstPoint.split(",");
+        String[] secondArray = secondPoint.split(",");
+        double firstLatitude = Double.valueOf(firstArray[0].trim());
+        double firstLongitude = Double.valueOf(firstArray[1].trim());
+        double secondLatitude = Double.valueOf(secondArray[0].trim());
+        double secondLongitude = Double.valueOf(secondArray[1].trim());
+        return getDistance(firstLatitude, firstLongitude, secondLatitude, secondLongitude);
+    }
+
+
+    public static void main(String[] args) {
+        System.out.println(MapToolUtils.GetPointDistance("31.3533250,114.6643240","30.591652,114.244087"));
+    }
+
+}

+ 55 - 0
xzl-admin/src/main/resources/mapper/MonitorAreaMapper.xml

@@ -21,6 +21,21 @@
         </where>
     </select>
 
+    <select id="getWarnClientList" resultType="map">
+        select a.client_code as "clientCode",
+               group_concat(a.monitor_info SEPARATOR "/") as "info",
+               vbc.LONGITUDE 'longitude',
+               vbc.LATITUDE 'latitude',
+               vbc.CLIENT_NAME 'clientName',
+               vbc.short_name "shortName",
+               vbc.TELPHONEA "telephone",
+               b.cnname "cnname"
+        from monitor_client a
+                 join v_b_client vbc on a.CLIENT_CODE=vbc.CLIENT_CODE
+                 JOIN T_B_EMPLOYEE B ON vbc.MANAGER_CODE=B.EMPLOYEE_CODE
+        group by a.client_code
+    </select>
+
     <select id="noWarnClient" resultType="com.xzl.web.model.monitorArea.entity.WarnClient">
         select
         vbc.LONGITUDE 'longitude',
@@ -78,11 +93,48 @@
             )
     </select>
 
+    <select id="getRegionMonitorInfo" resultType="map">
+        select id,name,if(client_num*1>rule_num*1,"1","2") as type,rule_num-client_num as num
+        from region a
+        join (select region_id,count(CLIENT_CODE) as client_num from region_client group by region_id) b on a.id=b.region_id
+        order by `NAME`
+    </select>
+
+    <select id="getClientPositionList" resultType="com.xzl.web.model.monitorArea.entity.ClientPositionInfo">
+        select a.client_code as clientCode,a.latitude,a.longitude,if(a.property_code = "C" OR a.property_code = "S","1","2") as businessType,IF(a.market_type=1,"1","2") as regionType
+        from v_b_client a
+        join region_client b on a.CLIENT_CODE=b.client_code
+        where state_code="02" and a.latitude is not null and a.longitude is not null
+    </select>
+
+    <select id="getClientRegionMonitorList" resultType="com.xzl.web.model.monitorArea.entity.MonitorClient">
+        select a.client_code as clientCode,
+               case
+                   WHEN (b.num>b.maximun and b.num>b.rule_num) then concat(b.name,"内零售户数量不合规,应设置",b.rule_num,"户,实设置",b.num,"户")
+                   WHEN (b.num>b.maximun or b.num>=b.rule_num) then concat(b.name,"内零售户数量已饱和,应设置",b.rule_num,"户,实设置",b.num,"户")
+                   WHEN (b.num <![CDATA[<]]> b.rule_num) then concat(b.name,"内零售户数量待增长,应设置",b.rule_num,"户,实设置",b.num,"户")
+                   end as monitorInfo
+        from region_client a
+                 join(
+            select a.id,a.name,a.maximun,a.rule_num,count(b.client_code) as num
+            from region a
+                     left join region_client b on a.id=b.region_id
+            group by a.id,a.name, a.maximun) b on a.region_id=b.id
+        order by b.name
+    </select>
+
     <insert id="saveArea" parameterType="com.xzl.web.model.monitorArea.entity.MonitorArea">
         INSERT INTO MONITOR_AREA(ID,AREA_NAME,AREA_TYPE,AREA_COLOR,AREA_DATA) VALUES
         (#{id},#{areaName},#{areaType},#{areaColor},#{areaData})
     </insert>
 
+    <insert id="saveMonitorClientList" parameterType="com.xzl.web.model.monitorArea.entity.MonitorClient">
+        insert into monitor_client values
+        <foreach collection="list" item="client" separator=",">
+            (#{client.clientCode},#{client.monitorInfo})
+        </foreach>
+    </insert>
+
     <delete id="deleteArea" parameterType="list">
         DELETE FROM MONITOR_AREA WHERE ID IN
         <foreach collection="list" item="item" separator="," open="(" close=")">
@@ -90,5 +142,8 @@
         </foreach>
     </delete>
 
+    <delete id="deleteMonitorClientList" parameterType="string">
+        delete from monitor_client
+    </delete>
 
 </mapper>

+ 5 - 1
xzl-ui/src/views/dataGovernance/tableData.vue

@@ -48,7 +48,11 @@ export default {
         url: "/dataGovernance/getTableTitleList?tableName=" + this.$route.query.databaseName+"."+this.$route.query.tableName,
         method: "get"
       }).then(rs => {
-        t.titleData = rs;
+        var titles=[];
+        for (let title in rs) {
+          titles.push({name: rs[title]});
+        }
+        t.titleData=titles;
       })
     },
     initData() {

+ 76 - 35
xzl-ui/src/views/monitor/map/customerPositionBmap.vue

@@ -13,7 +13,7 @@
           ></el-autocomplete>
         </el-form-item>
         <el-form-item label="距离:" prop="distance">
-          <el-select v-model="queryParams.distance" clearable>
+          <el-select v-model="queryParams.distance" clearable @change="handleSelect">
             <el-option
               v-for="item in distanceOptions"
               :key="item.value"
@@ -22,6 +22,16 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="区域:" prop="region">
+          <el-select v-model="queryParams.area" clearable @change="selectArea($event)">
+            <el-option
+              v-for="item in areaOptions"
+              :key="item.id"
+              :label="item.name"
+              :value="item"
+            />
+          </el-select>
+        </el-form-item>
       </el-form>
     </div>
     <div id="container" v-bind:style="'width: 100%;border: 1px solid #cecece;height:'+pageHeight*0.797+'px;'">
@@ -34,36 +44,45 @@ import request from '@/utils/request'
 export default {
   data() {
     return {
-      address:"",
+      address: "",
       queryParams: {
         address: {},
-        distance: "50"
+        distance: "50",
+        area: ""
       },
       placeInfo: [
         {value: "", label: ""}
       ],
+      selectPoint: {},
       distanceOptions: [
         {value: "50", label: "50米"},
         {value: "100", label: "100米"},
         {value: "200", label: "200米"}
       ],
+      areaOptions: [
+        {id: "", name: "",type:"",num:""},
+      ],
       map: null,
-      pageHeight:document.documentElement.clientHeight
+      pageHeight: document.documentElement.clientHeight
     }
   },
   created() {
-    setTimeout(()=>{
+    setTimeout(() => {
       this.initMap()
-    },100)
-    // var content =
-    //   '<ul class="map-customer-info">'
-    //   + '<li ><span>xx村零售户数量已有388户!计划为299户!</span></li>'
-    //   + '</ul>';
-    // this.$alert(content, '信息', {
-    //   dangerouslyUseHTMLString: true
-    // });
+    }, 100)
+  },
+  mounted() {
+    this.initAreaOptions();
   },
   methods: {
+    initAreaOptions(){
+      const t=this;
+      request({
+        url:"/monitorArea/getRegionMonitorInfo"
+      }).then(rs=>{
+        t.areaOptions=rs;
+      })
+    },
     addMarker(points) {
       //循环建立标注点
       var len = points.length;
@@ -73,13 +92,12 @@ export default {
       }
     },
     addTargetMarkerPoint(pointInfo, distance) {
-      console.log('pointInfo', pointInfo)
       let pt = new BMap.Point(pointInfo.longitude, pointInfo.latitude);
-      let icon=new BMap.Icon(require("@/assets/images/area_icon16x16.png") ,new BMap.Size(16, 16));
+      let icon = new BMap.Icon(require("@/assets/images/area_icon16x16.png"), new BMap.Size(16, 16));
       let options = {
-        icon:icon
+        icon: icon
       }
-      var marker = new BMap.Marker(pt,options)
+      var marker = new BMap.Marker(pt, options)
       var circle = new BMap.Circle(pt, distance, {
         strokeColor: 'blue',
         strokeWeight: 2,
@@ -166,29 +184,52 @@ export default {
     },
     querySearch(queryString, cb) {
       request({
-        url: '/api/map/search?key='+queryString,
+        url: '/api/map/search?key=' + queryString,
         method: 'get'
       }).then(function (res) {
         cb(res);
       })
     },
-    handleSelect(item){
-      if (item) {
-        const t=this;
-        this.map.clearOverlays();
-        this.addTargetMarkerPoint(item,this.queryParams.distance);
-        // 查询周围选定距离distance 以内的零售户
-        request({
-          url: "/api/map/customer/search",
-          method: 'post',
-          data: {latitude: item.latitude, longitude: item.longitude, count: 10, distance: this.queryParams.distance/1000}
-        }).then(function (rs) {
-          if (rs && rs.length) {
-            t.addMarker(rs);
-          } else {
-            t.$modal.msgError("未找到附近零售户");
-          }
-        })
+    handleSelect(item) {
+      if (!this.queryParams.distance) {
+        return;
+      }
+      if (typeof item == "object") {
+        this.selectPoint = item;
+      }
+      const t = this;
+      this.map.clearOverlays();
+      this.addTargetMarkerPoint(t.selectPoint, this.queryParams.distance);
+      // 查询周围选定距离distance 以内的零售户
+      request({
+        url: "/api/map/customer/search",
+        method: 'post',
+        data: {
+          latitude: t.selectPoint.latitude,
+          longitude: t.selectPoint.longitude,
+          count: 10,
+          distance: this.queryParams.distance / 1000
+        }
+      }).then(function (rs) {
+        if (rs && rs.length) {
+          t.addMarker(rs);
+        } else {
+          t.$modal.msgError("未找到附近零售户");
+        }
+      })
+
+    },
+    selectArea(option) {
+      if(option.type==1){
+        this.$message({
+          message: option.name+"零售户已饱和",
+          type:"error"
+        });
+      }else{
+        this.$message({
+          message: option.name+"零售户可办"+option.num+"户",
+          type:"success"
+        });
       }
     }
   }

+ 117 - 49
xzl-ui/src/views/monitor/map/warn.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-    <div id="container" v-bind:style="'width: 100%;border: 1px solid #cecece;height:'+pageHeight*0.9+'px;'">
+    <div id="container" v-bind:style="'width: 100%;border: 1px solid #cecece;height:'+pageHeight*0.81+'px;'">
     </div>
+    <el-row class="buttonRow">
+      <el-button type="warning" round  @click="initData" :loading="loadStatus">重新计算</el-button>
+    </el-row>
   </div>
 </template>
 <script>
@@ -24,10 +27,12 @@ export default {
         {value: "200", label: "200米"}
       ],
       map: null,
-      pageHeight: document.documentElement.clientHeight
+      pageHeight: document.documentElement.clientHeight,
+      loadStatus: false
     }
   },
   created() {
+    this.loadStatus=true;
     setTimeout(() => {
       this.initMap()
     }, 100)
@@ -40,27 +45,55 @@ export default {
       this.map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
       this.map.disableDoubleClickZoom();    //禁用双击放大
       this.init();
+      this.loadStatus=false;
     },
-    init() {
+    initData() {
+      let msg = '是否重新计算?';
       const t = this;
+      this.$confirm(msg, '确认信息', {
+        distinguishCancelAndClose: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消'
+      }).then(() => {
+        t.loadStatus=true;
+        const loading = this.$loading({
+          lock: true,
+          text: 'Loading',
+          spinner: 'el-icon-loading',
+          background: 'rgba(0, 0, 0, 0.7)'
+        });
+        request({
+          url: "/monitorArea/computeMonitorClient"
+        }).then(function (rs) {
+          t.initMap();
+          loading.close();
+          t.loadStatus=false;
+        });
+      }).catch(action => {
+        this.$message({
+          type: 'info',
+          message: "取消计算"
+        })
+      });
+    },
+    init() {
+      this.map.clearOverlays();
+      const t=this;
       request({
-        url: '/monitorArea/infoList',
-        method: "get"
+        url: "/monitorArea/infoList"
       }).then(function (rs) {
-        const areaInfo = rs.areaInfo;
-        const noWarnClientInfo = rs.noWarnClientInfo;
-        const WarnClientInfo = rs.WarnClientInfo;
-        console.log(areaInfo, noWarnClientInfo, WarnClientInfo);
-
-        areaInfo.forEach(data => {
-          if (data.areaType == 3) {
+        rs.areaInfo.forEach(data => {
             let listData = JSON.parse(data.areaData);
             let list = [];
             listData.forEach(areaData => {
               let pt = new BMap.Point(areaData.longitude, areaData.latitude);
               list.push(pt);
             });
-            let polygon = new BMap.Polygon(list, {fillColor: data.areaColor, strokeWeight: 2, strokeOpacity: 0.5});   //创建折线
+            let polygon = new BMap.Polygon(list, {
+              fillColor: data.areaColor,
+              strokeWeight: 2,
+              strokeOpacity: 0.5
+            });   //创建折线
             t.map.addOverlay(polygon);
             var x = 0,
               y = 0;
@@ -81,53 +114,73 @@ export default {
             let marker = new BMap.Marker(pt, options);
             t.map.addOverlay(marker);
             marker.addEventListener('click', function (e) {
-              var content =
-                '<ul class="map-customer-info">'
-                + '<li ><span>社区名称:</span>' + 'xxx社区' + '</li>'
-                + '<li ><span>人口:</span>' + 'xxxxxx' + '</li>'
-                + '<li ><span>零售户数量:</span>' + 'xxx' + '</li>'
-                + '<li ><span>可办证数量:</span>' + 'xx' + '</li>'
-                + '</ul>';
-              t.$alert(content, '社区信息', {
-                dangerouslyUseHTMLString: true
-              });
+              mini.alert("xx社区<br>" +
+                "总户数:3677(每年更新一次)<br>" +
+                "年未总人口:12735(每年更新一次)<br>" +
+                "可办理经营户:58户(固定)<br>" +
+                "现有零售户:93户(数据关连)<br>" +
+                "尚可办理经营户:-35(上面减下面)<br>" +
+                "目前排队户数:2(到时做扫描登记表进行关连)");  // 监听点击事件
             });
-          }
         });
-
-        let points = [];
-        noWarnClientInfo.forEach(data => {
+      });
+      request({
+        url: "/monitorArea/getWarnClientList"
+      }).then(function (rs) {
+        let dataList = rs;
+        let pointsG = [];  //成长绿色
+        let pointsB = [];  //饱和黄色
+        let pointsW = [];  //违规红色
+        dataList.forEach(data => {
           let pt = new BMap.Point(data.longitude, data.latitude);
           pt.shortName = data.shortName;
           pt.clientCode = data.clientCode;
           pt.telephone = data.telephone;
           pt.cnname = data.cnname;
-          points.push(pt);
+          pt.info = data.info;
+          if (data.info.includes("不合规") || data.info.includes("内有其他零售户")) {
+            pointsW.push(pt)
+          }
+          if (data.info.includes("饱和")) {
+            pointsB.push(pt)
+          }
+          if (data.info.includes("增长")) {
+            pointsG.push(pt)
+          }
         });
-        let options = {
+        let optionsG = {
           size: BMAP_POINT_SIZE_NORMAL,
           shape: BMAP_POINT_SHAPE_STAR,
-          color: '#848080'
+          color: "green"
         }
-        let pointCollection = new BMap.PointCollection(points, options);
-
-        pointCollection.addEventListener('click', function (e) {
-          var content =
-            '<ul class="map-customer-info">'
-            + '<li ><span>许可证号:</span>' + e.point.clientCode + '</li>'
-            + '<li ><span>名称:</span>' + e.point.shortName + '</li>'
-            + '<li ><span>电话:</span>' + e.point.telephone + '</li>'
-            + '<li ><span>客户经理:</span>' + e.point.cnname + '</li>'
-            + '<li ><span>库存:</span>' + 666 + '</li>'
-            + '</ul>';
-          t.$alert(content, '零售户信息', {
-            dangerouslyUseHTMLString: true
-          });
-        });
-        t.map.addOverlay(pointCollection);
-
-
-      });
+        let optionsB = {
+          size: BMAP_POINT_SIZE_NORMAL,
+          shape: BMAP_POINT_SHAPE_STAR,
+          color: "orange"
+        }
+        let optionsW = {
+          size: BMAP_POINT_SIZE_NORMAL,
+          shape: BMAP_POINT_SHAPE_STAR,
+          color: "#f34410"
+        }
+        let pointCollectionG = new BMap.PointCollection(pointsG, optionsG);
+        let pointCollectionB = new BMap.PointCollection(pointsB, optionsB);
+        let pointCollectionW = new BMap.PointCollection(pointsW, optionsW);
+        pointCollectionG.addEventListener('mouseover', function (e) {
+          let pt = new BMap.Point(e.point.lng, e.point.lat);
+          let opts = {
+            width: 300,     // 信息窗口宽度
+            height: 120,     // 信息窗口高度
+            title: '<h6 style="margin: 0;">零售户信息</h6>', // 信息窗口标题
+          }
+          let str = '姓名:' + e.point.shortName + "  许可证号:" + e.point.clientCode + "  <br>电话:" + e.point.telephone + "  市管员:" + e.point.cnname + "  <br>信息:" + e.point.info;
+          let infoWindow = new BMap.InfoWindow(str, opts);
+          t.map.openInfoWindow(infoWindow, pt);
+        })
+        t.map.addOverlay(pointCollectionG);
+        t.map.addOverlay(pointCollectionB);
+        t.map.addOverlay(pointCollectionW);
+      })
     }
   }
 }
@@ -141,4 +194,19 @@ export default {
 .anchorBL {
   display: none;
 }
+
+.buttonRow {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  /* 确保父元素的高度是可见区域的高度,以使其居中 */
+  padding-top: 10px;
+}
+
+button {
+  /* 可选的样式 */
+  padding: 10px 20px;
+  font-size: 16px;
+}
+
 </style>