演示系统细节修改

This commit is contained in:
zhangdongxu
2018-02-09 17:49:14 +08:00
parent 9bcc1211c6
commit 8c6cf449e1
4 changed files with 55 additions and 4 deletions

View File

@@ -80,6 +80,13 @@ public class ConfigSourcesService extends BaseService {
public static Map<Integer, Map<String, String>> getTableRelation() {
Map<Integer, Map<String, String>> tableMap = new HashMap<Integer, Map<String, String>>();
Map<String, String> typeMap = new HashMap<String, String>();
typeMap.put("REUSE_IP", "ip");
typeMap.put("HID_CONTENT", "ip");
typeMap.put("GSB_PZ_IP", "ip");
typeMap.put("FAKE_REGION_EXTEND", "str");
tableMap.put(0, typeMap);
typeMap = new HashMap<String, String>();
typeMap.put("DF_IP_PORT", "ip");
tableMap.put(1, typeMap);

View File

@@ -435,6 +435,44 @@ public class UpdateCompileByJDBCThread implements Runnable {
}
}
}
/**
*
* @Description: 根据compileId更新与之对应的group关系表的生效状态
* @author (zdx)
* @date 2017年8月16日 上午9:46:44
* @param compileList
* @param conn
* @param opTime
* @param msgList
*/
public static void updateGroupByCompileId(List<ConfigCompile> compileList, Connection conn, Date opTime,
List<Exception> msgList) {
if (null != compileList && compileList.size() > 0) {
try {
StringBuffer sb = new StringBuffer();
String tabName = Configurations.getStringProperty("groupTabName", "CONFIG_GROUP");
sb.append("update "+tabName+" set IS_VALID=?,op_time=?,LAST_UPDATE=sysdate where COMPILE_ID=? ");
conn.setAutoCommit(false);
PreparedStatement ps = conn.prepareStatement(sb.toString());
for (ConfigCompile compile : compileList) {
Object[] obj = new Object[] { compile.getIsValid(), opTime,compile.getCompileId() };
for (int x = 0; x < obj.length; x++) {
if (x == 1) {
ps.setTimestamp(x + 1, utileDate2TimeStamp(opTime));
} else {
ps.setObject(x + 1, obj[x]);
}
}
ps.addBatch();
}
ps.executeBatch();
} catch (Exception e) {
logger.error(e);
msgList.add(e);
}
}
}
@Override
public void run() {
List<Exception> msgList = ConfigSourcesService.getMsgList();
@@ -451,6 +489,10 @@ public class UpdateCompileByJDBCThread implements Runnable {
} else if (null != numRegionList && numRegionList.size() > 0) {
updateNumRegion(tableName, numRegionList, conn, opTime, msgList);
}
if((null !=compileList && compileList.size() > 0)&&(null != groupList && groupList.size()==0)){
updateGroupByCompileId(compileList, conn, opTime, msgList);
}
latch.countDown();
// System.out.println("latchCount=======================" +
// latch.getCount());