|
@@ -5,6 +5,7 @@ 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.DispatchStatusEnum;
|
|
|
+import com.zfire.jiasm.syncdata.constant.GDOrderStatusEnum;
|
|
|
import com.zfire.jiasm.syncdata.constant.OrderStatusEnum;
|
|
|
import com.zfire.jiasm.syncdata.dao.mapper.AZGDFYQDDownloadMapper;
|
|
|
import com.zfire.jiasm.syncdata.dao.mapper.AZGDFkMxDownloadMapper;
|
|
@@ -137,7 +138,7 @@ public class Business {
|
|
|
for (ItfTblAzAssignLcLsDownload item: lcls) {
|
|
|
try{
|
|
|
if (orderBaselist.contains(item.getPgguid())){
|
|
|
- // 修改
|
|
|
+ // 修改 TL_SynDataFrom_tbl_az_assign_lc_ls_batch
|
|
|
business.orderUpdate(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, brand, item);
|
|
|
} else {
|
|
|
// 新增 TL_SynDataFrom_tbl_az_assign_lc_ls_batch
|
|
@@ -169,13 +170,13 @@ public class Business {
|
|
|
.eq(OrderBase::getPgguid, item.getPgguid()).one();
|
|
|
|
|
|
// 获取安装工单主表
|
|
|
- OrderBase newLCLS = getOrderBase(item, brand);
|
|
|
+ OrderBase newLCLS = getAddOrderBase(item, brand);
|
|
|
// 这里一定不能少
|
|
|
newLCLS.setId(old.getId());
|
|
|
newLCLS.setDispatchStatus(old.getDispatchStatus());
|
|
|
|
|
|
// 获取工单主表要同步的数据
|
|
|
- OrderBase upInfo = getOrderBase(old, item, newLCLS);
|
|
|
+ OrderBase upInfo = getOrderBaseUp(old, item, newLCLS);
|
|
|
|
|
|
// 获取工单师傅信息来自于工单主表数据只有修改的情况
|
|
|
OrderWorker own =getOrderWorkerUpdate(old.getId(), upInfo, newLCLS);
|
|
@@ -623,11 +624,11 @@ public class Business {
|
|
|
}
|
|
|
|
|
|
@NotNull
|
|
|
- private OrderBase getOrderBase(OrderBase old, ItfTblAzAssignLcLsDownload item, OrderBase newLCLS) {
|
|
|
+ private OrderBase getOrderBaseUp(OrderBase old, ItfTblAzAssignLcLsDownload item, OrderBase newLCLS) {
|
|
|
OrderBase upInfo = new OrderBase();
|
|
|
|
|
|
// 本地订单已关闭 且总部的最后修改时间晚于本地数据修改时间 不可修改
|
|
|
- if (old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I10.getCode()) &&
|
|
|
+ if (old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode()) &&
|
|
|
item.getLastModifiedDate().compareTo(old.getUpdateTime())<0){
|
|
|
synItfTblAzAssignLcLsDownload(item.getSynReqId(), 99, "本地工单已关闭或作废忽略更新");
|
|
|
// 这里只是不修改订单主表,其他数据表接着执行
|
|
@@ -639,9 +640,9 @@ public class Business {
|
|
|
BeanUtils.copyProperties(newLCLS,upInfo);
|
|
|
}
|
|
|
// 2:网点信息修改 已待服务人员处理,不允更新网点 6,7,10 少6
|
|
|
- if (old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I6.getCode()) ||
|
|
|
- old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I10.getCode()) ||
|
|
|
- old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I7.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())){
|
|
|
// 售后网点
|
|
|
upInfo.setReceWebsitId(old.getReceWebsitId());
|
|
|
upInfo.setReceWebsitName(old.getReceWebsitName());
|
|
@@ -694,76 +695,76 @@ public class Business {
|
|
|
// 判断是否可更新工单状态
|
|
|
Boolean allowUpdate = Boolean.FALSE;
|
|
|
// 待派
|
|
|
- if ((old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I1.getCode()) ||
|
|
|
- old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I2.getCode()) ||
|
|
|
- old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I3.getCode())) &&
|
|
|
+ if ((old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G1_1.getCode()) ||
|
|
|
+ old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G2_0.getCode()) ||
|
|
|
+ old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G3.getCode())) &&
|
|
|
(old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_0.getCode()))){
|
|
|
allowUpdate = Boolean.TRUE;
|
|
|
}
|
|
|
// 改派
|
|
|
- if ((old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I3.getCode())) &&
|
|
|
+ if ((old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G3.getCode())) &&
|
|
|
(old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_0.getCode())) &&
|
|
|
- (newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I3.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I4.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I6.getCode()))){
|
|
|
+ (newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G3.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G4_0.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode()))){
|
|
|
allowUpdate = Boolean.TRUE;
|
|
|
}
|
|
|
// 待接单
|
|
|
- if ((old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I4.getCode())) &&
|
|
|
+ if ((old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G4_0.getCode())) &&
|
|
|
(old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_0.getCode())) &&
|
|
|
- (newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I7.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I8.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I9.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I10.getCode()))){
|
|
|
+ (newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G8.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G9.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode()))){
|
|
|
allowUpdate = Boolean.TRUE;
|
|
|
}
|
|
|
// 已接单
|
|
|
- if ((old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I6.getCode())) &&
|
|
|
+ if ((old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode())) &&
|
|
|
(old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_0.getCode()) ||
|
|
|
old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_1.getCode())||
|
|
|
old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_2.getCode()) ||
|
|
|
old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_3.getCode())) &&
|
|
|
- (newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I7.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I8.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I9.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I10.getCode()))){
|
|
|
+ (newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G8.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G9.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode()))){
|
|
|
allowUpdate = Boolean.TRUE;
|
|
|
}
|
|
|
// 服务人员完工
|
|
|
- if ((old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I7.getCode())) &&
|
|
|
+ if ((old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode())) &&
|
|
|
(old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_4.getCode()) ||
|
|
|
old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_1.getCode())||
|
|
|
old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_2.getCode()) ||
|
|
|
old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_3.getCode())) &&
|
|
|
- (newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I8.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I9.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I10.getCode()))){
|
|
|
+ (newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G8.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G9.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode()))){
|
|
|
allowUpdate = Boolean.TRUE;
|
|
|
}
|
|
|
// 用户改约
|
|
|
- if ((old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I5.getCode())) &&
|
|
|
+ if ((old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G5.getCode())) &&
|
|
|
(old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_5.getCode())) &&
|
|
|
- (newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I8.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I9.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I10.getCode()))){
|
|
|
+ (newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G8.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G9.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode()))){
|
|
|
allowUpdate = Boolean.TRUE;
|
|
|
}
|
|
|
// 作废申请
|
|
|
- if ((old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I2.getCode())) &&
|
|
|
+ if ((old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G2_0.getCode())) &&
|
|
|
(old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_2.getCode())) &&
|
|
|
- (newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I3.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I4.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I6.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I9.getCode()))){
|
|
|
+ (newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G3.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G4_0.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G9.getCode()))){
|
|
|
allowUpdate = Boolean.TRUE;
|
|
|
}
|
|
|
|
|
|
// 广佛作废时如果总部下载1121或1129也同步状态
|
|
|
- if (old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I9.getCode()) ||
|
|
|
- old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I10.getCode())){
|
|
|
- if (newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I2.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I3.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I4.getCode())){
|
|
|
+ if (old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G9.getCode()) ||
|
|
|
+ old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode())){
|
|
|
+ if (newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G2_0.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G3.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G4_0.getCode())){
|
|
|
allowUpdate = Boolean.TRUE;
|
|
|
} else {
|
|
|
allowUpdate = Boolean.FALSE;
|
|
@@ -771,21 +772,21 @@ public class Business {
|
|
|
} else {
|
|
|
allowUpdate = Boolean.TRUE;
|
|
|
}
|
|
|
- if ((old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I9.getCode()) ||
|
|
|
- old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I10.getCode())) &&
|
|
|
+ if ((old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G9.getCode()) ||
|
|
|
+ old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode())) &&
|
|
|
(old.getDispatchStatus().equals(DispatchStatusEnum.INSTALL_DISPATCH_STATUS_2.getCode())) &&
|
|
|
- (newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I3.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I4.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I6.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I9.getCode()))){
|
|
|
+ (newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G3.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G4_0.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G9.getCode()))){
|
|
|
allowUpdate = Boolean.TRUE;
|
|
|
}
|
|
|
|
|
|
// 广佛已自动派工,不根据总部状态更新
|
|
|
- if ((old.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I6.getCode())) &&
|
|
|
- (newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I2.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I3.getCode()) ||
|
|
|
- newLCLS.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I6.getCode()))){
|
|
|
+ if ((old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode())) &&
|
|
|
+ (newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G2_0.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G3.getCode()) ||
|
|
|
+ newLCLS.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode()))){
|
|
|
allowUpdate = Boolean.FALSE;
|
|
|
}
|
|
|
return allowUpdate;
|
|
@@ -817,7 +818,7 @@ public class Business {
|
|
|
synReqFkMxIds = fkmxs.stream().map(ItfTblAzAssignFkmxDownload::getSynReqId).collect(Collectors.toList());
|
|
|
|
|
|
// 获取安装工单主表
|
|
|
- OrderBase orderBase = getOrderBase(item, brand);
|
|
|
+ OrderBase orderBase = getAddOrderBase(item, brand);
|
|
|
// 获取工单师傅信息
|
|
|
OrderWorker orderWorker = getOrderWorker(orderBase);
|
|
|
// 获取工单机型
|
|
@@ -1235,7 +1236,7 @@ public class Business {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private OrderBase getOrderBase(ItfTblAzAssignLcLsDownload item, Brand brand) {
|
|
|
+ private OrderBase getAddOrderBase(ItfTblAzAssignLcLsDownload item, Brand brand) {
|
|
|
OrderBase orderBase = new OrderBase();
|
|
|
OrderPar orderPar = new OrderPar();
|
|
|
orderPar.setSynReqId(item.getSynReqId());
|