增加common-text

master
admin 2 years ago
parent bd51920d7b
commit 8b9a66b031

@ -328,6 +328,11 @@
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.30.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<build>

@ -15,7 +15,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;
import org.apache.commons.text.WordUtils;
import org.apache.tools.ant.util.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -116,11 +116,13 @@ public class IdcServiceImpl implements IdcService {
/*UDI系统上传自助平台*/
@Override
public void asyncUdiTask() {
logger.info("UDI管理系统同步任务开始--------");
asyncDataTask(true);
}
/*自助平台生成任务,不上传*/
@Override
public void asyncSpsTask() {
logger.info("自助平台同步任务开始--------");
asyncDataTask(false);
}
@ -164,11 +166,12 @@ public class IdcServiceImpl implements IdcService {
private void asyncDataTask(boolean isUpload) {
initTable();
Map<String,Object> map = dbDao.get("select * from sync_data_set limit 1");
if(map!=null&&map.get("downstreamEnable")!=null&&map.get("downstreamEnable").toString().equals("1"))
for(int i=0;i<SYNC_TABLES.length;i++) {
String[] tnames = SYNC_TABLES[i].split("/");
if(!StringUtils.isEmpty(tnames[0])&&map!=null&&map.get(tnames[0])!=null&&map.get(tnames[0]).toString().equals("1"))
syncData(SYNC_TABLES[i],isUpload);
if(map!=null&&map.get("downstreamEnable")!=null&&map.get("downstreamEnable").toString().equals("1")) {
for(int i=0;i<SYNC_TABLES.length;i++) {
String[] tnames = SYNC_TABLES[i].split("/");
if(!StringUtils.isEmpty(tnames[0])&&map!=null&&map.get(tnames[0])!=null&&map.get(tnames[0]).toString().equals("1"))
syncData(SYNC_TABLES[i],isUpload);
}
}
}
@ -190,7 +193,7 @@ public class IdcServiceImpl implements IdcService {
String keyColumn = keyList!=null&&keyList.size()>0 ? keyList.get(0).get("columnName").toString() : "id";
Map<String,Object> map = new HashMap<String,Object>();
String sqlWhere = "not exists (select fkId from idc_record where type='"+tnames[2]+"' and fkId="+tnames[2]+"."+keyColumn+")";
if(!StringUtils.isEmpty(tnames[2])) {
if(!StringUtils.isEmpty(tnames[5])) {
sqlWhere+=" and "+tnames[5]+">=cast('"+lastUpdateTime+"' as datetime)";
} else {
map.put("isEnd", "1");
@ -405,6 +408,7 @@ public class IdcServiceImpl implements IdcService {
String tableKey = params.get("tableKey").toString();
String[] childs = {};
int childNum = -1;
/*子表*/
for(String str:SYNC_TABLES) {
if(str.contains("/"+tableKey+"/")) {
childNum++;
@ -472,8 +476,14 @@ public class IdcServiceImpl implements IdcService {
}
orderNum++;
if(isUplaod) {
String result = relay("",JSON.toJSONString(data),files);
String result = "";
try {
result = relay("",JSON.toJSONString(data),files);
} catch (Exception ex) {
}
if(IDCUtils.isJson(result)) {
JSONObject json = JSON.parseObject(result);
if(json.getInteger("code")==20000) {
@ -487,9 +497,16 @@ public class IdcServiceImpl implements IdcService {
logger.error(result);
saveIdcLog(messageType,"",tableName +">"+result,i *limit,total);
}
} else {
success = false;
saveIdcLog(messageType,"",tableName +">fail:上传地址未连通",i *limit,total);
}
} else {
syncAddTask(data);
if(!StringUtils.isEmpty(recordSql)) {
dbDao.save("insert into idc_record (id,type,fkId,isEnd,createTime) values "+recordSql);
}
saveIdcLog(messageType,"",tableName +">success",i *limit,total);
}
}
}

Loading…
Cancel
Save