master:生产需求列表打印条码返回面料材质和内里材质;

pull/1121/head
liujiang 2025-11-24 23:36:35 +08:00
parent efedb86f7d
commit 56a4a4da58
3 changed files with 20 additions and 3 deletions

View File

@ -33,9 +33,9 @@ public class StoreProdColorResDTO {
private BigDecimal producePrice;
@ApiModelProperty(value = "排序")
private Integer orderNum;
@ApiModelProperty(value = "面材质(靴筒面材质)")
@ApiModelProperty(value = "材质(靴筒面材质)")
private String shaftMaterial;
@ApiModelProperty(value = "鞋面内里材质")
@ApiModelProperty(value = "内里材质")
private String shoeUpperLiningMaterial;
}

View File

@ -37,6 +37,10 @@ public class StoreProdDemandPageResDTO {
private Long storeProdColorId;
@ApiModelProperty(value = "档口颜色ID")
private Long storeColorId;
@ApiModelProperty(value = "面料材质(靴筒面材质)")
private String shaftMaterial;
@ApiModelProperty(value = "内里材质")
private String shoeUpperLiningMaterial;
@ApiModelProperty(value = "档口商品ID")
private Long storeProdId;
@ApiModelProperty(value = "生产状态")

View File

@ -52,6 +52,7 @@ public class StoreProductDemandServiceImpl implements IStoreProductDemandService
final IVoucherSequenceService sequenceService;
final StoreProductStorageDemandDeductMapper storageDemandDeductMapper;
final StoreFactoryMapper storeFacMapper;
final StoreProductCategoryAttributeMapper prodCateAttrMapper;
/**
@ -194,6 +195,16 @@ public class StoreProductDemandServiceImpl implements IStoreProductDemandService
if (CollectionUtils.isEmpty(demandList)) {
return Page.empty(pageDTO.getPageSize(), pageDTO.getPageNum());
}
// 查询内里材质
List<StoreProductColor> prodColorList = this.storeProdColorMapper.selectList(new LambdaQueryWrapper<StoreProductColor>()
.in(StoreProductColor::getId, demandList.stream().map(StoreProdDemandPageResDTO::getStoreProdColorId).distinct().collect(Collectors.toList())));
Map<Long, String> liningMaterialMap = CollectionUtils.isEmpty(prodColorList) ? new HashMap<>()
: prodColorList.stream().collect(Collectors.toMap(StoreProductColor::getId, StoreProductColor::getShoeUpperLiningMaterial));
// 查询面料材质
List<StoreProductCategoryAttribute> prodCateAttrList = this.prodCateAttrMapper.selectList(new LambdaQueryWrapper<StoreProductCategoryAttribute>()
.in(StoreProductCategoryAttribute::getStoreProdId, demandList.stream().map(StoreProdDemandPageResDTO::getStoreProdId).distinct().collect(Collectors.toList())));
Map<Long, String> shaftMaterialMap = CollectionUtils.isEmpty(prodCateAttrList) ? new HashMap<>()
: prodCateAttrList.stream().collect(Collectors.toMap(StoreProductCategoryAttribute::getStoreProdId, StoreProductCategoryAttribute::getShaftMaterial));
// 提取需求详情ID列表用于后续查询抵扣信息
List<Long> demandDetailIdList = demandList.stream().map(StoreProdDemandPageResDTO::getStoreProdDemandDetailId).distinct().collect(Collectors.toList());
// 找到需求单抵扣的数据
@ -205,7 +216,9 @@ public class StoreProductDemandServiceImpl implements IStoreProductDemandService
// 更新需求列表中的每个项,设置库存数量和生产中数量
demandList.forEach(x -> {
final Integer deductQuantity = deductQuantityMap.getOrDefault(x.getStoreProdDemandDetailId(), 0);
x.setStorageQuantity(deductQuantity).setInProdQuantity(x.getQuantity());
x.setShaftMaterial(shaftMaterialMap.getOrDefault(x.getStoreProdId(), ""))
.setShoeUpperLiningMaterial(liningMaterialMap.getOrDefault(x.getStoreProdColorId(), ""))
.setStorageQuantity(deductQuantity).setInProdQuantity(x.getQuantity());
});
// 将查询结果转换为分页对象并返回
return Page.convert(new PageInfo<>(demandList));