yaozhixue 2 jaren geleden
bovenliggende
commit
e2d7165311

+ 18 - 0
src/main/java/com/zfire/jiasm/syncdata/dao/mapper/RepairMxDownloadMapper.java

@@ -0,0 +1,18 @@
+package com.zfire.jiasm.syncdata.dao.mapper;
+
+import com.baomidou.mybatisplus.annotation.SqlParser;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zfire.jiasm.syncdata.parameter.OrderPar;
+import com.zfire.jiasm.syncdata.plus.entity.ItfTblAssignMxDownload;
+import com.zfire.jiasm.syncdata.plus.entity.OrderProduct;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 维修单明细下载记录表  Mapper 接口
+ * @author yaozx
+ * @since 2023-03-10
+ */
+public interface RepairMxDownloadMapper extends BaseMapper<ItfTblAssignMxDownload> {
+    @SqlParser(filter = true)
+    OrderProduct getMx(@Param("request") OrderPar request);
+}

+ 3 - 2
src/main/java/com/zfire/jiasm/syncdata/download/order/install/InstallBusiness.java

@@ -829,6 +829,7 @@ public class InstallBusiness {
                 .eq(ItfTblAzAssignFeeDownload::getDownloadTaskNo, item.getDownloadTaskNo())
                 .eq(ItfTblAzAssignFeeDownload::getSynStatus,0)
                 .one();
+        // 获取工单扩展信息  - 费用清单是不能放在扩展表的,这里有误 从订单表取才可以
         OrderInstall orderInstall = getOrderInstall(orderBase, brand, item, fyqd);
         // 获取用户预约改约信息
         List<ItfTblAzAssignAppointmentDownload> appointments = itfTblAzAssignAppointmentDownloadService.lambdaQuery()
@@ -1106,8 +1107,8 @@ public class InstallBusiness {
                         .eq(CustomerInformationWebsit::getBrandId, brand.getBrandId())
                         .one();
                 if (ciw !=null){
-                    oiol.setWebsitNumber(ciw.getWebsitId());
-                    oiol.setOperateWebsit(ciw.getWebsitId());
+                    oiol.setWebsitNumber(ciw.getWebsitId());// 为售后网点火器
+                    oiol.setOperateWebsit(ciw.getWebsitId());// 为操作人员所属网点
                 }
             }
 

+ 169 - 18
src/main/java/com/zfire/jiasm/syncdata/download/order/repair/RepairBusiness.java

@@ -4,15 +4,13 @@ import com.zfire.jiasm.syncdata.base.BaseService;
 import com.zfire.jiasm.syncdata.dao.mapper.AssignDownloadMapper;
 import com.zfire.jiasm.syncdata.dao.mapper.DetailOrderRepairMapper;
 import com.zfire.jiasm.syncdata.dao.mapper.RepairDownloadMapper;
+import com.zfire.jiasm.syncdata.dao.mapper.RepairMxDownloadMapper;
 import com.zfire.jiasm.syncdata.parameter.OrderPar;
-import com.zfire.jiasm.syncdata.plus.entity.Brand;
-import com.zfire.jiasm.syncdata.plus.entity.ItfTblAssignDownload;
-import com.zfire.jiasm.syncdata.plus.entity.OrderApplyDispatch;
-import com.zfire.jiasm.syncdata.plus.entity.OrderBase;
-import com.zfire.jiasm.syncdata.plus.service.ItfTblAssignDownloadService;
-import com.zfire.jiasm.syncdata.plus.service.OrderApplyDispatchService;
-import com.zfire.jiasm.syncdata.plus.service.OrderBaseService;
+import com.zfire.jiasm.syncdata.plus.entity.*;
+import com.zfire.jiasm.syncdata.plus.service.*;
+import com.zfire.jiasm.syncdata.response.WebsitSH;
 import com.zfire.jiasm.syncdata.service.OrderService;
+import com.zfire.jiasm.syncdata.service.PublicService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
@@ -20,9 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * 格力品牌维修工单下载后落本地数据表
@@ -46,11 +42,21 @@ public class RepairBusiness {
     @Resource
     OrderService orderService;
     @Resource
-    DetailOrderRepairMapper detailOrderRepairMapper;
-    @Resource
     OrderApplyDispatchService orderApplyDispatchService;
     @Resource
     AssignDownloadMapper assignDownloadMapper;
+    @Resource
+    ItfTblAssignMxDownloadService itfTblAssignMxDownloadService;
+    @Resource
+    RepairMxDownloadMapper repairMxDownloadMapper;
+    @Resource
+    PublicService publicService;
+    @Resource
+    OrderInstallService orderInstallService;
+    @Resource
+    OrderProductService orderProductService;
+    @Resource
+    ItfTblAssignFkmxDownloadService itfTblAssignFkmxDownloadService;
 
 
     // 1:工单落入本地表
@@ -70,6 +76,14 @@ public class RepairBusiness {
             return;
         }
 
+        // 提取品牌商对应的大类信息
+        Map<String, List<SysDictRef>> sysDictRefDLMap = publicService.getStringListMap(brand);
+        // 提取品牌商对应的小类信息
+        Map<String, List<SysDictRef>> sysDictRefXLMap = publicService.getListMap(brand);
+        // 提取品牌商对应的系列信息
+        Map<String, List<SysDictRef>> sysDictRefXiLieMap = publicService.getMap(brand);
+
+
         // 提取待落本地表的数据
         repairRec = itfTblAssignDownloadService.lambdaQuery()
                 .eq(ItfTblAssignDownload::getSynStatus,0)
@@ -87,15 +101,148 @@ public class RepairBusiness {
         for (ItfTblAssignDownload item: repairRec){
 
             // 新增
-            repairBusiness.addOrder(brand, item);
+            repairBusiness.addOrder(brand, item, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap);
         }
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public  void addOrder(Brand brand, ItfTblAssignDownload item) {
+    public  void addOrder(Brand brand, ItfTblAssignDownload item,
+                          Map<String, List<SysDictRef>> sysDictRefDLMap,
+                          Map<String, List<SysDictRef>> sysDictRefXLMap,
+                          Map<String, List<SysDictRef>> sysDictRefXiLieMap) {
         // 新增 TL_SynDataFrom_tbl_assign_batch
         // TL_SynDataFrom_tbl_assign 主单的 syn_req_id
-        // 生成维修工单主表数据
+
+        // 处理维修工单主表数据
+        OrderBase order = generateOrder(brand, item);
+        // 处理工单师傅
+        OrderWorker orderWorker = publicService.getOrderWorker(order);
+        // 获取工单扩展信息
+        getOrderInstall(item, order);
+
+        // 处理维修单明细表 TL_SynDataFrom_tbl_assign_mx
+        generateMx(brand, item, order, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap);
+
+
+        // 处理维修单过程反馈表 放入操作日志表
+        List<ItfTblAssignFkmxDownload> fkmxRec = new ArrayList<>();
+        List<OrderRepairOperatingLog> orol = new ArrayList<>();
+        List<ItfTblAssignFkmxDownload> ups = new ArrayList<>();
+
+        fkmxRec = itfTblAssignFkmxDownloadService.lambdaQuery()
+                .eq(ItfTblAssignFkmxDownload::getDownloadTaskNo,item.getDownloadTaskNo())
+                .eq(ItfTblAssignFkmxDownload::getSynStatus,0)
+                .orderByAsc(ItfTblAssignFkmxDownload::getCreatedDate,ItfTblAssignFkmxDownload::getFkid)
+                .list();
+        for (ItfTblAssignFkmxDownload fkmx :fkmxRec){
+            // 查看是否存在,存在为修改
+            // 新增时是不会存在的,所以这里只做新增
+            OrderRepairOperatingLog add = new OrderRepairOperatingLog();
+            add.setWebsitName(order.getWebsitName());
+            add.setWebsitId(order.getWebsitId());
+            add.setOrderBaseId(order.getId());
+            add.setCustomerName(order.getUserName());
+            add.setCustomerPhone(order.getUserMobile());
+            add.setType(fkmx.getFklb());
+            add.setContent(fkmx.getFknr());
+            add.setFeedback(fkmx.getFkjg());
+            add.setOperator(fkmx.getFkren());
+            add.setOperatorNumber(fkmx.getFkrenmc());
+            WebsitSH websitSH = publicService.WebsitToSH(fkmx.getFkwdno(),brand.getBrandId());
+            add.setOperateWebsit(websitSH.getWdmc());
+
+
+
+
+
+
+        }
+
+
+
+
+
+
+
+
+    }
+
+    private void getOrderInstall(ItfTblAssignDownload item, OrderBase order) {
+        OrderInstall oit = new OrderInstall();
+        oit.setOrderBaseId(order.getId());
+        oit.setExtendField1(item.getExtjson1());
+        oit.setExtendField2(item.getExtjson2());
+        oit.setExtendField3(item.getExtjson3());
+        oit.setExtendField4(item.getExtjson4());
+        oit.setExtendField5(item.getExtjson5());
+        oit.setCreateBy(order.getCreateBy());
+        oit.setCreateTime(order.getCreateTime());
+        oit.setUpdateBy(order.getUpdateBy());
+        oit.setUpdateTime(order.getUpdateTime());
+        orderInstallService.save(oit);
+    }
+
+    private void generateMx(Brand brand, ItfTblAssignDownload item, OrderBase order,
+                            Map<String, List<SysDictRef>> sysDictRefDLMap,
+                            Map<String, List<SysDictRef>> sysDictRefXLMap,
+                            Map<String, List<SysDictRef>> sysDictRefXiLieMap) {
+        List<ItfTblAssignMxDownload> mxRec = new ArrayList<>();
+        List<OrderProduct> addmx = new ArrayList<>();
+        List<ItfTblAssignMxDownload> ups = new ArrayList<>();
+
+
+        // 明取明细表数据
+        mxRec = itfTblAssignMxDownloadService.lambdaQuery()
+                .eq(ItfTblAssignMxDownload::getDownloadTaskNo, item.getDownloadTaskNo())
+                .eq(ItfTblAssignMxDownload::getSynStatus,0)
+                .orderByAsc(ItfTblAssignMxDownload::getSynStatus)
+                .list();
+        for (ItfTblAssignMxDownload rec:mxRec){
+            // 提取维修工单明细数据对象
+            OrderPar mxreq = new OrderPar();
+            mxreq.setSynReqId(Long.valueOf(rec.getSynReqId()));
+            mxreq.setBrandId(brand.getBrandId());
+            OrderProduct op = repairMxDownloadMapper.getMx(mxreq);
+
+            // 其他部分参数赋值
+            op.setOrderBaseId(order.getId());
+            op.setPgguid(item.getPgguid());
+            op.setMainId(order.getMainId());
+            op.setMainName(order.getMainName());
+            op.setMainId(sysDictRefDLMap.get(String.valueOf(rec.getSpid())).get(0).getDictCode());
+            op.setMainName(sysDictRefDLMap.get(String.valueOf(rec.getSpid())).get(0).getDictValue());
+            if (!rec.getXlid().equals(0L)){
+                op.setSmallId(sysDictRefXLMap.get(String.valueOf(rec.getXlid())).get(0).getDictCode());
+                op.setSmallName(sysDictRefXLMap.get(String.valueOf(rec.getXlid())).get(0).getDictValue());
+            } else {
+                op.setSmallId(String.valueOf(rec.getXlid()));
+                op.setSmallName(rec.getXlmc());
+            }
+
+            if (!rec.getXiid().equals("0")){
+                op.setSeriesId(sysDictRefXiLieMap.get(rec.getXiid()).get(0).getDictCode());
+                op.setSeriesName(sysDictRefXiLieMap.get(rec.getXiid()).get(0).getDictValue());
+            } else {
+                op.setSeriesId(rec.getXiid());
+                op.setSeriesName(rec.getXimc());
+            }
+            addmx.add(op);
+
+            ItfTblAssignMxDownload up = new ItfTblAssignMxDownload();
+            up.setSynReqId(rec.getSynReqId());
+            up.setSynStatus(1);
+            up.setSynReqTime(new Date());
+            ups.add(up);
+        }
+
+        if (addmx.size()>0){
+            orderProductService.saveBatch(addmx);
+            addmx.clear();
+            itfTblAssignMxDownloadService.updateBatchById(ups);
+        }
+    }
+
+    private OrderBase generateOrder(Brand brand, ItfTblAssignDownload item) {
         OrderBase order = saveOrderBase(brand, item);
 
         // 更新 修改时更新 新增时无需此操作 可以先放进来,是修改不到数据的
@@ -103,9 +250,9 @@ public class RepairBusiness {
         // order_product 无维修网点信息,所以不用做
 
         // 采集表需要做上面的操作 order_repair_detail  新增时也无需操作,加上也不会出错
-        OrderPar request = new OrderPar();
+        /*OrderPar request = new OrderPar();
         request.setOrderNo(order.getId());
-        detailOrderRepairMapper.updateWebsitMessage(request);
+        detailOrderRepairMapper.updateWebsitMessage(request);*/
 
 
         // 新增或是修改都要加  新增是一定要做的
@@ -128,6 +275,8 @@ public class RepairBusiness {
 
         // 修改同步状态
         upItfTblAssignDownloadStatus(item, order);
+
+        return order;
     }
 
     private OrderBase saveOrderBase(Brand brand, ItfTblAssignDownload item) {
@@ -158,6 +307,8 @@ public class RepairBusiness {
     }
 
     private void generateDispatch(OrderBase order) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
         List<String> parame = new ArrayList<>();
         parame.add(order.getWebsitId());
         parame.add(order.getReceWebsitId());
@@ -179,7 +330,7 @@ public class RepairBusiness {
             addn.setUserName(order.getUserName());
             addn.setUserMobile(order.getUserMobile());
             addn.setReserveTime(order.getAppointmentTime());
-            addn.setReservePeriod(String.valueOf(order.getAppointmentTime()));
+            addn.setReservePeriod(sdf.format(order.getAppointmentTime()));
             addn.setMainId(Integer.valueOf(order.getMainId()));
             addn.setMainName(order.getMainName());
             addn.setCreateTime(order.getCreateTime());

+ 2 - 0
src/main/java/com/zfire/jiasm/syncdata/parameter/InstallDetail.java

@@ -18,4 +18,6 @@ public class InstallDetail {
 
     // 查询使用
     private String id;
+
+    private String brandId;
 }

+ 18 - 0
src/main/java/com/zfire/jiasm/syncdata/response/WebsitSH.java

@@ -0,0 +1,18 @@
+package com.zfire.jiasm.syncdata.response;
+
+import lombok.Data;
+
+/**
+ * @author yaozx
+ * @version 1.0
+ * @description 介绍
+ * @date 2023-03-13
+ */
+@Data
+public class WebsitSH {
+    // 商户网点编码
+    private String wdId;
+
+    // 商户网点名称
+    private String wdmc;
+}

+ 30 - 0
src/main/java/com/zfire/jiasm/syncdata/service/PublicService.java

@@ -0,0 +1,30 @@
+package com.zfire.jiasm.syncdata.service;
+
+import com.zfire.jiasm.syncdata.plus.entity.Brand;
+import com.zfire.jiasm.syncdata.plus.entity.OrderBase;
+import com.zfire.jiasm.syncdata.plus.entity.OrderWorker;
+import com.zfire.jiasm.syncdata.plus.entity.SysDictRef;
+import com.zfire.jiasm.syncdata.response.WebsitPP;
+import com.zfire.jiasm.syncdata.response.WebsitSH;
+
+import java.util.List;
+import java.util.Map;
+
+public interface PublicService {
+
+    OrderWorker getOrderWorker(OrderBase orderBase);
+    // 提取品牌商对应的大类信息
+    Map<String, List<SysDictRef>> getStringListMap(Brand brand);
+    // 提取品牌商对应的小类信息
+    Map<String, List<SysDictRef>> getListMap(Brand brand);
+    // 提取品牌商对应的系列信息
+    Map<String, List<SysDictRef>> getMap(Brand brand);
+
+    // 品牌网点对应商户网点
+    WebsitSH WebsitToSH(String websitNo, String brandId);
+    // 商户网点对应品牌网点
+    WebsitPP WebsitToPP(String websitNo, String brandId);
+
+
+
+}

+ 181 - 0
src/main/java/com/zfire/jiasm/syncdata/service/impl/PublicServiceImpl.java

@@ -0,0 +1,181 @@
+package com.zfire.jiasm.syncdata.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.zfire.jiasm.syncdata.constant.DictTypeEnum;
+import com.zfire.jiasm.syncdata.plus.entity.*;
+import com.zfire.jiasm.syncdata.plus.service.*;
+import com.zfire.jiasm.syncdata.response.WebsitPP;
+import com.zfire.jiasm.syncdata.response.WebsitSH;
+import com.zfire.jiasm.syncdata.service.PublicService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+public class PublicServiceImpl implements PublicService {
+    @Resource
+    OrderWorkerService orderWorkerService;
+    @Resource
+    SysDictRefService sysDictRefService;
+    @Resource
+    WebsitOrderSignService websitOrderSignService;
+    @Resource
+    CustomerInformationWebsitService customerInformationWebsitService;
+    @Resource
+    BrandWebsitService brandWebsitService;
+    @Resource
+    WebsitService websitService;
+
+
+    @Override
+    public OrderWorker getOrderWorker(OrderBase orderBase){
+        if (StringUtils.isNotEmpty(orderBase.getWorkerName())){
+            OrderWorker orderWorker = new OrderWorker();
+            orderWorker.setOrderBaseId(orderBase.getId());
+            orderWorker.setWorkerId(orderBase.getWorkerId());
+            orderWorker.setWorkerName(orderBase.getWorkerName());
+            orderWorker.setWorkerMobile(orderBase.getWorkerMobile());
+            orderWorker.setWorkerIdcard(orderBase.getWorkerIdcard());
+            orderWorker.setIsMaster(Boolean.TRUE);
+            orderWorker.setBrandPgid(orderBase.getPgid());
+            orderWorker.setPgguid(orderBase.getPgguid());
+            orderWorker.setCreateTime(orderBase.getCreateTime());
+            orderWorker.setCreateBy(orderBase.getCreateBy());
+            orderWorker.setOutWorkerSource(Boolean.FALSE);
+
+            orderWorkerService.save(orderWorker);
+
+            return orderWorker;
+        }
+
+        return null;
+    }
+
+    @Override
+    public Map<String, List<SysDictRef>> getStringListMap(Brand brand){
+        List<SysDictRef> sysDictRef;
+        Map<String, List<SysDictRef>> sysDictRefDLMap = new HashMap<>();
+        sysDictRef =  sysDictRefService.lambdaQuery()
+                .select(SysDictRef::getDictCode,SysDictRef::getDictValue,SysDictRef::getRefDictCode)
+                .eq(SysDictRef::getBrandId, brand.getBrandId())
+                .eq(SysDictRef::getDictType, DictTypeEnum.DICT_TYPE_MAIN_TYPE.getCode())
+                .list();
+        sysDictRefDLMap = sysDictRef.stream().
+                collect(Collectors.groupingBy(SysDictRef::getRefDictCode));
+        return sysDictRefDLMap;
+    }
+
+    @Override
+    public Map<String, List<SysDictRef>> getListMap(Brand brand){
+        List<SysDictRef> sysDictxlRef;
+        Map<String, List<SysDictRef>> sysDictRefXLMap = new HashMap<>();
+        sysDictxlRef =  sysDictRefService.lambdaQuery()
+                .select(SysDictRef::getDictCode,SysDictRef::getDictValue,SysDictRef::getRefDictCode)
+                .eq(SysDictRef::getBrandId, brand.getBrandId())
+                .eq(SysDictRef::getDictType, DictTypeEnum.DICT_TYPE_SMALL_TYPE.getCode())
+                .list();
+        sysDictRefXLMap = sysDictxlRef.stream().
+                collect(Collectors.groupingBy(SysDictRef::getRefDictCode));
+        return sysDictRefXLMap;
+    }
+
+    @Override
+    public Map<String, List<SysDictRef>> getMap(Brand brand){
+        List<SysDictRef> sysDictxilieRef;
+        Map<String, List<SysDictRef>> sysDictRefXiLieMap = new HashMap<>();
+        sysDictxilieRef =  sysDictRefService.lambdaQuery()
+                .select(SysDictRef::getDictCode,SysDictRef::getDictValue,SysDictRef::getRefDictCode)
+                .eq(SysDictRef::getBrandId, brand.getBrandId())
+                .eq(SysDictRef::getDictType, DictTypeEnum.DICT_TYPE_SERIES.getCode())
+                .list();
+        sysDictRefXiLieMap = sysDictxilieRef.stream().
+                collect(Collectors.groupingBy(SysDictRef::getRefDictCode));
+        return sysDictRefXiLieMap;
+    }
+
+    // 品牌网点对应商户网点
+    @Override
+    public WebsitSH WebsitToSH(String websitNo, String brandId){
+        WebsitSH resultData = new WebsitSH();
+
+        resultData.setWdId("");
+        resultData.setWdmc("");
+
+        // 先从售后网点查
+        WebsitOrderSign wos = websitOrderSignService.lambdaQuery()
+                .eq(WebsitOrderSign::getBrandWebsitNumber, websitNo)
+                .eq(WebsitOrderSign::getBrandId, brandId)
+                .one();
+        if (wos != null){
+            resultData.setWdId(wos.getWebsitId());
+        } else {
+            CustomerInformationWebsit ciwx = customerInformationWebsitService.lambdaQuery()
+                    .eq(CustomerInformationWebsit::getRefWebsitId, websitNo)
+                    .eq(CustomerInformationWebsit::getBrandId, brandId)
+                    .one();
+            if (ciwx !=null){
+                resultData.setWdId(ciwx.getWebsitId());
+            }
+        }
+
+        // 提取网点名称
+        if (StringUtils.isNotEmpty(resultData.getWdId())){
+            Websit websit = websitService.lambdaQuery()
+                    .eq(Websit::getWebsitId,resultData.getWdId())
+                    .one();
+            if (websit != null){
+                resultData.setWdmc(websit.getWebsitName());
+            }
+        }
+
+        return resultData;
+    }
+
+    // 商户网点对应品牌网点
+    @Override
+    public WebsitPP WebsitToPP(String websitId, String brandId){
+        WebsitPP resultData = new WebsitPP();
+
+        resultData.setXtwdno("");
+        resultData.setWdno("");
+        resultData.setWdmc("");
+
+        // 先从售后网点查
+        WebsitOrderSign wos = websitOrderSignService.lambdaQuery()
+                .eq(WebsitOrderSign::getWebsitId, websitId)
+                .eq(WebsitOrderSign::getBrandId, brandId)
+                .one();
+        if (wos != null){
+            resultData.setWdno(wos.getBrandWebsitNumber());
+            resultData.setWdmc(wos.getBrandWebsitName());
+        } else {
+            CustomerInformationWebsit ciwx = customerInformationWebsitService.lambdaQuery()
+                    .eq(CustomerInformationWebsit::getWebsitId, websitId)
+                    .eq(CustomerInformationWebsit::getBrandId, brandId)
+                    .one();
+            if (ciwx !=null){
+                resultData.setWdno(ciwx.getRefWebsitId());
+                resultData.setWdmc(ciwx.getRefWebsitName());
+            }
+        }
+
+        // 提取系统网点编号
+        if (StringUtils.isNotEmpty(resultData.getWdno())){
+            BrandWebsit bw = brandWebsitService.lambdaQuery()
+                    .eq(BrandWebsit::getBrandWebsitNumber, resultData.getWdno())
+                    .eq(BrandWebsit::getBrandId, brandId)
+                    .one();
+            if (bw != null){
+                resultData.setXtwdno(bw.getSysWebsitNumber());
+            }
+
+        }
+
+        return resultData;
+    }
+
+}

+ 1 - 0
src/main/java/com/zfire/jiasm/syncdata/upload/order/ProduceDataUploadList.java

@@ -614,6 +614,7 @@ public class ProduceDataUploadList {
         InstallDetail request = new InstallDetail();
         request.setOrderNo(detail.getOrderBaseId());
         request.setId(detail.getId());
+        request.setBrandId(brand.getBrandId());
         // 为空时为 家用空调
         if (StringUtils.isEmpty(mainName) ||
                 mainName.equals("家用空调") || mainName.equals("家用空气能热水器") || mainName.equals("驻车空调")){

+ 1 - 4
src/main/java/com/zfire/jiasm/syncdata/upload/order/ProduceUploadList.java

@@ -50,9 +50,6 @@ public class ProduceUploadList {
     OrderReAppointmentService orderReAppointmentService;
 
 
-
-
-
     @Scheduled(fixedDelay = 1 * 20 * 1000)
     private void produceList(){
         if (1==1){
@@ -103,7 +100,7 @@ public class ProduceUploadList {
                     if (itemTableName.equals("order_base") && itemOrderType.equals("INSTALL")){
                         produceUploadList.orderBaseProess(itemTableNameId, ojtgutls, item.getSynReqId(), itemTableName, itemOrderType);
                     }
-                    // 安装工单操作明细
+                    // 安装工单操作日志
                     if (itemTableName.equals("order_install_operating_log")){
                         produceUploadList.orderInstallOperatingLog(item, itemTableName, itemOrderType);
                     }

+ 15 - 15
src/main/resources/mapper/DetailOrderInstallMapper.xml

@@ -25,12 +25,12 @@
                g.bracket as zjia,g.pipe as jcguan,g.swith_flag as kqkg,g.high_altitude as gkzy,g.hole as yccxqk
         from order_install_detail a
                  left join order_product b on b.order_base_id = a.order_base_id and a.order_product_id=b.id
-                 left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = 1 and c.dict_type='MAIN_TYPE'
-                 left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = 1 and d.dict_type='SMALL_TYPE'
-                 left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = 1 and e.dict_type='SERIES'
-                 left join brand_websit f on f.brand_id = 1 and f.brand_websit_number in
+                 left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
+                 left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
+                 left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
+                 left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
                            (select brand_websit_id from websit_order_sign
-                               where brand_id = 1 and websit_id =a.operator_websit_number)
+                               where brand_id = #{request.brandId} and websit_id =a.operator_websit_number)
                  left join order_install_detail_fee g on g.order_base_id = a.order_base_id and g.order_detail_id=a.id
         where a.order_base_id = #{request.orderNo} and a.status in( '1' , '2') and a.id = #{request.id}
     </select>
@@ -58,12 +58,12 @@
                g.bracket as zjia,g.pipe as jcguan,g.swith_flag as kqkg,g.high_altitude as gkzy,g.hole as yccxqk
         from order_install_detail a
                  left join order_product b on b.order_base_id = a.order_base_id and a.order_product_id=b.id
-                 left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = 1 and c.dict_type='MAIN_TYPE'
-                 left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = 1 and d.dict_type='SMALL_TYPE'
-                 left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = 1 and e.dict_type='SERIES'
-                 left join brand_websit f on f.brand_id = 1 and f.brand_websit_number in
+                 left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
+                 left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
+                 left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
+                 left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
                           (select brand_websit_id from websit_order_sign
-                              where brand_id = 1 and websit_id =a.operator_websit_number)
+                              where brand_id = #{request.brandId} and websit_id =a.operator_websit_number)
                  left join order_install_detail_fee g on g.order_base_id = a.order_base_id and g.order_detail_id=a.id
         where a.order_base_id = #{request.orderNo} and a.status in( '1' , '2') and a.id = #{request.id}
     </select>
@@ -92,12 +92,12 @@
                g.bracket as zjia,g.pipe as jcguan,g.swith_flag as kqkg,g.high_altitude as gkzy,g.hole as yccxqk
         from order_install_detail a
                  left join order_product b on b.order_base_id = a.order_base_id and a.order_product_id=b.id
-                 left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = 1 and c.dict_type='MAIN_TYPE'
-                 left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = 1 and d.dict_type='SMALL_TYPE'
-                 left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = 1 and e.dict_type='SERIES'
-                 left join brand_websit f on f.brand_id = 1 and f.brand_websit_number in
+                 left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
+                 left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
+                 left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
+                 left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
                           (select brand_websit_id from websit_order_sign
-                              where brand_id = 1 and websit_id =a.operator_websit_number)
+                              where brand_id = #{request.brandId} and websit_id =a.operator_websit_number)
                  left join order_install_detail_fee g on g.order_base_id = a.order_base_id and g.order_detail_id=a.id
         where a.order_base_id = #{request.orderNo} and a.status in( '1' , '2') and a.id = #{request.id}
     </select>

+ 24 - 0
src/main/resources/mapper/RepairMxDownloadMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zfire.jiasm.syncdata.dao.mapper.RepairMxDownloadMapper">
+
+    <select id="getMx" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar" resultType="com.zfire.jiasm.syncdata.plus.entity.OrderProduct">
+        select a.pgmxid,a.jxno as province_id,a.jxmc as product_name,a.njtm as inside_code,a.wjtm as out_code,
+               a.fee as price,a.shul as num,a.wwsl as undone_num,a.created_by,a.created_date as create_time,
+               a.last_modified_by as update_by,a.last_modified_date as update_time,a.gzxx as urgency,
+               b.websit_id as sale_websit,a.xsdwdh as sale_websit_mobile,
+               c.websit_id as service_websit,a.fwdwdh as service_websit_mobile, a.gmsj as buy_time,a.beiz as remark
+        from
+            itf_tbl_assign_mx_download a
+                left join websit b on b.websit_id in
+                          (select websit_id from customer_information_websit
+                                  where brand_id = #{request.brandId} and ref_websit_id in
+                                        (select xsdw from itf_tbl_assign_mx_download where syn_req_id = #{request.synReqId}))
+                left join websit c on c.websit_id in
+                          (select websit_id from customer_information_websit
+                                  where brand_id = #{request.brandId} and ref_websit_id in
+                                        (select fwdw from itf_tbl_assign_mx_download where syn_req_id = #{request.synReqId}))
+    </select>
+
+
+</mapper>