Browse Source

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

FengChaoYu 8 months ago
parent
commit
da499bf1d3

+ 18 - 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="服务单标识")
@@ -132,6 +132,9 @@ public class OrderBaseVO    {
     @ZfireField(isShow = false,isQuery = true)
     private String rpProjectRepairId;
 
+    @ApiModelProperty(value = "创建网点编号")
+    private String createWebsitId;
+
 
     @ApiModelProperty("创建网点")
     private String createWebsitName;
@@ -199,4 +202,18 @@ public class OrderBaseVO    {
     @ApiModelProperty(value = "是否是工单3.0同步true/false")
     private Boolean isThreeOrder;
 
+
+    @ApiModelProperty(value = "故障类型")
+    private String troubleValue;
+
+    @ApiModelProperty(value = "需求类别")
+    private String type;
+
+    @ApiModelProperty(value = "需求小类")
+    private String smallType;
+
+    @ApiModelProperty(value = "评价时间")
+    private Date appraiseTime;
+
+
 }

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

@@ -66,7 +66,7 @@ public class DispatchVO {
     @ApiModelProperty(value = "工单类型id")
     private String orderSmallId;
 
-    @ZfireField(tbName = "d")
+    @ZfireField(tbName = "d",colName = "name")
     @ApiModelProperty(value = "产品大类")
     private String categoryName;
 
@@ -75,7 +75,7 @@ public class DispatchVO {
     private String categoryId;
 
 
-    @ZfireField(tbName = "e")
+    @ZfireField(tbName = "e",colName = "dict_value")
     @ApiModelProperty(value = "工单来源")
     private String orderSource;
 

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

@@ -15,7 +15,7 @@ public class WebsitDispatchAdd {
 
 
     @ApiModelProperty(value = "街道id")
-    private String streetId;
+    private String streetCode;
 
     @ApiModelProperty(value = "工单渠道")
     private List<String> orderChannelIds;

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

@@ -14,7 +14,7 @@ import java.util.Date;
 
 @Data
 @ApiModel
-public class WebsitDispatchVO   {
+public class WebsitDispatchVO    {
 
     @ZfireField(hide = true)
     @TableId(value = "id", type = IdType.ID_WORKER_STR)
@@ -84,8 +84,9 @@ public class WebsitDispatchVO   {
     @TableField(fill = FieldFill.INSERT)
     private String createBy;
 
-    @ApiModelProperty(value = "创建人名称")
-    private String createName;
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
 
     @ApiModelProperty(value = "修改时间")
     @TableField(fill = FieldFill.INSERT_UPDATE)

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

@@ -146,7 +146,7 @@ public class DispatchController {
 
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.pList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
                 websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
         return ResponseHelper.success(dispatchCherVOS);
     }
@@ -158,7 +158,7 @@ public class DispatchController {
 
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.cList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
                 websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
         return ResponseHelper.success(dispatchCherVOS);
     }
@@ -170,7 +170,7 @@ public class DispatchController {
 
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.aList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
                 websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
         return ResponseHelper.success(dispatchCherVOS);
     }
@@ -181,7 +181,7 @@ public class DispatchController {
             @RequestBody WebsitDispatchRe websitDispatchRe
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.sList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
                 websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
         return ResponseHelper.success(dispatchCherVOS);
     }
@@ -193,7 +193,7 @@ public class DispatchController {
             @RequestBody WebsitDispatchRe websitDispatchRe
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.channel(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
                 websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
 
         return ResponseHelper.success(dispatchCherVOS);
@@ -206,7 +206,7 @@ public class DispatchController {
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
                 .smallList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                        websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                        websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
                         websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
 
         return ResponseHelper.success(dispatchCherVOS);
@@ -219,7 +219,7 @@ public class DispatchController {
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
                 .categoryList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                        websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                        websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
                         websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
         return ResponseHelper.success(dispatchCherVOS);
     }
@@ -231,7 +231,7 @@ public class DispatchController {
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
                 .sourceList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                        websitDispatchRe.getAreaCode(), websitDispatchRe.getProvinceCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
+                        websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
                         websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
         return ResponseHelper.success(dispatchCherVOS);
     }

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

@@ -281,6 +281,10 @@ public class ChangeOrderLogic {
 
     @Transactional(rollbackFor = Exception.class)
     public void saveOrder(WebsitDispatch websitDispatch) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        websitDispatch.setCompanyWechatId(adminUser.getCompanyWechatId());
+        websitDispatch.setCompanyWechatName(adminUser.getCompanyName());
         websitDispatch.insert();
     }
 
@@ -359,7 +363,7 @@ public class ChangeOrderLogic {
     public void saveDispatch(WebsitDispatchAdd websitDispatchAdd) {
         AdminWebsit adminWebsit = adminWebsitService.getById(websitDispatchAdd.getWebsitId());
 
-        Region region = regionService.getById(websitDispatchAdd.getStreetId());
+        Region region = regionService.getById(websitDispatchAdd.getStreetCode());
 
         List<WebsitDispatch> websitDispatches = new ArrayList<>();
 
@@ -383,18 +387,20 @@ public class ChangeOrderLogic {
                         WebsitDispatch websitDispatch = new WebsitDispatch();
                         websitDispatch.setWebsitId(adminWebsit.getWebsitId());
                         websitDispatch.setWebsitName(adminWebsit.getName());
-                        websitDispatch.setProvinceCode(region.getProvinceName());
-                        websitDispatch.setProvinceName(region.getProvinceCode());
+                        websitDispatch.setProvinceCode(region.getProvinceCode());
+                        websitDispatch.setProvinceName(region.getProvinceName());
                         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.setCompanyWechatId(adminWebsit.getCompanyWechatId());
+                        websitDispatch.setCompanyWechatName(adminWebsit.getCompanyWechatName());
 
 
-                        websitDispatch.setOrderSmallTypeText(orderSmallType.getId());
-                        websitDispatch.setOrderSmallId(orderSmallType.getOrderSmallTypeText());
+                        websitDispatch.setOrderSmallTypeText(orderSmallType.getOrderSmallTypeText());
+                        websitDispatch.setOrderSmallId(orderSmallType.getId());
 
                         websitDispatch.setCategoryId(goodsCategory.getCategoryId());
                         websitDispatch.setCategoryName(goodsCategory.getName());
@@ -492,18 +498,20 @@ public class ChangeOrderLogic {
             WebsitDispatch websitDispatch = new WebsitDispatch();
             websitDispatch.setWebsitId(adminWebsit.getWebsitId());
             websitDispatch.setWebsitName(adminWebsit.getName());
-            websitDispatch.setProvinceCode(region.getProvinceName());
-            websitDispatch.setProvinceName(region.getProvinceCode());
+            websitDispatch.setProvinceCode(region.getProvinceCode());
+            websitDispatch.setProvinceName(region.getProvinceName());
             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.setCompanyWechatId(adminUser.getCompanyWechatId());
+            websitDispatch.setCompanyWechatName(adminUser.getCompanyName());
 
 
-            websitDispatch.setOrderSmallTypeText(orderSmallType.getId());
-            websitDispatch.setOrderSmallId(orderSmallType.getOrderSmallTypeText());
+            websitDispatch.setOrderSmallTypeText(orderSmallType.getOrderSmallTypeText());
+            websitDispatch.setOrderSmallId(orderSmallType.getId());
 
             websitDispatch.setCategoryId(goodsCategory.getCategoryId());
             websitDispatch.setCategoryName(goodsCategory.getName());

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

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.google.common.collect.Lists;
 import com.gree.mall.manager.bean.SyncOrderDto;
 import com.gree.mall.manager.bean.admin.AdminUserCom;
@@ -1312,13 +1313,30 @@ public class OrderBaseExcelLogic {
                 pgOrderBase.setAreaId(region.getAreaCode());
                 pgOrderBase.setStreetId(region.getId());
 
+            }else {
+                Region one = regionService.lambdaQuery()
+                        .like(Region::getProvinceName, pgOrderBase.getProvince()).eq(Region::getCityName, pgOrderBase.getCity()).eq(Region::getAreaName, pgOrderBase.getArea())
+                        .eq(Region::getLevel, 3).one();
+
+                pgOrderBase.setProvinceId(region.getProvinceCode());
+                pgOrderBase.setCityId(region.getCityCode());
+                pgOrderBase.setAreaId(region.getAreaCode());
+
+                one.setId(IdWorker.getIdStr());
+                one.setStreetCode(one.getId());
+                one.setName(pgOrderBase.getStreet());
+                one.setLevel(4);
+                one.insert();
+
+
+                pgOrderBase.setStreetId(one.getId());
+
+
             }
             pgOrderBase.setIsThreeOrder(true);
         }
 
-        for (PgOrderOperatorLog pgOrderOperatorLog : syncOrderDto.getPgOrderOperatorLogs()) {
-            pgOrderOperatorLog.setIsThreeOrder(true);
-        }
+
 
 
         pgOrderBaseService.saveBatch(syncOrderDto.getPgOrderBases());
@@ -1327,7 +1345,14 @@ public class OrderBaseExcelLogic {
 
         pgOrderProductService.saveBatch(syncOrderDto.getOrderProducts());
 
-        pgOrderOperatorLogService.saveBatch(syncOrderDto.getPgOrderOperatorLogs());
+
+        if (!CollectionUtils.isEmpty(syncOrderDto.getPgOrderOperatorLogs())) {
+            for (PgOrderOperatorLog pgOrderOperatorLog : syncOrderDto.getPgOrderOperatorLogs()) {
+                pgOrderOperatorLog.setIsThreeOrder(true);
+            }
+
+            pgOrderOperatorLogService.saveBatch(syncOrderDto.getPgOrderOperatorLogs());
+        }
 
     }
 

+ 122 - 50
mall-server-api/src/main/resources/mapper/workorder/IncreMapper.xml

@@ -39,7 +39,7 @@
         e.dict_code as order_source_id
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -60,17 +60,25 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
         <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>
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND f.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         ${ex.query}
         and
         a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
         AND a.`level` = 4
+        and f.id is null
 
 
     </select>
@@ -96,7 +104,7 @@
         a.province_code as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -117,29 +125,37 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
         <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>
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND f.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
+        and f.id is null
 
         <if test="pId != null and pId !=''">
-            AND a.pid == #{pId}
+            AND a.province_code = #{pId}
         </if>
         <if test="cityCode != null and cityCode !=''">
-            AND a.city_code == #{cityCode}
+            AND a.city_code = #{cityCode}
         </if>
         <if test="areaCode != null and areaCode !=''">
-            AND a.area_code == #{areaCode}
+            AND a.area_code = #{areaCode}
         </if>
         <if test="streetCode != null and streetCode !=''">
-            AND a.id ==  #{streetCode}
+            AND a.id =  #{streetCode}
         </if>
         <if test="dictCode != null and dictCode.size > 0">
             AND b.dict_code IN
@@ -174,7 +190,7 @@
         a.city_code as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -195,29 +211,37 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
         <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>
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND f.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
+        and f.id is null
 
         <if test="pId != null and pId !=''">
-            AND a.pid == #{pId}
+            AND a.province_code = #{pId}
         </if>
         <if test="cityCode != null and cityCode !=''">
-            AND a.city_code == #{cityCode}
+            AND a.city_code = #{cityCode}
         </if>
         <if test="areaCode != null and areaCode !=''">
-            AND a.area_code == #{areaCode}
+            AND a.area_code = #{areaCode}
         </if>
         <if test="streetCode != null and streetCode !=''">
-            AND a.id ==  #{streetCode}
+            AND a.id =  #{streetCode}
         </if>
         <if test="dictCode != null and dictCode.size > 0">
             AND b.dict_code IN
@@ -252,7 +276,7 @@
         a.area_code as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -273,29 +297,37 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
         <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>
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND f.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
+        and f.id is null
 
         <if test="pId != null and pId !=''">
-            AND a.pid == #{pId}
+            AND a.province_code = #{pId}
         </if>
         <if test="cityCode != null and cityCode !=''">
-            AND a.city_code == #{cityCode}
+            AND a.city_code = #{cityCode}
         </if>
         <if test="areaCode != null and areaCode !=''">
-            AND a.area_code == #{areaCode}
+            AND a.area_code = #{areaCode}
         </if>
         <if test="streetCode != null and streetCode !=''">
-            AND a.id ==  #{streetCode}
+            AND a.id =  #{streetCode}
         </if>
         <if test="dictCode != null and dictCode.size > 0">
             AND b.dict_code IN
@@ -330,7 +362,7 @@
         a.id as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -351,29 +383,37 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
         <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>
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND f.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
+        and f.id is null
 
         <if test="pId != null and pId !=''">
-            AND a.pid == #{pId}
+            AND a.province_code = #{pId}
         </if>
         <if test="cityCode != null and cityCode !=''">
-            AND a.city_code == #{cityCode}
+            AND a.city_code = #{cityCode}
         </if>
         <if test="areaCode != null and areaCode !=''">
-            AND a.area_code == #{areaCode}
+            AND a.area_code = #{areaCode}
         </if>
         <if test="streetCode != null and streetCode !=''">
-            AND a.id ==  #{streetCode}
+            AND a.id =  #{streetCode}
         </if>
         <if test="dictCode != null and dictCode.size > 0">
             AND b.dict_code IN
@@ -408,7 +448,7 @@
         b.dict_code as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -429,29 +469,37 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
         <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>
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND f.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
+        and f.id is null
 
         <if test="pId != null and pId !=''">
-            AND a.pid == #{pId}
+            AND a.province_code = #{pId}
         </if>
         <if test="cityCode != null and cityCode !=''">
-            AND a.city_code == #{cityCode}
+            AND a.city_code = #{cityCode}
         </if>
         <if test="areaCode != null and areaCode !=''">
-            AND a.area_code == #{areaCode}
+            AND a.area_code = #{areaCode}
         </if>
         <if test="streetCode != null and streetCode !=''">
-            AND a.id ==  #{streetCode}
+            AND a.id =  #{streetCode}
         </if>
         <if test="dictCode != null and dictCode.size > 0">
             AND b.dict_code IN
@@ -486,7 +534,7 @@
         c.id as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -507,29 +555,37 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
         <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>
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND f.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
+        and f.id is null
 
         <if test="pId != null and pId !=''">
-            AND a.pid == #{pId}
+            AND a.province_code = #{pId}
         </if>
         <if test="cityCode != null and cityCode !=''">
-            AND a.city_code == #{cityCode}
+            AND a.city_code = #{cityCode}
         </if>
         <if test="areaCode != null and areaCode !=''">
-            AND a.area_code == #{areaCode}
+            AND a.area_code = #{areaCode}
         </if>
         <if test="streetCode != null and streetCode !=''">
-            AND a.id ==  #{streetCode}
+            AND a.id =  #{streetCode}
         </if>
         <if test="dictCode != null and dictCode.size > 0">
             AND b.dict_code IN
@@ -564,7 +620,7 @@
         d.category_id as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -585,29 +641,37 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
         <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>
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND f.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
+        and f.id is null
 
         <if test="pId != null and pId !=''">
-            AND a.pid == #{pId}
+            AND a.province_code = #{pId}
         </if>
         <if test="cityCode != null and cityCode !=''">
-            AND a.city_code == #{cityCode}
+            AND a.city_code = #{cityCode}
         </if>
         <if test="areaCode != null and areaCode !=''">
-            AND a.area_code == #{areaCode}
+            AND a.area_code = #{areaCode}
         </if>
         <if test="streetCode != null and streetCode !=''">
-            AND a.id ==  #{streetCode}
+            AND a.id =  #{streetCode}
         </if>
         <if test="dictCode != null and dictCode.size > 0">
             AND b.dict_code IN
@@ -642,7 +706,7 @@
         e.dict_code as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -663,29 +727,37 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
+        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
         <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>
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND f.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
+        and f.id is null
 
         <if test="pId != null and pId !=''">
-            AND a.pid == #{pId}
+            AND a.province_code = #{pId}
         </if>
         <if test="cityCode != null and cityCode !=''">
-            AND a.city_code == #{cityCode}
+            AND a.city_code = #{cityCode}
         </if>
         <if test="areaCode != null and areaCode !=''">
-            AND a.area_code == #{areaCode}
+            AND a.area_code = #{areaCode}
         </if>
         <if test="streetCode != null and streetCode !=''">
-            AND a.id ==  #{streetCode}
+            AND a.id =  #{streetCode}
         </if>
         <if test="dictCode != null and dictCode.size > 0">
             AND b.dict_code IN