Merge branch 'script_gj' of http://gitlab.fangjia.com/dev0/main into script_gj
This commit is contained in:
+1
-1
@@ -47,7 +47,7 @@ class DistrictDealSellRentRankBatch extends BaseBatch {
|
||||
"图木舒克","五家渠","济源","仙桃","潜江","天门","景德镇", "神农架","五指山","琼海","儋州","文昌","万宁","东方","定安","屯昌","澄迈","临高","白沙","昌江","乐东","陵水",
|
||||
"保亭","琼中","北屯","铁门关","双河","可克达拉"
|
||||
]
|
||||
cities = ["无锡"]
|
||||
// cities = ["无锡"]
|
||||
println cities
|
||||
for(String city : cities) {
|
||||
List<DBObject> districts = findDistrictByCity(city)
|
||||
|
||||
@@ -104,6 +104,43 @@ class FileUtils {
|
||||
sb.setLength(0)
|
||||
}
|
||||
out.close();
|
||||
return sb.toString().getBytes(charset)
|
||||
}
|
||||
|
||||
static def createEncryptFile(fileName, outputStr, isAppend){
|
||||
OutputStream out = new FileOutputStream(fileName, isAppend);
|
||||
out.write(outputStr.getBytes("utf-8"));
|
||||
out.close();
|
||||
}
|
||||
|
||||
|
||||
static def createFileStringByCustomSuffix(ret, fileName, charset, suffix, lineSuffix){
|
||||
File file = new File(fileName);
|
||||
// if (file.exists()) {
|
||||
// file.delete();
|
||||
// }
|
||||
|
||||
if (!file.getParentFile().exists()) {
|
||||
boolean result = file.getParentFile().mkdirs();
|
||||
if (!result) {
|
||||
System.out.println("´´½¨Ä¿Â¼Ê§°Ü");
|
||||
}
|
||||
}
|
||||
def sb = new StringBuffer();
|
||||
def index = 0
|
||||
for(def row : ret){
|
||||
if(row){
|
||||
index++
|
||||
sb.append(StringUtils.join(row.toArray(), suffix))
|
||||
if(index<ret.size()){
|
||||
sb.append(lineSuffix+"\n");
|
||||
}else{
|
||||
sb.append(lineSuffix);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return sb.toString()
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user