|
|
@ -456,8 +456,12 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc |
|
|
|
|
|
|
|
|
|
|
|
stockArticleEntity.setTypeService("1");//默认商配
|
|
|
|
stockArticleEntity.setTypeService("1");//默认商配
|
|
|
|
|
|
|
|
|
|
|
|
if(!StringUtil.isBlank(waybillNo)){ |
|
|
|
if(Objects.isNull(waybillEntity)){ |
|
|
|
if(!Objects.isNull(waybillEntity)){ |
|
|
|
if(!StringUtil.isBlank(waybillNo)){ |
|
|
|
|
|
|
|
waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); |
|
|
|
|
|
|
|
if(Objects.isNull(waybillEntity)){ |
|
|
|
|
|
|
|
throw new CustomerException(405,"运单信息不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
Long consigneeId = waybillEntity.getConsigneeId(); |
|
|
|
Long consigneeId = waybillEntity.getConsigneeId(); |
|
|
|
|
|
|
|
|
|
|
|
BasicdataClientEntity clientEntity = basicdataClientClient.findEntityById(consigneeId); |
|
|
|
BasicdataClientEntity clientEntity = basicdataClientClient.findEntityById(consigneeId); |
|
|
@ -479,45 +483,67 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc |
|
|
|
if(!Objects.isNull(basicdataStoreBusinessEntity)){ |
|
|
|
if(!Objects.isNull(basicdataStoreBusinessEntity)){ |
|
|
|
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold()); |
|
|
|
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, advanceEntity.getBrand()); |
|
|
|
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, advanceEntity.getBrand()); |
|
|
|
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId); |
|
|
|
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId); |
|
|
|
if(!Objects.isNull(basicdataClientEntity)){ |
|
|
|
if(!Objects.isNull(basicdataClientEntity)){ |
|
|
|
String clientType = basicdataClientEntity.getClientType(); |
|
|
|
String clientType = basicdataClientEntity.getClientType(); |
|
|
|
if("5".equals(clientType)){ |
|
|
|
if("5".equals(clientType)){ |
|
|
|
stockArticleEntity.setStoreId(basicdataClientEntity.getId()); |
|
|
|
stockArticleEntity.setStoreId(basicdataClientEntity.getId()); |
|
|
|
stockArticleEntity.setStoreCode(basicdataClientEntity.getClientCode()); |
|
|
|
stockArticleEntity.setStoreCode(basicdataClientEntity.getClientCode()); |
|
|
|
stockArticleEntity.setStoreName(basicdataClientEntity.getClientName()); |
|
|
|
stockArticleEntity.setStoreName(basicdataClientEntity.getClientName()); |
|
|
|
//查询门店的父级商场
|
|
|
|
//查询门店的父级商场
|
|
|
|
Long pid = basicdataClientEntity.getPid(); |
|
|
|
Long pid = basicdataClientEntity.getPid(); |
|
|
|
BasicdataClientEntity pidEntity = basicdataClientClient.findEntityById(pid); |
|
|
|
BasicdataClientEntity pidEntity = basicdataClientClient.findEntityById(pid); |
|
|
|
if(!Objects.isNull(pidEntity)){ |
|
|
|
if(!Objects.isNull(pidEntity)){ |
|
|
|
String pidEntityClientType = pidEntity.getClientType(); |
|
|
|
String pidEntityClientType = pidEntity.getClientType(); |
|
|
|
if("2".equals(pidEntityClientType)){ |
|
|
|
if("2".equals(pidEntityClientType)){ |
|
|
|
//商城
|
|
|
|
//商城
|
|
|
|
stockArticleEntity.setMallId(pidEntity.getId()); |
|
|
|
stockArticleEntity.setMallId(pidEntity.getId()); |
|
|
|
stockArticleEntity.setMallName(pidEntity.getClientName()); |
|
|
|
stockArticleEntity.setMallName(pidEntity.getClientName()); |
|
|
|
stockArticleEntity.setMallCode(pidEntity.getClientCode()); |
|
|
|
stockArticleEntity.setMallCode(pidEntity.getClientCode()); |
|
|
|
|
|
|
|
|
|
|
|
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(pidEntity.getId(), 3); |
|
|
|
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(pidEntity.getId(), 3); |
|
|
|
if(!Objects.isNull(basicdataStoreBusinessEntity)){ |
|
|
|
if(!Objects.isNull(basicdataStoreBusinessEntity)){ |
|
|
|
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold()); |
|
|
|
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else if("2".equals(clientType)){ |
|
|
|
}else if("2".equals(clientType)){ |
|
|
|
//商城
|
|
|
|
//商城
|
|
|
|
stockArticleEntity.setMallId(basicdataClientEntity.getId()); |
|
|
|
stockArticleEntity.setMallId(basicdataClientEntity.getId()); |
|
|
|
stockArticleEntity.setMallName(basicdataClientEntity.getClientName()); |
|
|
|
stockArticleEntity.setMallName(basicdataClientEntity.getClientName()); |
|
|
|
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); |
|
|
|
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); |
|
|
|
|
|
|
|
|
|
|
|
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(basicdataClientEntity.getId(), 3); |
|
|
|
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(basicdataClientEntity.getId(), 3); |
|
|
|
if(!Objects.isNull(basicdataStoreBusinessEntity)){ |
|
|
|
if(!Objects.isNull(basicdataStoreBusinessEntity)){ |
|
|
|
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold()); |
|
|
|
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
Long consigneeId = waybillEntity.getConsigneeId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BasicdataClientEntity clientEntity = basicdataClientClient.findEntityById(consigneeId); |
|
|
|
|
|
|
|
if(!Objects.isNull(clientEntity)){ |
|
|
|
|
|
|
|
stockArticleEntity.setMallId(clientEntity.getId()); |
|
|
|
|
|
|
|
stockArticleEntity.setMallName(clientEntity.getClientName()); |
|
|
|
|
|
|
|
stockArticleEntity.setMallCode(clientEntity.getClientCode()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String consignee = waybillEntity.getConsignee(); |
|
|
|
|
|
|
|
String consigneeName = waybillEntity.getConsigneeName(); |
|
|
|
|
|
|
|
String consigneeMobile = waybillEntity.getConsigneeMobile(); |
|
|
|
|
|
|
|
String consigneeAddress = waybillEntity.getConsigneeAddress(); |
|
|
|
|
|
|
|
stockArticleEntity.setConsigneeUnit(consignee); |
|
|
|
|
|
|
|
stockArticleEntity.setConsigneePerson(consigneeName); |
|
|
|
|
|
|
|
stockArticleEntity.setConsigneeMobile(consigneeMobile); |
|
|
|
|
|
|
|
stockArticleEntity.setConsigneeAddress(consigneeAddress); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(consigneeId, 3); |
|
|
|
|
|
|
|
if(!Objects.isNull(basicdataStoreBusinessEntity)){ |
|
|
|
|
|
|
|
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
stockArticleEntity.setCustomerName(advanceEntity.getCustomerName()); |
|
|
|
stockArticleEntity.setCustomerName(advanceEntity.getCustomerName()); |
|
|
@ -564,19 +590,17 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc |
|
|
|
parcelList.setWarehouse(warehouseEntity.getName()); |
|
|
|
parcelList.setWarehouse(warehouseEntity.getName()); |
|
|
|
parcelList.setWarehouseId(warehouseId); |
|
|
|
parcelList.setWarehouseId(warehouseId); |
|
|
|
String waybillNo = advanceEntity.getWaybillNo(); |
|
|
|
String waybillNo = advanceEntity.getWaybillNo(); |
|
|
|
if(StringUtil.isNotBlank(waybillNo)){ |
|
|
|
if(!Objects.isNull(waybillEntity)){ |
|
|
|
if(!Objects.isNull(waybillEntity)){ |
|
|
|
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId(); |
|
|
|
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId(); |
|
|
|
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId(); |
|
|
|
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId(); |
|
|
|
parcelList.setWaybillId(waybillEntity.getId()); |
|
|
|
parcelList.setWaybillId(waybillEntity.getId()); |
|
|
|
parcelList.setWaybillNumber(waybillEntity.getWaybillNo()); |
|
|
|
parcelList.setWaybillNumber(waybillEntity.getWaybillNo()); |
|
|
|
parcelList.setSendWarehouseId(departureWarehouseId); |
|
|
|
parcelList.setSendWarehouseId(departureWarehouseId); |
|
|
|
parcelList.setSendWarehouseName(waybillEntity.getDepartureWarehouseName()); |
|
|
|
parcelList.setSendWarehouseName(waybillEntity.getDepartureWarehouseName()); |
|
|
|
parcelList.setAcceptWarehouseId(destinationWarehouseId); |
|
|
|
parcelList.setAcceptWarehouseId(destinationWarehouseId); |
|
|
|
parcelList.setAcceptWarehouseName(waybillEntity.getDestinationWarehouseName()); |
|
|
|
parcelList.setAcceptWarehouseName(waybillEntity.getDestinationWarehouseName()); |
|
|
|
if(departureWarehouseId.equals(destinationWarehouseId)){ |
|
|
|
if(departureWarehouseId.equals(destinationWarehouseId)){ |
|
|
|
parcelList.setIsTransfer(0); |
|
|
|
parcelList.setIsTransfer(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
parcelList.setConditions(1); |
|
|
|
parcelList.setConditions(1); |
|
|
|