Subversion Repositories SmartDukaan

Rev

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

Rev 22215 Rev 22893
Line 3... Line 3...
3
import java.util.HashMap;
3
import java.util.HashMap;
4
import java.util.Map;
4
import java.util.Map;
5
 
5
 
6
import com.spice.profitmandi.common.enumuration.SchemeType;
6
import com.spice.profitmandi.common.enumuration.SchemeType;
7
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
7
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
-
 
8
import com.spice.profitmandi.common.model.GadgetCopsDocumentInsuranceModel;
8
import com.spice.profitmandi.common.model.GadgetCopsInsuranceModel;
9
import com.spice.profitmandi.common.model.GadgetCopsInsuranceModel;
9
import com.spice.profitmandi.common.web.client.RestClient;
10
import com.spice.profitmandi.common.web.client.RestClient;
10
 
11
 
11
public class InsuranceUtils {
12
public class InsuranceUtils {
12
	
13
	
Line 35... Line 36...
35
		//RestClient rc = new RestClient(SchemeType.HTTP, "www.google.com", 8080);
36
		//RestClient rc = new RestClient(SchemeType.HTTP, "www.google.com", 8080);
36
		RestClient restClient = new RestClient(SchemeType.HTTP, HOST_NAME, 80);
37
		RestClient restClient = new RestClient(SchemeType.HTTP, HOST_NAME, 80);
37
		
38
		
38
		Map<String, String> params = new HashMap<>(18);
39
		Map<String, String> params = new HashMap<>(18);
39
		//params.put(OP, REGISTER_POLICY);
40
		//params.put(OP, REGISTER_POLICY);
-
 
41
		params.put(MOBILE_BRAND, gadgetCopsInsuranceModel.getBrand());
-
 
42
		params.put(MOBILE_MODEL, gadgetCopsInsuranceModel.getModelName());
-
 
43
		params.put(MOBILE_IMEI, gadgetCopsInsuranceModel.getSerialNumber());
-
 
44
		params.put(CUS_FIRST_NAME, gadgetCopsInsuranceModel.getCustomerFirstName());
-
 
45
		params.put(CUS_LAST_NAME, gadgetCopsInsuranceModel.getCustomerLastName());
-
 
46
		params.put(CUS_CONTACT_NUMBER, gadgetCopsInsuranceModel.getCustomerMobileNumber());
-
 
47
		params.put(CUS_EMAIL, gadgetCopsInsuranceModel.getCustomerEmailId());
-
 
48
		params.put(CUS_DOB, StringUtils.toString(gadgetCopsInsuranceModel.getCustomerDateOfBirth()));
-
 
49
		params.put(CUS_ADDRESS1, gadgetCopsInsuranceModel.getCustomerAddress1());
-
 
50
		params.put(CUS_ADDRESS2, gadgetCopsInsuranceModel.getCustomerAddress2());
-
 
51
		params.put(CUS_CITY, gadgetCopsInsuranceModel.getCustomerCity());
-
 
52
		params.put(CUS_STATE, gadgetCopsInsuranceModel.getCustomerState());
-
 
53
		params.put(CUS_ZIP, gadgetCopsInsuranceModel.getCustomerPinCode());
-
 
54
		params.put(TRANSACTION_DATE, StringUtils.toString(gadgetCopsInsuranceModel.getInvoiceCreationDate()));
-
 
55
		params.put(TRANSACTION_INVOICE_VALUE, String.valueOf(gadgetCopsInsuranceModel.getPrice()));
-
 
56
		params.put(TRANSACTION_INVOICE_NUMBER, gadgetCopsInsuranceModel.getInvoiceNumber());
-
 
57
		params.put(TRANSACTION_POLICY_NUMBER, gadgetCopsInsuranceModel.getPolicyNumber());
-
 
58
		
-
 
59
		Map<String, String> headers = new HashMap<>(0);
-
 
60
		//headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
-
 
61
		
-
 
62
		restClient.post(URI, params, headers);
-
 
63
	}
-
 
64
	
-
 
65
	public static void submitToGadgetCops(GadgetCopsDocumentInsuranceModel gadgetCopsInsuranceModel) throws ProfitMandiBusinessException{
-
 
66
		//RestClient rc = new RestClient(SchemeType.HTTP, "www.google.com", 8080);
-
 
67
		RestClient restClient = new RestClient(SchemeType.HTTP, HOST_NAME, 80);
-
 
68
		
-
 
69
		Map<String, String> params = new HashMap<>(18);
-
 
70
		//params.put(OP, REGISTER_POLICY);
40
		params.put(MOBILE_BRAND, gadgetCopsInsuranceModel.getBrand());
71
		params.put(MOBILE_BRAND, gadgetCopsInsuranceModel.getBrand());
41
		params.put(MOBILE_MODEL, gadgetCopsInsuranceModel.getModelName());
72
		params.put(MOBILE_MODEL, gadgetCopsInsuranceModel.getModelName());
42
		params.put(MOBILE_IMEI, gadgetCopsInsuranceModel.getSerialNumber());
73
		params.put(MOBILE_IMEI, gadgetCopsInsuranceModel.getSerialNumber());
43
		params.put(CUS_FIRST_NAME, gadgetCopsInsuranceModel.getCustomerFirstName());
74
		params.put(CUS_FIRST_NAME, gadgetCopsInsuranceModel.getCustomerFirstName());
44
		params.put(CUS_LAST_NAME, gadgetCopsInsuranceModel.getCustomerLastName());
75
		params.put(CUS_LAST_NAME, gadgetCopsInsuranceModel.getCustomerLastName());