|
|
|
@ -18,13 +18,13 @@ import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity;
|
|
|
|
|
import com.logpm.aftersales.feign.IAftersalesAbnormalRecordClient; |
|
|
|
|
import com.logpm.aftersales.feign.IAftersalesWorkOrderClient; |
|
|
|
|
import com.logpm.aftersales.vo.DealWithAbnormalVO; |
|
|
|
|
import com.logpm.basic.entity.BasicMaterialEntity; |
|
|
|
|
import com.logpm.basic.feign.IBasicMaterialClient; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataClientEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataTrayEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataCodeClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataDriverArteryClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataTrayClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; |
|
|
|
|
import com.logpm.basicdata.feign.*; |
|
|
|
|
import com.logpm.distribution.dto.FindParamterDTO; |
|
|
|
|
import com.logpm.distribution.dto.UpdatePackageDTO; |
|
|
|
|
import com.logpm.distribution.entity.DistributionParcelListEntity; |
|
|
|
@ -138,6 +138,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
private final ITrunklineCarsLoadLinePhotoService carsLoadLinePhotoService; |
|
|
|
|
private final ITrunklineAdvanceService advanceService; |
|
|
|
|
private final BladeRedis bladeRedis; |
|
|
|
|
private final IBasicdataClientClient clientClient; |
|
|
|
|
private final IBasicdataTripartiteMallClient tripartiteMallClient; |
|
|
|
|
private final IBasicMaterialClient basicMaterialClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -227,6 +230,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Integer startCarType = loadCarsDTO.getStartCarType(); |
|
|
|
|
Long warehouseId = loadCarsDTO.getWarehouseId(); |
|
|
|
|
String fullLoadRate = loadCarsDTO.getFullLoadRate(); |
|
|
|
|
String startDate1 = loadCarsDTO.getStartDate();//TODO 加入发车时间
|
|
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); |
|
|
|
|
if (Objects.isNull(warehouseEntity)) { |
|
|
|
@ -4549,8 +4553,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
BigDecimal countTransportCost = carsLoadEntity.getCountTransportCost(); |
|
|
|
|
Integer unloadNumber = carsLoadEntity.getUnloadNumber(); |
|
|
|
|
|
|
|
|
|
BigDecimal freightPrice = countTransportCost.divide(new BigDecimal(unloadNumber),2, RoundingMode.HALF_UP); |
|
|
|
|
BigDecimal freightPrice; |
|
|
|
|
if(!NumberUtil.equals(unloadNumber,0)){ |
|
|
|
|
freightPrice = countTransportCost.divide(new BigDecimal(unloadNumber),2, RoundingMode.HALF_UP); |
|
|
|
|
} else { |
|
|
|
|
freightPrice = BigDecimal.ZERO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<TrunklineCarsLoadLineEntity> loadLineList = trunklineCarsLoadLineService.findListByLoadId(loadId); |
|
|
|
|
|
|
|
|
@ -4821,6 +4829,391 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
return R.data(trunklineCarsLoadVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void syncUnloadData() { |
|
|
|
|
|
|
|
|
|
log.info("############syncUnloadData: 同步卸车数据 开始"); |
|
|
|
|
|
|
|
|
|
List<JSONObject> ls = trunklineAdvanceDetailService.findAllUnloadData(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (JSONObject json : ls) { |
|
|
|
|
Integer id = json.getInteger("id"); |
|
|
|
|
String orderPackageCode = json.getString("orderPackageCode"); |
|
|
|
|
try{ |
|
|
|
|
|
|
|
|
|
log.info("###############syncUnloadData: 当前处理的包件 orderPackageCode={}",orderPackageCode); |
|
|
|
|
|
|
|
|
|
TrunklineAdvanceDetailEntity advanceDetailEntity = trunklineAdvanceDetailService.findEntityByOrderPackageCode(orderPackageCode); |
|
|
|
|
if(Objects.isNull(advanceDetailEntity)){ |
|
|
|
|
log.info("############syncUnloadData: 暂存单不存在 orderPackageCode={}",orderPackageCode); |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
String packageStatus = advanceDetailEntity.getPackageStatus(); |
|
|
|
|
Long incomingWarehouseId = advanceDetailEntity.getIncomingWarehouseId(); |
|
|
|
|
String incomeCategoryName = advanceDetailEntity.getIncomeCategoryName(); |
|
|
|
|
Long nowWarehouseId = advanceDetailEntity.getNowWarehouseId(); |
|
|
|
|
String nowWarehouseName = advanceDetailEntity.getNowWarehouseName(); |
|
|
|
|
Long warehouseId = advanceDetailEntity.getWarehouseId(); |
|
|
|
|
String warehouseName = advanceDetailEntity.getWarehouseName(); |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findOneByOrderPackageCode(orderPackageCode); |
|
|
|
|
|
|
|
|
|
if(packageStatus.equals("0")){ |
|
|
|
|
//未入库 判断当前包件入库最后的仓库有无数据
|
|
|
|
|
if(!Objects.isNull(distributionParcelListEntity)){ |
|
|
|
|
//如果有数据,则把暂存单入库并
|
|
|
|
|
advanceDetailEntity.setPackageStatus("1"); |
|
|
|
|
Long parcelListWarehouseId = distributionParcelListEntity.getWarehouseId(); |
|
|
|
|
String parcelListWarehouse = distributionParcelListEntity.getWarehouse(); |
|
|
|
|
//判断当前包件所在仓与导入仓库是否一致,一致则不插入
|
|
|
|
|
if(parcelListWarehouseId.equals(warehouseId)){ |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseId(parcelListWarehouseId); |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseName(parcelListWarehouse); |
|
|
|
|
}else{ |
|
|
|
|
//如果不一致,则把包件插入到入库仓库状态为60
|
|
|
|
|
advanceDetailEntity.setIncomingWarehouseId(warehouseId); |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseName(warehouseName); |
|
|
|
|
|
|
|
|
|
log.info("#################syncUnloadData 1111 orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,warehouseId,"60"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
advanceDetailEntity.setNowWarehouseId(parcelListWarehouseId); |
|
|
|
|
advanceDetailEntity.setNowWarehouseName(parcelListWarehouse); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
//暂存单包件已入库
|
|
|
|
|
if(!Objects.isNull(nowWarehouseId)){ |
|
|
|
|
//当前所在仓id不为空
|
|
|
|
|
if(!Objects.isNull(distributionParcelListEntity)){ |
|
|
|
|
//判断当前所包件所在仓有数据
|
|
|
|
|
Long warehouseId1 = distributionParcelListEntity.getWarehouseId(); |
|
|
|
|
String warehouse = distributionParcelListEntity.getWarehouse(); |
|
|
|
|
if(!nowWarehouseId.equals(warehouseId1)){ |
|
|
|
|
//判断当前仓库与包件所在仓库是否一致,不一致则判断当前所在仓包件有无入库
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, nowWarehouseId); |
|
|
|
|
if(Objects.isNull(parcelListEntity)){ |
|
|
|
|
//未入库
|
|
|
|
|
|
|
|
|
|
log.info("#################syncUnloadData 22222 orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,nowWarehouseId,"20"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
advanceDetailEntity.setNowWarehouseId(warehouseId1); |
|
|
|
|
advanceDetailEntity.setNowWarehouseName(warehouse); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
if(Objects.isNull(incomingWarehouseId)){ |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseId(warehouseId); |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseName(warehouseName); |
|
|
|
|
if(warehouseId.equals(nowWarehouseId)){ |
|
|
|
|
|
|
|
|
|
log.info("#################syncUnloadData 333333 orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,warehouseId,"20"); |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
log.info("#################syncUnloadData 44444 orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,warehouseId,"60"); |
|
|
|
|
log.info("#################syncUnloadData 55555 orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,nowWarehouseId,"20"); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
if(nowWarehouseId.equals(incomingWarehouseId)){ |
|
|
|
|
log.info("#################syncUnloadData 66666 orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,nowWarehouseId,"20"); |
|
|
|
|
}else{ |
|
|
|
|
log.info("#################syncUnloadData 7777 orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,incomingWarehouseId,"60"); |
|
|
|
|
log.info("#################syncUnloadData 88888 orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,nowWarehouseId,"20"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
if(!Objects.isNull(distributionParcelListEntity)){ |
|
|
|
|
|
|
|
|
|
Long warehouseId1 = distributionParcelListEntity.getWarehouseId(); |
|
|
|
|
String warehouse = distributionParcelListEntity.getWarehouse(); |
|
|
|
|
if(Objects.isNull(incomingWarehouseId)){ |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseId(warehouseId); |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseName(warehouseName); |
|
|
|
|
advanceDetailEntity.setNowWarehouseId(warehouseId1); |
|
|
|
|
advanceDetailEntity.setNowWarehouseName(warehouse); |
|
|
|
|
log.info("#################syncUnloadData 99999 orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,warehouseId,"60"); |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
advanceDetailEntity.setNowWarehouseId(warehouseId1); |
|
|
|
|
advanceDetailEntity.setNowWarehouseName(warehouse); |
|
|
|
|
if(!incomingWarehouseId.equals(warehouseId1)){ |
|
|
|
|
log.info("#################syncUnloadData 000000 orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,incomingWarehouseId,"60"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
if(Objects.isNull(incomingWarehouseId)){ |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseId(warehouseId); |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseName(warehouseName); |
|
|
|
|
advanceDetailEntity.setNowWarehouseId(warehouseId); |
|
|
|
|
advanceDetailEntity.setNowWarehouseName(warehouseName); |
|
|
|
|
log.info("#################syncUnloadData aaaaaa orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,warehouseId,"20"); |
|
|
|
|
}else{ |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseId(incomingWarehouseId); |
|
|
|
|
advanceDetailEntity.setIncomingWarehouseName(incomeCategoryName); |
|
|
|
|
advanceDetailEntity.setNowWarehouseId(incomingWarehouseId); |
|
|
|
|
advanceDetailEntity.setNowWarehouseName(incomeCategoryName); |
|
|
|
|
|
|
|
|
|
log.info("#################syncUnloadData bbbbbbb orderPackageCode={}",orderPackageCode); |
|
|
|
|
//更新包件到指定仓并且状态为20
|
|
|
|
|
updateParcelListToWarehouse(advanceDetailEntity,incomingWarehouseId,"20"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
trunklineAdvanceDetailService.updateSyncUnloadDataStatus(id,1); |
|
|
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.warn("###############syncUnloadData: 包件处理失败 orderPackageCode={}", orderPackageCode); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
log.info("############syncUnloadData: 同步卸车数据 完成"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void updateParcelListToWarehouse(TrunklineAdvanceDetailEntity advanceDetailEntity, Long warehouseId, String status) { |
|
|
|
|
String orderPackageCode = advanceDetailEntity.getOrderPackageCode(); |
|
|
|
|
String orderCode = advanceDetailEntity.getOrderCode(); |
|
|
|
|
String waybillNo = advanceDetailEntity.getWaybillNo(); |
|
|
|
|
Long advanceId = advanceDetailEntity.getAdvanceId(); |
|
|
|
|
TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId); |
|
|
|
|
|
|
|
|
|
Integer total = trunklineAdvanceDetailService.findTotalNumByOrderCode(orderCode); |
|
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); |
|
|
|
|
String warehouseName = warehouseEntity.getName(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if("20".equals(status)){ |
|
|
|
|
List<DistributionParcelListEntity> list = distributionParcelListClient.findListByOrderPackageCodeAndStatus(orderPackageCode,"20"); |
|
|
|
|
//把list通过warehouseId进行分组
|
|
|
|
|
List<DistributionParcelListEntity> updateParceList = new ArrayList<>(); |
|
|
|
|
if(CollUtil.isNotEmpty(list)){ |
|
|
|
|
list.forEach(distributionParcelListEntity -> { |
|
|
|
|
DistributionParcelListEntity updateEntity = new DistributionParcelListEntity(); |
|
|
|
|
updateEntity.setId(distributionParcelListEntity.getId()); |
|
|
|
|
updateEntity.setOrderPackageStatus("60"); |
|
|
|
|
updateParceList.add(updateEntity); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
distributionParcelListClient.updateList(updateParceList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); |
|
|
|
|
Date date = new Date(); |
|
|
|
|
|
|
|
|
|
Long orderId = null; |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); |
|
|
|
|
if(Objects.isNull(stockArticleEntity)){ |
|
|
|
|
stockArticleEntity = new DistributionStockArticleEntity(); |
|
|
|
|
stockArticleEntity.setOrderCode(orderCode); |
|
|
|
|
stockArticleEntity.setServiceNumber(advanceEntity.getServiceNum()); |
|
|
|
|
stockArticleEntity.setWaybillNumber(waybillNo); |
|
|
|
|
stockArticleEntity.setTotalNumber(total); |
|
|
|
|
stockArticleEntity.setHandQuantity(0); |
|
|
|
|
// stockArticleEntity.setTenantId(TenantNum.HUITONGCODE);// 对应租户ID
|
|
|
|
|
stockArticleEntity.setWarehouse(warehouseName); |
|
|
|
|
stockArticleEntity.setWarehouseId(warehouseId); |
|
|
|
|
stockArticleEntity.setBrand(advanceEntity.getBrand()); |
|
|
|
|
stockArticleEntity.setDescriptionGoods(advanceEntity.getPackName()); |
|
|
|
|
stockArticleEntity.setWarehouseEntryTime(date); |
|
|
|
|
stockArticleEntity.setGenre(1); |
|
|
|
|
|
|
|
|
|
String dealerName = advanceEntity.getDealerName();//暂存单经销商名称
|
|
|
|
|
stockArticleEntity.setDealerCode(advanceEntity.getDealerCode()); |
|
|
|
|
stockArticleEntity.setDealerName(advanceEntity.getDealerName()); |
|
|
|
|
|
|
|
|
|
stockArticleEntity.setTypeService("1");//默认商配
|
|
|
|
|
|
|
|
|
|
if (!Objects.isNull(waybillEntity)) { |
|
|
|
|
|
|
|
|
|
Long consigneeId = waybillEntity.getConsigneeId(); |
|
|
|
|
String consigneeName1 = waybillEntity.getConsignee(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BasicdataClientEntity clientEntity = clientClient.getMallById(consigneeId); |
|
|
|
|
// 如果在入库的时候发现客户信息不存在,则不设置客户信息 默认采用商配
|
|
|
|
|
if (!Objects.isNull(clientEntity)) { |
|
|
|
|
stockArticleEntity.setMallId(clientEntity.getId()); |
|
|
|
|
stockArticleEntity.setMallName(clientEntity.getClientName()); |
|
|
|
|
stockArticleEntity.setMallCode(clientEntity.getClientCode()); |
|
|
|
|
|
|
|
|
|
stockArticleEntity.setTypeService(clientEntity.getTypeService()+""); |
|
|
|
|
} |
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
Long clientId = tripartiteMallClient.getClientIdByNameAndBrand(dealerName, advanceEntity.getBrand()); |
|
|
|
|
BasicdataClientEntity basicdataClientEntity = clientClient.findEntityById(clientId); |
|
|
|
|
if (!Objects.isNull(basicdataClientEntity)) { |
|
|
|
|
String clientType = basicdataClientEntity.getClientType(); |
|
|
|
|
if ("5".equals(clientType)) { |
|
|
|
|
stockArticleEntity.setStoreId(basicdataClientEntity.getId()); |
|
|
|
|
stockArticleEntity.setStoreCode(basicdataClientEntity.getClientCode()); |
|
|
|
|
stockArticleEntity.setStoreName(basicdataClientEntity.getClientName()); |
|
|
|
|
//查询门店的父级商场
|
|
|
|
|
Long pid = basicdataClientEntity.getPid(); |
|
|
|
|
BasicdataClientEntity pidEntity = clientClient.findEntityById(pid); |
|
|
|
|
if (!Objects.isNull(pidEntity)) { |
|
|
|
|
String pidEntityClientType = pidEntity.getClientType(); |
|
|
|
|
if ("2".equals(pidEntityClientType)) { |
|
|
|
|
//商城
|
|
|
|
|
stockArticleEntity.setMallId(pidEntity.getId()); |
|
|
|
|
stockArticleEntity.setMallName(pidEntity.getClientName()); |
|
|
|
|
stockArticleEntity.setMallCode(pidEntity.getClientCode()); |
|
|
|
|
|
|
|
|
|
stockArticleEntity.setTypeService(pidEntity.getTypeService()+""); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else if ("2".equals(clientType)) { |
|
|
|
|
//商城
|
|
|
|
|
stockArticleEntity.setMallId(basicdataClientEntity.getId()); |
|
|
|
|
stockArticleEntity.setMallName(basicdataClientEntity.getClientName()); |
|
|
|
|
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); |
|
|
|
|
|
|
|
|
|
stockArticleEntity.setTypeService(basicdataClientEntity.getTypeService()+""); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
stockArticleEntity.setCustomerName(advanceEntity.getCustomerName()); |
|
|
|
|
stockArticleEntity.setCustomerTelephone(advanceEntity.getCustomerPhone()); |
|
|
|
|
stockArticleEntity.setCustomerAddress(advanceEntity.getCustomerAddress()); |
|
|
|
|
stockArticleEntity.setStockupStatus("10"); |
|
|
|
|
stockArticleEntity.setReservationStatus("10"); |
|
|
|
|
stockArticleEntity.setOrderStatus("0"); |
|
|
|
|
stockArticleEntity.setGroundingStatus("10"); |
|
|
|
|
stockArticleEntity.setOrderReceiveStatus("10"); |
|
|
|
|
stockArticleEntity.setFreezeStatus("10"); |
|
|
|
|
stockArticleEntity.setNotification(2); |
|
|
|
|
stockArticleEntity.setIsHaveData(2); |
|
|
|
|
stockArticleEntity.setTrainNumber(advanceEntity.getTrainNumber()); |
|
|
|
|
stockArticleEntity.setSortingQuantity(0); |
|
|
|
|
stockArticleEntity.setDeliveryQuantity(0); |
|
|
|
|
stockArticleEntity.setTransferQuantity(0); |
|
|
|
|
stockArticleEntity.setSigninQuantity(0); |
|
|
|
|
orderId = distributionStockArticleClient.addData(stockArticleEntity); |
|
|
|
|
if(NumberUtil.equals(orderId,0)){ |
|
|
|
|
log.warn("################111111: 保存失败"); |
|
|
|
|
throw new CustomerException(405,"保存失败"); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
stockArticleEntity.setGenre(1); |
|
|
|
|
stockArticleEntity.setTotalNumber(total); |
|
|
|
|
orderId = stockArticleEntity.getId(); |
|
|
|
|
distributionStockArticleClient.updateEntity(stockArticleEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntity parcelList = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId); |
|
|
|
|
if(Objects.isNull(parcelList)){ |
|
|
|
|
parcelList = new DistributionParcelListEntity(); |
|
|
|
|
parcelList.setWarehouse(warehouseEntity.getName()); |
|
|
|
|
parcelList.setWarehouseId(warehouseId); |
|
|
|
|
parcelList.setIsTransfer(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Objects.isNull(waybillEntity)) { |
|
|
|
|
parcelList.setWaybillId(waybillEntity.getId()); |
|
|
|
|
parcelList.setWaybillNumber(waybillEntity.getWaybillNo()); |
|
|
|
|
parcelList.setSendWarehouseId(waybillEntity.getDepartureWarehouseId()); |
|
|
|
|
parcelList.setSendWarehouseName(waybillEntity.getDepartureWarehouseName()); |
|
|
|
|
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId(); |
|
|
|
|
parcelList.setAcceptWarehouseId(destinationWarehouseId); |
|
|
|
|
parcelList.setAcceptWarehouseName(waybillEntity.getDestinationWarehouseName()); |
|
|
|
|
if (warehouseId.equals(destinationWarehouseId)) { |
|
|
|
|
parcelList.setIsTransfer(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
parcelList.setConditions(1); |
|
|
|
|
parcelList.setOrderPackageCode(orderPackageCode); |
|
|
|
|
parcelList.setFirsts(advanceDetailEntity.getFirstPackName()); |
|
|
|
|
parcelList.setSecond(advanceDetailEntity.getSecondPackName()); |
|
|
|
|
parcelList.setThirdProduct(advanceDetailEntity.getThirdPackName()); |
|
|
|
|
parcelList.setQuantity(1); |
|
|
|
|
parcelList.setStockArticleId(orderId); |
|
|
|
|
parcelList.setOrderCode(orderCode); |
|
|
|
|
parcelList.setServiceNumber(advanceDetailEntity.getServiceNum()); |
|
|
|
|
parcelList.setTrainNumber(advanceDetailEntity.getTrainNumber()); |
|
|
|
|
parcelList.setAdvanceId(advanceId); |
|
|
|
|
|
|
|
|
|
Long materialId = advanceDetailEntity.getMaterialId(); |
|
|
|
|
String materialCode = advanceDetailEntity.getMaterialCode(); |
|
|
|
|
String materialName = advanceDetailEntity.getMaterialName(); |
|
|
|
|
if (Objects.isNull(materialId)) { |
|
|
|
|
if (StringUtil.isNotBlank(materialCode) && StringUtil.isNotBlank(materialCode) && StringUtil.isNotBlank(materialName)) { |
|
|
|
|
BasicMaterialEntity materialEntity = basicMaterialClient.findEntityByCodeAndName(materialCode, materialName); |
|
|
|
|
if (!Objects.isNull(materialEntity)) { |
|
|
|
|
parcelList.setMaterialId(materialEntity.getId()); |
|
|
|
|
parcelList.setMaterialName(materialEntity.getName()); |
|
|
|
|
parcelList.setMaterialCode(materialEntity.getProductCode()); |
|
|
|
|
parcelList.setMaterialUnit(materialEntity.getSpecification()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(materialId); |
|
|
|
|
if (!Objects.isNull(materialOwnId)) { |
|
|
|
|
parcelList.setMaterialId(materialOwnId.getId()); |
|
|
|
|
parcelList.setMaterialName(materialOwnId.getName()); |
|
|
|
|
parcelList.setMaterialCode(materialOwnId.getProductCode()); |
|
|
|
|
parcelList.setMaterialUnit(materialOwnId.getSpecification()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
parcelList.setBrandName(advanceDetailEntity.getBrand()); |
|
|
|
|
parcelList.setOrderPackageStatus(status); |
|
|
|
|
parcelList.setOrderPackageFreezeStatus("10"); |
|
|
|
|
parcelList.setOrderPackageGroundingStatus("10"); |
|
|
|
|
parcelList.setOrderPackageStockupStatus("10"); |
|
|
|
|
parcelList.setOrderPackageReservationStatus("10"); |
|
|
|
|
parcelList.setOrderPackageLoadingStatus("10"); |
|
|
|
|
parcelList.setWarehouseEntryTimeEnd(date); |
|
|
|
|
parcelList.setDealerCode(stockArticleEntity.getDealerCode()); |
|
|
|
|
parcelList.setDealerName(stockArticleEntity.getDealerName()); |
|
|
|
|
distributionParcelListClient.addReturnId(parcelList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R carsLoadDetailInfo(LoadCarsDTO loadCarsDTO) { |
|
|
|
@ -5288,7 +5681,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
String audio = null; |
|
|
|
|
String orders = null; |
|
|
|
|
if (0 == isZero) { |
|
|
|
|
unloadPackage(loadId, orderPackageCode, warehouseId, 1, "卸分一体 卸车", incomingType,palletName,trayCode); |
|
|
|
|
unloadPackage(loadId, orderPackageCode, warehouseId, 1, "卸分一体 卸车", incomingType, palletName, trayCode); |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("trayType", trayType); |
|
|
|
|
map.put("trayCode", trayCode); |
|
|
|
@ -7714,13 +8107,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
log.warn("############signLoadScanByIds: 车辆还未发车 loadId={}", loadId); |
|
|
|
|
return R.fail(405, "车辆还未发车"); |
|
|
|
|
} |
|
|
|
|
if("90".equals(loadStatus)){ |
|
|
|
|
log.warn("############signLoadScanByIds: 车辆已签收 loadStatus={}", loadStatus); |
|
|
|
|
return R.fail(405, "车辆已签收"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(!"40".equals(loadStatus)){ |
|
|
|
|
if(!"40".equals(loadStatus)||!"91".equals(loadStatus)){ |
|
|
|
|
log.warn("############signLoadScanByIds: 车辆还未到达 loadStatus={}", loadStatus); |
|
|
|
|
return R.fail(405, "车辆还未到达"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer realLoadingNumber = carsLoadEntity.getRealLoadingNumber(); |
|
|
|
|
String deliveryType = carsLoadEntity.getDeliveryType(); |
|
|
|
|
|
|
|
|
@ -10747,7 +11146,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
if(exists){ |
|
|
|
|
return R.fail("正在同步中,请勿重复操作"); |
|
|
|
|
}else{ |
|
|
|
|
bladeRedis.set(key,"1"); |
|
|
|
|
bladeRedis.setEx(key,"1",60L); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|