Subversion Repositories SmartDukaan

Rev

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

Rev 30610 Rev 30622
Line 1... Line 1...
1
package com.spice.profitmandi.web.controller;
1
package com.spice.profitmandi.web.controller;
2
 
2
 
3
import com.spice.profitmandi.common.solr.SolrService;
3
import java.time.LocalDateTime;
4
import com.spice.profitmandi.common.web.util.ResponseSender;
4
import java.util.List;
5
import com.spice.profitmandi.dao.entity.dtr.WebListing;
5
import java.util.Map;
6
import com.spice.profitmandi.dao.entity.dtr.WebOffer;
6
import java.util.Optional;
7
import com.spice.profitmandi.dao.entity.dtr.WebOfferProduct;
7
import java.util.stream.Collectors;
-
 
8
 
8
import com.spice.profitmandi.dao.repository.dtr.WebOfferProductRepository;
9
import javax.servlet.http.HttpServletRequest;
9
import com.spice.profitmandi.dao.repository.dtr.WebOfferRepository;
10
import javax.transaction.Transactional;
-
 
11
 
10
import org.apache.logging.log4j.LogManager;
12
import org.apache.logging.log4j.LogManager;
11
import org.apache.logging.log4j.Logger;
13
import org.apache.logging.log4j.Logger;
12
import org.json.JSONObject;
14
import org.json.JSONObject;
13
import org.springframework.beans.factory.annotation.Autowired;
15
import org.springframework.beans.factory.annotation.Autowired;
14
import org.springframework.stereotype.Controller;
16
import org.springframework.stereotype.Controller;
15
import org.springframework.ui.Model;
17
import org.springframework.ui.Model;
-
 
18
import org.springframework.web.bind.annotation.PathVariable;
16
import org.springframework.web.bind.annotation.*;
19
import org.springframework.web.bind.annotation.RequestBody;
-
 
20
import org.springframework.web.bind.annotation.RequestMapping;
-
 
21
import org.springframework.web.bind.annotation.RequestMethod;
-
 
22
import org.springframework.web.bind.annotation.RequestParam;
17
 
23
 
18
import javax.servlet.http.HttpServletRequest;
24
import com.spice.profitmandi.common.solr.SolrService;
19
import javax.transaction.Transactional;
25
import com.spice.profitmandi.common.web.util.ResponseSender;
20
import java.time.LocalDateTime;
26
import com.spice.profitmandi.dao.entity.dtr.WebOffer;
21
import java.util.List;
27
import com.spice.profitmandi.dao.entity.dtr.WebOfferProduct;
22
import java.util.Map;
-
 
23
import java.util.Optional;
28
import com.spice.profitmandi.dao.repository.dtr.WebOfferProductRepository;
24
import java.util.stream.Collectors;
29
import com.spice.profitmandi.dao.repository.dtr.WebOfferRepository;
25
 
30
 
26
@Controller
31
@Controller
27
@Transactional(rollbackOn = Throwable.class)
32
@Transactional(rollbackOn = Throwable.class)
28
public class WebOffersController {
33
public class WebOffersController {
29
 
34
 
Line 114... Line 119...
114
 
119
 
115
			webOffer.setStartDate(wo.getStartDate());
120
			webOffer.setStartDate(wo.getStartDate());
116
			webOffer.setEndDate(wo.getEndDate());
121
			webOffer.setEndDate(wo.getEndDate());
117
			webOffer.setDetailedText(wo.getDetailedText());
122
			webOffer.setDetailedText(wo.getDetailedText());
118
			webOffer.setTitle(wo.getTitle());
123
			webOffer.setTitle(wo.getTitle());
-
 
124
			webOfferRepository.persist(webOffer);
119
		}
125
		}
120
		return getOfferListing(request, model);
126
		return getOfferListing(request, model);
121
	}
127
	}
122
 
128
 
123
	@RequestMapping(value = "/web-offer/order/{webListingId}", method = RequestMethod.POST)
129
	@RequestMapping(value = "/web-offer/order/{webListingId}", method = RequestMethod.POST)