Commit 0020d583 authored by ='s avatar =

hungtt-commit get data combobox field

parent 43c9a614
......@@ -91,6 +91,8 @@ public interface CampaignCustomerRepository extends JpaRepository<CampaignCustom
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)
List<Short> getStatus();
}
......@@ -1653,12 +1653,14 @@ public class CustomerServiceImpl implements CustomerService {
List<Short> lstStatus = campaignCustomerRepository.getStatus();
try {
for (String cusId : lstCusId) {
CampaignCustomer entity = campaignCustomerRepository.findCampaignCustomerByCampaignIdAndCompanySiteIdAndCustomerId(campaignId, companySiteId, Long.parseLong(cusId));
if (entity.getStatus() == 0) {
campaignCustomerRepository.delete(entity);
} else if (lstStatus.contains(entity.getStatus())) {
entity.setInCampaignStatus((short) 0);
campaignCustomerRepository.save(entity);
List<CampaignCustomer> listEntity = campaignCustomerRepository.findCampaignCustomersByCampaignIdAndCompanySiteIdAndCustomerIdAndInCampaignStatus(campaignId, companySiteId, Long.parseLong(cusId), 1L);
for (CampaignCustomer entity : listEntity) {
if (entity.getStatus() == 0) {
campaignCustomerRepository.delete(entity);
} else if (lstStatus.contains(entity.getStatus())) {
entity.setInCampaignStatus((short) 0);
campaignCustomerRepository.save(entity);
}
}
}
resultDTO.setErrorCode(Constants.ApiErrorCode.SUCCESS);
......
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