|
|
|
@ -3,7 +3,7 @@ package com.sztzjy.trade.service.impl;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.sztzjy.trade.config.exception.handler.ServiceException;
|
|
|
|
|
import com.sztzjy.trade.entity.*;
|
|
|
|
|
import com.sztzjy.trade.entity.dto.StuGoodsInfoDTO;
|
|
|
|
|
import com.sztzjy.trade.entity.dto.StuGoodsManageInfoDTO;
|
|
|
|
|
import com.sztzjy.trade.mapper.StuGoodsInfoMapper;
|
|
|
|
|
import com.sztzjy.trade.mapper.StuGoodsPromotionPricingMapper;
|
|
|
|
|
import com.sztzjy.trade.mapper.StuGoodsSalesManageMapper;
|
|
|
|
@ -58,7 +58,7 @@ public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterServ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Integer save(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files) {
|
|
|
|
|
public Integer save(StuGoodsManageInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files) {
|
|
|
|
|
|
|
|
|
|
//主图片上传
|
|
|
|
|
String upload="";
|
|
|
|
@ -68,7 +68,7 @@ public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterServ
|
|
|
|
|
stuGoodsInfoDTO.setGoodsMainImage(upload);
|
|
|
|
|
|
|
|
|
|
//轮播图批量上传
|
|
|
|
|
StuGoodsInfoDTO stuGoodsInfoDTO1=new StuGoodsInfoDTO();
|
|
|
|
|
StuGoodsManageInfoDTO stuGoodsInfoDTO1=new StuGoodsManageInfoDTO();
|
|
|
|
|
if(!files.isEmpty()){
|
|
|
|
|
stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files);
|
|
|
|
|
}
|
|
|
|
@ -134,13 +134,13 @@ public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterServ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Integer add(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files) {
|
|
|
|
|
public Integer add(StuGoodsManageInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files) {
|
|
|
|
|
//主图片上传
|
|
|
|
|
String upload= fileUtil.upload(file);
|
|
|
|
|
stuGoodsInfoDTO.setGoodsMainImage(upload);
|
|
|
|
|
|
|
|
|
|
//轮播图批量上传
|
|
|
|
|
StuGoodsInfoDTO stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files);
|
|
|
|
|
StuGoodsManageInfoDTO stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files);
|
|
|
|
|
|
|
|
|
|
//关键词拼接
|
|
|
|
|
String join = String.join(",", stuGoodsInfoDTO1.getProductKeyword());
|
|
|
|
@ -200,13 +200,13 @@ public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterServ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Integer update(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files) {
|
|
|
|
|
public Integer update(StuGoodsManageInfoDTO stuGoodsInfoDTO, MultipartFile file, List<MultipartFile> files) {
|
|
|
|
|
//主图片上传
|
|
|
|
|
String upload= fileUtil.upload(file);
|
|
|
|
|
stuGoodsInfoDTO.setGoodsMainImage(upload);
|
|
|
|
|
|
|
|
|
|
//轮播图批量上传
|
|
|
|
|
StuGoodsInfoDTO stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files);
|
|
|
|
|
StuGoodsManageInfoDTO stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files);
|
|
|
|
|
|
|
|
|
|
//关键词拼接
|
|
|
|
|
String join = String.join(",", stuGoodsInfoDTO1.getProductKeyword());
|
|
|
|
@ -300,7 +300,7 @@ public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterServ
|
|
|
|
|
* @param stuGoodsInfoDTO
|
|
|
|
|
* @param files
|
|
|
|
|
*/
|
|
|
|
|
private StuGoodsInfoDTO insertBatch(StuGoodsInfoDTO stuGoodsInfoDTO, List<MultipartFile> files) {
|
|
|
|
|
private StuGoodsManageInfoDTO insertBatch(StuGoodsManageInfoDTO stuGoodsInfoDTO, List<MultipartFile> files) {
|
|
|
|
|
StringBuilder imageUpload = new StringBuilder();
|
|
|
|
|
for (int i = 0; i < files.size(); i++) {
|
|
|
|
|
String upload = fileUtil.upload(files.get(i));
|
|
|
|
|