Commit 0020d583 authored by ='s avatar =

hungtt-commit get data combobox field

parent 43c9a614
...@@ -91,6 +91,8 @@ public interface CampaignCustomerRepository extends JpaRepository<CampaignCustom ...@@ -91,6 +91,8 @@ public interface CampaignCustomerRepository extends JpaRepository<CampaignCustom
CampaignCustomer findCampaignCustomerByCampaignIdAndCompanySiteIdAndCustomerId(Long campaignId, Long companySiteId, Long customerId); CampaignCustomer findCampaignCustomerByCampaignIdAndCompanySiteIdAndCustomerId(Long campaignId, Long companySiteId, Long customerId);
List<CampaignCustomer> findCampaignCustomersByCampaignIdAndCompanySiteIdAndCustomerIdAndInCampaignStatus(Long campaignId, Long companySiteId, Long customerId, Long inCampaingStatus);
@Query(value = "select complete_value from campaign_complete_code where status = 1 and is_finish = 0 and is_recall = 0", nativeQuery = true) @Query(value = "select complete_value from campaign_complete_code where status = 1 and is_finish = 0 and is_recall = 0", nativeQuery = true)
List<Short> getStatus(); List<Short> getStatus();
} }
...@@ -1653,7 +1653,8 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1653,7 +1653,8 @@ public class CustomerServiceImpl implements CustomerService {
List<Short> lstStatus = campaignCustomerRepository.getStatus(); List<Short> lstStatus = campaignCustomerRepository.getStatus();
try { try {
for (String cusId : lstCusId) { for (String cusId : lstCusId) {
CampaignCustomer entity = campaignCustomerRepository.findCampaignCustomerByCampaignIdAndCompanySiteIdAndCustomerId(campaignId, companySiteId, Long.parseLong(cusId)); List<CampaignCustomer> listEntity = campaignCustomerRepository.findCampaignCustomersByCampaignIdAndCompanySiteIdAndCustomerIdAndInCampaignStatus(campaignId, companySiteId, Long.parseLong(cusId), 1L);
for (CampaignCustomer entity : listEntity) {
if (entity.getStatus() == 0) { if (entity.getStatus() == 0) {
campaignCustomerRepository.delete(entity); campaignCustomerRepository.delete(entity);
} else if (lstStatus.contains(entity.getStatus())) { } else if (lstStatus.contains(entity.getStatus())) {
...@@ -1661,6 +1662,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1661,6 +1662,7 @@ public class CustomerServiceImpl implements CustomerService {
campaignCustomerRepository.save(entity); campaignCustomerRepository.save(entity);
} }
} }
}
resultDTO.setErrorCode(Constants.ApiErrorCode.SUCCESS); resultDTO.setErrorCode(Constants.ApiErrorCode.SUCCESS);
resultDTO.setDescription(Constants.ApiErrorDesc.SUCCESS); resultDTO.setDescription(Constants.ApiErrorDesc.SUCCESS);
} catch (Exception e) { } catch (Exception e) {
......
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