|
|
|
@ -8,6 +8,7 @@ import java.net.URLDecoder; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
|
import org.jeecg.common.constant.CommonConstant; |
|
|
|
@ -623,4 +624,61 @@ public class ExpertController extends JeecgController<Expert, IExpertService> { |
|
|
|
|
return Result.OK("驳回成功!请到编辑页面确定问题数据并填写驳回原因"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@AutoLog(value = "专家注册") |
|
|
|
|
@ApiOperation(value="专家注册", notes="专家注册") |
|
|
|
|
@PostMapping (value = "userRegisterexp") |
|
|
|
|
public Result<Object> userRegisterexp(@RequestBody JSONObject jsonObject) { |
|
|
|
|
String emails = jsonObject.getString("emails"); |
|
|
|
|
String username = jsonObject.getString("username"); |
|
|
|
|
String ssdep = jsonObject.getString("ssdep"); |
|
|
|
|
String realname = jsonObject.getString("realname"); |
|
|
|
|
String psd = jsonObject.getString("psd"); |
|
|
|
|
String sepsd = jsonObject.getString("sepsd"); |
|
|
|
|
String phone = jsonObject.getString("phone"); |
|
|
|
|
String workon = jsonObject.getString("workon"); |
|
|
|
|
if (!psd.equals(sepsd)){ |
|
|
|
|
return Result.OK().error500("两次输入的密码不同"); |
|
|
|
|
} |
|
|
|
|
//判断是用户名是否存在
|
|
|
|
|
String isusername = expertService.isusername(username); |
|
|
|
|
if(isusername.equals("1")){ |
|
|
|
|
Result.OK().error500("当前的用户名已经存在"); |
|
|
|
|
} |
|
|
|
|
//判断工号是否存在
|
|
|
|
|
String isworkon =expertService.isworkon(workon); |
|
|
|
|
if (isworkon.equals("1")){ |
|
|
|
|
Result.OK().error500("当前的工号已经存在"); |
|
|
|
|
} |
|
|
|
|
//判断电话号码是否存在
|
|
|
|
|
String isphone = expertService.isphone(phone); |
|
|
|
|
if (isphone.equals("1")){ |
|
|
|
|
Result.OK().error500("当前的电话号码已经存在"); |
|
|
|
|
} |
|
|
|
|
//判断电子邮件是否存在
|
|
|
|
|
String isemils = expertService.isemils(emails); |
|
|
|
|
if (isemils.equals("1")){ |
|
|
|
|
Result.OK().error500("当前的电子邮件已经存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//开始添加到用户表
|
|
|
|
|
SysUser user = new SysUser(); |
|
|
|
|
user.setRealname(realname); |
|
|
|
|
user.setUsername(username); |
|
|
|
|
user.setWorkNo(workon); |
|
|
|
|
user.setEmail(emails); |
|
|
|
|
user.setPhone(phone); |
|
|
|
|
user.setCreateTime(new Date());//设置创建时间
|
|
|
|
|
String salt = oConvertUtils.randomGen(8); |
|
|
|
|
user.setSalt(salt); |
|
|
|
|
String passwordEncode = PasswordUtil.encrypt(username, psd, salt); |
|
|
|
|
user.setPassword(passwordEncode); |
|
|
|
|
user.setStatus(1); |
|
|
|
|
user.setDelFlag(CommonConstant.DEL_FLAG_0); |
|
|
|
|
sysUserService.saveUser(user, "1843478958968647681", ssdep, ""); |
|
|
|
|
Expert expert = new Expert(); |
|
|
|
|
expert.setSeusername(username); |
|
|
|
|
expertService.save(expert); |
|
|
|
|
return Result.OK("注册成功"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|