| Line 59... |
Line 59... |
| 59 |
private WebProductListingRepository webProductListingRepository;
|
59 |
private WebProductListingRepository webProductListingRepository;
|
| 60 |
|
60 |
|
| 61 |
@Value("${new.solr.url}")
|
61 |
@Value("${new.solr.url}")
|
| 62 |
private String solrUrl;
|
62 |
private String solrUrl;
|
| 63 |
|
63 |
|
| - |
|
64 |
@Value("${reportico.url}")
|
| - |
|
65 |
private String reporticoUrl;
|
| - |
|
66 |
|
| 64 |
private static final Logger logger = LogManager.getLogger(FofoSolr.class);
|
67 |
private static final Logger logger = LogManager.getLogger(FofoSolr.class);
|
| 65 |
|
68 |
|
| 66 |
private static final List<Integer> CATEGORY_MASTER = Arrays.asList(10006, 10010, 14202, 14203);
|
69 |
private static final List<Integer> CATEGORY_MASTER = Arrays.asList(10006, 10010, 14202, 14203);
|
| 67 |
|
70 |
|
| 68 |
String solrPath = "http://" + "172.105.58.16" + ":8984/solr/demo";
|
71 |
String solrPath = "http://" + solrUrl + ":8984/solr/demo";
|
| 69 |
String mongoHost = "localhost";
|
72 |
String mongoHost = "localhost";
|
| 70 |
SolrClient solr = new HttpSolrClient.Builder(solrPath).build();
|
73 |
SolrClient solr = new HttpSolrClient.Builder(solrPath).build();
|
| 71 |
|
74 |
|
| 72 |
private String getAvailabilityJSON() {
|
75 |
private String getAvailabilityJSON() {
|
| 73 |
String url = "http://172.105.58.16/reports/run.php?execute_mode=EXECUTE&xmlin=warehousecisnew.xml&project=FOCOR&project_password=focor&target_format=JSON";
|
76 |
String url = reporticoUrl + "?execute_mode=EXECUTE&xmlin=warehousecisnew.xml&project=FOCOR&project_password=focor&target_format=JSON";
|
| 74 |
return getUrlContent(url);
|
77 |
return getUrlContent(url);
|
| 75 |
}
|
78 |
}
|
| 76 |
|
79 |
|
| 77 |
private String getPendingPOJSON() {
|
80 |
private String getPendingPOJSON() {
|
| 78 |
String url = "http://172.105.58.16/reports/run.php?execute_mode=EXECUTE&xmlin=UnfulfilledPOItemsNew.xml&project=FOCOR&project_password=focor&target_format=JSON";
|
81 |
String url = reporticoUrl + "?execute_mode=EXECUTE&xmlin=UnfulfilledPOItemsNew.xml&project=FOCOR&project_password=focor&target_format=JSON";
|
| 79 |
return getUrlContent(url);
|
82 |
return getUrlContent(url);
|
| 80 |
}
|
83 |
}
|
| 81 |
|
84 |
|
| 82 |
private static String getUrlContent(String urlString) {
|
85 |
private static String getUrlContent(String urlString) {
|
| 83 |
BufferedReader reader = null;
|
86 |
BufferedReader reader = null;
|
| Line 101... |
Line 104... |
| 101 |
}
|
104 |
}
|
| 102 |
return null;
|
105 |
return null;
|
| 103 |
}
|
106 |
}
|
| 104 |
|
107 |
|
| 105 |
public JSONArray getAvailability() throws IOException, JSONException {
|
108 |
public JSONArray getAvailability() throws IOException, JSONException {
|
| 106 |
String url = "http://172.105.58.16/reports/run.php?execute_mode=EXECUTE&xmlin=warehousecisnew.xml&project=FOCOR&project_password=focor&target_format=JSON";
|
109 |
String url = reporticoUrl + "?execute_mode=EXECUTE&xmlin=warehousecisnew.xml&project=FOCOR&project_password=focor&target_format=JSON";
|
| 107 |
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
110 |
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
| 108 |
connection.setRequestProperty("Accept-Encoding", "gzip");
|
111 |
connection.setRequestProperty("Accept-Encoding", "gzip");
|
| 109 |
BufferedReader reader = null;
|
112 |
BufferedReader reader = null;
|
| 110 |
|
113 |
|
| 111 |
try {
|
114 |
try {
|
| Line 135... |
Line 138... |
| 135 |
}
|
138 |
}
|
| 136 |
}
|
139 |
}
|
| 137 |
}
|
140 |
}
|
| 138 |
|
141 |
|
| 139 |
public JSONArray getPendingPO() throws IOException, JSONException {
|
142 |
public JSONArray getPendingPO() throws IOException, JSONException {
|
| 140 |
String url = "http://172.105.58.16/reports/run.php?execute_mode=EXECUTE&xmlin=UnfulfilledPOItemsNew.xml&project=FOCOR&project_password=focor&target_format=JSON";
|
143 |
String url = reporticoUrl+"?execute_mode=EXECUTE&xmlin=UnfulfilledPOItemsNew.xml&project=FOCOR&project_password=focor&target_format=JSON";
|
| 141 |
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
144 |
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
| 142 |
connection.setRequestProperty("Accept-Encoding", "gzip");
|
145 |
connection.setRequestProperty("Accept-Encoding", "gzip");
|
| 143 |
BufferedReader reader = null;
|
146 |
BufferedReader reader = null;
|
| 144 |
|
147 |
|
| 145 |
try {
|
148 |
try {
|