Commit 3356201f authored by Nguyen Ha's avatar Nguyen Ha

fix vul

parent f7378f37
sonar.host.url=http://192.168.1.210:9000
sonar.sourceEncoding=UTF-8
sonar.projectKey=0ad5d5fb7aa141b4ac383bcb096e2ec3faba0b1b
sonar.projectName=VTT_CAMPAIGN
sonar.projectVersion=1.0
sonar.sources=.
sonar.language=java
mvn sonar:sonar -Dsonar.host.url=http://192.168.1.210:9000 -Dsonar.login=0ad5d5fb7aa141b4ac383bcb096e2ec3faba0b1b
\ No newline at end of file
......@@ -9,10 +9,10 @@ import java.util.Date;
@Entity
@Table(name = "CUSTOMIZE_FIELDS")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
//@Getter
//@Setter
//@NoArgsConstructor
//@AllArgsConstructor
public class CustomizeFields implements Serializable {
@Id
@GeneratedValue(generator = "CUSTOMIZE_FIELDS_SEQ")
......@@ -64,10 +64,180 @@ public class CustomizeFields implements Serializable {
@Column(name = "ACTIVE")
private Long active;
public CustomizeFields(@NotNull String type, @NotNull String title) {
public CustomizeFields() {
}
public CustomizeFields(String type, String title) {
// public CustomizeFields(@NotNull String type, @NotNull String title) {
this.type = type;
this.title = title;
}
public Long getCustomizeFieldId() {
return customizeFieldId;
}
public void setCustomizeFieldId(Long customizeFieldId) {
this.customizeFieldId = customizeFieldId;
}
public Long getSiteId() {
return siteId;
}
public void setSiteId(Long siteId) {
this.siteId = siteId;
}
public String getFunctionCode() {
return functionCode;
}
public void setFunctionCode(String functionCode) {
this.functionCode = functionCode;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public Long getStatus() {
return status;
}
public void setStatus(Long status) {
this.status = status;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getPlaceholder() {
return placeholder;
}
public void setPlaceholder(String placeholder) {
this.placeholder = placeholder;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Long getPosition() {
return position;
}
public void setPosition(Long position) {
this.position = position;
}
public Long getRequired() {
return required;
}
public void setRequired(Long required) {
this.required = required;
}
public Long getFieldOptionsId() {
return fieldOptionsId;
}
public void setFieldOptionsId(Long fieldOptionsId) {
this.fieldOptionsId = fieldOptionsId;
}
public String getRegexpForValidation() {
return regexpForValidation;
}
public void setRegexpForValidation(String regexpForValidation) {
this.regexpForValidation = regexpForValidation;
}
public Long getMaxLength() {
return maxLength;
}
public void setMaxLength(Long maxLength) {
this.maxLength = maxLength;
}
public Long getMinLength() {
return minLength;
}
public void setMinLength(Long minLength) {
this.minLength = minLength;
}
public Long getMin() {
return min;
}
public void setMin(Long min) {
this.min = min;
}
public Long getMax() {
return max;
}
public void setMax(Long max) {
this.max = max;
}
public Long getActive() {
return active;
}
public void setActive(Long active) {
this.active = active;
}
}
......@@ -67,7 +67,7 @@ public class CampaignCustomerListColumnRepositoryImpl implements CampaignCustome
data = query.list();
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
} finally {
session.close();
}
......
......@@ -66,7 +66,7 @@ public class CampaignCustomerRepositoryImpl implements CampaignCustomerRepositor
result = query.list();
} catch (Exception ex) {
ex.printStackTrace();
// ex.printStackTrace();
} finally {
session.close();
}
......
......@@ -579,7 +579,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
return result;
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return result;
......
......@@ -54,7 +54,7 @@ public class TicketRepositoryImpl implements TicketRepositoryCustom {
return lst;
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return lst;
......
......@@ -54,7 +54,7 @@ public class AgentsServiceImpl implements AgentsService {
result.setDescription("agents data null");
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return result;
......@@ -251,7 +251,7 @@ public class AgentsServiceImpl implements AgentsService {
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
......@@ -274,7 +274,7 @@ public class AgentsServiceImpl implements AgentsService {
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
......@@ -532,7 +532,7 @@ public class AgentsServiceImpl implements AgentsService {
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
......
......@@ -176,7 +176,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
resultDTO.setDescription("CompleteCodeDTO null");
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
......@@ -203,7 +203,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
resultDTO.setDescription("CompleteCodeDTO null");
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
......@@ -227,7 +227,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
......@@ -249,7 +249,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
}
......
......@@ -303,7 +303,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result.setErrorCode(Constants.ApiErrorCode.SUCCESS);
result.setDescription(Constants.ApiErrorDesc.SUCCESS);
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
result.setErrorCode(Constants.ApiErrorCode.ERROR);
result.setDescription(Constants.ApiErrorDesc.ERROR);
}
......@@ -475,7 +475,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result.setDescription(Constants.ApiErrorDesc.SUCCESS);
result.setData(rclResult);
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
result.setErrorCode(Constants.ApiErrorCode.ERROR);
result.setDescription(Constants.ApiErrorDesc.ERROR);
}
......@@ -529,7 +529,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result.setErrorCode(Constants.ApiErrorCode.SUCCESS);
result.setDescription(Constants.ApiErrorDesc.SUCCESS);
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
result.setErrorCode(Constants.ApiErrorCode.ERROR);
result.setDescription(Constants.ApiErrorDesc.ERROR);
}
......@@ -548,7 +548,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result.setDescription(Constants.ApiErrorDesc.SUCCESS);
result.setData(ccr);
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
result.setErrorCode(Constants.ApiErrorCode.ERROR);
result.setDescription(Constants.ApiErrorDesc.ERROR);
}
......@@ -569,7 +569,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result.setDescription(Constants.ApiErrorDesc.SUCCESS);
result.setData(ccr);
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
result.setErrorCode(Constants.ApiErrorCode.ERROR);
result.setDescription(Constants.ApiErrorDesc.ERROR);
}
......@@ -589,7 +589,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result.setDescription(Constants.ApiErrorDesc.SUCCESS);
result.setData(ccr);
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
result.setErrorCode(Constants.ApiErrorCode.ERROR);
result.setDescription(Constants.ApiErrorDesc.ERROR);
}
......@@ -615,7 +615,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result.setDescription(Constants.ApiErrorDesc.SUCCESS);
result.setData(resultUpdate);
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
result.setErrorCode(Constants.ApiErrorCode.ERROR);
result.setDescription(Constants.ApiErrorDesc.ERROR);
}
......@@ -715,7 +715,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
return lstTimeZone.getDialMode().toString();
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return "-1";
......
......@@ -32,8 +32,8 @@ import java.util.*;
public class CampaignServiceImpl implements CampaignService {
private static final Logger logger = LogManager.getLogger(CampaignServiceImpl.class);
public static String CAMPAIGN_TYPE = "CAMPAIGN_TYPE";
public static String CAMPAIGN_STATUS = "CAMPAIGN_STATUS";
public static final String CAMPAIGN_TYPE = "CAMPAIGN_TYPE";
public static final String CAMPAIGN_STATUS = "CAMPAIGN_STATUS";
@Autowired
CampaignRepository campaignRepository;
......
......@@ -377,7 +377,7 @@ public class CustomerServiceImpl implements CustomerService {
resultDTO.setDescription("customerDTO null");
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
......@@ -400,7 +400,7 @@ public class CustomerServiceImpl implements CustomerService {
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
......@@ -421,7 +421,7 @@ public class CustomerServiceImpl implements CustomerService {
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
}
......@@ -513,7 +513,7 @@ public class CustomerServiceImpl implements CustomerService {
}
} catch (Exception e) {
//logger.info(e.getMessage(), e);
e.printStackTrace();
// e.printStackTrace();
}
return new Date();
}
......@@ -698,7 +698,7 @@ public class CustomerServiceImpl implements CustomerService {
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
......@@ -725,7 +725,7 @@ public class CustomerServiceImpl implements CustomerService {
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
......@@ -753,7 +753,7 @@ public class CustomerServiceImpl implements CustomerService {
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return resultDTO;
}
......@@ -897,7 +897,7 @@ public class CustomerServiceImpl implements CustomerService {
result.setTotalRow(customerContactRepository.findByCustomerIdAndAndContactTypeAndContact(customer.getCustomerId(), customer.getContactType(), customer.getContact(), null).size());
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return result;
}
......@@ -920,7 +920,7 @@ public class CustomerServiceImpl implements CustomerService {
result.setDescription("campaign customer data null");
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
}
return result;
}
......@@ -1819,7 +1819,7 @@ public class CustomerServiceImpl implements CustomerService {
rootNode = new RSQLParser().parse(queryString);
query = rootNode.accept(visitor, entityManager);
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
throw new IllegalArgumentException(e.getMessage());
}
return query;
......
......@@ -114,7 +114,7 @@ public final class DateTimeUtil {
try {
expression = new CronExpression(cron);
} catch (ParseException e) {
e.printStackTrace();
// e.printStackTrace();
}
Date currentDate = new Date();
assert expression != null;
......
......@@ -2,19 +2,19 @@ package com.viettel.campaign.utils;
public enum SearchOperation {
EQUALITY, NEGATION, GREATER_THAN, LESS_THAN, LIKE, STARTS_WITH, ENDS_WITH, CONTAINS;
public static final String[] SIMPLE_OPERATION_SET = { ":", "!", ">", "<", "~" };
protected static final String[] SIMPLE_OPERATION_SET = { ":", "!", ">", "<", "~" };
public static final String OR_PREDICATE_FLAG = "'";
protected static final String OR_PREDICATE_FLAG = "'";
public static final String ZERO_OR_MORE_REGEX = "*";
protected static final String ZERO_OR_MORE_REGEX = "*";
public static final String OR_OPERATOR = "OR";
protected static final String OR_OPERATOR = "OR";
public static final String AND_OPERATOR = "AND";
protected static final String AND_OPERATOR = "AND";
public static final String LEFT_PARANTHESIS = "(";
protected static final String LEFT_PARANTHESIS = "(";
public static final String RIGHT_PARANTHESIS = ")";
protected static final String RIGHT_PARANTHESIS = ")";
public static SearchOperation getSimpleOperation(final char input) {
switch (input) {
......
......@@ -13,18 +13,18 @@ import java.util.Date;
@Getter
@Setter
public class ScenarioAnswerDTO implements Serializable {
public Long scenarioAnswerId;
public Long companySiteId;
public Long scenarioQuestionId;
public String code;
public String answer;
public Integer orderIndex;
public Short hasInput;
public Short status;
public Date createTime;
public Date deleteTime;
public Long mappingQuestionId;
public Long campaignId;
public String importQuestionCode;
public String mappingQuestionCode;
private Long scenarioAnswerId;
private Long companySiteId;
private Long scenarioQuestionId;
private String code;
private String answer;
private Integer orderIndex;
private Short hasInput;
private Short status;
private Date createTime;
private Date deleteTime;
private Long mappingQuestionId;
private Long campaignId;
private String importQuestionCode;
private String mappingQuestionCode;
}
......@@ -39,7 +39,7 @@ public class ScenarioAnswerController {
}
@RequestMapping(value = "/count-duplicate-code", method = RequestMethod.GET)
ResponseEntity<Integer> countDuplicateCode(@RequestParam String code, @RequestParam Long scenarioQuestionId, @RequestParam Long scenarioAnswerId) {
public ResponseEntity<Integer> countDuplicateCode(@RequestParam String code, @RequestParam Long scenarioQuestionId, @RequestParam Long scenarioAnswerId) {
Integer count = scenarioAnswerService.countDuplicateScenarioCode(code, scenarioQuestionId, scenarioAnswerId);
return new ResponseEntity<>(count, HttpStatus.OK);
}
......
......@@ -46,30 +46,30 @@ public class ScenarioController {
ScenarioService scenarioService;
@RequestMapping(value = "/findOneByCampaignIdAndCompanyId", method = RequestMethod.GET)
Scenario findOneByCampaignIdAndCompanyId(@RequestParam Long campaignId, @RequestParam Long companySiteId) {
public Scenario findOneByCampaignIdAndCompanyId(@RequestParam Long campaignId, @RequestParam Long companySiteId) {
return scenarioService.findScenarioByCampaignIdAndCompanySiteId(campaignId, companySiteId);
}
@RequestMapping(method = RequestMethod.PUT)
ResponseEntity<ResultDTO> update(@RequestBody ScenarioDTO scenario) {
public ResponseEntity<ResultDTO> update(@RequestBody ScenarioDTO scenario) {
ResultDTO resultDTO = scenarioService.update(scenario);
return new ResponseEntity<>(resultDTO, HttpStatus.OK);
}
@RequestMapping(value = "/sort-question-answer", method = RequestMethod.POST)
ResponseEntity<ResultDTO> sortQuestionAndAnswer(@RequestBody ScenarioDTO scenarioDTO) {
public ResponseEntity<ResultDTO> sortQuestionAndAnswer(@RequestBody ScenarioDTO scenarioDTO) {
ResultDTO resultDTO = scenarioService.sortQuestionAndAnswer(scenarioDTO);
return new ResponseEntity<>(resultDTO, HttpStatus.OK);
}
@RequestMapping(value = "/count-duplicate-code", method = RequestMethod.GET)
ResponseEntity<Integer> countDuplicateCode(@RequestParam String code, @RequestParam Long scenarioId, @RequestParam Long companySiteId) {
public ResponseEntity<Integer> countDuplicateCode(@RequestParam String code, @RequestParam Long scenarioId, @RequestParam Long companySiteId) {
Integer count = scenarioService.countDuplicateScenarioCode(companySiteId, code, scenarioId);
return new ResponseEntity<>(count, HttpStatus.OK);
}
@RequestMapping(value = "/saveContactQuestResult", method = RequestMethod.POST)
ResponseEntity<ResultDTO> saveContactQuestResult(@RequestBody ContactQuestResultDTO dto) {
public ResponseEntity<ResultDTO> saveContactQuestResult(@RequestBody ContactQuestResultDTO dto) {
ResultDTO resultDTO = scenarioService.saveContacQuestResult(dto);
return new ResponseEntity<>(resultDTO, HttpStatus.OK);
}
......
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