Subversion Repositories SmartDukaan

Rev

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

Rev 29738 Rev 31048
Line 1... Line 1...
1
package com.spice.profitmandi.web.controller;
1
package com.spice.profitmandi.web.controller;
2
 
2
 
3
import java.time.LocalDate;
-
 
4
import java.time.LocalDateTime;
-
 
5
import java.util.ArrayList;
-
 
6
import java.util.List;
-
 
7
import java.util.stream.Collectors;
-
 
8
 
-
 
9
import javax.servlet.http.HttpServletRequest;
-
 
10
 
-
 
11
import org.apache.logging.log4j.LogManager;
-
 
12
import org.apache.logging.log4j.Logger;
-
 
13
import org.springframework.beans.factory.annotation.Autowired;
-
 
14
import org.springframework.http.MediaType;
-
 
15
import org.springframework.http.ResponseEntity;
-
 
16
import org.springframework.stereotype.Controller;
-
 
17
import org.springframework.transaction.annotation.Transactional;
-
 
18
import org.springframework.util.StringUtils;
-
 
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;
-
 
23
 
-
 
24
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
25
import com.spice.profitmandi.common.model.CustomAddress;
4
import com.spice.profitmandi.common.model.CustomAddress;
26
import com.spice.profitmandi.common.model.CustomCustomer;
5
import com.spice.profitmandi.common.model.CustomCustomer;
27
import com.spice.profitmandi.common.model.ProfitMandiConstants;
6
import com.spice.profitmandi.common.model.ProfitMandiConstants;
28
import com.spice.profitmandi.common.solr.SolrService;
7
import com.spice.profitmandi.common.solr.SolrService;
29
import com.spice.profitmandi.common.web.util.ResponseSender;
8
import com.spice.profitmandi.common.web.util.ResponseSender;
30
import com.spice.profitmandi.dao.entity.catalog.CustomerOfferItem;
9
import com.spice.profitmandi.dao.entity.catalog.CustomerOfferItem;
31
import com.spice.profitmandi.dao.entity.catalog.Item;
10
import com.spice.profitmandi.dao.entity.catalog.Item;
32
import com.spice.profitmandi.dao.entity.fofo.Customer;
11
import com.spice.profitmandi.dao.entity.fofo.*;
33
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
-
 
34
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
-
 
35
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
-
 
36
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
-
 
37
import com.spice.profitmandi.dao.model.CustomerOrderDetail;
12
import com.spice.profitmandi.dao.model.CustomerOrderDetail;
38
import com.spice.profitmandi.dao.model.UserCart;
13
import com.spice.profitmandi.dao.model.UserCart;
39
import com.spice.profitmandi.dao.repository.catalog.CustomerOfferItemRepository;
14
import com.spice.profitmandi.dao.repository.catalog.CustomerOfferItemRepository;
40
import com.spice.profitmandi.dao.repository.catalog.CustomerOfferRepository;
15
import com.spice.profitmandi.dao.repository.catalog.CustomerOfferRepository;
41
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
16
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
42
import com.spice.profitmandi.dao.repository.catalog.SamsungUpgradeOfferRepository;
17
import com.spice.profitmandi.dao.repository.catalog.SamsungUpgradeOfferRepository;
43
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
18
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
44
import com.spice.profitmandi.dao.repository.fofo.CustomerAddressRepository;
-
 
45
import com.spice.profitmandi.dao.repository.fofo.CustomerRepository;
19
import com.spice.profitmandi.dao.repository.fofo.*;
46
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
-
 
47
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
-
 
48
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
-
 
49
import com.spice.profitmandi.service.CustomerService;
20
import com.spice.profitmandi.service.CustomerService;
50
import com.spice.profitmandi.service.inventory.InventoryService;
21
import com.spice.profitmandi.service.inventory.InventoryService;
51
 
-
 
52
import io.swagger.annotations.ApiImplicitParam;
22
import io.swagger.annotations.ApiImplicitParam;
53
import io.swagger.annotations.ApiImplicitParams;
23
import io.swagger.annotations.ApiImplicitParams;
-
 
24
import org.apache.logging.log4j.LogManager;
-
 
25
import org.apache.logging.log4j.Logger;
-
 
26
import org.springframework.beans.factory.annotation.Autowired;
-
 
27
import org.springframework.http.MediaType;
-
 
28
import org.springframework.http.ResponseEntity;
-
 
29
import org.springframework.stereotype.Controller;
-
 
30
import org.springframework.transaction.annotation.Transactional;
-
 
31
import org.springframework.util.StringUtils;
-
 
32
import org.springframework.web.bind.annotation.RequestBody;
-
 
33
import org.springframework.web.bind.annotation.RequestMapping;
-
 
34
import org.springframework.web.bind.annotation.RequestMethod;
-
 
35
import org.springframework.web.bind.annotation.RequestParam;
-
 
36
 
-
 
37
import javax.servlet.http.HttpServletRequest;
-
 
38
import java.time.LocalDate;
-
 
39
import java.time.LocalDateTime;
-
 
40
import java.util.ArrayList;
-
 
41
import java.util.List;
-
 
42
import java.util.stream.Collectors;
54
 
43
 
55
@Controller
44
@Controller
56
@Transactional(rollbackFor = Throwable.class)
45
@Transactional(rollbackFor = Throwable.class)
57
public class CustomerController {
46
public class CustomerController {
58
 
47
 
Line 261... Line 250...
261
						customerOrderDetail.setCancelledTimestamp(fo.getCancelledTimestamp());
250
						customerOrderDetail.setCancelledTimestamp(fo.getCancelledTimestamp());
262
						customerOrderDetail.setInsurance(false);
251
						customerOrderDetail.setInsurance(false);
263
 
252
 
264
						if (!serialNumber.isEmpty()) {
253
						if (!serialNumber.isEmpty()) {
265
 
254
 
266
							if (fo.getCreateTimestamp().toLocalDate().equals(LocalDate.now())
255
							if (fo.getCreateTimestamp().toLocalDate().plusDays(10).isBefore(LocalDate.now())
267
									&& item.getHsnCode().equals("85171290")) {
256
									&& item.getHsnCode().equals("85171290")) {
268
								customerOrderDetail.setInsurance(true);
257
								customerOrderDetail.setInsurance(true);
269
							} else {
258
							} else {
270
								customerOrderDetail.setInsurance(false);
259
								customerOrderDetail.setInsurance(false);
271
							}
260
							}