门店多轮播图
This commit is contained in:
@ -96,7 +96,6 @@ public class CompanyStoreServiceImpl implements ICompanyStoreService
|
||||
companyStore.setCreateTime(DateUtils.getNowDate());
|
||||
companyStore.setUpdateTime(DateUtils.getNowDate());
|
||||
companyStore.setStatus("0");
|
||||
companyStore.setAddress(companyStore.getProvinceName()+companyStore.getCityName()+companyStore.getAreaName());
|
||||
setAreaInfo(companyStore);
|
||||
int flag = companyStoreMapper.insertCompanyStore(companyStore);
|
||||
if(flag > 0){
|
||||
@ -120,6 +119,8 @@ public class CompanyStoreServiceImpl implements ICompanyStoreService
|
||||
companyStore.setCityName(areaHn.getName());
|
||||
companyStore.setProvinceId(areaHn.getParentCode());
|
||||
companyStore.setProvinceName(areaHn.getParentName());
|
||||
companyStore.setAddress(companyStore.getProvinceName()+companyStore.getCityName()+companyStore.getAreaName());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -133,7 +134,6 @@ public class CompanyStoreServiceImpl implements ICompanyStoreService
|
||||
{
|
||||
companyStore.setUpdateTime(DateUtils.getNowDate());
|
||||
companyStore.setStatus("0");
|
||||
companyStore.setAddress(companyStore.getProvinceName()+companyStore.getCityName()+companyStore.getAreaName());
|
||||
setAreaInfo(companyStore);
|
||||
return companyStoreMapper.updateCompanyStore(companyStore);
|
||||
}
|
||||
|
||||
@ -355,15 +355,31 @@ public class CommonController
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
|
||||
for (MultipartFile file : files) {
|
||||
|
||||
/** oss --------------- */
|
||||
// 检查文件是否为空
|
||||
if (file.isEmpty()) {
|
||||
return AjaxResult.error("上传文件不能为空");
|
||||
}
|
||||
|
||||
// 检查文件类型(可选)
|
||||
String contentType = file.getContentType();
|
||||
if (contentType == null || !contentType.startsWith("image/")) {
|
||||
return AjaxResult.error("只允许上传图片文件");
|
||||
}
|
||||
|
||||
// 上传到 OSS
|
||||
String url = ossService.uploadImage(file);
|
||||
// 返回文件访问 URL
|
||||
String[] str = url.split("/");
|
||||
String fileName = str[str.length - 1];
|
||||
|
||||
/** 原文件上传 --------------- */
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, fileType, file);
|
||||
|
||||
// String fileName = FileUploadUtils.upload(filePath, fileType, file);
|
||||
// String url = serverConfig.getUrl() + fileName;
|
||||
/** -------------------------- */
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
|
||||
// String url = serverConfig.getUrl() + "/common/newDownload?uuid=" + uuid;
|
||||
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
|
||||
CommonAttachment insert = new CommonAttachment();
|
||||
insert.setUuid(uuid);
|
||||
insert.setDataId(dataId);
|
||||
|
||||
Reference in New Issue
Block a user