|
|
|
@ -66,13 +66,13 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
private String backFilePath;
|
|
|
|
|
|
|
|
|
|
@Value("${API_KEY}")
|
|
|
|
|
private String apiKey;
|
|
|
|
|
@Value("${API_SECRET}")
|
|
|
|
|
private String apiSecret;
|
|
|
|
|
private String apiKey;
|
|
|
|
|
@Value("${API_SECRET}")
|
|
|
|
|
private String apiSecret;
|
|
|
|
|
|
|
|
|
|
/*同步表,格式:同步设置表列名/同步设置表列名(子表时设置,主表不设置)/主表唯一列(多列逗号分隔)/主表关联列/子表关联列/数据库实际表/时间列/图片或文件列/数据条件/说明*/
|
|
|
|
|
private final String[] SYNC_TABLES= {
|
|
|
|
|
"entrustAction//basic_entrust_accept/id///updateTime///委托验收","basicProducts//basic_udirel/id///updateTime///耗材字典","/basicProducts/basic_products/id/uuid/uuid////耗材字典信息详情",
|
|
|
|
|
/*同步表,格式:同步设置表列名/同步设置表列名(子表时设置,主表不设置)/主表唯一列(多列逗号分隔)/主表关联列/子表关联列/数据库实际表/时间列/图片或文件列/数据条件/说明*/
|
|
|
|
|
private final String[] SYNC_TABLES= {
|
|
|
|
|
"entrustAction//basic_entrust_accept/id///updateTime///委托验收","basicProducts//basic_udirel/id///updateTime///耗材字典","/basicProducts/basic_products/id/uuid/uuid////耗材字典信息详情",
|
|
|
|
|
"/companyCert/company_product_relevance/id/customerId/unitFk/updateTime///供应商关联信息",
|
|
|
|
|
"basicCorp//basic_corp/id///updateTime///往来单位","typeThird//thr_bustype_origin/id///updateTime///第三方单据类型",
|
|
|
|
|
"basicThirdCorp//thr_corp/id///updateTime///第三方往来单位","//thr_dept/id///updateTime///第三方部门",
|
|
|
|
@ -85,14 +85,14 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
"/manufacturerCert/sup_cert/id/manufacturerId/manufacturerIdFk/updateTime/filePath/type=2/生产企业资质证书信息",
|
|
|
|
|
"/productCert/sup_cert/id/productId/productIdFk/updateTime/filePath/type=3/产品资质证书信息",
|
|
|
|
|
"//udicompany/id///updateTime///国际库医疗器械注册人信息"};
|
|
|
|
|
//"dbDiProducts//productinfo/id///updateTime///DI产品信息",
|
|
|
|
|
//"basicInv/////////仓库字典",
|
|
|
|
|
//"typeBus/////////业务单据类型",
|
|
|
|
|
//"typeScan/////////扫码单据类型",
|
|
|
|
|
//"dbDiProducts//productinfo/id///updateTime///DI产品信息",
|
|
|
|
|
//"basicInv/////////仓库字典",
|
|
|
|
|
//"typeBus/////////业务单据类型",
|
|
|
|
|
//"typeScan/////////扫码单据类型",
|
|
|
|
|
private int orderNum=0;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private SystemParamConfigService systemParamConfigService;
|
|
|
|
|
private SystemParamConfigService systemParamConfigService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
@ -101,7 +101,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
private DbDao dbDao;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ScheduledDao scheduledDao;
|
|
|
|
|
private ScheduledDao scheduledDao;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse taskList(HttpServletRequest request,Map<String,Object> params) {
|
|
|
|
@ -132,18 +132,18 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*UDI系统上传自助平台*/
|
|
|
|
|
/*UDI系统上传自助平台*/
|
|
|
|
|
@Override
|
|
|
|
|
public void asyncUdiTask() {
|
|
|
|
|
public void asyncUdiTask() {
|
|
|
|
|
logger.info("UDI管理系统同步任务开始--------");
|
|
|
|
|
asyncDataTask(true);
|
|
|
|
|
}
|
|
|
|
|
/*自助平台生成任务,不上传*/
|
|
|
|
|
}
|
|
|
|
|
/*自助平台生成任务,不上传*/
|
|
|
|
|
@Override
|
|
|
|
|
public void asyncSpsTask() {
|
|
|
|
|
public void asyncSpsTask() {
|
|
|
|
|
logger.info("自助平台同步任务开始--------");
|
|
|
|
|
asyncDataTask(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*拉取前一级中继服务数据*/
|
|
|
|
|
@Async
|
|
|
|
@ -196,7 +196,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
|
|
|
|
|
@Async
|
|
|
|
|
@Override
|
|
|
|
|
public void asyncIdcTask() {
|
|
|
|
|
public void asyncIdcTask() {
|
|
|
|
|
initTable();
|
|
|
|
|
Map<String,Object> map = dbDao.get("select * from idc_var where code='system_type'");
|
|
|
|
|
if(map==null) {
|
|
|
|
@ -261,18 +261,18 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
ScheduledRequest scheduledRequest = new ScheduledRequest();
|
|
|
|
|
scheduledRequest.setCronName("sync"+WordUtils.capitalizeFully(tnames[2], new char[]{'_'}).replace("_", ""));
|
|
|
|
|
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
|
|
|
|
|
String cron = scheduledEntity!=null ? scheduledEntity.getCron() : "";
|
|
|
|
|
String cron = scheduledEntity!=null ? scheduledEntity.getCron() : "";
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(cron)) {
|
|
|
|
|
if(!StringUtils.isEmpty(cron)) {
|
|
|
|
|
CronSequenceGenerator cronSequenceGenerator = new CronSequenceGenerator(cron);
|
|
|
|
|
Date nextTimePoint = cronSequenceGenerator.next(DateUtil.parseDate(lastUpdateTime));
|
|
|
|
|
sync = nextTimePoint.before(nowUpdateTime);
|
|
|
|
|
}
|
|
|
|
|
if(sync) {
|
|
|
|
|
if(sync) {
|
|
|
|
|
if(syncMasterData(map,isUpload,syncIp)) {
|
|
|
|
|
setUpdateTime(tnames[2]+"."+tnames[0],DateUtil.formatDate(nowUpdateTime,"yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -280,14 +280,14 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
|
|
|
|
|
private String fetchData(String host,Map<String,Object> params) {
|
|
|
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
|
.build();
|
|
|
|
|
.build();
|
|
|
|
|
MediaType mediaType = MediaType.parse("application/json");
|
|
|
|
|
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(params));
|
|
|
|
|
Request request = new Request.Builder()
|
|
|
|
|
.url(host+"/spssync/common/download")
|
|
|
|
|
.method("POST", body)
|
|
|
|
|
.addHeader("Content-Type", "application/json")
|
|
|
|
|
.build();
|
|
|
|
|
.url(host+"/spssync/common/download")
|
|
|
|
|
.method("POST", body)
|
|
|
|
|
.addHeader("Content-Type", "application/json")
|
|
|
|
|
.build();
|
|
|
|
|
String result = "";
|
|
|
|
|
MultipartFile[] files = {};
|
|
|
|
|
try {
|
|
|
|
@ -328,16 +328,16 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
|
|
|
|
|
private String post(String url,Map<String,Object> params) {
|
|
|
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
|
.build();
|
|
|
|
|
.build();
|
|
|
|
|
MediaType mediaType = MediaType.parse("application/json");
|
|
|
|
|
RequestBody body = RequestBody.create(mediaType, "");
|
|
|
|
|
if(params!=null)
|
|
|
|
|
body = RequestBody.create(mediaType,JSON.toJSONString(params));
|
|
|
|
|
Request request = new Request.Builder()
|
|
|
|
|
.url(url)
|
|
|
|
|
.method("POST", body)
|
|
|
|
|
.addHeader("Content-Type", "application/json")
|
|
|
|
|
.build();
|
|
|
|
|
.url(url)
|
|
|
|
|
.method("POST", body)
|
|
|
|
|
.addHeader("Content-Type", "application/json")
|
|
|
|
|
.build();
|
|
|
|
|
String result = "";
|
|
|
|
|
try {
|
|
|
|
|
Response response = client.newCall(request).execute();
|
|
|
|
@ -358,7 +358,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
/****/
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse receive(HttpServletRequest request,
|
|
|
|
|
String content,MultipartFile[] files) {
|
|
|
|
|
String content,MultipartFile[] files) {
|
|
|
|
|
/*授权检查,后续完善*/
|
|
|
|
|
String apiKey = request.getHeader("apiKey");
|
|
|
|
|
String secretKey = request.getHeader("secretKey");
|
|
|
|
@ -375,21 +375,21 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
IDCUtils.createDirectory(filePath +backFileSlash +datePath+"/");
|
|
|
|
|
|
|
|
|
|
FileUtils.SaveFileAs(content, fileName);
|
|
|
|
|
FileUtils.SaveFileAs(content, backFileName);
|
|
|
|
|
ArrayList<String> saveFiles = new ArrayList<>();
|
|
|
|
|
FileUtils.SaveFileAs(content, backFileName);
|
|
|
|
|
ArrayList<String> saveFiles = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
if(files!=null) {
|
|
|
|
|
if(files!=null) {
|
|
|
|
|
|
|
|
|
|
int n=0;
|
|
|
|
|
try {
|
|
|
|
|
for(MultipartFile file:files) {
|
|
|
|
|
String imageName = filePath +filePathSlash+"register/file/image2/"+file.getOriginalFilename();
|
|
|
|
|
saveFiles.add(imageName);
|
|
|
|
|
int n=0;
|
|
|
|
|
try {
|
|
|
|
|
for(MultipartFile file:files) {
|
|
|
|
|
String imageName = filePath +filePathSlash+"register/file/image2/"+file.getOriginalFilename();
|
|
|
|
|
saveFiles.add(imageName);
|
|
|
|
|
|
|
|
|
|
writeFile(file.getBytes(), filePath +filePathSlash+"register/file/image2/", file.getOriginalFilename());
|
|
|
|
|
writeFile(file.getBytes(), backFilePath +backFileSlash+datePath+"register/file/image2/", file.getOriginalFilename());
|
|
|
|
|
n++;
|
|
|
|
|
}
|
|
|
|
|
writeFile(file.getBytes(), filePath +filePathSlash+"register/file/image2/", file.getOriginalFilename());
|
|
|
|
|
writeFile(file.getBytes(), backFilePath +backFileSlash+datePath+"register/file/image2/", file.getOriginalFilename());
|
|
|
|
|
n++;
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
@ -398,33 +398,33 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*解析入库*/
|
|
|
|
|
boolean success = false;
|
|
|
|
|
if(isLastLevel()) {
|
|
|
|
|
success = analyMiddle("",json,files,true,true);
|
|
|
|
|
syncAddTaskStatus(json,2,success);
|
|
|
|
|
if(!success) {
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.error(9000, "解析失败");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//需要转发
|
|
|
|
|
if(isRelay()) {
|
|
|
|
|
String host = getNextHost();
|
|
|
|
|
String result = relay(request.getHeader("reqNo"),content,saveFiles,host);
|
|
|
|
|
if(IDCUtils.isJson(result)) {
|
|
|
|
|
syncAddTaskStatus(json,1,true);
|
|
|
|
|
BaseResponse object = JSON.parseObject(result,BaseResponse.class);
|
|
|
|
|
return object;
|
|
|
|
|
} else {
|
|
|
|
|
syncAddTaskStatus(json,1,false);
|
|
|
|
|
return ResultVOUtils.error(9000, "转发失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*解析入库*/
|
|
|
|
|
boolean success = false;
|
|
|
|
|
if(isLastLevel()) {
|
|
|
|
|
success = analyMiddle("",json,files,true,true);
|
|
|
|
|
syncAddTaskStatus(json,2,success);
|
|
|
|
|
if(!success) {
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.error(9000, "解析失败");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//需要转发
|
|
|
|
|
if(isRelay()) {
|
|
|
|
|
String host = getNextHost();
|
|
|
|
|
String result = relay(request.getHeader("reqNo"),content,saveFiles,host);
|
|
|
|
|
if(IDCUtils.isJson(result)) {
|
|
|
|
|
syncAddTaskStatus(json,1,true);
|
|
|
|
|
BaseResponse object = JSON.parseObject(result,BaseResponse.class);
|
|
|
|
|
return object;
|
|
|
|
|
} else {
|
|
|
|
|
syncAddTaskStatus(json,1,false);
|
|
|
|
|
return ResultVOUtils.error(9000, "转发失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -456,8 +456,8 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
byte[] bytes = FileUtils.readFileByBytes(filePath+filePathSlash+fileName);
|
|
|
|
|
os = response.getOutputStream();
|
|
|
|
|
os.write(bytes);
|
|
|
|
|
os.flush();
|
|
|
|
|
os.close();
|
|
|
|
|
os.flush();
|
|
|
|
|
os.close();
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
@ -667,23 +667,23 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
IDCUtils.createDirectory(filePath +datePath+"/");
|
|
|
|
|
|
|
|
|
|
FileUtils.SaveFileAs(content, fileName);
|
|
|
|
|
FileUtils.SaveFileAs(content, backFileName);
|
|
|
|
|
|
|
|
|
|
//type,transportType,superiorService,subordinateService,cacheFilePath
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("type", json.get("messageType"));
|
|
|
|
|
map.put("transportType", scheduleType == 0 ? "1" : "2");
|
|
|
|
|
map.put("scheduleType", scheduleType);
|
|
|
|
|
map.put("taskId", json.get("messageId"));
|
|
|
|
|
map.put("cacheFilePath", fileName);
|
|
|
|
|
map.put("status", success ? "1" : "0");
|
|
|
|
|
if(scheduleType==2) {
|
|
|
|
|
saveUploadStatus(map);
|
|
|
|
|
} else if (scheduleType==3) {
|
|
|
|
|
saveDownloadStatus(map);
|
|
|
|
|
} else {
|
|
|
|
|
saveExportStatus(map);
|
|
|
|
|
}
|
|
|
|
|
FileUtils.SaveFileAs(content, backFileName);
|
|
|
|
|
|
|
|
|
|
//type,transportType,superiorService,subordinateService,cacheFilePath
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("type", json.get("messageType"));
|
|
|
|
|
map.put("transportType", scheduleType == 0 ? "1" : "2");
|
|
|
|
|
map.put("scheduleType", scheduleType);
|
|
|
|
|
map.put("taskId", json.get("messageId"));
|
|
|
|
|
map.put("cacheFilePath", fileName);
|
|
|
|
|
map.put("status", success ? "1" : "0");
|
|
|
|
|
if(scheduleType==2) {
|
|
|
|
|
saveUploadStatus(map);
|
|
|
|
|
} else if (scheduleType==3) {
|
|
|
|
|
saveDownloadStatus(map);
|
|
|
|
|
} else {
|
|
|
|
|
saveExportStatus(map);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
logger.error(ex.getMessage());
|
|
|
|
|
}
|
|
|
|
@ -777,7 +777,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
key++;
|
|
|
|
|
} else {
|
|
|
|
|
if(columnList.get(i).get("columnKey")!=null&&!StringUtils.isEmpty(columnList.get(i).get("columnKey").toString())&&
|
|
|
|
|
("PRI".contains(columnList.get(i).get("columnKey").toString()))) {
|
|
|
|
|
("PRI".contains(columnList.get(i).get("columnKey").toString()))) {
|
|
|
|
|
keyColumn[key] = columnList.get(i).get("columnName").toString();
|
|
|
|
|
keyDataType[key]=columnList.get(i).get("dataType").toString().contains("char") ? "C" : columnList.get(i).get("dataType").toString().contains("date") ? "D" : "N";
|
|
|
|
|
key++;
|
|
|
|
@ -823,35 +823,35 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
String value = list.get(i).get(attrName) !=null ? list.get(i).get(attrName).toString() : "";
|
|
|
|
|
value = DBAUtils.escape(value);
|
|
|
|
|
String dataType = columnList.get(k).get("dataType").toLowerCase().contains("char") || columnList.get(k).get("dataType").toLowerCase().contains("text") ?
|
|
|
|
|
"C" : columnList.get(k).get("dataType").toLowerCase().contains("date") ? "D" : "N" ;
|
|
|
|
|
|
|
|
|
|
sql+=m>0 ? "," : "";
|
|
|
|
|
boolean ups = list.get(i).containsKey(attrName) ? true : false ;
|
|
|
|
|
updateSet+=ups&&h>0 ? "," : "";
|
|
|
|
|
updateSet+=ups ? columnList.get(k).get("columnName")+"=" : "";
|
|
|
|
|
if(StringUtils.isEmpty(value)) {
|
|
|
|
|
sql+="null";
|
|
|
|
|
updateSet+=ups ? "null" : "";
|
|
|
|
|
"C" : columnList.get(k).get("dataType").toLowerCase().contains("date") ? "D" : "N" ;
|
|
|
|
|
|
|
|
|
|
sql+=m>0 ? "," : "";
|
|
|
|
|
boolean ups = list.get(i).containsKey(attrName) ? true : false ;
|
|
|
|
|
updateSet+=ups&&h>0 ? "," : "";
|
|
|
|
|
updateSet+=ups ? columnList.get(k).get("columnName")+"=" : "";
|
|
|
|
|
if(StringUtils.isEmpty(value)) {
|
|
|
|
|
sql+="null";
|
|
|
|
|
updateSet+=ups ? "null" : "";
|
|
|
|
|
} else {
|
|
|
|
|
if(dataType.equals("C")) {
|
|
|
|
|
sql+="'"+value+"'";
|
|
|
|
|
updateSet+=ups ? "'"+value+"'" : "";
|
|
|
|
|
} else if (dataType.equals("N")) {
|
|
|
|
|
sql+=value;
|
|
|
|
|
updateSet+=ups ? value : "";
|
|
|
|
|
} else {
|
|
|
|
|
if(dataType.equals("C")) {
|
|
|
|
|
sql+="'"+value+"'";
|
|
|
|
|
updateSet+=ups ? "'"+value+"'" : "";
|
|
|
|
|
} else if (dataType.equals("N")) {
|
|
|
|
|
sql+=value;
|
|
|
|
|
updateSet+=ups ? value : "";
|
|
|
|
|
} else {
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
date = StringUtils.isNumeric(value) ? new Date(Long.valueOf(value)) : IDCUtils.parseDate(value);
|
|
|
|
|
String str = DateUtils.format(date, "yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
sql+="cast('"+str+"' as datetime)";
|
|
|
|
|
updateSet+=ups ? "cast('"+str+"' as datetime)" : "";
|
|
|
|
|
}
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
date = StringUtils.isNumeric(value) ? new Date(Long.valueOf(value)) : IDCUtils.parseDate(value);
|
|
|
|
|
String str = DateUtils.format(date, "yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
sql+="cast('"+str+"' as datetime)";
|
|
|
|
|
updateSet+=ups ? "cast('"+str+"' as datetime)" : "";
|
|
|
|
|
}
|
|
|
|
|
m++;
|
|
|
|
|
if(operateMode.equals("U")&&!StringUtils.isEmpty(updateSet)&&!StringUtils.isEmpty(updateWhere))
|
|
|
|
|
dbDao.update(upd + updateSet+" where "+updateWhere);
|
|
|
|
|
h+=ups ? 1 : 0;
|
|
|
|
|
}
|
|
|
|
|
m++;
|
|
|
|
|
if(operateMode.equals("U")&&!StringUtils.isEmpty(updateSet)&&!StringUtils.isEmpty(updateWhere))
|
|
|
|
|
dbDao.update(upd + updateSet+" where "+updateWhere);
|
|
|
|
|
h+=ups ? 1 : 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sql+=")";
|
|
|
|
|
n++;
|
|
|
|
@ -894,7 +894,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
host+="/spssync/common/upload" ;
|
|
|
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
|
.connectTimeout(30, TimeUnit.SECONDS)//设置连接超时时间
|
|
|
|
|
.readTimeout(30, TimeUnit.SECONDS)//设置读取超时时间
|
|
|
|
|
.readTimeout(30, TimeUnit.SECONDS)//设置读取超时时间
|
|
|
|
|
.build();
|
|
|
|
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
|
|
|
|
|
|
|
|
@ -905,8 +905,8 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
for (int i = 0; i < files.size(); i++) {
|
|
|
|
|
if(!StringUtils.isEmpty(files.get(i))) {
|
|
|
|
|
File file = new File(files.get(i));
|
|
|
|
|
builder.addFormDataPart("files",files.get(i),
|
|
|
|
|
RequestBody.create(MediaType.parse(fileType), file));
|
|
|
|
|
builder.addFormDataPart("files",files.get(i),
|
|
|
|
|
RequestBody.create(MediaType.parse(fileType), file));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -914,17 +914,17 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
RequestBody body = builder.build();
|
|
|
|
|
|
|
|
|
|
Request req = new Request.Builder()
|
|
|
|
|
.url(host)
|
|
|
|
|
.method("POST", body)
|
|
|
|
|
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
|
|
|
|
.addHeader("format", "json")
|
|
|
|
|
.addHeader("apiKey", apiKey)
|
|
|
|
|
.addHeader("secretKey", apiSecret)
|
|
|
|
|
.addHeader("reqNo", reqNo)
|
|
|
|
|
.addHeader("timestamp",DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"))
|
|
|
|
|
.addHeader("Access-Control-Allow-Headers", "Authorization, Origin, X-Requested-With, Content-Type, Accept")
|
|
|
|
|
.build();
|
|
|
|
|
try {
|
|
|
|
|
.url(host)
|
|
|
|
|
.method("POST", body)
|
|
|
|
|
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
|
|
|
|
.addHeader("format", "json")
|
|
|
|
|
.addHeader("apiKey", apiKey)
|
|
|
|
|
.addHeader("secretKey", apiSecret)
|
|
|
|
|
.addHeader("reqNo", reqNo)
|
|
|
|
|
.addHeader("timestamp",DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"))
|
|
|
|
|
.addHeader("Access-Control-Allow-Headers", "Authorization, Origin, X-Requested-With, Content-Type, Accept")
|
|
|
|
|
.build();
|
|
|
|
|
try {
|
|
|
|
|
Response response = client.newCall(req).execute();
|
|
|
|
|
result=response.body().string();
|
|
|
|
|
log.debug("result--->"+result);
|
|
|
|
@ -958,7 +958,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
private boolean signleDownloadFile(String syncIp,String fileName) {
|
|
|
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
|
.build();;
|
|
|
|
|
.build();;
|
|
|
|
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
|
|
|
|
|
|
|
|
|
RequestBody body = RequestBody.create(mediaType, "fileName="+fileName);
|
|
|
|
@ -1099,7 +1099,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
for(int i=0;i<columnList.size();i++) {
|
|
|
|
|
Map<String,Object> column = new HashMap<String,Object>();
|
|
|
|
|
String dataType =columnList.get(i).get("dataType").toLowerCase().contains("char") || columnList.get(i).get("dataType").toLowerCase().contains("text")?
|
|
|
|
|
"C" : columnList.get(i).get("dataType").toLowerCase().contains("date") ? "D" : "N" ;;
|
|
|
|
|
"C" : columnList.get(i).get("dataType").toLowerCase().contains("date") ? "D" : "N" ;;
|
|
|
|
|
String attrName = columnList.get(i).get("columnName").toString();
|
|
|
|
|
if(map.get(attrName)==null) {
|
|
|
|
|
column.put("tableName", tname);
|
|
|
|
|