Subversion Repositories SmartDukaan

Rev

Rev 15233 | Rev 15272 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15233 Rev 15238
Line 19... Line 19...
19
 
19
 
20
	private String skuBundleId;
20
	private String skuBundleId;
21
	private String source_id;
21
	private String source_id;
22
	private String id;
22
	private String id;
23
	private String url;
23
	private String url;
24
	private String fetchLive;
-
 
25
 
24
 
26
	public String index(){
25
	public String index(){
27
		Gson gs = new Gson();
26
		Gson gs = new Gson();
28
		DtrClient dc = null;
27
		DtrClient dc = null;
29
		try {
28
		try {
30
			dc = new DtrClient();
29
			dc = new DtrClient();
31
			List<in.shop2020.model.v1.dtr.LivePricing> pricingObj = dc.getClient().getLatestPricing(Long.valueOf(skuBundleId), Long.valueOf(source_id));
30
			List<in.shop2020.model.v1.dtr.LivePricing> pricingObj = dc.getClient().getLatestPricing(Long.valueOf(skuBundleId), Long.valueOf(source_id));
32
			setResultJson(JSON.parse(gs.toJson(pricingObj)).toString());
31
			setResultJson(JSON.parse(gs.toJson(pricingObj)).toString());
33
			
32
			
34
		} catch (Exception e) {
33
		} catch (Exception e) {
35
			log.info(e);
34
			log.error("Error while get latest pricing",e);
36
		}
35
		}
37
		finally{
36
		finally{
38
			dc.closeConnection();
37
			dc.closeConnection();
39
		}
38
		}
40
		return "index";
39
		return "index";
Line 50... Line 49...
50
		UserMessagePojo ump = new UserMessagePojo();
49
		UserMessagePojo ump = new UserMessagePojo();
51
		ump.setMessage("");
50
		ump.setMessage("");
52
		ump.setResult(false);
51
		ump.setResult(false);
53
		try {
52
		try {
54
			dc = new DtrClient();
53
			dc = new DtrClient();
55
			if (Boolean.valueOf(fetchLive))
-
 
56
			dc.getClient().updateLatestPriceForItem(Long.valueOf(id));
54
			dc.getClient().updateLatestPriceForItem(Long.valueOf(id));
57
			if (Long.valueOf(source_id) == 3){
55
			if (Long.valueOf(source_id) == 3){
58
				SnapdealProductPageParserController spp = new SnapdealProductPageParserController();
56
				SnapdealProductPageParserController spp = new SnapdealProductPageParserController();
59
				spp.setUrl(url);
57
				spp.setUrl(url);
60
				setResultJson(spp.getColorMessage());
58
				setResultJson(spp.getColorMessage());
Line 102... Line 100...
102
 
100
 
103
	public void setUrl(String url) {
101
	public void setUrl(String url) {
104
		this.url = url;
102
		this.url = url;
105
	}
103
	}
106
	
104
	
107
	public void setFetchLive(String fetchLive) {
-
 
108
		this.fetchLive = fetchLive;
-
 
109
	}
-
 
110
 
-
 
111
	public String getFetchLive() {
-
 
112
		return fetchLive;
-
 
113
	}
-
 
114
 
105
 
115
	public static void main (String[] args){
106
	public static void main (String[] args){
116
		LivePricingController live = new LivePricingController();
107
		LivePricingController live = new LivePricingController();
117
		live.setId("84");
108
		live.setId("84");
118
		live.setUrl("aHR0cDovL20uc25hcGRlYWwuY29tL3Byb2R1Y3Qvc3BpY2UtYm9zcy1lbnRlcnRhaW5lci0zLW01NDA2LzEwNTA2ODk2MjM/c3VwYz1TREw3MDA0MzYzMTUmdXRtX3NvdXJjZT1hZmZfcHJvZyZ1dG1fY2FtcGFpZ249YWZ0cyZvZmZlcl9pZD0xNyZhZmZfaWQ9MTc5MTUmYWZmX3N1Yj1TSEEzMTQzMTY3NzM0NQ==");
109
		live.setUrl("aHR0cDovL20uc25hcGRlYWwuY29tL3Byb2R1Y3Qvc3BpY2UtYm9zcy1lbnRlcnRhaW5lci0zLW01NDA2LzEwNTA2ODk2MjM/c3VwYz1TREw3MDA0MzYzMTUmdXRtX3NvdXJjZT1hZmZfcHJvZyZ1dG1fY2FtcGFpZ249YWZ0cyZvZmZlcl9pZD0xNyZhZmZfaWQ9MTc5MTUmYWZmX3N1Yj1TSEEzMTQzMTY3NzM0NQ==");
119
		live.setSource_id("3");
110
		live.setSource_id("3");
120
		live.setFetchLive("false");
-
 
121
		live.latestPriceById();
111
		live.latestPriceById();
122
		System.out.println(live.getResultJson());
112
		System.out.println(live.getResultJson());
123
	}
113
	}
124
	
114
	
125
}
115
}