|
|
|
@ -125,6 +125,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
logger.info("UDI管理系统同步任务开始--------");
|
|
|
|
|
asyncDataTask(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*自助平台生成任务,不上传*/
|
|
|
|
|
@Override
|
|
|
|
|
public void asyncSpsTask() {
|
|
|
|
@ -138,6 +139,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
public void asyncFetchUdiTask() {
|
|
|
|
|
fetchTask(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Async
|
|
|
|
|
@Override
|
|
|
|
|
public void asyncFetchTask() {
|
|
|
|
@ -255,7 +257,6 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String fetchData(String host, Map<String, Object> params) {
|
|
|
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
|
.build();
|
|
|
|
@ -332,6 +333,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
dbDao.update(sql);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****/
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse receive(HttpServletRequest request,
|
|
|
|
@ -403,6 +405,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse send(String messageType, String tableName, Map<String, Object> params) {
|
|
|
|
|
|
|
|
|
@ -432,6 +435,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
|
|
|
|
|
dbDao.save(sql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveDownloadStatus(String messageType, String taskId, String remark) {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
map.put("id", CustomUtil.getId());
|
|
|
|
@ -445,6 +449,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
|
|
|
|
|
dbDao.save(sql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveIdcLog(String messageType, String taskId, String content, int offset, int total) {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
map.put("id", CustomUtil.getId());
|
|
|
|
@ -610,7 +615,6 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*解析到数据库*/
|
|
|
|
|
private boolean analyToDB(JSONObject jsonObject, MultipartFile[] files) {
|
|
|
|
|
|
|
|
|
@ -852,6 +856,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
List<Map<String, Object>> list = dbDao.list(map);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*由表名获取数据*/
|
|
|
|
|
private Map<String, Object> getData(String messageType, String tableName, Map<String, Object> params, Map<String, Object> whereParams) {
|
|
|
|
|
List<Map<String, Object>> list = getList(tableName, whereParams);
|
|
|
|
@ -870,8 +875,6 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()))) {
|
|
|
|
@ -888,6 +891,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
System.out.print(JSON.toJSONString(systemParamConfigEntity) + "\n");
|
|
|
|
|
return systemParamConfigEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void writeFile(byte[] file, String filePath, String fileName) throws Exception {
|
|
|
|
|
File targetFile = new File(filePath);
|
|
|
|
|
if (!targetFile.exists()) {
|
|
|
|
@ -912,7 +916,8 @@ 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);
|
|
|
|
@ -948,6 +953,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
return updateTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String setUpdateTime(String id, String updateTime) {
|
|
|
|
|
String sql = "";
|
|
|
|
|
Map<String, Object> map = dbDao.get("select * from idc_status where id='" + id + "'");
|
|
|
|
@ -960,6 +966,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
}
|
|
|
|
|
return updateTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void initTable() {
|
|
|
|
|
alterTable("idc_var", "create table idc_var (code varchar(60),content varchar(200),PRIMARY KEY (code))");
|
|
|
|
|
alterTable("idc_status", "create table idc_status (id varchar(36),statusTime datetime,PRIMARY KEY (id))");
|
|
|
|
@ -973,6 +980,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void alterTable(String tableName, String sql) {
|
|
|
|
|
Map<String, String> map = dbDao.getMysql(tableName);
|
|
|
|
|
if (!(map != null && map.get("tableName") != null)) {
|
|
|
|
|