|
|
@ -7,6 +7,7 @@ import com.mh.common.page.PageRequest; |
|
|
|
import com.mh.common.page.PageResult; |
|
|
|
import com.mh.common.page.PageResult; |
|
|
|
import com.mh.common.utils.FileUtils; |
|
|
|
import com.mh.common.utils.FileUtils; |
|
|
|
import com.mh.common.utils.StringUtils; |
|
|
|
import com.mh.common.utils.StringUtils; |
|
|
|
|
|
|
|
import com.mh.user.constants.Constant; |
|
|
|
import com.mh.user.entity.ProjectInfoEntity; |
|
|
|
import com.mh.user.entity.ProjectInfoEntity; |
|
|
|
import com.mh.user.mapper.ProjectInfoMapper; |
|
|
|
import com.mh.user.mapper.ProjectInfoMapper; |
|
|
|
import com.mh.user.service.ProjectInfoService; |
|
|
|
import com.mh.user.service.ProjectInfoService; |
|
|
@ -51,8 +52,9 @@ public class ProjectInfoServiceImpl implements ProjectInfoService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void update(ProjectInfoEntity projectInfoEntity) { |
|
|
|
public void update(ProjectInfoEntity projectInfoEntity) { |
|
|
|
if (null != projectInfoEntity.getFile()) { |
|
|
|
if (null != projectInfoEntity.getFile()) { |
|
|
|
String fileToBase64 = FileUtils.reSizeImg(projectInfoEntity.getFile()); |
|
|
|
String currentPath = System.getProperty("user.dir"); |
|
|
|
projectInfoEntity.setPicContent(fileToBase64); |
|
|
|
FileUtils.copyFile(projectInfoEntity.getFile(), currentPath + Constant.PROJECT_IMG_PATH); |
|
|
|
|
|
|
|
projectInfoEntity.setPicContent("/images/"+projectInfoEntity.getFile().getOriginalFilename()); |
|
|
|
projectInfoEntity.setPic(projectInfoEntity.getFile().getOriginalFilename()); |
|
|
|
projectInfoEntity.setPic(projectInfoEntity.getFile().getOriginalFilename()); |
|
|
|
} |
|
|
|
} |
|
|
|
projectInfoMapper.updateById(projectInfoEntity); |
|
|
|
projectInfoMapper.updateById(projectInfoEntity); |
|
|
@ -61,8 +63,12 @@ public class ProjectInfoServiceImpl implements ProjectInfoService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void save(ProjectInfoEntity projectInfoEntity) { |
|
|
|
public void save(ProjectInfoEntity projectInfoEntity) { |
|
|
|
if (null != projectInfoEntity.getFile()) { |
|
|
|
if (null != projectInfoEntity.getFile()) { |
|
|
|
String fileToBase64 = FileUtils.reSizeImg(projectInfoEntity.getFile()); |
|
|
|
// String fileToBase64 = FileUtils.reSizeImg(projectInfoEntity.getFile());
|
|
|
|
projectInfoEntity.setPicContent(fileToBase64); |
|
|
|
// projectInfoEntity.setPicContent(fileToBase64);
|
|
|
|
|
|
|
|
// projectInfoEntity.setPic(projectInfoEntity.getFile().getOriginalFilename());
|
|
|
|
|
|
|
|
String currentPath = System.getProperty("user.dir"); |
|
|
|
|
|
|
|
FileUtils.copyFile(projectInfoEntity.getFile(), currentPath + Constant.PROJECT_IMG_PATH); |
|
|
|
|
|
|
|
projectInfoEntity.setPicContent("/image/"+projectInfoEntity.getFile().getOriginalFilename()); |
|
|
|
projectInfoEntity.setPic(projectInfoEntity.getFile().getOriginalFilename()); |
|
|
|
projectInfoEntity.setPic(projectInfoEntity.getFile().getOriginalFilename()); |
|
|
|
} |
|
|
|
} |
|
|
|
projectInfoEntity.setCreateTime(new Date()); |
|
|
|
projectInfoEntity.setCreateTime(new Date()); |
|
|
|