فهرست منبع

预警管理,数据导入

zhangshuling 1 سال پیش
والد
کامیت
2ccbd000e6

+ 124 - 0
xzl-admin/src/main/java/com/xzl/web/controller/userPortrait/BussIllegalCustomerController.java

@@ -0,0 +1,124 @@
+package com.xzl.web.controller.userPortrait;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.xzl.common.core.domain.entity.SysUser;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.xzl.common.annotation.Log;
+import com.xzl.common.core.controller.BaseController;
+import com.xzl.common.core.domain.AjaxResult;
+import com.xzl.common.enums.BusinessType;
+import com.xzl.system.domain.BussIllegalCustomer;
+import com.xzl.system.service.IBussIllegalCustomerService;
+import com.xzl.common.utils.poi.ExcelUtil;
+import com.xzl.common.core.page.TableDataInfo;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author xzl
+ * @date 2023-12-27
+ */
+@RestController
+@RequestMapping("/buss/illegal-customer")
+public class BussIllegalCustomerController extends BaseController {
+  @Autowired
+  private IBussIllegalCustomerService bussIllegalCustomerService;
+
+  /**
+   * 查询【请填写功能名称】列表
+   */
+  @PreAuthorize("@ss.hasPermi('buss:illegal-customer:list')")
+  @GetMapping("/list")
+  public TableDataInfo list(BussIllegalCustomer bussIllegalCustomer) {
+    startPage();
+    List<BussIllegalCustomer> list = bussIllegalCustomerService.selectBussIllegalCustomerList(bussIllegalCustomer);
+    return getDataTable(list);
+  }
+
+
+  /**
+   * 查询【请填写功能名称】列表
+   */
+  @GetMapping("/all")
+  public List<BussIllegalCustomer> all(BussIllegalCustomer bussIllegalCustomer) {
+    List<BussIllegalCustomer> list = bussIllegalCustomerService.selectBussIllegalCustomerList(bussIllegalCustomer);
+    return list;
+  }
+
+
+  /**
+   * 导出【请填写功能名称】列表
+   */
+  @PreAuthorize("@ss.hasPermi('buss:illegal-customer:export')")
+  @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+  @PostMapping("/export")
+  public void export(HttpServletResponse response, BussIllegalCustomer bussIllegalCustomer) {
+    List<BussIllegalCustomer> list = bussIllegalCustomerService.selectBussIllegalCustomerList(bussIllegalCustomer);
+    ExcelUtil<BussIllegalCustomer> util = new ExcelUtil<BussIllegalCustomer>(BussIllegalCustomer.class);
+    util.exportExcel(response, list, "【请填写功能名称】数据");
+  }
+
+  /**
+   * 获取【请填写功能名称】详细信息
+   */
+  @PreAuthorize("@ss.hasPermi('buss:illegal-customer:query')")
+  @GetMapping(value = "/{id}")
+  public AjaxResult getInfo(@PathVariable("id") String id) {
+    return success(bussIllegalCustomerService.selectBussIllegalCustomerById(id));
+  }
+
+  /**
+   * 新增【请填写功能名称】
+   */
+  @PreAuthorize("@ss.hasPermi('buss:illegal-customer:add')")
+  @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+  @PostMapping
+  public AjaxResult add(@RequestBody BussIllegalCustomer bussIllegalCustomer) {
+    return toAjax(bussIllegalCustomerService.insertBussIllegalCustomer(bussIllegalCustomer));
+  }
+
+  /**
+   * 修改【请填写功能名称】
+   */
+  @PreAuthorize("@ss.hasPermi('buss:illegal-customer:edit')")
+  @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+  @PutMapping
+  public AjaxResult edit(@RequestBody BussIllegalCustomer bussIllegalCustomer) {
+    return toAjax(bussIllegalCustomerService.updateBussIllegalCustomer(bussIllegalCustomer));
+  }
+
+  /**
+   * 删除【请填写功能名称】
+   */
+  @PreAuthorize("@ss.hasPermi('buss:illegal-customer:remove')")
+  @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+  @DeleteMapping("/{ids}")
+  public AjaxResult remove(@PathVariable String[] ids) {
+    return toAjax(bussIllegalCustomerService.deleteBussIllegalCustomerByIds(ids));
+  }
+
+
+  @Log(title = "用户管理", businessType = BusinessType.IMPORT)
+//  @PreAuthorize("@ss.hasPermi('system:user:import')")
+  @PostMapping("/importData")
+  public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
+    ExcelUtil<BussIllegalCustomer> util = new ExcelUtil<BussIllegalCustomer>(BussIllegalCustomer.class);
+    List<BussIllegalCustomer> customerList = util.importExcel(file.getInputStream());
+    String operName = getUsername();
+    String message = bussIllegalCustomerService.importData(customerList, updateSupport, operName);
+    return success(message);
+  }
+
+}

+ 150 - 0
xzl-system/src/main/java/com/xzl/system/domain/BussIllegalCustomer.java

@@ -0,0 +1,150 @@
+package com.xzl.system.domain;
+
+import com.xzl.common.annotation.Excel;
+import com.xzl.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.springframework.data.annotation.Transient;
+
+import java.math.BigDecimal;
+
+/**
+ * 【请填写功能名称】对象 buss_illegal_customer
+ * Ø
+ *
+ * @author xzl
+ * @date 2023-12-27
+ */
+public class BussIllegalCustomer extends BaseEntity {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * $column.columnComment
+   */
+  private String id;
+
+  /**
+   * 许可证号
+   */
+  @Excel(name = "许可证号")
+  private String licenceNo;
+
+  /**
+   * 零售户姓名
+   */
+  @Excel(name = "零售户姓名")
+  private String customerName;
+
+  /**
+   * 1许可证异常信息、2经营户违规信息、3真烟外流信息进行数据关链、4产生许可证异常预警、5内管黑名单预警、6内管灰名单预警
+   */
+  @Excel(name = "违规类型")
+  private String illegalType;
+  /**
+   * 经度
+   */
+  @Excel(name = "经度")
+  private BigDecimal longitude;
+
+  /**
+   * 纬度
+   */
+  @Excel(name = "纬度")
+  private BigDecimal latitude;
+
+  private String delFlag;
+
+  @Excel(name = "备注")
+  private String remark;
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public void setLicenceNo(String licenceNo) {
+    this.licenceNo = licenceNo;
+  }
+
+  public String getLicenceNo() {
+    return licenceNo;
+  }
+
+  public void setCustomerName(String customerName) {
+    this.customerName = customerName;
+  }
+
+  public String getCustomerName() {
+    return customerName;
+  }
+
+  public void setIllegalType(String illegalType) {
+    this.illegalType = illegalType;
+  }
+
+  public String getIllegalType() {
+    return illegalType;
+  }
+
+  public void setLongitude(BigDecimal longitude) {
+    this.longitude = longitude;
+  }
+
+  public BigDecimal getLongitude() {
+    return longitude;
+  }
+
+  public void setLatitude(BigDecimal latitude) {
+    this.latitude = latitude;
+  }
+
+  public BigDecimal getLatitude() {
+    return latitude;
+  }
+
+  public String getDelFlag() {
+    return delFlag;
+  }
+
+  public void setDelFlag(String delFlag) {
+    this.delFlag = delFlag;
+  }
+
+
+  private String address;
+  private String illegalTypes;
+
+  @Transient
+  public String getAddress() {
+    return address;
+  }
+
+  public void setAddress(String address) {
+    this.address = address;
+  }
+
+  @Transient
+  public String getIllegalTypes() {
+    return illegalTypes;
+  }
+
+  public void setIllegalTypes(String illegalTypes) {
+    this.illegalTypes = illegalTypes;
+  }
+
+  @Override
+  public String toString() {
+    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+      .append("id", getId())
+      .append("licenceNo", getLicenceNo())
+      .append("customerName", getCustomerName())
+      .append("illegalType", getIllegalType())
+      .append("longitude", getLongitude())
+      .append("latitude", getLatitude())
+      .append("remark", getRemark())
+      .toString();
+  }
+}

+ 5 - 52
xzl-system/src/main/java/com/xzl/system/domain/DOrder.java

@@ -1,15 +1,13 @@
 package com.xzl.system.domain;
 
-import java.math.BigDecimal;
-import java.util.Date;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
 import com.xzl.common.annotation.Excel;
 import com.xzl.common.core.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import org.springframework.data.annotation.Transient;
 
+import java.math.BigDecimal;
+
 /**
  * 【请填写功能名称】对象 d_order
  *
@@ -65,24 +63,6 @@ public class DOrder extends BaseEntity {
   @Excel(name = "商品单价")
   private BigDecimal goodsAmount;
 
-  /**
-   * $column.columnComment
-   */
-  @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
-  private Date createdDate;
-
-  /**
-   * $column.columnComment
-   */
-  @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
-  private String lastModifiedBy;
-
-  /**
-   * $column.columnComment
-   */
-  @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
-  private Date lastModifiedDate;
-
   public void setId(String id) {
     this.id = id;
   }
@@ -147,30 +127,6 @@ public class DOrder extends BaseEntity {
     return goodsAmount;
   }
 
-  public void setCreatedDate(Date createdDate) {
-    this.createdDate = createdDate;
-  }
-
-  public Date getCreatedDate() {
-    return createdDate;
-  }
-
-  public void setLastModifiedBy(String lastModifiedBy) {
-    this.lastModifiedBy = lastModifiedBy;
-  }
-
-  public String getLastModifiedBy() {
-    return lastModifiedBy;
-  }
-
-  public void setLastModifiedDate(Date lastModifiedDate) {
-    this.lastModifiedDate = lastModifiedDate;
-  }
-
-  public Date getLastModifiedDate() {
-    return lastModifiedDate;
-  }
-
   @Override
   public String toString() {
     return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@@ -183,16 +139,10 @@ public class DOrder extends BaseEntity {
       .append("goodsQuantity", getGoodsQuantity())
       .append("goodsAmount", getGoodsAmount())
       .append("remark", getRemark())
-      .append("createBy", getCreateBy())
-      .append("createdDate", getCreatedDate())
-      .append("lastModifiedBy", getLastModifiedBy())
-      .append("lastModifiedDate", getLastModifiedDate())
       .toString();
   }
 
 
-
-
   private String clientCode;
   private String shortName;
   private String startDatetime;
@@ -206,6 +156,7 @@ public class DOrder extends BaseEntity {
   public void setClientCode(String clientCode) {
     this.clientCode = clientCode;
   }
+
   @Transient
   public String getShortName() {
     return shortName;
@@ -214,6 +165,7 @@ public class DOrder extends BaseEntity {
   public void setShortName(String shortName) {
     this.shortName = shortName;
   }
+
   @Transient
   public String getStartDatetime() {
     return startDatetime;
@@ -222,6 +174,7 @@ public class DOrder extends BaseEntity {
   public void setStartDatetime(String startDatetime) {
     this.startDatetime = startDatetime;
   }
+
   @Transient
   public String getEndDatetime() {
     return endDatetime;

+ 64 - 0
xzl-system/src/main/java/com/xzl/system/mapper/BussIllegalCustomerMapper.java

@@ -0,0 +1,64 @@
+package com.xzl.system.mapper;
+
+import com.xzl.system.domain.BussIllegalCustomer;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ * 
+ * @author xzl
+ * @date 2023-12-27
+ */
+public interface BussIllegalCustomerMapper 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public BussIllegalCustomer selectBussIllegalCustomerById(String id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param bussIllegalCustomer 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<BussIllegalCustomer> selectBussIllegalCustomerList(BussIllegalCustomer bussIllegalCustomer);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param bussIllegalCustomer 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertBussIllegalCustomer(BussIllegalCustomer bussIllegalCustomer);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param bussIllegalCustomer 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateBussIllegalCustomer(BussIllegalCustomer bussIllegalCustomer);
+
+    /**
+     * 删除【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteBussIllegalCustomerById(String id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBussIllegalCustomerByIds(String[] ids);
+
+    void cleanData();
+}

+ 64 - 0
xzl-system/src/main/java/com/xzl/system/service/IBussIllegalCustomerService.java

@@ -0,0 +1,64 @@
+package com.xzl.system.service;
+
+import com.xzl.common.core.domain.entity.SysUser;
+import com.xzl.system.domain.BussIllegalCustomer;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author xzl
+ * @date 2023-12-27
+ */
+public interface IBussIllegalCustomerService {
+  /**
+   * 查询【请填写功能名称】
+   *
+   * @param id 【请填写功能名称】主键
+   * @return 【请填写功能名称】
+   */
+  public BussIllegalCustomer selectBussIllegalCustomerById(String id);
+
+  /**
+   * 查询【请填写功能名称】列表
+   *
+   * @param bussIllegalCustomer 【请填写功能名称】
+   * @return 【请填写功能名称】集合
+   */
+  public List<BussIllegalCustomer> selectBussIllegalCustomerList(BussIllegalCustomer bussIllegalCustomer);
+
+  /**
+   * 新增【请填写功能名称】
+   *
+   * @param bussIllegalCustomer 【请填写功能名称】
+   * @return 结果
+   */
+  public int insertBussIllegalCustomer(BussIllegalCustomer bussIllegalCustomer);
+
+  /**
+   * 修改【请填写功能名称】
+   *
+   * @param bussIllegalCustomer 【请填写功能名称】
+   * @return 结果
+   */
+  public int updateBussIllegalCustomer(BussIllegalCustomer bussIllegalCustomer);
+
+  /**
+   * 批量删除【请填写功能名称】
+   *
+   * @param ids 需要删除的【请填写功能名称】主键集合
+   * @return 结果
+   */
+  public int deleteBussIllegalCustomerByIds(String[] ids);
+
+  /**
+   * 删除【请填写功能名称】信息
+   *
+   * @param id 【请填写功能名称】主键
+   * @return 结果
+   */
+  public int deleteBussIllegalCustomerById(String id);
+
+  String importData(List<BussIllegalCustomer> list, boolean updateSupport, String operName);
+}

+ 148 - 0
xzl-system/src/main/java/com/xzl/system/service/impl/BussIllegalCustomerServiceImpl.java

@@ -0,0 +1,148 @@
+package com.xzl.system.service.impl;
+
+import com.xzl.common.exception.ServiceException;
+import com.xzl.common.utils.StringUtils;
+import com.xzl.common.utils.bean.BeanValidators;
+import com.xzl.common.utils.uuid.IdUtils;
+import com.xzl.system.domain.BussIllegalCustomer;
+import com.xzl.system.mapper.BussIllegalCustomerMapper;
+import com.xzl.system.service.IBussIllegalCustomerService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.validation.Validator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author xzl
+ * @date 2023-12-27
+ */
+@Service
+public class BussIllegalCustomerServiceImpl implements IBussIllegalCustomerService {
+
+  private static final Logger log = LoggerFactory.getLogger(BussIllegalCustomerServiceImpl.class);
+
+  @Autowired
+  private BussIllegalCustomerMapper bussIllegalCustomerMapper;
+
+  @Autowired
+  protected Validator validator;
+
+  /**
+   * 查询【请填写功能名称】
+   *
+   * @param id 【请填写功能名称】主键
+   * @return 【请填写功能名称】
+   */
+  @Override
+  public BussIllegalCustomer selectBussIllegalCustomerById(String id) {
+    return bussIllegalCustomerMapper.selectBussIllegalCustomerById(id);
+  }
+
+  /**
+   * 查询【请填写功能名称】列表
+   *
+   * @param bussIllegalCustomer 【请填写功能名称】
+   * @return 【请填写功能名称】
+   */
+  @Override
+  public List<BussIllegalCustomer> selectBussIllegalCustomerList(BussIllegalCustomer bussIllegalCustomer) {
+    return bussIllegalCustomerMapper.selectBussIllegalCustomerList(bussIllegalCustomer);
+  }
+
+  /**
+   * 新增【请填写功能名称】
+   *
+   * @param bussIllegalCustomer 【请填写功能名称】
+   * @return 结果
+   */
+  @Override
+  public int insertBussIllegalCustomer(BussIllegalCustomer bussIllegalCustomer) {
+    return bussIllegalCustomerMapper.insertBussIllegalCustomer(bussIllegalCustomer);
+  }
+
+  /**
+   * 修改【请填写功能名称】
+   *
+   * @param bussIllegalCustomer 【请填写功能名称】
+   * @return 结果
+   */
+  @Override
+  public int updateBussIllegalCustomer(BussIllegalCustomer bussIllegalCustomer) {
+    return bussIllegalCustomerMapper.updateBussIllegalCustomer(bussIllegalCustomer);
+  }
+
+  /**
+   * 批量删除【请填写功能名称】
+   *
+   * @param ids 需要删除的【请填写功能名称】主键
+   * @return 结果
+   */
+  @Override
+  public int deleteBussIllegalCustomerByIds(String[] ids) {
+    return bussIllegalCustomerMapper.deleteBussIllegalCustomerByIds(ids);
+  }
+
+  /**
+   * 删除【请填写功能名称】信息
+   *
+   * @param id 【请填写功能名称】主键
+   * @return 结果
+   */
+  @Override
+  public int deleteBussIllegalCustomerById(String id) {
+    return bussIllegalCustomerMapper.deleteBussIllegalCustomerById(id);
+  }
+
+  @Override
+  public String importData(List<BussIllegalCustomer> list, boolean updateSupport, String operName) {
+    if (StringUtils.isNull(list) || list.size() == 0) {
+      throw new ServiceException("导入零售户数据不能为空!");
+    }
+    int successNum = 0;
+    int failureNum = 0;
+    StringBuilder successMsg = new StringBuilder();
+    StringBuilder failureMsg = new StringBuilder();
+    // 先删除表数据
+    bussIllegalCustomerMapper.cleanData();
+
+    Map<String, String> typeMap = new HashMap<String, String>();
+    typeMap.put("许可证异常信息", "1");
+    typeMap.put("经营户违规信息", "2");
+    typeMap.put("真烟外流信息进行数据关链", "3");
+    typeMap.put("产生许可证异常预警", "4");
+    typeMap.put("内管黑名单预警", "5");
+    typeMap.put("内管灰名单预警", "6");
+
+    for (BussIllegalCustomer customer : list) {
+      try {
+        customer.setId(IdUtils.simpleUUID());
+        customer.setIllegalType(typeMap.get(customer.getIllegalType()));
+        // 验证是否存在这个用户
+        BeanValidators.validateWithException(validator, customer);
+        customer.setUpdateBy(operName);
+        bussIllegalCustomerMapper.insertBussIllegalCustomer(customer);
+        successNum++;
+        successMsg.append("<br/>" + successNum + "、零售户 " + customer.getCustomerName() + " 保存成功");
+      } catch (Exception e) {
+        failureNum++;
+        String msg = "<br/>" + failureNum + "、零售户 " + customer.getCustomerName() + " 导入失败:";
+        failureMsg.append(msg + e.getMessage());
+        log.error(msg, e);
+      }
+    }
+    if (failureNum > 0) {
+      failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
+      throw new ServiceException(failureMsg.toString());
+    } else {
+      successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+    }
+    return successMsg.toString();
+  }
+}

+ 104 - 0
xzl-system/src/main/resources/mapper/system/BussIllegalCustomerMapper.xml

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xzl.system.mapper.BussIllegalCustomerMapper">
+
+    <resultMap type="BussIllegalCustomer" id="BussIllegalCustomerResult">
+        <result property="id" column="id"/>
+        <result property="licenceNo" column="licence_no"/>
+        <result property="customerName" column="customer_name"/>
+        <result property="illegalType" column="illegal_type"/>
+        <result property="longitude" column="longitude"/>
+        <result property="latitude" column="latitude"/>
+        <result property="remark" column="remark"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="address" column="address"/>
+    </resultMap>
+
+    <sql id="selectBussIllegalCustomerVo">
+        select m.id, m.licence_no, m.customer_name, m.illegal_type, m.longitude, m.latitude, m.remark, m.del_flag, m.create_by, m.create_time, m.update_by, m.update_time,
+        d.address
+        from buss_illegal_customer m
+        left join v_b_client d on m.licence_no = d.client_code
+    </sql>
+
+    <select id="selectBussIllegalCustomerList" parameterType="BussIllegalCustomer"
+            resultMap="BussIllegalCustomerResult">
+        <include refid="selectBussIllegalCustomerVo"/>
+        where m.del_flag = '0'
+        <if test="licenceNo != null  and licenceNo != ''">and m.licence_no = #{licenceNo}</if>
+        <if test="customerName != null  and customerName != ''">and m.customer_name like concat('%', #{customerName},'%')
+        </if>
+        <if test="illegalType != null  and illegalType != ''">and m.illegal_type = #{illegalType}</if>
+        <if test="illegalTypes != null  and illegalTypes != ''">
+            and m.illegal_type in
+            <foreach collection="illegalTypes.split(',')" index="index" item="illegalType" open="(" separator="," close=")">
+                #{illegalType}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="selectBussIllegalCustomerById" parameterType="String" resultMap="BussIllegalCustomerResult">
+        <include refid="selectBussIllegalCustomerVo"/>
+        where m.id = #{id}
+    </select>
+
+    <insert id="insertBussIllegalCustomer" parameterType="BussIllegalCustomer">
+        insert into buss_illegal_customer
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="licenceNo != null">licence_no,</if>
+            <if test="customerName != null">customer_name,</if>
+            <if test="illegalType != null">illegal_type,</if>
+            <if test="longitude != null">longitude,</if>
+            <if test="latitude != null">latitude,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createBy != null">create_by,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="licenceNo != null">#{licenceNo},</if>
+            <if test="customerName != null">#{customerName},</if>
+            <if test="illegalType != null">#{illegalType},</if>
+            <if test="longitude != null">#{longitude},</if>
+            <if test="latitude != null">#{latitude},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createBy != null">#{createBy},</if>
+        </trim>
+    </insert>
+
+    <update id="updateBussIllegalCustomer" parameterType="BussIllegalCustomer">
+        update buss_illegal_customer
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="licenceNo != null">licence_no = #{licenceNo},</if>
+            <if test="customerName != null">customer_name = #{customerName},</if>
+            <if test="illegalType != null">illegal_type = #{illegalType},</if>
+            <if test="longitude != null">longitude = #{longitude},</if>
+            <if test="latitude != null">latitude = #{latitude},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBussIllegalCustomerById" parameterType="String">
+          update buss_illegal_customer set del_flag = '2'  where id = #{id}
+    </delete>
+
+    <delete id="deleteBussIllegalCustomerByIds" parameterType="String">
+        update buss_illegal_customer set del_flag = '2' where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+
+    <update id="cleanData" parameterType="map">
+        update buss_illegal_customer set del_flag = '2' where del_flag = '0'
+    </update>
+</mapper>

+ 6 - 15
xzl-system/src/main/resources/mapper/system/DOrderMapper.xml

@@ -14,16 +14,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="goodsQuantity"    column="goods_quantity"    />
         <result property="goodsAmount"    column="goods_amount"    />
         <result property="remark"    column="remark"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createdDate"    column="created_date"    />
-        <result property="lastModifiedBy"    column="last_modified_by"    />
-        <result property="lastModifiedDate"    column="last_modified_date"    />
+        <result property="createBy"      column="create_by"      />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"      column="update_by"      />
+        <result property="updateTime"    column="update_time"    />
         <result property="clientCode"    column="client_code"    />
         <result property="shortName"    column="short_name"    />
     </resultMap>
 
     <sql id="selectDOrderVo">
-        select id, o_id, sn_id, order_time, order_id, goods_name, goods_quantity, goods_amount, remark, create_by, created_date, last_modified_by, last_modified_date from d_order
+        select id, o_id, sn_id, order_time, order_id, goods_name, goods_quantity, goods_amount, remark, create_by, create_time, update_by, update_time from d_order
     </sql>
 
     <select id="selectDOrderList" parameterType="DOrder" resultMap="DOrderResult">
@@ -58,9 +58,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="goodsAmount != null">goods_amount,</if>
             <if test="remark != null">remark,</if>
             <if test="createBy != null">create_by,</if>
-            <if test="createdDate != null">created_date,</if>
-            <if test="lastModifiedBy != null">last_modified_by,</if>
-            <if test="lastModifiedDate != null">last_modified_date,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null and id != ''">#{id},</if>
@@ -73,9 +70,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="goodsAmount != null">#{goodsAmount},</if>
             <if test="remark != null">#{remark},</if>
             <if test="createBy != null">#{createBy},</if>
-            <if test="createdDate != null">#{createdDate},</if>
-            <if test="lastModifiedBy != null">#{lastModifiedBy},</if>
-            <if test="lastModifiedDate != null">#{lastModifiedDate},</if>
          </trim>
     </insert>
 
@@ -90,10 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="goodsQuantity != null">goods_quantity = #{goodsQuantity},</if>
             <if test="goodsAmount != null">goods_amount = #{goodsAmount},</if>
             <if test="remark != null">remark = #{remark},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createdDate != null">created_date = #{createdDate},</if>
-            <if test="lastModifiedBy != null">last_modified_by = #{lastModifiedBy},</if>
-            <if test="lastModifiedDate != null">last_modified_date = #{lastModifiedDate},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
         </trim>
         where id = #{id}
     </update>

BIN
xzl-ui/public/illegal_customer_template.xlsx


+ 259 - 0
xzl-ui/src/views/monitor/map/largeScreenShow.vue

@@ -0,0 +1,259 @@
+<template>
+  <div><!--
+    <div
+      style="position: absolute; height: 40px; width: 160px; opacity: 0.8; z-index: 9999; padding: 8px; top:6px; left: 6px; background: #fff; border-radius: 8px;">
+      <button @click="uploadFile" style="width: 98%; text-align: center">导入违规零售户</button>
+    </div> -->
+    <div id="container" v-bind:style="'width: 100%;border: 1px solid #cecece;height:'+pageHeight*0.9+'px;'">
+    </div>
+
+
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <a href="/illegal_customer_template.xlsx" style="padding-left:10px; color: coral">下载违规零售户模板</a>
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import request from '@/utils/request'
+  import {getToken} from "@/utils/auth";
+
+  export default {
+    data() {
+      return {
+        address: "",
+        queryParams: {
+          address: {},
+          distance: "50"
+        },
+        placeInfo: [
+          {value: "", label: ""}
+        ],
+        distanceOptions: [
+          {value: "50", label: "50米"},
+          {value: "100", label: "100米"},
+          {value: "200", label: "200米"}
+        ],
+        map: null,
+        pageHeight: document.documentElement.clientHeight,
+        // 用户导入参数
+        upload: {
+          // 是否显示弹出层(用户导入)
+          open: false,
+          // 弹出层标题(用户导入)
+          title: "",
+          // 是否禁用上传
+          isUploading: false,
+          // 是否更新已经存在的用户数据
+          updateSupport: 0,
+          // 设置上传的请求头部
+          headers: {Authorization: "Bearer " + getToken()},
+          // 上传的地址
+          url: process.env.VUE_APP_BASE_API + "/buss/illegal-customer/importData"
+        },
+        typeItems: {
+          '1': {color: 'red', 'typeName': '许可证异常信息'},
+          '2': {color: 'orange', 'typeName': '经营户违规信息'},
+          '3': {color: 'yellow', 'typeName': '真烟外流信息进行数据关链'},
+          '4': {color: 'blue', 'typeName': '产生许可证异常预警'},
+          '5': {color: 'green', 'typeName': '内管黑名单预警'},
+          '6': {color: 'gray', 'typeName': '内管灰名单预警'},
+        }
+      }
+    },
+    created() {
+      setTimeout(() => {
+        this.initMap()
+      }, 100)
+    },
+    methods: {
+      initMap() {
+        this.map = new BMap.Map("container", {enableMapClick: false});        // 创建Map实例 命名空间为BMAP
+        this.map.centerAndZoom(new BMap.Point(113.465771, 30.368834), 10);  // 初始化地图,设置中心点坐标和地图级别
+        this.map.setCurrentCity("仙桃");
+        this.map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
+        this.map.disableDoubleClickZoom();    //禁用双击放大
+        // this.init();
+        this.getList()
+      },
+      init() {
+        const t = this;
+        request({
+          url: '/monitorArea/infoList',
+          method: "get"
+        }).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) {
+              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});   //创建折线
+              t.map.addOverlay(polygon);
+              var x = 0,
+                y = 0;
+              var path = polygon.getPath();//返回多边型的点数组;ply是多边形覆盖物
+              for (var k = 0; k < path.length; k++) {
+                x = x + parseFloat(path[k].lng);
+                y = y + parseFloat(path[k].lat);
+              }
+              x = x / path.length;
+              y = y / path.length;
+              let points = [];
+              let pt = new BMap.Point(x, y);
+              points.push(pt);
+              let icon = new BMap.Icon(require("@/assets/images/area_icon16x16.png"), new BMap.Size(16, 16));
+              let options = {
+                icon: icon
+              }
+              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
+                });
+              });
+            }
+          });
+
+          let points = [];
+          noWarnClientInfo.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);
+          });
+          let options = {
+            size: BMAP_POINT_SIZE_NORMAL,
+            shape: BMAP_POINT_SHAPE_STAR,
+            color: '#848080'
+          }
+          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);
+
+
+        });
+      },
+      getList() {
+        const t = this;
+        request({
+          url: '/buss/illegal-customer/all?illegalTypes=1,2',
+          method: "get"
+        }).then(function (rs) {
+          // 描点
+          rs.forEach(o => {
+            let pt = new BMap.Point(o.longitude, o.latitude);
+            const ct = t.typeItems[o.illegalType];
+            let marker = new BMap.Marker(pt, {
+              // 指定Marker的icon属性为Symbol
+              icon: new BMap.Symbol(BMap_Symbol_SHAPE_POINT, {
+                scale: 1.5,//图标缩放大小
+                fillColor: ct.color,//填充颜色
+                fillOpacity: 0.8//填充透明度
+              })
+            });
+            t.map.addOverlay(marker);
+
+            marker.addEventListener('click', function (e) {
+              var content =
+                '<ul class="map-customer-info">'
+                + '<li ><span>零售户名称:</span>' + o.customerName + '</li>'
+                + '<li ><span>许可证号:</span>' + o.licenceNo + '</li>'
+                + '<li ><span>地址:</span>' + o.address + '</li>'
+                + '<li ><span>违规类型:</span>' + ct.typeName + '</li>'
+                + '</ul>';
+              t.$alert(content, '零售户违规信息', {
+                dangerouslyUseHTMLString: true
+              });
+            });
+          })
+        })
+      },
+      uploadFile() {
+        this.upload.title = "导入违规零售户";
+        this.upload.open = true;
+      }
+      ,
+      // 提交上传文件
+      submitFileForm() {
+        this.$refs.upload.submit();
+      }
+      ,
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+        this.upload.isUploading = true;
+      }
+      ,
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
+        this.upload.open = false;
+        this.upload.isUploading = false;
+        this.$refs.upload.clearFiles();
+        this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
+        this.initMap();
+      }
+      ,
+    }
+  }
+</script>
+
+<style rel="stylesheet/scss" lang="scss">
+  .BMap_cpyCtrl {
+    display: none;
+  }
+
+  .anchorBL {
+    display: none;
+  }
+</style>

+ 259 - 0
xzl-ui/src/views/monitor/map/warn1.vue

@@ -0,0 +1,259 @@
+<template>
+  <div>
+    <div
+      style="position: absolute; height: 40px; width: 160px; opacity: 0.8; z-index: 9999; padding: 8px; top:6px; left: 6px; background: #fff; border-radius: 8px;">
+      <button @click="uploadFile" style="width: 98%; text-align: center">导入违规零售户</button>
+    </div>
+    <div id="container" v-bind:style="'width: 100%;border: 1px solid #cecece;height:'+pageHeight*0.9+'px;'">
+    </div>
+
+
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <a href="/illegal_customer_template.xlsx" style="padding-left:10px; color: coral">下载违规零售户模板</a>
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import request from '@/utils/request'
+  import {getToken} from "@/utils/auth";
+
+  export default {
+    data() {
+      return {
+        address: "",
+        queryParams: {
+          address: {},
+          distance: "50"
+        },
+        placeInfo: [
+          {value: "", label: ""}
+        ],
+        distanceOptions: [
+          {value: "50", label: "50米"},
+          {value: "100", label: "100米"},
+          {value: "200", label: "200米"}
+        ],
+        map: null,
+        pageHeight: document.documentElement.clientHeight,
+        // 用户导入参数
+        upload: {
+          // 是否显示弹出层(用户导入)
+          open: false,
+          // 弹出层标题(用户导入)
+          title: "",
+          // 是否禁用上传
+          isUploading: false,
+          // 是否更新已经存在的用户数据
+          updateSupport: 0,
+          // 设置上传的请求头部
+          headers: {Authorization: "Bearer " + getToken()},
+          // 上传的地址
+          url: process.env.VUE_APP_BASE_API + "/buss/illegal-customer/importData"
+        },
+        typeItems: {
+          '1': {color: 'red', 'typeName': '许可证异常信息'},
+          '2': {color: 'orange', 'typeName': '经营户违规信息'},
+          '3': {color: 'yellow', 'typeName': '真烟外流信息进行数据关链'},
+          '4': {color: 'blue', 'typeName': '产生许可证异常预警'},
+          '5': {color: 'green', 'typeName': '内管黑名单预警'},
+          '6': {color: 'gray', 'typeName': '内管灰名单预警'},
+        }
+      }
+    },
+    created() {
+      setTimeout(() => {
+        this.initMap()
+      }, 100)
+    },
+    methods: {
+      initMap() {
+        this.map = new BMap.Map("container", {enableMapClick: false});        // 创建Map实例 命名空间为BMAP
+        this.map.centerAndZoom(new BMap.Point(113.465771, 30.368834), 10);  // 初始化地图,设置中心点坐标和地图级别
+        this.map.setCurrentCity("仙桃");
+        this.map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
+        this.map.disableDoubleClickZoom();    //禁用双击放大
+        // this.init();
+        this.getList()
+      },
+      init() {
+        const t = this;
+        request({
+          url: '/monitorArea/infoList',
+          method: "get"
+        }).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) {
+              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});   //创建折线
+              t.map.addOverlay(polygon);
+              var x = 0,
+                y = 0;
+              var path = polygon.getPath();//返回多边型的点数组;ply是多边形覆盖物
+              for (var k = 0; k < path.length; k++) {
+                x = x + parseFloat(path[k].lng);
+                y = y + parseFloat(path[k].lat);
+              }
+              x = x / path.length;
+              y = y / path.length;
+              let points = [];
+              let pt = new BMap.Point(x, y);
+              points.push(pt);
+              let icon = new BMap.Icon(require("@/assets/images/area_icon16x16.png"), new BMap.Size(16, 16));
+              let options = {
+                icon: icon
+              }
+              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
+                });
+              });
+            }
+          });
+
+          let points = [];
+          noWarnClientInfo.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);
+          });
+          let options = {
+            size: BMAP_POINT_SIZE_NORMAL,
+            shape: BMAP_POINT_SHAPE_STAR,
+            color: '#848080'
+          }
+          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);
+
+
+        });
+      },
+      getList() {
+        const t = this;
+        request({
+          url: '/buss/illegal-customer/all',
+          method: "get"
+        }).then(function (rs) {
+          // 描点
+          rs.forEach(o => {
+            let pt = new BMap.Point(o.longitude, o.latitude);
+            const ct = t.typeItems[o.illegalType];
+            let marker = new BMap.Marker(pt, {
+              // 指定Marker的icon属性为Symbol
+              icon: new BMap.Symbol(BMap_Symbol_SHAPE_POINT, {
+                scale: 1.5,//图标缩放大小
+                fillColor: ct.color,//填充颜色
+                fillOpacity: 0.8//填充透明度
+              })
+            });
+            t.map.addOverlay(marker);
+
+            marker.addEventListener('click', function (e) {
+              var content =
+                '<ul class="map-customer-info">'
+                + '<li ><span>零售户名称:</span>' + o.customerName + '</li>'
+                + '<li ><span>许可证号:</span>' + o.licenceNo + '</li>'
+                + '<li ><span>地址:</span>' + o.address + '</li>'
+                + '<li ><span>违规类型:</span>' + ct.typeName + '</li>'
+                + '</ul>';
+              t.$alert(content, '零售户违规信息', {
+                dangerouslyUseHTMLString: true
+              });
+            });
+          })
+        })
+      },
+      uploadFile() {
+        this.upload.title = "导入违规零售户";
+        this.upload.open = true;
+      }
+      ,
+      // 提交上传文件
+      submitFileForm() {
+        this.$refs.upload.submit();
+      }
+      ,
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+        this.upload.isUploading = true;
+      }
+      ,
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
+        this.upload.open = false;
+        this.upload.isUploading = false;
+        this.$refs.upload.clearFiles();
+        this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
+        this.initMap();
+      }
+      ,
+    }
+  }
+</script>
+
+<style rel="stylesheet/scss" lang="scss">
+  .BMap_cpyCtrl {
+    display: none;
+  }
+
+  .anchorBL {
+    display: none;
+  }
+</style>

+ 144 - 0
xzl-ui/src/views/monitor/map/warn2.vue

@@ -0,0 +1,144 @@
+<template>
+  <div>
+    <div id="container" v-bind:style="'width: 100%;border: 1px solid #cecece;height:'+pageHeight*0.9+'px;'">
+    </div>
+  </div>
+</template>
+<script>
+import request from '@/utils/request'
+
+export default {
+  data() {
+    return {
+      address: "",
+      queryParams: {
+        address: {},
+        distance: "50"
+      },
+      placeInfo: [
+        {value: "", label: ""}
+      ],
+      distanceOptions: [
+        {value: "50", label: "50米"},
+        {value: "100", label: "100米"},
+        {value: "200", label: "200米"}
+      ],
+      map: null,
+      pageHeight: document.documentElement.clientHeight
+    }
+  },
+  created() {
+    setTimeout(() => {
+      this.initMap()
+    }, 100)
+  },
+  methods: {
+    initMap() {
+      this.map = new BMap.Map("container", {enableMapClick: false});        // 创建Map实例 命名空间为BMAP
+      this.map.centerAndZoom(new BMap.Point(113.465771, 30.368834), 13);  // 初始化地图,设置中心点坐标和地图级别
+      this.map.setCurrentCity("仙桃");
+      this.map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
+      this.map.disableDoubleClickZoom();    //禁用双击放大
+      this.init();
+    },
+    init() {
+      const t = this;
+      request({
+        url: '/monitorArea/infoList',
+        method: "get"
+      }).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) {
+            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});   //创建折线
+            t.map.addOverlay(polygon);
+            var x = 0,
+              y = 0;
+            var path = polygon.getPath();//返回多边型的点数组;ply是多边形覆盖物
+            for (var k = 0; k < path.length; k++) {
+              x = x + parseFloat(path[k].lng);
+              y = y + parseFloat(path[k].lat);
+            }
+            x = x / path.length;
+            y = y / path.length;
+            let points = [];
+            let pt = new BMap.Point(x, y);
+            points.push(pt);
+            let icon = new BMap.Icon(require("@/assets/images/area_icon16x16.png"), new BMap.Size(16, 16));
+            let options = {
+              icon: icon
+            }
+            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
+              });
+            });
+          }
+        });
+
+        let points = [];
+        noWarnClientInfo.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);
+        });
+        let options = {
+          size: BMAP_POINT_SIZE_NORMAL,
+          shape: BMAP_POINT_SHAPE_STAR,
+          color: '#848080'
+        }
+        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);
+
+
+      });
+    }
+  }
+}
+</script>
+
+<style rel="stylesheet/scss" lang="scss">
+.BMap_cpyCtrl {
+  display: none;
+}
+
+.anchorBL {
+  display: none;
+}
+</style>