注册信息增加返回负责人

ww
chengqf 2 years ago
parent 86ca24675f
commit f8ca58b378

@ -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,6 +38,8 @@ 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<String,Object> params, HttpSession httpSession) {
@ -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<UserPersonEntity> userPersons = userPersonService.selectByRegisterId(userRegisterEntity.getId().toString());
userRegisterEntity.setUserPersons(userPersons);
}
return ResultVOUtils.success(userRegisterEntity);
}

@ -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 org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface UserPersonDao extends BaseMapperPlus<UserPersonDao, UserPersonEntity, UserPersonEntity> {
import org.apache.ibatis.annotations.Param;
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<UserPersonDao, UserPersonEntity, UserPersonEntity> {
List<UserRegisterEntity> filterUserPersons(UserPersonFilterRequest userPersonFilterRequest);
List<UserPersonEntity> selectByRegisterId(@Param("registerId") String registerId);
}

@ -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;
}

@ -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<UserRegisterEntity> filterUserPersons(UserPersonFilterRequest userPersonFilterRequest);
List<UserPersonEntity> selectByRegisterId(String registerId);
}

@ -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<UserRegisterEntity> 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<UserPersonEntity> selectByRegisterId(String registerId) {
return userPersonDao.selectByRegisterId(registerId);
}
}

@ -4,7 +4,32 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.auth.UserPersonDao">
<select id="filterUserPersons" parameterType="com.glxp.api.req.auth.UserPersonFilterRequest"
resultType="com.glxp.api.entity.auth.UserPersonEntity">
SELECT *
FROM user_person
<where>
<if test="registerId != null and ''!=registerId">
AND registerId = #{registerId}
</if>
<if test="companyId != null and ''!=companyId">
AND companyId = #{companyId}
</if>
<if test="mobile != null and ''!=mobile">
AND mobile = #{mobile}
</if>
<if test="name != null and ''!=name">
AND name = #{name}
</if>
</where>
</select>
<select id="selectByRegisterId" parameterType="java.lang.String"
resultType="com.glxp.api.entity.auth.UserPesonEntity">
SELECT *
FROM user_person
where registerId=#{registerId}
</select>
<insert id="insert" keyProperty="roleId" useGeneratedKeys="true"
parameterType="com.glxp.api.entity.auth.UserPersonEntity">

Loading…
Cancel
Save