附件相关修改
This commit is contained in:
parent
0b36cd1492
commit
afef212818
|
@ -1,5 +1,8 @@
|
|||
package com.ydool.common.constant;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @author msh
|
||||
* @version 1.0
|
||||
|
@ -38,7 +41,7 @@ public class ArgsConst {
|
|||
/**
|
||||
* 附件所属:变更
|
||||
*/
|
||||
public static final String CHANGE = "Change";
|
||||
public static final String CHANGE = "change";
|
||||
/**
|
||||
* 附件所属:人员
|
||||
*/
|
||||
|
@ -52,4 +55,9 @@ public class ArgsConst {
|
|||
*/
|
||||
public static final String DIRECTORS = "directors";
|
||||
|
||||
/**
|
||||
* 选调
|
||||
*/
|
||||
|
||||
public static final String EXCHANGE = "exchange";
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@ public interface UrlConstant {
|
|||
String DIRECTORS_SUPERVISORS = API + "/directors_supervisors";
|
||||
String ALTERATION = API + "/alteration";
|
||||
|
||||
String Attachment = API + "/attachment";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
package com.ydool.staff.controller;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
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.service.IAttachmentService;
|
||||
import com.ydool.system.request.IdsRequest;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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/10 12:01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(UrlConstant.ALTERATION)
|
||||
@Api(tags = "附件", value = "附件")
|
||||
@ApiSupport(order = 1)
|
||||
public class AttachmentController extends BaseController {
|
||||
@Resource
|
||||
private IAttachmentService attachmentService;
|
||||
|
||||
@GetMapping("/selectOrganizationFileList")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@ApiOperation(value = "根据id查附件列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "关联Id"),
|
||||
@ApiImplicitParam(name = "current", value = "当前页"),
|
||||
@ApiImplicitParam(name = "size", value = "每页条数"),
|
||||
@ApiImplicitParam(name = "type", value = "附件类型:personnel:人员,change:变更,organization:机构,exchange:选调,directors:董监")})
|
||||
public AjaxResult selectOrganizationFileList(String id, String type){
|
||||
return attachmentService.selectOrganizationFileList(getPage(),id, type);
|
||||
}
|
||||
|
||||
@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(getPage(), id);
|
||||
}
|
||||
|
||||
@PostMapping("/deleteFile")
|
||||
@ApiOperation(value = "删除附件")
|
||||
public AjaxResult deleteFile(@RequestBody IdsRequest ids){
|
||||
return attachmentService.deleteFile(ids);
|
||||
}
|
||||
}
|
|
@ -46,14 +46,21 @@ public class ExchangeController extends BaseController {
|
|||
|
||||
|
||||
@GetMapping("exchangePage")
|
||||
@ApiOperation(value = "人员选调列表,传id查一条",response = ExchangePageDto.class)
|
||||
@ApiOperation(value = "人员选调列表",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);
|
||||
public AjaxResult exchangePage(){
|
||||
return exchangeService.exchangePage(getPage());
|
||||
}
|
||||
@GetMapping("selectById")
|
||||
@ApiOperation(value = "查看")
|
||||
@ApiImplicitParam(name = "id", value = "人员选调id")
|
||||
public AjaxResult selectById(String id){
|
||||
return exchangeService.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("saveExchange")
|
||||
@ApiOperation(value = "新增人员选调",response = ExchangeRequest.class)
|
||||
|
@ -68,8 +75,8 @@ public class ExchangeController extends BaseController {
|
|||
|
||||
@GetMapping("deleteExchange")
|
||||
@ApiOperation(value = "删除人员选调",response = PersonnelDeleteRequest.class)
|
||||
public AjaxResult deleteExchange(@RequestBody PersonnelDeleteRequest request){
|
||||
return exchangeService.deleteExchangeById(request);
|
||||
public AjaxResult deleteExchange(@RequestBody PersonnelDeleteRequest ids){
|
||||
return exchangeService.deleteExchangeById(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ydool.staff.controller;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.ydool.common.base.BaseController;
|
||||
import com.ydool.common.constant.ArgsConst;
|
||||
import com.ydool.common.constant.UrlConstant;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.entity.PartyOrganization;
|
||||
|
@ -46,14 +47,6 @@ public class OrganizationController extends BaseController {
|
|||
return organizationService.selectOrganizationList(new Page<>(getPageNum(), getPageSize()), companyName);
|
||||
}
|
||||
|
||||
@GetMapping("/selectOrganizationFileList")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@ApiOperation(value = "内设机构附件列表")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "企业Id")})
|
||||
public AjaxResult selectOrganizationFileList(String id){
|
||||
return attachmentService.selectOrganizationFileList(id);
|
||||
}
|
||||
|
||||
@GetMapping("/selectOrganizationByMechanism")
|
||||
@ApiOperation(value = "内设机构登记详情")
|
||||
@ApiOperationSupport(order = 4)
|
||||
|
|
|
@ -84,25 +84,6 @@ public class PersonnelController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@PostMapping("/deleteFile")
|
||||
@ApiOperation(value = "删除附件")
|
||||
public AjaxResult deleteFile(@RequestBody IdsRequest ids){
|
||||
return attachmentService.deleteFile(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
package com.ydool.staff.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ydool.staff.entity.Attachment;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author msh
|
||||
* @version 1.0
|
||||
* @date 2023/2/2 17:15
|
||||
*/
|
||||
@Data
|
||||
public class ExchangeOneDto {
|
||||
|
||||
@ApiModelProperty(value = "员工id")
|
||||
private String personnelId;
|
||||
|
||||
@ApiModelProperty(value = "调入企业名称")
|
||||
private String willCompanyName;
|
||||
|
||||
@ApiModelProperty(value = "调入信用代码")
|
||||
private String willCOde;
|
||||
|
||||
@ApiModelProperty(value = "调出企业名称")
|
||||
private String originalCompanyName;
|
||||
|
||||
@ApiModelProperty(value = "调入信用代码")
|
||||
private String originalCode;
|
||||
|
||||
@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 excReason;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "选调相关附件")
|
||||
private List<AttachmentDto> excFiles;
|
||||
|
||||
@ApiModelProperty(value = "初审意见")
|
||||
private String firstTrialRemark;
|
||||
|
||||
@ApiModelProperty(value = "终审意见")
|
||||
private String finalTrialRemark;
|
||||
|
||||
|
||||
}
|
|
@ -97,7 +97,7 @@ public class Personnel extends BaseEntity {
|
|||
private String personnelCharacter;
|
||||
|
||||
@ApiModelProperty(value = "年薪")
|
||||
private BigDecimal annualSalary;
|
||||
private Integer annualSalary;
|
||||
|
||||
@ApiModelProperty(value = "入职时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ChangeRequest {
|
|||
|
||||
@ApiModelProperty(value = "年薪")
|
||||
@NotBlank(message = "年薪不能为空")
|
||||
private BigDecimal annualSalary;
|
||||
private Integer annualSalary;
|
||||
|
||||
@ApiModelProperty(value = "退休时间")
|
||||
@NotNull(message = "退休时间不能为空")
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ydool.staff.request;
|
||||
|
||||
import com.ydool.staff.dto.AttachmentDto;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
@ -36,6 +37,6 @@ public class ExchangeRequest {
|
|||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "选调相关附件")
|
||||
private List<AttachmentRequest> attachmentList;
|
||||
private List<AttachmentDto> attachmentList;
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,6 @@ public interface IAttachmentService {
|
|||
|
||||
AjaxResult deleteFile(IdsRequest ids);
|
||||
|
||||
AjaxResult selectOrganizationFileList(String id);
|
||||
AjaxResult selectOrganizationFileList(Page page,String id,String type);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,10 +16,12 @@ import com.ydool.staff.request.PersonnelUpdateRequest;
|
|||
*/
|
||||
public interface IExchangeService {
|
||||
|
||||
AjaxResult exchangePage(Page page, String id);
|
||||
AjaxResult exchangePage(Page page);
|
||||
|
||||
AjaxResult saveExchange(ExchangeRequest exchangeRequest);
|
||||
|
||||
AjaxResult deleteExchangeById(PersonnelDeleteRequest request);
|
||||
|
||||
AjaxResult selectById(String id);
|
||||
}
|
||||
|
||||
|
|
|
@ -78,11 +78,15 @@ public class AttachmentServiceImpl extends BaseService<AttachmentMapper, Attachm
|
|||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectOrganizationFileList(String id) {
|
||||
LambdaQueryWrapper<Attachment> attachmentLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
attachmentLambdaQueryWrapper.eq(Attachment::getTargetId, id);
|
||||
attachmentLambdaQueryWrapper.eq(Attachment::getTargetType, ArgsConst.ORGANIZATION);
|
||||
Page<Attachment> attachmentPage = attachmentMapper.selectPage(new Page<>(), attachmentLambdaQueryWrapper);
|
||||
public AjaxResult selectOrganizationFileList(Page page, String id,String type) {
|
||||
LambdaQueryWrapper<Attachment> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Attachment::getTargetId, id);
|
||||
if(ArgsConst.PERSONNEL.equals(type)||ArgsConst.CHANGE.equals(type)){
|
||||
wrapper.in(Attachment::getTargetType, ArgsConst.CARD_FILE,ArgsConst.ENGAGE_FILE,ArgsConst.JOBTITLE_FILE,ArgsConst.EDUCATION_FILE,ArgsConst.AUDIT_FILE);
|
||||
}else {
|
||||
wrapper.eq(Attachment::getTargetType, type);
|
||||
}
|
||||
Page<Attachment> attachmentPage = attachmentMapper.selectPage(page, wrapper);
|
||||
return AjaxResult.ok().data(attachmentPage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,19 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||
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.constant.ArgsConst;
|
||||
import com.ydool.common.data.dto.AjaxResult;
|
||||
import com.ydool.staff.dto.AttachmentDto;
|
||||
import com.ydool.staff.dto.ExchangeOneDto;
|
||||
import com.ydool.staff.dto.ExchangePageDto;
|
||||
import com.ydool.staff.entity.Attachment;
|
||||
import com.ydool.staff.entity.CompanyName;
|
||||
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.CompanyNameMapper;
|
||||
import com.ydool.staff.mapper.ExchangeMapper;
|
||||
import com.ydool.staff.mapper.OrganizationMapper;
|
||||
import com.ydool.staff.mapper.PersonnelMapper;
|
||||
|
@ -22,7 +27,9 @@ 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.Dept;
|
||||
import com.ydool.system.entity.User;
|
||||
import com.ydool.system.mapper.DeptMapper;
|
||||
import com.ydool.system.mapper.UserMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -49,27 +56,34 @@ public class ExchangeServiceImpl extends BaseService<ExchangeMapper, Exchange> i
|
|||
private PersonnelMapper personnelMapper;
|
||||
@Resource
|
||||
private AttachmentMapper attachmentMapper;
|
||||
|
||||
@Resource
|
||||
private OrganizationMapper organizationMapper;
|
||||
private ExchangeMapper exchangeMapper;
|
||||
|
||||
@Resource
|
||||
private DeptMapper deptMapper;
|
||||
@Resource
|
||||
private CompanyNameMapper companyNameMapper;
|
||||
@Resource
|
||||
private UserMapper userMapper;
|
||||
@Override
|
||||
public AjaxResult exchangePage(Page page, String id) {
|
||||
if (ObjectUtil.isNotNull(id)){
|
||||
return AjaxResult.ok().data(get(id));
|
||||
}
|
||||
public AjaxResult exchangePage(Page page) {
|
||||
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());
|
||||
CompanyName original = companyNameMapper.selectById(personnel.getCompanyName());
|
||||
CompanyName will = companyNameMapper.selectById(e.getWillCompanyId());
|
||||
Dept originalDept = deptMapper.selectById(personnel.getPresentDept());
|
||||
Dept willDept = deptMapper.selectById(e.getWillDept());
|
||||
User user = userMapper.selectById((String)StpUtil.getLoginId());
|
||||
dto.setUserName(personnel.getUserName());
|
||||
dto.setOriginalCompanyName(personnel.getCompanyName());
|
||||
// dto.setWillCompanyName(organization.getCompanyName());
|
||||
dto.setOriginalCompanyName(original.getCompanyName());
|
||||
dto.setWillCompanyName(will.getCompanyName());
|
||||
dto.setCardId(personnel.getNumberId());
|
||||
dto.setNowDept(personnel.getPresentDept());
|
||||
dto.setNowDept(originalDept.getName());
|
||||
dto.setWillDept(willDept.getName());
|
||||
dto.setNowPosition(personnel.getPosition());
|
||||
dto.setWritten(user.getUserName());
|
||||
return dto;
|
||||
|
@ -80,17 +94,18 @@ public class ExchangeServiceImpl extends BaseService<ExchangeMapper, Exchange> i
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult saveExchange(ExchangeRequest exchangeRequest) {
|
||||
List<AttachmentRequest> attachmentList = exchangeRequest.getAttachmentList();
|
||||
List<AttachmentDto> attachmentList = exchangeRequest.getAttachmentList();
|
||||
ArrayList<String> s = new ArrayList<>();
|
||||
Exchange exchange = BeanUtil.copyProperties(exchangeRequest, Exchange.class);
|
||||
for (AttachmentRequest request : attachmentList) {
|
||||
for (AttachmentDto request : attachmentList) {
|
||||
s.add(request.getPath());
|
||||
exchange.setExcFile(StringUtils.join(s,','));
|
||||
}
|
||||
boolean save = save(exchange);
|
||||
for (AttachmentRequest request : attachmentList) {
|
||||
for (AttachmentDto request : attachmentList) {
|
||||
Attachment attachment = BeanUtil.copyProperties(request, Attachment.class);
|
||||
attachment.setTargetId(exchange.getId());
|
||||
attachment.setTargetType(ArgsConst.EXCHANGE);
|
||||
attachmentMapper.insert(attachment);
|
||||
}
|
||||
return save ?AjaxResult.ok().msg("保存成功!"):AjaxResult.fail().msg("保存失败!");
|
||||
|
@ -103,10 +118,37 @@ public class ExchangeServiceImpl extends BaseService<ExchangeMapper, Exchange> i
|
|||
if (CollectionUtil.isEmpty(asList)) {
|
||||
return AjaxResult.fail().msg("Id不能为空!");
|
||||
} else {
|
||||
int i = personnelMapper.deleteBatchIds(asList);
|
||||
int i = exchangeMapper.deleteBatchIds(asList);
|
||||
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectById(String id) {
|
||||
Exchange exchange = getById(id);
|
||||
Personnel personnel = personnelMapper.selectById(exchange.getPersonnelId());
|
||||
CompanyName nowCompany = companyNameMapper.selectById(personnel.getCompanyName());
|
||||
Dept nowDept = deptMapper.selectById(personnel.getPresentDept());
|
||||
|
||||
CompanyName willCompany = companyNameMapper.selectById(exchange.getWillCompanyId());
|
||||
Dept dept = deptMapper.selectById(exchange.getWillDept());
|
||||
|
||||
List<Attachment> attachments = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, exchange.getId()));
|
||||
List<AttachmentDto> attachmentDtos = BeanUtil.copyToList(attachments, AttachmentDto.class);
|
||||
System.out.println("byId = " + exchange);
|
||||
ExchangeOneDto exchangeOneDto = BeanUtil.copyProperties(exchange, ExchangeOneDto.class);
|
||||
exchangeOneDto.setWillCompanyName(willCompany.getCompanyName());
|
||||
exchangeOneDto.setWillCOde(willCompany.getCreditCode());
|
||||
exchangeOneDto.setOriginalCompanyName(nowCompany.getCompanyName());
|
||||
exchangeOneDto.setOriginalCode(nowCompany.getCreditCode());
|
||||
exchangeOneDto.setUserName(personnel.getUserName());
|
||||
exchangeOneDto.setCardId(personnel.getNumberId());
|
||||
exchangeOneDto.setNowDept(nowDept.getName());
|
||||
exchangeOneDto.setWillDept(dept.getName());
|
||||
exchangeOneDto.setNowPosition(personnel.getPosition());
|
||||
exchangeOneDto.setExcFiles(attachmentDtos);
|
||||
return AjaxResult.ok().data(exchangeOneDto);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package com.ydool.staff.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ydool.common.base.BaseService;
|
||||
|
@ -17,10 +19,12 @@ import com.ydool.staff.dto.PersonnelUpdateDto;
|
|||
import com.ydool.staff.entity.Alteration;
|
||||
import com.ydool.staff.entity.Attachment;
|
||||
import com.ydool.staff.entity.CompanyName;
|
||||
import com.ydool.staff.entity.Organization;
|
||||
import com.ydool.staff.entity.Personnel;
|
||||
import com.ydool.staff.entity.SelectRequest;
|
||||
import com.ydool.staff.mapper.AlterationMapper;
|
||||
import com.ydool.staff.mapper.CompanyNameMapper;
|
||||
import com.ydool.staff.mapper.OrganizationMapper;
|
||||
import com.ydool.staff.mapper.PersonnelMapper;
|
||||
import com.ydool.staff.request.AttachmentRequest;
|
||||
import com.ydool.staff.request.ChangeRequest;
|
||||
|
@ -36,6 +40,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.Null;
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
@ -239,6 +246,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
attachmentService.savePersonnel(attachment);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -261,13 +269,12 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
}
|
||||
return path;
|
||||
}
|
||||
return new ArrayList<>();
|
||||
return null;
|
||||
}
|
||||
|
||||
public void saveAlteration(String details,Object before ,Object after,String type, String id,String fieldName){
|
||||
if (ObjectUtil.isNotNull(after)){
|
||||
System.out.println("after = " + after);
|
||||
if (!before.equals(after)) {
|
||||
if (!after.equals(before)){
|
||||
Alteration alteration = new Alteration();
|
||||
alteration.setDetails(details);
|
||||
alteration.setFieldName(fieldName);
|
||||
|
@ -282,6 +289,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
alterationMapper.insert(alteration);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<AttachmentDto> nameAndPath(String file, String id) {
|
||||
|
@ -305,14 +313,28 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
|
|||
|
||||
public QueryWrapper selectWrapper(SelectRequest request,String orderBy,String column){
|
||||
QueryWrapper<Personnel> wrapper = new QueryWrapper<>();
|
||||
wrapper.lambda().eq(StrUtil.isNotBlank(request.getPersonnelType()), Personnel::getPersonnelType, request.getPersonnelType()).eq(StrUtil.isNotBlank(request.getPresentDept()), Personnel::getPresentDept, request.getPresentDept()).eq(StrUtil.isNotBlank(request.getPoliticsStatus()), Personnel::getPoliticsStatus, request.getPoliticsStatus()).eq(StrUtil.isNotBlank(request.getHireType()), Personnel::getHireType, request.getHireType()).eq(StrUtil.isNotBlank(request.getPosition()), Personnel::getPosition, request.getPosition()).eq(StrUtil.isNotBlank(request.getContractModality()), Personnel::getContractModality, request.getContractModality()).eq(StrUtil.isNotBlank(request.getQualification()), Personnel::getQualification, request.getQualification()).eq(StrUtil.isNotBlank(request.getPersonnelType()), Personnel::getPersonnelType, request.getPersonnelType()).eq(ObjectUtil.isNotNull(request.getHireDate()), Personnel::getHireDate, request.getHireDate()).eq(ObjectUtil.isNotNull(request.getResignationTime()), Personnel::getResignationTime, request.getResignationTime()).eq(StrUtil.isNotBlank(request.getWorkState()), Personnel::getWorkState, request.getWorkState()).eq(StrUtil.isNotBlank(request.getReceipts()), Personnel::getRecruitNumber, request.getReceipts()).eq(StrUtil.isNotBlank(request.getAlterationSign()), Personnel::getAlterationSign, request.getAlterationSign());
|
||||
wrapper.lambda().like(Personnel::getUserName, request.getUserName()).like(Personnel::getNumberId, request.getNumberId())
|
||||
.exists(StrUtil.isNotBlank(request.getCompanyName()), "select t2.id from t_lc_company_name t2 where " + "t_lc_personnel.company_name = t2.id and t2.company_name like '%" + request.getCompanyName() + "%'");
|
||||
wrapper.lambda().eq(StrUtil.isNotBlank(request.getPersonnelType()),Personnel::getPersonnelType,request.getPersonnelType())
|
||||
.eq(StrUtil.isNotBlank(request.getPresentDept()),Personnel::getPresentDept,request.getPresentDept())
|
||||
.eq(StrUtil.isNotBlank(request.getPoliticsStatus()),Personnel::getPoliticsStatus,request.getPoliticsStatus())
|
||||
.eq(StrUtil.isNotBlank(request.getHireType()),Personnel::getHireType,request.getHireType())
|
||||
.eq(StrUtil.isNotBlank(request.getPosition()),Personnel::getPosition,request.getPosition())
|
||||
.eq(StrUtil.isNotBlank(request.getContractModality()),Personnel::getContractModality,request.getContractModality())
|
||||
.eq(StrUtil.isNotBlank(request.getQualification()),Personnel::getQualification,request.getQualification())
|
||||
.eq(StrUtil.isNotBlank(request.getPersonnelType()),Personnel::getPersonnelType,request.getPersonnelType())
|
||||
.eq(ObjectUtil.isNotNull(request.getHireDate()),Personnel::getHireDate,request.getHireDate())
|
||||
.eq(ObjectUtil.isNotNull(request.getResignationTime()),Personnel::getResignationTime,request.getResignationTime())
|
||||
.eq(StrUtil.isNotBlank(request.getWorkState()),Personnel::getWorkState,request.getWorkState())
|
||||
.eq(StrUtil.isNotBlank(request.getReceipts()),Personnel::getRecruitNumber,request.getReceipts())
|
||||
.eq(StrUtil.isNotBlank(request.getAlterationSign()),Personnel::getAlterationSign,request.getAlterationSign());
|
||||
wrapper.lambda().like(Personnel::getUserName,request.getUserName())
|
||||
.like(Personnel::getNumberId,request.getNumberId())
|
||||
/*.like(Personnel::getAuditFile,request.getFileName()).or()
|
||||
.like(Personnel::getCardFile,request.getFileName()).or()
|
||||
.like(Personnel::getEducationFile,request.getFileName()).or()
|
||||
.like(Personnel::getEngageFile,request.getFileName()).or()
|
||||
.like(Personnel::getJobTitleFile,request.getFileName()).or()*/
|
||||
.exists(StrUtil.isNotBlank(request.getCompanyName()), "select t2.id from t_lc_company_name t2 where " +
|
||||
"t_lc_personnel.company_name = t2.id and t2.company_name like '%" + request.getCompanyName() + "%'");
|
||||
if ("desc".equals(orderBy) && StrUtil.isNotBlank(column)) {
|
||||
wrapper.orderByDesc(column);
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ sa-token:
|
|||
# token名称 (同时也是cookie名称)
|
||||
token-name: x-token
|
||||
# token有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 86400
|
||||
timeout: 864000
|
||||
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
activity-timeout: 1800
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
|
|
Loading…
Reference in New Issue