|
@@ -2,9 +2,7 @@ package com.goafanti.user.controller;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -20,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import com.goafanti.common.bo.Result;
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
|
|
+import com.goafanti.common.model.OrgHumanResource;
|
|
|
import com.goafanti.common.model.OrganizationIdentity;
|
|
import com.goafanti.common.model.OrganizationIdentity;
|
|
|
import com.goafanti.common.model.OrganizationInfo;
|
|
import com.goafanti.common.model.OrganizationInfo;
|
|
|
import com.goafanti.common.model.OrganizationProperties;
|
|
import com.goafanti.common.model.OrganizationProperties;
|
|
@@ -41,6 +40,7 @@ import com.goafanti.user.bo.UidAndTypeBo;
|
|
|
import com.goafanti.user.bo.UserIdentityBo;
|
|
import com.goafanti.user.bo.UserIdentityBo;
|
|
|
import com.goafanti.user.bo.UserInfoBo;
|
|
import com.goafanti.user.bo.UserInfoBo;
|
|
|
import com.goafanti.user.bo.UserPageHomeBo;
|
|
import com.goafanti.user.bo.UserPageHomeBo;
|
|
|
|
|
+import com.goafanti.user.service.OrgHumanResourceService;
|
|
|
import com.goafanti.user.service.OrganizationIdentityService;
|
|
import com.goafanti.user.service.OrganizationIdentityService;
|
|
|
import com.goafanti.user.service.OrganizationInfoService;
|
|
import com.goafanti.user.service.OrganizationInfoService;
|
|
|
import com.goafanti.user.service.OrganizationPropertiesService;
|
|
import com.goafanti.user.service.OrganizationPropertiesService;
|
|
@@ -78,9 +78,12 @@ public class UserApiController extends BaseApiController {
|
|
|
private OrganizationTechService organizationTechService;
|
|
private OrganizationTechService organizationTechService;
|
|
|
@Resource
|
|
@Resource
|
|
|
private OrganizationPropertiesService organizationPropertiesService;
|
|
private OrganizationPropertiesService organizationPropertiesService;
|
|
|
-
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private OrgHumanResourceService orgHumanResourceService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 修改密码
|
|
* 修改密码
|
|
|
|
|
+ *
|
|
|
* @param password
|
|
* @param password
|
|
|
* @param newPassword
|
|
* @param newPassword
|
|
|
* @return
|
|
* @return
|
|
@@ -110,9 +113,10 @@ public class UserApiController extends BaseApiController {
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 重置密码
|
|
* 重置密码
|
|
|
|
|
+ *
|
|
|
* @param resetCode
|
|
* @param resetCode
|
|
|
* @param mobile
|
|
* @param mobile
|
|
|
* @param type
|
|
* @param type
|
|
@@ -120,15 +124,15 @@ public class UserApiController extends BaseApiController {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@RequestMapping(value = "/resetPwd", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/resetPwd", method = RequestMethod.POST)
|
|
|
- public Result resetPwd(String resetCode,String mobile,Integer type,String newPwd){
|
|
|
|
|
|
|
+ public Result resetPwd(String resetCode, String mobile, Integer type, String newPwd) {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
- if(TimeUtils.checkOverTime("resetCode")){
|
|
|
|
|
- res.getError().add(buildError(ErrorConstants.RESET_CODE_OVERTIME,"页面超时失效,请重新获取验证码!"));
|
|
|
|
|
|
|
+ if (TimeUtils.checkOverTime("resetCode")) {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.RESET_CODE_OVERTIME, "页面超时失效,请重新获取验证码!"));
|
|
|
this.cleanCodeSession();
|
|
this.cleanCodeSession();
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
- if(!TokenManager.getSession().getAttribute(VerifyCodeUtils.RESET_CODE).equals(resetCode)){
|
|
|
|
|
- res.getError().add(buildError(ErrorConstants.RESET_CODE_ERROR,"页面失效,请重新获取验证码!"));
|
|
|
|
|
|
|
+ if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.RESET_CODE).equals(resetCode)) {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.RESET_CODE_ERROR, "页面失效,请重新获取验证码!"));
|
|
|
this.cleanCodeSession();
|
|
this.cleanCodeSession();
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
@@ -140,29 +144,28 @@ public class UserApiController extends BaseApiController {
|
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE_TIME);
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE_TIME);
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
*
|
|
*
|
|
|
* @param mobileCode
|
|
* @param mobileCode
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@RequestMapping(value = "/checkMCode", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/checkMCode", method = RequestMethod.POST)
|
|
|
- public Result checkMCode(String mobileCode){
|
|
|
|
|
|
|
+ public Result checkMCode(String mobileCode) {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
- if(TimeUtils.checkOverTime("register")){
|
|
|
|
|
- res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR,"手机验证码超时失效"));
|
|
|
|
|
|
|
+ if (TimeUtils.checkOverTime("register")) {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR, "手机验证码超时失效"));
|
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE);
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE);
|
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
System.out.println(TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE));
|
|
System.out.println(TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE));
|
|
|
- if(!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode)){
|
|
|
|
|
- res.getError().add(buildError(ErrorConstants.MCODE_ERROR,"手机验证码错误"));
|
|
|
|
|
|
|
+ if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode)) {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "手机验证码错误"));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -242,12 +245,12 @@ public class UserApiController extends BaseApiController {
|
|
|
res.setData(handleFile(res, "/avatar/", false, req, ""));
|
|
res.setData(handleFile(res, "/avatar/", false, req, ""));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 公共可替换
|
|
* 公共可替换
|
|
|
*/
|
|
*/
|
|
|
- @RequestMapping(value="/avatar/uploadReplace",method = RequestMethod.POST)
|
|
|
|
|
- public Result avatarReplace(HttpServletRequest req ,String sign) {
|
|
|
|
|
|
|
+ @RequestMapping(value = "/avatar/uploadReplace", method = RequestMethod.POST)
|
|
|
|
|
+ public Result avatarReplace(HttpServletRequest req, String sign) {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
res.setData(handleFile(res, "/avatar/", false, req, sign));
|
|
res.setData(handleFile(res, "/avatar/", false, req, sign));
|
|
|
return res;
|
|
return res;
|
|
@@ -265,29 +268,27 @@ public class UserApiController extends BaseApiController {
|
|
|
res.setData(handleFile(res, "/identity/", true, req, sign));
|
|
res.setData(handleFile(res, "/identity/", true, req, sign));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 专利
|
|
* 专利
|
|
|
*
|
|
*
|
|
|
* @param req
|
|
* @param req
|
|
|
* @return
|
|
* @return
|
|
|
*//*
|
|
*//*
|
|
|
-
|
|
|
|
|
- @RequestMapping(value = "/patent/upload", method = RequestMethod.POST)
|
|
|
|
|
- public Result patentFile(HttpServletRequest req ,String sign) {
|
|
|
|
|
- Result res = new Result();
|
|
|
|
|
- res.setData(handleFile(res, "/patent/", true, req, sign));
|
|
|
|
|
- return res;
|
|
|
|
|
- }*/
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ *
|
|
|
|
|
+ * @RequestMapping(value = "/patent/upload", method =
|
|
|
|
|
+ * RequestMethod.POST) public Result patentFile(HttpServletRequest req
|
|
|
|
|
+ * ,String sign) { Result res = new Result();
|
|
|
|
|
+ * res.setData(handleFile(res, "/patent/", true, req, sign)); return
|
|
|
|
|
+ * res; }
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign) {
|
|
private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign) {
|
|
|
List<MultipartFile> files = getFiles(req);
|
|
List<MultipartFile> files = getFiles(req);
|
|
|
String fileName = "";
|
|
String fileName = "";
|
|
|
if (isPrivate || sign != "") {
|
|
if (isPrivate || sign != "") {
|
|
|
- fileName = path + TokenManager.getUserId() + "_" + sign + ".jpg";
|
|
|
|
|
-
|
|
|
|
|
|
|
+ fileName = path + TokenManager.getUserId() + "_" + sign + ".jpg";
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
fileName = path + System.nanoTime() + ".jpg";
|
|
fileName = path + System.nanoTime() + ".jpg";
|
|
|
}
|
|
}
|
|
@@ -597,34 +598,59 @@ public class UserApiController extends BaseApiController {
|
|
|
public Result ability() {
|
|
public Result ability() {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
UidAndTypeBo ub = basicInfo(userService);
|
|
UidAndTypeBo ub = basicInfo(userService);
|
|
|
- //UserAbility u = userAbilityService.selectUserAbilityByUserId(basicInfo(userService).getUid());
|
|
|
|
|
- UserAbility u =userAbilityService.selectUserAbilityByUserId(ub.getUid());
|
|
|
|
|
|
|
+ // UserAbility u =
|
|
|
|
|
+ // userAbilityService.selectUserAbilityByUserId(basicInfo(userService).getUid());
|
|
|
|
|
+ UserAbility u = userAbilityService.selectUserAbilityByUserId(ub.getUid());
|
|
|
res.setData(u);
|
|
res.setData(u);
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 团体人力资源情况入口
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/humanResource", method = RequestMethod.GET)
|
|
|
|
|
+ public Result humanResource() {
|
|
|
|
|
+ Result res = new Result();
|
|
|
|
|
+ res.setData(orgHumanResourceService.selectOrgHumanResourceByUserId(TokenManager.getUserId()));
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 团体人力资源情况修改保存(用户端)
|
|
|
|
|
+ * @param orgHumanResource
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/SaveHumanResource", method = RequestMethod.POST)
|
|
|
|
|
+ public Result SaveHumanResource(OrgHumanResource orgHumanResource){
|
|
|
|
|
+ Result res = new Result();
|
|
|
|
|
+ OrgHumanResource org = orgHumanResourceService.selectOrgHumanResourceByUserId(TokenManager.getUserId());
|
|
|
|
|
+ if (null == org){
|
|
|
|
|
+ orgHumanResource.setId(UUID.randomUUID().toString());
|
|
|
|
|
+ orgHumanResource.setUid(TokenManager.getUserId());
|
|
|
|
|
+ orgHumanResourceService.insert(orgHumanResource);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ orgHumanResource.setId(org.getId());
|
|
|
|
|
+ orgHumanResourceService.updateByPrimaryKeySelective(orgHumanResource);
|
|
|
|
|
+ }
|
|
|
|
|
+ res.setData(orgHumanResource);
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 首页
|
|
* 首页
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- @RequestMapping(value ="/homePage",method = RequestMethod.GET)
|
|
|
|
|
- public Result homePage(){
|
|
|
|
|
|
|
+ @RequestMapping(value = "/homePage", method = RequestMethod.GET)
|
|
|
|
|
+ public Result homePage() {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
- if (TokenManager.isLogin()){
|
|
|
|
|
|
|
+ if (TokenManager.isLogin()) {
|
|
|
UserPageHomeBo userPageHomeBo = userService.selectUserPageHomeBoByUserId(TokenManager.getUserId());
|
|
UserPageHomeBo userPageHomeBo = userService.selectUserPageHomeBoByUserId(TokenManager.getUserId());
|
|
|
res.setData(userPageHomeBo);
|
|
res.setData(userPageHomeBo);
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -641,161 +667,163 @@ public class UserApiController extends BaseApiController {
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 个人实名认证流程入口
|
|
* 个人实名认证流程入口
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- @RequestMapping(value="/userPro",method = RequestMethod.GET)
|
|
|
|
|
- public Result userProcess(){
|
|
|
|
|
|
|
+ @RequestMapping(value = "/userPro", method = RequestMethod.GET)
|
|
|
|
|
+ public Result userProcess() {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
- if (TokenManager.isLogin()){
|
|
|
|
|
|
|
+ if (TokenManager.isLogin()) {
|
|
|
res.setData(userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId()));
|
|
res.setData(userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId()));
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 个人实名认证流程下一步
|
|
* 个人实名认证流程下一步
|
|
|
*/
|
|
*/
|
|
|
- @RequestMapping(value="/userNextPro",method = RequestMethod.POST)
|
|
|
|
|
- public Result userNextProcess(UserIdentity userIdentity ,String verificationCode){
|
|
|
|
|
|
|
+ @RequestMapping(value = "/userNextPro", method = RequestMethod.POST)
|
|
|
|
|
+ public Result userNextProcess(UserIdentity userIdentity, String verificationCode) {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
- if (1 == userIdentity.getProcess()){
|
|
|
|
|
- if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.V_CODE).equals(verificationCode)){
|
|
|
|
|
- res.getError().add(buildError(ErrorConstants.VCODE_ERROR,"验证码错误"));
|
|
|
|
|
|
|
+ if (1 == userIdentity.getProcess()) {
|
|
|
|
|
+ if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.V_CODE).equals(verificationCode)) {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.VCODE_ERROR, "验证码错误"));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (3 == userIdentity.getProcess()){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (3 == userIdentity.getProcess()) {
|
|
|
UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
|
|
UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
|
|
|
u.setAuditStatus(1);
|
|
u.setAuditStatus(1);
|
|
|
userIdentityService.updateByPrimaryKeySelective(u);
|
|
userIdentityService.updateByPrimaryKeySelective(u);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (5 == userIdentity.getProcess()){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (5 == userIdentity.getProcess()) {
|
|
|
UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
|
|
UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
|
|
|
- if ((System.currentTimeMillis() - u.getPaymentDate().getTime()) > 432000000){
|
|
|
|
|
|
|
+ if ((System.currentTimeMillis() - u.getPaymentDate().getTime()) > 432000000) {
|
|
|
u.setAuditStatus(4);
|
|
u.setAuditStatus(4);
|
|
|
userIdentityService.updateByPrimaryKeySelective(u);
|
|
userIdentityService.updateByPrimaryKeySelective(u);
|
|
|
- res.getError().add(buildError("","1"));//超过打款日期5日,无法提交确认
|
|
|
|
|
|
|
+ res.getError().add(buildError("", "1"));// 超过打款日期5日,无法提交确认
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
- if (3 == u.getWrongCount()){
|
|
|
|
|
|
|
+ if (3 == u.getWrongCount()) {
|
|
|
u.setAuditStatus(4);
|
|
u.setAuditStatus(4);
|
|
|
u.setProcess(5);
|
|
u.setProcess(5);
|
|
|
userIdentityService.updateByPrimaryKeySelective(u);
|
|
userIdentityService.updateByPrimaryKeySelective(u);
|
|
|
- res.getError().add(buildError("","2"));//输入错误金额次数过多
|
|
|
|
|
|
|
+ res.getError().add(buildError("", "2"));// 输入错误金额次数过多
|
|
|
return res;
|
|
return res;
|
|
|
- }
|
|
|
|
|
- if (0 != (u.getAmountMoney().compareTo(userIdentity.getAmountMoney()))){
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (0 != (u.getAmountMoney().compareTo(userIdentity.getAmountMoney()))) {
|
|
|
int t = 3 - u.getWrongCount() - 1;
|
|
int t = 3 - u.getWrongCount() - 1;
|
|
|
- u.setWrongCount(u.getWrongCount()+1);
|
|
|
|
|
- userIdentityService.updateByPrimaryKeySelective(u);
|
|
|
|
|
- if (0 == t){
|
|
|
|
|
|
|
+ u.setWrongCount(u.getWrongCount() + 1);
|
|
|
|
|
+ userIdentityService.updateByPrimaryKeySelective(u);
|
|
|
|
|
+ if (0 == t) {
|
|
|
u.setAuditStatus(4);
|
|
u.setAuditStatus(4);
|
|
|
u.setProcess(5);
|
|
u.setProcess(5);
|
|
|
userIdentityService.updateByPrimaryKeySelective(u);
|
|
userIdentityService.updateByPrimaryKeySelective(u);
|
|
|
- res.getError().add(buildError("","2"));//输入错误金额次数过多
|
|
|
|
|
|
|
+ res.getError().add(buildError("", "2"));// 输入错误金额次数过多
|
|
|
} else {
|
|
} else {
|
|
|
- res.getError().add(buildError("","输入打款金额错误,您还有" + t + "次机会"));
|
|
|
|
|
|
|
+ res.getError().add(buildError("", "输入打款金额错误,您还有" + t + "次机会"));
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
userIdentity.setAuditStatus(5);
|
|
userIdentity.setAuditStatus(5);
|
|
|
}
|
|
}
|
|
|
- return dealUserProcess(res,userIdentity,TokenManager.getUserId());
|
|
|
|
|
|
|
+ return dealUserProcess(res, userIdentity, TokenManager.getUserId());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 团体实名认证流程入口
|
|
* 团体实名认证流程入口
|
|
|
*/
|
|
*/
|
|
|
- @RequestMapping(value="/orgProcess",method = RequestMethod.GET)
|
|
|
|
|
- public Result orgProcess(){
|
|
|
|
|
|
|
+ @RequestMapping(value = "/orgProcess", method = RequestMethod.GET)
|
|
|
|
|
+ public Result orgProcess() {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
- if (TokenManager.isLogin()){
|
|
|
|
|
|
|
+ if (TokenManager.isLogin()) {
|
|
|
res.setData(organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId()));
|
|
res.setData(organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId()));
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 团体实名认证流程下一步
|
|
* 团体实名认证流程下一步
|
|
|
*/
|
|
*/
|
|
|
- @RequestMapping(value="/orgNextPro",method = RequestMethod.POST)
|
|
|
|
|
- public Result orgNextProcess(OrganizationIdentity orgIdentity, String verificationCode){
|
|
|
|
|
|
|
+ @RequestMapping(value = "/orgNextPro", method = RequestMethod.POST)
|
|
|
|
|
+ public Result orgNextProcess(OrganizationIdentity orgIdentity, String verificationCode) {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
- if (1 == orgIdentity.getProcess()){
|
|
|
|
|
- if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.V_CODE).equals(verificationCode)){
|
|
|
|
|
- res.getError().add(buildError(ErrorConstants.VCODE_ERROR,"验证码错误"));
|
|
|
|
|
|
|
+ if (1 == orgIdentity.getProcess()) {
|
|
|
|
|
+ if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.V_CODE).equals(verificationCode)) {
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.VCODE_ERROR, "验证码错误"));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (3 == orgIdentity.getProcess()){
|
|
|
|
|
- OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId());
|
|
|
|
|
|
|
+ if (3 == orgIdentity.getProcess()) {
|
|
|
|
|
+ OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId());
|
|
|
o.setAuditStatus(1);
|
|
o.setAuditStatus(1);
|
|
|
organizationIdentityService.updateByPrimaryKeySelective(o);
|
|
organizationIdentityService.updateByPrimaryKeySelective(o);
|
|
|
}
|
|
}
|
|
|
- if (5 == orgIdentity.getProcess()){
|
|
|
|
|
|
|
+ if (5 == orgIdentity.getProcess()) {
|
|
|
OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId());
|
|
OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId());
|
|
|
- if (System.currentTimeMillis() - o.getPaymentDate().getTime() > 432000000){
|
|
|
|
|
|
|
+ if (System.currentTimeMillis() - o.getPaymentDate().getTime() > 432000000) {
|
|
|
o.setAuditStatus(4);
|
|
o.setAuditStatus(4);
|
|
|
organizationIdentityService.updateByPrimaryKeySelective(o);
|
|
organizationIdentityService.updateByPrimaryKeySelective(o);
|
|
|
- res.getError().add(buildError("", "1"));//超过打款日期5日,无法提交确认
|
|
|
|
|
|
|
+ res.getError().add(buildError("", "1"));// 超过打款日期5日,无法提交确认
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
- if (3 == o.getWrongCount()){
|
|
|
|
|
|
|
+ if (3 == o.getWrongCount()) {
|
|
|
o.setAuditStatus(4);
|
|
o.setAuditStatus(4);
|
|
|
o.setProcess(5);
|
|
o.setProcess(5);
|
|
|
organizationIdentityService.updateByPrimaryKeySelective(o);
|
|
organizationIdentityService.updateByPrimaryKeySelective(o);
|
|
|
- res.getError().add(buildError("", "2"));//输入错误金额次数过多
|
|
|
|
|
|
|
+ res.getError().add(buildError("", "2"));// 输入错误金额次数过多
|
|
|
return res;
|
|
return res;
|
|
|
- }
|
|
|
|
|
- if (0 != (o.getValidationAmount().compareTo(orgIdentity.getValidationAmount()))){
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (0 != (o.getValidationAmount().compareTo(orgIdentity.getValidationAmount()))) {
|
|
|
int t = 3 - o.getWrongCount() - 1;
|
|
int t = 3 - o.getWrongCount() - 1;
|
|
|
o.setWrongCount(o.getWrongCount() + 1);
|
|
o.setWrongCount(o.getWrongCount() + 1);
|
|
|
- organizationIdentityService.updateByPrimaryKeySelective(o);
|
|
|
|
|
- if (0 == t){
|
|
|
|
|
|
|
+ organizationIdentityService.updateByPrimaryKeySelective(o);
|
|
|
|
|
+ if (0 == t) {
|
|
|
o.setAuditStatus(4);
|
|
o.setAuditStatus(4);
|
|
|
o.setProcess(5);
|
|
o.setProcess(5);
|
|
|
organizationIdentityService.updateByPrimaryKeySelective(o);
|
|
organizationIdentityService.updateByPrimaryKeySelective(o);
|
|
|
- res.getError().add(buildError("","2"));//输入错误金额次数过多
|
|
|
|
|
|
|
+ res.getError().add(buildError("", "2"));// 输入错误金额次数过多
|
|
|
} else {
|
|
} else {
|
|
|
res.getError().add(buildError("", "输入打款金额错误,您还有" + t + "次机会"));
|
|
res.getError().add(buildError("", "输入打款金额错误,您还有" + t + "次机会"));
|
|
|
}
|
|
}
|
|
|
- return res;
|
|
|
|
|
|
|
+ return res;
|
|
|
}
|
|
}
|
|
|
orgIdentity.setAuditStatus(5);
|
|
orgIdentity.setAuditStatus(5);
|
|
|
}
|
|
}
|
|
|
- return dealOrgProcess(res, orgIdentity ,TokenManager.getUserId());
|
|
|
|
|
|
|
+ return dealOrgProcess(res, orgIdentity, TokenManager.getUserId());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 认证失败
|
|
* 认证失败
|
|
|
*/
|
|
*/
|
|
|
- @RequestMapping(value="/identFailed", method = RequestMethod.GET)
|
|
|
|
|
- public Result authenticationFailed(){
|
|
|
|
|
|
|
+ @RequestMapping(value = "/identFailed", method = RequestMethod.GET)
|
|
|
|
|
+ public Result authenticationFailed() {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
return dealFaild(res);
|
|
return dealFaild(res);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 管理端确认用户认证
|
|
* 管理端确认用户认证
|
|
|
|
|
+ *
|
|
|
* @param auditStatus
|
|
* @param auditStatus
|
|
|
* @param money
|
|
* @param money
|
|
|
* @param uid
|
|
* @param uid
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- @RequestMapping(value="/adminConfirmIdent", method = RequestMethod.POST)
|
|
|
|
|
- public Result adminConfirmIdent(Integer auditStatus, BigDecimal money, String uid){
|
|
|
|
|
|
|
+ @RequestMapping(value = "/adminConfirmIdent", method = RequestMethod.POST)
|
|
|
|
|
+ public Result adminConfirmIdent(Integer auditStatus, BigDecimal money, String uid) {
|
|
|
Result res = new Result();
|
|
Result res = new Result();
|
|
|
- if (0 == userService.selectByPrimaryKey(uid).getType()){
|
|
|
|
|
|
|
+ if (0 == userService.selectByPrimaryKey(uid).getType()) {
|
|
|
UserIdentity u = userIdentityService.selectUserIdentityByUserId(uid);
|
|
UserIdentity u = userIdentityService.selectUserIdentityByUserId(uid);
|
|
|
u.setAuditStatus(auditStatus);
|
|
u.setAuditStatus(auditStatus);
|
|
|
u.setAmountMoney(money);
|
|
u.setAmountMoney(money);
|
|
|
res.setData(userIdentityService.updateByPrimaryKeySelective(u));
|
|
res.setData(userIdentityService.updateByPrimaryKeySelective(u));
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(uid);
|
|
OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(uid);
|
|
|
o.setAuditStatus(auditStatus);
|
|
o.setAuditStatus(auditStatus);
|
|
|
o.setValidationAmount(money);
|
|
o.setValidationAmount(money);
|
|
@@ -803,10 +831,10 @@ public class UserApiController extends BaseApiController {
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- //认证失败清除相关认证信息
|
|
|
|
|
- private Result dealFaild(Result res){
|
|
|
|
|
- if (0 == userService.selectByPrimaryKey(TokenManager.getUserId()).getType()){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 认证失败清除相关认证信息
|
|
|
|
|
+ private Result dealFaild(Result res) {
|
|
|
|
|
+ if (0 == userService.selectByPrimaryKey(TokenManager.getUserId()).getType()) {
|
|
|
UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
|
|
UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
|
|
|
UserIdentity user = new UserIdentity();
|
|
UserIdentity user = new UserIdentity();
|
|
|
user.setId(u.getId());
|
|
user.setId(u.getId());
|
|
@@ -825,11 +853,11 @@ public class UserApiController extends BaseApiController {
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- //orgProcess
|
|
|
|
|
- private Result dealOrgProcess(Result res, OrganizationIdentity o ,String uid){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // orgProcess
|
|
|
|
|
+ private Result dealOrgProcess(Result res, OrganizationIdentity o, String uid) {
|
|
|
OrganizationIdentity org = organizationIdentityService.selectOrgIdentityByUserId(uid);
|
|
OrganizationIdentity org = organizationIdentityService.selectOrgIdentityByUserId(uid);
|
|
|
- if (null == org){
|
|
|
|
|
|
|
+ if (null == org) {
|
|
|
o.setId(UUID.randomUUID().toString());
|
|
o.setId(UUID.randomUUID().toString());
|
|
|
o.setUid(uid);
|
|
o.setUid(uid);
|
|
|
res.setData(organizationIdentityService.insert(o));
|
|
res.setData(organizationIdentityService.insert(o));
|
|
@@ -839,11 +867,11 @@ public class UserApiController extends BaseApiController {
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- //userProcess
|
|
|
|
|
- private Result dealUserProcess(Result res,UserIdentity userIdentity,String uid){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // userProcess
|
|
|
|
|
+ private Result dealUserProcess(Result res, UserIdentity userIdentity, String uid) {
|
|
|
UserIdentity identity = userIdentityService.selectUserIdentityByUserId(uid);
|
|
UserIdentity identity = userIdentityService.selectUserIdentityByUserId(uid);
|
|
|
- if (null == identity){
|
|
|
|
|
|
|
+ if (null == identity) {
|
|
|
userIdentity.setId(UUID.randomUUID().toString());
|
|
userIdentity.setId(UUID.randomUUID().toString());
|
|
|
userIdentity.setUid(uid);
|
|
userIdentity.setUid(uid);
|
|
|
res.setData(userIdentityService.insert(userIdentity));
|
|
res.setData(userIdentityService.insert(userIdentity));
|
|
@@ -853,17 +881,14 @@ public class UserApiController extends BaseApiController {
|
|
|
}
|
|
}
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- private void cleanCodeSession(){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ private void cleanCodeSession() {
|
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE);
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE);
|
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE_TIME);
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE_TIME);
|
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE);
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE);
|
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
|
|
TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
private UidAndTypeBo basicInfo(UserService userService) {
|
|
private UidAndTypeBo basicInfo(UserService userService) {
|
|
|
User u = userService.selectByPrimaryKey(TokenManager.getUserId());
|
|
User u = userService.selectByPrimaryKey(TokenManager.getUserId());
|
|
|
UidAndTypeBo ub = new UidAndTypeBo();
|
|
UidAndTypeBo ub = new UidAndTypeBo();
|
|
@@ -871,6 +896,5 @@ public class UserApiController extends BaseApiController {
|
|
|
ub.setUid(u.getId());
|
|
ub.setUid(u.getId());
|
|
|
return ub;
|
|
return ub;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|