This commit is contained in:
2025-03-04 16:15:02 +08:00
parent d1c4cddd91
commit f46223ae10
21 changed files with 56 additions and 23 deletions

View File

@ -28,6 +28,7 @@ import com.ruoyi.wgz.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.var;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@ -517,10 +518,15 @@ public class WgzAppController {
@GetMapping("/wgzUserAttachmentAcquisition")
public AjaxResult<WgzAppAttachmentAcquisitionRes> userAttachmentAcquisition(@Validated WgzAppAttachmentAcquisitionReq req) {
Long appUserId = SecurityUtils.getAppUserId();
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
Long recruitId = by.getRecruitId();
if (!appUserId.equals(recruitId)){
throw new RuntimeException("当前用户不是该招工的申请人");
Long recruitId;
if (req.getType()==1){
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
recruitId = by.getRecruitId();
if (!appUserId.equals(recruitId)){
throw new RuntimeException("当前用户不是该招工的申请人");
}
} else {
recruitId = 0L;
}
//返回对象
WgzAppAttachmentAcquisitionRes wgzAppAttachmentAcquisitionRes = new WgzAppAttachmentAcquisitionRes();
@ -528,20 +534,22 @@ public class WgzAppController {
//附件类型
String annexType = "wgz_attachment";
//具体附件值
String[] specifiedAttachment = req.getSpecifiedAttachment();
List<String> specifiedAttachment = req.getSpecifiedAttachment();
//String[] SpecifiedAttachment = {"0"};
//1、获取指定实名认证的附件结构返回
List<SysDictData> data = dictTypeService.selectDictDataByType(annexType);
data.forEach(item -> {
for (String val : specifiedAttachment) {
for (SysDictData item : data) {
for (int i = 0; i < specifiedAttachment.size(); i++) {
String dictValue = item.getDictValue();
String val = specifiedAttachment.get(i);
if (dictValue.equals(val)) {
//2、每个结构下有那些附件附件可能有多个或一个查询附件表
AnnexQueryBo annexQueryBo = new AnnexQueryBo();
annexQueryBo.setUserId(appUserId);
annexQueryBo.setUserType(WGZ);
annexQueryBo.setRecruitId(recruitId);
if (req.getType()==1){
annexQueryBo.setRecruitId(recruitId);
}
annexQueryBo.setAnnexType(val);
List<Annex> annexes = iAnnexService.queryList(annexQueryBo);
//3、具体附件结构
@ -552,7 +560,7 @@ public class WgzAppController {
resData.add(wgzAutonymAnnex);
}
}
});
}
return AjaxResult.success(wgzAppAttachmentAcquisitionRes.setWgzAutonymAnnex(resData));
}