@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<ContactInfo> getNewContactInfo(
      Long userId, ContactInfo oldContactInfo) {

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

    boolean contactInfoChanged =
        supplierChangedInfoRedisDao.tabInfoChanged(userId, ChangedInfoKeys.contactInfoTab());
    if (!contactInfoChanged) {
      supplierUpdatedInfoDto.setSupplierInfo(oldContactInfo);
      supplierUpdatedInfoDto.setOldValues(oldValues);
      return supplierUpdatedInfoDto;
    }

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

    ContactInfo newContactInfo = new ContactInfo();
    BeanMapper.copy(oldContactInfo, newContactInfo);

    if (changedInfo.containsKey(ChangedInfoKeys.contactInfoName())) {
      newContactInfo.setName(changedInfo.get(ChangedInfoKeys.contactInfoName()));
      oldValues.put(ChangedInfoKeys.contactInfoName(), oldContactInfo.getName());
    }

    if (changedInfo.containsKey(ChangedInfoKeys.contactInfoEmail())) {
      newContactInfo.setEmail(changedInfo.get(ChangedInfoKeys.contactInfoEmail()));
      oldValues.put(ChangedInfoKeys.contactInfoEmail(), oldContactInfo.getEmail());
    }

    if (changedInfo.containsKey(ChangedInfoKeys.contactInfoMobile())) {
      newContactInfo.setMobile(changedInfo.get(ChangedInfoKeys.contactInfoMobile()));
      oldValues.put(ChangedInfoKeys.contactInfoMobile(), oldContactInfo.getMobile());
    }

    if (changedInfo.containsKey(ChangedInfoKeys.contactInfoPhone())) {
      newContactInfo.setOfficePhone(changedInfo.get(ChangedInfoKeys.contactInfoPhone()));
      oldValues.put(ChangedInfoKeys.contactInfoPhone(), oldContactInfo.getOfficePhone());
    }

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