|
|
|
@ -61,12 +61,12 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
private String filePath;
|
|
|
|
|
@Value("${back_file_path}")
|
|
|
|
|
private String backFilePath;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${API_KEY}")
|
|
|
|
|
private String apiKey;
|
|
|
|
|
@Value("${API_SECRET}")
|
|
|
|
|
private String apiSecret;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*自助平台->UDI*/
|
|
|
|
|
private final String[] SPMS_TO_UDI_TABLES= {
|
|
|
|
|
"basic_udirel/updateTime//耗材字典","basic_products///耗材字典信息详情","company_product_relevance/updateTime//供应商关联信息",
|
|
|
|
@ -90,19 +90,19 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
"productinfo/updateTime//国家库UDI数据,udicompany/updateTime//国际库医疗器械注册人信息"};
|
|
|
|
|
|
|
|
|
|
private int orderNum=0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private SystemParamConfigService systemParamConfigService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private DbDao dbDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ScheduledDao scheduledDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse taskList(HttpServletRequest request,Map<String,Object> params) {
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
@ -110,7 +110,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
List<Map<String,Object>> list = dbDao.list(map);
|
|
|
|
|
return ResultVOUtils.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse download(HttpServletRequest request,Map<String,Object> params) {
|
|
|
|
|
Map<String,Object> map = dbDao.get("select * from basic_upload_status where taskId='"+params.get("taskId")+"'");
|
|
|
|
@ -120,7 +120,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
JSONObject object = JSON.parseObject(json);
|
|
|
|
|
return ResultVOUtils.success(object);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*拉取前一级中继服务数据*/
|
|
|
|
|
@Override
|
|
|
|
|
public void pull() {
|
|
|
|
@ -138,14 +138,14 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Async
|
|
|
|
|
@Override
|
|
|
|
|
public void asyncIdcTask() {
|
|
|
|
|
initTable();
|
|
|
|
|
String[] tNames= {};
|
|
|
|
|
String direction = getDirection();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(direction.equals("I")) {
|
|
|
|
|
tNames = SPMS_TO_UDI_TABLES;
|
|
|
|
|
} else {
|
|
|
|
@ -161,7 +161,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
uploadData(t);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void uploadData(String t) {
|
|
|
|
|
String[] tn = t.split("/");
|
|
|
|
@ -196,7 +196,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String pullData(String url,Map<String,Object> params) {
|
|
|
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
|
.build();
|
|
|
|
@ -220,7 +220,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String post(String url,Map<String,Object> params) {
|
|
|
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
|
.build();
|
|
|
|
@ -241,8 +241,8 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BaseResponse downlaodSuccess(HttpServletRequest request,Map<String,Object> params) {
|
|
|
|
|
String sql = "update basic_upload_status set status='1' where taskId='"+params.get("taskId")+"'";
|
|
|
|
|
dbDao.update(sql);
|
|
|
|
@ -257,9 +257,9 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
String secretKey = request.getHeader("secretKey");
|
|
|
|
|
/*******/
|
|
|
|
|
JSONObject json = JSONObject.parseObject(content);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String datePath = DateUtil.formatDate(new Date(),"yyyy-MM-dd");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FileUtils.makeDirectory(filePath +datePath+"/");
|
|
|
|
|
FileUtils.makeDirectory(backFilePath +datePath+"/");
|
|
|
|
|
String fileName = filePath +datePath+"/"+json.getString("messageType")+"-"+json.getString("messageId")+".udi";
|
|
|
|
@ -284,7 +284,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
saveUploadStatus(json.getString("messageType"),json.getString("messageId"),fileName);
|
|
|
|
|
/*解析入库*/
|
|
|
|
@ -298,8 +298,8 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*数据同步,从数据库获取数据下发或上传下级中继服务*/
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse send(Map<String,Object> params) {
|
|
|
|
@ -307,12 +307,12 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse send(String messageType,String tableName,Map<String,Object> params) {
|
|
|
|
|
if(sendOnPage(messageType,tableName,params))
|
|
|
|
|
if(sendOnPage(messageType,tableName,params))
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
return ResultVOUtils.error(9999, "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void saveUploadStatus(String messageType,String taskId,String fileName) {
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
map.put("id", CustomUtil.getId());
|
|
|
|
@ -323,7 +323,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
map.put("updateTime", new Date());
|
|
|
|
|
Map<String,Object> columns = getColumn("basic_upload_status");
|
|
|
|
|
String sql = "insert into basic_upload_status "+DBAUtils.parseInsert(map, columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dbDao.save(sql);
|
|
|
|
|
}
|
|
|
|
|
private void saveDownloadStatus(String messageType,String taskId,String remark) {
|
|
|
|
@ -336,7 +336,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
map.put("remark", remark);
|
|
|
|
|
Map<String,Object> columns = getColumn("basic_download_status");
|
|
|
|
|
String sql = "insert into basic_download_status "+DBAUtils.parseInsert(map, columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dbDao.save(sql);
|
|
|
|
|
}
|
|
|
|
|
private void saveIdcLog(String messageType,String taskId,String content,int offset,int total) {
|
|
|
|
@ -351,7 +351,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
map.put("total", total);
|
|
|
|
|
Map<String,Object> columns = getColumn("idc_log");
|
|
|
|
|
String sql = "insert into idc_log "+DBAUtils.parseInsert(map, columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dbDao.save(sql);
|
|
|
|
|
}
|
|
|
|
|
private boolean sendOnPage(String messageType,String tableName,Map<String,Object> params) {
|
|
|
|
@ -359,10 +359,10 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
Map<String,String> table = dbDao.getMysql(tableName);
|
|
|
|
|
if(!(table!=null&&table.get("tableName")!=null))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String sql = "select count(*) from "+tableName;
|
|
|
|
|
Map<String,Object> column = getColumn(tableName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String where = DBAUtils.convertWhere(column,params,"");
|
|
|
|
|
sql+=!StringUtils.isEmpty(where) ? " where "+where : "";
|
|
|
|
@ -370,7 +370,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
int total = dbDao.count(map);
|
|
|
|
|
String direction = getDirection();
|
|
|
|
|
String isEnd = params.get("isEnd")!=null ? params.get("isEnd").toString() : "0";
|
|
|
|
|
int limit = 50;
|
|
|
|
|
int limit = 50;
|
|
|
|
|
String[] files = new String[limit];
|
|
|
|
|
String filePathColumn = params.get("filePathColumn")!=null ? params.get("filePathColumn").toString() : "";
|
|
|
|
|
orderNum++;
|
|
|
|
@ -386,7 +386,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
orderNum++;
|
|
|
|
|
saveIdcLog(messageType,"",tableName +">"+where,i *limit,total);
|
|
|
|
|
if(data.get("data")!=null) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map> list = JSONObject.parseArray(JSON.toJSONString(data.get("data")), Map.class);
|
|
|
|
|
if(list!=null&&list.size()>0) {
|
|
|
|
|
for(int m=0;m<list.size();m++) {
|
|
|
|
@ -396,7 +396,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
recordSql+=!StringUtils.isEmpty(recordSql) ? "," : "";
|
|
|
|
|
recordSql+="('"+UUID.randomUUID().toString().replaceAll("-", "")+"','"+tableName+"','"+list.get(m).get("id")+"','"+isEnd+"',now())";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
orderNum++;
|
|
|
|
|
String result = relay(direction,"",JSON.toJSONString(data),files);
|
|
|
|
|
if(IDCUtils.isJson(result)) {
|
|
|
|
@ -419,7 +419,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*解析到数据库*/
|
|
|
|
|
private void analyToDB(JSONObject jsonObject,MultipartFile[] files) {
|
|
|
|
|
if(!StringUtils.isEmpty(jsonObject.getString("tableName"))) {
|
|
|
|
@ -428,7 +428,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
//图片处理
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*按表名解析数据到数据库,子表暂未处理*/
|
|
|
|
|
private void analyData(String tableName,List<Map<String,Object>> list) {
|
|
|
|
|
String tName = DBAUtils.tableRealName(tableName);
|
|
|
|
@ -455,7 +455,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sql+=") values ";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(list!=null&&list.size()>0) {
|
|
|
|
|
int n = 0;
|
|
|
|
|
int d = 0;
|
|
|
|
@ -470,10 +470,10 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
updateWhere+=keyColumn[z]+" = "+(keyDataType[z].equals("C") ? "'" :"") +list.get(i).get(keyColumn[z]) +(keyDataType[z].equals("C") ? "'" :"");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if("A,D".contains(operateMode)&&!StringUtils.isEmpty(updateWhere))
|
|
|
|
|
if("A,D".contains(operateMode)&&!StringUtils.isEmpty(updateWhere))
|
|
|
|
|
dbDao.delete(del+updateWhere);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*A 新增 U 更新*/
|
|
|
|
|
if("A,U".contains(operateMode)) {
|
|
|
|
|
sql+=n>0 ? "," : "";
|
|
|
|
@ -484,7 +484,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
String extra = columnList.get(k).get("extra")!=null&&columnList.get(k).get("extra").toLowerCase().contains("auto") ? "A" : "N";
|
|
|
|
|
String attrName = columnList.get(k).get("attrName");
|
|
|
|
|
String value = list.get(i).get(attrName) !=null ? list.get(i).get(attrName).toString() : "";
|
|
|
|
|
String dataType = columnList.get(k).get("dataType").toLowerCase().contains("char") || columnList.get(k).get("dataType").toLowerCase().contains("text") ?
|
|
|
|
|
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" ;
|
|
|
|
|
if(extra.equals("N")) {
|
|
|
|
|
sql+=m>0 ? "," : "";
|
|
|
|
@ -521,12 +521,12 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
if(n>0)
|
|
|
|
|
dbDao.save(sql);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*转发下级或上级中继服务*/
|
|
|
|
|
private String relay(String direction,String reqNo,String content,String[] files) {
|
|
|
|
|
String host = getNextHost(direction);
|
|
|
|
@ -540,20 +540,20 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
.readTimeout(30, TimeUnit.SECONDS)//设置读取超时时间
|
|
|
|
|
.build();
|
|
|
|
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MultipartBody.Builder builder = new MultipartBody.Builder();
|
|
|
|
|
builder.setType(MultipartBody.FORM);
|
|
|
|
|
String fileType = "application/octet-stream";
|
|
|
|
|
for (int i = 0; i < files.length; i++) {
|
|
|
|
|
for (int i = 0; i < files.length; i++) {
|
|
|
|
|
if(!StringUtils.isEmpty(files[i])) {
|
|
|
|
|
File file = new File(files[i]);
|
|
|
|
|
builder.addFormDataPart("files",files[i],
|
|
|
|
|
File file = new File(files[i]);
|
|
|
|
|
builder.addFormDataPart("files",files[i],
|
|
|
|
|
RequestBody.create(MediaType.parse(fileType), file));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
builder.addFormDataPart("content", content);
|
|
|
|
|
RequestBody body = builder.build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Request req = new Request.Builder()
|
|
|
|
|
.url(host)
|
|
|
|
|
.method("POST", body)
|
|
|
|
@ -573,13 +573,13 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
log.debug("未配置中继服务地址");
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*获取转发服务地址,当前值允许单向,只使用参数upper_server_ip*/
|
|
|
|
|
private String getNextHost(String direction) {
|
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity = getSystemParamConfig("upper_server_ip","中继上传服务地址" , "","");
|
|
|
|
@ -587,14 +587,14 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
//getSystemParamConfig("sync_idc_lower_host","下级(下发)中继服务地址" , "","") ;
|
|
|
|
|
return systemParamConfigEntity.getParamValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*判断是否最后一级*/
|
|
|
|
|
private boolean isLastLevel(String direction) {
|
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity =
|
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity =
|
|
|
|
|
direction.equals("I") ? getSystemParamConfig("sync_idc_top","是否顶级中继服务(连接自助平台)" , "0","0:否;1:是(是,接收下级上传数据后解析入库)"):
|
|
|
|
|
getSystemParamConfig("sync_idc_final","是否末级中继服务(连接UDI管理系统)" , "0","0:否;1:是(是,接收上级下发数据后解析入库)") ;
|
|
|
|
|
return systemParamConfigEntity.getParamValue().equals("0") ? false : true ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/*检查当前系统为自助平台(下发)还是UDI系统(上传),返回传输方向,如果都未设置,默认返回下发*/
|
|
|
|
|
private String getDirection() {
|
|
|
|
@ -606,13 +606,13 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
return "U";
|
|
|
|
|
}
|
|
|
|
|
return "I";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*是否需要转发*/
|
|
|
|
|
private boolean isRelay(String direction) {
|
|
|
|
|
String relayStr = direction.equals("U") ? "sync_upstream_enable" : "sync_downstream_enable";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey(relayStr);
|
|
|
|
|
if (systemParamConfigEntity!=null&&systemParamConfigEntity.getParamValue()!=null&&
|
|
|
|
|
systemParamConfigEntity.getParamValue().equals("0")) {
|
|
|
|
@ -620,8 +620,8 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*由表名获取数据*/
|
|
|
|
|
private Map<String,Object> getData(String messageType,String tableName,Map<String,Object> params) {
|
|
|
|
|
String sql = "select "+tableName+".*,'A' as operateMode from "+tableName;
|
|
|
|
@ -641,10 +641,10 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
map.put("data", list);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private SystemParamConfigEntity getSystemParamConfig(String paramKey,String paramName,String defaultValue,String paramExplain) {
|
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey(paramKey);
|
|
|
|
|
if(systemParamConfigEntity==null||(systemParamConfigEntity!=null&&StringUtils.isEmpty(systemParamConfigEntity.getParamKey()))) {
|
|
|
|
@ -654,7 +654,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
systemParamConfigEntity.setParentId(0);
|
|
|
|
|
systemParamConfigEntity.setParamValue(defaultValue);
|
|
|
|
|
systemParamConfigEntity.setParamExplain(paramExplain);
|
|
|
|
|
systemParamConfigEntity.setParamStatus(0);
|
|
|
|
|
systemParamConfigEntity.setParamStatus(1);
|
|
|
|
|
systemParamConfigEntity.setParamType(0);
|
|
|
|
|
systemParamConfigService.insert(systemParamConfigEntity);
|
|
|
|
|
}
|
|
|
|
@ -671,8 +671,8 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
out.flush();
|
|
|
|
|
out.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*把列数据转Map*/
|
|
|
|
|
private Map<String,Object> getColumn(String tableName) {
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
@ -684,7 +684,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
if(columnList!=null&&columnList.size()>0) {
|
|
|
|
|
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")?
|
|
|
|
|
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" ;;
|
|
|
|
|
String attrName = columnList.get(i).get("columnName").toString();
|
|
|
|
|
if(map.get(attrName)==null) {
|
|
|
|
@ -707,8 +707,8 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getUpdateTime(String id) {
|
|
|
|
|
String updateTime = "";
|
|
|
|
|
Map<String,Object> map = dbDao.get("select * from idc_status where id='"+id+"'");
|
|
|
|
@ -718,7 +718,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
updateTime = "2000-01-01 00:00:00";
|
|
|
|
|
String sql = "insert into idc_status (id,statusTime) values ('"+id+"',cast('"+updateTime+"' as datetime))";
|
|
|
|
|
dbDao.save(sql);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return updateTime;
|
|
|
|
|
}
|
|
|
|
|
private String setUpdateTime(String id,String updateTime) {
|
|
|
|
@ -730,7 +730,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
} else {
|
|
|
|
|
sql = "insert into idc_status (id,statusTime) values ('"+id+"',cast('"+updateTime+"' as datetime))";
|
|
|
|
|
dbDao.save(sql);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return updateTime;
|
|
|
|
|
}
|
|
|
|
|
private void initTable() {
|
|
|
|
@ -744,7 +744,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
if(!(map!=null&&map.get("tableName")!=null)) {
|
|
|
|
|
jdbcTemplate.execute(sql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|