Merge remote-tracking branch 'origin/master'

This commit is contained in:
lijiaqi 2023-02-09 16:58:53 +08:00
commit 796e2688ce
9 changed files with 77 additions and 69 deletions

View File

@ -5,10 +5,8 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.ydool.common.base.BaseController; import com.ydool.common.base.BaseController;
import com.ydool.common.constant.UrlConstant; import com.ydool.common.constant.UrlConstant;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.entity.PartyOrganization; import com.ydool.staff.entity.PartyOrganization;
import com.ydool.staff.request.MechanismRequest; import com.ydool.staff.request.MechanismRequest;
import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.service.*; import com.ydool.staff.service.*;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -35,23 +33,8 @@ public class OrganizationController extends BaseController {
@Autowired @Autowired
IAttachmentService attachmentService; IAttachmentService attachmentService;
// @GetMapping("/selectOrganization")
// @ApiOperation(value = "企业名称列表")
// @ApiOperationSupport(order = 1)
// public AjaxResult selectOrganization() {
// return organizationService.selectOrganization();
// }
//
// @GetMapping("/selectOrganizationByName")
// @ApiOperation(value = "企业名称查企业信息")
// @ApiOperationSupport(order = 2)
// // @ApiImplicitParams({@ApiImplicitParam(name = "companyName", value = "企业名称", required = true)})
// public AjaxResult selectOrganizationByName(String companyName) {
// return organizationService.selectOrganizationByName(companyName);
// }
/** /**
* =======================内设机构登记=========================== * =======================内设机构登记=========================
* @return * @return
*/ */
@ -74,7 +57,7 @@ public class OrganizationController extends BaseController {
@GetMapping("/selectOrganizationByMechanism") @GetMapping("/selectOrganizationByMechanism")
@ApiOperation(value = "内设机构登记详情") @ApiOperation(value = "内设机构登记详情")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "内设机构Id")}) @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "内设机构Id", required = true)})
public AjaxResult selectOrganizationByMechanism(String id) { public AjaxResult selectOrganizationByMechanism(String id) {
return organizationService.selectOrganizationByMechanism(id); return organizationService.selectOrganizationByMechanism(id);
} }
@ -87,7 +70,7 @@ public class OrganizationController extends BaseController {
} }
/** /**
* =======================机构信息========================= * ===========================机构信息============================
* @return * @return
*/ */
@ -98,36 +81,16 @@ public class OrganizationController extends BaseController {
return mechanismService.saveOrganizationMechanism(mechanismRequest); return mechanismService.saveOrganizationMechanism(mechanismRequest);
} }
// @PostMapping("/deleteMechanism")
// @ApiOperation(value = "机构信息删除")
// @ApiOperationSupport(order = 7)
// public AjaxResult deleteMechanism(@RequestBody IdsRequest id) {
// return mechanismService.deleteMechanism(id);
// }
/** /**
* ========================党组织信息======================== * ==========================党组织信息===========================
* @return * @return
*/ */
// @GetMapping("/selectPartyOrganizationList")
// @ApiOperation(value = "党组织信息列表")
// @ApiOperationSupport(order = 8)
// public AjaxResult selectPartyOrganizationList() {
// return partyOrganizationService.selectPartyOrganizationList(new Page<PartyOrganization>(getPageNum(), getPageSize()));
// }
@PostMapping("/savePartyOrganization") @PostMapping("/savePartyOrganization")
@ApiOperation(value = "党组织信息新增") @ApiOperation(value = "党组织信息新增")
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 7)
public AjaxResult savePartyOrganization(@RequestBody @Validated PartyOrganization partyOrganization) { public AjaxResult savePartyOrganization(@RequestBody @Validated PartyOrganization partyOrganization) {
return partyOrganizationService.savePartyOrganization(partyOrganization); return partyOrganizationService.savePartyOrganization(partyOrganization);
} }
// @PostMapping("/deletePartyOrganization")
// @ApiOperation(value = "党组织信息删除")
// @ApiOperationSupport(order = 10)
// public AjaxResult deletePartyOrganization(@RequestBody IdsRequest id) {
// return partyOrganizationService.deletePartyOrganization(id);
// }
} }

View File

@ -6,6 +6,9 @@ import lombok.Data;
@Data @Data
public class DirectorsSupervisorsDto { public class DirectorsSupervisorsDto {
@ApiModelProperty(value = "企业名称")
private String companyName;
@ApiModelProperty(value = "姓名") @ApiModelProperty(value = "姓名")
private String username; private String username;

View File

@ -1,5 +1,6 @@
package com.ydool.staff.service.impl; package com.ydool.staff.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.extra.spring.SpringUtil; import cn.hutool.extra.spring.SpringUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -15,9 +16,13 @@ import com.ydool.staff.mapper.AlterationMapper;
import com.ydool.staff.service.IAlterationService; import com.ydool.staff.service.IAlterationService;
import com.ydool.system.entity.Dept; import com.ydool.system.entity.Dept;
import com.ydool.system.entity.User; import com.ydool.system.entity.User;
import com.ydool.system.mapper.DeptMapper;
import com.ydool.system.mapper.UserMapper; import com.ydool.system.mapper.UserMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -32,17 +37,32 @@ import java.util.stream.Collectors;
@Service @Service
public class AlterationServiceImpl extends BaseService<AlterationMapper, Alteration> implements IAlterationService { public class AlterationServiceImpl extends BaseService<AlterationMapper, Alteration> implements IAlterationService {
@Resource
private UserMapper userMapper;
@Override @Override
public AjaxResult alterationList(String id) { public AjaxResult alterationList(String id) {
List<Alteration> list = list(new LambdaQueryWrapper<Alteration>().eq(Alteration::getRelevancyId, id)); List<Alteration> list = list(new LambdaQueryWrapper<Alteration>().eq(Alteration::getRelevancyId, id));
List<AlterationDto> alterationDtos = BeanUtil.copyToList(list, AlterationDto.class); List<AlterationDto> alterationDtos = new ArrayList<>();
for (Alteration dto : list) { DeptMapper deptMapper = SpringUtil.getBean(DeptMapper.class);
UserMapper userMapper = SpringUtil.getBean(UserMapper.class); for (Alteration alteration : list) {
User user = userMapper.selectById(dto.getCreatedId()); AlterationDto dto = BeanUtil.copyProperties(alteration, AlterationDto.class);
for (AlterationDto alterationDto : alterationDtos) { User user = userMapper.selectById(alteration.getCreatedId());
alterationDto.setCreatedName(user.getUserName()); dto.setCreatedName(user.getUserName());
if ("presentDept".equals(alteration.getFieldName())){
Dept deptBeforeChange = deptMapper.selectById(dto.getBeforeChange());
Dept deptAfterChange = deptMapper.selectById(dto.getAfterChange());
dto.setBeforeChange(deptBeforeChange.getName());
dto.setAfterChange(deptAfterChange.getName());
} }
if ("freshGraduate".equals(alteration.getFieldName())){
if ("0".equals(alteration.getBeforeChange())){
dto.setBeforeChange("");
}if ("1".equals(alteration.getAfterChange())){
dto.setAfterChange("");
}
}
alterationDtos.add(dto);
} }
return AjaxResult.ok().data(alterationDtos); return AjaxResult.ok().data(alterationDtos);
} }

View File

@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
/** /**
@ -66,10 +67,11 @@ public class AttachmentServiceImpl extends BaseService<AttachmentMapper, Attachm
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult deleteFile(IdsRequest id) { public AjaxResult deleteFile(IdsRequest id) {
if (CollectionUtil.isEmpty(Arrays.asList(id.getIds()))) { List<String> asList = Arrays.asList(id.getIds());
if (CollectionUtil.isEmpty(asList)) {
return AjaxResult.fail().msg("Id不能为空"); return AjaxResult.fail().msg("Id不能为空");
} else { } else {
int i = attachmentMapper.deleteBatchIds(Arrays.asList(id.getIds())); int i = attachmentMapper.deleteBatchIds(asList);
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!"); return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
} }
} }

View File

@ -1,5 +1,6 @@
package com.ydool.staff.service.impl; package com.ydool.staff.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ydool.common.base.BaseService; import com.ydool.common.base.BaseService;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
@ -44,6 +45,9 @@ public class CompanyNameServiceImpl extends BaseService<CompanyNameMapper, Compa
@Override @Override
public AjaxResult selectCompanyNameById(String id) { public AjaxResult selectCompanyNameById(String id) {
CompanyName companyName = companyNameMapper.selectById(id); CompanyName companyName = companyNameMapper.selectById(id);
if (ObjectUtil.isNull(companyName)) {
return AjaxResult.fail().msg("未找到相关信息!");
}
List<Recruitment> recruitments = recruitmentMapper.selectList(new LambdaQueryWrapper<Recruitment>().eq(Recruitment::getCompanyId, companyName.getId())); List<Recruitment> recruitments = recruitmentMapper.selectList(new LambdaQueryWrapper<Recruitment>().eq(Recruitment::getCompanyId, companyName.getId()));
CompanyNameRequest companyNameRequest = new CompanyNameRequest(); CompanyNameRequest companyNameRequest = new CompanyNameRequest();
companyNameRequest.setRecruitments(recruitments); companyNameRequest.setRecruitments(recruitments);

View File

@ -2,6 +2,7 @@ package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.util.StringUtils; import org.thymeleaf.util.StringUtils;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -43,6 +45,7 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
@Override @Override
public AjaxResult selectDirectorsSupervisorsList(Page<DirectorsSupervisors> page, DirectorsSupervisorsDto directorsSupervisorsDto) { public AjaxResult selectDirectorsSupervisorsList(Page<DirectorsSupervisors> page, DirectorsSupervisorsDto directorsSupervisorsDto) {
LambdaQueryWrapper<DirectorsSupervisors> directorsSupervisorsLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DirectorsSupervisors> directorsSupervisorsLambdaQueryWrapper = new LambdaQueryWrapper<>();
directorsSupervisorsLambdaQueryWrapper.exists(StrUtil.isNotBlank(directorsSupervisorsDto.getCompanyName()), "select t2.id from t_lc_company_name t2 where t_lc_directors_supervisors.organization_id = t2.id and t2.company_name like '%" + directorsSupervisorsDto.getCompanyName() + "%'");
directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getUsername()), DirectorsSupervisors::getUsername, directorsSupervisorsDto.getUsername()); directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getUsername()), DirectorsSupervisors::getUsername, directorsSupervisorsDto.getUsername());
directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getDirectorsType()), DirectorsSupervisors::getDirectorsType, directorsSupervisorsDto.getDirectorsType()); directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getDirectorsType()), DirectorsSupervisors::getDirectorsType, directorsSupervisorsDto.getDirectorsType());
directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getPersonnelType()), DirectorsSupervisors::getPersonnelType, directorsSupervisorsDto.getPersonnelType()); directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getPersonnelType()), DirectorsSupervisors::getPersonnelType, directorsSupervisorsDto.getPersonnelType());
@ -60,7 +63,7 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
for (AttachmentDto attachment : attachmentList) { for (AttachmentDto attachment : attachmentList) {
list.add(attachment.getPath()); list.add(attachment.getPath());
} }
directorsSupervisors.setCorrelationFile(StringUtils.join(list,",")); directorsSupervisors.setCorrelationFile(StringUtils.join(list, ","));
int i = directorsSupervisorsMapper.insert(directorsSupervisors); int i = directorsSupervisorsMapper.insert(directorsSupervisors);
if (i > 0) { if (i > 0) {
List<AttachmentDto> attachmentDtoList = directorsSupervisors.getAttachmentDtoList(); List<AttachmentDto> attachmentDtoList = directorsSupervisors.getAttachmentDtoList();
@ -85,10 +88,11 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult deleteDirectorsSupervisors(IdsRequest ids) { public AjaxResult deleteDirectorsSupervisors(IdsRequest ids) {
if (CollectionUtil.isEmpty(Arrays.asList(ids.getIds()))) { List<String> asList = Arrays.asList(ids.getIds());
if (CollectionUtil.isEmpty(asList)) {
return AjaxResult.fail().msg("Id不能为空"); return AjaxResult.fail().msg("Id不能为空");
} else { } else {
int i = directorsSupervisorsMapper.deleteBatchIds(Arrays.asList(ids.getIds())); int i = directorsSupervisorsMapper.deleteBatchIds(asList);
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!"); return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
} }
} }
@ -96,6 +100,9 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
@Override @Override
public AjaxResult selectDirectorsSupervisorsById(String id) { public AjaxResult selectDirectorsSupervisorsById(String id) {
DirectorsSupervisors directorsSupervisors = directorsSupervisorsMapper.selectById(id); DirectorsSupervisors directorsSupervisors = directorsSupervisorsMapper.selectById(id);
if (ObjectUtil.isNull(directorsSupervisors)) {
return AjaxResult.fail().msg("未找到相关信息!");
}
List<Attachment> attachmentList = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, directorsSupervisors.getId()).eq(Attachment::getTargetType, "directors")); List<Attachment> attachmentList = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, directorsSupervisors.getId()).eq(Attachment::getTargetType, "directors"));
List<AttachmentDto> attachmentDtos = BeanUtil.copyToList(attachmentList, AttachmentDto.class); List<AttachmentDto> attachmentDtos = BeanUtil.copyToList(attachmentList, AttachmentDto.class);
directorsSupervisors.setAttachmentDtoList(attachmentDtos); directorsSupervisors.setAttachmentDtoList(attachmentDtos);

View File

@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.util.StringUtils; import org.thymeleaf.util.StringUtils;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -51,7 +52,7 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
@Override @Override
public AjaxResult selectOrganizationList(Page<Organization> page, String companyName) { public AjaxResult selectOrganizationList(Page<Organization> page, String companyName) {
LambdaQueryWrapper<Organization> organizationLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Organization> organizationLambdaQueryWrapper = new LambdaQueryWrapper<>();
organizationLambdaQueryWrapper.eq(StrUtil.isNotBlank(companyName), Organization::getCompanyName, companyName); organizationLambdaQueryWrapper.exists(StrUtil.isNotBlank(companyName), "select t2.id from t_lc_company_name t2 where t_lc_organization.company_id = t2.id and t2.company_name like '%" + companyName + "%'");
Page<Organization> selectPage = organizationMapper.selectPage(page, organizationLambdaQueryWrapper); Page<Organization> selectPage = organizationMapper.selectPage(page, organizationLambdaQueryWrapper);
for (Organization record : selectPage.getRecords()) { for (Organization record : selectPage.getRecords()) {
record.setUpdatedName(userMapper.selectById(record.getUpdatedId()).getUserName()); record.setUpdatedName(userMapper.selectById(record.getUpdatedId()).getUserName());
@ -84,10 +85,11 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult deleteOrganization(IdsRequest id) { public AjaxResult deleteOrganization(IdsRequest id) {
if (CollectionUtil.isEmpty(Arrays.asList(id.getIds()))) { List<String> asList = Arrays.asList(id.getIds());
if (CollectionUtil.isEmpty(asList)) {
return AjaxResult.fail().msg("Id不能为空"); return AjaxResult.fail().msg("Id不能为空");
} else { } else {
int i = organizationMapper.deleteBatchIds(Arrays.asList(id.getIds())); int i = organizationMapper.deleteBatchIds(asList);
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!"); return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
} }
} }

View File

@ -12,7 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotEmpty;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
/** /**
* <p> * <p>

View File

@ -160,6 +160,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
String card = StringUtils.join(saveFilePath(cardFile, AgesConst.CARD_FILE, AgesConst.UPDATE, updateRequest.getId()), ','); String card = StringUtils.join(saveFilePath(cardFile, AgesConst.CARD_FILE, AgesConst.UPDATE, updateRequest.getId()), ',');
String education = StringUtils.join(saveFilePath(educationFile,AgesConst.EDUCATION_FILE,AgesConst.UPDATE,updateRequest.getId()),','); String education = StringUtils.join(saveFilePath(educationFile,AgesConst.EDUCATION_FILE,AgesConst.UPDATE,updateRequest.getId()),',');
String audit = StringUtils.join(saveFilePath(auditFile,AgesConst.AUDIT_FILE,AgesConst.UPDATE,updateRequest.getId()),','); String audit = StringUtils.join(saveFilePath(auditFile,AgesConst.AUDIT_FILE,AgesConst.UPDATE,updateRequest.getId()),',');
System.out.println("per = " + per);
if (per.getAuditState().equals(0)||per.getAuditState().equals(1)) { if (per.getAuditState().equals(0)||per.getAuditState().equals(1)) {
return AjaxResult.fail().msg("该人员修改的资料未审批完成,请联系管理员!"); return AjaxResult.fail().msg("该人员修改的资料未审批完成,请联系管理员!");
} }
@ -271,20 +272,24 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
} }
public void saveAlteration(String details,Object before ,Object after,String type, String id,String fieldName){ public void saveAlteration(String details,Object before ,Object after,String type, String id,String fieldName){
if (!before.equals(after)){ if (ObjectUtil.isNotNull(after)){
Alteration alteration = new Alteration(); System.out.println("after = " + after);
alteration.setDetails(details); if (!before.equals(after)){
alteration.setFieldName(fieldName); Alteration alteration = new Alteration();
alteration.setType(type); alteration.setDetails(details);
alteration.setRelevancyId(id); alteration.setFieldName(fieldName);
if (ObjectUtil.isNotNull(before)){ alteration.setType(type);
alteration.setBeforeChange( before.toString()); alteration.setRelevancyId(id);
}else { if (ObjectUtil.isNotNull(before)){
alteration.setBeforeChange(""); alteration.setBeforeChange( before.toString());
}else {
alteration.setBeforeChange("");
}
alteration.setAfterChange(after.toString());
alterationMapper.insert(alteration);
} }
alteration.setAfterChange(after.toString());
alterationMapper.insert(alteration);
} }
} }
public List<AttachmentDto> nameAndPath(String file,String id){ public List<AttachmentDto> nameAndPath(String file,String id){
if (StrUtil.isNotBlank(file)){ if (StrUtil.isNotBlank(file)){