实名认证
This commit is contained in:
@ -1,13 +1,18 @@
|
||||
package com.ruoyi.web.controller.wgz.controller;
|
||||
|
||||
|
||||
import com.ruoyi.common.bo.AnnexQueryBo;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppPersonalBasicInformationReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserLongInReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserRegisterReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzRealNameAuthenticationReq;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.domain.Annex;
|
||||
import com.ruoyi.common.service.IAnnexService;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import com.ruoyi.wgz.bo.WgzAutonymAnnex;
|
||||
import com.ruoyi.wgz.bo.WgzUserQueryBo;
|
||||
import com.ruoyi.wgz.bo.req.*;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppAttachmentAcquisitionRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppPersonalBasicInformationRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppUserLongInRes;
|
||||
import com.ruoyi.wgz.service.IWgzUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -17,6 +22,10 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP务工者Controller
|
||||
*
|
||||
@ -32,6 +41,12 @@ public class WgzAppController {
|
||||
|
||||
private final IWgzUserService iWgzUserService;
|
||||
|
||||
@Autowired
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@Autowired
|
||||
private IAnnexService iAnnexService;
|
||||
|
||||
|
||||
/**
|
||||
* 【注册】务工者注册
|
||||
@ -39,20 +54,79 @@ public class WgzAppController {
|
||||
@ApiOperation("APP务工者注册")
|
||||
@PreAuthorize("@ss.hasPermi('wgzApp:user:register')")
|
||||
@PostMapping("/wgzRegister")
|
||||
public AjaxResult userRegister(@Validated @RequestBody WgzAppUserRegisterReq bo) {
|
||||
public AjaxResult<Boolean> userRegister(@Validated @RequestBody WgzAppUserRegisterReq bo) {
|
||||
return AjaxResult.success(iWgzUserService.userRegister(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 【我的】【个人基本信息】查询基础用户信息(还未带附件信息)
|
||||
*/
|
||||
@ApiOperation("APP务工者-修改用户头像")
|
||||
@PreAuthorize("@ss.hasPermi('wgzApp:user:userModifyingUserProfilePicture')")
|
||||
@PutMapping("/wgzUserModifyingUserProfilePicture")
|
||||
public AjaxResult<Boolean> userModifyingUserProfilePicture(@Validated @RequestBody WgzAppModifyingUserProfilePictureReq req) {
|
||||
return AjaxResult.success(iWgzUserService.userModifyingUserProfilePicture(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 【我的】【个人基本信息】查询基础用户信息(还未带附件信息)
|
||||
*/
|
||||
@ApiOperation("APP务工者-个人基本信息")
|
||||
@PreAuthorize("@ss.hasPermi('wgzApp:user:userPersonalBasicInformation')")
|
||||
@GetMapping("/wgzPersonalBasicInformation")
|
||||
@GetMapping("/wgzUserPersonalBasicInformation")
|
||||
public AjaxResult<WgzAppPersonalBasicInformationRes> userPersonalBasicInformation(@Validated WgzAppPersonalBasicInformationReq req) {
|
||||
return AjaxResult.success(iWgzUserService.userPersonalBasicInformation(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 【我的】【实名认证】实名认证之务工者附件结构获取
|
||||
*/
|
||||
@ApiOperation("APP务工者-实名认证·附件获取")
|
||||
@PreAuthorize("@ss.hasPermi('wgzApp:user:userAttachmentAcquisition')")
|
||||
@GetMapping("/wgzUserAttachmentAcquisition")
|
||||
public AjaxResult<WgzAppAttachmentAcquisitionRes> userAttachmentAcquisition(@Validated WgzAppAttachmentAcquisitionReq req) {
|
||||
//返回对象
|
||||
WgzAppAttachmentAcquisitionRes wgzAppAttachmentAcquisitionRes = new WgzAppAttachmentAcquisitionRes();
|
||||
List<WgzAutonymAnnex> resData = new ArrayList<>();
|
||||
//附件类型
|
||||
String userType = "wgz_attachment";
|
||||
//具体附件值
|
||||
String[] SpecifiedAttachment = {"0"};
|
||||
|
||||
//1、获取指定实名认证的附件结构返回
|
||||
List<SysDictData> data = dictTypeService.selectDictDataByType(userType);
|
||||
data.forEach(item -> {
|
||||
for (String val : SpecifiedAttachment) {
|
||||
String dictValue = item.getDictValue();
|
||||
if (dictValue.equals(val)) {
|
||||
//2、每个结构下有那些附件(附件可能有多个或一个);查询附件表
|
||||
AnnexQueryBo annexQueryBo = new AnnexQueryBo();
|
||||
annexQueryBo.setUserId(req.getUserId());
|
||||
annexQueryBo.setUserType(userType);
|
||||
annexQueryBo.setAnnexType(val);
|
||||
List<Annex> annexes = iAnnexService.queryList(annexQueryBo);
|
||||
//3、具体附件结构
|
||||
WgzAutonymAnnex wgzAutonymAnnex = new WgzAutonymAnnex().
|
||||
setUserType(userType).
|
||||
setDictLabel(item.getDictLabel()).
|
||||
setDictValue(dictValue).setAnnex(annexes);
|
||||
resData.add(wgzAutonymAnnex);
|
||||
}
|
||||
}
|
||||
});
|
||||
return AjaxResult.success(wgzAppAttachmentAcquisitionRes.setWgzAutonymAnnex(resData));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 【我的】【实名认证】实名认证·删除附件
|
||||
// */
|
||||
// @ApiOperation("APP务工者-实名认证·删除附件")
|
||||
// @PreAuthorize("@ss.hasPermi('wgzApp:user:userDeleteAttachment')")
|
||||
// @DeleteMapping("/WgzUserDeleteAttachment/{attachmentId}")
|
||||
// public AjaxResult<Boolean> userDeleteAttachment(@NotEmpty(message = "主键不能为空") @PathVariable Long attachmentId) {
|
||||
// return AjaxResult.success(iAnnexService.deleteByIds(attachmentId));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 【我的】【实名认证】实名认证
|
||||
*/
|
||||
|
Reference in New Issue
Block a user