Commit 77d9a47f authored by Phạm Duy Phi's avatar Phạm Duy Phi

phipd commit

parent b1ee87e2
...@@ -192,8 +192,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -192,8 +192,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("_", "\\_")
+ "%"); + "%");
} }
...@@ -226,8 +226,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -226,8 +226,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("_", "\\_")
+ "%"); + "%");
} }
...@@ -235,8 +235,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -235,8 +235,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("_", "\\_")
+ "%"); + "%");
} }
...@@ -244,8 +244,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -244,8 +244,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("_", "\\_")
+ "%"); + "%");
} }
......
...@@ -32,8 +32,6 @@ public interface CustomerService { ...@@ -32,8 +32,6 @@ public interface CustomerService {
// ------------ 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);
......
...@@ -536,92 +536,6 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -536,92 +536,6 @@ public class CustomerServiceImpl implements CustomerService {
} }
// ------------- customer list ----------------- // // ------------- customer list ----------------- //
@Override
@Transactional(DataSourceQualify.CCMS_FULL)
public ResultDTO getAllCustomerList(int page, int pageSize, String sort, Long companySiteId) {
ResultDTO resultDTO = new ResultDTO();
SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
Session session = null;
if (DataUtil.isNullOrZero(companySiteId)) {
resultDTO.setErrorCode(Constants.ApiErrorCode.ERROR);
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
return resultDTO;
}
try {
session = sessionFactory.openSession();
session.beginTransaction();
// StringBuilder sb = new StringBuilder();
// sb.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_MNG, "search-campaign-customer-by-params"));
StringBuilder sb = new StringBuilder();
sb.append("SELECT");
sb.append(" CUSTOMER_LIST_ID customerListId,");
sb.append(" COMPANY_SITE_ID companySiteId,");
sb.append(" CUSTOMER_LIST_CODE customerListCode,");
sb.append(" CUSTOMER_LIST_NAME customerListName,");
sb.append(" STATUS status,");
sb.append(" CREATE_BY createBy,");
sb.append(" CREATE_AT createAt,");
sb.append(" UPDATE_BY updateBy,");
sb.append(" UPDATE_AT updateAt,");
sb.append(" SOURCE source,");
sb.append(" DEPT_CREATE deptCreate");
sb.append(" FROM CUSTOMER_LIST");
sb.append(" WHERE 1 = 1");
sb.append(" AND STATUS = 1");
sb.append(" AND COMPANY_SITE_ID = :p_company_site_id");
sb.append(" ORDER BY CREATE_AT DESC");
SQLQuery query = session.createSQLQuery(sb.toString());
query.setParameter("p_company_site_id", companySiteId);
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.setResultTransformer(Transformers.aliasToBean(CustomerListDTO.class));
int count = 0;
List<CustomerListDTO> dtoList = query.list();
if (dtoList.size() > 0) {
count = query.list().size();
}
Pageable pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Order.desc(sort)));
if (pageable != null) {
query.setFirstResult(pageable.getPageNumber() * pageable.getPageSize());
query.setMaxResults(pageable.getPageSize());
}
List<CustomerListDTO> data = query.list();
Page<CustomerListDTO> dataPage = new PageImpl<>(data, pageable, count);
resultDTO.setData(dataPage);
resultDTO.setErrorCode(Constants.ApiErrorCode.SUCCESS);
resultDTO.setDescription(Constants.ApiErrorDesc.SUCCESS);
} catch (Exception e) {
resultDTO.setErrorCode(Constants.ApiErrorCode.ERROR);
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
} finally {
if (session != null) session.close();
}
return resultDTO;
}
@Override @Override
@Transactional(DataSourceQualify.CCMS_FULL) @Transactional(DataSourceQualify.CCMS_FULL)
public ResultDTO createCustomerList(CustomerListDTO customerListDTO, String userName) { public ResultDTO createCustomerList(CustomerListDTO customerListDTO, String userName) {
......
...@@ -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);
......
...@@ -98,14 +98,6 @@ public class CustomerController { ...@@ -98,14 +98,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) {
......
...@@ -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