T100738
2024-04-16 eeb86aaf2f73a02600195ce2637dde6caf858a88
product-server-data-center/src/main/java/com/product/data/center/service/DataSyncService.java
@@ -132,8 +132,8 @@
            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();
@@ -157,6 +157,7 @@
        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)) {
@@ -172,7 +173,7 @@
                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));
@@ -466,6 +467,11 @@
            }
        }
      } finally {
         if (lockStatus && !StringUtils.isEmpty(lockKey)) {
            customLock.unLock(lockKey);
         }
      }
    }
    private static String[] getUniqueValue(String value) {