【一期物料主数据】对外接口 查询物料图号

This commit is contained in:
10001392 2024-07-23 16:14:01 +08:00
parent f52664df9f
commit c59157c3cb
2 changed files with 15 additions and 9 deletions

View File

@ -2393,7 +2393,7 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
updateList.add(update);
});
List<String> materialNos = list.stream().map(MaterialMainEntity::getMaterialNo).collect(Collectors.toList());
log.info("【计算推荐度】采购物料半年内新编码:\n{}", materialNos);
// log.info("【计算推荐度】采购物料半年内新编码:\n{}", materialNos);
}
List<MaterialMainEntity> list2 = this.lambdaQuery()
// 已审核 || 历史物料
@ -2434,7 +2434,7 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
updateList.add(update);
});
List<String> materialNos = subList21.stream().map(MaterialMainEntity::getMaterialNo).collect(Collectors.toList());
log.info("【计算推荐度】半年前非激活物料编码:\n{}", materialNos);
// log.info("【计算推荐度】半年前非激活物料编码:\n{}", materialNos);
}
// 激活物料
List<MaterialMainEntity> subList22 = list2.stream().filter(item -> item.getMaterialState() == 1).collect(Collectors.toList());
@ -2442,7 +2442,7 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
Set<String> categorySet = subList22.stream().map(MaterialMainEntity::getMaterialCategoryCode).collect(Collectors.toSet());
if (CollectionUtil.isNotEmpty(categorySet)) {
List<String> materialNos = subList22.stream().map(MaterialMainEntity::getMaterialNo).collect(Collectors.toList());
log.info("【计算推荐度】半年前激活物料编码:\n{}", materialNos);
// log.info("【计算推荐度】半年前激活物料编码:\n{}", materialNos);
categorySet.forEach(item -> {
log.info("【计算推荐度】分类代码:{}", item);
// 该分类的物料
@ -2496,19 +2496,19 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
int size60Index = new BigDecimal(itemList.size()).multiply(new BigDecimal("0.6").setScale(2, RoundingMode.HALF_DOWN)).intValue();
// 80% 下标
int size80Index = new BigDecimal(itemList.size()).multiply(new BigDecimal("0.8").setScale(2, RoundingMode.HALF_DOWN)).intValue();
log.info("【10% 下标】{}", size10Index);
log.info("【30% 下标】{}", size30Index);
log.info("【60% 下标】{}", size60Index);
log.info("【80% 下标】{}", size80Index);
// log.info("【10% 下标】{}", size10Index);
// log.info("【30% 下标】{}", size30Index);
// log.info("【60% 下标】{}", size60Index);
// log.info("【80% 下标】{}", size80Index);
otherSubList.forEach(i -> {
Double towYearLssl = i.getTowYearLssl();
// 该数量最小下标
int minIdx = numList.indexOf(towYearLssl);
// 该数量最大下标
int maxIdx = numList.lastIndexOf(towYearLssl);
log.info("【库存量】: {}, 【范围】: {}, {}", towYearLssl, minIdx, maxIdx);
// log.info("【库存量】: {}, 【范围】: {}, {}", towYearLssl, minIdx, maxIdx);
int recommend = confirmRecommend(size10Index, size30Index, size60Index, size80Index, itemList.size(), minIdx);
log.info("【确定推荐度】{}", recommend);
// log.info("【确定推荐度】{}", recommend);
MaterialMainEntity update = new MaterialMainEntity();
update.setRowId(i.getRowId());
update.setRecommend(recommend);

View File

@ -546,6 +546,12 @@
<if test="query.materialNo != null and query.materialNo != ''">
AND material_no = #{query.materialNo}
</if>
<if test="query.materialNos != null and query.materialNos.size() > 0">
and material_no in
<foreach collection="query.materialNos" open="(" close=")" separator="," item="item">
#{item}
</foreach>
</if>
order by material_no
</select>