@ -1,5 +1,6 @@
package com.logpm.factory.comfac.service.impl ;
import cn.hutool.core.util.ArrayUtil ;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper ;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper ;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils ;
@ -96,6 +97,11 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
private final IFactoryPackageDetailService factoryPackageDetailService ;
/ * *
* 目前推送的基地
* /
private String [ ] jidiCanshu = { "双流基地" , "无锡基地" } ;
/ * *
* 处理皮阿诺数据推送到汇通老库
* /
@ -147,7 +153,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceEntity . setSenderMobile ( StringUtil . isBlank ( panFactoryOrder . getSenderMobile ( ) ) ? "" : panFactoryOrder . getSenderMobile ( ) ) ; //发货人电话 可以为空
advanceEntity . setSenderAddress ( StringUtil . isBlank ( panFactoryOrder . getSenderAddress ( ) ) ? "" : panFactoryOrder . getSenderAddress ( ) ) ; //发货地址 可以为空
advanceEntity . setSenderName ( StringUtil . isBlank ( panFactoryOrder . getSendFactory ( ) ) ? "" : panFactoryOrder . getSendFactory ( ) ) ; //发货工厂名称 可以为空
advanceEntity . setAdministratorsId ( 1078 ) ; // 导入人
advanceEntity . setAdministratorsId ( 1093 ) ; // 导入人
advanceEntity . setCreateTime ( initTimestamp ( ) ) ; //添加时间
advanceEntity . setCarsNum ( "" ) ; //派车单--snm 可以为空
advanceEntity . setDeleteTime ( 0 ) ; // 删除时间
@ -221,7 +227,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity . setDeleteTime ( 0 ) ; //删除时间
advanceDetailEntity . setServiceNum ( StringUtil . isBlank ( panFactoryOrder . getServiceNum ( ) ) ? "" : panFactoryOrder . getServiceNum ( ) ) ; //服务号
advanceDetailEntity . setAdmin ( "" ) ; //
advanceDetailEntity . setAdministratorsId ( 0 ) ; //导入人
advanceDetailEntity . setAdministratorsId ( 1126 ) ; //导入人
// advanceDetailEntity.setDueDate(0);//交期
advanceDetailEntity . setRemark ( "" ) ; //备注
advanceDetailEntity . setOldId ( 0 ) ; //
@ -250,7 +256,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
detailProductEntity . setDelivernum ( Objects . isNull ( panPackageList . getQuantity ( ) ) ? 0 : panPackageList . getQuantity ( ) ) ;
detailProductEntity . setProducttype ( "" ) ;
detailProductEntity . setBuyTime ( "" ) ;
detailProductEntity . setAdministratorsId ( 0 ) ;
detailProductEntity . setAdministratorsId ( 1126 ) ;
detailProductEntity . setDeleteTime ( 0 ) ;
detailProductEntity . setCreateTime ( LocalDate . now ( ) ) ;
saveList . add ( detailProductEntity ) ;
@ -401,9 +407,18 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
// 需要从老系统进行订单数据查询
AdvanceEntity advanceEntity = findAdvanceEntityUseCacheByOrderSelfNum ( factoryOrderEntity . getSelfCode ( ) , carNumber ) ;
if ( ObjectUtils . isNull ( advanceEntity ) ) {
//todo 先阶段值推送老系统的双流和无锡
if ( ! ArrayUtil . contains ( jidiCanshu , receivingOrderEntity . getCurrentWarehouseName ( ) ) ) {
log . info ( "推送老系统失败,当前仓库不是双流和无锡,推送失败 {}" , receivingOrderEntity . getCurrentWarehouseName ( ) ) ;
continue ;
}
advanceEntity = new AdvanceEntity ( ) ;
advanceEntity . setOrderSelfNum ( StringUtil . isBlank ( factoryOrderEntity . getSelfCode ( ) ) ? "" : factoryOrderEntity . getSelfCode ( ) ) ; //订单自编号
advanceEntity . setSiteName ( "" ) ; // 基地 TODO 需要映射
advanceEntity . setSiteName ( receivingOrderEntity . getCurrentWarehouseName ( ) ) ; // 基地 TODO 需要映射
advanceEntity . setArea ( "" ) ; // 区域
advanceEntity . setOrderTypeName ( "" ) ; //订单类型名称 可以为空
advanceEntity . setOrderClassName ( "工厂" ) ; //订单类型 可以为空
@ -434,13 +449,19 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceEntity . setSenderMobile ( "" ) ; //发货人电话 可以为空
advanceEntity . setSenderAddress ( "" ) ; //发货地址 可以为空
advanceEntity . setSenderName ( "" ) ; //发货工厂名称 可以为空
advanceEntity . setAdministratorsId ( 1078 ) ; // 导入人
advanceEntity . setAdministratorsId ( 1126 ) ; // 导入人
advanceEntity . setCreateTime ( initTimestamp ( ) ) ; //添加时间
advanceEntity . setCarsNum ( receivingOrderEntity . getCarNumber ( ) ) ;
advanceEntity . setDeleteTime ( 0 ) ; // 删除时间
advanceEntity . setWaybillNo ( "" ) ; //运单号 可以为空
// Integer id = PanFactoryEnum.getId(panFactoryOrder.getPlantId());
advanceEntity . setWarehouseId ( 141 ) ; //导入人仓库id TODO 需要提供映射
advanceEntity . setWaybillStatus ( Byte . parseByte ( "1" ) ) ; //开单状态:1=未开单,2=已开单
advanceEntity . setOldId ( 0 ) ; //
advanceEntity . setFreeze ( Byte . parseByte ( "1" ) ) ; //冻结状态:1=正常,2=冻结
@ -538,7 +559,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity . setDeleteTime ( 0 ) ; //删除时间
advanceDetailEntity . setServiceNum ( StringUtil . isBlank ( advanceEntity . getServiceNum ( ) ) ? "" : advanceEntity . getServiceNum ( ) ) ; //服务号
advanceDetailEntity . setAdmin ( "" ) ; //
advanceDetailEntity . setAdministratorsId ( 0 ) ; //导入人
advanceDetailEntity . setAdministratorsId ( 1126 ) ; //导入人
advanceDetailEntity . setRemark ( "" ) ; //备注
advanceDetailEntity . setOldId ( 0 ) ; //
Integer detailId = advanceDetailClient . addAdvanceDetail ( advanceDetailEntity ) ;
@ -657,7 +678,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
detailProductEntity . setDelivernum ( Objects . isNull ( zbPackageInfoEntity . getPlanQty ( ) ) ? 0 : zbPackageInfoEntity . getPlanQty ( ) ) ;
detailProductEntity . setProducttype ( "" ) ;
detailProductEntity . setBuyTime ( "" ) ;
detailProductEntity . setAdministratorsId ( 0 ) ;
detailProductEntity . setAdministratorsId ( 1126 ) ;
detailProductEntity . setDeleteTime ( 0 ) ;
detailProductEntity . setCreateTime ( LocalDate . now ( ) ) ;
saveList . add ( detailProductEntity ) ;
@ -697,7 +718,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
detailProductEntity . setDelivernum ( 1 ) ;
detailProductEntity . setProducttype ( "" ) ;
detailProductEntity . setBuyTime ( "" ) ;
detailProductEntity . setAdministratorsId ( 0 ) ;
detailProductEntity . setAdministratorsId ( 1126 ) ;
detailProductEntity . setDeleteTime ( 0 ) ;
detailProductEntity . setCreateTime ( LocalDate . now ( ) ) ;
saveList . add ( detailProductEntity ) ;
@ -781,7 +802,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity . setDeleteTime ( 0 ) ; //删除时间
advanceDetailEntity . setServiceNum ( StringUtil . isBlank ( advanceEntity . getServiceNum ( ) ) ? "" : advanceEntity . getServiceNum ( ) ) ; //服务号
advanceDetailEntity . setAdmin ( "" ) ; //
advanceDetailEntity . setAdministratorsId ( 0 ) ; //导入人
advanceDetailEntity . setAdministratorsId ( 1126 ) ; //导入人
// advanceDetailEntity.setDueDate(0);//交期
advanceDetailEntity . setRemark ( "" ) ; //备注
advanceDetailEntity . setOldId ( 0 ) ; //
@ -881,8 +902,8 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceEntity . setSenderMobile ( StringUtil . isBlank ( zbReceiptEntity . getSenderMobile ( ) ) ? "" : zbReceiptEntity . getSenderMobile ( ) ) ; //发货人电话 可以为空
advanceEntity . setSenderAddress ( StringUtil . isBlank ( zbReceiptEntity . getSenderAddress ( ) ) ? "" : zbReceiptEntity . getSenderAddress ( ) ) ; //发货地址 可以为空
advanceEntity . setSenderName ( StringUtil . isBlank ( zbReceiptEntity . getSenderName ( ) ) ? "" : zbReceiptEntity . getSenderName ( ) ) ; //发货工厂名称 可以为空
// todo 需要运营提供 1080为线上测试环境
advanceEntity . setAdministratorsId ( 1080 ) ; // 导入人
// todo 需要运营提供 1080为线上测试环境 1126为正式
advanceEntity . setAdministratorsId ( 1126 ) ; // 导入人
advanceEntity . setCreateTime ( initTimestamp ( ) ) ; //添加时间
advanceEntity . setCarsNum ( "" ) ; //派车单--snm 可以为空
advanceEntity . setDeleteTime ( 0 ) ; // 删除时间
@ -1033,7 +1054,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceEntity . setSenderMobile ( "" ) ; //发货人电话 可以为空
advanceEntity . setSenderAddress ( "" ) ; //发货地址 可以为空
advanceEntity . setSenderName ( "" ) ; //发货工厂名称 可以为空
advanceEntity . setAdministratorsId ( 1078 ) ; // 导入人
advanceEntity . setAdministratorsId ( 1094 ) ; // 导入人
advanceEntity . setCreateTime ( initTimestamp ( ) ) ; //添加时间
advanceEntity . setCarsNum ( StringUtil . isBlank ( mtFactoryOrderMain . getInvoiceOrderCode ( ) ) ? "" : mtFactoryOrderMain . getInvoiceOrderCode ( ) ) ; //派车单--snm 可以为空
advanceEntity . setDeleteTime ( 0 ) ; // 删除时间
@ -1071,7 +1092,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity . setDeleteTime ( 0 ) ; //删除时间
advanceDetailEntity . setServiceNum ( StringUtil . isBlank ( mtFactoryOrder . getMainOrderCode ( ) ) ? "" : mtFactoryOrder . getMainOrderCode ( ) ) ; //服务号
advanceDetailEntity . setAdmin ( "" ) ; //
advanceDetailEntity . setAdministratorsId ( 0 ) ; //导入人
advanceDetailEntity . setAdministratorsId ( 1 094 ) ; //导入人
// advanceDetailEntity.setDueDate(0);//交期
advanceDetailEntity . setRemark ( "" ) ; //备注
advanceDetailEntity . setOldId ( 0 ) ; //