|
|
|
@ -171,11 +171,11 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
//判断是否需要创建在库订单
|
|
|
|
|
} |
|
|
|
|
//创建在库订单
|
|
|
|
|
createStockArticle(warehouseWaybill); |
|
|
|
|
createStockArticle(warehouseWaybill,allNum); |
|
|
|
|
log.info("###############waybillDataHandler: 处理数据结束 waybillNo={}", waybillNo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void createStockArticle(WarehouseWaybillEntity warehouseWaybill) { |
|
|
|
|
private void createStockArticle(WarehouseWaybillEntity warehouseWaybill,Integer allNum) { |
|
|
|
|
//判断新系统是否有这条订单数据
|
|
|
|
|
//自动生成的在库订单就用运单号作为订单号
|
|
|
|
|
String waybillNo = warehouseWaybill.getWaybillNo(); |
|
|
|
@ -254,6 +254,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
distributionStockArticleEntity.setAcceptWarehouseId(warehouseWaybill.getDestinationWarehouseId()); |
|
|
|
|
distributionStockArticleEntity.setAcceptWarehouseName(warehouseWaybill.getDestinationWarehouseName()); |
|
|
|
|
distributionStockArticleEntity.setIsZero("1"); |
|
|
|
|
distributionStockArticleEntity.setIncomingNum(allNum); |
|
|
|
|
distributionStockArticleEntity.setTenantId(TenantNum.HUITONGCODE); |
|
|
|
|
|
|
|
|
|
List<WarehouseWayBillDetail> details = warehouseWayBillDetailService.findByWaybillId(waybillId); |
|
|
|
@ -694,23 +695,39 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<WarehouseWaybillEntity> pageInfo(IPage<Object> page, Map<String, Object> warehouseWaybill) { |
|
|
|
|
public IPage<WarehouseWaybillVO> pageInfo(IPage<Object> page, Map<String, Object> warehouseWaybill) { |
|
|
|
|
WarehouseWaybillDTO warehouseWaybillDTO = JSON.parseObject(JSONObject.toJSONString(warehouseWaybill), WarehouseWaybillDTO.class); |
|
|
|
|
// QueryWrapper<WarehouseWaybillEntity> queryWrapper = Condition.getQueryWrapper(warehouseWaybill, WarehouseWaybillEntity.class);
|
|
|
|
|
//获取当前登录人仓库
|
|
|
|
|
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); |
|
|
|
|
List<Long> collect = myWatchWarehouse.stream() |
|
|
|
|
.map(BasicdataWarehouseEntity::getId) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
// queryWrapper.lambda()
|
|
|
|
|
// .in(collect.size() > 0, WarehouseWaybillEntity::getDepartureWarehouseId, collect)
|
|
|
|
|
// .or()
|
|
|
|
|
// .in(collect.size() > 0, WarehouseWaybillEntity::getDestinationWarehouseId, collect);
|
|
|
|
|
if(!collect.isEmpty()){ |
|
|
|
|
warehouseWaybillDTO.setDepartureWarehouseIds(collect); |
|
|
|
|
warehouseWaybillDTO.setDestinationWarehouseIds(collect); |
|
|
|
|
|
|
|
|
|
Long warehouseId = warehouseWaybillDTO.getWarehouseId(); |
|
|
|
|
|
|
|
|
|
IPage<WarehouseWaybillVO> warehouseWaybillVOIPage = baseMapper.pageInfo(page, warehouseWaybillDTO); |
|
|
|
|
|
|
|
|
|
List<WarehouseWaybillVO> records = warehouseWaybillVOIPage.getRecords(); |
|
|
|
|
|
|
|
|
|
for (WarehouseWaybillVO record : records) { |
|
|
|
|
String deliveryMethodStr = DictBizCache.getValue(DictBizConstant.DELIVERY_METHOD, record.getDeliveryMethod()); |
|
|
|
|
record.setDeliveryMethodStr(deliveryMethodStr); |
|
|
|
|
String urgencyStr = DictBizCache.getValue(DictBizConstant.URGENCY, record.getUrgency()); |
|
|
|
|
record.setUrgencyStr(urgencyStr); |
|
|
|
|
String statsStr = DictBizCache.getValue(DictBizConstant.WAY_BILL_STATUS, record.getStats()); |
|
|
|
|
record.setStatsStr(statsStr); |
|
|
|
|
String typeStr = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, record.getServiceType()); |
|
|
|
|
record.setServiceTypeStr(typeStr); |
|
|
|
|
String freezeStatusStr = DictBizCache.getValue(DictBizConstant.FREEZE_STATUS, record.getFreezeStatus()); |
|
|
|
|
record.setFreezeStatusStr(freezeStatusStr); |
|
|
|
|
|
|
|
|
|
Integer waybillType = record.getWaybillType(); |
|
|
|
|
if(waybillType.equals(2)){ |
|
|
|
|
String orderCode = record.getWaybillNo(); |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); |
|
|
|
|
if(!Objects.isNull(stockArticleEntity)){ |
|
|
|
|
record.setHandleNum(stockArticleEntity.getHandQuantity()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return baseMapper.pageInfo(page,warehouseWaybillDTO); |
|
|
|
|
warehouseWaybillVOIPage.setRecords(records); |
|
|
|
|
|
|
|
|
|
return warehouseWaybillVOIPage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -719,9 +736,17 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
page.setCurrent(waybillDTO.getPageNum()); |
|
|
|
|
page.setSize(waybillDTO.getPageSize()); |
|
|
|
|
|
|
|
|
|
Long warehouseId = waybillDTO.getWarehouseId(); |
|
|
|
|
|
|
|
|
|
IPage<WarehouseWaybillVO> pageList = baseMapper.pageList(page,waybillDTO); |
|
|
|
|
List<WarehouseWaybillVO> records = pageList.getRecords(); |
|
|
|
|
for (WarehouseWaybillVO record : records) { |
|
|
|
|
// Integer waybillType = record.getWaybillType();
|
|
|
|
|
// if(waybillType.equals(2)){
|
|
|
|
|
// String orderCode = record.getWaybillNo();
|
|
|
|
|
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
|
|
|
|
|
// record.setHandleNum(stockArticleEntity.getHandQuantity());
|
|
|
|
|
// }
|
|
|
|
|
Long waybillId = record.getId(); |
|
|
|
|
List<WarehouseWayBillDetail> wayBillDetailList = warehouseWayBillDetailService.findByWaybillId(waybillId); |
|
|
|
|
record.setDetailList(wayBillDetailList); |
|
|
|
|