|
|
@@ -3,6 +3,7 @@ package com.zfire.jiasm.syncdata.download.order;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.zfire.jiasm.syncdata.base.BaseService;
|
|
|
+import com.zfire.jiasm.syncdata.constant.DictTypeEnum;
|
|
|
import com.zfire.jiasm.syncdata.constant.GDOrderStatusEnum;
|
|
|
import com.zfire.jiasm.syncdata.constant.OrderTypeEnum;
|
|
|
import com.zfire.jiasm.syncdata.dao.mapper.*;
|
|
|
@@ -14,6 +15,7 @@ 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.apache.commons.collections4.CollectionUtils;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
@@ -80,11 +82,15 @@ public class RepairBusiness {
|
|
|
OrderRepairDetailService orderRepairDetailService;
|
|
|
@Resource
|
|
|
OrderRepairService orderRepairService;
|
|
|
+ @Resource
|
|
|
+ RepairLogMapper repairLogMapper;
|
|
|
+ @Resource
|
|
|
+ GDOrderBaseMapper gdOrderBaseMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- // 1:工单落入本地表
|
|
|
+ // 1:工单落入本地表 TL_SynDataFrom_tbl_assign_batch
|
|
|
@Scheduled(fixedDelay = 1 * 5 * 1000)
|
|
|
public void inputOrder() {
|
|
|
if (1 == 1) {
|
|
|
@@ -263,8 +269,9 @@ public class RepairBusiness {
|
|
|
// 增加判断是否有未处理的待改派,如果广佛有待改派但总部工单不是待改派,直接更新改派标志
|
|
|
// 无删除标识,暂不处理
|
|
|
|
|
|
- // 增加处理采集数据下载
|
|
|
- if ((oldOrder.getOrderStatus().equals("B41") || oldOrder.getOrderStatus().equals("B102")) && cjDowFlag ==0){
|
|
|
+ // 增加处理采集数据下载 41,102
|
|
|
+ if ((oldOrder.getOrderStatus().equals(GDOrderStatusEnum.REPAIR_STATUS_G8.getCode()) ||
|
|
|
+ oldOrder.getOrderStatus().equals(GDOrderStatusEnum.REPAIR_STATUS_G14.getCode())) && cjDowFlag ==0){
|
|
|
List<OrderRepairDetail> ords = orderRepairDetailService.lambdaQuery()
|
|
|
.eq(OrderRepairDetail::getOrderBaseId,oldOrder.getId())
|
|
|
.ne(OrderRepairDetail::getStatus,0).list();
|
|
|
@@ -272,8 +279,8 @@ public class RepairBusiness {
|
|
|
if (!(ords !=null && ords.size()>0)){
|
|
|
// 清除待采集数据
|
|
|
delOrderRepairDetail(oldOrder);
|
|
|
- // 向表内写数据,另起任务下载数据 todo
|
|
|
-
|
|
|
+ // 向表内写数据,另起任务下载数据
|
|
|
+ // 这里向itf_gree_to_fa_download_task_list表的任务类型写入6601 并不会下载,这里无需处理
|
|
|
// 修改基础表已采集下载标识
|
|
|
OrderBase up = new OrderBase();
|
|
|
up.setId(oldOrder.getId());
|
|
|
@@ -281,12 +288,54 @@ public class RepairBusiness {
|
|
|
orderBaseService.updateById(up);
|
|
|
}
|
|
|
}
|
|
|
- // 如果是家用的工单,且工单状态是待中心派工或待网点派工时,写入派嘉讯茂 暂停 todo
|
|
|
+
|
|
|
+ // 如果是家用的工单,且工单状态是待中心派工或待网点派工时,写入派嘉讯茂
|
|
|
+ // 写入操作日志
|
|
|
+ addOperatingLog(sysDictRefDLMap, item, oldOrder);
|
|
|
|
|
|
// 修改同步状态
|
|
|
upItfTblAssignDownloadStatus(item, oldOrder);
|
|
|
}
|
|
|
|
|
|
+ private void addOperatingLog(Map<String, List<SysDictRef>> sysDictRefDLMap, ItfTblAssignDownload item, OrderBase oldOrder) {
|
|
|
+ if (oldOrder.getOrderStatus().equals(GDOrderStatusEnum.REPAIR_STATUS_G2.getCode()) ||
|
|
|
+ oldOrder.getOrderStatus().equals(GDOrderStatusEnum.REPAIR_STATUS_G3.getCode()) ||
|
|
|
+ oldOrder.getOrderStatus().equals(GDOrderStatusEnum.REPAIR_STATUS_G4.getCode())){
|
|
|
+ // 大类存在,且相同 非商用
|
|
|
+ if (StringUtils.isNotEmpty(oldOrder.getMainId()) && StringUtils.isNotEmpty(String.valueOf(item.getSpid())) &&
|
|
|
+ !oldOrder.getMainId().equals(sysDictRefDLMap.get(String.valueOf(item.getSpid())).get(0).getDictCode()) &&
|
|
|
+ (!item.getSpid().equals(DictTypeEnum.DICT_TYPE_SY_102.getCode())) &&
|
|
|
+ (!item.getSpid().equals(DictTypeEnum.DICT_TYPE_SY_109.getCode())) ){
|
|
|
+ List<OrderRepairOperatingLog> orlog = orderRepairOperatingLogService.lambdaQuery()
|
|
|
+ .eq(OrderRepairOperatingLog::getOrderBaseId, oldOrder.getId())
|
|
|
+ .eq(OrderRepairOperatingLog::getType,"指派服务商").list();
|
|
|
+ if (CollectionUtils.isEmpty(orlog)){
|
|
|
+ OrderPar request = new OrderPar();
|
|
|
+ request.setOrderNo(oldOrder.getId());
|
|
|
+ OrderRepairOperatingLog orolog = repairLogMapper.getUpdatetime(request);
|
|
|
+ if (orolog == null){
|
|
|
+ orolog = repairLogMapper.getUpdatetimeT(request);
|
|
|
+ }
|
|
|
+ // 存在处理
|
|
|
+ if (orolog != null){
|
|
|
+ OrderPar orderPar = new OrderPar();
|
|
|
+ orderPar.setOrderNo(oldOrder.getId());
|
|
|
+ OrderRepairOperatingLog addlog = gdOrderBaseMapper.getOrderBaseLog(orderPar);
|
|
|
+ orderRepairOperatingLogService.save(addlog);
|
|
|
+ }
|
|
|
+ //
|
|
|
+ if ((!("S9219801".equals(item.getWxwdno())) && !("S9219807".equals(item.getWxwdno()))) &&
|
|
|
+ (!("S9219801".equals(item.getXjwdno())) && !("S9219807".equals(item.getXjwdno())))){
|
|
|
+ OrderPar orderPar = new OrderPar();
|
|
|
+ orderPar.setOrderNo(oldOrder.getId());
|
|
|
+ OrderRepairOperatingLog addlog = gdOrderBaseMapper.getOrderBaseLogT(orderPar);
|
|
|
+ orderRepairOperatingLogService.save(addlog);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void delOrderRepairDetail(OrderBase oldOrder) {
|
|
|
QueryWrapper dWrapper = new QueryWrapper<OrderRepairDetail>()
|
|
|
.eq("order_base_id", oldOrder.getId())
|