Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
774c7e227d
|
@ -27,6 +27,7 @@ public interface UrlConstant {
|
|||
String MENU = API + "/menu";
|
||||
|
||||
String PERSON = API + "/person";
|
||||
String EXCHANGE = API + "/exchange";
|
||||
|
||||
String COMPANY = API + "/company";
|
||||
|
||||
|
|
|
@ -2,10 +2,15 @@ package com.ydool.common.utils;
|
|||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Date;
|
||||
|
||||
public class UploadUtils {
|
||||
|
@ -31,4 +36,33 @@ public class UploadUtils {
|
|||
return System.getProperty("user.dir");
|
||||
}
|
||||
|
||||
public static void download(HttpServletResponse response, String fullFilePath, String fileName) {
|
||||
response.reset();
|
||||
response.setContentType("application/octet-stream; charset=utf-8");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.addHeader("Content-Disposition", "attachment; filename*=utf-8'zh_cn'" + encodeUrl(StrUtil.isNotBlank(fileName) ? fileName : FileUtil.getName(fullFilePath)));
|
||||
try {
|
||||
IoUtil.copy(FileUtil.getInputStream(fullFilePath), response.getOutputStream());
|
||||
response.flushBuffer();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static String encodeUrl(String part) {
|
||||
return encodeUrl(part, "UTF-8");
|
||||
}
|
||||
|
||||
public static String encodeUrl(String part, String encoding) {
|
||||
if (part == null) {
|
||||
return null;
|
||||
} else {
|
||||
try {
|
||||
return URLEncoder.encode(part, encoding);
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
package com.ydool.staff.controller;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import com.ydool.common.base.BaseController;
|
||||
import com.ydool.common.constant.UrlConstant;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.dto.ExchangePageDto;
|
||||
import com.ydool.staff.dto.PersonnelByExchangeDto;
|
||||
import com.ydool.staff.dto.PersonnelDto;
|
||||
import com.ydool.staff.entity.Exchange;
|
||||
import com.ydool.staff.request.ExchangeRequest;
|
||||
import com.ydool.staff.request.PersonnelDeleteRequest;
|
||||
import com.ydool.staff.request.PersonnelRequest;
|
||||
import com.ydool.staff.request.PersonnelUpdateRequest;
|
||||
import com.ydool.staff.service.IExchangeService;
|
||||
import com.ydool.staff.service.IPersonnelService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author msh
|
||||
* @version 1.0
|
||||
* @date 2023/2/2 17:02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(UrlConstant.EXCHANGE)
|
||||
@Api(tags = "人员选调", value = "人员选调")
|
||||
@ApiSupport(order = 5)
|
||||
public class ExchangeController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IExchangeService exchangeService;
|
||||
@Resource
|
||||
private IPersonnelService personnelService;
|
||||
|
||||
|
||||
@GetMapping("exchangePage")
|
||||
@ApiOperation(value = "人员选调列表,传id查一条",response = ExchangePageDto.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "current", value = "当前页"),
|
||||
@ApiImplicitParam(name = "size", value = "每页条数"),
|
||||
@ApiImplicitParam(name = "id", value = "人员选调id")})
|
||||
public AjaxResult exchangePage(String id){
|
||||
return exchangeService.exchangePage(getPage(),id);
|
||||
}
|
||||
|
||||
@PostMapping("saveExchange")
|
||||
@ApiOperation(value = "新增人员选调",response = ExchangeRequest.class)
|
||||
public AjaxResult saveExchange(@Validated @RequestBody ExchangeRequest exchangeRequest){
|
||||
return exchangeService.saveExchange(exchangeRequest);
|
||||
}
|
||||
@GetMapping("personnelByExchangeList")
|
||||
@ApiOperation(value = "点击姓名返人员列表",response = PersonnelByExchangeDto.class)
|
||||
public AjaxResult personnelByExchangeList(){
|
||||
return personnelService.personnelByExchangeList();
|
||||
}
|
||||
|
||||
@GetMapping("deleteExchange")
|
||||
@ApiOperation(value = "删除人员选调",response = PersonnelDeleteRequest.class)
|
||||
public AjaxResult deleteExchange(@RequestBody PersonnelDeleteRequest request){
|
||||
return exchangeService.deleteExchangeById(request);
|
||||
}
|
||||
|
||||
}
|
|
@ -21,6 +21,12 @@ public class OrganizationController extends BaseController {
|
|||
@Autowired
|
||||
IOrganizationService organizationService;
|
||||
|
||||
@GetMapping("/selectOrganization")
|
||||
@ApiOperation(value = "企业名称列表")
|
||||
public AjaxResult selectOrganization() {
|
||||
return organizationService.selectOrganization();
|
||||
}
|
||||
|
||||
@GetMapping("/selectOrganizationByName")
|
||||
@ApiOperation(value = "企业名称查企业信息")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "companyName", value = "企业名称", required = true)})
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
package com.ydool.staff.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import com.ydool.common.base.BaseController;
|
||||
import com.ydool.common.constant.UrlConstant;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.common.utils.UploadUtils;
|
||||
import com.ydool.staff.dto.PersonnelDto;
|
||||
import com.ydool.staff.entity.Attachment;
|
||||
import com.ydool.staff.request.PersonnelDeleteRequest;
|
||||
import com.ydool.staff.request.PersonnelRequest;
|
||||
import com.ydool.staff.request.PersonnelUpdateRequest;
|
||||
import com.ydool.staff.service.IAttachmentService;
|
||||
import com.ydool.staff.service.IPersonnelService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
@ -15,12 +19,9 @@ import io.swagger.annotations.ApiImplicitParams;
|
|||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -33,10 +34,12 @@ import java.util.List;
|
|||
@Api(tags = "人员", value = "人员")
|
||||
@ApiSupport(order = 6)
|
||||
public class PersonnelController extends BaseController {
|
||||
@Autowired
|
||||
@Resource
|
||||
private IPersonnelService personnelService;
|
||||
@Autowired
|
||||
IAttachmentService attachmentService;
|
||||
|
||||
@GetMapping(value = "personnelList")
|
||||
@GetMapping( "personnelList")
|
||||
@ApiOperation(value = "人员列表,传id查一条",response = PersonnelDto.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "current", value = "当前页"),
|
||||
|
@ -52,9 +55,9 @@ public class PersonnelController extends BaseController {
|
|||
return personnelService.savePersonnel(personnelRequest);
|
||||
}
|
||||
@PostMapping(value = "deletePersonnel")
|
||||
@ApiOperation(value = "删除/批量删除人员")
|
||||
public AjaxResult deletePersonnel(@RequestBody PersonnelDeleteRequest personnelDeleteRequest){
|
||||
return personnelService.deleteByIds(personnelDeleteRequest);
|
||||
@ApiOperation(value = "删除/批量删除人员",response = PersonnelDeleteRequest.class)
|
||||
public AjaxResult deletePersonnel(@RequestBody PersonnelDeleteRequest request){
|
||||
return personnelService.deleteByIds(request);
|
||||
}
|
||||
@PostMapping(value = "updatePersonnel")
|
||||
@ApiOperation(value = "修改人员")
|
||||
|
@ -62,4 +65,18 @@ public class PersonnelController extends BaseController {
|
|||
return personnelService.updatePersonnel(personnelDeleteRequest);
|
||||
}
|
||||
|
||||
@GetMapping("/download")
|
||||
@ApiOperation(value = "下载文件")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "path", value = "文件路径"), @ApiImplicitParam(name = "fileName", value = "文件名")})
|
||||
public void download(String path, String fileName) {
|
||||
String fullFilePath = UploadUtils.getWebRoot() + path;
|
||||
UploadUtils.download(response, fullFilePath, fileName);
|
||||
}
|
||||
|
||||
@GetMapping("/fileList")
|
||||
@ApiOperation(value = "文件列表")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "current", value = "当前页"), @ApiImplicitParam(name = "size", value = "每页条数"), @ApiImplicitParam(name = "id", value = "人员id", required = true)})
|
||||
public AjaxResult fileList(String id) {
|
||||
return attachmentService.fileList(new Page<Attachment>(getPageNum(), getPageSize()), id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package com.ydool.staff.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author msh
|
||||
* @version 1.0
|
||||
* @date 2023/2/2 17:15
|
||||
*/
|
||||
@Data
|
||||
public class ExchangePageDto {
|
||||
|
||||
@ApiModelProperty(value = "员工id")
|
||||
private String personnelId;
|
||||
|
||||
@ApiModelProperty(value = "调入企业名称")
|
||||
private String willCompanyName;
|
||||
|
||||
@ApiModelProperty(value = "调出企业名称")
|
||||
private String originalCompanyName;
|
||||
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String cardId;
|
||||
|
||||
@ApiModelProperty(value = "现所在部门")
|
||||
private String nowDept;
|
||||
|
||||
@ApiModelProperty(value = "拟所在部门")
|
||||
private String willDept;
|
||||
|
||||
@ApiModelProperty(value = "现任岗位职务")
|
||||
private String nowPosition;
|
||||
|
||||
@ApiModelProperty(value = "拟任岗位职务")
|
||||
private String willPosition;
|
||||
|
||||
@ApiModelProperty(value = "填报人")
|
||||
private String written;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "填报时间")
|
||||
private LocalDateTime createdAt;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.ydool.staff.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author msh
|
||||
* @version 1.0
|
||||
* @date 2023/2/3 11:02
|
||||
*/
|
||||
@Data
|
||||
public class PersonnelByExchangeDto {
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String numberId;
|
||||
|
||||
@ApiModelProperty(value = "统一社会信用代码")
|
||||
private String socialCreditCode;
|
||||
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String companyName;
|
||||
|
||||
@ApiModelProperty(value = "所在部门")
|
||||
private String presentDept;
|
||||
|
||||
@ApiModelProperty(value = "岗位职务")
|
||||
private String position;
|
||||
}
|
|
@ -38,10 +38,6 @@ public class PersonnelDto {
|
|||
@ApiModelProperty(value = "人员类型")
|
||||
private String personnelType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "created_at", fill = FieldFill.INSERT)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
|
|
@ -31,10 +31,10 @@ public class Attachment extends BaseEntity{
|
|||
private String targetType;
|
||||
|
||||
@ApiModelProperty(value = "附件名")
|
||||
private String title;
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "附件路径")
|
||||
private String attachment;
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(value = "文件大小")
|
||||
private String size;
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package com.ydool.staff.entity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ydool.common.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员选调表
|
||||
* </p>
|
||||
*
|
||||
* @author msh
|
||||
* @since 2023-02-02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("t_lc_exchange")
|
||||
@ApiModel(value="Exchange对象", description="人员选调表")
|
||||
public class Exchange extends BaseEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "员工id")
|
||||
@NotBlank(message = "员工姓名不能为空")
|
||||
private String personnelId;
|
||||
|
||||
@ApiModelProperty(value = "调入企业id")
|
||||
@NotBlank(message = "调入企业名称不能为空")
|
||||
private String willCompanyId;
|
||||
|
||||
@ApiModelProperty(value = "拟所在部门")
|
||||
@NotBlank(message = "拟所在部门不能为空")
|
||||
private String willDept;
|
||||
|
||||
@ApiModelProperty(value = "拟任岗位职务")
|
||||
@NotBlank(message = "拟任岗位职务不能为空")
|
||||
private String willPosition;
|
||||
|
||||
@ApiModelProperty(value = "选调理由")
|
||||
private String excReason;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "选调相关附件")
|
||||
private String excFile;
|
||||
|
||||
@ApiModelProperty(value = "审批状态")
|
||||
private String auditState;
|
||||
|
||||
}
|
|
@ -31,6 +31,13 @@ public class Personnel extends BaseEntity {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
public static final String CARD_FILE = "card";
|
||||
public static final String ENGAGE_FILE = "engage";
|
||||
public static final String JOBTITLE_FILE = "jobtitle";
|
||||
public static final String EDUCATION_FILE = "education";
|
||||
public static final String AUDIT_FILE = "audit";
|
||||
|
||||
@ApiModelProperty(value = "统一社会信用代码")
|
||||
private String socialCreditCode;
|
||||
|
||||
|
@ -60,7 +67,7 @@ public class Personnel extends BaseEntity {
|
|||
private String education;
|
||||
|
||||
@ApiModelProperty(value = "是否应届毕业生")
|
||||
private Integer freshGraduate;
|
||||
private Boolean freshGraduate;
|
||||
|
||||
@ApiModelProperty(value = "毕业院校")
|
||||
private String academy;
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package com.ydool.staff.mapper;
|
||||
|
||||
import com.ydool.staff.entity.Exchange;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员选调表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author msh
|
||||
* @since 2023-02-02
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExchangeMapper extends MPJBaseMapper<Exchange> {
|
||||
|
||||
}
|
|
@ -11,15 +11,12 @@ import lombok.Data;
|
|||
@Data
|
||||
public class AttachmentRequest {
|
||||
|
||||
@ApiModelProperty(value = "附件类型", required = true)
|
||||
private String targetType;
|
||||
|
||||
@ApiModelProperty(value = "文件名", required = true)
|
||||
@ApiModelProperty(value = "文件名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "路径", required = true)
|
||||
@ApiModelProperty(value = "路径")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(value = "大小", required = true)
|
||||
@ApiModelProperty(value = "大小")
|
||||
private String size;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package com.ydool.staff.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author msh
|
||||
* @version 1.0
|
||||
* @date 2023/2/3 9:56
|
||||
*/
|
||||
@Data
|
||||
public class ExchangeRequest {
|
||||
@ApiModelProperty(value = "员工id")
|
||||
@NotBlank(message = "员工姓名不能为空")
|
||||
private String personnelId;
|
||||
|
||||
@ApiModelProperty(value = "调入企业id")
|
||||
@NotBlank(message = "调入企业名称不能为空")
|
||||
private String willCompanyId;
|
||||
|
||||
@ApiModelProperty(value = "拟所在部门")
|
||||
@NotBlank(message = "拟所在部门不能为空")
|
||||
private String willDept;
|
||||
|
||||
@ApiModelProperty(value = "拟任岗位职务")
|
||||
@NotBlank(message = "拟任岗位职务不能为空")
|
||||
private String willPosition;
|
||||
|
||||
@ApiModelProperty(value = "选调理由")
|
||||
private String excReason;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "选调相关附件")
|
||||
private List<AttachmentRequest> attachmentList;
|
||||
|
||||
}
|
|
@ -31,8 +31,8 @@ public class PersonnelRequest {
|
|||
private String companyName;
|
||||
|
||||
@ApiModelProperty(value = "性别")
|
||||
@NotBlank(message = "性别不能为空")
|
||||
private String gender;
|
||||
@NotNull(message = "性别不能为空")
|
||||
private Boolean gender;
|
||||
|
||||
@ApiModelProperty(value = "出生日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
|
@ -55,8 +55,8 @@ public class PersonnelRequest {
|
|||
private String education;
|
||||
|
||||
@ApiModelProperty(value = "是否应届毕业生")
|
||||
@NotBlank(message = "是否应届毕业生不能为空")
|
||||
private String freshGraduate;
|
||||
@NotNull(message = "是否应届毕业生不能为空")
|
||||
private Boolean freshGraduate;
|
||||
|
||||
@ApiModelProperty(value = "毕业院校")
|
||||
@NotBlank(message = "毕业院校不能为空")
|
||||
|
@ -110,13 +110,6 @@ public class PersonnelRequest {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date hiredate;
|
||||
|
||||
@ApiModelProperty(value = "退休时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date retirementTime;
|
||||
|
||||
@ApiModelProperty(value = "离职时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date resignationTime;
|
||||
|
||||
@ApiModelProperty(value = "退休返聘开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
|
@ -133,12 +126,18 @@ public class PersonnelRequest {
|
|||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "初审意见")
|
||||
private String firstTrialRemark;
|
||||
@ApiModelProperty(value = "身份证附件")
|
||||
private List<AttachmentRequest> cardFile;
|
||||
|
||||
@ApiModelProperty(value = "终审意见")
|
||||
private String finalTrialRemark;
|
||||
@ApiModelProperty(value = "聘任证书附件")
|
||||
private List<AttachmentRequest> engageFile;
|
||||
|
||||
@ApiModelProperty(value = "相关附件")
|
||||
private List<AttachmentRequest> attachmentList;
|
||||
@ApiModelProperty(value = "职称证书附件")
|
||||
private List<AttachmentRequest> jobTitleFile;
|
||||
|
||||
@ApiModelProperty(value = "学历证书附件")
|
||||
private List<AttachmentRequest> educationFile;
|
||||
|
||||
@ApiModelProperty(value = "审批资料附件")
|
||||
private List<AttachmentRequest> auditFile;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class PersonnelUpdateRequest {
|
|||
|
||||
@ApiModelProperty(value = "是否应届毕业生")
|
||||
@NotBlank(message = "是否应届毕业生不能为空")
|
||||
private Integer freshGraduate;
|
||||
private Boolean freshGraduate;
|
||||
|
||||
@ApiModelProperty(value = "毕业院校")
|
||||
@NotBlank(message = "毕业院校不能为空")
|
||||
|
@ -56,6 +56,13 @@ public class PersonnelUpdateRequest {
|
|||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "相关附件")
|
||||
private List<AttachmentRequest> attachmentList;
|
||||
@ApiModelProperty(value = "身份证附件")
|
||||
private List<AttachmentRequest> cardFile;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "学历证书附件")
|
||||
private List<AttachmentRequest> educationFile;
|
||||
|
||||
@ApiModelProperty(value = "审批资料附件")
|
||||
private List<AttachmentRequest> auditFile;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ydool.staff.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.entity.Attachment;
|
||||
import com.ydool.staff.request.AttachmentRequest;
|
||||
|
||||
|
@ -18,5 +20,7 @@ public interface IAttachmentService {
|
|||
boolean deleteById(String targetType,String id);
|
||||
|
||||
Attachment selectFile(String path, String id);
|
||||
|
||||
AjaxResult fileList(Page<Attachment> page, String id);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.ydool.staff.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.request.ExchangeRequest;
|
||||
import com.ydool.staff.request.PersonnelDeleteRequest;
|
||||
import com.ydool.staff.request.PersonnelUpdateRequest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员选调表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author msh
|
||||
* @since 2023-02-02
|
||||
*/
|
||||
public interface IExchangeService {
|
||||
|
||||
AjaxResult exchangePage(Page page, String id);
|
||||
|
||||
AjaxResult saveExchange(ExchangeRequest exchangeRequest);
|
||||
|
||||
AjaxResult deleteExchangeById(PersonnelDeleteRequest request);
|
||||
}
|
||||
|
|
@ -22,5 +22,7 @@ public interface IOrganizationService {
|
|||
AjaxResult deleteOrganization(IdsRequest id);
|
||||
|
||||
AjaxResult selectOrganizationByName(String companyName);
|
||||
|
||||
AjaxResult selectOrganization();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ public interface IPersonnelService {
|
|||
*/
|
||||
AjaxResult personnelList(Page page , String id);
|
||||
|
||||
AjaxResult personnelByExchangeList();
|
||||
|
||||
/**
|
||||
* 新增保存
|
||||
* @param personnelRequest
|
||||
|
@ -43,5 +45,8 @@ public interface IPersonnelService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult updatePersonnel(PersonnelUpdateRequest personnelDeleteRequest);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
package com.ydool.staff.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ydool.common.base.BaseService;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.entity.Attachment;
|
||||
import com.ydool.staff.mapper.AttachmentMapper;
|
||||
import com.ydool.staff.request.AttachmentRequest;
|
||||
import com.ydool.staff.service.IAttachmentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 附件表 服务类
|
||||
|
@ -20,6 +25,9 @@ import org.springframework.stereotype.Service;
|
|||
public class AttachmentServiceImpl extends BaseService<AttachmentMapper, Attachment> implements IAttachmentService {
|
||||
|
||||
|
||||
@Autowired
|
||||
AttachmentMapper attachmentMapper;
|
||||
|
||||
@Override
|
||||
public boolean savePersonnel(Attachment entity) {
|
||||
return save(entity);
|
||||
|
@ -32,9 +40,12 @@ public class AttachmentServiceImpl extends BaseService<AttachmentMapper, Attachm
|
|||
|
||||
@Override
|
||||
public Attachment selectFile(String path, String id) {
|
||||
return getOne(new LambdaQueryWrapper<Attachment>().eq(Attachment::getAttachment, path).eq(Attachment::getTargetId,id));
|
||||
|
||||
return getOne(new LambdaQueryWrapper<Attachment>().eq(Attachment::getPath, path).eq(Attachment::getTargetId, id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult fileList(Page<Attachment> page, String id) {
|
||||
return AjaxResult.ok().data(attachmentMapper.selectPage(page, new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, id)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
package com.ydool.staff.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.dto.ExchangePageDto;
|
||||
import com.ydool.staff.entity.Attachment;
|
||||
import com.ydool.staff.entity.Exchange;
|
||||
import com.ydool.common.base.BaseService;
|
||||
import com.ydool.staff.entity.Organization;
|
||||
import com.ydool.staff.entity.Personnel;
|
||||
import com.ydool.staff.mapper.AttachmentMapper;
|
||||
import com.ydool.staff.mapper.ExchangeMapper;
|
||||
import com.ydool.staff.mapper.OrganizationMapper;
|
||||
import com.ydool.staff.mapper.PersonnelMapper;
|
||||
import com.ydool.staff.request.AttachmentRequest;
|
||||
import com.ydool.staff.request.ExchangeRequest;
|
||||
import com.ydool.staff.request.PersonnelDeleteRequest;
|
||||
import com.ydool.staff.request.PersonnelUpdateRequest;
|
||||
import com.ydool.staff.service.IExchangeService;
|
||||
import com.ydool.system.entity.User;
|
||||
import com.ydool.system.mapper.UserMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员选调表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author msh
|
||||
* @since 2023-02-02
|
||||
*/
|
||||
@Service
|
||||
public class ExchangeServiceImpl extends BaseService<ExchangeMapper, Exchange> implements IExchangeService {
|
||||
|
||||
@Resource
|
||||
private PersonnelMapper personnelMapper;
|
||||
@Resource
|
||||
private AttachmentMapper attachmentMapper;
|
||||
@Resource
|
||||
private OrganizationMapper organizationMapper;
|
||||
@Resource
|
||||
private UserMapper userMapper;
|
||||
@Override
|
||||
public AjaxResult exchangePage(Page page, String id) {
|
||||
if (ObjectUtil.isNotNull(id)){
|
||||
return AjaxResult.ok().data(get(id));
|
||||
}
|
||||
Page exchangePage = page(page, new LambdaQueryWrapper<>());
|
||||
List<Exchange> list = exchangePage.getRecords();
|
||||
exchangePage.setRecords(list.stream().map(e->{
|
||||
ExchangePageDto dto = BeanUtil.copyProperties(e, ExchangePageDto.class);
|
||||
Personnel personnel = personnelMapper.selectById(dto.getPersonnelId());
|
||||
Organization organization = organizationMapper.selectById(e.getWillCompanyId());
|
||||
User user = userMapper.selectById((String)StpUtil.getLoginId());
|
||||
dto.setUserName(personnel.getUserName());
|
||||
dto.setOriginalCompanyName(personnel.getCompanyName());
|
||||
dto.setWillCompanyName(organization.getCompanyName());
|
||||
dto.setCardId(personnel.getNumberId());
|
||||
dto.setNowDept(personnel.getPresentDept());
|
||||
dto.setNowPosition(personnel.getPosition());
|
||||
dto.setWritten(user.getUserName());
|
||||
return dto;
|
||||
}).collect(Collectors.toList()));
|
||||
return AjaxResult.ok().data(exchangePage);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult saveExchange(ExchangeRequest exchangeRequest) {
|
||||
List<AttachmentRequest> attachmentList = exchangeRequest.getAttachmentList();
|
||||
ArrayList<String> s = new ArrayList<>();
|
||||
Exchange exchange = BeanUtil.copyProperties(exchangeRequest, Exchange.class);
|
||||
for (AttachmentRequest request : attachmentList) {
|
||||
s.add(request.getPath());
|
||||
exchange.setExcFile(StringUtils.join(s,','));
|
||||
}
|
||||
boolean save = save(exchange);
|
||||
for (AttachmentRequest request : attachmentList) {
|
||||
Attachment attachment = BeanUtil.copyProperties(request, Attachment.class);
|
||||
attachment.setTargetId(exchange.getId());
|
||||
attachmentMapper.insert(attachment);
|
||||
}
|
||||
return save ?AjaxResult.ok().msg("保存成功!"):AjaxResult.fail().msg("保存失败!");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult deleteExchangeById(PersonnelDeleteRequest request) {
|
||||
List<String> ids = request.getIds();
|
||||
boolean flag = false;
|
||||
if (1<ids.size()){
|
||||
for (String id : ids) {
|
||||
flag = removeById(id);
|
||||
}
|
||||
return flag?AjaxResult.ok().msg("批量删除成功!"):AjaxResult.fail().msg("批量删除失败!");
|
||||
}
|
||||
flag = removeById(ids.get(0));
|
||||
return flag?AjaxResult.ok().msg("删除成功!"):AjaxResult.fail().msg("删除失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -45,9 +45,9 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
|
|||
LambdaQueryWrapper<Organization> organizationLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
organizationLambdaQueryWrapper.eq(StrUtil.isNotBlank(companyName), Organization::getCompanyName, companyName);
|
||||
Page<Organization> selectPage = organizationMapper.selectPage(page, organizationLambdaQueryWrapper);
|
||||
for (Organization record : selectPage.getRecords()) {
|
||||
record.setUpdatedId(userMapper.selectById(record.getUpdatedId()).getUserName());
|
||||
}
|
||||
// for (Organization record : selectPage.getRecords()) {
|
||||
// record.setUpdatedId(userMapper.selectById(record.getUpdatedId()).getUserName());
|
||||
// }
|
||||
return AjaxResult.ok().data(selectPage);
|
||||
}
|
||||
|
||||
|
@ -80,5 +80,10 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
|
|||
public AjaxResult selectOrganizationByName(String companyName) {
|
||||
return AjaxResult.ok().data(organizationMapper.selectOne(new LambdaQueryWrapper<Organization>().eq(Organization::getCompanyName, companyName)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectOrganization() {
|
||||
return AjaxResult.ok().data(organizationMapper.selectList(null));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ydool.common.base.BaseService;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.dto.PersonnelByExchangeDto;
|
||||
import com.ydool.staff.dto.PersonnelDto;
|
||||
import com.ydool.staff.entity.Attachment;
|
||||
import com.ydool.staff.entity.Personnel;
|
||||
|
@ -16,14 +17,12 @@ import com.ydool.staff.request.PersonnelRequest;
|
|||
import com.ydool.staff.request.PersonnelUpdateRequest;
|
||||
import com.ydool.staff.service.IAttachmentService;
|
||||
import com.ydool.staff.service.IPersonnelService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -47,11 +46,9 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
@Override
|
||||
public AjaxResult personnelList(Page page , String id) {
|
||||
if (ObjectUtil.isNotNull(id)){
|
||||
Personnel personnel = get(id);
|
||||
return AjaxResult.ok().data(personnel);
|
||||
return AjaxResult.ok().data(get(id));
|
||||
}
|
||||
LambdaQueryWrapper<Personnel> wrapper = new LambdaQueryWrapper<>();
|
||||
Page personnelPage = page(page, wrapper);
|
||||
Page personnelPage = page(page, new LambdaQueryWrapper<>());
|
||||
List<Personnel> list = personnelPage.getRecords();
|
||||
personnelPage.setRecords(list.stream().map(e->{
|
||||
PersonnelDto dto = BeanUtil.copyProperties(e, PersonnelDto.class);
|
||||
|
@ -63,6 +60,13 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult personnelByExchangeList() {
|
||||
List<Personnel> list = list();
|
||||
List<PersonnelByExchangeDto> dtos = BeanUtil.copyToList(list, PersonnelByExchangeDto.class);
|
||||
return AjaxResult.ok().data(dtos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人员申报
|
||||
* @return
|
||||
|
@ -70,42 +74,18 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult savePersonnel(PersonnelRequest personnelRequest) {
|
||||
List<AttachmentRequest> attachmentList = personnelRequest.getAttachmentList();
|
||||
Personnel personnel = BeanUtil.copyProperties(personnelRequest, Personnel.class);
|
||||
ArrayList<String> card = new ArrayList<>();
|
||||
ArrayList<String> engage = new ArrayList<>();
|
||||
ArrayList<String> jobTitle = new ArrayList<>();
|
||||
ArrayList<String> education = new ArrayList<>();
|
||||
ArrayList<String> audit = new ArrayList<>();
|
||||
for (AttachmentRequest request : attachmentList) {
|
||||
if ("card".equals(request.getTargetType())){
|
||||
card.add(request.getPath());
|
||||
personnel.setCardFile(StringUtils.join(card,','));
|
||||
}else if ("engage".equals(request.getTargetType())){
|
||||
engage.add(request.getPath());
|
||||
personnel.setEngageFile(StringUtils.join(engage,','));
|
||||
}else if ("jobTitle".equals(request.getTargetType())){
|
||||
jobTitle.add(request.getPath());
|
||||
personnel.setJobTitleFile(StringUtils.join(jobTitle,','));
|
||||
}else if ("education".equals(request.getTargetType())){
|
||||
education.add(request.getPath());
|
||||
personnel.setEducationFile(StringUtils.join(education,','));
|
||||
}else if ("audit".equals(request.getTargetType())){
|
||||
audit.add(request.getPath());
|
||||
personnel.setAuditFile(StringUtils.join(audit,','));
|
||||
}
|
||||
}
|
||||
personnel.setCardFile(StringUtils.join(saveFilePath(personnelRequest.getCardFile(),Personnel.CARD_FILE,"",""),','));
|
||||
personnel.setEngageFile(StringUtils.join(saveFilePath(personnelRequest.getEngageFile(),Personnel.ENGAGE_FILE,"",""),','));
|
||||
personnel.setJobTitleFile(StringUtils.join(saveFilePath(personnelRequest.getJobTitleFile(),Personnel.EDUCATION_FILE,"",""),','));
|
||||
personnel.setEducationFile(StringUtils.join(saveFilePath(personnelRequest.getEducationFile(),Personnel.JOBTITLE_FILE,"",""),','));
|
||||
personnel.setAuditFile(StringUtils.join(saveFilePath(personnelRequest.getAuditFile(),Personnel.AUDIT_FILE,"",""),','));
|
||||
boolean save = save(personnel);
|
||||
List<AttachmentRequest> list = personnelRequest.getAttachmentList();
|
||||
for (AttachmentRequest request : list) {
|
||||
Attachment attachment = new Attachment();
|
||||
attachment.setTargetType(request.getTargetType());
|
||||
attachment.setSize(request.getSize());
|
||||
attachment.setAttachment(request.getPath());
|
||||
attachment.setTitle(request.getName());
|
||||
attachment.setTargetId(personnel.getId());
|
||||
attachmentService.savePersonnel(attachment);
|
||||
}
|
||||
saveAttachment(personnelRequest.getCardFile(),Personnel.CARD_FILE,personnel.getId());
|
||||
saveAttachment(personnelRequest.getEngageFile(),Personnel.ENGAGE_FILE,personnel.getId());
|
||||
saveAttachment(personnelRequest.getEducationFile(),Personnel.EDUCATION_FILE,personnel.getId());
|
||||
saveAttachment(personnelRequest.getJobTitleFile(),Personnel.JOBTITLE_FILE,personnel.getId());
|
||||
saveAttachment(personnelRequest.getAuditFile(),Personnel.AUDIT_FILE,personnel.getId());
|
||||
return save ? AjaxResult.ok().msg("保存成功!"):AjaxResult.fail().msg("保存失败!");
|
||||
}
|
||||
|
||||
|
@ -128,46 +108,51 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult updatePersonnel(PersonnelUpdateRequest updateRequest) {
|
||||
Personnel personnel = BeanUtil.copyProperties(updateRequest, Personnel.class);
|
||||
List<AttachmentRequest> attachmentList = updateRequest.getAttachmentList();
|
||||
ArrayList<String> card = new ArrayList<>();
|
||||
ArrayList<String> engage = new ArrayList<>();
|
||||
ArrayList<String> jobTitle = new ArrayList<>();
|
||||
ArrayList<String> education = new ArrayList<>();
|
||||
ArrayList<String> audit = new ArrayList<>();
|
||||
for (AttachmentRequest request : attachmentList) {
|
||||
if ("card".equals(request.getTargetType())){
|
||||
card.add(request.getPath());
|
||||
personnel.setCardFile(StringUtils.join(card,','));
|
||||
attachmentService.deleteById(request.getTargetType(),updateRequest.getId());
|
||||
}else if ("engage".equals(request.getTargetType())){
|
||||
engage.add(request.getPath());
|
||||
personnel.setEngageFile(StringUtils.join(engage,','));
|
||||
attachmentService.deleteById(request.getTargetType(),updateRequest.getId());
|
||||
}else if ("jobTitle".equals(request.getTargetType())){
|
||||
jobTitle.add(request.getPath());
|
||||
personnel.setJobTitleFile(StringUtils.join(jobTitle,','));
|
||||
attachmentService.deleteById(request.getTargetType(),updateRequest.getId());
|
||||
}else if ("education".equals(request.getTargetType())){
|
||||
education.add(request.getPath());
|
||||
personnel.setEducationFile(StringUtils.join(education,','));
|
||||
attachmentService.deleteById(request.getTargetType(),updateRequest.getId());
|
||||
}else if ("audit".equals(request.getTargetType())){
|
||||
audit.add(request.getPath());
|
||||
personnel.setAuditFile(StringUtils.join(audit,','));
|
||||
attachmentService.deleteById(request.getTargetType(),updateRequest.getId());
|
||||
}
|
||||
}
|
||||
List<AttachmentRequest> cardFile = updateRequest.getCardFile();
|
||||
List<AttachmentRequest> educationFile = updateRequest.getEducationFile();
|
||||
List<AttachmentRequest> auditFile = updateRequest.getAuditFile();
|
||||
personnel.setCardFile(StringUtils.join(saveFilePath(cardFile,Personnel.CARD_FILE,"update",personnel.getId()),','));
|
||||
personnel.setEducationFile(StringUtils.join(saveFilePath(educationFile,Personnel.EDUCATION_FILE,"update",personnel.getId()),','));
|
||||
personnel.setAuditFile(StringUtils.join(saveFilePath(auditFile,Personnel.AUDIT_FILE,"update",personnel.getId()),','));
|
||||
boolean update = updateById(personnel);
|
||||
for (AttachmentRequest request : attachmentList) {
|
||||
Attachment attachment = new Attachment();
|
||||
attachment.setTargetType(request.getTargetType());
|
||||
attachment.setSize(request.getSize());
|
||||
attachment.setAttachment(request.getPath());
|
||||
attachment.setTitle(request.getName());
|
||||
attachment.setTargetId(personnel.getId());
|
||||
attachmentService.savePersonnel(attachment);
|
||||
}
|
||||
saveAttachment(cardFile,Personnel.CARD_FILE,personnel.getId());
|
||||
saveAttachment(educationFile,Personnel.EDUCATION_FILE,personnel.getId());
|
||||
saveAttachment(auditFile,Personnel.AUDIT_FILE,personnel.getId());
|
||||
return update ? AjaxResult.ok().msg("修改成功!"):AjaxResult.fail().msg("修改失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存附件
|
||||
* @param file
|
||||
* @param type
|
||||
* @param id
|
||||
*/
|
||||
public void saveAttachment(List<AttachmentRequest> file,String type, String id){
|
||||
for (AttachmentRequest request : file) {
|
||||
Attachment attachment = BeanUtil.copyProperties(request, Attachment.class);
|
||||
attachment.setTargetType(type);
|
||||
attachment.setTargetId(id);
|
||||
attachmentService.savePersonnel(attachment);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存附件返路径
|
||||
* @param file
|
||||
* @param type
|
||||
* @param args
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public ArrayList<String> saveFilePath(List<AttachmentRequest> file, String type, String args, String id){
|
||||
ArrayList<String> path = new ArrayList<>();
|
||||
for (AttachmentRequest request : file) {
|
||||
if ("update".equals(args)){
|
||||
attachmentService.deleteById(type,id);
|
||||
}
|
||||
path.add(request.getPath());
|
||||
}
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue