diff --git a/src/main/java/com/glxp/api/controller/auth/RegisterController.java b/src/main/java/com/glxp/api/controller/auth/RegisterController.java index 72dd086..f442d48 100644 --- a/src/main/java/com/glxp/api/controller/auth/RegisterController.java +++ b/src/main/java/com/glxp/api/controller/auth/RegisterController.java @@ -1,5 +1,6 @@ package com.glxp.api.controller.auth; +import java.util.List; import java.util.Map; import javax.annotation.Resource; @@ -20,8 +21,10 @@ import com.alibaba.fastjson2.JSON; 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.entity.auth.UserPersonEntity; import com.glxp.api.entity.auth.UserRegisterEntity; import com.glxp.api.req.auth.UserResisterFilterRequest; +import com.glxp.api.service.auth.UserPersonService; import com.glxp.api.service.auth.UserRegisterService; import com.glxp.api.util.CaptchaUtils; @@ -35,7 +38,9 @@ public class RegisterController { private static final Logger logger = LoggerFactory.getLogger(RegisterController.class); @Resource private UserRegisterService userRegisterService; - + @Resource + private UserPersonService userPersonService; + @PostMapping("/admin/auth/register/getCheckcode") public BaseResponse getCheckcode(@RequestBody Map params, HttpSession httpSession) { logger.info("---------------"+JSON.toJSONString(params)); @@ -57,8 +62,12 @@ public class RegisterController { @GetMapping("/admin/auth/register/get/{mobile}") public BaseResponse getInfo(@PathVariable String mobile) { UserRegisterEntity userRegisterEntity = userRegisterService.selectByMobile(mobile); - if(userRegisterEntity==null) + if(userRegisterEntity==null) { userRegisterEntity = new UserRegisterEntity(); + } else { + List userPersons = userPersonService.selectByRegisterId(userRegisterEntity.getId().toString()); + userRegisterEntity.setUserPersons(userPersons); + } return ResultVOUtils.success(userRegisterEntity); } diff --git a/src/main/java/com/glxp/api/dao/auth/UserPersonDao.java b/src/main/java/com/glxp/api/dao/auth/UserPersonDao.java index 5694b0c..0e44b85 100644 --- a/src/main/java/com/glxp/api/dao/auth/UserPersonDao.java +++ b/src/main/java/com/glxp/api/dao/auth/UserPersonDao.java @@ -1,16 +1,16 @@ package com.glxp.api.dao.auth; -import com.glxp.api.dao.BaseMapperPlus; -import com.glxp.api.entity.auth.DeptEntity; -import com.glxp.api.entity.auth.UserPersonEntity; -import com.glxp.api.req.auth.FilterInvWarehouseRequest; +import java.util.List; + import org.apache.ibatis.annotations.Param; -import java.util.Date; -import java.util.List; +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.auth.UserPersonEntity; +import com.glxp.api.entity.auth.UserRegisterEntity; +import com.glxp.api.req.auth.UserPersonFilterRequest; public interface UserPersonDao extends BaseMapperPlus { - - + List filterUserPersons(UserPersonFilterRequest userPersonFilterRequest); + List selectByRegisterId(@Param("registerId") String registerId); } diff --git a/src/main/java/com/glxp/api/req/auth/UserPersonFilterRequest.java b/src/main/java/com/glxp/api/req/auth/UserPersonFilterRequest.java new file mode 100644 index 0000000..53d8cee --- /dev/null +++ b/src/main/java/com/glxp/api/req/auth/UserPersonFilterRequest.java @@ -0,0 +1,18 @@ +package com.glxp.api.req.auth; + +import com.glxp.api.util.page.ListPageRequest; + +import lombok.Data; + +@Data +public class UserPersonFilterRequest extends ListPageRequest { + + private String companyId; + private String companyName; + private String creditNum; + private String mobile; + private String bussinessStatus; + private String checkStatus; + private String registerTime; + private String checkTime; +} diff --git a/src/main/java/com/glxp/api/service/auth/UserPersonService.java b/src/main/java/com/glxp/api/service/auth/UserPersonService.java new file mode 100644 index 0000000..f37f2e8 --- /dev/null +++ b/src/main/java/com/glxp/api/service/auth/UserPersonService.java @@ -0,0 +1,13 @@ +package com.glxp.api.service.auth; + +import java.util.List; + +import com.glxp.api.entity.auth.UserPersonEntity; +import com.glxp.api.entity.auth.UserRegisterEntity; +import com.glxp.api.req.auth.UserPersonFilterRequest; + +public interface UserPersonService { + + List filterUserPersons(UserPersonFilterRequest userPersonFilterRequest); + List selectByRegisterId(String registerId); +} diff --git a/src/main/java/com/glxp/api/service/auth/impl/UserPersonServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/UserPersonServiceImpl.java new file mode 100644 index 0000000..1846f97 --- /dev/null +++ b/src/main/java/com/glxp/api/service/auth/impl/UserPersonServiceImpl.java @@ -0,0 +1,37 @@ +package com.glxp.api.service.auth.impl; + +import java.util.Collections; +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.auth.UserPersonDao; +import com.glxp.api.entity.auth.UserPersonEntity; +import com.glxp.api.entity.auth.UserRegisterEntity; +import com.glxp.api.req.auth.UserPersonFilterRequest; +import com.glxp.api.service.auth.UserPersonService; + +@Service +@Transactional(rollbackFor = Exception.class) +public class UserPersonServiceImpl implements UserPersonService { + @Resource + UserPersonDao userPersonDao; + @Override + public List filterUserPersons(UserPersonFilterRequest userPersonFilterRequest) { + if (userPersonFilterRequest == null) { + return Collections.emptyList(); + } + int offset = (userPersonFilterRequest.getPage() - 1) * userPersonFilterRequest.getLimit(); + PageHelper.offsetPage(offset, userPersonFilterRequest.getLimit()); + return userPersonDao.filterUserPersons(userPersonFilterRequest); + } + + @Override + public List selectByRegisterId(String registerId) { + return userPersonDao.selectByRegisterId(registerId); + } +} diff --git a/src/main/resources/mybatis/mapper/auth/UserPersonMapper.xml b/src/main/resources/mybatis/mapper/auth/UserPersonMapper.xml index 08952cb..69d4bbc 100644 --- a/src/main/resources/mybatis/mapper/auth/UserPersonMapper.xml +++ b/src/main/resources/mybatis/mapper/auth/UserPersonMapper.xml @@ -4,7 +4,32 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + +