| Line 47... |
Line 47... |
| 47 |
import com.spice.profitmandi.common.model.UserInfo;
|
47 |
import com.spice.profitmandi.common.model.UserInfo;
|
| 48 |
import com.spice.profitmandi.common.util.JWTUtil;
|
48 |
import com.spice.profitmandi.common.util.JWTUtil;
|
| 49 |
import com.spice.profitmandi.common.web.client.RestClient;
|
49 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| 50 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
50 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 51 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
51 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| - |
|
52 |
import com.spice.profitmandi.dao.entity.catalog.FocusedModelByPassRequest;
|
| 52 |
import com.spice.profitmandi.dao.entity.dtr.MobileAppSetting;
|
53 |
import com.spice.profitmandi.dao.entity.dtr.MobileAppSetting;
|
| 53 |
import com.spice.profitmandi.dao.entity.dtr.Retailer;
|
54 |
import com.spice.profitmandi.dao.entity.dtr.Retailer;
|
| 54 |
import com.spice.profitmandi.dao.entity.dtr.Role;
|
55 |
import com.spice.profitmandi.dao.entity.dtr.Role;
|
| 55 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
56 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 56 |
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
|
57 |
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
|
| Line 59... |
Line 60... |
| 59 |
import com.spice.profitmandi.dao.entity.fofo.PartnerOnBoardingPanel;
|
60 |
import com.spice.profitmandi.dao.entity.fofo.PartnerOnBoardingPanel;
|
| 60 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
61 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| 61 |
import com.spice.profitmandi.dao.entity.user.Address;
|
62 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 62 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
63 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
| 63 |
import com.spice.profitmandi.dao.entity.user.Refferal;
|
64 |
import com.spice.profitmandi.dao.entity.user.Refferal;
|
| - |
|
65 |
import com.spice.profitmandi.dao.enumuration.catalog.ByPassRequestStatus;
|
| 64 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
66 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| 65 |
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
|
67 |
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
|
| 66 |
import com.spice.profitmandi.dao.enumuration.dtr.StoreTimeline;
|
68 |
import com.spice.profitmandi.dao.enumuration.dtr.StoreTimeline;
|
| 67 |
import com.spice.profitmandi.dao.model.CreateRefferalRequest;
|
69 |
import com.spice.profitmandi.dao.model.CreateRefferalRequest;
|
| 68 |
import com.spice.profitmandi.dao.model.DateRangeModel;
|
70 |
import com.spice.profitmandi.dao.model.DateRangeModel;
|
| Line 133... |
Line 135... |
| 133 |
private RetailerRepository retailerRepository;
|
135 |
private RetailerRepository retailerRepository;
|
| 134 |
|
136 |
|
| 135 |
@Autowired
|
137 |
@Autowired
|
| 136 |
private UserRoleRepository userRoleRepository;
|
138 |
private UserRoleRepository userRoleRepository;
|
| 137 |
|
139 |
|
| 138 |
@Autowired
|
140 |
@Autowired
|
| 139 |
private PartnerTypeChangeService partnerTypeChangeService;
|
141 |
private PartnerTypeChangeService partnerTypeChangeService;
|
| 140 |
|
142 |
|
| 141 |
@Autowired
|
143 |
@Autowired
|
| 142 |
private UserAccountRepository userAccountRepository;
|
144 |
private UserAccountRepository userAccountRepository;
|
| 143 |
|
145 |
|
| Line 822... |
Line 824... |
| 822 |
rfm.setMinimumEarning(confirmedRefferalValue * 5000);
|
824 |
rfm.setMinimumEarning(confirmedRefferalValue * 5000);
|
| 823 |
|
825 |
|
| 824 |
return rfm;
|
826 |
return rfm;
|
| 825 |
}
|
827 |
}
|
| 826 |
|
828 |
|
| - |
|
829 |
@RequestMapping(value = "/user/getReferals", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| - |
|
830 |
@ApiImplicitParams({
|
| - |
|
831 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| - |
|
832 |
public ResponseEntity<?> getReferals(HttpServletRequest request, @RequestParam RefferalStatus status)
|
| - |
|
833 |
throws Exception {
|
| - |
|
834 |
int userId = (int) request.getAttribute("userId");
|
| - |
|
835 |
|
| - |
|
836 |
User user = userRepository.selectById(userId);
|
| - |
|
837 |
UserCart uc = userAccountRepository.getUserCart(userId);
|
| - |
|
838 |
|
| - |
|
839 |
List<Refferal> refferals = refferalRepository.selectByEmailIdAndStatus(user.getEmailId(), status);
|
| - |
|
840 |
return responseSender.ok(refferals);
|
| - |
|
841 |
}
|
| - |
|
842 |
|
| 827 |
@RequestMapping(value = "/user/partnerTarget", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
843 |
@RequestMapping(value = "/user/partnerTarget", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 828 |
@ApiImplicitParams({
|
844 |
@ApiImplicitParams({
|
| 829 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
845 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 830 |
public ResponseEntity<?> PartnerTarget(HttpServletRequest request) throws Exception {
|
846 |
public ResponseEntity<?> PartnerTarget(HttpServletRequest request) throws Exception {
|
| 831 |
int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
|
847 |
int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
|