Commit e5d05c7f authored by đinh thị đầm's avatar đinh thị đầm

Merge branch 'master' of http://git.myitsol.com/hanv/service-campaign

 Conflicts:
	src/main/java/com/viettel/campaign/repository/ccms_full/CampaignCfgRepository.java
parents f79dfbd2 e099d3d4
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
<version>3.17</version> <version>4.0.1</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io --> <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency> <dependency>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId> <artifactId>poi-ooxml</artifactId>
<version>3.17</version> <version>4.0.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.quartz-scheduler</groupId> <groupId>org.quartz-scheduler</groupId>
......
...@@ -123,7 +123,7 @@ public class CampaignJob { ...@@ -123,7 +123,7 @@ public class CampaignJob {
List<CustomerTime> customerTimes = customerTimeService.findByCustomerId(customer.getCustomerId()); List<CustomerTime> customerTimes = customerTimeService.findByCustomerId(customer.getCustomerId());
customerTimes.parallelStream().forEach(customerTime -> { customerTimes.parallelStream().forEach(customerTime -> {
log.info("Cap nhat Customer time cua KH ... #{}", customerTime.getCustomerId()); log.info("Cap nhat Customer time cua KH ... #{}", customerTime.getCustomerId());
customerTime.setStatus(2); customerTime.setStatus((short) 2);
customerTime.setUpdateTime(new Date()); customerTime.setUpdateTime(new Date());
customerTimeService.update(customerTime); customerTimeService.update(customerTime);
}); });
......
...@@ -19,15 +19,18 @@ import java.util.Date; ...@@ -19,15 +19,18 @@ import java.util.Date;
public class CustomerTime { public class CustomerTime {
@Id @Id
@GeneratedValue(generator = "CUSTOMER_TIME_SEQ")
@SequenceGenerator(name = "CUSTOMER_TIME_SEQ", sequenceName = "CUSTOMER_TIME_SEQ", allocationSize = 1)
@Basic(optional = false)
@NotNull @NotNull
@Column(name = "CUSTOMER_TIME_ID") @Column(name = "CUSTOMER_TIME_ID")
private Long customerTimeId; private Long customerTimeId;
@Column(name = "COMPANY_SITE_ID") @Column(name = "COMPANY_SITE_ID")
private String companySiteId; private Long companySiteId;
@Column(name = "CUSTOMER_ID") @Column(name = "CUSTOMER_ID")
private String customerId; private Long customerId;
@Column(name = "START_TIME") @Column(name = "START_TIME")
private Date startTime; private Date startTime;
...@@ -36,7 +39,7 @@ public class CustomerTime { ...@@ -36,7 +39,7 @@ public class CustomerTime {
private Date endTime; private Date endTime;
@Column(name = "STATUS") @Column(name = "STATUS")
private Integer status; private Short status;
@Column(name = "CREATE_TIME") @Column(name = "CREATE_TIME")
private Date createTime; private Date createTime;
...@@ -45,10 +48,10 @@ public class CustomerTime { ...@@ -45,10 +48,10 @@ public class CustomerTime {
private Date updateTime; private Date updateTime;
@Column(name = "CREATE_BY") @Column(name = "CREATE_BY")
private String createBy; private Long createBy;
@Column(name = "UPDATE_BY") @Column(name = "UPDATE_BY")
private String updateBy; private Long updateBy;
@Column(name = "CONTACT_CUST_RESULT_ID") @Column(name = "CONTACT_CUST_RESULT_ID")
private Long contactCustResultId; private Long contactCustResultId;
......
...@@ -47,4 +47,6 @@ public interface CampaignCfgRepository extends JpaRepository<CampaignCfg, Long> ...@@ -47,4 +47,6 @@ public interface CampaignCfgRepository extends JpaRepository<CampaignCfg, Long>
@Query("select c from CampaignCfg c where c.companySiteId =:p_company_site_id") @Query("select c from CampaignCfg c where c.companySiteId =:p_company_site_id")
List<CampaignCfg> findAllCampaignCompleteCode(); List<CampaignCfg> findAllCampaignCompleteCode();
@Query(value = "FROM CampaignCfg WHERE status = 1 AND completeValue = :completeValue AND companySiteId = :companySiteId")
CampaignCfg findByCompanySiteIdAndCompleteValue(@Param("companySiteId") Long companySiteId, @Param("completeValue") String completeValue);
} }
...@@ -22,5 +22,4 @@ public interface CampaignExecuteRepository { ...@@ -22,5 +22,4 @@ public interface CampaignExecuteRepository {
List<ContactCustResultDTO> getExcelInteractiveResult(CampaignRequestDTO dto); List<ContactCustResultDTO> getExcelInteractiveResult(CampaignRequestDTO dto);
List<ContactQuestResultDTO> createListContacQuestResult(List<ContactQuestResultDTO> dtoList);
} }
...@@ -12,5 +12,10 @@ import java.util.List; ...@@ -12,5 +12,10 @@ import java.util.List;
@Repository @Repository
@Transactional(DataSourceQualify.CCMS_FULL) @Transactional(DataSourceQualify.CCMS_FULL)
public interface ContactQuestResultRepository extends JpaRepository<ContactQuestResult, Long> { public interface ContactQuestResultRepository extends JpaRepository<ContactQuestResult, Long> {
List<ContactQuestResultDTO> findByCompanySiteIdAndCampaignId(Long companySiteId, Long campaignId); List<ContactQuestResultDTO> findByCompanySiteIdAndCampaignId(Long companySiteId, Long campaignId);
List<ContactQuestResult> findByContactCustResultId(Long contactCustResultId);
List<ContactQuestResult> findByCompanySiteIdAndCampaignIdAndCustomerId(Long companySiteId, Long campaignId, Long customerId);
} }
...@@ -11,6 +11,8 @@ import java.util.List; ...@@ -11,6 +11,8 @@ 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")
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 @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") @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")
......
...@@ -123,7 +123,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -123,7 +123,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
sql.append(" CCR.PHONE_NUMBER AS phoneNumber, "); sql.append(" CCR.PHONE_NUMBER AS phoneNumber, ");
sql.append(" CUS.NAME AS customerName, "); sql.append(" CUS.NAME AS customerName, ");
sql.append(" CCR.START_CALL AS startCall, "); sql.append(" CCR.START_CALL AS startCall, ");
sql.append(" CC1.COMPLETE_NAME AS contactStatus, "); sql.append(" CC1.COMPLETE_NAME AS connectStatus, ");
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, ");
...@@ -291,7 +291,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -291,7 +291,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
item.setPhoneNumber((String) obj[5]); item.setPhoneNumber((String) obj[5]);
item.setCustomerName((String) obj[6]); item.setCustomerName((String) obj[6]);
item.setStartCall(obj[7] == null ? null : (Date) obj[7]); item.setStartCall(obj[7] == null ? null : (Date) obj[7]);
item.setContactStatus((String) obj[8]); item.setConnectStatus((String) obj[8]);
item.setSurveyStatus((String) obj[9]); item.setSurveyStatus((String) obj[9]);
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());
...@@ -585,28 +585,4 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository { ...@@ -585,28 +585,4 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
return result; return result;
} }
@Override
@Transactional(DataSourceQualify.CCMS_FULL)
public List<ContactQuestResultDTO> createListContacQuestResult(List<ContactQuestResultDTO> dtoList) {
ResultDTO resultDTO = new ResultDTO();
List<ContactQuestResultDTO> list = new ArrayList<>();
SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
Session session = sessionFactory.openSession();
session.beginTransaction();
try {
// list = contactQuestResultRepository.saveAll(dtoList);
} catch (Exception e) {
logger.error(e.getMessage(), e);
resultDTO.setErrorCode(Constants.ApiErrorCode.ERROR);
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
} finally {
session.close();
}
return list;
}
} }
...@@ -22,4 +22,6 @@ public interface AgentsService { ...@@ -22,4 +22,6 @@ public interface AgentsService {
ResultDTO searchCampaignAgentSelectByName(int page, int pageSize, Long companySiteId, Long campaignId, String userName, String fullName); ResultDTO searchCampaignAgentSelectByName(int page, int pageSize, Long companySiteId, Long campaignId, String userName, String fullName);
ResultDTO createMultipleCampaignAgent(CampaignAgentRequestDTO campaignAgentRequestDTO); ResultDTO createMultipleCampaignAgent(CampaignAgentRequestDTO campaignAgentRequestDTO);
ResultDTO updateAgent(CampaignAgentDTO campaignAgentDTO);
} }
...@@ -32,12 +32,12 @@ public interface CampaignExecuteService { ...@@ -32,12 +32,12 @@ public interface CampaignExecuteService {
ResultDTO getCallLog(ReceiveCustLogDTO dto); ResultDTO getCallLog(ReceiveCustLogDTO dto);
ResultDTO getCallStatus(CampaignRequestDTO dto);
ResultDTO getAgentLogout(CampaignRequestDTO dto); ResultDTO getAgentLogout(CampaignRequestDTO dto);
ResultDTO updateContactCustResult(ContactCustResultDTO dto, UserSession userSession); ResultDTO updateContactCustResult(ContactCustResultDTO dto, UserSession userSession);
ResultDTO draftAtTen(ContactCustResultDTO dto, UserSession userSession);
ResultDTO recallCustomer(ContactCustResultDTO dto); ResultDTO recallCustomer(ContactCustResultDTO dto);
ResultDTO callCustomerEnd(ContactCustResultDTO dto); ResultDTO callCustomerEnd(ContactCustResultDTO dto);
...@@ -48,9 +48,15 @@ public interface CampaignExecuteService { ...@@ -48,9 +48,15 @@ public interface CampaignExecuteService {
ResultDTO getCustomerInfor(Long companySiteId, Long customerId, Long campaignId); ResultDTO getCustomerInfor(Long companySiteId, Long customerId, Long campaignId);
ResultDTO createListContacQuestResult(List<ContactQuestResultDTO> dtoList); ResultDTO createListContactQuestResult(List<ContactQuestResultDTO> dtoList);
ResultDTO updateListContactQuestResult(ContactQuestResultDTO dto);
String getDialModeAtCurrent(Long campaignId, Long companySiteId); String getDialModeAtCurrent(Long campaignId, Long companySiteId);
ResultDTO getContactCustResultById(Long contactCustResultId); ResultDTO getContactCustResultById(Long contactCustResultId);
ResultDTO updateCampaignCustomer(CampaignCustomerDTO dto);
ResultDTO updateSurveyStatus(CustomerTimeDTO dto, UserSession userSession);
} }
package com.viettel.campaign.service; package com.viettel.campaign.service;
import com.viettel.campaign.model.ccms_full.ContactQuestResult;
import com.viettel.campaign.model.ccms_full.Scenario; import com.viettel.campaign.model.ccms_full.Scenario;
import com.viettel.campaign.web.dto.*; import com.viettel.campaign.web.dto.*;
import com.viettel.econtact.filter.UserSession; import com.viettel.econtact.filter.UserSession;
...@@ -28,4 +29,6 @@ public interface ScenarioService { ...@@ -28,4 +29,6 @@ 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> readAndValidateCustomer(String path, Long scenarioId, Long campaignId, Long companySiteId) throws IOException;
List<ContactQuestResult> getContactQuestResult(Long companySiteId, Long campaignId, Long customerId);
} }
...@@ -537,4 +537,28 @@ public class AgentsServiceImpl implements AgentsService { ...@@ -537,4 +537,28 @@ public class AgentsServiceImpl implements AgentsService {
return resultDTO; return resultDTO;
} }
@Override
public ResultDTO updateAgent(CampaignAgentDTO campaignAgentDTO) {
ResultDTO resultDTO = new ResultDTO();
try {
if (campaignAgentDTO != null) {
Agents agents = new Agents();
agents.setAgentId(campaignAgentDTO.getAgentId().toString());
agents.setCampaignSystemStatus("AVAILABLE");
agentsRepository.save(agents);
resultDTO.setErrorCode(Constants.ApiErrorCode.SUCCESS);
resultDTO.setDescription(Constants.ApiErrorDesc.SUCCESS);
} else {
resultDTO.setErrorCode(Constants.ApiErrorCode.ERROR);
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
}
} catch (Exception e) {
// e.printStackTrace();
}
return resultDTO;
}
} }
...@@ -207,6 +207,11 @@ public class CampaignServiceImpl implements CampaignService { ...@@ -207,6 +207,11 @@ public class CampaignServiceImpl implements CampaignService {
try { try {
Campaign entity = campaignRepository.findCampaignByCampaignIdAndCompanySiteId(dto.getCampaignId(), dto.getCompanySiteId()); Campaign entity = campaignRepository.findCampaignByCampaignIdAndCompanySiteId(dto.getCampaignId(), dto.getCompanySiteId());
if (entity != null) { if (entity != null) {
if(entity.getStatus().equals(dto.getStatus().longValue())) {
result.setDescription("Duplicate status");
result.setErrorCode("02");
return result;
}
entity.setStatus(dto.getStatus().longValue()); entity.setStatus(dto.getStatus().longValue());
entity.setUpdateTime(new Date()); entity.setUpdateTime(new Date());
entity.setUpdateBy(dto.getUpdateBy()); entity.setUpdateBy(dto.getUpdateBy());
......
...@@ -20,6 +20,7 @@ import cz.jirutka.rsql.parser.ast.RSQLVisitor; ...@@ -20,6 +20,7 @@ import cz.jirutka.rsql.parser.ast.RSQLVisitor;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList; import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.hibernate.SQLQuery; import org.hibernate.SQLQuery;
import org.hibernate.Session; import org.hibernate.Session;
...@@ -980,7 +981,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -980,7 +981,7 @@ public class CustomerServiceImpl implements CustomerService {
FileInputStream fis = new FileInputStream(file); FileInputStream fis = new FileInputStream(file);
workbook = new XSSFWorkbook(fis); workbook = new XSSFWorkbook(fis);
ByteArrayOutputStream os = new ByteArrayOutputStream(); ByteArrayOutputStream os = new ByteArrayOutputStream();
Sheet sheet = workbook.getSheetAt(0); XSSFSheet sheet = workbook.getSheetAt(0);
Row row = sheet.getRow(3); Row row = sheet.getRow(3);
//<editor-fold desc="Tạo style cho cột kết quả" defaultstate="collapsed"> //<editor-fold desc="Tạo style cho cột kết quả" defaultstate="collapsed">
...@@ -998,7 +999,26 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -998,7 +999,26 @@ public class CustomerServiceImpl implements CustomerService {
//</editor-fold> //</editor-fold>
//<editor-fold desc="Kiểm tra header của template" defaultstate="collapsed"> //<editor-fold desc="Kiểm tra header của template" defaultstate="collapsed">
if (row.getPhysicalNumberOfCells() != header.size()) { if (row.getPhysicalNumberOfCells() > header.size()) {
for (int i = 0; i < row.getPhysicalNumberOfCells(); i++) {
if (sheet.isColumnHidden(i)) {
sheet.setColumnHidden(i, false);
}
if (isColumnNullOrBlank(sheet, i)) {
sheet.shiftColumns(i + 1, i + 1, -1);
sheet.removeMergedRegion(0);
sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, 13));
}
}
for (int i = 0; i < header.size(); i++) {
Cell cell = row.getCell(i);
if (!cell.getStringCellValue().equals(header.get(i).getTitle().split("#")[0])) {
result.put("content", Files.readAllBytes(file.toPath()));
result.put("message", "template-invalid");
return result;
}
}
} else if (row.getPhysicalNumberOfCells() < header.size()) {
result.put("content", Files.readAllBytes(file.toPath())); result.put("content", Files.readAllBytes(file.toPath()));
result.put("message", "template-invalid"); result.put("message", "template-invalid");
return result; return result;
...@@ -1022,7 +1042,10 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1022,7 +1042,10 @@ public class CustomerServiceImpl implements CustomerService {
result.put("content", Files.readAllBytes(file.toPath())); result.put("content", Files.readAllBytes(file.toPath()));
return result; return result;
} else { } else {
Cell resultCell = sheet.getRow(3).createCell(sheet.getRow(3).getPhysicalNumberOfCells()); Cell resultCell = sheet.getRow(3).getCell(header.size());
if (resultCell == null) {
resultCell = sheet.getRow(3).createCell(header.size());
}
resultCell.setCellValue(BundleUtils.getLangString("customer.result", locale)); resultCell.setCellValue(BundleUtils.getLangString("customer.result", locale));
resultCell.setCellStyle(resultStyle); resultCell.setCellStyle(resultStyle);
} }
...@@ -1398,6 +1421,18 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1398,6 +1421,18 @@ public class CustomerServiceImpl implements CustomerService {
String regexp = "@\"^\\p{L}+$\""; String regexp = "@\"^\\p{L}+$\"";
return str.matches(regexp); return str.matches(regexp);
} }
private boolean isColumnNullOrBlank(Sheet sheet, int columnIndex) {
for (Row row : sheet) {
if (row.getRowNum() < 3) continue;
Cell cell = row.getCell(columnIndex, Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
if (cell != null) {
return false;
}
}
return true;
}
//</editor-fold> //</editor-fold>
@Override @Override
......
...@@ -461,6 +461,12 @@ public class ScenarioServiceImpl implements ScenarioService { ...@@ -461,6 +461,12 @@ public class ScenarioServiceImpl implements ScenarioService {
return result; return result;
} }
@Override
@Transactional(DataSourceQualify.CCMS_FULL)
public List<ContactQuestResult> getContactQuestResult(Long companySiteId, Long campaignId, Long customerId) {
return questResultRepository.findByCompanySiteIdAndCampaignIdAndCustomerId(companySiteId, campaignId, customerId);
}
private boolean validateMappingQuestion(String mappingQuestion, String currentQuestionCode, List<String> lstQuestionCode) { private boolean validateMappingQuestion(String mappingQuestion, String currentQuestionCode, List<String> lstQuestionCode) {
if (mappingQuestion != null && mappingQuestion.equals(currentQuestionCode)) return false; if (mappingQuestion != null && mappingQuestion.equals(currentQuestionCode)) return false;
......
...@@ -14,7 +14,7 @@ public class ContactCustResultDTO extends BaseDTO { ...@@ -14,7 +14,7 @@ public class ContactCustResultDTO extends BaseDTO {
private Long contactCustResultId; private Long contactCustResultId;
private Long companySiteId; private Long companySiteId;
private Short callStatus; private Short callStatus;
private String contactStatus; private Short contactStatus;
private Short status; private Short status;
private Integer satisfaction; private Integer satisfaction;
private String description; private String description;
...@@ -52,6 +52,7 @@ public class ContactCustResultDTO extends BaseDTO { ...@@ -52,6 +52,7 @@ public class ContactCustResultDTO extends BaseDTO {
private String campaignCode; private String campaignCode;
private String userName; private String userName;
private String surveyStatus; private String surveyStatus;
private String connectStatus;
private Boolean enableEdit; private Boolean enableEdit;
private Integer totalRow; private Integer totalRow;
......
package com.viettel.campaign.web.dto;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
@Getter
@Setter
public class CustomerTimeDTO extends BaseDTO {
private Long customerTimeId;
private Long companySiteId;
private Long customerId;
private Date startTime;
private Date endTime;
private Short status;
private Date createTime;
private Date updateTime;
private Long createBy;
private Long updateBy;
private Long contactCustResultId;
private String completeValue;
}
...@@ -82,4 +82,12 @@ public class AgentsController { ...@@ -82,4 +82,12 @@ public class AgentsController {
result = agentsService.createMultipleCampaignAgent(campaignAgentRequestDTO); result = agentsService.createMultipleCampaignAgent(campaignAgentRequestDTO);
return result; return result;
} }
@PostMapping("/updateAgent")
@ResponseBody
public ResultDTO updateAgent(@RequestBody @Valid CampaignAgentDTO requestDTO) {
ResultDTO result = new ResultDTO();
result = agentsService.updateAgent(requestDTO);
return result;
}
} }
...@@ -68,13 +68,6 @@ public class CampaignExecuteController { ...@@ -68,13 +68,6 @@ public class CampaignExecuteController {
return new ResponseEntity<>(result, HttpStatus.OK); return new ResponseEntity<>(result, HttpStatus.OK);
} }
@PostMapping("/getCallStatus")
@ResponseBody
public ResponseEntity<ResultDTO> getCallStatus(@RequestBody CampaignRequestDTO requestDto) {
ResultDTO result = campaignExecuteService.getCallStatus(requestDto);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@GetMapping("/countRecallCustomer") @GetMapping("/countRecallCustomer")
@ResponseBody @ResponseBody
public ResponseEntity countRecallCustomer(@RequestParam("companySiteId") Long companySiteId, @RequestParam("agentId") Long agentId) { public ResponseEntity countRecallCustomer(@RequestParam("companySiteId") Long companySiteId, @RequestParam("agentId") Long agentId) {
...@@ -169,7 +162,15 @@ public class CampaignExecuteController { ...@@ -169,7 +162,15 @@ public class CampaignExecuteController {
@ResponseBody @ResponseBody
public ResponseEntity<ResultDTO> createListContactQuestResult(@RequestBody List<ContactQuestResultDTO> dtoList) { public ResponseEntity<ResultDTO> createListContactQuestResult(@RequestBody List<ContactQuestResultDTO> dtoList) {
ResultDTO result = null; ResultDTO result = null;
result = campaignExecuteService.createListContacQuestResult(dtoList); result = campaignExecuteService.createListContactQuestResult(dtoList);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@PutMapping("/updateListContactQuestResult")
@ResponseBody
public ResponseEntity<ResultDTO> updateListContactQuestResult(@RequestBody ContactQuestResultDTO dto) {
ResultDTO result = null;
result = campaignExecuteService.updateListContactQuestResult(dto);
return new ResponseEntity<>(result, HttpStatus.OK); return new ResponseEntity<>(result, HttpStatus.OK);
} }
...@@ -186,4 +187,29 @@ public class CampaignExecuteController { ...@@ -186,4 +187,29 @@ public class CampaignExecuteController {
ResultDTO result = campaignExecuteService.getContactCustResultById(contactCustResultId); ResultDTO result = campaignExecuteService.getContactCustResultById(contactCustResultId);
return new ResponseEntity<>(result, HttpStatus.OK); return new ResponseEntity<>(result, HttpStatus.OK);
} }
@PostMapping("/draftAtTen")
@ResponseBody
public ResponseEntity<ResultDTO> draftAtTen(@RequestBody ContactCustResultDTO requestDto, HttpServletRequest request) {
String xAuthToken = request.getHeader("X-Auth-Token");
UserSession userSession = (UserSession) RedisUtil.getInstance().get(xAuthToken);
ResultDTO result = campaignExecuteService.draftAtTen(requestDto, userSession);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@PostMapping("/updateCampaignCustomer")
@ResponseBody
public ResponseEntity<ResultDTO> updateCampaignCustomer(@RequestBody CampaignCustomerDTO requestDto) {
ResultDTO result = campaignExecuteService.updateCampaignCustomer(requestDto);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@PostMapping("/updateSurveyStatus")
@ResponseBody
public ResponseEntity<ResultDTO> updateSurveyStatus(@RequestBody CustomerTimeDTO requestDto, HttpServletRequest request) {
String xAuthToken = request.getHeader("X-Auth-Token");
UserSession userSession = (UserSession) RedisUtil.getInstance().get(xAuthToken);
ResultDTO result = campaignExecuteService.updateSurveyStatus(requestDto, userSession);
return new ResponseEntity<>(result, HttpStatus.OK);
}
} }
...@@ -76,9 +76,11 @@ public class CustomerController { ...@@ -76,9 +76,11 @@ public class CustomerController {
@PostMapping("/delete") @PostMapping("/delete")
@ResponseBody @ResponseBody
public ResultDTO deleteCustomer(@RequestBody @Valid CustomerRequestDTO customerRequestDTO) { public ResultDTO deleteCustomer(@RequestBody @Valid CustomerRequestDTO customerRequestDTO) {
ResultDTO result = new ResultDTO(); ResultDTO resultDTO = new ResultDTO();
result = customerService.deleteCustomer(customerRequestDTO); if (customerRequestDTO != null) {
return result; resultDTO = customerService.deleteCustomer(customerRequestDTO);
}
return resultDTO;
} }
@PostMapping("/deleteIds") @PostMapping("/deleteIds")
......
package com.viettel.campaign.web.rest; package com.viettel.campaign.web.rest;
import com.viettel.campaign.model.ccms_full.ContactQuestResult;
import com.viettel.campaign.model.ccms_full.Scenario; import com.viettel.campaign.model.ccms_full.Scenario;
import com.viettel.campaign.service.ScenarioService; import com.viettel.campaign.service.ScenarioService;
import com.viettel.campaign.utils.BundleUtils; import com.viettel.campaign.utils.BundleUtils;
...@@ -36,7 +37,7 @@ import java.util.*; ...@@ -36,7 +37,7 @@ import java.util.*;
@RestController @RestController
@RequestMapping("/ipcc/campaign/scenario") @RequestMapping("/ipcc/campaign/scenario")
@CrossOrigin @CrossOrigin(origins = "*")
public class ScenarioController { public class ScenarioController {
private static final Logger logger = LoggerFactory.getLogger(ScenarioController.class); private static final Logger logger = LoggerFactory.getLogger(ScenarioController.class);
...@@ -147,4 +148,9 @@ public class ScenarioController { ...@@ -147,4 +148,9 @@ public class ScenarioController {
return null; return null;
} }
@RequestMapping(value = "/getContactQuestResult", method = RequestMethod.GET)
public List<ContactQuestResult> getContactQuestResult(@RequestParam Long companySiteId, @RequestParam Long campaignId, @RequestParam Long customerId) {
return scenarioService.getContactQuestResult(companySiteId, campaignId, customerId);
}
} }
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