Commit 82799e42 authored by Tu Bach's avatar Tu Bach

tubn campaign execute update

parent 6070a547
......@@ -3,6 +3,7 @@ package com.viettel.campaign.repository.ccms_full;
import com.viettel.campaign.config.DataSourceQualify;
import com.viettel.campaign.model.ccms_full.AgentStatusStat;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
......@@ -12,6 +13,7 @@ import java.util.List;
@Transactional(DataSourceQualify.CCMS_FULL)
public interface AgentStatusStatRepository extends JpaRepository<AgentStatusStat, Long> {
AgentStatusStat findByKzUserIdAndCurrentStatusNotIn(String kzUserId, List<String> currentStatus);
@Query(value = "FROM AgentStatusStat WHERE kzUserId = :kzUserId ORDER BY timestamp DESC")
List<AgentStatusStat> getStatusByKzUserId(String kzUserId);
}
......@@ -312,7 +312,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
try {
String dialMode = getDialModeAtCurrent(Long.parseLong(requestDto.getCompanySiteId()), Long.parseLong(requestDto.getCampaignId()));
VSAUsers vsa = vsaUsersRepository.findByUserId(Long.parseLong(requestDto.getAgentId()));
AgentStatusStat ass = agentStatusStatRepository.findByKzUserIdAndCurrentStatusNotIn(vsa.getUserKazooId(), Arrays.asList("logged_out", "campaign"));
List<AgentStatusStat> ass = agentStatusStatRepository.getStatusByKzUserId(vsa.getUserKazooId());
if (ass != null) {
result.setErrorCode("02");
result.setDescription("campaign-agents-err-callout");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment