附件数据回显调整

This commit is contained in:
mash 2023-02-24 13:52:08 +08:00
parent 0ca3a8266b
commit 6d43ef7938
2 changed files with 15 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.Attachment; import com.ydool.staff.entity.Attachment;
import com.ydool.staff.mapper.AttachmentMapper; import com.ydool.staff.mapper.AttachmentMapper;
import com.ydool.staff.service.IAttachmentService; import com.ydool.staff.service.IAttachmentService;
import com.ydool.system.entity.User;
import com.ydool.system.mapper.UserMapper; import com.ydool.system.mapper.UserMapper;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -19,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
@ -87,6 +89,16 @@ public class AttachmentServiceImpl extends BaseService<AttachmentMapper, Attachm
wrapper.eq(Attachment::getTargetType, type); wrapper.eq(Attachment::getTargetType, type);
} }
Page<Attachment> attachmentPage = attachmentMapper.selectPage(page, wrapper); Page<Attachment> attachmentPage = attachmentMapper.selectPage(page, wrapper);
List<Attachment> records = attachmentPage.getRecords();
attachmentPage.setRecords(records.stream().map(e->{
User user = userMapper.selectById(e.getCreatedId());
e.setCreatedId(user.getUserName());
User user1 = userMapper.selectById(e.getUpdatedId());
e.setUpdatedId(user1.getUserName());
return e;
}).collect(Collectors.toList()));
return AjaxResult.ok().data(attachmentPage); return AjaxResult.ok().data(attachmentPage);
} }
} }

View File

@ -295,6 +295,9 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
List<AttachmentRequest> engageFiles = request.getEngageFiles(); List<AttachmentRequest> engageFiles = request.getEngageFiles();
List<AttachmentRequest> educationFiles = request.getEducationFiles(); List<AttachmentRequest> educationFiles = request.getEducationFiles();
List<AttachmentRequest> auditFiles = request.getAuditFiles(); List<AttachmentRequest> auditFiles = request.getAuditFiles();
if ("入职".equals(per.getWorkState())) {
return AjaxResult.fail().msg("该人员未在职,不能变更数据");
}
if ("1".equals(per.getAlterationSign())) { if ("1".equals(per.getAlterationSign())) {
return AjaxResult.fail().msg("该人员在申报中,资料未完成审批,请等待领导审批!"); return AjaxResult.fail().msg("该人员在申报中,资料未完成审批,请等待领导审批!");
} }