Commit 56ae38e7 authored by ='s avatar =

hungtt-commit fix bug luu che do quay so cuoc goi

parent ed8fc845
......@@ -20,4 +20,6 @@ public interface TimeRangeDialModeRepository extends JpaRepository<TimeRangeDial
@Query(value = "SELECT * FROM TIME_RANGE_DIAL_MODE r " +
"WHERE r.CAMPAIGN_ID = :campaignId AND r.COMPANY_SITE_ID = :companySiteId AND TO_CHAR(r.START_TIME,'HH24:MI:SS') <= TO_CHAR(SYSDATE,'HH24:MI:SS')", nativeQuery = true)
TimeRangeDialMode findDialModeAtCurrent(@Param("campaignId") Long campaignId, @Param("companySiteId") Long companySiteId);
void deleteAllByCampaignIdAndCompanySiteId(Long campaignId, Long companySiteId);
}
......@@ -20,4 +20,6 @@ public interface TimeZoneDialModeRepository extends JpaRepository<TimeZoneDialMo
@Query(value = "SELECT * FROM TIME_ZONE_DIAL_MODE z " +
"WHERE z.CAMPAIGN_ID = :campaignId AND z.COMPANY_SITE_ID = :companySiteId AND concat(z.HOUR, ':', z.MINUTE) <= TO_CHAR(SYSDATE,'HH24:MI')", nativeQuery = true)
TimeZoneDialMode findDialModeAtCurrent(@Param("campaignId") Long campaignId, @Param("companySiteId") Long companySiteId);
void deleteAllByCampaignIdAndCompanySiteId(Long campaignId, Long companySiteId);
}
......@@ -405,6 +405,8 @@ public class CampaignServiceImpl implements CampaignService {
// Save campaign to database
campaignRepository.save(campaignEntity);
// Save time dial
timeRangeDialModeRepository.deleteAllByCampaignIdAndCompanySiteId(dto.getCampaignId(), dto.getCompanySiteId());
timeZoneDialModeRepository.deleteAllByCampaignIdAndCompanySiteId(dto.getCampaignId(), dto.getCompanySiteId());
for (TimeRangeDialModeDTO timeRangeDto : lstTimeRange) {
timeRangeDto.setCampaignId(dto.getCampaignId());
TimeRangeDialMode timeRangeEntity = modelMapper.map(timeRangeDto, TimeRangeDialMode.class);
......
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