|
@@ -97,12 +97,18 @@ public class LoginController {
|
|
*
|
|
*
|
|
* @param invitationCode 邀请码
|
|
* @param invitationCode 邀请码
|
|
* @param userOrganizeID 组织id
|
|
* @param userOrganizeID 组织id
|
|
- * @return
|
|
|
|
|
|
+ * @return 0: 请输入邀请码
|
|
|
|
+ * -2: 邀请码已失效
|
|
|
|
+ * -3: 邀请码已被使用
|
|
*/
|
|
*/
|
|
@RequestMapping("/isEnabled")
|
|
@RequestMapping("/isEnabled")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public WxJsonModel isEnabled(String invitationCode, Integer userOrganizeID) {
|
|
public WxJsonModel isEnabled(String invitationCode, Integer userOrganizeID) {
|
|
WxJsonModel res = WxJsonModel.newInstance();
|
|
WxJsonModel res = WxJsonModel.newInstance();
|
|
|
|
+ String mobile = loginService.cellPhone(userOrganizeID);
|
|
|
|
+ if (invitationCode == null || invitationCode.equals("")) {
|
|
|
|
+ return res.error("0", mobile);
|
|
|
|
+ }
|
|
CmOperationUser operationUser = loginService.isEnabled(invitationCode, userOrganizeID);
|
|
CmOperationUser operationUser = loginService.isEnabled(invitationCode, userOrganizeID);
|
|
if (operationUser == null) {
|
|
if (operationUser == null) {
|
|
return res.error("-1", "邀请码错误");
|
|
return res.error("-1", "邀请码错误");
|
|
@@ -112,10 +118,10 @@ public class LoginController {
|
|
calendar.setTime(operationUser.getInvitationCodeTime());
|
|
calendar.setTime(operationUser.getInvitationCodeTime());
|
|
calendar.add(Calendar.DATE, 2);
|
|
calendar.add(Calendar.DATE, 2);
|
|
if (operationUser.getStatus().equals("1") && date.getTime() > calendar.getTime().getTime() && operationUser.getDelFlag().equals("0")) {
|
|
if (operationUser.getStatus().equals("1") && date.getTime() > calendar.getTime().getTime() && operationUser.getDelFlag().equals("0")) {
|
|
- return res.error("-2", "邀请码已失效");
|
|
|
|
|
|
+ return res.error("-2", mobile);
|
|
}
|
|
}
|
|
if (operationUser.getStatus().equals("2") && operationUser.getDelFlag().equals("0")) {
|
|
if (operationUser.getStatus().equals("2") && operationUser.getDelFlag().equals("0")) {
|
|
- return res.error("-3", "邀请码已被使用");
|
|
|
|
|
|
+ return res.error("-3", mobile);
|
|
}
|
|
}
|
|
if (!operationUser.getDelFlag().equals("0")) {
|
|
if (!operationUser.getDelFlag().equals("0")) {
|
|
return res.error("-1", "您的账号已下线");
|
|
return res.error("-1", "您的账号已下线");
|