| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.controller;
|
1 |
package com.spice.profitmandi.web.controller;
|
| 2 |
|
2 |
|
| 3 |
import java.util.List;
|
3 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| - |
|
4 |
import com.spice.profitmandi.common.model.SendMessageModel;
|
| 4 |
import java.util.Map;
|
5 |
import com.spice.profitmandi.common.util.Utils;
|
| - |
|
6 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 5 |
import java.util.stream.Collectors;
|
7 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 6 |
|
- |
|
| 7 |
import javax.servlet.http.HttpServletRequest;
|
8 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
| 8 |
|
- |
|
| 9 |
import org.apache.logging.log4j.LogManager;
|
9 |
import org.apache.logging.log4j.LogManager;
|
| 10 |
import org.apache.logging.log4j.Logger;
|
10 |
import org.apache.logging.log4j.Logger;
|
| 11 |
import org.springframework.beans.factory.annotation.Autowired;
|
11 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 12 |
import org.springframework.stereotype.Controller;
|
12 |
import org.springframework.stereotype.Controller;
|
| 13 |
import org.springframework.transaction.annotation.Transactional;
|
13 |
import org.springframework.transaction.annotation.Transactional;
|
| 14 |
import org.springframework.ui.Model;
|
14 |
import org.springframework.ui.Model;
|
| 15 |
import org.springframework.web.bind.annotation.RequestBody;
|
15 |
import org.springframework.web.bind.annotation.RequestBody;
|
| 16 |
import org.springframework.web.bind.annotation.RequestMapping;
|
16 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 17 |
import org.springframework.web.bind.annotation.RequestMethod;
|
17 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 18 |
|
18 |
|
| 19 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
19 |
import javax.servlet.http.HttpServletRequest;
|
| 20 |
import com.spice.profitmandi.common.model.SendMessageModel;
|
- |
|
| 21 |
import com.spice.profitmandi.common.util.Utils;
|
20 |
import java.util.List;
|
| 22 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
- |
|
| 23 |
import com.spice.profitmandi.service.user.RetailerService;
|
21 |
import java.util.Map;
|
| 24 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
22 |
import java.util.stream.Collectors;
|
| 25 |
|
23 |
|
| 26 |
@Controller
|
24 |
@Controller
|
| 27 |
@Transactional(rollbackFor = Throwable.class)
|
25 |
@Transactional(rollbackFor = Throwable.class)
|
| 28 |
public class MessageController {
|
26 |
public class MessageController {
|
| 29 |
|
27 |
|
| Line 69... |
Line 67... |
| 69 |
CustomRetailer customRetailer = customRetailersMap.get(retailerId);
|
67 |
CustomRetailer customRetailer = customRetailersMap.get(retailerId);
|
| 70 |
String phone = customRetailer.getMobileNumber();
|
68 |
String phone = customRetailer.getMobileNumber();
|
| 71 |
String msg = java.text.MessageFormat.format("{0}", sendMessageModel.getMessageText());
|
69 |
String msg = java.text.MessageFormat.format("{0}", sendMessageModel.getMessageText());
|
| 72 |
Utils.sendSms(msg, phone);
|
70 |
Utils.sendSms(msg, phone);
|
| 73 |
}
|
71 |
}
|
| 74 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
72 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 75 |
return "response";
|
73 |
return "response";
|
| 76 |
}
|
74 |
}
|
| 77 |
|
75 |
|
| 78 |
}
|
76 |
}
|