|
|
@ -4102,6 +4102,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
map.put("定制品集合", spaclOrderList); |
|
|
|
map.put("定制品集合", spaclOrderList); |
|
|
|
map.put("定制品合计", spaclOrderList.stream().mapToInt(map1 -> Integer.parseInt(map1.get("数量").toString())).sum()); |
|
|
|
map.put("定制品合计", spaclOrderList.stream().mapToInt(map1 -> Integer.parseInt(map1.get("数量").toString())).sum()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 通过预约单查询预约下面的订单 --1 或者 库存品 --2
|
|
|
|
|
|
|
|
List<Map<String, Object>> spaclStockList = buildSpaclOrders(distributionReservationEntity, 2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
map.put("库存品集合", spaclStockList); |
|
|
|
|
|
|
|
map.put("库存品合计", spaclStockList.stream().mapToInt(map1 -> Integer.parseInt(map1.get("数量").toString())).sum()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
map.put("备注", distributionReservationEntity.getRemarks()); |
|
|
|
map.put("备注", distributionReservationEntity.getRemarks()); |
|
|
|
|
|
|
|
|
|
|
@ -4162,6 +4168,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
|
|
|
|
|
|
|
|
map.put("定制品集合", spaclOrderList); |
|
|
|
map.put("定制品集合", spaclOrderList); |
|
|
|
map.put("定制品合计", spaclOrderList.stream().mapToInt(map1 -> Integer.parseInt(map1.get("数量").toString())).sum()); |
|
|
|
map.put("定制品合计", spaclOrderList.stream().mapToInt(map1 -> Integer.parseInt(map1.get("数量").toString())).sum()); |
|
|
|
|
|
|
|
// 通过预约单查询预约下面的订单 --1 或者 库存品 --2
|
|
|
|
|
|
|
|
List<Map<String, Object>> spaclStockList = buildSpaclOrders(distributionReservationEntity, 2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
map.put("库存品集合", spaclStockList); |
|
|
|
|
|
|
|
map.put("库存品合计", spaclStockList.stream().mapToInt(map1 -> Integer.parseInt(map1.get("数量").toString())).sum()); |
|
|
|
|
|
|
|
|
|
|
|
map.put("备注", distributionReservationEntity.getRemarks()); |
|
|
|
map.put("备注", distributionReservationEntity.getRemarks()); |
|
|
|
} |
|
|
|
} |
|
|
@ -4209,12 +4220,19 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
temp.put("合同号", distributionStockArticleEntity.getOrderCode()); |
|
|
|
temp.put("合同号", distributionStockArticleEntity.getOrderCode()); |
|
|
|
temp.put("产品名称", distributionStockArticleEntity.getDescriptionGoods()); |
|
|
|
temp.put("产品名称", distributionStockArticleEntity.getDescriptionGoods()); |
|
|
|
//todo 单位是否需要查询物料表
|
|
|
|
//todo 单位是否需要查询物料表
|
|
|
|
temp.put("单位", "件"); |
|
|
|
temp.put("单位", getUnit(distributionStockArticleEntity.getId())); |
|
|
|
temp.put("数量", distributionReservationStockarticleEntity.getReservationNum()); |
|
|
|
temp.put("数量", distributionReservationStockarticleEntity.getReservationNum()); |
|
|
|
temp.put("备货区", null); |
|
|
|
|
|
|
|
//todo 这里还没完成
|
|
|
|
|
|
|
|
temp.put("货位", null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
temp.put("备货区", getStockupArea(distributionReservationEntity.getId())); |
|
|
|
|
|
|
|
//todo 这里还没完成
|
|
|
|
|
|
|
|
//通过订单id和预约id查询对应包件的库位信息
|
|
|
|
|
|
|
|
List<String> allocationStrList = distributionReservationMapper.getAllocationByStockArticleIdAndReservationId(distributionStockArticleEntity.getId(), distributionReservationEntity.getId()); |
|
|
|
|
|
|
|
if(!allocationStrList.isEmpty()){ |
|
|
|
|
|
|
|
String allocationStr = StringUtils.join(allocationStrList, ","); |
|
|
|
|
|
|
|
temp.put("货位", allocationStr); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
temp.put("货位", null); |
|
|
|
|
|
|
|
} |
|
|
|
result.add(temp); |
|
|
|
result.add(temp); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -4222,14 +4240,70 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
distributionReservationStocklistEntities = distributionReservationStocklistService.lambdaQuery().eq(DistributionReservationStocklistEntity::getReservationId, distributionReservationEntity.getId()).list(); |
|
|
|
distributionReservationStocklistEntities = distributionReservationStocklistService.lambdaQuery().eq(DistributionReservationStocklistEntity::getReservationId, distributionReservationEntity.getId()).list(); |
|
|
|
|
|
|
|
if(distributionReservationStocklistEntities.isEmpty()){ |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 取值
|
|
|
|
|
|
|
|
for (DistributionReservationStocklistEntity reservationStocklistEntity : distributionReservationStocklistEntities) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> temp = new HashMap<>(); |
|
|
|
|
|
|
|
//查询库存品信息
|
|
|
|
|
|
|
|
DistributionStockListEntity distributionStockListEntity = distributionStockListMapper.selectById(reservationStocklistEntity.getStocklistId()); |
|
|
|
|
|
|
|
if(ObjectUtils.isNull(distributionStockListEntity)){ |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
temp.put("合同号", distributionStockListEntity.getOrderCode()); |
|
|
|
|
|
|
|
temp.put("产品名称", distributionStockListEntity.getDescriptionGoods()); |
|
|
|
|
|
|
|
//todo 单位是否需要查询物料表
|
|
|
|
|
|
|
|
temp.put("单位",Optional.ofNullable(distributionStockListEntity.getCargoUnit()).orElse(null) ); |
|
|
|
|
|
|
|
temp.put("数量", reservationStocklistEntity.getReservationNum()); |
|
|
|
|
|
|
|
temp.put("备货区", getStockupArea(distributionReservationEntity.getId())); |
|
|
|
|
|
|
|
//todo 这里还没完成
|
|
|
|
|
|
|
|
List<String> allocationList = distributionReservationMapper.getStockListAllocation(distributionStockListEntity.getId(),distributionReservationEntity.getId()); |
|
|
|
|
|
|
|
if(!allocationList.isEmpty()){ |
|
|
|
|
|
|
|
String allocationStr = StringUtils.join(allocationList, ","); |
|
|
|
|
|
|
|
temp.put("货位", allocationStr); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
temp.put("货位", null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.add(temp); |
|
|
|
|
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 查询备货区 |
|
|
|
|
|
|
|
* @param reservationId |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private String getStockupArea(Long reservationId){ |
|
|
|
|
|
|
|
List<DistributionStockupInfoEntity> list = distributionStockupInfoService.list(Wrappers.<DistributionStockupInfoEntity>query().lambda().eq(DistributionStockupInfoEntity::getReservationId, reservationId)); |
|
|
|
|
|
|
|
if(!list.isEmpty()){ |
|
|
|
|
|
|
|
DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(list.get(0).getStockupId()); |
|
|
|
|
|
|
|
return ObjectUtils.isNotNull(distributionStockupEntity) ? distributionStockupEntity.getStockupArea() : "无"; |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
return "无"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 查询物料单位 |
|
|
|
|
|
|
|
* @param stockArticleId |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private String getUnit(Long stockArticleId){ |
|
|
|
|
|
|
|
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, stockArticleId)); |
|
|
|
|
|
|
|
if(!list.isEmpty()){ |
|
|
|
|
|
|
|
return list.stream().map(ii -> ii.getMaterialUnit()).collect(Collectors.joining(",")); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
return "无"; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|