From 27bc37de63be148eebcc19c323d864091c590e67 Mon Sep 17 00:00:00 2001 From: schry <2433098676@qq.com> Date: Sun, 9 Jul 2023 23:25:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E4=BC=81=E4=B8=9A=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=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 --- .../purchase/userPersonController.java | 19 +++++++++++++++++++ .../api/service/sup/UserPersonService.java | 5 +++++ 2 files changed, 24 insertions(+) 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 23d3760..93030cf 100644 --- a/src/main/java/com/glxp/api/controller/purchase/userPersonController.java +++ b/src/main/java/com/glxp/api/controller/purchase/userPersonController.java @@ -24,6 +24,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.util.Date; import java.util.List; /** @@ -90,6 +91,23 @@ public class userPersonController { return ResultVOUtils.success(); } + @ApiOperation(value = "新增本企业负责人信息", response = BaseResponse.class) + @PostMapping("/sup/company/person/addPerSon") + public BaseResponse addPerSon(@RequestBody UserPersonFilterRequest userPersonFilterRequest ,BindingResult bindingResult ){ + if (bindingResult.hasErrors()) { + 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.setId(Long.valueOf(Long.parseLong(userPersonFilterRequest.getCompanyId()))); + userPerson.setCreateTime(new Date()); + userPersonService.add(userPerson); + return ResultVOUtils.success(); + } + public String getCompanyId() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); if (attributes == null) { @@ -101,4 +119,5 @@ public class userPersonController { } + } diff --git a/src/main/java/com/glxp/api/service/sup/UserPersonService.java b/src/main/java/com/glxp/api/service/sup/UserPersonService.java index 01c2ff3..13d0b91 100644 --- a/src/main/java/com/glxp/api/service/sup/UserPersonService.java +++ b/src/main/java/com/glxp/api/service/sup/UserPersonService.java @@ -24,4 +24,9 @@ public class UserPersonService extends ServiceImpl 0; } + + public boolean add(UserPersonEntity userPerson) { + return userPersonMapper.insert(userPerson)> 0; + } + }