添加耗材记录通过店铺id

This commit is contained in:
牛叉闪闪 2024-07-20 16:02:45 +08:00
parent 4bd089e0fc
commit 7e4299eecc
2 changed files with 5 additions and 5 deletions

View File

@ -16,10 +16,10 @@ public interface TbConsInfoFlowRepository extends JpaRepository<TbConsInfoFlow,
@Query(value = "SELECT\n" +
"\tp.`name` \n" +
"FROM\n" +
"\ttb_cons_info_flow i\n" +
"\tLEFT JOIN tb_product_sku s ON i.pro_sku_id = s.id\n" +
"\ttb_product_sku s\n" +
"\tLEFT JOIN tb_product p ON s.product_id = p.id \n" +
"\twhere i.pro_sku_id=?1 limit 1",nativeQuery = true)
"WHERE\n" +
"\ts.id = ?1",nativeQuery = true)
String selectByPskId(Integer skuId);
}

View File

@ -45,7 +45,7 @@ public class TbConsInfoFlowServiceImpl implements TbConsInfoFlowService {
Page<TbConsInfoFlow> page = tbConsInfoFlowRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
page.get().forEach(it->{
String name= tbConsInfoFlowRepository.selectByPskId(it.getConsId());
String name= tbConsInfoFlowRepository.selectByPskId(it.getProSkuId());
if(Objects.nonNull(name)){
it.setProductName(name);
}