|
|
|
|
@ -38,22 +38,22 @@ public class ProductScreenImpl implements ProductScreenService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
public FileServiceUtils fileServiceUtils;
|
|
|
|
|
public FileServiceUtils fileServiceUtils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public AjaxResult getProductList(TbProduct product) {
|
|
|
|
|
try{
|
|
|
|
|
List<TbProduct> list=mapper.getProductList(product);
|
|
|
|
|
if(StringUtils.isNotEmpty(list)){
|
|
|
|
|
list.forEach(vo->{
|
|
|
|
|
String url = fileServiceUtils.getFileUrl(vo.getLinkImage(),null);
|
|
|
|
|
// String url = minioUtil.getFileUrl(minioConfig.getBucketName(),vo.getLinkImage(), GlobalUtils.FILE_TIMES);
|
|
|
|
|
try {
|
|
|
|
|
List<TbProduct> list = mapper.getProductList(product);
|
|
|
|
|
if (StringUtils.isNotEmpty(list)) {
|
|
|
|
|
list.forEach(vo -> {
|
|
|
|
|
String url = fileServiceUtils.getFileUrl(vo.getLinkImage(), null);
|
|
|
|
|
// String url = minioUtil.getFileUrl(minioConfig.getBucketName(),vo.getLinkImage(), GlobalUtils.FILE_TIMES);
|
|
|
|
|
vo.setLinkImage(url);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error(e.toString());
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success(new ArrayList<TbProduct>());
|
|
|
|
|
@ -61,59 +61,76 @@ public class ProductScreenImpl implements ProductScreenService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查看宣传物料信息
|
|
|
|
|
*
|
|
|
|
|
* @param product
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public AjaxResult getProductDetails(TbProduct product) {
|
|
|
|
|
try{
|
|
|
|
|
try {
|
|
|
|
|
//详情
|
|
|
|
|
TbProduct vo=mapper.getProductDetails(product);
|
|
|
|
|
if(vo!=null){
|
|
|
|
|
TbProduct vo = mapper.getProductDetails(product);
|
|
|
|
|
if (vo != null) {
|
|
|
|
|
//封面图
|
|
|
|
|
String url = fileServiceUtils.getFileUrl(vo.getLinkImage(),null);
|
|
|
|
|
// String url = minioUtil.getFileUrl(minioConfig.getBucketName(),vo.getLinkImage(), GlobalUtils.FILE_TIMES);
|
|
|
|
|
String url = fileServiceUtils.getFileUrl(vo.getLinkImage(), null);
|
|
|
|
|
// String url = minioUtil.getFileUrl(minioConfig.getBucketName(),vo.getLinkImage(), GlobalUtils.FILE_TIMES);
|
|
|
|
|
vo.setLinkImage(url);
|
|
|
|
|
// vo.setLinkImage(minioConfig.getUrl()+"/"+minioConfig.getBucketName()+vo.getLinkImage());
|
|
|
|
|
// vo.setLinkImage(minioConfig.getUrl()+"/"+minioConfig.getBucketName()+vo.getLinkImage());
|
|
|
|
|
getProductDetails(product, vo, productMapper, minioUtil);
|
|
|
|
|
//查询 宣传手册和宣传视频
|
|
|
|
|
List<ProductScreenVo> list=mapper.getMaterialList(vo);
|
|
|
|
|
List<ProductScreenVo> videoList=new ArrayList<>();
|
|
|
|
|
List<ProductScreenVo> fileList=new ArrayList<>();
|
|
|
|
|
if(StringUtils.isNotEmpty(list)){
|
|
|
|
|
list.forEach(vo1->{
|
|
|
|
|
String imageUlr = fileServiceUtils.getFileUrl(vo1.getImage(),null);
|
|
|
|
|
String path = fileServiceUtils.getFileUrl(vo1.getFilePath(),null);
|
|
|
|
|
// String imageUlr = minioUtil.getFileUrl(minioConfig.getBucketName(),vo1.getImage(), GlobalUtils.FILE_TIMES);
|
|
|
|
|
// String path = minioUtil.getFileUrl(minioConfig.getBucketName(),vo1.getFilePath(), GlobalUtils.FILE_TIMES);
|
|
|
|
|
vo1.setImage(imageUlr);
|
|
|
|
|
vo1.setUrl(path);
|
|
|
|
|
if("0".equals(vo1.getFileType())){
|
|
|
|
|
videoList.add(vo1);
|
|
|
|
|
}else {
|
|
|
|
|
fileList.add(vo1);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
vo.setVideoList(videoList);
|
|
|
|
|
vo.setFileList(fileList);
|
|
|
|
|
List<ProductScreenVo> list = mapper.getMaterialList(vo);
|
|
|
|
|
List<ProductScreenVo> videoList = new ArrayList<>();
|
|
|
|
|
List<ProductScreenVo> fileList = new ArrayList<>();
|
|
|
|
|
if (StringUtils.isNotEmpty(list)) {
|
|
|
|
|
list.forEach(vo1 -> {
|
|
|
|
|
String imageUlr = fileServiceUtils.getFileUrl(vo1.getImage(), null);
|
|
|
|
|
String path = fileServiceUtils.getFileUrl(vo1.getFilePath(), null);
|
|
|
|
|
// String imageUlr = minioUtil.getFileUrl(minioConfig.getBucketName(),vo1.getImage(), GlobalUtils.FILE_TIMES);
|
|
|
|
|
// String path = minioUtil.getFileUrl(minioConfig.getBucketName(),vo1.getFilePath(), GlobalUtils.FILE_TIMES);
|
|
|
|
|
vo1.setImage(imageUlr);
|
|
|
|
|
vo1.setUrl(path);
|
|
|
|
|
if ("0".equals(vo1.getFileType())) {
|
|
|
|
|
videoList.add(vo1);
|
|
|
|
|
} else {
|
|
|
|
|
fileList.add(vo1);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
vo.setVideoList(videoList);
|
|
|
|
|
vo.setFileList(fileList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success(vo);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error(e.toString());
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success(product);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getProductDetails(TbProduct product, TbProduct vo, ProductMapper productMapper, MinioUtil minioUtil) {
|
|
|
|
|
List<TbProductCase> productCases= productMapper.getProductCaseList(product.getId());
|
|
|
|
|
for (TbProductCase productCase:productCases) {
|
|
|
|
|
@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) {
|
|
|
|
|
List<TbProductCase> productCases = productMapper.getProductCaseList(product.getId());
|
|
|
|
|
for (TbProductCase productCase : productCases) {
|
|
|
|
|
//产品案例
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
|
|