| | |
| | | if (syncInfo != null && !StringUtils.isEmpty(syncInfo.getString(CmnConst.TABLE_NAME))) { |
| | | String tableName = syncInfo.getString(CmnConst.TABLE_NAME); |
| | | baseDao.executeUpdate("UPDATE product_sys_data_center_log set deal_flag=?,deal_result=?,updated_utc_datetime=?" + |
| | | " where type=3 and UPPER(other_info) like concat('%',UPPER(?),'%')" |
| | | , new Object[]{1, count == lists.size() ? 1 : 0, new Date(), "\"table_name\":\"" + tableName + "\""}); |
| | | " where type=3 and config_uuid in (select uuid from product_sys_data_sync_mes_sub where UPPER(table_name)=UPPER(?)) and (result=0 or deal_result=0)" |
| | | , new Object[]{1, count == lists.size() ? 1 : 0, new Date(), tableName}); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | String lockKey = null; |
| | | Dao sourceDao = null; |
| | | try { |
| | | try { |
| | | String tableName = jsonObject.getString(CmnConst.TABLE_NAME); |
| | | String[] uniqueSignFieldName = (StringUtils.isEmpty(jsonObject.getString(CmnConst.UNIQUE_NAME)) ? "" : jsonObject.getString(CmnConst.UNIQUE_NAME)).split(","); |
| | | if (ArrayUtil.isEmpty(uniqueSignFieldName)) { |
| | |
| | | throw new BaseException(ErrorCode.SYNC_GET_CONFIG_FAIL); |
| | | } |
| | | lockKey = jsonObject.getString(CmnConst.TABLE_NAME); |
| | | if (!customLock.tryLock(lockKey)) { |
| | | if (!customLock.tryLock(lockKey, 120)) { |
| | | syncDataLogEntity.setOtherInfo("该表数据同步已有任务在执行,跳过本次执行!"); |
| | | journalEntities.add(getLogRecord(syncDataLogEntity, null, tableName, |
| | | null, null, null, 0L)); |
| | |
| | | } |
| | | |
| | | } |
| | | } finally { |
| | | if (lockStatus && !StringUtils.isEmpty(lockKey)) { |
| | | customLock.unLock(lockKey); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static String[] getUniqueValue(String value) { |