Merge remote-tracking branch 'origin/master'

This commit is contained in:
majintao
2025-04-21 17:08:52 +08:00
4 changed files with 41 additions and 1 deletions
@@ -71,7 +71,8 @@ public class FilesController {
if(StringUtils.isNotBlank(model.getFilename())){
filename = model.getFilename();
}
GridFSInputFile gridFSInputFile = fileDao.saveToGridFs(file.getInputStream(), filename, contentType);
String type = model.getType();
GridFSInputFile gridFSInputFile = fileDao.saveToGridFs(file.getInputStream(), filename, contentType, type);
UniversalDto dto = UniversalDto.newDto();
if(OpenConfig.getConfig().isProductionEnvironment()){
dto.append("link", "http://static.fangjia.com/stc/files/" + gridFSInputFile.get("_id").toString());
@@ -7,6 +7,10 @@ public class FilesModel extends FangjiaApiModel {
private MultipartFile file;
private String contentType;
private String filename;
/**
* ÎļþÀàÐÍ
*/
private String type;
public MultipartFile getFile() {
return file;
@@ -31,4 +35,12 @@ public class FilesModel extends FangjiaApiModel {
public void setFilename(String filename) {
this.filename = filename;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
@@ -8,6 +8,7 @@ import com.mongodb.gridfs.GridFS;
import com.mongodb.gridfs.GridFSDBFile;
import com.mongodb.gridfs.GridFSInputFile;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.bson.types.ObjectId;
import java.io.InputStream;
@@ -70,6 +71,18 @@ public class FileDao {
return fsInputFile;
}
public GridFSInputFile saveToGridFs(InputStream inputStream, String filename, String contentType, String type){
GridFSInputFile fsInputFile = gridFs.createFile(inputStream, filename);
fsInputFile.put("contentType", contentType);
if (StringUtils.isNotBlank(type)){
fsInputFile.put("type", type);
} else {
fsInputFile.put("type", "default");
}
fsInputFile.save();
return fsInputFile;
}
public GridFSDBFile findByIdInGridFS(String id){
return gridFs.findOne(new ObjectId(id));
}
@@ -530,6 +530,20 @@ class FjwBigdataForsaleBatch extends BaseBatch{
}
}
if(estate_type2 && estate_type2=="别墅"){
def newName = name + "(别墅)"
if(!alias.contains(newName)){
alias << newName
}
}
if(estate_type2 && estate_type2=="商住"){
def newName = name + "(商住)"
if(!alias.contains(newName)){
alias << newName
}
}
if(alias && alias.size()>0){
BoolQueryBuilder inBuilder = QueryBuilders.boolQuery();
for(def s : alias){