Commit 2f4944a3 authored by Tu Bach's avatar Tu Bach

Merge branch 'master' into tubn

# Conflicts:
#	src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
parents bc6c4f74 ba5f20e1
...@@ -11,23 +11,16 @@ import java.util.List; ...@@ -11,23 +11,16 @@ import java.util.List;
public interface CustomerListMappingRepository extends JpaRepository<CustomerListMapping, Long> { public interface CustomerListMappingRepository extends JpaRepository<CustomerListMapping, Long> {
// ----------- customer ------------ // // ----------- customer ------------ //
@Query("select c from CustomerListMapping c where c.customerId in (:p_ids) and c.customerListId =:p_customer_list_id and c.companySiteId=:p_company_site_id") @Query("select c from CustomerListMapping c where c.customerId in (:p_ids) and c.customerListId =:p_customer_list_id and c.companySiteId=:p_company_site_id")
List<CustomerListMapping> findAllCustomerListMapping(@Param("p_ids") List<Long> p_ids, @Param("p_customer_list_id") Long p_customer_list_id, @Param("p_company_site_id") Long p_company_site_id); List<CustomerListMapping> findAllCustomerListMapping(@Param("p_ids") List<Long> p_ids, @Param("p_customer_list_id") Long p_customer_list_id, @Param("p_company_site_id") Long p_company_site_id);
@Modifying
@Query("delete from CustomerListMapping c where c.customerId=:p_customer_id and c.customerListId=:p_customer_list_id and c.companySiteId=:p_company_site_id")
int deleteMappingByCustomerId(@Param("p_customer_id") Long p_customer_id, @Param("p_customer_list_id") Long p_customer_list_id, @Param("p_company_site_id") Long p_company_site_id);
@Modifying @Modifying
@Query("delete from CustomerListMapping c where c.customerId in (:p_ids) and c.customerListId =:p_customer_list_id and c.companySiteId=:p_company_site_id") @Query("delete from CustomerListMapping c where c.customerId in (:p_ids) and c.customerListId =:p_customer_list_id and c.companySiteId=:p_company_site_id")
int deleteMappingByCustomerIds(@Param("p_ids") List<Long> p_ids, @Param("p_customer_list_id") Long p_customer_list_id, @Param("p_company_site_id") Long p_company_site_id); int deleteMappingByCustomerIds(@Param("p_ids") List<Long> p_ids, @Param("p_customer_list_id") Long p_customer_list_id, @Param("p_company_site_id") Long p_company_site_id);
// ----------- customer list --------------- // // ----------- customer list --------------- //
@Modifying
@Query("delete from CustomerListMapping c where c.customerListId=:p_customer_list_id and c.companySiteId=:p_company_site_id")
int deleteMappingByCustomerListId(@Param("p_customer_list_id") Long p_customer_list_id, @Param("p_company_site_id") Long p_company_site_id);
@Modifying @Modifying
@Query("delete from CustomerListMapping c where c.customerListId in (:p_ids) and c.companySiteId=:p_company_site_id") @Query("delete from CustomerListMapping c where c.customerListId in (:p_ids) and c.companySiteId=:p_company_site_id")
int deleteMappingByCustomerListIds(@Param("p_ids") List<Long> p_ids, @Param("p_company_site_id") Long p_company_site_id); int deleteMappingByCustomerListIds(@Param("p_ids") List<Long> p_ids, @Param("p_company_site_id") Long p_company_site_id);
......
...@@ -8,7 +8,7 @@ import org.springframework.data.repository.query.Param; ...@@ -8,7 +8,7 @@ import org.springframework.data.repository.query.Param;
import java.util.List; import java.util.List;
public interface CustomerListRepository extends JpaRepository<CustomerList, Long> { public interface CustomerListRepository extends JpaRepository<CustomerList, Long>, CustomerListRepositoryCustom {
CustomerList findByCustomerListIdAndCompanySiteId(long customerListId, long companySiteId); CustomerList findByCustomerListIdAndCompanySiteId(long customerListId, long companySiteId);
...@@ -17,14 +17,7 @@ public interface CustomerListRepository extends JpaRepository<CustomerList, Long ...@@ -17,14 +17,7 @@ public interface CustomerListRepository extends JpaRepository<CustomerList, Long
@Query("select c from CustomerList c where c.customerListId in (:p_ids) and c.companySiteId=:p_company_site_id and c.status = 1") @Query("select c from CustomerList c where c.customerListId in (:p_ids) and c.companySiteId=:p_company_site_id and c.status = 1")
List<CustomerList> findAllCustomerList(@Param("p_ids") List<Long> p_ids, @Param("p_company_site_id") Long p_company_site_id); List<CustomerList> findAllCustomerList(@Param("p_ids") List<Long> p_ids, @Param("p_company_site_id") Long p_company_site_id);
@Modifying
@Query("update CustomerList c set c.status = 0 where c.customerListId=:p_customer_list_id and c.companySiteId=:p_company_site_id")
int deleteCustomerList(@Param("p_customer_list_id") Long p_customer_list_id, @Param("p_company_site_id") Long p_company_site_id);
@Modifying @Modifying
@Query("update CustomerList c set c.status = 0 where c.customerListId in (:p_ids) and c.companySiteId=:p_company_site_id") @Query("update CustomerList c set c.status = 0 where c.customerListId in (:p_ids) and c.companySiteId=:p_company_site_id")
int deleteCustomerListIds(@Param("p_ids") List<Long> p_ids, @Param("p_company_site_id") Long p_company_site_id); int deleteCustomerListIds(@Param("p_ids") List<Long> p_ids, @Param("p_company_site_id") Long p_company_site_id);
@Query(value = "SELECT * FROM (SELECT c.*, MAX(c.CREATE_AT) OVER() AS LATEST_CREATED FROM CUSTOMER_LIST c) WHERE CREATE_AT = LATEST_CREATED AND COMPANY_SITE_ID =:p_company_site_id", nativeQuery = true)
CustomerList latestCreated(@Param("p_company_site_id") Long p_company_site_id);
} }
package com.viettel.campaign.repository.ccms_full;
import com.viettel.campaign.web.dto.CustomerListDTO;
import com.viettel.campaign.web.dto.request_dto.SearchCustomerListRequestDTO;
import org.springframework.data.domain.Pageable;
import java.util.List;
public interface CustomerListRepositoryCustom {
List<CustomerListDTO> getAllCustomerListByParams(SearchCustomerListRequestDTO searchCustomerListRequestDTO, Pageable pageable);
}
...@@ -15,7 +15,7 @@ import java.util.Date; ...@@ -15,7 +15,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
@Repository @Repository
public interface CustomerRepository extends JpaRepository<Customer, Long> { public interface CustomerRepository extends JpaRepository<Customer, Long>, CustomerRepositoryCustom {
Page<Customer> findAll(Pageable pageable); Page<Customer> findAll(Pageable pageable);
......
package com.viettel.campaign.repository.ccms_full;
import com.viettel.campaign.web.dto.*;
import com.viettel.campaign.web.dto.request_dto.CustomerDetailRequestDTO;
import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO;
import com.viettel.econtact.filter.UserSession;
import org.springframework.data.domain.Pageable;
import java.util.List;
public interface CustomerRepositoryCustom {
List<CustomerDetailRequestDTO> getCustomerDetailById(Long companySiteId, Long customerListId, Long customerId);
List<CustomerCustomDTO> getAllCustomerByParams(SearchCustomerRequestDTO searchCustomerRequestDTO, Pageable pageable);
List<CampaignInformationDTO> getCampaignInformation(CampaignCustomerDTO campaignCustomerDTO);
List<CustomerDTO> getIndividualCustomerInfo(CampaignCustomerDTO campaignCustomerDTO);
List<CustomerListDTO> getCustomerListInfo(CampaignCustomerDTO campaignCustomerDTO);
List<CustomerDTO> getCustomizeFields(CampaignCustomerDTO campaignCustomerDTO, UserSession userSession, Pageable pageable);
}
...@@ -195,8 +195,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -195,8 +195,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
query.setParameter("p_customer_id", "%" + query.setParameter("p_customer_id", "%" +
dto.getCustomerId().toUpperCase() dto.getCustomerId().toUpperCase()
.replace("\\", "\\\\") .replace("\\", "\\\\")
.replaceAll("%", "\\\\%") .replaceAll("%", "\\%")
.replaceAll("_", "\\\\_") .replaceAll("_", "\\_")
+ "%"); + "%");
} }
...@@ -229,8 +229,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -229,8 +229,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
query.setParameter("p_phone_number", "%" + query.setParameter("p_phone_number", "%" +
dto.getPhoneNumber().toUpperCase() dto.getPhoneNumber().toUpperCase()
.replace("\\", "\\\\") .replace("\\", "\\\\")
.replaceAll("%", "\\\\%") .replaceAll("%", "\\%")
.replaceAll("_", "\\\\_") .replaceAll("_", "\\_")
+ "%"); + "%");
} }
...@@ -238,8 +238,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -238,8 +238,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
query.setParameter("p_campaign_name", "%" + query.setParameter("p_campaign_name", "%" +
dto.getCampaignName().toUpperCase() dto.getCampaignName().toUpperCase()
.replace("\\", "\\\\") .replace("\\", "\\\\")
.replaceAll("%", "\\\\%") .replaceAll("%", "\\%")
.replaceAll("_", "\\\\_") .replaceAll("_", "\\_")
+ "%"); + "%");
} }
...@@ -247,8 +247,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -247,8 +247,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
query.setParameter("p_user_name", "%" + query.setParameter("p_user_name", "%" +
dto.getAgentId().toUpperCase() dto.getAgentId().toUpperCase()
.replace("\\", "\\\\") .replace("\\", "\\\\")
.replaceAll("%", "\\\\%") .replaceAll("%", "\\%")
.replaceAll("_", "\\\\_") .replaceAll("_", "\\_")
+ "%"); + "%");
} }
...@@ -526,8 +526,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -526,8 +526,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
query.setParameter("pCampaignName", "%" + query.setParameter("pCampaignName", "%" +
campaignRequestDto.getCampaignName().toUpperCase() campaignRequestDto.getCampaignName().toUpperCase()
.replace("\\", "\\\\") .replace("\\", "\\\\")
.replaceAll("%", "\\\\%") .replaceAll("%", "\\%")
.replaceAll("_", "\\\\_") .replaceAll("_", "\\_")
+ "%"); + "%");
} }
......
package com.viettel.campaign.repository.ccms_full.impl;
import com.viettel.campaign.repository.ccms_full.CustomerListRepositoryCustom;
import com.viettel.campaign.utils.*;
import com.viettel.campaign.web.dto.CustomerListDTO;
import com.viettel.campaign.web.dto.request_dto.SearchCustomerListRequestDTO;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.transform.Transformers;
import org.hibernate.type.DateType;
import org.hibernate.type.LongType;
import org.hibernate.type.ShortType;
import org.hibernate.type.StringType;
import org.springframework.data.domain.*;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.List;
import java.util.TimeZone;
@Repository
public class CustomerListRepositoryImpl implements CustomerListRepositoryCustom {
@Override
public List<CustomerListDTO> getAllCustomerListByParams(SearchCustomerListRequestDTO searchCustomerListRequestDTO, Pageable pageable) {
TimeZone tzClient = TimeZoneUtils.getZoneMinutes(searchCustomerListRequestDTO.getTimezoneOffset());
List<CustomerListDTO> listData = new ArrayList<>();
SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
Session session = null;
try {
session = sessionFactory.openSession();
session.beginTransaction();
StringBuilder sb = new StringBuilder();
sb.append("SELECT");
sb.append(" a.CUSTOMER_LIST_ID customerListId,");
sb.append(" a.COMPANY_SITE_ID companySiteId,");
sb.append(" a.CUSTOMER_LIST_CODE customerListCode,");
sb.append(" a.CUSTOMER_LIST_NAME customerListName,");
sb.append(" a.STATUS status,");
sb.append(" a.CREATE_BY createBy,");
sb.append(" a.CREATE_AT createAt,");
sb.append(" a.UPDATE_BY updateBy,");
sb.append(" a.UPDATE_AT updateAt,");
sb.append(" a.SOURCE source,");
sb.append(" a.DEPT_CREATE deptCreate,");
sb.append(" b.count count");
sb.append(" FROM CUSTOMER_LIST a");
sb.append(" LEFT JOIN (SELECT COUNT(CAMPAIGN_ID) as count, CUSTOMER_LIST_ID");
sb.append(" FROM CAMPAIGN_CUSTOMERLIST");
sb.append(" GROUP BY CUSTOMER_LIST_ID) b");
sb.append(" ON a.CUSTOMER_LIST_ID = b.CUSTOMER_LIST_ID");
sb.append(" WHERE 1 = 1");
sb.append(" AND a.STATUS = 1");
sb.append(" AND a.COMPANY_SITE_ID = :p_company_site_id");
sb.append(" AND to_date(CREATE_AT, 'DD/MM/RR') >= to_date(:p_date_from, 'DD/MM/YYYY HH24:MI:SS') AND to_date(CREATE_AT, 'DD/MM/RR') <= to_date(:p_date_to, 'DD/MM/YYYY HH24:MI:SS')");
if (!DataUtil.isNullOrEmpty(searchCustomerListRequestDTO.getCustomerListCode())) {
sb.append(" AND UPPER(CUSTOMER_LIST_CODE) LIKE UPPER(:p_list_code)");
}
if (!DataUtil.isNullOrEmpty(searchCustomerListRequestDTO.getCustomerListName())) {
sb.append(" AND UPPER(CUSTOMER_LIST_NAME) LIKE UPPER(:p_list_name)");
}
sb.append(" ORDER BY CREATE_AT DESC");
SQLQuery query = session.createSQLQuery(sb.toString());
query.setParameter("p_company_site_id", searchCustomerListRequestDTO.getCompanySiteId());
query.setParameter("p_date_from", TimeZoneUtils.toDateStringWithTimeZone(DateTimeUtil.parseDate("YYYYMMdd", searchCustomerListRequestDTO.getConvertedDateFrom()), tzClient));
query.setParameter("p_date_to", TimeZoneUtils.toDateStringWithTimeZone(DateTimeUtil.parseDate("YYYYMMdd", searchCustomerListRequestDTO.getConvertedDateTo()), tzClient));
if (!DataUtil.isNullOrEmpty(searchCustomerListRequestDTO.getCustomerListCode())) {
query.setParameter("p_list_code", "%" +
searchCustomerListRequestDTO.getCustomerListCode().trim()
.replace("\\", "\\\\")
.replaceAll("%", "\\%")
.replaceAll("_", "\\_")
+ "%");
}
if (!DataUtil.isNullOrEmpty(searchCustomerListRequestDTO.getCustomerListName())) {
query.setParameter("p_list_name", "%" +
searchCustomerListRequestDTO.getCustomerListName().trim()
.replace("\\", "\\\\")
.replaceAll("%", "\\%")
.replaceAll("_", "\\_")
+ "%");
}
query.addScalar("customerListId", new LongType());
query.addScalar("companySiteId", new LongType());
query.addScalar("customerListCode", new StringType());
query.addScalar("customerListName", new StringType());
query.addScalar("status", new ShortType());
query.addScalar("createBy", new StringType());
query.addScalar("createAt", new DateType());
query.addScalar("updateBy", new StringType());
query.addScalar("updateAt", new DateType());
query.addScalar("source", new StringType());
query.addScalar("deptCreate", new StringType());
query.addScalar("count", new StringType());
query.setResultTransformer(Transformers.aliasToBean(CustomerListDTO.class));
if (pageable != null) {
query.setFirstResult(pageable.getPageNumber() * pageable.getPageSize());
query.setMaxResults(pageable.getPageSize());
}
listData = query.list();
listData.forEach(item -> {
item.setCreateAt(DateTimeUtil.parseDate("dd/MM/yyyy HH:mm:ss",TimeZoneUtils.toDateStringWithTimeZone(item.getCreateAt(),tzClient)));
if (item.getUpdateAt() != null) {
item.setUpdateAt(DateTimeUtil.parseDate("dd/MM/yyyy HH:mm:ss",TimeZoneUtils.toDateStringWithTimeZone(item.getUpdateAt(),tzClient)));
}
});
} catch (Exception e) {
e.printStackTrace();
} finally {
if (session != null) session.close();
}
return listData;
}
}
...@@ -6,6 +6,7 @@ import com.viettel.campaign.model.ccms_full.CustomizeFieldObject; ...@@ -6,6 +6,7 @@ import com.viettel.campaign.model.ccms_full.CustomizeFieldObject;
import com.viettel.campaign.model.ccms_full.CustomizeFields; import com.viettel.campaign.model.ccms_full.CustomizeFields;
import com.viettel.campaign.web.dto.*; import com.viettel.campaign.web.dto.*;
import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO; import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO;
import com.viettel.campaign.web.dto.request_dto.SearchCustomerListRequestDTO;
import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO; import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO;
import com.viettel.econtact.filter.UserSession; import com.viettel.econtact.filter.UserSession;
...@@ -16,37 +17,27 @@ import java.util.Map; ...@@ -16,37 +17,27 @@ import java.util.Map;
public interface CustomerService { public interface CustomerService {
ResultDTO getAllCustomer(int page, int pageSize, String sort, long customerListId, long companySiteId);
ResultDTO getCustomerId(Long customerId); ResultDTO getCustomerId(Long customerId);
ResultDTO searchAllCustomer(int page, int pageSize, String sort, long customerListId, long companySiteId, String name, String mobileNumber, String email); ResultDTO searchAllCustomer(SearchCustomerRequestDTO searchCustomerRequestDTO);
ResultDTO createCustomer(CustomerDTO customerDTO); ResultDTO createCustomer(CustomerDTO customerDTO);
ResultDTO deleteCustomer(CustomerRequestDTO customerRequestDTO);
ResultDTO deleteIds(CustomerRequestDTO customerRequestDTO); ResultDTO deleteIds(CustomerRequestDTO customerRequestDTO);
ResultDTO getCustomerDetailById(Long companySiteId, Long customerListId, Long customerId); ResultDTO getCustomerDetailById(Long companySiteId, Long customerListId, Long customerId);
// ------------ customer list ------------ // // ------------ customer list ------------ //
ResultDTO getAllCustomerList(int page, int pageSize, String sort, Long companySiteId);
// THÍM NÀO MERGE CONFLICT THÌ GIỮ LẠI HỘ E CÁI METHOD NÀY VỚI // THÍM NÀO MERGE CONFLICT THÌ GIỮ LẠI HỘ E CÁI METHOD NÀY VỚI
// VIẾT ĐI VIẾT LẠI 4 LẦN RỒI ĐẤY // VIẾT ĐI VIẾT LẠI 4 LẦN RỒI ĐẤY
ResultDTO createCustomerList(CustomerListDTO customerListDTO, String userName); ResultDTO createCustomerList(CustomerListDTO customerListDTO, String userName);
ResultDTO updateCustomerList(CustomerListDTO customerListDTO, String userName); ResultDTO updateCustomerList(CustomerListDTO customerListDTO, String userName);
ResultDTO deleteCustomerList(CustomerListDTO customerListDTO);
ResultDTO deleteCustomerListIds(CustomerRequestDTO customerRequestDTO); ResultDTO deleteCustomerListIds(CustomerRequestDTO customerRequestDTO);
ResultDTO searchCustomerList(SearchCustomerRequestDTO searchCustomerRequestDTO); ResultDTO searchCustomerList(SearchCustomerListRequestDTO searchCustomerListRequestDTO);
CustomerList getLatestCreated(Long companySiteId);
// ------------ customer contact ------------ // // ------------ customer contact ------------ //
......
...@@ -28,7 +28,7 @@ public interface ScenarioService { ...@@ -28,7 +28,7 @@ public interface ScenarioService {
XSSFWorkbook buildTemplate() throws IOException; XSSFWorkbook buildTemplate() throws IOException;
Map<String, Object> readAndValidateCustomer(String path, Long scenarioId, Long campaignId, Long companySiteId) throws IOException; Map<String, Object> readAndValidateScenario(String path, Long scenarioId, Long campaignId, Long companySiteId) throws IOException;
List<ContactQuestResult> getContactQuestResult(Long companySiteId, Long campaignId, Long customerId); List<ContactQuestResult> getContactQuestResult(Long companySiteId, Long campaignId, Long customerId);
} }
...@@ -80,7 +80,6 @@ public class ScenarioQuestionServiceImpl implements ScenarioQuestionService { ...@@ -80,7 +80,6 @@ public class ScenarioQuestionServiceImpl implements ScenarioQuestionService {
if (scenarioQuestionDTO.getLstAnswers().size() > 0) { if (scenarioQuestionDTO.getLstAnswers().size() > 0) {
lstAnswers = scenarioQuestionDTO.getLstAnswers(); lstAnswers = scenarioQuestionDTO.getLstAnswers();
lstAnswers.forEach(item -> { lstAnswers.forEach(item -> {
item.setCode(scenarioQuestion.getCode() + "_" + item.getOrderIndex());
item.setScenarioQuestionId(scenarioQuestion.getScenarioQuestionId()); item.setScenarioQuestionId(scenarioQuestion.getScenarioQuestionId());
item.setCreateTime(new Date()); item.setCreateTime(new Date());
item.setStatus((short) 1); item.setStatus((short) 1);
......
...@@ -254,7 +254,7 @@ public class ScenarioServiceImpl implements ScenarioService { ...@@ -254,7 +254,7 @@ public class ScenarioServiceImpl implements ScenarioService {
@Override @Override
@Transactional(DataSourceQualify.CCMS_FULL) @Transactional(DataSourceQualify.CCMS_FULL)
public Map<String, Object> readAndValidateCustomer (String path, Long scenarioId, Long campaignId, Long companySiteId) throws IOException{ public Map<String, Object> readAndValidateScenario (String path, Long scenarioId, Long campaignId, Long companySiteId) throws IOException{
Locale locale = new Locale("vi", "VN"); Locale locale = new Locale("vi", "VN");
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
...@@ -551,6 +551,7 @@ public class ScenarioServiceImpl implements ScenarioService { ...@@ -551,6 +551,7 @@ public class ScenarioServiceImpl implements ScenarioService {
lstQuestions.forEach(q2 -> { lstQuestions.forEach(q2 -> {
List<ScenarioAnswerDTO> lstAnswers = q2.getLstAnswers(); List<ScenarioAnswerDTO> lstAnswers = q2.getLstAnswers();
lstAnswers.forEach(a2 -> { lstAnswers.forEach(a2 -> {
a2.setCode(q2.getCode() + "_" + a2.getOrderIndex());
ScenarioQuestionDTO mappingQuestion = lstQuestions.stream().filter(mq -> mq.getImportCode().equals(a2.getMappingQuestionCode())).findFirst().orElse(null); ScenarioQuestionDTO mappingQuestion = lstQuestions.stream().filter(mq -> mq.getImportCode().equals(a2.getMappingQuestionCode())).findFirst().orElse(null);
if (mappingQuestion != null) { if (mappingQuestion != null) {
a2.setMappingQuestionCode(mappingQuestion.getCode()); a2.setMappingQuestionCode(mappingQuestion.getCode());
......
...@@ -8,7 +8,6 @@ import java.util.List; ...@@ -8,7 +8,6 @@ import java.util.List;
@Getter @Getter
@Setter @Setter
public class CustomerRequestDTO { public class CustomerRequestDTO {
Long customerId;
Long customerListId; Long customerListId;
List<Long> ids; List<Long> ids;
Long companySiteId; Long companySiteId;
......
package com.viettel.campaign.web.dto.request_dto;
import com.viettel.campaign.web.dto.BaseDTO;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class SearchCustomerListRequestDTO extends BaseDTO {
String customerListCode;
String customerListName;
String convertedDateFrom;
String convertedDateTo;
String companySiteId;
Long timezoneOffset;
}
...@@ -7,10 +7,9 @@ import lombok.Setter; ...@@ -7,10 +7,9 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class SearchCustomerRequestDTO extends BaseDTO { public class SearchCustomerRequestDTO extends BaseDTO {
String customerListCode; Long companySiteId;
String customerListName; Long customerListId;
String convertedDateFrom; String name;
String convertedDateTo; String mobileNumber;
String companySiteId; String email;
Integer timezoneOffset;
} }
...@@ -24,7 +24,7 @@ import java.util.List; ...@@ -24,7 +24,7 @@ import java.util.List;
@RestController @RestController
@RequestMapping("/ipcc/campaign/execute") @RequestMapping("/ipcc/campaign/execute")
//@CrossOrigin @CrossOrigin(origins = "*")
public class CampaignExecuteController { public class CampaignExecuteController {
private static final Logger logger = LoggerFactory.getLogger(CampaignController.class); private static final Logger logger = LoggerFactory.getLogger(CampaignController.class);
......
...@@ -9,6 +9,7 @@ import com.viettel.campaign.utils.Config; ...@@ -9,6 +9,7 @@ import com.viettel.campaign.utils.Config;
import com.viettel.campaign.utils.RedisUtil; import com.viettel.campaign.utils.RedisUtil;
import com.viettel.campaign.web.dto.*; import com.viettel.campaign.web.dto.*;
import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO; import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO;
import com.viettel.campaign.web.dto.request_dto.SearchCustomerListRequestDTO;
import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO; import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO;
import com.viettel.econtact.filter.UserSession; import com.viettel.econtact.filter.UserSession;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
...@@ -44,13 +45,6 @@ public class CustomerController { ...@@ -44,13 +45,6 @@ public class CustomerController {
@Autowired(required = true) @Autowired(required = true)
CustomerService customerService; CustomerService customerService;
@GetMapping("/findAll")
@ResponseBody
public ResponseEntity findAllCustomer(@RequestParam("page") int page, @RequestParam("pageSize") int pageSize, @RequestParam("sort") String sort, @RequestParam("customerListId") long customerListId, @RequestParam("companySiteId") long companySiteId) {
ResultDTO result = customerService.getAllCustomer(page, pageSize, sort, customerListId, companySiteId);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@GetMapping("/findCustomerId") @GetMapping("/findCustomerId")
@ResponseBody @ResponseBody
public ResponseEntity<ResultDTO> findAllCustomerName(@RequestParam("customerId") Long customerId) { public ResponseEntity<ResultDTO> findAllCustomerName(@RequestParam("customerId") Long customerId) {
...@@ -58,10 +52,10 @@ public class CustomerController { ...@@ -58,10 +52,10 @@ public class CustomerController {
return new ResponseEntity(result, HttpStatus.OK); return new ResponseEntity(result, HttpStatus.OK);
} }
@GetMapping("/searchAllCustomerByParams") @PostMapping("/searchAllCustomerByParams")
@ResponseBody @ResponseBody
public ResponseEntity findAllCustomerByParams(@RequestParam("page") int page, @RequestParam("pageSize") int pageSize, @RequestParam("sort") String sort, @RequestParam("customerListId") Long customerListId, @RequestParam("companySiteId") Long companySiteId, @RequestParam("name") String name, @RequestParam("mobileNumber") String mobileNumber, @RequestParam("email") String email) { public ResponseEntity findAllCustomerByParams(@RequestBody SearchCustomerRequestDTO searchCustomerRequestDTO) {
ResultDTO result = customerService.searchAllCustomer(page, pageSize, sort, customerListId, companySiteId, name, mobileNumber, email); ResultDTO result = customerService.searchAllCustomer(searchCustomerRequestDTO);
return new ResponseEntity(result, HttpStatus.OK); return new ResponseEntity(result, HttpStatus.OK);
} }
...@@ -73,14 +67,6 @@ public class CustomerController { ...@@ -73,14 +67,6 @@ public class CustomerController {
return result; return result;
} }
@PostMapping("/delete")
@ResponseBody
public ResultDTO deleteCustomer(@RequestBody @Valid CustomerRequestDTO customerRequestDTO) {
ResultDTO resultDTO = new ResultDTO();
resultDTO = customerService.deleteCustomer(customerRequestDTO);
return resultDTO;
}
@PostMapping("/deleteIds") @PostMapping("/deleteIds")
@ResponseBody @ResponseBody
public ResultDTO deleteIds(@RequestBody @Valid CustomerRequestDTO customerRequestDTO) { public ResultDTO deleteIds(@RequestBody @Valid CustomerRequestDTO customerRequestDTO) {
...@@ -98,14 +84,6 @@ public class CustomerController { ...@@ -98,14 +84,6 @@ public class CustomerController {
// --------------- customer list table ----------------- // // --------------- customer list table ----------------- //
@GetMapping("/findAlls")
@ResponseBody
public ResponseEntity findAllCustomerList(@RequestParam("page") int page, @RequestParam("pageSize") int pageSize, @RequestParam("sort") String sort, @RequestParam("companySiteId") Long companySiteId) {
ResultDTO result = customerService.getAllCustomerList(page, pageSize, sort, companySiteId);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@PostMapping("/createCustomerList") @PostMapping("/createCustomerList")
@ResponseBody @ResponseBody
public ResultDTO createCustomerList(@RequestBody @Valid CustomerListDTO customerListDTO, HttpServletRequest request) { public ResultDTO createCustomerList(@RequestBody @Valid CustomerListDTO customerListDTO, HttpServletRequest request) {
...@@ -129,14 +107,6 @@ public class CustomerController { ...@@ -129,14 +107,6 @@ public class CustomerController {
return customerService.updateCustomerList(customerListDTO, userSession.getUserName()); return customerService.updateCustomerList(customerListDTO, userSession.getUserName());
} }
@PostMapping("/deleteCustomerList")
@ResponseBody
public ResultDTO deleteCustomerList(@RequestBody @Valid CustomerListDTO customerListDTO) {
ResultDTO result = new ResultDTO();
result = customerService.deleteCustomerList(customerListDTO);
return result;
}
@PostMapping("/deleteCustomerListIds") @PostMapping("/deleteCustomerListIds")
@ResponseBody @ResponseBody
public ResultDTO deleteCustomerListIds(@RequestBody @Valid CustomerRequestDTO customerRequestDTO) { public ResultDTO deleteCustomerListIds(@RequestBody @Valid CustomerRequestDTO customerRequestDTO) {
...@@ -146,16 +116,8 @@ public class CustomerController { ...@@ -146,16 +116,8 @@ public class CustomerController {
} }
@RequestMapping(value = "/searchCustomerList", method = RequestMethod.POST) @RequestMapping(value = "/searchCustomerList", method = RequestMethod.POST)
public ResponseEntity searchCustomerList(@RequestBody SearchCustomerRequestDTO searchCustomerRequestDTO) { public ResponseEntity searchCustomerList(@RequestBody SearchCustomerListRequestDTO searchCustomerListRequestDTO) {
ResultDTO result = customerService.searchCustomerList(searchCustomerRequestDTO); ResultDTO result = customerService.searchCustomerList(searchCustomerListRequestDTO);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@GetMapping("/latestCreated")
@ResponseBody
public ResponseEntity getLatestCreated(@RequestParam("companySiteId") Long companySiteId) {
ResultDTO result = new ResultDTO();
result.setData(customerService.getLatestCreated(companySiteId));
return new ResponseEntity<>(result, HttpStatus.OK); return new ResponseEntity<>(result, HttpStatus.OK);
} }
......
...@@ -118,7 +118,7 @@ public class ScenarioController { ...@@ -118,7 +118,7 @@ public class ScenarioController {
return new ResponseEntity<>(BundleUtils.getLangString("common.fileInvalidFormat", locale), HttpStatus.OK); return new ResponseEntity<>(BundleUtils.getLangString("common.fileInvalidFormat", locale), HttpStatus.OK);
} }
String path = saveUploadFile(file); String path = saveUploadFile(file);
Map<String, Object> map = scenarioService.readAndValidateCustomer(path, scenarioId, campaignId, userSession.getCompanySiteId()); Map<String, Object> map = scenarioService.readAndValidateScenario(path, scenarioId, campaignId, userSession.getCompanySiteId());
String code = (String) map.get("code"); String code = (String) map.get("code");
byte[] content = (byte[]) map.get("content"); byte[] content = (byte[]) map.get("content");
return ResponseEntity.ok() return ResponseEntity.ok()
......
...@@ -14,6 +14,7 @@ campaign.execute.interactive.contactStatus = Contact status ...@@ -14,6 +14,7 @@ campaign.execute.interactive.contactStatus = Contact status
campaign.execute.interactive.surveyStatus = Trạng thái khảo sát campaign.execute.interactive.surveyStatus = Trạng thái khảo sát
campaign.execute.interactive.status = Trạng thái chiến dịch campaign.execute.interactive.status = Trạng thái chiến dịch
campaign.execute.interactive.recordStatus = Trạng thái bản ghi campaign.execute.interactive.recordStatus = Trạng thái bản ghi
campaign.execute.interactive.callTime = Thời lượng cuộc gọi
#Campaign #Campaign
campaign = Campaigns campaign = Campaigns
......
...@@ -14,6 +14,7 @@ campaign.execute.interactive.contactStatus = Trạng thái kết nối ...@@ -14,6 +14,7 @@ campaign.execute.interactive.contactStatus = Trạng thái kết nối
campaign.execute.interactive.surveyStatus = Trạng thái khảo sát campaign.execute.interactive.surveyStatus = Trạng thái khảo sát
campaign.execute.interactive.status = Trạng thái chiến dịch campaign.execute.interactive.status = Trạng thái chiến dịch
campaign.execute.interactive.recordStatus = Trạng thái bản ghi campaign.execute.interactive.recordStatus = Trạng thái bản ghi
campaign.execute.interactive.callTime = Thời lượng cuộc gọi
#Campaigns #Campaigns
......
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