本企业信息页面接口优化

cert
schry 2 years ago
parent 27bc37de63
commit aba6c1db1e

@ -12,6 +12,7 @@ import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.service.auth.*;
import com.glxp.api.util.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
@ -140,6 +141,12 @@ public class AuthUserController extends BaseController {
public BaseResponse updateUser(@RequestBody UpdateUserRequset updateUserRequset) {
AuthAdmin authAdmin=customerService.getUserBean();
System.out.println(updateUserRequset.toString());
if (StringUtils.isBlank(updateUserRequset.getNewPassword())){
return ResultVOUtils.error(500,"请输入新密码!");
}
if (StringUtils.isBlank(updateUserRequset.getConfirmPassword())){
return ResultVOUtils.error(500,"请输入确认密码!");
}
if (!updateUserRequset.getPassWord().equals(authAdmin.getPassWord())){
return ResultVOUtils.error(500,"当前密码输入错误!请重新输入!");
}

@ -13,6 +13,7 @@ import com.glxp.api.req.system.DeleteCompanyFileRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.sup.UserCertService;
import com.glxp.api.service.sup.UserCertSetService;
import com.glxp.api.util.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
@ -73,20 +74,11 @@ public class ResgitserCertController {
return ResultVOUtils.success(pageSimpleResponse);
}
public String getCompanyId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
HttpServletRequest request = attributes.getRequest();
String companyId = request.getHeader("companyId");
return companyId;
}
//资质证书添加
@PostMapping("/reg/company/cert/isertCert")
public BaseResponse isertCert(@RequestBody UserCertEntity userCert) {
userCert.setBusinessId(Long.valueOf(getCompanyId()));
userCert.setCreateTime(new Date());
userCert.setUpdateTime(new Date());
userCert.setStatus(1 + "");
@ -133,5 +125,15 @@ public class ResgitserCertController {
return ResultVOUtils.success("修改成功");
}
public String getCompanyId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
HttpServletRequest request = attributes.getRequest();
String companyId = request.getHeader("companyId");
return companyId;
}
}

@ -98,12 +98,12 @@ public class userPersonController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
UserPersonEntity userPerson = new UserPersonEntity();
BeanUtils.copyProperties(userPersonFilterRequest,userPerson);
userPerson.setPassword(userPersonFilterRequest.getCheckPassword());
userPerson.setCompanyId(Long.valueOf(userPersonFilterRequest.getCompanyId()));
//userPerson.setCompanyId(Long.valueOf(userPersonFilterRequest.getCompanyId()));
// userPerson.setId(Long.valueOf(Long.parseLong(userPersonFilterRequest.getCompanyId())));
userPerson.setCreateTime(new Date());
userPerson.setCompanyId(Long.valueOf(getCompanyId()));
userPersonService.add(userPerson);
return ResultVOUtils.success();
}

Loading…
Cancel
Save