|
|
|
@ -1,18 +1,13 @@
|
|
|
|
|
package cn.jyjz.xiaoyao.ocr.controller;
|
|
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.admin.dataobject.Tenant;
|
|
|
|
|
import cn.jyjz.xiaoyao.admin.dataobject.User;
|
|
|
|
|
import cn.jyjz.xiaoyao.admin.service.TenantService;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.controller.BaseController;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.redis.cache.ICacheManager;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.redis.cache.constants.CacheConstants;
|
|
|
|
|
import cn.jyjz.xiaoyao.framework.security.service.SmsLoginService;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSUserT;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrISUserTService;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
@ -21,19 +16,11 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -62,11 +49,12 @@ public class OcrSUserTController {
|
|
|
|
|
@Autowired
|
|
|
|
|
OcrTaskchildPictureService ocrtaskchildpictureservice;
|
|
|
|
|
|
|
|
|
|
/** 忘记密码
|
|
|
|
|
/**
|
|
|
|
|
* 忘记密码
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "重置密码", notes = "重置密码")
|
|
|
|
|
@RequestMapping(value = "/updateSUser", method = RequestMethod.POST)
|
|
|
|
|
public ResponseEntity<?> updateSUser(@RequestBody Map<String,String> map) {
|
|
|
|
|
public ResultVo updateSUser(@RequestBody Map<String,String> map) {
|
|
|
|
|
|
|
|
|
|
// System.out.println(map);
|
|
|
|
|
// Map<String, String> map=new HashMap<String,String>();
|
|
|
|
@ -82,34 +70,39 @@ public class OcrSUserTController {
|
|
|
|
|
boolean update = sUserTService.update(updatewrapper);
|
|
|
|
|
|
|
|
|
|
if(update){
|
|
|
|
|
return new ResponseEntity<Object>("密码重设成功!",HttpStatus.OK);
|
|
|
|
|
|
|
|
|
|
// return new ResponseEntity<Object>("密码重设成功!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"密码重设成功!");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
return new ResponseEntity<Object>("两次密码输入不一致!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("两次密码输入不一致!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"两次密码输入不一致!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
return new ResponseEntity<Object>("请再次输入新密码!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("请再次输入新密码!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"请再次输入新密码!");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
return new ResponseEntity<Object>("请输入新密码!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("请输入新密码!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入新密码!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
|
|
return new ResponseEntity<Object>("请输入同时包含英文、数字的8~16位密码!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("请输入同时包含英文、数字的8~16位密码!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入同时包含英文、数字的8~16位密码!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "忘记密码", notes = "忘记密码")
|
|
|
|
|
@RequestMapping(value = "/selectSUser", method = RequestMethod.POST)
|
|
|
|
|
public ResponseEntity<?> selectSUser(@RequestBody Map<String,Object> map) {
|
|
|
|
|
public ResultVo selectSUser(@RequestBody Map<String,Object> map) {
|
|
|
|
|
|
|
|
|
|
if(null!=map.get("loginname")){
|
|
|
|
|
if(null!=map.get("phone")){
|
|
|
|
@ -134,35 +127,44 @@ public class OcrSUserTController {
|
|
|
|
|
if(!StringUtils.isBlank(sysCode) && !sysCode.equals(map.get("phone").toString())){
|
|
|
|
|
Map<Object, String> list = new HashMap<>();
|
|
|
|
|
list.put("loginname",map.get("loginname").toString());
|
|
|
|
|
return new ResponseEntity<Map<Object, String>>(list, HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Map<Object, String>>(list, HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.success(ResultVo.SUCCESS,list);
|
|
|
|
|
}else {
|
|
|
|
|
return new ResponseEntity<Object>("验证码错误!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("验证码错误!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"验证码错误!");
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
return new ResponseEntity<Object>("手机号错误!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("手机号错误!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"手机号错误!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
return new ResponseEntity<Object>("账号不存在!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("账号不存在!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"账号不存在!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
return new ResponseEntity<Object>("企业编码错误!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("企业编码错误!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"企业编码错误!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
return new ResponseEntity<Object>("请输入企业编码!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("请输入企业编码!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入企业编码!");
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
return new ResponseEntity<Object>("请输入验证码!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("请输入验证码!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入验证码!");
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
return new ResponseEntity<Object>("请输入手机号!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("请输入手机号!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入手机号!");
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
|
|
return new ResponseEntity<Object>("请输入账号!",HttpStatus.OK);
|
|
|
|
|
// return new ResponseEntity<Object>("请输入账号!",HttpStatus.OK);
|
|
|
|
|
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入账号!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|