‘linchangsheng’ 8 ヶ月 前
コミット
7179eef6bb

+ 19 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/DispatchCherVO.java

@@ -0,0 +1,19 @@
+package com.gree.mall.manager.bean.workorder;
+
+import com.gree.mall.manager.annotation.ZfireField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel
+public class DispatchCherVO {
+
+
+    @ApiModelProperty(value = "id")
+    private String keyId;
+
+
+    @ApiModelProperty(value = "名称")
+    private String valueName;
+}

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/DispatchVO.java

@@ -16,7 +16,7 @@ public class DispatchVO {
 
     @ZfireField(tbName = "a",hide = true)
     @ApiModelProperty(value = "省")
-    private String pid;
+    private String provinceCode;
 
 
     @ZfireField(tbName = "a")

+ 98 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/WebsitDispatchVO.java

@@ -0,0 +1,98 @@
+package com.gree.mall.manager.bean.workorder;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.plus.entity.WebsitDispatch;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@ApiModel
+public class WebsitDispatchVO   {
+
+    @ZfireField(hide = true)
+    @TableId(value = "id", type = IdType.ID_WORKER_STR)
+    private String id;
+
+    @ApiModelProperty(value = "省份")
+    private String provinceName;
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "省id")
+    private String pid;
+
+    @ApiModelProperty(value = "城市")
+    private String cityName;
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "城市id")
+    private String cityCode;
+
+    @ApiModelProperty(value = "区域")
+    private String areaName;
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "区域id")
+    private String areaCode;
+
+    @ApiModelProperty(value = "街道")
+    private String streetName;
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "街道id")
+    private String streetCode;
+
+    @ApiModelProperty(value = "工单渠道")
+    private String dictValue;
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "工单渠道id")
+    private String dictCode;
+
+    @ApiModelProperty(value = "工单类型")
+    private String orderSmallTypeText;
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "工单类型id")
+    private String orderSmallId;
+
+    @ApiModelProperty(value = "产品大类")
+    private String categoryName;
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "产品大类id")
+    private String categoryId;
+
+    @ApiModelProperty(value = "工单来源")
+    private String orderSource;
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "工单来源id")
+    private String orderSourceId;
+
+    @ApiModelProperty(value = "网点编号")
+    private String websitId;
+
+    @ApiModelProperty(value = "网点名称")
+    private String websitName;
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "商户id")
+    private String companyWechatId;
+
+    @ApiModelProperty(value = "商户名称")
+    private String companyWechatName;
+
+    @ApiModelProperty(value = "创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    @ApiModelProperty(value = "创建人名称")
+    private String createName;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "修改人")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateBy;
+
+}

+ 99 - 2
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/workorder/IncreMapper.java

@@ -3,8 +3,10 @@ package com.gree.mall.manager.commonmapper.workorder;
 import com.baomidou.mybatisplus.annotation.SqlParser;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.bean.workorder.DispatchCherVO;
 import com.gree.mall.manager.bean.workorder.DispatchVO;
 import com.gree.mall.manager.bean.workorder.IncreVO;
+import com.gree.mall.manager.bean.workorder.WebsitDispatchVO;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -15,8 +17,103 @@ import java.util.List;
 public interface IncreMapper {
 
     @SqlParser(filter = true)
-    IPage<IncreVO> list(IPage page, @Param("ex")ZfireParamBean zfireParam, @Param("adminCompanyIds")List<String> adminCompanyIds);
+    IPage<IncreVO> list(IPage page, @Param("ex") ZfireParamBean zfireParam, @Param("adminCompanyIds") List<String> adminCompanyIds);
 
     @SqlParser(filter = true)
-    IPage<DispatchVO> listDispatch(Page page,@Param("ex") ZfireParamBean zfireParam, @Param("adminCompanyIds") List<String> adminCompanyIds);
+    IPage<DispatchVO> listDispatch(Page page, @Param("ex") ZfireParamBean zfireParam, @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    @SqlParser(filter = true)
+    IPage<WebsitDispatchVO> listDispatchWebsit(Page page, @Param("ex") ZfireParamBean zfireParamBean, @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+
+    @SqlParser(filter = true)
+    List<DispatchCherVO> pList(@Param("pId") String pId,
+                               @Param("cityCode") String cityCode,
+                               @Param("areaCode") String areaCode,
+                               @Param("streetCode") String streetCode,
+                               @Param("dictCode") String dictCode,
+                               @Param("orderSmallId") String orderSmallId,
+                               @Param("categoryId") String categoryId,
+                               @Param("orderSourceId") String orderSourceId,
+                                @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    @SqlParser(filter = true)
+    List<DispatchCherVO> cList(
+            @Param("pId") String pId,
+            @Param("cityCode") String cityCode,
+            @Param("areaCode") String areaCode,
+            @Param("streetCode") String streetCode,
+            @Param("dictCode") String dictCode,
+            @Param("orderSmallId") String orderSmallId,
+            @Param("categoryId") String categoryId,
+            @Param("orderSourceId") String orderSourceId,
+            @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    @SqlParser(filter = true)
+    List<DispatchCherVO> aList(  @Param("pId") String pId,
+                                 @Param("cityCode") String cityCode,
+                                 @Param("areaCode") String areaCode,
+                                 @Param("streetCode") String streetCode,
+                                 @Param("dictCode") String dictCode,
+                                 @Param("orderSmallId") String orderSmallId,
+                                 @Param("categoryId") String categoryId,
+                                 @Param("orderSourceId") String orderSourceId,
+                                 @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    @SqlParser(filter = true)
+    List<DispatchCherVO> sList(@Param("pId") String pId,
+                               @Param("cityCode") String cityCode,
+                               @Param("areaCode") String areaCode,
+                               @Param("streetCode") String streetCode,
+                               @Param("dictCode") String dictCode,
+                               @Param("orderSmallId") String orderSmallId,
+                               @Param("categoryId") String categoryId,
+                               @Param("orderSourceId") String orderSourceId,
+                               @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    @SqlParser(filter = true)
+    List<DispatchCherVO> channel(
+            @Param("pId") String pId,
+            @Param("cityCode") String cityCode,
+            @Param("areaCode") String areaCode,
+            @Param("streetCode") String streetCode,
+            @Param("dictCode") String dictCode,
+            @Param("orderSmallId") String orderSmallId,
+            @Param("categoryId") String categoryId,
+            @Param("orderSourceId") String orderSourceId,
+            @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    @SqlParser(filter = true)
+    List<DispatchCherVO> smallList(  @Param("pId") String pId,
+                                     @Param("cityCode") String cityCode,
+                                     @Param("areaCode") String areaCode,
+                                     @Param("streetCode") String streetCode,
+                                     @Param("dictCode") String dictCode,
+                                     @Param("orderSmallId") String orderSmallId,
+                                     @Param("categoryId") String categoryId,
+                                     @Param("orderSourceId") String orderSourceId,
+                                     @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    @SqlParser(filter = true)
+    List<DispatchCherVO> categoryList( @Param("pId") String pId,
+                                       @Param("cityCode") String cityCode,
+                                       @Param("areaCode") String areaCode,
+                                       @Param("streetCode") String streetCode,
+                                       @Param("dictCode") String dictCode,
+                                       @Param("orderSmallId") String orderSmallId,
+                                       @Param("categoryId") String categoryId,
+                                       @Param("orderSourceId") String orderSourceId,
+                                       @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    @SqlParser(filter = true)
+    List<DispatchCherVO> sourceList(
+            @Param("pId") String pId,
+            @Param("cityCode") String cityCode,
+            @Param("areaCode") String areaCode,
+            @Param("streetCode") String streetCode,
+            @Param("dictCode") String dictCode,
+            @Param("orderSmallId") String orderSmallId,
+            @Param("categoryId") String categoryId,
+            @Param("orderSourceId") String orderSourceId,
+            @Param("adminCompanyIds") List<String> adminCompanyIds);
 }

+ 162 - 7
mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/DispatchController.java

@@ -4,12 +4,11 @@ import cn.hutool.core.lang.TypeReference;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gree.mall.manager.annotation.ZfireList;
-import com.gree.mall.manager.bean.listvo.param.WorkOrderZfireParam;
-import com.gree.mall.manager.bean.listvo.workorder.OrderBaseVO;
 import com.gree.mall.manager.bean.workorder.*;
+import com.gree.mall.manager.bean.workorder.DispatchCherVO;
 import com.gree.mall.manager.helper.ResponseHelper;
 import com.gree.mall.manager.logic.workorder.ChangeOrderLogic;
-import com.gree.mall.manager.plus.entity.PgOrderProductDetail;
+import com.gree.mall.manager.plus.entity.WebsitDispatch;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import io.swagger.annotations.Api;
@@ -21,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.text.ParseException;
+import javax.validation.Valid;
 import java.util.List;
 
 @Slf4j
@@ -36,17 +35,18 @@ public class DispatchController {
 
     @ZfireList
     @PostMapping("/list")
-    @ApiOperation(value = "列表")
+    @ApiOperation(value = "未配置街道-列表")
     public ResponseHelper<Page<DispatchVO>> list(
             @RequestBody ZfireParamBean zfireParamBean
     ) {
         IPage<DispatchVO> orderBaseVOIPage = changeOrderLogic.list(zfireParamBean);
-        return ResponseHelper.success(orderBaseVOIPage, new TypeReference<DispatchVO>() {});
+        return ResponseHelper.success(orderBaseVOIPage, new TypeReference<DispatchVO>() {
+        });
     }
 
 
     @PostMapping("/list/export")
-    @ApiOperation(value = "导出")
+    @ApiOperation(value = "未配置街道-导出")
     public void listExport(@RequestBody ZfireParamBean zfireParamBean,
                            HttpServletRequest request, HttpServletResponse response) throws Exception {
         //1.组装查询条件
@@ -58,7 +58,162 @@ public class DispatchController {
     }
 
 
+    @PostMapping("/save")
+    @ApiOperation(value = "未配置街道-配置")
+    public ResponseHelper save(@Valid @RequestBody WebsitDispatch websitDispatch) {
+        changeOrderLogic.saveOrder(websitDispatch);
+        return ResponseHelper.success();
+    }
+
+
+    @ZfireList
+    @PostMapping("/listDispatch")
+    @ApiOperation(value = "自动派工街道配置-列表")
+    public ResponseHelper<Page<WebsitDispatchVO>> listDispatch(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) {
+        IPage<WebsitDispatchVO> orderBaseVOIPage = changeOrderLogic.listDispatch(zfireParamBean);
+        return ResponseHelper.success(orderBaseVOIPage, new TypeReference<WebsitDispatchVO>() {
+        });
+    }
+
+
+    @PostMapping("/listDispatch/export")
+    @ApiOperation(value = "自动派工街道配置-导出")
+    public void listDispatchExport(@RequestBody ZfireParamBean zfireParamBean,
+                                   HttpServletRequest request, HttpServletResponse response) throws Exception {
+        //1.组装查询条件
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
+        //2.查询要导出的内容
+        IPage<WebsitDispatchVO> page = changeOrderLogic.listDispatch(zfireParamBean);
+        //3.导出
+        FieldUtils.exportData(page.getRecords(), zfireParam.getExportFields(), request, response);
+    }
+
+    @PostMapping("/pList")
+    @ApiOperation(value = "省")
+    public ResponseHelper<List<DispatchCherVO>> pList(
+            @ApiParam(value = "省id", required = false) @RequestParam String pId,
+            @ApiParam(value = "市id", required = false) @RequestParam String cityCode,
+            @ApiParam(value = "区id", required = false) @RequestParam String areaCode,
+            @ApiParam(value = "街道id", required = false) @RequestParam String streetCode,
+            @ApiParam(value = "工单渠道id", required = false) @RequestParam String dictCode,
+            @ApiParam(value = "工单类型id", required = false) @RequestParam String orderSmallId,
+            @ApiParam(value = "产品大类id", required = false) @RequestParam String categoryId,
+            @ApiParam(value = "工单来源id", required = false) @RequestParam String orderSourceId
+
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.pList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId);
+        return ResponseHelper.success(dispatchCherVOS);
+    }
 
+    @PostMapping("/cList")
+    @ApiOperation(value = "市")
+    public ResponseHelper<List<DispatchCherVO>> cList(
+            @ApiParam(value = "省id", required = false) @RequestParam String pId,
+            @ApiParam(value = "市id", required = false) @RequestParam String cityCode,
+            @ApiParam(value = "区id", required = false) @RequestParam String areaCode,
+            @ApiParam(value = "街道id", required = false) @RequestParam String streetCode,
+            @ApiParam(value = "工单渠道id", required = false) @RequestParam String dictCode,
+            @ApiParam(value = "工单类型id", required = false) @RequestParam String orderSmallId,
+            @ApiParam(value = "产品大类id", required = false) @RequestParam String categoryId,
+            @ApiParam(value = "工单来源id", required = false) @RequestParam String orderSourceId
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.cList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId);
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/aList")
+    @ApiOperation(value = "区")
+    public ResponseHelper<List<DispatchCherVO>> aList(@ApiParam(value = "省id", required = false) @RequestParam String pId,
+                                @ApiParam(value = "市id", required = false) @RequestParam String cityCode,
+                                @ApiParam(value = "区id", required = false) @RequestParam String areaCode,
+                                @ApiParam(value = "街道id", required = false) @RequestParam String streetCode,
+                                @ApiParam(value = "工单渠道id", required = false) @RequestParam String dictCode,
+                                @ApiParam(value = "工单类型id", required = false) @RequestParam String orderSmallId,
+                                @ApiParam(value = "产品大类id", required = false) @RequestParam String categoryId,
+                                @ApiParam(value = "工单来源id", required = false) @RequestParam String orderSourceId) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.aList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId);
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/sList")
+    @ApiOperation(value = "街道")
+    public ResponseHelper<List<DispatchCherVO>> sList(
+            @ApiParam(value = "省id", required = false) @RequestParam String pId,
+            @ApiParam(value = "市id", required = false) @RequestParam String cityCode,
+            @ApiParam(value = "区id", required = false) @RequestParam String areaCode,
+            @ApiParam(value = "街道id", required = false) @RequestParam String streetCode,
+            @ApiParam(value = "工单渠道id", required = false) @RequestParam String dictCode,
+            @ApiParam(value = "工单类型id", required = false) @RequestParam String orderSmallId,
+            @ApiParam(value = "产品大类id", required = false) @RequestParam String categoryId,
+            @ApiParam(value = "工单来源id", required = false) @RequestParam String orderSourceId
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.sList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId);
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+
+    @PostMapping("/channel")
+    @ApiOperation(value = "工单渠道")
+    public ResponseHelper<List<DispatchCherVO>> channel(    @ApiParam(value = "省id", required = false) @RequestParam String pId,
+                                   @ApiParam(value = "市id", required = false) @RequestParam String cityCode,
+                                   @ApiParam(value = "区id", required = false) @RequestParam String areaCode,
+                                   @ApiParam(value = "街道id", required = false) @RequestParam String streetCode,
+                                   @ApiParam(value = "工单渠道id", required = false) @RequestParam String dictCode,
+                                   @ApiParam(value = "工单类型id", required = false) @RequestParam String orderSmallId,
+                                   @ApiParam(value = "产品大类id", required = false) @RequestParam String categoryId,
+                                   @ApiParam(value = "工单来源id", required = false) @RequestParam String orderSourceId) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.channel(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId);
+
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/smallList")
+    @ApiOperation(value = "工单类型")
+    public ResponseHelper<List<DispatchCherVO>> smallList(@ApiParam(value = "省id", required = false) @RequestParam String pId,
+                                    @ApiParam(value = "市id", required = false) @RequestParam String cityCode,
+                                    @ApiParam(value = "区id", required = false) @RequestParam String areaCode,
+                                    @ApiParam(value = "街道id", required = false) @RequestParam String streetCode,
+                                    @ApiParam(value = "工单渠道id", required = false) @RequestParam String dictCode,
+                                    @ApiParam(value = "工单类型id", required = false) @RequestParam String orderSmallId,
+                                    @ApiParam(value = "产品大类id", required = false) @RequestParam String categoryId,
+                                    @ApiParam(value = "工单来源id", required = false) @RequestParam String orderSourceId) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
+                .smallList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId);
+
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/categoryList")
+    @ApiOperation(value = "产品大类")
+    public ResponseHelper<List<DispatchCherVO>> categoryList(@ApiParam(value = "省id", required = false) @RequestParam String pId,
+                                       @ApiParam(value = "市id", required = false) @RequestParam String cityCode,
+                                       @ApiParam(value = "区id", required = false) @RequestParam String areaCode,
+                                       @ApiParam(value = "街道id", required = false) @RequestParam String streetCode,
+                                       @ApiParam(value = "工单渠道id", required = false) @RequestParam String dictCode,
+                                       @ApiParam(value = "工单类型id", required = false) @RequestParam String orderSmallId,
+                                       @ApiParam(value = "产品大类id", required = false) @RequestParam String categoryId,
+                                       @ApiParam(value = "工单来源id", required = false) @RequestParam String orderSourceId) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
+                .categoryList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId);
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/sourceList")
+    @ApiOperation(value = "工单来源")
+    public ResponseHelper sourceList(@ApiParam(value = "省id", required = false) @RequestParam String pId,
+                                     @ApiParam(value = "市id", required = false) @RequestParam String cityCode,
+                                     @ApiParam(value = "区id", required = false) @RequestParam String areaCode,
+                                     @ApiParam(value = "街道id", required = false) @RequestParam String streetCode,
+                                     @ApiParam(value = "工单渠道id", required = false) @RequestParam String dictCode,
+                                     @ApiParam(value = "工单类型id", required = false) @RequestParam String orderSmallId,
+                                     @ApiParam(value = "产品大类id", required = false) @RequestParam String categoryId,
+                                     @ApiParam(value = "工单来源id", required = false) @RequestParam String orderSourceId) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
+                .sourceList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId);
+        return ResponseHelper.success(dispatchCherVOS);
+    }
 
 
 }

+ 77 - 4
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/ChangeOrderLogic.java

@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gree.mall.manager.bean.SyncOrderDto;
 import com.gree.mall.manager.bean.admin.AdminUserCom;
-import com.gree.mall.manager.bean.workorder.DispatchVO;
-import com.gree.mall.manager.bean.workorder.IncreVO;
-import com.gree.mall.manager.bean.workorder.PgOrderProductDetailVO;
-import com.gree.mall.manager.bean.workorder.WorkerOrderDetail;
+import com.gree.mall.manager.bean.workorder.*;
 import com.gree.mall.manager.commonmapper.workorder.IncreMapper;
 import com.gree.mall.manager.enums.PayStatusEnum;
 import com.gree.mall.manager.enums.admin.AdminWebsitTypeEnum;
@@ -253,4 +250,80 @@ public class ChangeOrderLogic {
 
 
     }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void saveOrder(WebsitDispatch websitDispatch) {
+        websitDispatch.insert();
+    }
+
+    public IPage<WebsitDispatchVO> listDispatch(ZfireParamBean zfireParamBean) {
+
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        //1.组装查询条件
+        zfireParamBean = FieldUtils.supplyParam(zfireParamBean, WebsitDispatchVO.class);
+
+        IPage<WebsitDispatchVO> websitDispatchVOIPage = increMapper.listDispatchWebsit(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean,adminCompanyIds);
+
+        return websitDispatchVOIPage;
+    }
+
+    public List<DispatchCherVO> pList(String pId, String cityCode, String areaCode, String streetCode, String dictCode, String orderSmallId, String categoryId, String orderSourceId) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        return increMapper.pList(pId,  cityCode,  areaCode,  streetCode,  dictCode,  orderSmallId,  categoryId, orderSourceId,adminCompanyIds);
+    }
+
+    public List<DispatchCherVO> cList(String pId, String cityCode, String areaCode, String streetCode, String dictCode, String orderSmallId, String categoryId, String orderSourceId) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        return increMapper.cList(pId,  cityCode,  areaCode,  streetCode,  dictCode,  orderSmallId,  categoryId, orderSourceId,adminCompanyIds);
+    }
+
+    public List<DispatchCherVO> aList(String pId, String cityCode, String areaCode, String streetCode, String dictCode, String orderSmallId, String categoryId, String orderSourceId) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        return increMapper.aList(pId,  cityCode,  areaCode,  streetCode,  dictCode,  orderSmallId,  categoryId, orderSourceId,adminCompanyIds);
+    }
+
+    public List<DispatchCherVO> sList(String pId, String cityCode, String areaCode, String streetCode, String dictCode, String orderSmallId, String categoryId, String orderSourceId) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        return increMapper.sList(pId,  cityCode,  areaCode,  streetCode,  dictCode,  orderSmallId,  categoryId, orderSourceId,adminCompanyIds);
+    }
+
+    public List<DispatchCherVO> channel(String pId, String cityCode, String areaCode, String streetCode, String dictCode, String orderSmallId, String categoryId, String orderSourceId) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        return increMapper.channel(pId,  cityCode,  areaCode,  streetCode,  dictCode,  orderSmallId,  categoryId, orderSourceId,adminCompanyIds);
+    }
+
+    public List<DispatchCherVO> smallList(String pId, String cityCode, String areaCode, String streetCode, String dictCode, String orderSmallId, String categoryId, String orderSourceId) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        return increMapper.smallList(pId,  cityCode,  areaCode,  streetCode,  dictCode,  orderSmallId,  categoryId, orderSourceId,adminCompanyIds);
+    }
+
+    public List<DispatchCherVO> categoryList(String pId, String cityCode, String areaCode, String streetCode, String dictCode, String orderSmallId, String categoryId, String orderSourceId) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        return increMapper.categoryList(pId,  cityCode,  areaCode,  streetCode,  dictCode,  orderSmallId,  categoryId, orderSourceId,adminCompanyIds);
+    }
+
+    public List<DispatchCherVO> sourceList(String pId, String cityCode, String areaCode, String streetCode, String dictCode, String orderSmallId, String categoryId, String orderSourceId) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        return increMapper.sourceList(pId,  cityCode,  areaCode,  streetCode,  dictCode,  orderSmallId,  categoryId, orderSourceId,adminCompanyIds);
+    }
 }

+ 547 - 2
mall-server-api/src/main/resources/mapper/workorder/IncreMapper.xml

@@ -22,7 +22,7 @@
     <select id="listDispatch" resultType="com.gree.mall.manager.bean.workorder.DispatchVO">
         SELECT
         a.province_name,
-        a.pid,
+        a.province_code,
         a.city_name,
         a.city_code,
         a.area_name,
@@ -67,10 +67,555 @@
                 #{item}
             </foreach>
         </if>
-        where
+        ${ex.query}
+        and
+        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
+        AND a.`level` = 4
+
+
+    </select>
+    <select id="listDispatchWebsit" resultType="com.gree.mall.manager.bean.workorder.WebsitDispatchVO">
+        SELECT
+        ${ex.selected}
+        FROM websit_dispatch a
+        ${ex.query}
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND a.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
+    <select id="pList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
+        SELECT
+        a.province_name as valueName,
+        a.province_code as keyId
+        FROM
+        region a
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND b.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join order_small_type c
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            on c.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND d.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND e.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+      where 1=1
+        and
+        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
+        AND a.`level` = 4
+
+        <if test="pId != null and pId !=''">
+            AND a.pid == #{pId}
+        </if>
+        <if test="cityCode != null and cityCode !=''">
+            AND a.city_code == #{cityCode}
+        </if>
+        <if test="areaCode != null and areaCode !=''">
+            AND a.area_code == #{areaCode}
+        </if>
+        <if test="streetCode != null and streetCode !=''">
+            AND a.id ==  #{streetCode}
+        </if>
+        <if test="dictCode != null and dictCode !=''">
+            AND b.dict_code == #{dictCode}
+        </if>
+        <if test="orderSmallId != null and orderSmallId !=''">
+            AND c.id== #{orderSmallId}
+        </if>
+        <if test="categoryId != null and categoryId !=''">
+            AND d.category_id == #{categoryId}
+        </if>
+        <if test="orderSourceId != null and orderSourceId !=''">
+            AND e.dict_code == #{orderSourceId}
+        </if>
+
+     group by a.province_code
+    </select>
+    <select id="cList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
+        SELECT
+        a.city_name as valueName,
+        a.city_code as keyId
+        FROM
+        region a
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND b.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join order_small_type c
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            on c.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND d.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND e.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        where 1=1
+        and
+        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
+        AND a.`level` = 4
+
+        <if test="pId != null and pId !=''">
+            AND a.pid == #{pId}
+        </if>
+        <if test="cityCode != null and cityCode !=''">
+            AND a.city_code == #{cityCode}
+        </if>
+        <if test="areaCode != null and areaCode !=''">
+            AND a.area_code == #{areaCode}
+        </if>
+        <if test="streetCode != null and streetCode !=''">
+            AND a.id ==  #{streetCode}
+        </if>
+        <if test="dictCode != null and dictCode !=''">
+            AND b.dict_code == #{dictCode}
+        </if>
+        <if test="orderSmallId != null and orderSmallId !=''">
+            AND c.id== #{orderSmallId}
+        </if>
+        <if test="categoryId != null and categoryId !=''">
+            AND d.category_id == #{categoryId}
+        </if>
+        <if test="orderSourceId != null and orderSourceId !=''">
+            AND e.dict_code == #{orderSourceId}
+        </if>
+
+        group by a.city_code
+    </select>
+    <select id="aList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
+        SELECT
+        a.area_name as valueName,
+        a.area_code as keyId
+        FROM
+        region a
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND b.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join order_small_type c
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            on c.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND d.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND e.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        where 1=1
+        and
+        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
+        AND a.`level` = 4
+
+        <if test="pId != null and pId !=''">
+            AND a.pid == #{pId}
+        </if>
+        <if test="cityCode != null and cityCode !=''">
+            AND a.city_code == #{cityCode}
+        </if>
+        <if test="areaCode != null and areaCode !=''">
+            AND a.area_code == #{areaCode}
+        </if>
+        <if test="streetCode != null and streetCode !=''">
+            AND a.id ==  #{streetCode}
+        </if>
+        <if test="dictCode != null and dictCode !=''">
+            AND b.dict_code == #{dictCode}
+        </if>
+        <if test="orderSmallId != null and orderSmallId !=''">
+            AND c.id== #{orderSmallId}
+        </if>
+        <if test="categoryId != null and categoryId !=''">
+            AND d.category_id == #{categoryId}
+        </if>
+        <if test="orderSourceId != null and orderSourceId !=''">
+            AND e.dict_code == #{orderSourceId}
+        </if>
+
+        group by a.area_code
+    </select>
+    <select id="sList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
+        SELECT
+        a.name as valueName,
+        a.id as keyId
+        FROM
+        region a
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND b.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join order_small_type c
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            on c.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND d.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND e.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        where 1=1
+        and
         a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
         AND a.`level` = 4
 
+        <if test="pId != null and pId !=''">
+            AND a.pid == #{pId}
+        </if>
+        <if test="cityCode != null and cityCode !=''">
+            AND a.city_code == #{cityCode}
+        </if>
+        <if test="areaCode != null and areaCode !=''">
+            AND a.area_code == #{areaCode}
+        </if>
+        <if test="streetCode != null and streetCode !=''">
+            AND a.id ==  #{streetCode}
+        </if>
+        <if test="dictCode != null and dictCode !=''">
+            AND b.dict_code == #{dictCode}
+        </if>
+        <if test="orderSmallId != null and orderSmallId !=''">
+            AND c.id== #{orderSmallId}
+        </if>
+        <if test="categoryId != null and categoryId !=''">
+            AND d.category_id == #{categoryId}
+        </if>
+        <if test="orderSourceId != null and orderSourceId !=''">
+            AND e.dict_code == #{orderSourceId}
+        </if>
+
+        group by a.id
+    </select>
+    <select id="channel" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
+        SELECT
+        b.dict_value as valueName,
+        b.dict_code as keyId
+        FROM
+        region a
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND b.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join order_small_type c
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            on c.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND d.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND e.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        where 1=1
+        and
+        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
+        AND a.`level` = 4
+
+        <if test="pId != null and pId !=''">
+            AND a.pid == #{pId}
+        </if>
+        <if test="cityCode != null and cityCode !=''">
+            AND a.city_code == #{cityCode}
+        </if>
+        <if test="areaCode != null and areaCode !=''">
+            AND a.area_code == #{areaCode}
+        </if>
+        <if test="streetCode != null and streetCode !=''">
+            AND a.id ==  #{streetCode}
+        </if>
+        <if test="dictCode != null and dictCode !=''">
+            AND b.dict_code == #{dictCode}
+        </if>
+        <if test="orderSmallId != null and orderSmallId !=''">
+            AND c.id== #{orderSmallId}
+        </if>
+        <if test="categoryId != null and categoryId !=''">
+            AND d.category_id == #{categoryId}
+        </if>
+        <if test="orderSourceId != null and orderSourceId !=''">
+            AND e.dict_code == #{orderSourceId}
+        </if>
+
+        group by b.dict_code
+    </select>
+    <select id="smallList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
+        SELECT
+        c.order_small_type_text as valueName,
+        c.id as keyId
+        FROM
+        region a
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND b.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join order_small_type c
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            on c.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND d.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND e.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        where 1=1
+        and
+        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
+        AND a.`level` = 4
+
+        <if test="pId != null and pId !=''">
+            AND a.pid == #{pId}
+        </if>
+        <if test="cityCode != null and cityCode !=''">
+            AND a.city_code == #{cityCode}
+        </if>
+        <if test="areaCode != null and areaCode !=''">
+            AND a.area_code == #{areaCode}
+        </if>
+        <if test="streetCode != null and streetCode !=''">
+            AND a.id ==  #{streetCode}
+        </if>
+        <if test="dictCode != null and dictCode !=''">
+            AND b.dict_code == #{dictCode}
+        </if>
+        <if test="orderSmallId != null and orderSmallId !=''">
+            AND c.id== #{orderSmallId}
+        </if>
+        <if test="categoryId != null and categoryId !=''">
+            AND d.category_id == #{categoryId}
+        </if>
+        <if test="orderSourceId != null and orderSourceId !=''">
+            AND e.dict_code == #{orderSourceId}
+        </if>
+
+        group by c.id
+    </select>
+    <select id="categoryList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
+        SELECT
+        d.name as valueName,
+        d.category_id as keyId
+        FROM
+        region a
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND b.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join order_small_type c
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            on c.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND d.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND e.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        where 1=1
+        and
+        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
+        AND a.`level` = 4
+
+        <if test="pId != null and pId !=''">
+            AND a.pid == #{pId}
+        </if>
+        <if test="cityCode != null and cityCode !=''">
+            AND a.city_code == #{cityCode}
+        </if>
+        <if test="areaCode != null and areaCode !=''">
+            AND a.area_code == #{areaCode}
+        </if>
+        <if test="streetCode != null and streetCode !=''">
+            AND a.id ==  #{streetCode}
+        </if>
+        <if test="dictCode != null and dictCode !=''">
+            AND b.dict_code == #{dictCode}
+        </if>
+        <if test="orderSmallId != null and orderSmallId !=''">
+            AND c.id== #{orderSmallId}
+        </if>
+        <if test="categoryId != null and categoryId !=''">
+            AND d.category_id == #{categoryId}
+        </if>
+        <if test="orderSourceId != null and orderSourceId !=''">
+            AND e.dict_code == #{orderSourceId}
+        </if>
+
+        group by d.category_id
+    </select>
+    <select id="sourceList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
+        SELECT
+        e.dict_value as valueName,
+        e.dict_code as keyId
+        FROM
+        region a
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND b.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join order_small_type c
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            on c.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND d.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND e.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        where 1=1
+        and
+        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
+        AND a.`level` = 4
+
+        <if test="pId != null and pId !=''">
+            AND a.pid == #{pId}
+        </if>
+        <if test="cityCode != null and cityCode !=''">
+            AND a.city_code == #{cityCode}
+        </if>
+        <if test="areaCode != null and areaCode !=''">
+            AND a.area_code == #{areaCode}
+        </if>
+        <if test="streetCode != null and streetCode !=''">
+            AND a.id ==  #{streetCode}
+        </if>
+        <if test="dictCode != null and dictCode !=''">
+            AND b.dict_code == #{dictCode}
+        </if>
+        <if test="orderSmallId != null and orderSmallId !=''">
+            AND c.id== #{orderSmallId}
+        </if>
+        <if test="categoryId != null and categoryId !=''">
+            AND d.category_id == #{categoryId}
+        </if>
+        <if test="orderSourceId != null and orderSourceId !=''">
+            AND e.dict_code == #{orderSourceId}
+        </if>
 
+        group by  e.dict_code
     </select>
 </mapper>