Browse Source

qxm-增加导出已认证经销商功能

qxm 4 years ago
parent
commit
213e3e50df

+ 17 - 0
suishenbang-order/src/main/java/com/dgtly/order/controller/OrderCustomersController.java

@@ -6,8 +6,12 @@ package com.dgtly.order.controller;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.dgtly.common.core.domain.AjaxResult;
 import com.dgtly.common.core.page.TableDataInfo;
 import com.dgtly.common.utils.MapDataUtil;
+import com.dgtly.common.utils.poi.ExcelUtil;
+import com.dgtly.order.domain.BpmWxNoticeOrg;
+import com.dgtly.order.domain.CustomerAuthModel;
 import com.dgtly.order.domain.OrderCustomers;
 import com.dgtly.order.service.ICustomersStartService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -144,4 +148,17 @@ public class OrderCustomersController extends BaseController
         return getDataTable(usercustomersList);
     }
 
+    /**
+     * 导出企微人员发送列表
+     */
+    @RequiresPermissions("order:customers:export")
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export()
+    {
+        List<CustomerAuthModel> list = customersStartService.selectCustomerAuthList();
+        ExcelUtil<CustomerAuthModel> util = new ExcelUtil<CustomerAuthModel>(CustomerAuthModel.class);
+        return util.exportExcel(list, "已认证经销商列表");
+    }
+
 }

+ 165 - 0
suishenbang-order/src/main/java/com/dgtly/order/domain/CustomerAuthModel.java

@@ -0,0 +1,165 @@
+package com.dgtly.order.domain;
+
+import com.dgtly.common.annotation.Excel;
+import com.dgtly.common.core.domain.BaseEntity;
+
+import java.util.Date;
+
+/**
+ * @description:经销商认证实体
+ * @author:qxm
+ * @date:2021/9/27 16:55
+ */
+public class CustomerAuthModel  extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 公司名称 */
+    @Excel(name = "公司")
+    private String companyName;
+
+    /** 公司代码 */
+//    @Excel(name = "公司代码")
+    private String companyCode;
+
+    /** 销售大区 */
+    @Excel(name = "销售大区")
+    private String saleName;
+
+    /** 销售大区代码 */
+//    @Excel(name = "销售大区代码")
+    private String saleCode;
+
+    /** 销售部 */
+    @Excel(name = "销售部", width = 30)
+    private String officeName;
+
+    /** 销售部代码 */
+//    @Excel(name = "销售部代码")
+    private String officeCode;
+
+    /** 销售分部 */
+    @Excel(name = "销售分部", width = 30)
+    private String subOfficeName;
+
+    /** 销售分部代码 */
+//    @Excel(name = "销售分部代码")
+    private String subOfficeCode;
+
+    /** 经销商 */
+    @Excel(name = "经销商", width = 30)
+    private String customerName;
+
+    /** 经销商代码 */
+    @Excel(name = "经销商代码")
+    private String customerCode;
+
+    /** 认证时间 */
+    @Excel(name = "认证时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
+    private Date authTime;
+
+    public String getCompanyName() {
+        return companyName;
+    }
+
+    public void setCompanyName(String companyName) {
+        this.companyName = companyName;
+    }
+
+    public String getCompanyCode() {
+        return companyCode;
+    }
+
+    public void setCompanyCode(String companyCode) {
+        this.companyCode = companyCode;
+    }
+
+    public String getSaleName() {
+        return saleName;
+    }
+
+    public void setSaleName(String saleName) {
+        this.saleName = saleName;
+    }
+
+    public String getSaleCode() {
+        return saleCode;
+    }
+
+    public void setSaleCode(String saleCode) {
+        this.saleCode = saleCode;
+    }
+
+    public String getOfficeName() {
+        return officeName;
+    }
+
+    public void setOfficeName(String officeName) {
+        this.officeName = officeName;
+    }
+
+    public String getOfficeCode() {
+        return officeCode;
+    }
+
+    public void setOfficeCode(String officeCode) {
+        this.officeCode = officeCode;
+    }
+
+    public String getSubOfficeName() {
+        return subOfficeName;
+    }
+
+    public void setSubOfficeName(String subOfficeName) {
+        this.subOfficeName = subOfficeName;
+    }
+
+    public String getSubOfficeCode() {
+        return subOfficeCode;
+    }
+
+    public void setSubOfficeCode(String subOfficeCode) {
+        this.subOfficeCode = subOfficeCode;
+    }
+
+    public String getCustomerName() {
+        return customerName;
+    }
+
+    public void setCustomerName(String customerName) {
+        this.customerName = customerName;
+    }
+
+    public String getCustomerCode() {
+        return customerCode;
+    }
+
+    public void setCustomerCode(String customerCode) {
+        this.customerCode = customerCode;
+    }
+
+    public Date getAuthTime() {
+        return authTime;
+    }
+
+    public void setAuthTime(Date authTime) {
+        this.authTime = authTime;
+    }
+
+    @Override
+    public String toString() {
+        return "CustomerAuthModel{" +
+                "companyName='" + companyName + '\'' +
+                ", companyCode='" + companyCode + '\'' +
+                ", saleName='" + saleName + '\'' +
+                ", saleCode='" + saleCode + '\'' +
+                ", officeName='" + officeName + '\'' +
+                ", officeCode='" + officeCode + '\'' +
+                ", subOfficeName='" + subOfficeName + '\'' +
+                ", subOfficeCode='" + subOfficeCode + '\'' +
+                ", customerName='" + customerName + '\'' +
+                ", customerCode='" + customerCode + '\'' +
+                ", authTime=" + authTime +
+                '}';
+    }
+}

+ 3 - 0
suishenbang-order/src/main/java/com/dgtly/order/mapper/CustomersStartMapper.java

@@ -1,5 +1,6 @@
 package com.dgtly.order.mapper;
 
+import com.dgtly.order.domain.CustomerAuthModel;
 import com.dgtly.order.domain.CustomersStart;
 import com.dgtly.order.domain.OrderCustomers;
 
@@ -69,4 +70,6 @@ public interface CustomersStartMapper
     List<OrderCustomers> selectcustomersList(OrderCustomers customers);
 
     OrderCustomers selectCustomersById(Long id);
+
+    List<CustomerAuthModel> selectCustomerAuthList();
 }

+ 3 - 0
suishenbang-order/src/main/java/com/dgtly/order/service/ICustomersStartService.java

@@ -1,5 +1,6 @@
 package com.dgtly.order.service;
 
+import com.dgtly.order.domain.CustomerAuthModel;
 import com.dgtly.order.domain.CustomersStart;
 import com.dgtly.order.domain.OrderCustomers;
 
@@ -74,4 +75,6 @@ public interface ICustomersStartService
      * @return
      */
     int addCustomersStart(String ids);
+
+    List<CustomerAuthModel> selectCustomerAuthList();
 }

+ 6 - 0
suishenbang-order/src/main/java/com/dgtly/order/service/impl/CustomersStartServiceImpl.java

@@ -4,6 +4,7 @@ import java.util.Date;
 import java.util.List;
 
 import com.dgtly.common.utils.StringUtils;
+import com.dgtly.order.domain.CustomerAuthModel;
 import com.dgtly.order.domain.OrderCustomers;
 import org.springframework.stereotype.Service;
 import com.dgtly.order.mapper.CustomersStartMapper;
@@ -141,4 +142,9 @@ public class CustomersStartServiceImpl implements ICustomersStartService
         }
         return state;
     }
+
+    @Override
+    public List<CustomerAuthModel> selectCustomerAuthList() {
+        return customersStartMapper.selectCustomerAuthList();
+    }
 }

+ 24 - 0
suishenbang-order/src/main/resources/mapper/order/CustomersStartMapper.xml

@@ -50,6 +50,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          and id = #{id}
     </select>
 
+    <select id="selectCustomerAuthList" resultType="com.dgtly.order.domain.CustomerAuthModel">
+        SELECT
+            mds.Org3code companyCode,
+            mds.Org3name companyName,
+            mds.Org4code saleCode,
+            mds.Org4name saleName,
+            mds.Org5code officeCode,
+            mds.Org5name officeName,
+            osc.suboffice_code subOfficeCode,
+            osc.suboffice_name subOfficeName,
+            osc.customer_id customerCode,
+            osc.customer_name customerName,
+            ce.org_attestation_time authTime
+        FROM
+            customers_ext ce
+        LEFT JOIN order_sales_customer osc ON ce.chains_code = osc.customer_id
+        LEFT JOIN meta_diy_salesorgtree mds ON osc.suboffice_code = mds.Org6code
+        WHERE
+            ce.org_attestation_time IS NOT NULL
+        GROUP BY
+            osc.customer_id
+        ORDER BY mds.Org3name DESC
+    </select>
+
     <insert id="insertCustomersStart" parameterType="com.dgtly.order.domain.CustomersStart">
         insert into customers_start
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 5 - 4
suishenbang-order/src/main/resources/templates/order/customers/customers.html

@@ -56,9 +56,9 @@
                 <!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:customers:remove">-->
                     <!--<i class="fa fa-remove"></i> 删除-->
                 <!--</a>-->
-                <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:customers:export">-->
-                    <!--<i class="fa fa-download"></i> 导出-->
-                 <!--</a>-->
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="order:customers:export">
+                    <i class="fa fa-download"></i> 导出已认证经销商
+                 </a>
             </div>
             <div class="col-sm-12 select-table table-striped">
                 <table id="bootstrap-table"></table>
@@ -74,7 +74,8 @@
             var options = {
                 url: prefix + "/list",
                 updateUrl: prefix + "/edit/{id}",
-                modalName: "经销商",
+                exportUrl: prefix + "/export",
+                modalName: "认证经销商",
                 columns: [{
                     checkbox: true
                 },