变更附件获取

This commit is contained in:
2025-02-18 14:07:59 +08:00
parent 39ed23e9d4
commit 211b9c5475
2 changed files with 57 additions and 48 deletions

View File

@ -28,6 +28,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
@ -93,45 +94,6 @@ public class WgzAppController {
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));
}
// /**
// * 【我的】【实名认证】实名认证·删除附件
// */
@ -152,15 +114,6 @@ public class WgzAppController {
return AjaxResult.success(iWgzUserService.userRealNameAuthentication(req));
}
/**
* 【我的】【签协议】协议列表(无任何实际操作目前只是查看)
*/
@ApiOperation("APP务工者-签协议·协议列表")
@PreAuthorize("@ss.hasPermi('wgzApp:user:userSignAnAgreement')")
@GetMapping("/WgzUserSignAnAgreement")
public AjaxResult<WgzAppSubmitATestPaperRes> userSignAnAgreement(@Validated WgzAppSubmitATestPaperReq req) {
return AjaxResult.success(iWgzQuestionSaveService.userSubmitATestPaper(req));
}
/**
* 【我的】【岗前培训】获取安全教育考试试卷(随机获取)
@ -201,6 +154,56 @@ public class WgzAppController {
return AjaxResult.success(iWgzQuestionSaveService.userSubmitATestPaper(req));
}
/**
* 通用接口
* =================================================================================================================
* =================================================================================================================
* =================================================================================================================
*/
/**
* 【我的】【实名认证】实名认证之务工者附件结构获取
0-资格证书
* 【我的】【签协议】协议列表
1-劳动合同
*/
@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 = req.getSpecifiedAttachment();
//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));
}
/**
* 控制层业务
* =================================================================================================================

View File

@ -7,6 +7,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
@Data
@ -17,4 +18,9 @@ public class WgzAppAttachmentAcquisitionReq implements Serializable {
@ApiModelProperty("唯一标识")
@NotNull(message = "唯一标识不能为空")
private Long userId;
@ApiModelProperty("0资格证书 1劳动合同 2保单")
@NotNull(message = "唯一标识不能为空")
@Size(min = 1, message = "唯一标识数组必须至少包含一个元素")
private String[] specifiedAttachment;
}