| Line 22... |
Line 22... |
| 22 |
import javax.mail.internet.MimeMessage;
|
22 |
import javax.mail.internet.MimeMessage;
|
| 23 |
import javax.mail.internet.MimeMultipart;
|
23 |
import javax.mail.internet.MimeMultipart;
|
| 24 |
|
24 |
|
| 25 |
import org.apache.commons.io.FileUtils;
|
25 |
import org.apache.commons.io.FileUtils;
|
| 26 |
import org.apache.commons.io.IOUtils;
|
26 |
import org.apache.commons.io.IOUtils;
|
| - |
|
27 |
import org.apache.commons.lang3.StringEscapeUtils;
|
| - |
|
28 |
import org.apache.commons.lang3.StringUtils;
|
| 27 |
import org.apache.http.client.utils.URIBuilder;
|
29 |
import org.apache.http.client.utils.URIBuilder;
|
| 28 |
import org.apache.logging.log4j.LogManager;
|
30 |
import org.apache.logging.log4j.LogManager;
|
| 29 |
import org.apache.logging.log4j.Logger;
|
31 |
import org.apache.logging.log4j.Logger;
|
| 30 |
import org.apache.thrift.TException;
|
32 |
import org.apache.thrift.TException;
|
| 31 |
import org.apache.thrift.transport.TTransportException;
|
33 |
import org.apache.thrift.transport.TTransportException;
|
| 32 |
import org.springframework.core.io.InputStreamSource;
|
34 |
import org.springframework.core.io.InputStreamSource;
|
| 33 |
import org.springframework.mail.javamail.JavaMailSender;
|
35 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 34 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
36 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
| 35 |
|
37 |
|
| - |
|
38 |
import com.google.gson.Gson;
|
| 36 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
39 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 37 |
import com.spice.profitmandi.common.model.GstRate;
|
40 |
import com.spice.profitmandi.common.model.GstRate;
|
| 38 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
41 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 39 |
import com.spice.profitmandi.thrift.clients.CatalogClient;
|
42 |
import com.spice.profitmandi.thrift.clients.CatalogClient;
|
| 40 |
import com.spice.profitmandi.thrift.clients.InventoryClient;
|
43 |
import com.spice.profitmandi.thrift.clients.InventoryClient;
|
| Line 63... |
Line 66... |
| 63 |
|
66 |
|
| 64 |
private static final Logger logger = LogManager.getLogger(Utils.class);
|
67 |
private static final Logger logger = LogManager.getLogger(Utils.class);
|
| 65 |
public static final String EXPORT_ENTITIES_PATH = getExportPath();
|
68 |
public static final String EXPORT_ENTITIES_PATH = getExportPath();
|
| 66 |
public static final String PRODUCT_PROPERTIES_SNIPPET = "ProductPropertiesSnippet.html";
|
69 |
public static final String PRODUCT_PROPERTIES_SNIPPET = "ProductPropertiesSnippet.html";
|
| 67 |
public static final String DOCUMENT_STORE = "/profitmandi/documents/";
|
70 |
public static final String DOCUMENT_STORE = "/profitmandi/documents/";
|
| - |
|
71 |
private Gson gson = new Gson();
|
| 68 |
private static final Map<Integer, String> helpMap = new HashMap<>(6);
|
72 |
private static final Map<Integer, String> helpMap = new HashMap<>(6);
|
| 69 |
private static final Map<Integer, String> dthIdAliasMap = new HashMap<>(7);
|
73 |
private static final Map<Integer, String> dthIdAliasMap = new HashMap<>(7);
|
| 70 |
private static Map<Long, List<RechargePlan>> operatorPlanMap = new HashMap<>(20);
|
74 |
private static Map<Long, List<RechargePlan>> operatorPlanMap = new HashMap<>(20);
|
| 71 |
private static Map<Long, String> mobileProvidersMap;
|
75 |
private static Map<Long, String> mobileProvidersMap;
|
| 72 |
private static Map<Long, String> dthProvidersMap;
|
76 |
private static Map<Long, String> dthProvidersMap;
|
| Line 590... |
Line 594... |
| 590 |
}
|
594 |
}
|
| 591 |
message.setContent(mp);
|
595 |
message.setContent(mp);
|
| 592 |
mailSender.send(message);
|
596 |
mailSender.send(message);
|
| 593 |
|
597 |
|
| 594 |
}
|
598 |
}
|
| - |
|
599 |
|
| - |
|
600 |
public String htmlJson(Object object) {
|
| - |
|
601 |
return StringEscapeUtils.escapeHtml4(gson.toJson(object));
|
| - |
|
602 |
}
|
| 595 |
|
603 |
|
| 596 |
}
|
604 |
}
|