详情接口提交

This commit is contained in:
liang.chao 2025-09-30 13:33:44 +08:00
parent 7054784661
commit 157eeeff8d
5 changed files with 76 additions and 45 deletions

View File

@ -34,4 +34,9 @@ public class ProductScreenController {
return service.getProductDetails(product) ; return service.getProductDetails(product) ;
} }
@PostMapping("/getProductDetailsById")
public AjaxResult getProductDetailsById(@RequestBody TbProduct product ){
return service.getProductDetailsById(product) ;
}
} }

View File

@ -121,4 +121,6 @@ public interface ProductMapper {
* @return * @return
*/ */
Integer getProductOnCz(TbProduct product); Integer getProductOnCz(TbProduct product);
TbProductCase getProductDetailsById(String id);
} }

View File

@ -17,4 +17,6 @@ public interface ProductScreenService {
* @return * @return
*/ */
AjaxResult getProductDetails(TbProduct product); AjaxResult getProductDetails(TbProduct product);
AjaxResult getProductDetailsById(TbProduct product);
} }

View File

@ -61,6 +61,7 @@ public class ProductScreenImpl implements ProductScreenService {
/** /**
* 查看宣传物料信息 * 查看宣传物料信息
*
* @param product * @param product
* @return * @return
*/ */
@ -105,6 +106,22 @@ public class ProductScreenImpl implements ProductScreenService {
return AjaxResult.success(product); return AjaxResult.success(product);
} }
@Override
public AjaxResult getProductDetailsById(TbProduct product) {
TbProductCase productCase = productMapper.getProductDetailsById(product.getId());
//产品案例
List<ProductCaseImage> caseImages = productMapper.getCaseImageByTable(productCase.getId(), "tb_product_case");
if (StringUtils.isNotEmpty(caseImages)) {
caseImages.forEach(image -> {
String path = fileServiceUtils.getFileUrl(image.getFilePath(), image.getBucketName());
// String path = minioUtil.getFileUrl(image.getBucketName(),image.getFilePath(), GlobalUtils.FILE_TIMES);
image.setUrl(path);
});
productCase.setImageList(caseImages);
}
return AjaxResult.success(productCase);
}
public void getProductDetails(TbProduct product, TbProduct vo, ProductMapper productMapper, MinioUtil minioUtil) { public void getProductDetails(TbProduct product, TbProduct vo, ProductMapper productMapper, MinioUtil minioUtil) {
List<TbProductCase> productCases = productMapper.getProductCaseList(product.getId()); List<TbProductCase> productCases = productMapper.getProductCaseList(product.getId());
for (TbProductCase productCase : productCases) { for (TbProductCase productCase : productCases) {

View File

@ -76,6 +76,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where product_id=#{id} where product_id=#{id}
</select> </select>
<select id="getProductDetailsById" resultType="com.bonus.business.domain.TbProductCase">
SELECT id,product_id productId,case_company caseCompany,case_introduction caseIntroduction,case_sort caseSort
from tb_product_case
where del_flag=0 and id=#{id}
</select>
<insert id="addProduct" parameterType="com.bonus.business.domain.TbProduct" keyProperty="id" useGeneratedKeys="true" > <insert id="addProduct" parameterType="com.bonus.business.domain.TbProduct" keyProperty="id" useGeneratedKeys="true" >
insert into tb_product insert into tb_product