@Override
  public Response<SupplierInfoChanged> checkSupplierInfoChanged(Long userId) {
    Response<SupplierInfoChanged> result = new Response<SupplierInfoChanged>();
    if (userId == null) {
      log.error("use id can not be null");
      result.setError("user.id.not.null.fail");
      return result;
    }

    try {

      SupplierInfoChanged supplierInfoChanged = new SupplierInfoChanged();
      supplierInfoChanged.setCompanyChanged(
          supplierChangedInfoRedisDao.tabInfoChanged(userId, ChangedInfoKeys.companyTab()));
      supplierInfoChanged.setPaperworkChanged(
          supplierChangedInfoRedisDao.tabInfoChanged(userId, ChangedInfoKeys.paperworkTab()));
      supplierInfoChanged.setContactInfoChanged(
          supplierChangedInfoRedisDao.tabInfoChanged(userId, ChangedInfoKeys.contactInfoTab()));
      supplierInfoChanged.setFinanceChanged(
          supplierChangedInfoRedisDao.tabInfoChanged(userId, ChangedInfoKeys.financeTab()));
      supplierInfoChanged.setQualityChanged(
          supplierChangedInfoRedisDao.tabInfoChanged(userId, ChangedInfoKeys.qualityTab()));

      result.setResult(supplierInfoChanged);
    } catch (Exception e) {
      log.error(
          "fail to check supplier info changed where userId={},cause:{}",
          userId,
          Throwables.getStackTraceAsString(e));
      result.setError("check.supplier.info.changed.fail");
    }

    return result;
  }
  @Override
  public SupplierUpdatedInfoDto<CompanyExtraQuality> getNewCompanyExtraQuality(
      Long userId, CompanyExtraQuality oldCompanyExtraQuality) {

    SupplierUpdatedInfoDto<CompanyExtraQuality> supplierUpdatedInfoDto =
        new SupplierUpdatedInfoDto<CompanyExtraQuality>();
    Map<String, Object> oldValues = Maps.newHashMap();

    boolean qualityChanged =
        supplierChangedInfoRedisDao.tabInfoChanged(userId, ChangedInfoKeys.qualityTab());
    if (!qualityChanged) {
      supplierUpdatedInfoDto.setSupplierInfo(oldCompanyExtraQuality);
      supplierUpdatedInfoDto.setOldValues(oldValues);
      return supplierUpdatedInfoDto;
    }

    Map<String, String> changedInfo = supplierChangedInfoRedisDao.getChangedInfos(userId);

    CompanyExtraQuality newCompanyExtraQuality = new CompanyExtraQuality();
    BeanMapper.copy(oldCompanyExtraQuality, newCompanyExtraQuality);

    if (changedInfo.containsKey(ChangedInfoKeys.qualityRohsId())) {
      newCompanyExtraQuality.setRohsId(changedInfo.get(ChangedInfoKeys.qualityRohsId()));
      oldValues.put(ChangedInfoKeys.qualityRohsId(), oldCompanyExtraQuality.getRohsId());
    }
    if (changedInfo.containsKey(ChangedInfoKeys.qualityRohsAttachUrl())) {
      newCompanyExtraQuality.setRohsAttachUrl(
          changedInfo.get(ChangedInfoKeys.qualityRohsAttachUrl()));
      oldValues.put(
          ChangedInfoKeys.qualityRohsAttachUrl(), oldCompanyExtraQuality.getRohsAttachUrl());
    }
    if (changedInfo.containsKey(ChangedInfoKeys.qualityRohsValidDate())) {
      String rohsValidDate = changedInfo.get(ChangedInfoKeys.qualityRohsValidDate());
      newCompanyExtraQuality.setRohsValidDate(DateTime.parse(rohsValidDate, FORMATTER).toDate());
      oldValues.put(
          ChangedInfoKeys.qualityRohsValidDate(), oldCompanyExtraQuality.getRohsValidDate());
    }

    if (changedInfo.containsKey(ChangedInfoKeys.qualityISO9001Id())) {
      newCompanyExtraQuality.setIso9001Id(changedInfo.get(ChangedInfoKeys.qualityISO9001Id()));
      oldValues.put(ChangedInfoKeys.qualityISO9001Id(), oldCompanyExtraQuality.getIso9001Id());
    }
    if (changedInfo.containsKey(ChangedInfoKeys.qualityISO9001AttachUrl())) {
      newCompanyExtraQuality.setIso9001AttachUrl(
          changedInfo.get(ChangedInfoKeys.qualityISO9001AttachUrl()));
      oldValues.put(
          ChangedInfoKeys.qualityISO9001AttachUrl(), oldCompanyExtraQuality.getIso9001AttachUrl());
    }
    if (changedInfo.containsKey(ChangedInfoKeys.qualityISO9001ValidDate())) {
      String iso900ValidDate = changedInfo.get(ChangedInfoKeys.qualityISO9001ValidDate());
      newCompanyExtraQuality.setIso9001ValidDate(
          DateTime.parse(iso900ValidDate, FORMATTER).toDate());
      oldValues.put(
          ChangedInfoKeys.qualityISO9001ValidDate(), oldCompanyExtraQuality.getIso9001ValidDate());
    }

    if (changedInfo.containsKey(ChangedInfoKeys.qualityISO14001Id())) {
      newCompanyExtraQuality.setIso14001Id(changedInfo.get(ChangedInfoKeys.qualityISO14001Id()));
      oldValues.put(ChangedInfoKeys.qualityISO14001Id(), oldCompanyExtraQuality.getIso14001Id());
    }
    if (changedInfo.containsKey(ChangedInfoKeys.qualityISO14001AttachUrl())) {
      newCompanyExtraQuality.setIso14001AttachUrl(
          changedInfo.get(ChangedInfoKeys.qualityISO14001AttachUrl()));
      oldValues.put(
          ChangedInfoKeys.qualityISO14001AttachUrl(),
          oldCompanyExtraQuality.getIso14001AttachUrl());
    }
    if (changedInfo.containsKey(ChangedInfoKeys.qualityISO14001ValidDate())) {
      String iso1400ValidDate = changedInfo.get(ChangedInfoKeys.qualityISO14001ValidDate());
      newCompanyExtraQuality.setIso14001ValidDate(
          DateTime.parse(iso1400ValidDate, FORMATTER).toDate());
      oldValues.put(
          ChangedInfoKeys.qualityISO14001ValidDate(),
          oldCompanyExtraQuality.getIso14001ValidDate());
    }

    if (changedInfo.containsKey(ChangedInfoKeys.qualityTS16949Id())) {
      newCompanyExtraQuality.setTs16949Id(changedInfo.get(ChangedInfoKeys.qualityTS16949Id()));
      oldValues.put(ChangedInfoKeys.qualityTS16949Id(), oldCompanyExtraQuality.getTs16949Id());
    }
    if (changedInfo.containsKey(ChangedInfoKeys.qualityTS16949AttachUrl())) {
      newCompanyExtraQuality.setTs16949AttachUrl(
          changedInfo.get(ChangedInfoKeys.qualityTS16949AttachUrl()));
      oldValues.put(
          ChangedInfoKeys.qualityTS16949AttachUrl(), oldCompanyExtraQuality.getTs16949AttachUrl());
    }
    if (changedInfo.containsKey(ChangedInfoKeys.qualityTS16949ValidDate())) {
      String ts16949ValidDate = changedInfo.get(ChangedInfoKeys.qualityTS16949ValidDate());
      newCompanyExtraQuality.setTs16949ValidDate(
          DateTime.parse(ts16949ValidDate, FORMATTER).toDate());
      oldValues.put(
          ChangedInfoKeys.qualityTS16949ValidDate(), oldCompanyExtraQuality.getTs16949ValidDate());
    }

    supplierUpdatedInfoDto.setSupplierInfo(newCompanyExtraQuality);
    supplierUpdatedInfoDto.setOldValues(oldValues);
    return supplierUpdatedInfoDto;
  }