+26
-18
@@ -26,29 +26,37 @@ class XiaMenVillageBatch extends BaseBatch{
|
|||||||
println "输入文件:"+inFileName+" 输出文件:"+outFileName
|
println "输入文件:"+inFileName+" 输出文件:"+outFileName
|
||||||
def exists = checkFileExists(outFileName)
|
def exists = checkFileExists(outFileName)
|
||||||
if(!exists){
|
if(!exists){
|
||||||
def rows = []
|
def inExists = checkFileExists(inFileName)
|
||||||
rows << ["序号","地址","判定后涉农组织类型(城市企业[不含县城企业]、农村企业、县城企业)","所属工业园区或经济开发区"]
|
if(inExists){
|
||||||
def rets = XmBankVillageFtpUtils.readExcelFile(inFileName)
|
def rows = []
|
||||||
if(rets){
|
rows << ["序号","地址","判定后涉农组织类型(城市企业[不含县城企业]、农村企业、县城企业)","所属工业园区或经济开发区"]
|
||||||
for(def row : rets){
|
def rets = XmBankVillageFtpUtils.readExcelFile(inFileName)
|
||||||
if(row[1]){
|
if(rets){
|
||||||
def dto = OpenApiUtils.addrVerifyXiameng(null, row[1], 2)
|
for(def row : rets){
|
||||||
if(dto){
|
if(row[1]){
|
||||||
row[2] = dto.addrArea //所属区域 农村区域 城市区域 县城城区(对公)
|
def dto = OpenApiUtils.addrVerifyXiameng(null, row[1], 2)
|
||||||
if(dto.devDistrictName){
|
if(dto){
|
||||||
row[3] = dto.devDistrictName//开发区
|
row[2] = dto.addrArea //所属区域 农村区域 城市区域 县城城区(对公)
|
||||||
}else{
|
if(dto.devDistrictName){
|
||||||
row[3] = ""
|
row[3] = dto.devDistrictName//开发区
|
||||||
}
|
}else{
|
||||||
|
row[3] = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
rows << row
|
||||||
}
|
}
|
||||||
rows << row
|
|
||||||
}
|
}
|
||||||
|
uploadExcel(rows, outFileName)
|
||||||
|
println "新增文件,上传已完成 "+DateUtil.formatByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||||
|
println "*******************************************************************************************"
|
||||||
|
}else{
|
||||||
|
println "输入${inFileName}文件不存在,待客户上传 "+DateUtil.formatByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||||
|
println "*******************************************************************************************"
|
||||||
}
|
}
|
||||||
uploadExcel(rows, outFileName)
|
|
||||||
println "新增文件,上传已完成"
|
|
||||||
println "*******************************************************************************************"
|
|
||||||
}else{
|
}else{
|
||||||
println "已存在 "+ DateUtil.formatByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
println "已存在 "+ DateUtil.formatByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||||
println "*******************************************************************************************"
|
println "*******************************************************************************************"
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class DataTransfer {
|
|||||||
DBObject q_43 = new BasicDBObject();
|
DBObject q_43 = new BasicDBObject();
|
||||||
q_43.put("from_user_id", "1007497");
|
q_43.put("from_user_id", "1007497");
|
||||||
DBCursor cursor_43 = col_43.find(q_43).addOption(Bytes.QUERYOPTION_NOTIMEOUT).batchSize(500);
|
DBCursor cursor_43 = col_43.find(q_43).addOption(Bytes.QUERYOPTION_NOTIMEOUT).batchSize(500);
|
||||||
List<DBObject> db43List = new ArrayList<>();
|
List<DBObject> db43List = new ArrayList<DBObject>();
|
||||||
while(cursor_43.hasNext()) {
|
while(cursor_43.hasNext()) {
|
||||||
DBObject obj_43 = cursor_43.next();
|
DBObject obj_43 = cursor_43.next();
|
||||||
if(obj_43 != null) {
|
if(obj_43 != null) {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class ApiUtil {
|
|||||||
String signature = "";
|
String signature = "";
|
||||||
try {
|
try {
|
||||||
//参数排序,保证签名一致
|
//参数排序,保证签名一致
|
||||||
List<String> fileds = new ArrayList<>();
|
List<String> fileds = new ArrayList<String>();
|
||||||
Set<Entry<String, Object>> set = body.entrySet();
|
Set<Entry<String, Object>> set = body.entrySet();
|
||||||
for (Entry<String, Object> entry : set) {
|
for (Entry<String, Object> entry : set) {
|
||||||
fileds.add(entry.getKey());
|
fileds.add(entry.getKey());
|
||||||
|
|||||||
Reference in New Issue
Block a user