人员附件修改相关1.0

This commit is contained in:
mash 2023-02-07 16:50:38 +08:00
parent bcd3d389a7
commit 5c1332690c
3 changed files with 12 additions and 6 deletions

View File

@ -67,7 +67,7 @@ public class Personnel extends BaseEntity {
private String education; private String education;
@ApiModelProperty(value = "是否应届毕业生") @ApiModelProperty(value = "是否应届毕业生")
private Boolean freshGraduate; private Integer freshGraduate;
@ApiModelProperty(value = "毕业院校") @ApiModelProperty(value = "毕业院校")
private String academy; private String academy;

View File

@ -32,7 +32,7 @@ public class PersonnelRequest {
@ApiModelProperty(value = "性别") @ApiModelProperty(value = "性别")
@NotNull(message = "性别不能为空") @NotNull(message = "性别不能为空")
private Boolean gender; private Integer gender;
@ApiModelProperty(value = "出生日期") @ApiModelProperty(value = "出生日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")

View File

@ -33,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.util.StringUtils; import org.thymeleaf.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.constraints.Null;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -249,7 +250,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
} }
return path; return path;
} }
return null; return new ArrayList<>();
} }
public void saveAlteration(String details,Object before ,Object after,String type, String id){ public void saveAlteration(String details,Object before ,Object after,String type, String id){
@ -258,8 +259,12 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
alteration.setDetails(details); alteration.setDetails(details);
alteration.setType(type); alteration.setType(type);
alteration.setRelevancyId(id); alteration.setRelevancyId(id);
alteration.setBeforeChange((String) before); if (ObjectUtil.isNotNull(before)){
alteration.setAfterChange((String) after); alteration.setBeforeChange( before.toString());
}else {
alteration.setBeforeChange("");
}
alteration.setAfterChange(after.toString());
alterationMapper.insert(alteration); alterationMapper.insert(alteration);
} }
@ -268,8 +273,8 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
if (StrUtil.isNotBlank(file)){ if (StrUtil.isNotBlank(file)){
List<String> cardFile = Arrays.asList(file.split(",")); List<String> cardFile = Arrays.asList(file.split(","));
ArrayList<AttachmentDto> attachmentDtos = new ArrayList<>(); ArrayList<AttachmentDto> attachmentDtos = new ArrayList<>();
AttachmentDto dto = new AttachmentDto();
for (String s : cardFile) { for (String s : cardFile) {
AttachmentDto dto = new AttachmentDto();
Attachment attachment = attachmentService.selectByIdAndPath(id, s); Attachment attachment = attachmentService.selectByIdAndPath(id, s);
if (ObjectUtil.isNotEmpty(attachment)){ if (ObjectUtil.isNotEmpty(attachment)){
dto.setName(attachment.getName()); dto.setName(attachment.getName());
@ -277,6 +282,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
dto.setSize(attachment.getSize()); dto.setSize(attachment.getSize());
attachmentDtos.add(dto); attachmentDtos.add(dto);
} }
} }
return attachmentDtos; return attachmentDtos;
} }