| Line 118... |
Line 118... |
| 118 |
long userId = isUserLoggedIn ? userinfo.getUserId() : 0;
|
118 |
long userId = isUserLoggedIn ? userinfo.getUserId() : 0;
|
| 119 |
String email = request.getParameter("email");
|
119 |
String email = request.getParameter("email");
|
| 120 |
communicationType = Integer.parseInt(request
|
120 |
communicationType = Integer.parseInt(request
|
| 121 |
.getParameter("communication_type"));
|
121 |
.getParameter("communication_type"));
|
| 122 |
|
122 |
|
| 123 |
if (request.getParameter("order_id") != null) {
|
- |
|
| 124 |
orderId = Integer.parseInt(request.getParameter("order_id"));
|
- |
|
| 125 |
}
|
- |
|
| 126 |
|
- |
|
| 127 |
String awb = request.getParameter("awb");
|
- |
|
| 128 |
String product = request.getParameter("product");
|
- |
|
| 129 |
String subject = request.getParameter("subject");
|
- |
|
| 130 |
String message = request.getParameter("message");
|
- |
|
| 131 |
|
- |
|
| 132 |
UserContextService.Client userClient = (new UserClient())
|
- |
|
| 133 |
.getClient();
|
- |
|
| 134 |
|
- |
|
| 135 |
if (userClient.saveUserCommunication(userId, email,
|
- |
|
| 136 |
communicationType, orderId, awb, product, subject, message)) {
|
- |
|
| 137 |
log.info("User Communication saved successfully!");
|
- |
|
| 138 |
}
|
- |
|
| 139 |
|
- |
|
| 140 |
/*
|
- |
|
| 141 |
* We need to change status for the given order to
|
- |
|
| 142 |
* CANCELLATION_REQUEST_RECIEVED
|
- |
|
| 143 |
*/
|
- |
|
| 144 |
if(communicationType == 2) {
|
- |
|
| 145 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient =
|
- |
|
| 146 |
(new TransactionClient()).getClient();
|
- |
|
| 147 |
transactionClient.markOrderCancellationRequestReceived(orderId);
|
- |
|
| 148 |
}
|
- |
|
| 149 |
|
- |
|
| 150 |
TicketCategory ticketCategory = TicketCategory.findByValue((int) communicationType);
|
123 |
TicketCategory ticketCategory = TicketCategory.findByValue((int) communicationType);
|
| 151 |
|
124 |
|
| 152 |
// Validating ticket category to avoid cases where someone tries to programmatically
|
125 |
// Validating ticket category to avoid cases where someone tries to programmatically
|
| 153 |
// send requests to us with invalid communication types
|
126 |
// send requests to us with invalid communication types
|
| 154 |
if (ticketCategory != null) {
|
127 |
if (ticketCategory != null) {
|
| - |
|
128 |
if (request.getParameter("order_id") != null) {
|
| - |
|
129 |
orderId = Integer.parseInt(request.getParameter("order_id"));
|
| - |
|
130 |
}
|
| - |
|
131 |
|
| - |
|
132 |
String awb = request.getParameter("awb");
|
| - |
|
133 |
String product = request.getParameter("product");
|
| - |
|
134 |
String subject = request.getParameter("subject");
|
| - |
|
135 |
String message = request.getParameter("message");
|
| - |
|
136 |
|
| - |
|
137 |
UserContextService.Client userClient = (new UserClient()).getClient();
|
| - |
|
138 |
|
| - |
|
139 |
if (userClient.saveUserCommunication(userId, email,
|
| - |
|
140 |
communicationType, orderId, awb, product, subject, message)) {
|
| - |
|
141 |
log.info("User Communication saved successfully!");
|
| - |
|
142 |
}
|
| - |
|
143 |
|
| - |
|
144 |
/*
|
| - |
|
145 |
* We need to change status for the given order to
|
| - |
|
146 |
* CANCELLATION_REQUEST_RECIEVED
|
| - |
|
147 |
*/
|
| - |
|
148 |
if(communicationType == 2) {
|
| - |
|
149 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient =
|
| - |
|
150 |
(new TransactionClient()).getClient();
|
| - |
|
151 |
transactionClient.markOrderCancellationRequestReceived(orderId);
|
| - |
|
152 |
}
|
| - |
|
153 |
|
| 155 |
// We need to have tickets for all data communication!
|
154 |
// We need to have tickets for all data communication!
|
| 156 |
log.info("Creating ticket!");
|
155 |
log.info("Creating ticket!");
|
| 157 |
Client crmServiceClient = new CRMClient().getClient();
|
156 |
Client crmServiceClient = new CRMClient().getClient();
|
| 158 |
Ticket ticket = new Ticket();
|
157 |
Ticket ticket = new Ticket();
|
| 159 |
ticket.setAirwayBillNo(awb);
|
158 |
ticket.setAirwayBillNo(awb);
|