Commit 07a95c14 authored by Tu Bach's avatar Tu Bach

no message

parent 7399e170
...@@ -106,17 +106,21 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -106,17 +106,21 @@ public class CustomerServiceImpl implements CustomerService {
@Transactional(DataSourceQualify.CCMS_FULL) @Transactional(DataSourceQualify.CCMS_FULL)
public ResultDTO getCustomerId(Long customerId) { public ResultDTO getCustomerId(Long customerId) {
ResultDTO resultDTO = new ResultDTO(); ResultDTO resultDTO = new ResultDTO();
List<CustomerContact> cc = new ArrayList<>();
Customer customer = customerRepository.findByCustomerId(customerId); try {
customer.setMobileNumber(customerContactRepository.getLastPhone(customerId, (short) 1, (short) 5, (short) 1).get(0).getContact()); Customer customer = customerRepository.findByCustomerId(customerId);
customer.setEmail(customerContactRepository.getLastEmail(customerId, (short) 1, (short) 2).get(0).getContact()); cc = customerContactRepository.getLastPhone(customerId, (short) 1, (short) 5, (short) 1);
customer.setMobileNumber(cc == null ? "" : cc.get(0).getContact());
cc = customerContactRepository.getLastEmail(customerId, (short) 1, (short) 2);
customer.setEmail(cc == null ? "" : cc.get(0).getContact());
if (customer != null) {
resultDTO.setErrorCode(Constants.ApiErrorCode.SUCCESS); resultDTO.setErrorCode(Constants.ApiErrorCode.SUCCESS);
resultDTO.setDescription("customer data"); resultDTO.setDescription("customer data");
//resultDTO.setListData(customer); //resultDTO.setListData(customer);
resultDTO.setData(customer); resultDTO.setData(customer);
} else { } catch (Exception e) {
LOGGER.error(e.getMessage(), e);
resultDTO.setErrorCode(Constants.ApiErrorCode.ERROR); resultDTO.setErrorCode(Constants.ApiErrorCode.ERROR);
resultDTO.setDescription("customer data null"); resultDTO.setDescription("customer data null");
} }
......
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