yaozhixue 1 سال پیش
والد
کامیت
fe69f23838

+ 77 - 25
src/main/java/com/zfire/jiasm/syncdata/download/order/InstallBusiness.java

@@ -87,6 +87,7 @@ public class InstallBusiness {
 
 
 
+
     // 3:工单落入本地表
     @Scheduled(fixedDelay = 1 * 5 * 1000)
     public void inputOrderInstall() {
@@ -187,12 +188,12 @@ public class InstallBusiness {
                 .eq(OrderBase::getPgguid, item.getPgguid()).one();
 
         // 获取安装工单主表
-        OrderBase newLCLS = getAddOrderBase(item, brand);
-        // 这里一定不能少
+        OrderBase newLCLS = getAddOrderBaseUp(item, brand);
+        // 这里一定不能少 已生成了工单号,不能再次生成
         newLCLS.setId(old.getId());
         newLCLS.setDispatchStatus(old.getDispatchStatus());
 
-        // 获取工单主表要同步的数据
+        // 获取工单主表要同步的数据  upInfo 为null todo
         OrderBase upInfo = getOrderBaseUp(old, item, newLCLS, brand);
 
         // 以旧换新数据下载同步表
@@ -674,9 +675,9 @@ public class InstallBusiness {
             }
         }
         // 2:网点信息修改 已待服务人员处理,不允更新网点   6,7,10 少6
-        if (old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode()) ||
+        if (!(old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode()) ||
                 old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode()) ||
-                old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode())){
+                old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()))){
             // 售后网点
             upInfo.setReceWebsitId(old.getReceWebsitId());
             upInfo.setReceWebsitName(old.getReceWebsitName());
@@ -692,30 +693,27 @@ public class InstallBusiness {
         // 已预约过 退回查询处理
         if (ora != null){
             upInfo.setAppointmentTime(old.getAppointmentTime());
-            upInfo.setExpectStartTime(old.getExpectStartTime());
-            upInfo.setExpectEndTime(old.getExpectEndTime());
+            upInfo.setAppointmentEndTime(old.getAppointmentEndTime());
         }
 
-        // 3.2天猫工单,允许天猫自已预约 查询中已做处理,这里无需操作
-        /*
-        OrderInstall oi = orderInstallService.lambdaQuery()
-                .eq(OrderInstall::getOrderBaseId,old.getId()).one();
-        if (oi !=null && StringUtils.isNotEmpty(oi.getExtendField2()) &&
-                oi.getExtendField2().equals("TBL_TMALL_ORDERINFO")){
-            upInfo.setAppointmentTime(newLCLS.getAppointmentTime());
-        }
-        */
+        // 3.2天猫工单,允许天猫自已预约
+        upYyazsj(old, item, upInfo);
 
         // 4:工单状态
         Boolean allowUpdate = getAllowUpdate(old, newLCLS);
-        if (allowUpdate && item.getLastModifiedDate().compareTo(old.getUpdateTime())>0){
-            upInfo.setOrderStatus(newLCLS.getOrderStatus());
-            upInfo.setOrderStatus(newLCLS.getOrderStatus());
-            upInfo.setOrderStatus(newLCLS.getOrderStatus());
-
-
+        // 不可修改退回去
+        if (!(allowUpdate && item.getLastModifiedDate().compareTo(old.getUpdateTime())>0)){
+            upInfo.setOrderStatus(old.getOrderStatus());
+            upInfo.setOrderStatusTime(old.getOrderStatusTime());
+            upInfo.setLastOrderStatus(old.getLastOrderStatus());
+            upInfo.setDispatchStatus(old.getDispatchStatus());
+            upInfo.setDispatchTime(old.getDispatchTime());
+        }
 
-            // upInfo.setDispatchStatus("DJS");
+        // 5.预派工标志更新 -IsReservation
+        if (old.getIsReservation().equals(1) &&
+                (item.getSfwcps().equals("已配送") ||(!upInfo.getIsReservation().equals(1)))){
+            upInfo.setIsReservation(0);
         }
 
         upInfo.setId(old.getId());
@@ -725,6 +723,32 @@ public class InstallBusiness {
         return upInfo;
     }
 
+    private void upYyazsj(OrderBase old, ItfTblAzAssignLcLsDownload item, OrderBase upInfo) {
+        Boolean flag = Boolean.TRUE;
+        // 1是天猫工单,2预约时间不相同
+        if (upInfo.getExternalName2().equals("TBL_TMALL_ORDERINFO")){
+            if (item.getYyazsj() !=null){
+                if (old.getAppointmentTime().compareTo(upInfo.getAppointmentTime()) !=0){
+                    if (old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G2_0.getCode()) ||
+                            old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G2_1.getCode()) ||
+                            old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G3.getCode()) ||
+                            old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G4_0.getCode()) ||
+                            old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G4_1.getCode()) ||
+                            old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G5.getCode()) ||
+                            old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode())){
+                        // 要改
+                        flag = Boolean.FALSE;
+                    }
+                }
+            }
+            // 不需要改退回
+            if (flag){
+                upInfo.setAppointmentTime(old.getAppointmentTime());
+                upInfo.setAppointmentEndTime(old.getAppointmentEndTime());
+            }
+        }
+    }
+
 
     private void synItfTblAzAssignLcLsDownload(Long synReqId, Integer synStatus, String msg){
         ItfTblAzAssignLcLsDownload uplcls = new ItfTblAzAssignLcLsDownload();
@@ -866,8 +890,19 @@ public class InstallBusiness {
                 .list();
         synReqFkMxIds = fkmxs.stream().map(ItfTblAzAssignFkmxDownload::getSynReqId).collect(Collectors.toList());
 
+        // 分销商城订单 这里不再判断
+        /*if (item.getShopno().equals("88888888")){
+            ItfFxInstallReq itfFxInstallReq=itfFxInstallReqService.lambdaQuery()
+                    .eq(ItfFxInstallReq::getPgguid,item.getPgguid()).one();
+            if (itfFxInstallReq==null){
+                synItfTblAzAssignLcLsDownload(item.getSynReqId(), 99, "分销商城订单生成失败(itf_fx_install_req pgguid="+item.getPgguid());
+                return;
+            }
+        }*/
+
         // 获取安装工单主表
         OrderBase orderBase = getAddOrderBase(item, brand);
+
         // 以旧换新数据下载同步表
         getOldForNewProduct(item, orderBase,its);
 
@@ -971,7 +1006,6 @@ public class InstallBusiness {
         if (orderBase != null) {
             orderBaseService.save(orderBase);
         }
-        upItfTblAzAssignLcLsDownload(synReqId);
 
         // 工单师傅表
         if (orderWorker != null) {
@@ -1040,11 +1074,14 @@ public class InstallBusiness {
             its.clear();
         }
 
-        // 修改同步状态
+        // 客户评价信息
         if (getpjSynReqId.size()>0){
             upItfTblAzAssignSatisfactionDownload(getpjSynReqId);
             getpjSynReqId.clear();
         }
+
+        // 修改同步状态
+        upItfTblAzAssignLcLsDownload(synReqId);
     }
 
     private void upItfTblAzAssignFeeDownload(List<ItfTblAzAssignFeeDownload> fyqd) {
@@ -1520,8 +1557,10 @@ public class InstallBusiness {
 
         // 生成工单基础表 对象
         orderBase = azGDLcLsDownloadMapper.getOrderBase(orderPar);
+        orderBase.setId("33"+IdWorker.getIdStr());
         // 总部下来的工单新增时统一为待接收状态
         orderBase.setDispatchStatus("DJS");
+
         //  预派工订单标识
         if (orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1100.getCode()) ||
                 orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1122.getCode()) ||
@@ -1533,4 +1572,17 @@ public class InstallBusiness {
 
         return orderBase;
     }
+
+    private OrderBase getAddOrderBaseUp(ItfTblAzAssignLcLsDownload item, Brand brand) {
+        OrderBase orderBase = new OrderBase();
+        OrderPar orderPar = new OrderPar();
+        orderPar.setSynReqId(item.getSynReqId());
+        orderPar.setBrandId(brand.getBrandId());
+        // 生成工单基础表 对象
+        orderBase = azGDLcLsDownloadMapper.getOrderBase(orderPar);
+        // 重置部分数据
+        orderService.setParUp(item, orderBase);
+
+        return orderBase;
+    }
 }

+ 2 - 0
src/main/java/com/zfire/jiasm/syncdata/download/order/RepairBusiness.java

@@ -1,6 +1,7 @@
 package com.zfire.jiasm.syncdata.download.order;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.zfire.jiasm.syncdata.base.BaseService;
 import com.zfire.jiasm.syncdata.constant.DictTypeEnum;
@@ -1495,6 +1496,7 @@ public class RepairBusiness {
         orderPar.setSynReqId(item.getSynReqId());
         orderPar.setBrandId(brand.getBrandId());
         OrderBase order = repairDownloadMapper.getOrderBase(orderPar);
+        order.setId("77"+ IdWorker.getIdStr());
         if (isChildInfo){
             order.setIsChildInfo("YES");
         }

+ 1 - 0
src/main/java/com/zfire/jiasm/syncdata/service/OrderService.java

@@ -12,6 +12,7 @@ import com.zfire.jiasm.syncdata.plus.entity.*;
 public interface OrderService extends IService<OrderBase> {
 
     void setPar(ItfTblAzAssignLcLsDownload item, OrderBase orderBase);
+    void setParUp(ItfTblAzAssignLcLsDownload item, OrderBase orderBase);
 
     void setParame(Brand brand, OrderBase orderBase, ItfTblAssignDownload item);
 

+ 181 - 1
src/main/java/com/zfire/jiasm/syncdata/service/impl/OrderServiceImpl.java

@@ -1,18 +1,27 @@
 package com.zfire.jiasm.syncdata.service.impl;
 
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zfire.jiasm.syncdata.constant.GDOrderStatusEnum;
+import com.zfire.jiasm.syncdata.constant.OrderStatusEnum;
 import com.zfire.jiasm.syncdata.plus.entity.*;
 import com.zfire.jiasm.syncdata.plus.mapper.OrderBaseMapper;
 import com.zfire.jiasm.syncdata.plus.service.*;
 import com.zfire.jiasm.syncdata.response.WebsitFWS;
+import com.zfire.jiasm.syncdata.response.WebsitSH;
 import com.zfire.jiasm.syncdata.service.OrderService;
 import com.zfire.jiasm.syncdata.service.PublicService;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -25,6 +34,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderBaseMapper, OrderBase> im
     AreaService areaService;
     @Resource
     PublicService publicService;
+    @Resource
+    OrderBaseService orderBaseService;
+    @Resource
+    OrderInstallDetailService orderInstallDetailService;
+    @Resource
+    OrderApplyDispatchService orderApplyDispatchService;
 
 
     @Override
@@ -87,7 +102,172 @@ public class OrderServiceImpl extends ServiceImpl<OrderBaseMapper, OrderBase> im
             }
         }
 
-        // 分销商城订单需要写日志表 20230531 todo 下面还有其他的处理
+        // 接收派工网点为中心且当前节点是1129或1301,更新为2待分部派工
+        if ((item.getJspgwdno().equals("S9219801") || item.getJspgwdno().equals("S9219807")) &&
+                (orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1129.getCode()) ||
+                        orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1301.getCode()))){
+            orderBase.setOrderStatus(GDOrderStatusEnum.INSTALL_STATUS_G2_0.getCode());
+        }
+        // 分销商城订单需要写日志表这里不再处理
+
+        // 省市区单独处理
+        shPositionTopt(orderBase);
+        // 派工方式,新创建订单时 azren 名称不为空时为手动派工  (dispatch_flag派工方式 A=自动派工 B=手动派工)
+        if (StringUtils.isNotEmpty(orderBase.getDispatchFlag())){
+            orderBase.setDispatchFlag("B");
+        } else {
+            orderBase.setDispatchFlag("A");
+        }
+
+        // create_sys - 创建网点系统  cjwdno
+        // last_operator_websit:最近操作网点 创建单时也是创建网点 可能是销售网点,也可能是售后网点  zjczwd
+        // sys_websit_number 系统网点编号 zjczwd 同上
+        orderBase.setCreateSys(orderBase.getCreateWebsitId());
+
+        // 先从销售网点判断
+        websitFWS = publicService.shxswdToptxswd(item.getXsdwno(),orderBase);
+        if (StringUtils.isEmpty(websitFWS.getWebsitId())){
+            websitFWS = publicService.shshwdToptshwd(item.getXsdwno(),orderBase);
+        }
+        orderBase.setLastOperatorWebsit(websitFWS.getWebsitId());
+        orderBase.setSysWebsitNumber(websitFWS.getBrandSysWebsitNumber());
+
+        // ////////////////////////////////////////////////////////////////////////////////////////////////
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        // 提取本地订单
+        OrderBase old = orderBaseService.lambdaQuery()
+                .eq(OrderBase::getPgguid, item.getPgguid()).one();
+        WebsitSH websitSH = publicService.ptxswdToshxswd(old.getReceWebsitId(),old.getMainId());
+
+        if (orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1121.getCode()) ||
+                orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1125.getCode())){
+            if (!(websitSH.getWdId().equals("S9219801") || websitSH.getWdId().equals("S9219807")) &&
+                    (!orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G1_0.getCode()) &&
+                            !orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G1_0.getCode()) &&
+                            !orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G1_1.getCode()) &&
+                            !orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G2_0.getCode()) &&
+                            !orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G2_1.getCode()) &&
+                            !orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G3.getCode()) &&
+                            !orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G4_0.getCode()) &&
+                            !orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G4_1.getCode())) &&
+                    !orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G5.getCode())){
+                orderBase.setOrderStatus(GDOrderStatusEnum.INSTALL_STATUS_G3.getCode());
+                orderBase.setDispatchStatus("DJS");
+            }
+            if (orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1125.getCode())){
+                // 售后网点=接收派工网点
+                orderBase.setWebsitId(orderBase.getReceWebsitId());
+                orderBase.setWebsitName(orderBase.getReceWebsitName());
+            }
+        }
+
+        if (orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1129.getCode()) ||
+                orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1135.getCode())){
+            if (websitSH.getWdId().equals("S9219801") || websitSH.getWdId().equals("S9219807")){
+                orderBase.setOrderStatus(GDOrderStatusEnum.INSTALL_STATUS_G2_0.getCode());
+                orderBase.setDispatchStatus("DJS");
+            }
+        }
+
+        // 总部下来的关闭工单要修改
+        if (orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1309.getCode())){
+            List<OrderInstallDetail> oid = orderInstallDetailService.lambdaQuery()
+                    .eq(OrderInstallDetail::getOrderBaseId,old.getId())
+                    .eq(OrderInstallDetail::getStatus,1).list();
+            if (CollectionUtils.isNotEmpty(oid) && oid.size()==old.getTotalNum()){
+                orderBase.setOrderStatus(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode());
+                orderBase.setDispatchStatus("YBWG");
+            }
+        }
+
+        // 处理改派
+        if (orderBase.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_A1135.getCode())){
+            OrderApplyDispatch oad = orderApplyDispatchService.lambdaQuery()
+                    .eq(OrderApplyDispatch::getOrderBaseId,orderBase.getId())
+                    .eq(OrderApplyDispatch::getExamineStatus,"WAIT")
+                    .eq(OrderApplyDispatch::getWebsitId,orderBase.getReceWebsitId()).one();
+            // 无记录,生成改派申请数据
+            if (oad==null){
+                OrderApplyDispatch add =new OrderApplyDispatch();
+                add.setOrderBaseId(orderBase.getId());
+                add.setPgid(orderBase.getPgid());
+                add.setType(orderBase.getOrderType());
+                add.setWebsitId(orderBase.getWebsitId());
+                add.setWebsitName(orderBase.getWebsitName());
+                add.setApplyContent("申请改派");
+                add.setExamineStatus("WAIT");
+                add.setUserName(orderBase.getUserName());
+                add.setUserMobile(orderBase.getUserMobile());
+                add.setReserveTime(orderBase.getAppointmentTime());
+                add.setReservePeriod(sdf.format(orderBase.getAppointmentTime()));
+                add.setMainId(Integer.valueOf(orderBase.getMainId()));
+                add.setMainName(orderBase.getMainName());
+                add.setCreateTime(new Date());
+                add.setUpdateTime(new Date());
+                add.setSource(1);
+                add.setAuditChangeTypeTab(3);
+            }
+
+
+
+
+
+        }
+
+
+
+
+        // //////////////////////////////////////////////////////////////////////////////////////
+
+    }
+
+    @Override
+    public void setParUp(ItfTblAzAssignLcLsDownload item, OrderBase orderBase){
+        WebsitFWS websitFWS = new WebsitFWS();
+
+        if (StringUtils.isEmpty(orderBase.getGpsAddress())){
+            orderBase.setGpsAddress(publicService.getGpsaddress(orderBase.getLng(),orderBase.getLat()));
+        }
+        // 售后网点处理-安装或维修网点
+        websitFWS = publicService.shshwdToptshwd(orderBase.getWebsitId(),orderBase);
+        orderBase.setWebsitId(websitFWS.getWebsitId());
+        orderBase.setWebsitName(websitFWS.getWdmc());
+        orderBase.setGroupCompanyId(websitFWS.getGroupCompanyId());
+        orderBase.setGroupCompanyName(websitFWS.getGroupCompanyName());
+        orderBase.setProductBrandId("A");
+        orderBase.setProductBrandName("格力(机型品牌)");
+
+        // 接收派工网点处理 总力总部下来的接收网点信息不为空
+        if (item.getAzwdno().equals(orderBase.getReceWebsitId())){
+            orderBase.setReceWebsitId(orderBase.getWebsitId());
+            orderBase.setReceWebsitName(orderBase.getWebsitName());
+            // 结算主体
+            orderBase.setBrandId(websitFWS.getBrandId());
+            orderBase.setBrandName(websitFWS.getBrandName());
+
+        } else {
+            websitFWS = publicService.shshwdToptshwd(orderBase.getReceWebsitId(),orderBase);
+            orderBase.setReceWebsitId(websitFWS.getWebsitId());
+            orderBase.setReceWebsitName(websitFWS.getWdmc());
+            // 结算主体
+            orderBase.setBrandId(websitFWS.getBrandId());
+            orderBase.setBrandName(websitFWS.getBrandName());
+        }
+        // 创建网点处理
+        if (item.getAzwdno().equals(orderBase.getCreateWebsitId())){
+            orderBase.setCreateWebsitId(orderBase.getWebsitId());
+            orderBase.setCreateWebsitName(orderBase.getWebsitName());
+        } else {
+            websitFWS = publicService.shshwdToptshwd(orderBase.getCreateWebsitId(),orderBase);
+            orderBase.setCreateWebsitId(websitFWS.getWebsitId());
+            orderBase.setCreateWebsitName(websitFWS.getWdmc());
+        }
+        // 销售网点处理
+        websitFWS = publicService.shxswdToptxswd(orderBase.getSaleWebsitId(),orderBase);
+        orderBase.setSaleWebsitId(websitFWS.getWebsitId());
+        orderBase.setSaleWebsitName(websitFWS.getWdmc());
+        // 这里为商户的系统网点编号
+        orderBase.setSaleWebsitSysNumber(websitFWS.getBrandSysWebsitNumber());
 
         // 省市区单独处理
         shPositionTopt(orderBase);

+ 3 - 1
src/main/java/com/zfire/jiasm/syncdata/test.java

@@ -3,6 +3,7 @@ package com.zfire.jiasm.syncdata;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.zfire.jiasm.syncdata.plus.entity.Belongcompany;
 import com.zfire.jiasm.syncdata.plus.entity.YjhxJdd;
@@ -54,7 +55,8 @@ public class test {
         BeanUtils.copyProperties(a, c,
                 new String[] {"websitId"});
 
-        System.out.println("OI");
+        System.out.println(IdWorker.getIdStr());
+        System.out.println(UUID.randomUUID().toString());
 
     }
 

+ 5 - 5
src/main/resources/mapper/AZGDLcLsDownloadMapper.xml

@@ -20,17 +20,18 @@
                a.cjwdno as create_sys,a.zjczwd as last_operator_websit,a.zjczwdxtbh as sys_websit_number,
                a.zjczren as last_operator_by,a.zjczsj as last_operator_time,a.xslx as sale_type,a.lcid as process_no,
                a.djlxno as  bill_type_no,ifnull(a.yyazsj,a.yhqwkssj) as appointment_time,
-               case a.sfwcps when '0' then 'NO'
-                             when '1' then 'YES' else 'NO' end as is_delivery_over,
+               ifnull(a.yyazsj,a.yhqwkssj) as appointment_end_time,
+               case a.sfwcps when '未配送' then 'NO' when '配送中' then 'NO' when '否' then 'NO' else 'YES' end as is_delivery_over,
                a.azsl as total_num,a.wwsl as undone_num,a.xsdh as sale_no,a.xsdwno as sale_websit_id,
                a.fphm as invoice_no,a.gmsj as buy_time,a.kqbh as cross_no,
                a.xsorsh as data_push_attr,a.jindu as lng,a.weidu as lat,a.shsj as delivery_time,a.sfygllc as sfygllc,
                a.xslxid as sale_type_id,a.yhsxid as user_attr_id,a.xxlbid as info_type_id,a.xxlyid as info_source_id,
                a.wcsj as over_time,a.cjdt as create_time,a.cjren as create_by,a.cjrmc as create_name,a.last_modified_date as update_time,
                a.last_modified_by as update_by,a.azren as dispatch_flag,a.jspgwdsj as first_dispatch_websit_time,
-               1 as upload_flag,TL_createOrderSn('33', 20, 1, 9) as id,
+               1 as upload_flag,
                case when a.spid=102 then '商用' when a.spid=109 then '商用' else '家用' end as service_flag,
-               a.fjhm as gree_virtualnumber
+               a.fjhm as gree_virtualnumber,
+               case a.dqjd when 1100 then '1' when 1122 then '1' when 1130 then '1' else '0' end as is_reservation
         from itf_tbl_az_assign_lc_ls_download a
                  left join itf_tbl_wangdian_wxg_download b on a.azrenid=b.wxgid and b.wdno=a.jspgwdno
                  left join order_state_contrast c on a.dqjd=c.brand_order_state and c.state_type=10 and c.brand_id = #{request.brandId}
@@ -56,7 +57,6 @@
                c.order_state as order_status,
 
 
-
                a.dqjdsj as order_status_time,d.order_state as last_order_status,e.order_state as dispatch_status,
                a.fjhm,a.extendfiled2 as vip,a.email,
                a.yxji as priority,a.gdhao as file_no,f.dict_code as main_id,f.dict_value as main_name,

+ 1 - 1
src/main/resources/mapper/RepairDownloadMapper.xml

@@ -20,7 +20,7 @@
                a.xswdno as sale_websit_id,a.xsorsh as data_push_attr,
                a.jindu as lng,a.weidu as lat,a.wcsj as over_time,a.cjdt as create_time,a.cjren as create_by,a.cjrmc as create_name,
                IFNULL(a.last_modified_date,a.zjczsj) as update_time,a.last_modified_by as update_by,a.wxrenid as dispatch_flag,1 as upload_flag,
-               TL_createOrderSn('77', 20, 1, 9) as id,a.xjwdsj as rece_time,a.xxlbid as info_type_id,a.xxlyid as info_source_id,
+               a.xjwdsj as rece_time,a.xxlbid as info_type_id,a.xxlyid as info_source_id,
                a.yhsxid as user_attr_id,a.qqlymc as external_name,a.qqlyxh as external_no,a.wxcount as out_wxcount,a.xxqdid as info_channel_id,
                case a.tsdengji when '一级投诉' then 'FIRST'
                                when '二级投诉' then 'SECOND'