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