Commit 623d4956 authored by Vu Duy Anh's avatar Vu Duy Anh

anhvd fix bug

parent 7e6a4c2d
......@@ -40,7 +40,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
private static final Logger logger = LogManager.getLogger(CampaignRepositoryImpl.class);
@Autowired
@PersistenceContext( unitName= DataSourceQualify.JPA_UNIT_NAME_CCMS_FULL)
@PersistenceContext(unitName = DataSourceQualify.JPA_UNIT_NAME_CCMS_FULL)
EntityManager entityManager;
@Autowired
......@@ -121,7 +121,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
sb.append(" AND a.STATUS <> -1");
if (!DataUtil.isNullOrEmpty(requestDto.getCampaignCode())) {
if (!DataUtil.isNullOrEmpty(requestDto.getCampaignCode()) && !DataUtil.isNullOrEmpty(requestDto.getCampaignCode().trim())) {
sb.append(" AND a.CAMPAIGN_CODE IN (:p_code) ");
}
if (!DataUtil.isNullOrEmpty(requestDto.getCampaignName())) {
......@@ -164,7 +164,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
sb.append(" ORDER BY a.CREATE_TIME DESC ");
SQLQuery query = session.createSQLQuery(sb.toString());
if (!DataUtil.isNullOrEmpty(requestDto.getCampaignCode())) {
if (!DataUtil.isNullOrEmpty(requestDto.getCampaignCode()) && !DataUtil.isNullOrEmpty(requestDto.getCampaignCode().trim())) {
String[] lstCode = requestDto.getCampaignCode().trim().split(",");
query.setParameterList("p_code", lstCode);
}
......@@ -260,7 +260,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
result.setDescription(Constants.ApiErrorDesc.ERROR);
logger.error(ex.getMessage(), ex);
} finally {
if(null != session) {
if (null != session) {
session.close();
}
}
......@@ -350,7 +350,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
result.setErrorCode(Constants.ApiErrorCode.ERROR);
result.setDescription(Constants.ApiErrorDesc.ERROR);
} finally {
if(session != null) session.close();
if (session != null) session.close();
}
return result;
}
......@@ -381,8 +381,8 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
}
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
}finally {
if(session != null) session.close();
} finally {
if (session != null) session.close();
}
return null;
}
......@@ -514,7 +514,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
ResultDTO resultDTO = new ResultDTO();
try {
List<CustomerCustomDTO> list = dto.getCustomerCustomDTOList();
for (CustomerCustomDTO customerCustomDTO: list) {
for (CustomerCustomDTO customerCustomDTO : list) {
CampaignCustomer campaignCustomer = campaignCustomerRepository.findCampaignCustomerByCampaignCustomerId(customerCustomDTO.getCampaignCustomerId());
campaignCustomer.setStatus((short) 0);
campaignCustomer.setCallStatus(null);
......@@ -885,7 +885,6 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
}
@Override
@Transactional(DataSourceQualify.CCMS_FULL)
public ResultDTO getCampaignCustomerInformation(CampaignRequestDTO dto) {
......
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