Commit 8e43843f authored by Phạm Duy Phi's avatar Phạm Duy Phi
parents 89c392e4 5e3ed78c
...@@ -126,7 +126,9 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -126,7 +126,9 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
sql.append(" CC2.COMPLETE_NAME AS surveyStatus, "); sql.append(" CC2.COMPLETE_NAME AS surveyStatus, ");
sql.append(" C.STATUS AS status, "); sql.append(" C.STATUS AS status, ");
sql.append(" CCR.STATUS AS recordStatus, "); sql.append(" CCR.STATUS AS recordStatus, ");
sql.append(" (( CCR.END_TIME - CCR.START_CALL ) * 24 * 60 * 60) AS callTime "); sql.append(" (( CCR.END_TIME - CCR.START_CALL ) * 24 * 60 * 60) AS callTime, ");
sql.append(" C.CAMPAIGN_ID AS campaignId, ");
sql.append(" CUS.CUSTOMER_ID AS customerId ");
sql.append("FROM CONTACT_CUST_RESULT CCR "); sql.append("FROM CONTACT_CUST_RESULT CCR ");
sql.append(" INNER JOIN CAMPAIGN C ON CCR.CAMPAIGN_ID = C.CAMPAIGN_ID "); sql.append(" INNER JOIN CAMPAIGN C ON CCR.CAMPAIGN_ID = C.CAMPAIGN_ID ");
sql.append(" INNER JOIN VSA_USERS VU ON CCR.AGENT_ID = VU.USER_ID "); sql.append(" INNER JOIN VSA_USERS VU ON CCR.AGENT_ID = VU.USER_ID ");
...@@ -293,6 +295,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -293,6 +295,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
item.setStatus(obj[10] == null ? 0 : ((BigDecimal) obj[10]).shortValueExact()); item.setStatus(obj[10] == null ? 0 : ((BigDecimal) obj[10]).shortValueExact());
item.setRecordStatus(obj[11] == null ? 0 : ((BigDecimal) obj[11]).shortValueExact()); item.setRecordStatus(obj[11] == null ? 0 : ((BigDecimal) obj[11]).shortValueExact());
item.setCallTime(obj[12] == null ? 0L : ((BigDecimal) obj[12]).longValueExact()); item.setCallTime(obj[12] == null ? 0L : ((BigDecimal) obj[12]).longValueExact());
item.setCampaignId(obj[13] == null ? 0L : ((BigDecimal) obj[13]).longValueExact());
item.setCustomerId(obj[14] == null ? 0L : ((BigDecimal) obj[14]).longValueExact());
list.add(item); list.add(item);
} }
......
...@@ -52,4 +52,6 @@ public interface CampaignExecuteService { ...@@ -52,4 +52,6 @@ public interface CampaignExecuteService {
ResultDTO createListContacQuestResult(List<ContactQuestResultDTO> dtoList); ResultDTO createListContacQuestResult(List<ContactQuestResultDTO> dtoList);
String getDialModeAtCurrent(Long campaignId, Long companySiteId); String getDialModeAtCurrent(Long campaignId, Long companySiteId);
ResultDTO getContactCustResultById(Long contactCustResultId);
} }
...@@ -38,9 +38,6 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService { ...@@ -38,9 +38,6 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
@Autowired @Autowired
ModelMapper modelMapper; ModelMapper modelMapper;
@Autowired
ContactCustResultRepository ccResultRepository;
@Autowired @Autowired
ReceiveCustLogRepository custLogRepository; ReceiveCustLogRepository custLogRepository;
...@@ -68,6 +65,9 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService { ...@@ -68,6 +65,9 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
@Autowired @Autowired
CampaignCustomerListColumnRepository campaignCustomerListColumnRepository; CampaignCustomerListColumnRepository campaignCustomerListColumnRepository;
@Autowired
ContactCustResultRepository ccResultRepository;
@Autowired @Autowired
ContactQuestResultRepository contactQuestResultRepository; ContactQuestResultRepository contactQuestResultRepository;
...@@ -226,9 +226,9 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService { ...@@ -226,9 +226,9 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
++rowIndex; ++rowIndex;
++count; ++count;
} }
}catch (Exception e){ } catch (Exception e) {
}finally { } finally {
if (workbook != null) workbook.close(); if (workbook != null) workbook.close();
} }
...@@ -728,4 +728,19 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService { ...@@ -728,4 +728,19 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
return "-1"; return "-1";
} }
@Override
public ResultDTO getContactCustResultById(Long contactCustResultId) {
ResultDTO resultDTO = new ResultDTO();
try {
resultDTO.setErrorCode(Constants.ApiErrorCode.SUCCESS);
resultDTO.setDescription(Constants.ApiErrorDesc.SUCCESS);
resultDTO.setData(ccResultRepository.findById(contactCustResultId));
} catch (Exception e) {
resultDTO.setErrorCode(Constants.ApiErrorCode.ERROR);
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
}
return resultDTO;
}
} }
...@@ -240,7 +240,7 @@ public class ScenarioServiceImpl implements ScenarioService { ...@@ -240,7 +240,7 @@ public class ScenarioServiceImpl implements ScenarioService {
logger.error(e.getMessage()); logger.error(e.getMessage());
return null; return null;
}finally { }finally {
if (workbook != null) workbook.close(); //if (workbook != null) workbook.close();
} }
} }
......
package com.viettel.campaign.web.dto.request_dto; package com.viettel.campaign.web.dto.request_dto;
import com.viettel.campaign.web.dto.BaseDTO; import com.viettel.campaign.web.dto.BaseDTO;
import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
@AllArgsConstructor
@NoArgsConstructor
public class CustomerQueryDTO extends BaseDTO { public class CustomerQueryDTO extends BaseDTO {
String join ; String join ;
Long field; Long field;
String operator; String operator;
String condition; String condition;
String type;
} }
...@@ -180,4 +180,11 @@ public class CampaignExecuteController { ...@@ -180,4 +180,11 @@ public class CampaignExecuteController {
String result = campaignExecuteService.getDialModeAtCurrent(companySiteId, campaignId); String result = campaignExecuteService.getDialModeAtCurrent(companySiteId, campaignId);
return new ResponseEntity<>(result, HttpStatus.OK); return new ResponseEntity<>(result, HttpStatus.OK);
} }
@GetMapping("/getContactCustResultById")
@ResponseBody
public ResponseEntity getContactCustResultById(@RequestParam("contactCustResultId") Long contactCustResultId) {
ResultDTO result = campaignExecuteService.getContactCustResultById(contactCustResultId);
return new ResponseEntity<>(result, HttpStatus.OK);
}
} }
...@@ -316,7 +316,7 @@ public class CustomerController { ...@@ -316,7 +316,7 @@ public class CustomerController {
return new ResponseEntity<>(resultDTO, HttpStatus.OK); return new ResponseEntity<>(resultDTO, HttpStatus.OK);
} }
@PostMapping("/searchCustomizeFields") @PostMapping("/searchIndividualCustomer")
@ResponseBody @ResponseBody
public ResponseEntity searchCustomizeFields(@RequestBody CampaignCustomerDTO campaignCustomerDTO ) { public ResponseEntity searchCustomizeFields(@RequestBody CampaignCustomerDTO campaignCustomerDTO ) {
ResultDTO result = customerService.searchCustomizeFields(campaignCustomerDTO); ResultDTO result = customerService.searchCustomizeFields(campaignCustomerDTO);
......
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