|
@@ -166,23 +166,27 @@ public class UploadCompanyInfoAndProductController {
|
|
|
infoFile.setUpdateTime(new Date());
|
|
|
infoFile.setCompId(companyId(companyName));
|
|
|
infoFile.setFileStatus(0);
|
|
|
- infoFile.setFileUrl(url+br+s);
|
|
|
+ String imgName = br + s;
|
|
|
str = str.toLowerCase();
|
|
|
+ String[] split = str.split("\\.");
|
|
|
+ imgName=imgName+"."+split[1];
|
|
|
+ String filePath = path + "\\" + str;
|
|
|
+ infoFile.setFileUrl(url+imgName);
|
|
|
if (str.contains("公众号二维码")){
|
|
|
infoFile.setFileType("qrl");
|
|
|
- uploadFileUtil.uploadLocalFile(path+"\\"+str,br+s);
|
|
|
+ uploadFileUtil.uploadLocalFile(filePath,imgName);
|
|
|
}else if (str.contains("logo")){
|
|
|
infoFile.setFileType("logo");
|
|
|
- uploadFileUtil.uploadLocalFile(path+"\\"+str,br+s);
|
|
|
+ uploadFileUtil.uploadLocalFile(filePath,imgName);
|
|
|
|
|
|
}else if (str.contains("供应商资质")){
|
|
|
infoFile.setFileType("cert");
|
|
|
- uploadFileUtil.uploadLocalFile(path+"\\"+str,br+s);
|
|
|
+ uploadFileUtil.uploadLocalFile(filePath,imgName);
|
|
|
|
|
|
|
|
|
}else if (str.contains("供应商图片")){
|
|
|
infoFile.setFileType("company");
|
|
|
- uploadFileUtil.uploadLocalFile(path+"\\"+str,br+s);
|
|
|
+ uploadFileUtil.uploadLocalFile(filePath,imgName);
|
|
|
}else{
|
|
|
i=1;
|
|
|
System.err.println("没有对应的照片");
|
|
@@ -255,19 +259,22 @@ public class UploadCompanyInfoAndProductController {
|
|
|
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ //生产地图片
|
|
|
public void addImg(List<String> file,String path,Long aLong){
|
|
|
String br = "0/1/"+aLong+"/";
|
|
|
UmsMemberOrigin u = new UmsMemberOrigin();
|
|
|
u.setId(aLong);
|
|
|
StringBuffer bu = new StringBuffer();
|
|
|
for(int i=0;i<file.size();i++){
|
|
|
+ String oldFileName = file.get(i);
|
|
|
String s = OrderNo.NextOrderNo();
|
|
|
- uploadFileUtil.uploadLocalFile(path+"\\"+file.get(i),br+s);
|
|
|
+ String[] split = oldFileName.split("\\.");
|
|
|
+ String fileName = br + s+split[1];
|
|
|
+ uploadFileUtil.uploadLocalFile(path + "\\"+oldFileName,fileName);
|
|
|
if (i>0){
|
|
|
- bu.append(","+url+br+s);
|
|
|
+ bu.append(","+url+fileName);
|
|
|
}else {
|
|
|
- bu.append(url+br+s);
|
|
|
+ bu.append(url+fileName);
|
|
|
}
|
|
|
}
|
|
|
u.setImgUrl(bu.toString());
|
|
@@ -360,6 +367,8 @@ public class UploadCompanyInfoAndProductController {
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
for (String s:file) {
|
|
|
String fs = br+OrderNo.NextOrderNo();
|
|
|
+ String[] split = s.split("\\.");
|
|
|
+ fs = fs + "." + split[1];
|
|
|
uploadFileUtil.uploadLocalFile(upPath+"\\"+s,fs);
|
|
|
if (s.contains("首图")){
|
|
|
p.setPic(url+fs);
|