All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arextest.schedule.service.ReplayRunDetailsService Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
package com.arextest.schedule.service;

import com.arextest.schedule.dao.mongodb.ReplayActionCaseItemRepository;
import com.arextest.schedule.mdc.MDCTracer;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class ReplayRunDetailsService {
  @Resource
  private ReplayActionCaseItemRepository repository;

  /**
   * update case status
   * @param recordId
   * @param caseStatus
   * @return
   */
  public long updateCaseStatus(String recordId, Integer caseStatus) {
    if (StringUtils.isEmpty(recordId) || caseStatus == null) {
      return 0L;
    }

    MDCTracer.addRecordId(recordId);
    try {
      long count = repository.updateCaseStatus(recordId, caseStatus);
      LOGGER.info("updateCaseStatus recordId:{} caseStatus:{} count:{}", recordId, caseStatus, count);
      return count;
    } catch (Exception e) {
      LOGGER.error("updateCaseStatus error", e);
      return 0L;
    } finally {
      MDCTracer.clear();
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy