| Line 62... |
Line 62... |
| 62 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
62 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 63 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
63 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 64 |
import com.spice.profitmandi.dao.entity.fofo.LiveDemoSerialNumber;
|
64 |
import com.spice.profitmandi.dao.entity.fofo.LiveDemoSerialNumber;
|
| 65 |
import com.spice.profitmandi.dao.entity.transaction.NotifyColorChange;
|
65 |
import com.spice.profitmandi.dao.entity.transaction.NotifyColorChange;
|
| 66 |
import com.spice.profitmandi.dao.entity.transaction.NotifyItem;
|
66 |
import com.spice.profitmandi.dao.entity.transaction.NotifyItem;
|
| - |
|
67 |
import com.spice.profitmandi.dao.entity.transaction.NotifyMessage;
|
| 67 |
import com.spice.profitmandi.dao.entity.transaction.NotifyOrder;
|
68 |
import com.spice.profitmandi.dao.entity.transaction.NotifyOrder;
|
| 68 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
69 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 69 |
import com.spice.profitmandi.dao.entity.user.User;
|
70 |
import com.spice.profitmandi.dao.entity.user.User;
|
| 70 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
71 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 71 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
72 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| Line 77... |
Line 78... |
| 77 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
78 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| 78 |
import com.spice.profitmandi.dao.repository.fofo.LiveDemoBillingRespository;
|
79 |
import com.spice.profitmandi.dao.repository.fofo.LiveDemoBillingRespository;
|
| 79 |
import com.spice.profitmandi.dao.repository.inventory.NotifyStatus;
|
80 |
import com.spice.profitmandi.dao.repository.inventory.NotifyStatus;
|
| 80 |
import com.spice.profitmandi.dao.repository.transaction.NotifyColorChangeRepository;
|
81 |
import com.spice.profitmandi.dao.repository.transaction.NotifyColorChangeRepository;
|
| 81 |
import com.spice.profitmandi.dao.repository.transaction.NotifyItemRepository;
|
82 |
import com.spice.profitmandi.dao.repository.transaction.NotifyItemRepository;
|
| - |
|
83 |
import com.spice.profitmandi.dao.repository.transaction.NotifyMessageRepository;
|
| 82 |
import com.spice.profitmandi.dao.repository.transaction.NotifyOrderRespository;
|
84 |
import com.spice.profitmandi.dao.repository.transaction.NotifyOrderRespository;
|
| 83 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
85 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 84 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
86 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 85 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
87 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 86 |
import com.spice.profitmandi.service.user.RetailerService;
|
88 |
import com.spice.profitmandi.service.user.RetailerService;
|
| Line 147... |
Line 149... |
| 147 |
|
149 |
|
| 148 |
@Autowired
|
150 |
@Autowired
|
| 149 |
private NotifyOrderRespository notifyOrderRespository;
|
151 |
private NotifyOrderRespository notifyOrderRespository;
|
| 150 |
|
152 |
|
| 151 |
@Autowired
|
153 |
@Autowired
|
| - |
|
154 |
private NotifyMessageRepository notifyMessageRepository;
|
| - |
|
155 |
|
| - |
|
156 |
@Autowired
|
| 152 |
private UserAccountRepository userAccountRepository;
|
157 |
private UserAccountRepository userAccountRepository;
|
| 153 |
|
158 |
|
| 154 |
@Value("${saholic.api.host}")
|
159 |
@Value("${saholic.api.host}")
|
| 155 |
private String host;
|
160 |
private String host;
|
| 156 |
|
161 |
|
| Line 696... |
Line 701... |
| 696 |
List<Integer> orderIds = new ArrayList<>();
|
701 |
List<Integer> orderIds = new ArrayList<>();
|
| 697 |
|
702 |
|
| 698 |
NotifyColorChange notifytimestamp = new NotifyColorChange();
|
703 |
NotifyColorChange notifytimestamp = new NotifyColorChange();
|
| 699 |
notifytimestamp.setCreated(LocalDateTime.now());
|
704 |
notifytimestamp.setCreated(LocalDateTime.now());
|
| 700 |
notifyColorChangeRepository.persist(notifytimestamp);
|
705 |
notifyColorChangeRepository.persist(notifytimestamp);
|
| - |
|
706 |
NotifyMessage notifyMessage = new NotifyMessage();
|
| - |
|
707 |
notifyMessage.setNotifyId(notifytimestamp.getId());
|
| - |
|
708 |
notifyMessage.setNotifyMessages(notifyOrderModel.getMessage());
|
| - |
|
709 |
notifyMessageRepository.persist(notifyMessage);
|
| 701 |
for (NotifyItemIdModel itemid : notifyOrderModel.getItemIds()) {
|
710 |
for (NotifyItemIdModel itemid : notifyOrderModel.getItemIds()) {
|
| 702 |
|
711 |
|
| 703 |
notifyItem = new com.spice.profitmandi.dao.entity.transaction.NotifyItem();
|
712 |
notifyItem = new com.spice.profitmandi.dao.entity.transaction.NotifyItem();
|
| 704 |
notifyItem.setItemId(itemid.getItemId());
|
713 |
notifyItem.setItemId(itemid.getItemId());
|
| 705 |
notifyItem.setResponseTime(itemid.getResponseTime());
|
714 |
notifyItem.setResponseTime(itemid.getResponseTime());
|
| Line 733... |
Line 742... |
| 733 |
|
742 |
|
| 734 |
LOGGER.info("orderIds" + orderIds);
|
743 |
LOGGER.info("orderIds" + orderIds);
|
| 735 |
List<Order> orders = orderRepository.selectByOrderIds(orderIds);
|
744 |
List<Order> orders = orderRepository.selectByOrderIds(orderIds);
|
| 736 |
for (Order order : orders) {
|
745 |
for (Order order : orders) {
|
| 737 |
LOGGER.info("order" + order.getId());
|
746 |
LOGGER.info("order" + order.getId());
|
| 738 |
Item item = itemRepository.selectById(order.getLineItem().getItemId());
|
- |
|
| 739 |
List<String> color = new ArrayList<>();
|
- |
|
| 740 |
for (NotifyItemIdModel itemid : notifyOrderModel.getItemIds()) {
|
- |
|
| 741 |
Item newItem = itemRepository.selectById(itemid.getItemId());
|
- |
|
| 742 |
color.add(newItem.getColor());
|
- |
|
| 743 |
}
|
747 |
|
| 744 |
|
- |
|
| 745 |
LOGGER.info("message" + item.getItemDescriptionNoColor() + "/" + item.getColor()
|
748 |
NotifyMessage message = notifyMessageRepository.selectByNotifyId(notifytimestamp.getId());
|
| 746 |
+ "is currently not in stock with Brand/ND. The current availability is in" + color);
|
- |
|
| 747 |
|
749 |
|
| - |
|
750 |
//LOGGER.info("message112" + message.getNotifyMessages());
|
| - |
|
751 |
|
| 748 |
NotificationCampaigns notification = new NotificationCampaigns();
|
752 |
NotificationCampaigns notification = new NotificationCampaigns();
|
| 749 |
notification.setName("Notify Partner");
|
753 |
notification.setName("Notify Partner");
|
| 750 |
|
754 |
|
| 751 |
notification.setTitle("Notify Partner");
|
755 |
notification.setTitle("Notify Partner");
|
| 752 |
|
756 |
|
| 753 |
notification.setMessage(item.getItemDescriptionNoColor() + "/" + item.getColor()
|
757 |
notification.setMessage(message.getNotifyMessages());
|
| 754 |
+ "is currently not in stock with Brand/ND. The current availability is in" + color);
|
- |
|
| 755 |
notification.setType("url");
|
758 |
notification.setType("url");
|
| 756 |
notification.setUrl("http://app.profitmandi.com/pages/home/notifyOrder");
|
759 |
notification.setUrl("http://app.profitmandi.com/pages/home/notifyOrder");
|
| 757 |
|
760 |
|
| 758 |
notification.setSql("SELECT distinct d1.user_id from devices d1 left join devices d2 on"
|
761 |
notification.setSql("SELECT distinct d1.user_id from devices d1 left join devices d2 on"
|
| 759 |
+ "(d1.imeinumber = d2.imeinumber and d1.created < d2.created) "
|
762 |
+ "(d1.imeinumber = d2.imeinumber and d1.created < d2.created) "
|