Browse Source

nsy update 销售组织架构启用管理

ningsy 3 years ago
parent
commit
3e328edab2

+ 156 - 0
suishenbang-order/src/main/java/com/dgtly/order/controller/DiysalesorgStartController.java

@@ -0,0 +1,156 @@
+package com.dgtly.order.controller;
+
+import java.util.List;
+
+import com.dgtly.order.domain.DiySalesorgtree;
+import com.dgtly.order.domain.OrderCustomers;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import com.dgtly.common.annotation.Log;
+import com.dgtly.common.enums.BusinessType;
+import com.dgtly.order.domain.DiysalesorgStart;
+import com.dgtly.order.service.IDiysalesorgStartService;
+import com.dgtly.common.core.controller.BaseController;
+import com.dgtly.common.core.domain.AjaxResult;
+import com.dgtly.common.utils.poi.ExcelUtil;
+import com.dgtly.common.core.page.TableDataInfo;
+
+/**
+ * 销售组织架构启用管理Controller
+ * 
+ * @author nsy
+ * @date 2021-01-19
+ */
+@Controller
+@RequestMapping("/order/salesorgStart")
+public class DiysalesorgStartController extends BaseController
+{
+    private String prefix = "order/salesorgStart";
+
+    @Autowired
+    private IDiysalesorgStartService diysalesorgStartService;
+
+    @RequiresPermissions("order:salesorgStart:view")
+    @GetMapping()
+    public String salesorgStart()
+    {
+        return prefix + "/salesorgStart";
+    }
+
+    /**
+     * 查询销售组织架构启用管理列表
+     */
+    @RequiresPermissions("order:salesorgStart:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(DiysalesorgStart diysalesorgStart)
+    {
+        startPage();
+        List<DiysalesorgStart> list = diysalesorgStartService.selectDiysalesorgStartList(diysalesorgStart);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出销售组织架构启用管理列表
+     */
+    @RequiresPermissions("order:salesorgStart:export")
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(DiysalesorgStart diysalesorgStart)
+    {
+        List<DiysalesorgStart> list = diysalesorgStartService.selectDiysalesorgStartList(diysalesorgStart);
+        ExcelUtil<DiysalesorgStart> util = new ExcelUtil<DiysalesorgStart>(DiysalesorgStart.class);
+        return util.exportExcel(list, "salesorgStart");
+    }
+
+    /**
+     * 新增销售组织架构启用管理
+     */
+    @GetMapping("/add")
+    public String add()
+    {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存销售组织架构启用管理
+     */
+    @RequiresPermissions("order:salesorgStart:add")
+    @Log(title = "销售组织架构启用管理", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(DiysalesorgStart diysalesorgStart)
+    {
+        return toAjax(diysalesorgStartService.insertDiysalesorgStart(diysalesorgStart));
+    }
+
+    /**
+     * 修改销售组织架构启用管理
+     */
+    @GetMapping("/edit/{salesorgCode}")
+    public String edit(@PathVariable("salesorgCode") String salesorgCode, ModelMap mmap)
+    {
+        DiysalesorgStart diysalesorgStart = diysalesorgStartService.selectDiysalesorgStartById(salesorgCode);
+        mmap.put("diysalesorgStart", diysalesorgStart);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存销售组织架构启用管理
+     */
+    @RequiresPermissions("order:salesorgStart:edit")
+    @Log(title = "销售组织架构启用管理", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(DiysalesorgStart diysalesorgStart)
+    {
+        return toAjax(diysalesorgStartService.updateDiysalesorgStart(diysalesorgStart));
+    }
+
+    /**
+     * 删除销售组织架构启用管理
+     */
+    @RequiresPermissions("order:salesorgStart:remove")
+    @Log(title = "销售组织架构启用管理", businessType = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        return toAjax(diysalesorgStartService.deleteDiysalesorgStartByIds(ids));
+    }
+
+    /**
+     * 返回销售组织架构列表
+     * @param salesorgtree
+     * @return
+     */
+    @PostMapping("/salesOrgList")
+    @ResponseBody
+    public TableDataInfo salesOrgList(DiySalesorgtree salesorgtree)
+    {
+        startPage();
+        List<DiySalesorgtree> usercustomersList = diysalesorgStartService.findSalesOrgList(salesorgtree);
+        return getDataTable(usercustomersList);
+    }
+
+
+    /**
+     * 新增保存销售组织架构启用
+     */
+    @RequiresPermissions("order:salesorgStart:add")
+    @PostMapping("/addSalesorgStart")
+    @ResponseBody
+    public AjaxResult addSalesorgStart(String org6names,String org6codes) {
+        if (org6codes == null || org6names == null) {
+            return AjaxResult.error("参数缺失,不支持操作");
+        }
+        return toAjax(diysalesorgStartService.saveSalesorgStart(org6codes, org6names));
+    }
+}

+ 126 - 0
suishenbang-order/src/main/java/com/dgtly/order/domain/DiySalesorgtree.java

@@ -0,0 +1,126 @@
+package com.dgtly.order.domain;
+
+/**
+ * 销售组织架构实体类
+ */
+public class DiySalesorgtree{
+    private String org1code;
+
+    private String org1name;
+
+    private String org2code;
+
+    private String org2name;
+
+    private String org3code;
+
+    private String org3name;
+
+    private String org4code;
+
+    private String org4name;
+
+    private String org5code;
+
+    private String org5name;
+
+    private String org6code;
+
+    private String org6name;
+
+    public String getOrg1code() {
+        return org1code;
+    }
+
+    public void setOrg1code(String org1code) {
+        this.org1code = org1code;
+    }
+
+    public String getOrg1name() {
+        return org1name;
+    }
+
+    public void setOrg1name(String org1name) {
+        this.org1name = org1name;
+    }
+
+    public String getOrg2code() {
+        return org2code;
+    }
+
+    public void setOrg2code(String org2code) {
+        this.org2code = org2code;
+    }
+
+    public String getOrg2name() {
+        return org2name;
+    }
+
+    public void setOrg2name(String org2name) {
+        this.org2name = org2name;
+    }
+
+    public String getOrg3code() {
+        return org3code;
+    }
+
+    public void setOrg3code(String org3code) {
+        this.org3code = org3code;
+    }
+
+    public String getOrg3name() {
+        return org3name;
+    }
+
+    public void setOrg3name(String org3name) {
+        this.org3name = org3name;
+    }
+
+    public String getOrg4code() {
+        return org4code;
+    }
+
+    public void setOrg4code(String org4code) {
+        this.org4code = org4code;
+    }
+
+    public String getOrg4name() {
+        return org4name;
+    }
+
+    public void setOrg4name(String org4name) {
+        this.org4name = org4name;
+    }
+
+    public String getOrg5code() {
+        return org5code;
+    }
+
+    public void setOrg5code(String org5code) {
+        this.org5code = org5code;
+    }
+
+    public String getOrg5name() {
+        return org5name;
+    }
+
+    public void setOrg5name(String org5name) {
+        this.org5name = org5name;
+    }
+
+    public String getOrg6code() {
+        return org6code;
+    }
+
+    public void setOrg6code(String org6code) {
+        this.org6code = org6code;
+    }
+
+    public String getOrg6name() {
+        return org6name;
+    }
+
+    public void setOrg6name(String org6name) {
+        this.org6name = org6name;
+    }
+}

+ 52 - 0
suishenbang-order/src/main/java/com/dgtly/order/domain/DiysalesorgStart.java

@@ -0,0 +1,52 @@
+package com.dgtly.order.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.dgtly.common.annotation.Excel;
+import com.dgtly.common.core.domain.BaseEntity;
+
+/**
+ * 销售组织架构启用管理对象 diysalesorg_start
+ * 
+ * @author nsy
+ * @date 2021-01-19
+ */
+public class DiysalesorgStart extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 销售分部代码 */
+    @Excel(name = "销售分部代码")
+    private String salesorgCode;
+
+    /** 销售分部名称 */
+    @Excel(name = "销售分部名称")
+    private String salseorgName;
+
+    public void setSalesorgCode(String salesorgCode) 
+    {
+        this.salesorgCode = salesorgCode;
+    }
+
+    public String getSalesorgCode() 
+    {
+        return salesorgCode;
+    }
+    public void setSalseorgName(String salseorgName) 
+    {
+        this.salseorgName = salseorgName;
+    }
+
+    public String getSalseorgName() 
+    {
+        return salseorgName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("salesorgCode", getSalesorgCode())
+            .append("salseorgName", getSalseorgName())
+            .toString();
+    }
+}

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

@@ -19,7 +19,7 @@ public interface CustomersStartMapper
      * @param customersCode 经销商启用ID
      * @return 经销商启用
      */
-    public CustomersStart selectCustomersStartById(String customersCode);
+    public CustomersStart selectCustomersStartByCustomersCode(String customersCode);
 
     /**
      * 查询经销商启用列表

+ 72 - 0
suishenbang-order/src/main/java/com/dgtly/order/mapper/DiysalesorgStartMapper.java

@@ -0,0 +1,72 @@
+package com.dgtly.order.mapper;
+
+import com.dgtly.order.domain.DiySalesorgtree;
+import com.dgtly.order.domain.DiysalesorgStart;
+import com.dgtly.order.domain.OrderCustomers;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 销售组织架构启用管理Mapper接口
+ * 
+ * @author nsy
+ * @date 2021-01-19
+ */
+public interface DiysalesorgStartMapper 
+{
+    /**
+     * 查询销售组织架构启用管理
+     * 
+     * @param salesorgCode 销售组织架构启用管理ID
+     * @return 销售组织架构启用管理
+     */
+    public DiysalesorgStart selectDiysalesorgStartById(String salesorgCode);
+
+    /**
+     * 查询销售组织架构启用管理列表
+     * 
+     * @param diysalesorgStart 销售组织架构启用管理
+     * @return 销售组织架构启用管理集合
+     */
+    public List<DiysalesorgStart> selectDiysalesorgStartList(DiysalesorgStart diysalesorgStart);
+
+    /**
+     * 新增销售组织架构启用管理
+     * 
+     * @param diysalesorgStart 销售组织架构启用管理
+     * @return 结果
+     */
+    public int insertDiysalesorgStart(DiysalesorgStart diysalesorgStart);
+
+    /**
+     * 修改销售组织架构启用管理
+     * 
+     * @param diysalesorgStart 销售组织架构启用管理
+     * @return 结果
+     */
+    public int updateDiysalesorgStart(DiysalesorgStart diysalesorgStart);
+
+    /**
+     * 删除销售组织架构启用管理
+     * 
+     * @param salesorgCode 销售组织架构启用管理ID
+     * @return 结果
+     */
+    public int deleteDiysalesorgStartById(String salesorgCode);
+
+    /**
+     * 批量删除销售组织架构启用管理
+     * 
+     * @param salesorgCodes 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteDiysalesorgStartByIds(String[] salesorgCodes);
+
+    /**
+     * 返回销售组织架构列表
+     * @param salesorgtree
+     * @return
+     */
+    List<DiySalesorgtree> selectSalesOrgList(DiySalesorgtree salesorgtree);
+}

+ 79 - 0
suishenbang-order/src/main/java/com/dgtly/order/service/IDiysalesorgStartService.java

@@ -0,0 +1,79 @@
+package com.dgtly.order.service;
+
+import com.dgtly.order.domain.DiySalesorgtree;
+import com.dgtly.order.domain.DiysalesorgStart;
+import com.dgtly.order.domain.OrderCustomers;
+
+import java.util.List;
+
+/**
+ * 销售组织架构启用管理Service接口
+ * 
+ * @author nsy
+ * @date 2021-01-19
+ */
+public interface IDiysalesorgStartService 
+{
+    /**
+     * 查询销售组织架构启用管理
+     * 
+     * @param salesorgCode 销售组织架构启用管理ID
+     * @return 销售组织架构启用管理
+     */
+    public DiysalesorgStart selectDiysalesorgStartById(String salesorgCode);
+
+    /**
+     * 查询销售组织架构启用管理列表
+     * 
+     * @param diysalesorgStart 销售组织架构启用管理
+     * @return 销售组织架构启用管理集合
+     */
+    public List<DiysalesorgStart> selectDiysalesorgStartList(DiysalesorgStart diysalesorgStart);
+
+    /**
+     * 新增销售组织架构启用管理
+     * 
+     * @param diysalesorgStart 销售组织架构启用管理
+     * @return 结果
+     */
+    public int insertDiysalesorgStart(DiysalesorgStart diysalesorgStart);
+
+    /**
+     * 修改销售组织架构启用管理
+     * 
+     * @param diysalesorgStart 销售组织架构启用管理
+     * @return 结果
+     */
+    public int updateDiysalesorgStart(DiysalesorgStart diysalesorgStart);
+
+    /**
+     * 批量删除销售组织架构启用管理
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteDiysalesorgStartByIds(String ids);
+
+    /**
+     * 删除销售组织架构启用管理信息
+     * 
+     * @param salesorgCode 销售组织架构启用管理ID
+     * @return 结果
+     */
+    public int deleteDiysalesorgStartById(String salesorgCode);
+
+    /**
+     * 返回销售组织架构列表
+     * @param salesorgtree
+     * @return
+     */
+    List<DiySalesorgtree> findSalesOrgList(DiySalesorgtree salesorgtree);
+
+    /**
+     * 新增保存销售组织架构启用
+     * @param org6codes
+     * @param org6names
+     * @return
+     */
+    int saveSalesorgStart(String org6codes,String org6names);
+}

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

@@ -33,7 +33,7 @@ public class CustomersStartServiceImpl implements ICustomersStartService
     @Override
     public CustomersStart selectCustomersStartById(String customersCode)
     {
-        return customersStartMapper.selectCustomersStartById(customersCode);
+        return customersStartMapper.selectCustomersStartByCustomersCode(customersCode);
     }
 
     /**
@@ -57,7 +57,7 @@ public class CustomersStartServiceImpl implements ICustomersStartService
     @Override
     public int insertCustomersStart(CustomersStart customersStart)
     {
-        CustomersStart customersS = customersStartMapper.selectCustomersStartById(customersStart.getCustomersCode());
+        CustomersStart customersS = customersStartMapper.selectCustomersStartByCustomersCode(customersStart.getCustomersCode());
         if(customersS != null) return 1;
         return customersStartMapper.insertCustomersStart(customersStart);
     }
@@ -122,7 +122,7 @@ public class CustomersStartServiceImpl implements ICustomersStartService
             if(customers != null){
                 String chainsCode = customers.getChainsCode();
                 String chainsName = customers.getChainsName();
-                CustomersStart customersStart = customersStartMapper.selectCustomersStartById(chainsCode);
+                CustomersStart customersStart = customersStartMapper.selectCustomersStartByCustomersCode(chainsCode);
                 if(customersStart == null){
                     customersStart = new CustomersStart();
                     customersStart.setCustomersCode(chainsCode);

+ 136 - 0
suishenbang-order/src/main/java/com/dgtly/order/service/impl/DiysalesorgStartServiceImpl.java

@@ -0,0 +1,136 @@
+package com.dgtly.order.service.impl;
+
+import java.util.List;
+
+import com.dgtly.order.domain.CustomersStart;
+import com.dgtly.order.domain.DiySalesorgtree;
+import com.dgtly.order.domain.OrderCustomers;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.dgtly.order.mapper.DiysalesorgStartMapper;
+import com.dgtly.order.domain.DiysalesorgStart;
+import com.dgtly.order.service.IDiysalesorgStartService;
+import com.dgtly.common.core.text.Convert;
+
+import javax.annotation.Resource;
+
+/**
+ * 销售组织架构启用管理Service业务层处理
+ * 
+ * @author nsy
+ * @date 2021-01-19
+ */
+@Service
+public class DiysalesorgStartServiceImpl implements IDiysalesorgStartService 
+{
+    @Resource
+    private DiysalesorgStartMapper diysalesorgStartMapper;
+
+    /**
+     * 查询销售组织架构启用管理
+     * 
+     * @param salesorgCode 销售组织架构启用管理ID
+     * @return 销售组织架构启用管理
+     */
+    @Override
+    public DiysalesorgStart selectDiysalesorgStartById(String salesorgCode)
+    {
+        return diysalesorgStartMapper.selectDiysalesorgStartById(salesorgCode);
+    }
+
+    /**
+     * 查询销售组织架构启用管理列表
+     * 
+     * @param diysalesorgStart 销售组织架构启用管理
+     * @return 销售组织架构启用管理
+     */
+    @Override
+    public List<DiysalesorgStart> selectDiysalesorgStartList(DiysalesorgStart diysalesorgStart)
+    {
+        return diysalesorgStartMapper.selectDiysalesorgStartList(diysalesorgStart);
+    }
+
+    /**
+     * 新增销售组织架构启用管理
+     * 
+     * @param diysalesorgStart 销售组织架构启用管理
+     * @return 结果
+     */
+    @Override
+    public int insertDiysalesorgStart(DiysalesorgStart diysalesorgStart)
+    {
+        return diysalesorgStartMapper.insertDiysalesorgStart(diysalesorgStart);
+    }
+
+    /**
+     * 修改销售组织架构启用管理
+     * 
+     * @param diysalesorgStart 销售组织架构启用管理
+     * @return 结果
+     */
+    @Override
+    public int updateDiysalesorgStart(DiysalesorgStart diysalesorgStart)
+    {
+        return diysalesorgStartMapper.updateDiysalesorgStart(diysalesorgStart);
+    }
+
+    /**
+     * 删除销售组织架构启用管理对象
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteDiysalesorgStartByIds(String ids)
+    {
+        return diysalesorgStartMapper.deleteDiysalesorgStartByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除销售组织架构启用管理信息
+     * 
+     * @param salesorgCode 销售组织架构启用管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteDiysalesorgStartById(String salesorgCode)
+    {
+        return diysalesorgStartMapper.deleteDiysalesorgStartById(salesorgCode);
+    }
+
+    /**
+     * 返回销售组织架构列表
+     * @param salesorgtree
+     * @return
+     */
+    @Override
+    public List<DiySalesorgtree> findSalesOrgList(DiySalesorgtree salesorgtree) {
+        return diysalesorgStartMapper.selectSalesOrgList(salesorgtree);
+    }
+
+    /**
+     * 新增保存销售组织架构启用
+     * @param org6codes
+     * @param org6names
+     * @return
+     */
+    @Override
+    public int saveSalesorgStart(String org6codes,String org6names) {
+        int state = 0;
+        String[] indexorg6codes = Convert.toStrArray(org6codes);
+        String[] indexorg6names = Convert.toStrArray(org6names);
+        for (int i = 0; i < indexorg6codes.length; i++){
+            String code = indexorg6codes[i];
+            String name = indexorg6names[i];
+            DiysalesorgStart diysalesorgStart = diysalesorgStartMapper.selectDiysalesorgStartById(code);
+            if(diysalesorgStart == null){
+                diysalesorgStart = new DiysalesorgStart();
+                diysalesorgStart.setSalesorgCode(code);
+                diysalesorgStart.setSalseorgName(name);
+                state = diysalesorgStartMapper.insertDiysalesorgStart(diysalesorgStart);
+            }
+            continue;
+        }
+        return state;
+    }
+}

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

@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
     
-    <select id="selectCustomersStartById" parameterType="String" resultMap="CustomersStartResult">
+    <select id="selectCustomersStartByCustomersCode" parameterType="String" resultMap="CustomersStartResult">
         <include refid="selectCustomersStartVo"/>
         where customers_code = #{customersCode}
     </select>

+ 98 - 0
suishenbang-order/src/main/resources/mapper/order/DiysalesorgStartMapper.xml

@@ -0,0 +1,98 @@
+<?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.dgtly.order.mapper.DiysalesorgStartMapper">
+
+    <resultMap type="com.dgtly.order.domain.DiySalesorgtree" id="MetaDiySalesorgtreeResult">
+        <result property="org1code"    column="Org1code"    />
+        <result property="org1name"    column="Org1name"    />
+        <result property="org2code"    column="Org2code"    />
+        <result property="org2name"    column="Org2name"    />
+        <result property="org3code"    column="Org3code"    />
+        <result property="org3name"    column="Org3name"    />
+        <result property="org4code"    column="Org4code"    />
+        <result property="org4name"    column="Org4name"    />
+        <result property="org5code"    column="Org5code"    />
+        <result property="org5name"    column="Org5name"    />
+        <result property="org6code"    column="Org6code"    />
+        <result property="org6name"    column="Org6name"    />
+    </resultMap>
+
+    <resultMap type="com.dgtly.order.domain.DiysalesorgStart" id="DiysalesorgStartResult">
+        <result property="salesorgCode"    column="salesorg_code"    />
+        <result property="salseorgName"    column="salseorg_name"    />
+    </resultMap>
+
+    <sql id="selectDiysalesorgStartVo">
+        select salesorg_code, salseorg_name from diysalesorg_start
+    </sql>
+
+    <select id="selectDiysalesorgStartList" parameterType="com.dgtly.order.domain.DiysalesorgStart" resultMap="DiysalesorgStartResult">
+        <include refid="selectDiysalesorgStartVo"/>
+        <where>  
+            <if test="salesorgCode != null  and salesorgCode != ''"> and salesorg_code like concat('%', #{salesorgCode}, '%')</if>
+            <if test="salseorgName != null  and salseorgName != ''"> and salseorg_name like concat('%', #{salseorgName}, '%')</if>
+        </where>
+    </select>
+    
+    <select id="selectDiysalesorgStartById" parameterType="String" resultMap="DiysalesorgStartResult">
+        <include refid="selectDiysalesorgStartVo"/>
+        where salesorg_code = #{salesorgCode}
+    </select>
+
+    <select id="selectSalesOrgList" parameterType="com.dgtly.order.domain.DiySalesorgtree" resultMap="MetaDiySalesorgtreeResult">
+        SELECT
+        Org1code, Org1name, Org2code, Org2name, Org3code, Org3name, Org4code, Org4name, Org5code, Org5name, Org6code, Org6name
+        from meta_diy_salesorgtree
+        where Org6code IS NOT NULL
+        and Org6code != ''
+        and Org6name IS NOT NULL
+        and Org6name != ''
+        <if test="org1code != null  and org1code != ''"> and Org1code like concat('%', #{org1code}, '%')</if>
+        <if test="org1name != null  and org1name != ''"> and Org1name like concat('%', #{org1name}, '%')</if>
+        <if test="org2code != null  and org2code != ''"> and Org2code like concat('%', #{org2code}, '%')</if>
+        <if test="org2name != null  and org2name != ''"> and Org2name like concat('%', #{org2name}, '%')</if>
+        <if test="org3code != null  and org3code != ''"> and Org3code like concat('%', #{org3code}, '%')</if>
+        <if test="org3name != null  and org3name != ''"> and Org3name like concat('%', #{org3name}, '%')</if>
+        <if test="org4code != null  and org4code != ''"> and Org4code like concat('%', #{org4code}, '%')</if>
+        <if test="org4name != null  and org4name != ''"> and Org4name like concat('%', #{org4name}, '%')</if>
+        <if test="org5code != null  and org5code != ''"> and Org5code like concat('%', #{org5code}, '%')</if>
+        <if test="org5name != null  and org5name != ''"> and Org5name like concat('%', #{org5name}, '%')</if>
+        <if test="org6code != null  and org6code != ''"> and Org6code like concat('%', #{org6code}, '%')</if>
+        <if test="org6name != null  and org6name != ''"> and Org6name like concat('%', #{org6name}, '%')</if>
+
+    </select>
+
+    <insert id="insertDiysalesorgStart" parameterType="com.dgtly.order.domain.DiysalesorgStart">
+        insert into diysalesorg_start
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="salesorgCode != null  and salesorgCode != ''">salesorg_code,</if>
+            <if test="salseorgName != null  and salseorgName != ''">salseorg_name,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="salesorgCode != null  and salesorgCode != ''">#{salesorgCode},</if>
+            <if test="salseorgName != null  and salseorgName != ''">#{salseorgName},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDiysalesorgStart" parameterType="com.dgtly.order.domain.DiysalesorgStart">
+        update diysalesorg_start
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="salseorgName != null  and salseorgName != ''">salseorg_name = #{salseorgName},</if>
+        </trim>
+        where salesorg_code = #{salesorgCode}
+    </update>
+
+    <delete id="deleteDiysalesorgStartById" parameterType="String">
+        delete from diysalesorg_start where salesorg_code = #{salesorgCode}
+    </delete>
+
+    <delete id="deleteDiysalesorgStartByIds" parameterType="String">
+        delete from diysalesorg_start where salesorg_code in 
+        <foreach item="salesorgCode" collection="array" open="(" separator="," close=")">
+            #{salesorgCode}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 1 - 3
suishenbang-order/src/main/resources/templates/order/customersStart/add.html

@@ -39,9 +39,7 @@
     $(function() {
         var options = {
             url: prefix,
-            sortName: "createTime",
-            sortOrder: "desc",
-            modalName: "用户",
+            modalName: "经销商启用",
             showSearch: false,
             showRefresh: false,
             showToggle: false,

+ 104 - 0
suishenbang-order/src/main/resources/templates/order/salesorgStart/add.html

@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('分配选择销售')" />
+</head>
+
+<body class="gray-bg">
+<div class="container-div">
+    <div class="row">
+        <div class="col-sm-12 search-collapse">
+            <form id="role-form">
+                <div class="select-list">
+                    <ul>
+                        <li>
+                            公司名称:<input type="text" name="org3name"/>
+                        </li>
+                        <li>
+                            大区名称:<input type="text" name="org4name"/>
+                        </li>
+                        <li>
+                            销售部名称:<input type="text" name="org5name"/>
+                        </li>
+                        <li>
+                            销售分部名称:<input type="text" name="org6name"/>
+                        </li>
+                        <li>
+                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                        </li>
+                    </ul>
+                </div>
+            </form>
+        </div>
+
+        <div class="col-sm-12 select-table table-striped">
+            <table id="bootstrap-table"></table>
+        </div>
+    </div>
+</div>
+<th:block th:include="include :: footer" />
+<script th:inline="javascript">
+    var datas = [[${@dict.getType('sys_normal_disable')}]];
+    var prefix = ctx + "order/salesorgStart";
+    $(function() {
+        var options = {
+            url: prefix+'/salesOrgList',
+            modalName: "销售组织架构启用",
+            showSearch: false,
+            showRefresh: false,
+            showToggle: false,
+            showColumns: false,
+            clickToSelect: true,
+            rememberSelected: true,
+            columns: [{
+                field: 'state',
+                checkbox: true
+            },
+                {
+                    field: 'org3code',
+                    title: '公司代码'
+                },{
+                    field: 'org3name',
+                    title: '公司名称'
+                },{
+                    field: 'org4code',
+                    title: '大区代码'
+                },{
+                    field: 'org4name',
+                    title: '大区名称'
+                },{
+                    field: 'org5code',
+                    title: '销售部代码'
+                },{
+                    field: 'org5name',
+                    title: '销售部名称'
+                },{
+                    field: 'org6code',
+                    title: '销售分部代码'
+                },{
+                    field: 'org6name',
+                    title: '销售分部名称'
+                }]
+        };
+        $.table.init(options);
+    });
+
+    /* 添加用户-选择用户-提交 */
+    function submitHandler() {
+        //var rows = $.table.selectFirstColumns();
+        let org6code = $.table.selectColumns('org6code')
+        let org6name = $.table.selectColumns('org6name')
+        console.log("org6code = " + org6code);
+        console.log("org6name = " + org6name);
+        if (org6code.length == 0) {
+            $.modal.alertWarning("请至少选择一条记录");
+            return;
+        }
+        var data = {"org6codes":org6code.join(),"org6names":org6name.join()};
+        console.log("data = " + data);
+        $.operate.save(prefix + "/addSalesorgStart", data);
+    }
+</script>
+</body>
+</html>

+ 90 - 0
suishenbang-order/src/main/resources/templates/order/salesorgStart/salesorgStart.html

@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('销售组织架构启用管理列表')" />
+</head>
+<body class="gray-bg">
+     <div class="container-div">
+        <div class="row">
+            <div class="col-sm-12 search-collapse">
+                <form id="formId">
+                    <div class="select-list">
+                        <ul>
+                            <li>
+                                <p>销售分部代码:</p>
+                                <input type="text" name="salesorgCode"/>
+                            </li>
+                            <li>
+                                <p>销售分部名称:</p>
+                                <input type="text" name="salseorgName"/>
+                            </li>
+                            <li>
+                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                            </li>
+                        </ul>
+                    </div>
+                </form>
+            </div>
+
+            <div class="btn-group-sm" id="toolbar" role="group">
+                <a class="btn btn-success" onclick="add()" shiro:hasPermission="order:salesorgStart:add">
+                    <i class="fa fa-plus"></i> 启用组织架构
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="order:salesorgStart:remove">
+                    <i class="fa fa-remove"></i> 停用组织架构
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="order:salesorgStart:export">
+                    <i class="fa fa-download"></i> 导出
+                 </a>
+            </div>
+            <div class="col-sm-12 select-table table-striped">
+                <table id="bootstrap-table"></table>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var editFlag = [[${@permission.hasPermi('order:salesorgStart:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('order:salesorgStart:remove')}]];
+        var prefix = ctx + "order/salesorgStart";
+
+        $(function() {
+            var options = {
+                url: prefix + "/list",
+                createUrl: prefix + "/add",
+                updateUrl: prefix + "/edit/{id}",
+                removeUrl: prefix + "/remove",
+                exportUrl: prefix + "/export",
+                modalName: "销售组织架构启用管理",
+                columns: [{
+                    checkbox: true
+                },
+                {
+                    field : 'salesorgCode', 
+                    title : '销售分部代码'
+                },
+                {
+                    field : 'salseorgName', 
+                    title : '销售分部名称'
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        var actions = [];
+                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.salesorgCode + '\')"><i class="fa fa-remove"></i>停用</a>');
+                        return actions.join('');
+                    }
+                }]
+            };
+            $.table.init(options);
+        });
+
+        function add() {
+            var url = prefix + '/add';
+            $.modal.open('启用经销商', url);
+        }
+    </script>
+</body>
+</html>