|
|
|
@ -15,6 +15,7 @@ import lombok.extern.log4j.Log4j2;
|
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
@Log4j2 |
|
|
|
@ -26,24 +27,30 @@ public class SyncServiceTypeServiceImpl implements ISyncServiceTypeService {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void syncServiceType(String id, String warehouseName, String mallName) { |
|
|
|
|
//根据包件码查询出订单号
|
|
|
|
|
DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findByOrderPackageCodeAndStatus(id); |
|
|
|
|
if (distributionParcelListEntity==null){ |
|
|
|
|
throw new ServiceException("订单号不存在"); |
|
|
|
|
} |
|
|
|
|
Long stockArticleId = distributionParcelListEntity.getStockArticleId(); |
|
|
|
|
//判断那个是仓库名称和商店名称谁是null
|
|
|
|
|
if (Objects.isNull(warehouseName) || warehouseName.isEmpty()){ |
|
|
|
|
//用订单和商店名称来操作 //修改商场名称 id code 服务类型 收货单位
|
|
|
|
|
|
|
|
|
|
syncServiceTypeMapper.syncServiceTypeByMallName(stockArticleId,mallName); |
|
|
|
|
//运单号查出包件码
|
|
|
|
|
|
|
|
|
|
}else if(Objects.isNull(mallName) || mallName.isEmpty()){ |
|
|
|
|
//用订单号和仓库名称来操作
|
|
|
|
|
syncServiceTypeMapper.syncServiceTypeByWarehouseName(stockArticleId,warehouseName); |
|
|
|
|
}else { |
|
|
|
|
throw new ServiceException("请传入仓库名称或商店名称"); |
|
|
|
|
List<DistributionParcelListEntity> parcelList = distributionParcelListClient.findByWaybillId(id); |
|
|
|
|
if (parcelList==null || parcelList.size()==0){ |
|
|
|
|
throw new ServiceException("运单号不存在"); |
|
|
|
|
} |
|
|
|
|
//根据包件码查询出订单号
|
|
|
|
|
for (DistributionParcelListEntity distributionParcelList : parcelList) { |
|
|
|
|
Long stockArticleId = distributionParcelList.getStockArticleId(); |
|
|
|
|
if (Objects.nonNull(warehouseName)&& Objects.nonNull(mallName)){ |
|
|
|
|
// 用warehouseName 和 mallName 来操作
|
|
|
|
|
|
|
|
|
|
}else |
|
|
|
|
//判断那个是仓库名称和商店名称谁是null
|
|
|
|
|
if (Objects.nonNull(mallName) ){ |
|
|
|
|
//用订单和商店名称来操作 //修改商场名称 id code 服务类型 收货单位
|
|
|
|
|
syncServiceTypeMapper.syncServiceTypeByMallName(stockArticleId,mallName); |
|
|
|
|
}else if(Objects.nonNull(warehouseName) ){ |
|
|
|
|
//用订单号和仓库名称来操作
|
|
|
|
|
syncServiceTypeMapper.syncServiceTypeByWarehouseName(stockArticleId,warehouseName); |
|
|
|
|
}else { |
|
|
|
|
throw new ServiceException("请传入仓库名称或商店名称"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|