瀏覽代碼

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu 8 月之前
父節點
當前提交
173cce1560

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

@@ -16,7 +16,7 @@ import java.util.List;
 
 @ZfireField(tbName = "a")
 @Data
-public class OrderBaseVO   {
+public class OrderBaseVO    {
 
     @ZfireField(sortNum = 1,isQuery = false, ignoreSelect = true)
     @ApiModelProperty(value="服务单标识")
@@ -184,6 +184,17 @@ public class OrderBaseVO   {
     private String operateEntity;
 
 
+    @ApiModelProperty(value = "销售网点编号")
+    private String salesWebsitNumber;
+
+    @ApiModelProperty(value = "销售网点名称")
+    private String salesWebsit;
+
+
+    @ApiModelProperty(value = "评价标签")
+    private String appraiseLabel;
+
+
     @ZfireField(hide = true)
     @ApiModelProperty(value = "是否是工单3.0同步true/false")
     private Boolean isThreeOrder;

+ 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")

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

@@ -0,0 +1,34 @@
+package com.gree.mall.manager.bean.workorder;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel
+public class WebsitDispatchAdd {
+
+    @ApiModelProperty(value = "网点id")
+    private String websitId;
+
+
+    @ApiModelProperty(value = "街道id")
+    private String streetId;
+
+    @ApiModelProperty(value = "工单渠道")
+    private List<String> orderChannelIds;
+
+    @ApiModelProperty(value = "工单类型")
+    private List<String> orderSmallIds;
+
+    @ApiModelProperty(value = "产品大类")
+    private List<String> categoryIds;
+
+    @ApiModelProperty(value = "工单来源")
+    private List<String> orderSourceIds;
+
+
+
+}

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

@@ -0,0 +1,38 @@
+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;
+
+import java.util.List;
+
+@Data
+@ApiModel
+public class WebsitDispatchRe {
+
+
+    @ApiModelProperty(value = "省id")
+    private String provinceCode;
+
+    @ApiModelProperty(value = "城市id")
+    private String cityCode;
+
+    @ApiModelProperty(value = "区域id")
+    private String areaCode;
+
+    @ApiModelProperty(value = "街道id")
+    private String streetCode;
+
+    @ApiModelProperty(value = "工单渠道id")
+    private List<String> dictCode;
+
+    @ApiModelProperty(value = "工单类型id")
+    private List<String> orderSmallId;
+
+    @ApiModelProperty(value = "产品大类id")
+    private List<String> categoryId;
+
+    @ApiModelProperty(value = "工单来源id")
+    private List<String> orderSourceId;
+}

+ 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 provinceCode;
+
+    @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") List<String> dictCode,
+                               @Param("orderSmallId") List<String> orderSmallId,
+                               @Param("categoryId") List<String> categoryId,
+                               @Param("orderSourceId") List<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") List<String> dictCode,
+            @Param("orderSmallId") List<String> orderSmallId,
+            @Param("categoryId") List<String> categoryId,
+            @Param("orderSourceId") List<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") List<String> dictCode,
+                                 @Param("orderSmallId") List<String> orderSmallId,
+                                 @Param("categoryId") List<String> categoryId,
+                                 @Param("orderSourceId") List<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") List<String> dictCode,
+                               @Param("orderSmallId") List<String> orderSmallId,
+                               @Param("categoryId") List<String> categoryId,
+                               @Param("orderSourceId") List<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") List<String> dictCode,
+            @Param("orderSmallId") List<String> orderSmallId,
+            @Param("categoryId") List<String> categoryId,
+            @Param("orderSourceId") List<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") List<String> dictCode,
+                                     @Param("orderSmallId") List<String> orderSmallId,
+                                     @Param("categoryId") List<String> categoryId,
+                                     @Param("orderSourceId") List<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") List<String> dictCode,
+                                       @Param("orderSmallId") List<String> orderSmallId,
+                                       @Param("categoryId") List<String> categoryId,
+                                       @Param("orderSourceId") List<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") List<String> dictCode,
+            @Param("orderSmallId") List<String> orderSmallId,
+            @Param("categoryId") List<String> categoryId,
+            @Param("orderSourceId") List<String> orderSourceId,
+            @Param("adminCompanyIds") List<String> adminCompanyIds);
 }

+ 4 - 0
mall-server-api/src/main/java/com/gree/mall/manager/constant/SysDictConstant.java

@@ -10,6 +10,10 @@ public class SysDictConstant {
     //工单渠道
     public final static String ORDER_CHANNEL = "ORDER_CHANNEL";
 
+    //工单来源
+    public final static String ORDER_SOURCE = "WORKER_ORDER_SOURCE";
+
+
     // 维修日结
     public final static String REPAIR_DAILY = "REPAIR_DAILY";
 }

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

@@ -4,12 +4,12 @@ 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.utils.CommonUtils;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import io.swagger.annotations.Api;
@@ -18,10 +18,12 @@ import io.swagger.annotations.ApiParam;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.text.ParseException;
+import javax.validation.Valid;
+import java.io.IOException;
 import java.util.List;
 
 @Slf4j
@@ -36,17 +38,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 +61,180 @@ 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("/saveDispatch")
+    @ApiOperation(value = "自动派工街道配置-新增")
+    public ResponseHelper save(@Valid @RequestBody WebsitDispatchAdd websitDispatchAdd) {
+        changeOrderLogic.saveDispatch(websitDispatchAdd);
+        return ResponseHelper.success();
+    }
+
+    @PostMapping("/updateDispatch")
+    @ApiOperation(value = "自动派工街道配置-编辑")
+    public ResponseHelper updateDispatch(@Valid @RequestBody WebsitDispatch websitDispatch) {
+        changeOrderLogic.updateDispatch(websitDispatch);
+        return ResponseHelper.success();
+    }
+
+
+    @PostMapping("/detailDispatch")
+    @ApiOperation(value = "自动派工街道配置-详情")
+    public ResponseHelper<WebsitDispatch> detailDispatch(@ApiParam(value = "id", required = false) @RequestParam String id) {
+        WebsitDispatch websitDispatch = changeOrderLogic.detailDispatch(id);
+        return ResponseHelper.success(websitDispatch);
+    }
+
+
+    @PostMapping("/delDispatch")
+    @ApiOperation(value = "自动派工街道配置-删除")
+    public ResponseHelper delDispatch(@ApiParam(value = "id", required = false) @RequestParam List<String> id) {
+        changeOrderLogic.delDispatch(id);
+        return ResponseHelper.success();
+    }
+
+
+    @GetMapping("/download")
+    @ApiOperation("自动派工街道配置-下载")
+    public void download(HttpServletResponse response) throws IOException {
+        CommonUtils.downloadFile("自动派工配置.xlsx",response);
+    }
+
+
+    @PostMapping("/import")
+    @ApiOperation("自动派工街道配置-导入")
+    public ResponseHelper importData(@RequestParam MultipartFile file) throws IOException {
+        changeOrderLogic.importData(file);
+        return ResponseHelper.success();
+    }
+
+    @PostMapping("/pList")
+    @ApiOperation(value = "省")
+    public ResponseHelper<List<DispatchCherVO>> pList(
+            @RequestBody WebsitDispatchRe websitDispatchRe
+
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.pList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/cList")
+    @ApiOperation(value = "市")
+    public ResponseHelper<List<DispatchCherVO>> cList(
+            @RequestBody WebsitDispatchRe websitDispatchRe
+
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.cList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/aList")
+    @ApiOperation(value = "区")
+    public ResponseHelper<List<DispatchCherVO>> aList(
+            @RequestBody WebsitDispatchRe websitDispatchRe
+
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.aList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/sList")
+    @ApiOperation(value = "街道")
+    public ResponseHelper<List<DispatchCherVO>> sList(
+            @RequestBody WebsitDispatchRe websitDispatchRe
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.sList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+
+    @PostMapping("/channel")
+    @ApiOperation(value = "工单渠道")
+    public ResponseHelper<List<DispatchCherVO>> channel(
+            @RequestBody WebsitDispatchRe websitDispatchRe
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.channel(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/smallList")
+    @ApiOperation(value = "工单类型")
+    public ResponseHelper<List<DispatchCherVO>> smallList(
+            @RequestBody WebsitDispatchRe websitDispatchRe
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
+                .smallList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
+                        websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                        websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/categoryList")
+    @ApiOperation(value = "产品大类")
+    public ResponseHelper<List<DispatchCherVO>> categoryList(
+            @RequestBody WebsitDispatchRe websitDispatchRe
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
+                .categoryList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
+                        websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                        websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+        return ResponseHelper.success(dispatchCherVOS);
+    }
+
+    @PostMapping("/sourceList")
+    @ApiOperation(value = "工单来源")
+    public ResponseHelper sourceList(
+            @RequestBody WebsitDispatchRe websitDispatchRe
+    ) {
+        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
+                .sourceList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
+                        websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                        websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+        return ResponseHelper.success(dispatchCherVOS);
+    }
 
 
 }

+ 3 - 0
mall-server-api/src/main/java/com/gree/mall/manager/enums/workorder/OrderBaseStatusEnum.java

@@ -62,6 +62,9 @@ public enum OrderBaseStatusEnum implements BaseEnum {
     SQSHCL("SQSHCL","申请售后处理"),
     YGBGD("YGBGD","已关闭工单"),
     FGFZF("FGFZF","非广佛作废"),
+    YBCGD("YBCGD","已保存工单"),
+    DFWRYCL("DFWRYCL","待服务人员处理"),
+    YZFGD("YZFGD","已作废工单"),
     ;
 
     @EnumValue

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

@@ -6,18 +6,19 @@ 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.constant.SysDictConstant;
 import com.gree.mall.manager.enums.PayStatusEnum;
 import com.gree.mall.manager.enums.admin.AdminWebsitTypeEnum;
 import com.gree.mall.manager.enums.workorder.OrderBaseStatusEnum;
 import com.gree.mall.manager.enums.workorder.OrderOperatorLogTypeEnum;
+import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.logic.common.SysDictCompanyLogic;
 import com.gree.mall.manager.plus.entity.*;
 import com.gree.mall.manager.plus.service.*;
+import com.gree.mall.manager.utils.excel.ExcelUtils;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import lombok.RequiredArgsConstructor;
@@ -25,8 +26,10 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
 import org.thymeleaf.util.StringUtils;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -81,6 +84,28 @@ public class ChangeOrderLogic {
     @Autowired
     IncreMapper increMapper;
 
+    @Autowired
+    RegionService regionService;
+
+
+    @Autowired
+    SysDictCompanyService sysDictCompanyService;
+
+    @Autowired
+    OrderSmallTypeService orderSmallTypeService;
+
+    @Autowired
+    GoodsCategoryService goodsCategoryService;
+
+    @Autowired
+    WebsitDispatchService websitDispatchService;
+
+    @Autowired
+    SysDictCompanyLogic sysDictCompanyLogic;
+
+    @Autowired
+    OrderBaseLogic orderBaseLogic;
+
 
     @Transactional(rollbackFor = Exception.class)
     public void changeAppointmentTime(String id, String appointmentTime, String appointmentEndTime,String remark) {
@@ -253,4 +278,278 @@ 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, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<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,List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<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, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<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, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<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, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<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, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<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, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<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, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<String> orderSourceId) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        return increMapper.sourceList(pId,  cityCode,  areaCode,  streetCode,  dictCode,  orderSmallId,  categoryId, orderSourceId,adminCompanyIds);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void saveDispatch(WebsitDispatchAdd websitDispatchAdd) {
+        AdminWebsit adminWebsit = adminWebsitService.getById(websitDispatchAdd.getWebsitId());
+
+        Region region = regionService.getById(websitDispatchAdd.getStreetId());
+
+        List<WebsitDispatch> websitDispatches = new ArrayList<>();
+
+        for (String orderSmallId : websitDispatchAdd.getOrderSmallIds()) {
+
+            OrderSmallType orderSmallType = orderSmallTypeService.getById(orderSmallId);
+
+            for (String categoryId : websitDispatchAdd.getCategoryIds()) {
+
+                GoodsCategory goodsCategory = goodsCategoryService.getById(categoryId);
+
+                for (String orderChannel : websitDispatchAdd.getOrderChannelIds()) {
+
+                    SysDictCompany orderChanne = sysDictCompanyService.lambdaQuery().eq(SysDictCompany::getDictCode, orderChannel).last("limit 1").one();
+
+                    for (String orderSourceId : websitDispatchAdd.getOrderSourceIds()) {
+
+
+                        SysDictCompany orderSource = sysDictCompanyService.lambdaQuery().eq(SysDictCompany::getDictCode, orderSourceId).last("limit 1").one();
+
+                        WebsitDispatch websitDispatch = new WebsitDispatch();
+                        websitDispatch.setWebsitId(adminWebsit.getWebsitId());
+                        websitDispatch.setWebsitName(adminWebsit.getName());
+                        websitDispatch.setProvinceCode(region.getProvinceName());
+                        websitDispatch.setProvinceName(region.getProvinceCode());
+                        websitDispatch.setCityCode(region.getCityCode());
+                        websitDispatch.setCityName(region.getCityName());
+                        websitDispatch.setAreaCode(region.getAreaCode());
+                        websitDispatch.setAreaName(region.getAreaName());
+                        websitDispatch.setStreetCode(region.getId());
+                        websitDispatch.setStreetName(region.getName());
+
+
+                        websitDispatch.setOrderSmallTypeText(orderSmallType.getId());
+                        websitDispatch.setOrderSmallId(orderSmallType.getOrderSmallTypeText());
+
+                        websitDispatch.setCategoryId(goodsCategory.getCategoryId());
+                        websitDispatch.setCategoryName(goodsCategory.getName());
+
+                        websitDispatch.setDictCode(orderChanne.getDictCode());
+                        websitDispatch.setDictValue(orderChanne.getDictValue());
+
+                        websitDispatch.setOrderSource(orderSource.getDictValue());
+                        websitDispatch.setOrderSourceId(orderSource.getDictCode());
+
+                        if (websitDispatchService.lambdaQuery().eq(WebsitDispatch::getStreetCode,region.getId())
+                                .eq(WebsitDispatch::getOrderSmallId,websitDispatch.getOrderSmallId())
+                                .eq(WebsitDispatch::getCategoryId,websitDispatch.getCategoryId())
+                                .eq(WebsitDispatch::getDictCode,websitDispatch.getDictCode())
+                                .eq(WebsitDispatch::getOrderSourceId,websitDispatch.getOrderSourceId()).count() > 0) {
+                            throw new RemoteServiceException("存在街道:"+websitDispatch.getStreetName()+",产品大类:"+websitDispatch.getCategoryName()+
+                                    ",工单渠道:"+websitDispatch.getDictValue()+",工单来源:"+websitDispatch.getOrderSource()+",工单类型:"+websitDispatch.getOrderSmallTypeText());
+                        }
+
+                        websitDispatches.add(websitDispatch);
+
+                    }
+                }
+            }
+        }
+
+        websitDispatchService.saveBatch(websitDispatches);
+    }
+
+    public void delDispatch(List<String> id) {
+        websitDispatchService.removeByIds(id);
+    }
+
+
+
+    @Transactional(rollbackFor = Exception.class)
+    public void importData(MultipartFile file) throws IOException {
+
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        List<Object> rows = ExcelUtils.importExcel(file);
+        if(org.apache.commons.collections4.CollectionUtils.isEmpty(rows)){
+            throw new RemoteServiceException("导入内容为空");
+        }
+
+
+        //工单类型map
+        Map<String, OrderSmallType> orderSmallTypeMap = sysDictCompanyLogic.orderSmallTypeMap(adminUser.getCompanyWechatId());
+        //产品大类,小类map
+        List<GoodsCategory> goodsCategoryList = goodsCategoryService.lambdaQuery()
+                .eq(GoodsCategory::getCompanyWechatId, adminUser.getCompanyWechatId())
+                .eq(GoodsCategory::getType, 2).list();
+        Map<String, GoodsCategory> categoryMap1 = goodsCategoryList.stream().filter(v -> v.getLevel() == 1)
+                .collect(Collectors.toMap(GoodsCategory::getName, v -> v));
+
+        //工单渠道
+         Map<String, SysDictCompany> orderChannelMap = sysDictCompanyLogic.dictByTypeOfValue(SysDictConstant.ORDER_CHANNEL, adminUser.getCompanyWechatId());
+
+        //工单渠道
+        Map<String, SysDictCompany> orderSourceMap = sysDictCompanyLogic.dictByTypeOfValue(SysDictConstant.ORDER_SOURCE, adminUser.getCompanyWechatId());
+        //网点名称
+        Map<String, AdminWebsit> adminWebsitMap = adminWebsitService.lambdaQuery()
+                .eq(AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatId())
+                .in(adminUser.getType() == 0, AdminWebsit::getWebsitId, adminUser.getAdminWebsitIds())
+                .eq(AdminWebsit::getType, AdminWebsitTypeEnum.C.getKey())
+                .list().stream().collect(Collectors.toMap(AdminWebsit::getWebsitId, Function.identity()));
+
+        List<WebsitDispatch> websitDispatches = new ArrayList<>();
+        for(Object o : rows) {
+            List<Object> row = (List<Object>) o;
+
+            String websitName = (String)row.get(0);
+            String websitId = (String)row.get(1);
+            String pName = (String)row.get(2);
+            String cName = (String)row.get(3);
+            String aName = (String)row.get(4);
+            String sName = (String)row.get(5);
+            String channelName = (String)row.get(6);
+            String smallName = (String)row.get(7);
+            String categoryName = (String)row.get(8);
+            String sourceName = (String)row.get(9);
+
+            AdminWebsit adminWebsit = adminWebsitMap.get(websitId);
+
+            Region region = orderBaseLogic.getRegion(pName, cName, aName, sName);
+
+            SysDictCompany orderChanne = orderChannelMap.get(channelName);
+
+            GoodsCategory goodsCategory = categoryMap1.get(categoryName);
+
+            OrderSmallType orderSmallType = orderSmallTypeMap.get(smallName);
+
+            SysDictCompany orderSource = orderSourceMap.get(sourceName);
+
+            WebsitDispatch websitDispatch = new WebsitDispatch();
+            websitDispatch.setWebsitId(adminWebsit.getWebsitId());
+            websitDispatch.setWebsitName(adminWebsit.getName());
+            websitDispatch.setProvinceCode(region.getProvinceName());
+            websitDispatch.setProvinceName(region.getProvinceCode());
+            websitDispatch.setCityCode(region.getCityCode());
+            websitDispatch.setCityName(region.getCityName());
+            websitDispatch.setAreaCode(region.getAreaCode());
+            websitDispatch.setAreaName(region.getAreaName());
+            websitDispatch.setStreetCode(region.getId());
+            websitDispatch.setStreetName(region.getName());
+
+
+            websitDispatch.setOrderSmallTypeText(orderSmallType.getId());
+            websitDispatch.setOrderSmallId(orderSmallType.getOrderSmallTypeText());
+
+            websitDispatch.setCategoryId(goodsCategory.getCategoryId());
+            websitDispatch.setCategoryName(goodsCategory.getName());
+
+            websitDispatch.setDictCode(orderChanne.getDictCode());
+            websitDispatch.setDictValue(orderChanne.getDictValue());
+
+            websitDispatch.setOrderSource(orderSource.getDictValue());
+            websitDispatch.setOrderSourceId(orderSource.getDictCode());
+
+            if (websitDispatchService.lambdaQuery().eq(WebsitDispatch::getStreetCode,region.getId())
+                    .eq(WebsitDispatch::getOrderSmallId,websitDispatch.getOrderSmallId())
+                    .eq(WebsitDispatch::getCategoryId,websitDispatch.getCategoryId())
+                    .eq(WebsitDispatch::getDictCode,websitDispatch.getDictCode())
+                    .eq(WebsitDispatch::getOrderSourceId,websitDispatch.getOrderSourceId()).count() > 0) {
+                throw new RemoteServiceException("存在街道:"+websitDispatch.getStreetName()+",产品大类:"+websitDispatch.getCategoryName()+
+                        ",工单渠道:"+websitDispatch.getDictValue()+",工单来源:"+websitDispatch.getOrderSource()+",工单类型:"+websitDispatch.getOrderSmallTypeText());
+            }
+
+            websitDispatches.add(websitDispatch);
+
+        }
+
+        websitDispatchService.saveBatch(websitDispatches);
+
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void updateDispatch(WebsitDispatch websitDispatch) {
+
+        if (websitDispatchService.lambdaQuery().eq(WebsitDispatch::getStreetCode,websitDispatch.getStreetCode())
+                .eq(WebsitDispatch::getOrderSmallId,websitDispatch.getOrderSmallId())
+                .eq(WebsitDispatch::getCategoryId,websitDispatch.getCategoryId())
+                .eq(WebsitDispatch::getDictCode,websitDispatch.getDictCode())
+                .ne(WebsitDispatch::getId,websitDispatch.getId())
+                .eq(WebsitDispatch::getOrderSourceId,websitDispatch.getOrderSourceId()).count() > 0) {
+            throw new RemoteServiceException("存在街道:"+websitDispatch.getStreetName()+",产品大类:"+websitDispatch.getCategoryName()+
+                    ",工单渠道:"+websitDispatch.getDictValue()+",工单来源:"+websitDispatch.getOrderSource()+",工单类型:"+websitDispatch.getOrderSmallTypeText());
+        }
+
+        websitDispatch.updateById();
+
+    }
+
+    public WebsitDispatch detailDispatch(String id) {
+
+        return websitDispatchService.getById(id);
+    }
 }

+ 643 - 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,651 @@
                 #{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.size > 0">
+            AND b.dict_code IN
+            <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSmallId != null and orderSmallId.size > 0">
+            AND c.id in
+            <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="categoryId != null and categoryId.size > 0">
+            AND d.category_id in
+            <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSourceId != null and orderSourceId.size > 0">
+            AND e.dict_code in
+            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </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.size > 0">
+            AND b.dict_code IN
+            <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSmallId != null and orderSmallId.size > 0">
+            AND c.id in
+            <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="categoryId != null and categoryId.size > 0">
+            AND d.category_id in
+            <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSourceId != null and orderSourceId.size > 0">
+            AND e.dict_code in
+            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </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.size > 0">
+            AND b.dict_code IN
+            <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSmallId != null and orderSmallId.size > 0">
+            AND c.id in
+            <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="categoryId != null and categoryId.size > 0">
+            AND d.category_id in
+            <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSourceId != null and orderSourceId.size > 0">
+            AND e.dict_code in
+            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </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.size > 0">
+            AND b.dict_code IN
+            <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSmallId != null and orderSmallId.size > 0">
+            AND c.id in
+            <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="categoryId != null and categoryId.size > 0">
+            AND d.category_id in
+            <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSourceId != null and orderSourceId.size > 0">
+            AND e.dict_code in
+            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </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.size > 0">
+            AND b.dict_code IN
+            <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSmallId != null and orderSmallId.size > 0">
+            AND c.id in
+            <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="categoryId != null and categoryId.size > 0">
+            AND d.category_id in
+            <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSourceId != null and orderSourceId.size > 0">
+            AND e.dict_code in
+            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </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.size > 0">
+            AND b.dict_code IN
+            <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSmallId != null and orderSmallId.size > 0">
+            AND c.id in
+            <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="categoryId != null and categoryId.size > 0">
+            AND d.category_id in
+            <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSourceId != null and orderSourceId.size > 0">
+            AND e.dict_code in
+            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </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.size > 0">
+            AND b.dict_code IN
+            <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSmallId != null and orderSmallId.size > 0">
+            AND c.id in
+            <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="categoryId != null and categoryId.size > 0">
+            AND d.category_id in
+            <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSourceId != null and orderSourceId.size > 0">
+            AND e.dict_code in
+            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </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.size > 0">
+            AND b.dict_code IN
+            <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSmallId != null and orderSmallId.size > 0">
+            AND c.id in
+            <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="categoryId != null and categoryId.size > 0">
+            AND d.category_id in
+            <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderSourceId != null and orderSourceId.size > 0">
+            AND e.dict_code in
+            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
 
+        group by  e.dict_code
     </select>
 </mapper>

二進制
mall-server-api/src/main/resources/template/自动派工配置.xlsx