Subversion Repositories SmartDukaan

Rev

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

Rev 23043 Rev 23046
Line 108... Line 108...
108
		}
108
		}
109
		
109
		
110
		return map;
110
		return map;
111
	}
111
	}
112
	
112
	
113
	@Override
-
 
114
	public Map<String, Object> updateRetailerDocument(String emailIdOrMobileNumber, int documentId)
-
 
115
			throws ProfitMandiBusinessException {
-
 
116
		Map<String, Object> map = this.getByEmailIdOrMobileNumber(emailIdOrMobileNumber);
-
 
117
		Retailer retailer = (Retailer)map.get("retailer");
-
 
118
		retailer.setDocumentId(documentId);
-
 
119
		retailerRepository.persist(retailer);
-
 
120
		documentRepository.markDocumentAsPersisted(documentId);
-
 
121
		return map;
-
 
122
	}
-
 
123
	
-
 
124
	@SuppressWarnings("unchecked")
-
 
125
	@Override
-
 
126
	public Map<String, Object> updateRetailerShopDocument(String emailIdOrMobileNumber, int shopId, int documentId)
-
 
127
			throws ProfitMandiBusinessException {
-
 
128
		Map<String, Object> map = this.getByEmailIdOrMobileNumber(emailIdOrMobileNumber);
-
 
129
		List<Shop> shops = (List<Shop>)map.get("shops");
-
 
130
		Shop foundShop = null;
-
 
131
		for(Shop shop : shops){
-
 
132
			if(shop.getId() == shopId){
-
 
133
				foundShop = shop;
-
 
134
				break;
-
 
135
			}
-
 
136
		}
-
 
137
		if(foundShop != null){
-
 
138
			foundShop.setDocumentId(documentId);
-
 
139
			shopRepository.persist(foundShop);
-
 
140
			documentRepository.markDocumentAsPersisted(documentId);
-
 
141
		}
-
 
142
		return map;
-
 
143
		
-
 
144
	}
-
 
145
	
-
 
146
	@SuppressWarnings("unchecked")
113
	@SuppressWarnings("unchecked")
147
	@Override
114
	@Override
148
	public Map<String, Object> updateRetailerDetails(UpdateRetailerRequest updateRetailerRequest)
115
	public Map<String, Object> updateRetailerDetails(UpdateRetailerRequest updateRetailerRequest)
149
			throws ProfitMandiBusinessException {
116
			throws ProfitMandiBusinessException {
150
		Map<String, Object> map = this.getByEmailIdOrMobileNumber(updateRetailerRequest.getEmailIdOrMobileNumber());
117
		Map<String, Object> map = this.getByEmailIdOrMobileNumber(updateRetailerRequest.getEmailIdOrMobileNumber());