| Line 2125... |
Line 2125... |
| 2125 |
|
2125 |
|
| 2126 |
@Override
|
2126 |
@Override
|
| 2127 |
public void updateCustomerDetails(CustomCustomer customCustomer, String invoiceNumber) throws
|
2127 |
public void updateCustomerDetails(CustomCustomer customCustomer, String invoiceNumber) throws
|
| 2128 |
ProfitMandiBusinessException {
|
2128 |
ProfitMandiBusinessException {
|
| 2129 |
FofoOrder fofoOrder = fofoOrderRepository.selectByInvoiceNumber(invoiceNumber);
|
2129 |
FofoOrder fofoOrder = fofoOrderRepository.selectByInvoiceNumber(invoiceNumber);
|
| - |
|
2130 |
LOGGER.info("fofoOrder{}", fofoOrder);
|
| 2130 |
Customer customer = customerRepository.selectById(fofoOrder.getCustomerId());
|
2131 |
Customer customer = customerRepository.selectById(fofoOrder.getCustomerId());
|
| - |
|
2132 |
LOGGER.info("customer{}", customer);
|
| 2131 |
customer.setFirstName(customCustomer.getFirstName());
|
2133 |
customer.setFirstName(customCustomer.getFirstName());
|
| 2132 |
customer.setLastName(customCustomer.getLastName());
|
2134 |
customer.setLastName(customCustomer.getLastName());
|
| 2133 |
customer.setMobileNumber(customCustomer.getMobileNumber());
|
2135 |
customer.setMobileNumber(customCustomer.getMobileNumber());
|
| 2134 |
customer.setEmailId(customCustomer.getEmailId());
|
2136 |
customer.setEmailId(customCustomer.getEmailId());
|
| 2135 |
customerRepository.persist(customer);
|
2137 |
customerRepository.persist(customer);
|
| Line 2141... |
Line 2143... |
| 2141 |
isNullOrEmpty(customAddress.getLastName()) ||
|
2143 |
isNullOrEmpty(customAddress.getLastName()) ||
|
| 2142 |
isNullOrEmpty(customAddress.getLine1()) ||
|
2144 |
isNullOrEmpty(customAddress.getLine1()) ||
|
| 2143 |
isNullOrEmpty(customAddress.getCity()) ||
|
2145 |
isNullOrEmpty(customAddress.getCity()) ||
|
| 2144 |
isNullOrEmpty(customAddress.getPinCode()) ||
|
2146 |
isNullOrEmpty(customAddress.getPinCode()) ||
|
| 2145 |
isNullOrEmpty(customAddress.getState()) ||
|
2147 |
isNullOrEmpty(customAddress.getState()) ||
|
| 2146 |
isNullOrEmpty(customAddress.getCountry()) ||
|
2148 |
// isNullOrEmpty(customAddress.getCountry()) ||
|
| 2147 |
isNullOrEmpty(customAddress.getPhoneNumber())) {
|
2149 |
isNullOrEmpty(customAddress.getPhoneNumber())) {
|
| 2148 |
throw new IllegalArgumentException("Required customer address fields are missing.");
|
2150 |
throw new IllegalArgumentException("Required customer address fields are missing.");
|
| 2149 |
}
|
2151 |
}
|
| 2150 |
|
2152 |
|
| 2151 |
CustomerAddress customerAddress = new CustomerAddress();
|
2153 |
CustomerAddress customerAddress = new CustomerAddress();
|
| Line 2156... |
Line 2158... |
| 2156 |
customerAddress.setLine2(customAddress.getLine2());
|
2158 |
customerAddress.setLine2(customAddress.getLine2());
|
| 2157 |
customerAddress.setLandmark(customAddress.getLandmark());
|
2159 |
customerAddress.setLandmark(customAddress.getLandmark());
|
| 2158 |
customerAddress.setCity(customAddress.getCity());
|
2160 |
customerAddress.setCity(customAddress.getCity());
|
| 2159 |
customerAddress.setPinCode(customAddress.getPinCode());
|
2161 |
customerAddress.setPinCode(customAddress.getPinCode());
|
| 2160 |
customerAddress.setState(customAddress.getState());
|
2162 |
customerAddress.setState(customAddress.getState());
|
| 2161 |
customerAddress.setCountry(customAddress.getCountry());
|
2163 |
// customerAddress.setCountry(customAddress.getCountry());
|
| 2162 |
customerAddress.setPhoneNumber(customAddress.getPhoneNumber());
|
2164 |
customerAddress.setPhoneNumber(customAddress.getPhoneNumber());
|
| 2163 |
customerAddressRepository.persist(customerAddress);
|
2165 |
customerAddressRepository.persist(customerAddress);
|
| 2164 |
fofoOrder.setCustomerAddressId(customerAddress.getId());
|
2166 |
fofoOrder.setCustomerAddressId(customerAddress.getId());
|
| 2165 |
|
2167 |
|
| 2166 |
}
|
2168 |
}
|