Subversion Repositories SmartDukaan

Rev

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

Rev 27176 Rev 27365
Line 16... Line 16...
16
@Component
16
@Component
17
public class PostOfficeServiceImpl implements PostOfficeService {
17
public class PostOfficeServiceImpl implements PostOfficeService {
18
 
18
 
19
	@Autowired
19
	@Autowired
20
	private PostOfficeRepository postOfficeRepository;
20
	private PostOfficeRepository postOfficeRepository;
-
 
21
	private static final Map<Integer, String> pincodeCitiesMap = new HashMap<Integer, String>();
21
 
22
	
-
 
23
	static {
-
 
24
		pincodeCitiesMap.put(160104, "Ludhiana");
-
 
25
	}
22
	@Override
26
	@Override
23
	public Map<String, Object> getPOPincode(int pincode) {
27
	public Map<String, Object> getPOPincode(int pincode) {
24
		List<PostOffice> postOffices = postOfficeRepository.selectByPinCode(pincode);
28
		List<PostOffice> postOffices = postOfficeRepository.selectByPinCode(pincode);
25
		Set<String> cities = new HashSet<>();
29
		Set<String> cities = new HashSet<>();
-
 
30
		//Add custom pincodes to support the major cities;
-
 
31
		if(pincodeCitiesMap.containsKey(pincode)) {
-
 
32
			cities.add(pincodeCitiesMap.get(pincode));
-
 
33
		}
26
		Map<String, Object> map = new HashMap<>(3);
34
		Map<String, Object> map = new HashMap<>(3);
27
 
35
 
28
		map.put(ProfitMandiConstants.PIN_CODE, pincode);
36
		map.put(ProfitMandiConstants.PIN_CODE, pincode);
29
		for (PostOffice postOffice : postOffices) {
37
		for (PostOffice postOffice : postOffices) {
30
			String city = postOffice.getCity();
38
			String city = postOffice.getCity();