Subversion Repositories SmartDukaan

Rev

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

Rev 25619 Rev 25622
Line 43... Line 43...
43
import com.spice.profitmandi.dao.entity.dtr.Retailer;
43
import com.spice.profitmandi.dao.entity.dtr.Retailer;
44
import com.spice.profitmandi.dao.entity.dtr.Role;
44
import com.spice.profitmandi.dao.entity.dtr.Role;
45
import com.spice.profitmandi.dao.entity.dtr.User;
45
import com.spice.profitmandi.dao.entity.dtr.User;
46
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
46
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
47
import com.spice.profitmandi.dao.entity.dtr.UserRole;
47
import com.spice.profitmandi.dao.entity.dtr.UserRole;
-
 
48
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
48
import com.spice.profitmandi.dao.entity.user.Address;
49
import com.spice.profitmandi.dao.entity.user.Address;
49
import com.spice.profitmandi.dao.entity.user.Promoter;
50
import com.spice.profitmandi.dao.entity.user.Promoter;
50
import com.spice.profitmandi.dao.entity.user.Refferal;
51
import com.spice.profitmandi.dao.entity.user.Refferal;
51
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
52
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
52
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
53
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
Line 58... Line 59...
58
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
59
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
59
import com.spice.profitmandi.dao.repository.dtr.RoleRepository;
60
import com.spice.profitmandi.dao.repository.dtr.RoleRepository;
60
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
61
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
61
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
62
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
62
import com.spice.profitmandi.dao.repository.dtr.UserRoleRepository;
63
import com.spice.profitmandi.dao.repository.dtr.UserRoleRepository;
-
 
64
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
63
import com.spice.profitmandi.dao.repository.user.AddressRepository;
65
import com.spice.profitmandi.dao.repository.user.AddressRepository;
64
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
66
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
65
import com.spice.profitmandi.service.AuthService;
67
import com.spice.profitmandi.service.AuthService;
66
import com.spice.profitmandi.service.authentication.RoleManager;
68
import com.spice.profitmandi.service.authentication.RoleManager;
67
import com.spice.profitmandi.service.user.RetailerService;
69
import com.spice.profitmandi.service.user.RetailerService;
Line 110... Line 112...
110
 
112
 
111
	@Autowired
113
	@Autowired
112
	private UserRoleRepository userRoleRepository;
114
	private UserRoleRepository userRoleRepository;
113
 
115
 
114
	@Autowired
116
	@Autowired
-
 
117
	private PartnerTypeChangeService partnerTypeChangeService;
-
 
118
 
-
 
119
	@Autowired
115
	private UserAccountRepository userAccountRepository;
120
	private UserAccountRepository userAccountRepository;
116
 
121
 
117
	@Autowired
122
	@Autowired
118
	private AuthService authService;
123
	private AuthService authService;
119
 
124
 
Line 707... Line 712...
707
		} else if (confirmedRefferalValue > 10) {
712
		} else if (confirmedRefferalValue > 10) {
708
			rfm.setMinimumEarning(200000);
713
			rfm.setMinimumEarning(200000);
709
		}
714
		}
710
		return rfm;
715
		return rfm;
711
	}
716
	}
-
 
717
	
-
 
718
	@RequestMapping(value = "/user/partnerTarget", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-
 
719
	@ApiImplicitParams({
-
 
720
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
-
 
721
	public ResponseEntity<?> PartnerTarget(HttpServletRequest request) throws Exception {
-
 
722
		int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
-
 
723
		int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
-
 
724
		PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(retailerId, LocalDate.now());
-
 
725
		
-
 
726
		return responseSender.ok(partnerType);
-
 
727
	}
712
 
728
 
713
}
729
}