演示系统细节修改

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());

View File

@@ -8,9 +8,11 @@ jdbc.devlop.password=/+7+DgxK++ZaD1nIcRRmDg==
jdbc.product.driver=oracle.jdbc.driver.OracleDriver
#jdbc.product.url=jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.17)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA =(SERVICE_NAME = ORCL)(FAILOVER_MODE =(TYPE = select)(METHOD = basic)(RETRIES = 180)(DELAY = 180))))
jdbc.product.url=jdbc:oracle:thin:@10.0.6.212:1523:app
#jdbc.product.url=jdbc:oracle:thin:@10.0.6.212:1523:app
jdbc.product.url=jdbc:oracle:thin:@10.0.6.165:1521:orcl
#jdbc.product.url=jdbc:oracle:thin:@10.174.196.20:1521:orcl
jdbc.product.username=gk_pz
jdbc.product.username=dfxj_2015
#jdbc.product.username=gk_pz
#jdbc.product.username=z2_5x9pz
jdbc.product.key=3X3ZBejyxS7lkVsHVm9KTw==
jdbc.product.password=sHqDBZIUS0hYZCbC+1xN3A==

View File

@@ -1,12 +1,12 @@
#编译表表名
compileTabName=CONFIG_COMPILE
compileTabName=MATT_CONFIG_COMPILE_WY
#编译表 新增配置时添加的字段 英文逗号分隔
compileFieldName=COMPILE_ID ,SERVICE ,ACTION , CONT_TYPE, ATTR_TYPE, CONT_LABEL, Task_id, Guarantee_ID, AFFAIR_ID, TOPIC_ID, DO_BLACKLIST ,DO_LOG ,EFFECTIVE_RANGE , ACTIVE_SYS, CONFIG_PERCENT ,CONFIG_OPTION ,START_TIME ,END_TIME , USER_REGION, IS_VALID,GROUP_NUM,FATHER_CFG_ID ,OP_TIME
#编译表 配置状态更新的条件
compileUpdateCondition=COMPILE_ID
#分组表表名
groupTabName=CONFIG_GROUP
groupTabName=MAAT_CONFIG_GROUP_WY
#分组表 新增配置时添加的字段 英文逗号分隔
#注意:第一个字段必需是分组表主键
groupFieldName=ID,GROUP_ID, COMPILE_ID, IS_VALID, OP_TIME