‘linchangsheng’ il y a 5 mois
Parent
commit
2b1682de5b

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

@@ -17,7 +17,8 @@ public interface IncreMapper {
     IPage<IncreVO> list(IPage page, @Param("ex") ZfireParamBean zfireParam, @Param("adminCompanyIds") List<String> adminCompanyIds);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
-    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,
+                                   @Param("codeList") List<String> codeList);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
     IPage<WebsitDispatchVO> listDispatchWebsit(Page page, @Param("ex") ZfireParamBean zfireParamBean, @Param("adminCompanyIds") List<String> adminCompanyIds);

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

@@ -274,7 +274,18 @@ public class ChangeOrderLogic {
         //1.组装查询条件
         zfireParam = FieldUtils.supplyParam(zfireParam, DispatchVO.class);
 
-        IPage<DispatchVO> dispatchVOIPage = increMapper.listDispatch(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam,adminCompanyIds);
+        List<WebsitDispatch> websitDispatches = websitDispatchService.lambdaQuery().eq(WebsitDispatch::getCompanyWechatId, adminUser.getCompanyWechatId())
+                .select(WebsitDispatch::getStreetCode, WebsitDispatch::getDictCode, WebsitDispatch::getOrderSmallId,
+                        WebsitDispatch::getCategoryId, WebsitDispatch::getOrderSourceId)
+                .list();
+
+        List<String> codeList = new ArrayList<>();
+        for (WebsitDispatch websitDispatch : websitDispatches) {
+            codeList.add(websitDispatch.getStreetCode()+websitDispatch.getDictCode()+websitDispatch.getOrderSmallId()
+            +websitDispatch.getCategoryId()+websitDispatch.getOrderSourceId());
+        }
+
+        IPage<DispatchVO> dispatchVOIPage = increMapper.listDispatch(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam,adminCompanyIds,codeList);
 
         return dispatchVOIPage;
 

+ 8 - 11
mall-server-api/src/main/resources/mapper/workorder/IncreMapper.xml

@@ -39,7 +39,9 @@
         e.dict_code as order_source_id
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
+        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0     and
+        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
+        AND a.`level` = 4
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -67,19 +69,14 @@
                 #{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=")">
+        ${ex.query}
+
+        <if test="codeList != null and codeList.size > 0">
+            AND CONCAT(a.id,b.dict_code,c.id,d.category_id,e.dict_code) not In
+            <foreach item="item" index="index" collection="codeList" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
-        ${ex.query}
-        and
-        a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
-        AND a.`level` = 4
-        and f.id is null
-
 
     </select>
     <select id="listDispatchWebsit" resultType="com.gree.mall.manager.bean.workorder.WebsitDispatchVO">