From aba6c1db1e15da676ff0b93a1d130209c1503d71 Mon Sep 17 00:00:00 2001 From: schry <2433098676@qq.com> Date: Mon, 10 Jul 2023 10:42:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E4=BC=81=E4=B8=9A=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/auth/AuthUserController.java | 7 ++++++ .../auth/ResgitserCertController.java | 22 ++++++++++--------- .../purchase/userPersonController.java | 4 ++-- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/auth/AuthUserController.java b/src/main/java/com/glxp/api/controller/auth/AuthUserController.java index 58d606e..77b2ce0 100644 --- a/src/main/java/com/glxp/api/controller/auth/AuthUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/AuthUserController.java @@ -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,"当前密码输入错误!请重新输入!"); } diff --git a/src/main/java/com/glxp/api/controller/auth/ResgitserCertController.java b/src/main/java/com/glxp/api/controller/auth/ResgitserCertController.java index ba67ed0..449ee8a 100644 --- a/src/main/java/com/glxp/api/controller/auth/ResgitserCertController.java +++ b/src/main/java/com/glxp/api/controller/auth/ResgitserCertController.java @@ -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; + } + } diff --git a/src/main/java/com/glxp/api/controller/purchase/userPersonController.java b/src/main/java/com/glxp/api/controller/purchase/userPersonController.java index 93030cf..a210132 100644 --- a/src/main/java/com/glxp/api/controller/purchase/userPersonController.java +++ b/src/main/java/com/glxp/api/controller/purchase/userPersonController.java @@ -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(); }