Merge remote-tracking branch 'origin/master'

This commit is contained in:
lijiaqi 2023-02-15 11:46:05 +08:00
commit 85da7ed448
48 changed files with 1864 additions and 284 deletions

View File

@ -39,6 +39,7 @@ public interface UrlConstant {
String ORGANIZATION = API + "/organization"; String ORGANIZATION = API + "/organization";
String PARTY_ORGANIZATION = API + "/party_organization"; String PARTY_ORGANIZATION = API + "/party_organization";
String DIRECTORS_SUPERVISORS = API + "/directors_supervisors"; String DIRECTORS_SUPERVISORS = API + "/directors_supervisors";
String PERSONNEL_INDICATORS = API + "/personnel_indicators";
String ALTERATION = API + "/alteration"; String ALTERATION = API + "/alteration";
String Attachment = API + "/attachment"; String Attachment = API + "/attachment";

View File

@ -0,0 +1,48 @@
package com.ydool.common.converter;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
/**
* @author msh
* @version 1.0
* @date 2023/2/13 17:19
*/
public class EasyExcelLocalDateConverter implements Converter<LocalDate> {
@Override
public Class<LocalDate> supportJavaTypeKey() {
return LocalDate.class;
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
@Override
public LocalDate convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
if (cellData.getType().equals(CellDataTypeEnum.NUMBER)){
LocalDate localDate = LocalDate.of(1900, 1, 1);
localDate = localDate.plusDays(cellData.getNumberValue().longValue() - 2);
return localDate;
}else if (cellData.getType().equals(CellDataTypeEnum.STRING)){
return LocalDate.parse(cellData.getStringValue(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}else {
return null;
}
}
@Override
public CellData<LocalDate> convertToExcelData(LocalDate value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
return new CellData<>(value.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
}
}

View File

@ -0,0 +1,67 @@
package com.ydool.common.handler;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.handler.CellWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.DataValidationHelper;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddressList;
import java.util.List;
import java.util.Map;
/**
* @author liuhaoze
* @date 2021/12/17 10:13
*/
public class ExcelDataValidationHandler implements CellWriteHandler {
private Map<Integer, String[]> dataValidation;
public ExcelDataValidationHandler(Map<Integer, String[]> dataValidation){
this.dataValidation = dataValidation;
}
@Override
public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Head head, Integer integer, Integer integer1, Boolean aBoolean) {
}
@Override
public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, Head head, Integer integer, Boolean aBoolean) {
}
@Override
public void afterCellDataConverted(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, CellData cellData, Cell cell, Head head, Integer integer, Boolean aBoolean) {
}
@Override
public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List<CellData> cellDataList, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) {
if(isHead){
Sheet sheet = writeSheetHolder.getSheet();
DataValidationHelper helper = sheet.getDataValidationHelper();
dataValidation.forEach((k, v) -> {
// 设置下拉单元格的首行 末行 首列 末列
CellRangeAddressList rangeList = new CellRangeAddressList(1, 100000, k, k);
// 下拉列表约束数据
DataValidationConstraint constraint = helper.createExplicitListConstraint(v);
// 设置约束
DataValidation validation = helper.createValidation(constraint, rangeList);
// 阻止输入非下拉选项的值
validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
validation.setShowErrorBox(true);
validation.setSuppressDropDownArrow(true);
validation.createErrorBox("提示", "此值与单元格定义格式不一致");
sheet.addValidationData(validation);
});
}
}
}

View File

@ -0,0 +1,186 @@
package com.ydool.common.utils;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.listener.ReadListener;
import com.ydool.staff.excel.ExcelPersonnel;
import com.ydool.staff.request.PersonnelDeleteRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
* 基于EasyExcel的导入导出工具类 在使用时需要先将excel实体类中的字段使用@ExcelProperty来指定表头
* {@link com.alibaba.excel.annotation.ExcelProperty}
* {@link com.alibaba.excel.annotation.write.style.ColumnWidth}
* {@link com.alibaba.excel.annotation.format.DateTimeFormat}
*/
public class EasyExcelAlibabaUtil {
private static Log logger = LogFactory.getLog("EasyExcelAlibabaUtil");
/**
* 将excel文件转化成javaList集合
* 需要在传入的class的字段中加入EasyExcel的专用注解来指定表名
*
* @param excelFile 前端传入的文件
* @param clazz 一个Class对象
* @param <T>
* @return 可以直接转成传入的Class的List集合
*/
public static <T> List<T> excelToList(MultipartFile excelFile, Class<T> clazz) {
List<T> objects = null;
try {
InputStream inputStream = excelFile.getInputStream();
objects = EasyExcel.read(inputStream).head(clazz).sheet().doReadSync();
} catch (Exception e) {
logger.error("excelToList-exception", e);
} finally {
return objects;
}
}
/**
* 读取excel这个相当于一个高性能模式
* 比上面的方法多了一个readListener接口 需要传一个实现这个接口的实现类
* 其中invoke方法是每读取一行都会调用 所以可以读取一行处理一行 性能比较高
*
* @param excelFile
* @param clazz
* @param readListener
*/
public static void readExcelHighPerformance(MultipartFile excelFile, Class<T> clazz, ReadListener readListener) {
try {
InputStream inputStream = excelFile.getInputStream();
EasyExcel.read(inputStream, clazz, readListener).sheet().doRead();
} catch (Exception e) {
logger.error("excelToList-readExcelHighPerformance", e);
}
}
/**
* 下载excel
*
* @param response web项目中response对象
* @param clazz Class对象 需要读取这个Class中的字段注解的名称 用于生成表头
* @param list java的List集合需要与传入的Class匹配
* @param excelName 需要生成的excel名称
*/
public static void download(HttpServletResponse response, Class<?> clazz, List<?> list, String excelName) {
try {
ServletOutputStream outputStream = response.getOutputStream();
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode(excelName, "UTF-8"));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
EasyExcel.write(baos, clazz).sheet("sheet1").doWrite(list);
response.setHeader("Content-Length", String.valueOf(baos.size()));
outputStream.write(baos.toByteArray());
response.flushBuffer();
} catch (Exception e) {
logger.error("excelToList-download", e);
}
}
public static void exportDownload(HttpServletResponse response, Class<?> clazz, List<?> list, String excelName, Set<String> param) {
try {
ServletOutputStream outputStream = response.getOutputStream();
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode(excelName, "UTF-8"));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// 这里 需要指定写用哪个class去写然后写到第一个sheet名字为模板 然后文件流会自动关闭
EasyExcel.write(baos, clazz).includeColumnFiledNames(param).sheet("sheet1")
.doWrite(list);
response.setHeader("Content-Length", String.valueOf(baos.size()));
outputStream.write(baos.toByteArray());
response.flushBuffer();
} catch (Exception e) {
logger.error("excelToList-download", e);
}
}
/**
* 下载excel
*
* @param clazz Class对象 需要读取这个Class中的字段注解的名称 用于生成表头
* @param list java的List集合需要与传入的Class匹配
* @param excelName 需要生成的excel名称
*/
public static String download(Class<?> clazz, List<?> list, String excelName) {
//文件名称
String fileName = excelName + IdUtil.randomUUID() + ".xlsx";
//文件存放目录
String urlPath = getWebRoot() + getFileUploadPath();
//文件路径
String fileNamePath = urlPath + File.separator + fileName;
//文件存放目录不存在则新建
File pathFile = new File(urlPath);
if (!pathFile.exists()) pathFile.mkdirs();
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
EasyExcel.write(baos, clazz).sheet("sheet1").doWrite(list);
//生成excel文件
FileOutputStream fileOutputStream = null;
try {
fileOutputStream = new FileOutputStream(fileNamePath);
fileOutputStream.write(baos.toByteArray());
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
} catch (Exception e) {
logger.error("excelToList-download", e);
}
return getFileUploadPath() + File.separator + fileName;
}
/**
* 文件名
*
* @param excelName
* @return
*/
public static String getFileNamePath(String excelName) {
String fileName = excelName + IdUtil.randomUUID() + ".xlsx";//文件名称
String folder = DateUtil.format(new Date(), "yyyy" + File.separator + "MM" + File.separator + "dd");//当天文件夹名称
String urlPath = System.getProperty("user.dir") + File.separator + "upload" + File.separator + folder; //文件存放路径
String fileNamePath = urlPath + File.separator + fileName;
return fileNamePath;
}
public static String getFileUploadPath() {
String folder = DateUtil.format(new Date(), "yyyy" + File.separator + "MM" + File.separator + "dd");
return File.separator + "upload" + File.separator + "excel" + File.separator + folder;
}
public static String getRtspUploadPath() {
String folder = "rtsp";
return File.separator + "upload" + File.separator + folder;
}
public static String getWebRoot() {
return System.getProperty("user.dir");
}
}

View File

@ -0,0 +1,108 @@
package com.ydool.common.utils;
import com.alibaba.excel.write.handler.RowWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
/**
* @author liuhaoze
* @date 2022/5/27 14:45
*/
public class ExcelMergeRowByRowUtil implements RowWriteHandler {
private int mergeRowIndex;//从哪一行开始合并
private int[] mergeColumnIndex;//excel合并的列
private int signNum;//合并的唯一标识
private int total;//总行数
private int lastRow;
private int firstCol;
private int lastCol;
private int firstRow;
private int mergeCount =1;
public ExcelMergeRowByRowUtil(int mergeRowIndex, int[] mergeColumnIndex, int signNum, int total) {
this.mergeRowIndex = mergeRowIndex;
this.mergeColumnIndex = mergeColumnIndex;
this.signNum = signNum;
this.total = total;
}
@Override
public void beforeRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Integer rowIndex, Integer relativeRowIndex, Boolean isHead) {
}
@Override
public void afterRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
}
@Override
public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
//当前行
int curRowIndex = row.getRowNum();
//每一行的最大列数
short lastCellNum = row.getLastCellNum();
if(curRowIndex == 1){
//赋初值 第一行
firstRow = curRowIndex;
}
//开始合并位置
if(curRowIndex > mergeRowIndex && !row.getCell(0).getStringCellValue().equals("")){
for (int i = 0; i < lastCellNum; i++) {
if(i == mergeColumnIndex[i]){
//当前行号 当前行对象 合并的标识位
mergeWithPrevAnyRow(writeSheetHolder.getSheet(),curRowIndex,row,signNum);
break;//已经进入到合并单元格操作里面了执行一次就行
}
}
}
}
public void mergeWithPrevAnyRow(Sheet sheet,int curRowIndex,Row row,int signNum){
Object currentData = row.getCell(signNum).getCellTypeEnum() == CellType.STRING ? row.getCell(signNum).getStringCellValue() : row.getCell(signNum).getNumericCellValue();
Row preRow = row.getSheet().getRow(curRowIndex - 1);
Object preData = preRow.getCell(signNum).getCellTypeEnum() == CellType.STRING ? preRow.getCell(signNum).getStringCellValue() : preRow.getCell(signNum).getNumericCellValue();
//判断是否合并单元格
boolean curEqualsPre = currentData.equals(preData);
//判断前一个和后一个相同 并且 标识位相同
if (curEqualsPre){
lastRow = curRowIndex;
mergeCount++;
}
//excel过程中合并
if(!curEqualsPre && mergeCount>1){
mergeSheet(firstRow,lastRow,mergeColumnIndex,sheet);
mergeCount = 1;
}
//excel结尾处合并
if (mergeCount>1 && total==curRowIndex){
mergeSheet(firstRow,lastRow,mergeColumnIndex,sheet);
mergeCount = 1;
}
if (!curEqualsPre){
firstRow = curRowIndex;
}
}
private void mergeSheet(int firstRow, int lastRow, int[] mergeColumnIndex, Sheet sheet){
for (int colNum : mergeColumnIndex){
firstCol = colNum;
lastCol = colNum;
CellRangeAddress cellRangeAddress = new CellRangeAddress(firstRow,lastRow,firstCol,lastCol);
sheet.addMergedRegion(cellRangeAddress);
}
}
}

View File

@ -0,0 +1,107 @@
package com.ydool.common.utils;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.ydool.common.exception.ResultException;
import com.ydool.common.handler.ExcelDataValidationHandler;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.IndexedColors;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
public class ExcelUtil {
public static void export(String fileName, List<List<String>> head, String sheetName, List data) {
try {
HttpServletResponse response = HttpServletUtil.getResponse();
response.reset();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream()).head(head).registerWriteHandler(getHorizontalCellStyleStrategy()).sheet(sheetName).doWrite(data);
}catch (Exception e) {
e.printStackTrace();
throw new ResultException("下载模板文件失败");
}
}
public static void export(String fileName, List<List<String>> head, Map<Integer, String[]> dataValidation, String sheetName, List data) {
try {
HttpServletResponse response = HttpServletUtil.getResponse();
response.reset();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream()).head(head).registerWriteHandler(getHorizontalCellStyleStrategy()).registerWriteHandler(new ExcelDataValidationHandler(dataValidation)).sheet(sheetName).doWrite(data);
}catch (Exception e) {
e.printStackTrace();
throw new ResultException("下载模板文件失败");
}
}
public static void export(String fileName, Class head, String sheetName, List data) {
try {
HttpServletResponse response = HttpServletUtil.getResponse();
response.reset();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream()).head(head).autoTrim(false).registerWriteHandler(getHorizontalCellStyleStrategy()).sheet(sheetName).doWrite(data);
}catch (Exception e) {
e.printStackTrace();
throw new ResultException("下载失败");
}
}
public static void export(String fileName, Class head,ExcelMergeRowByRowUtil excelMergeRowByRowStrategy, String sheetName, List data) {
try {
HttpServletResponse response = HttpServletUtil.getResponse();
response.reset();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream()).head(head).autoTrim(false).registerWriteHandler(getHorizontalCellStyleStrategy()).registerWriteHandler(excelMergeRowByRowStrategy).sheet(sheetName).doWrite(data);
}catch (Exception e) {
e.printStackTrace();
throw new ResultException("下载失败");
}
}
public static HorizontalCellStyleStrategy getHorizontalCellStyleStrategy() {
// 头的策略
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
headWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());
WriteFont headWriteFont = new WriteFont();
headWriteFont.setFontHeightInPoints((short)9);
headWriteFont.setFontName("宋体");
headWriteFont.setBold(false);//设置字体不加粗
headWriteCellStyle.setWriteFont(headWriteFont);
// 内容的策略
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
// 这里需要指定 FillPatternType 为FillPatternType.SOLID_FOREGROUND 不然无法显示背景颜色.头默认了 FillPatternType所以可以不指定
contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
// 背景白色
contentWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());
// 字体
WriteFont contentWriteFont = new WriteFont();
contentWriteFont.setFontHeightInPoints((short)9);
contentWriteFont.setFontName("宋体");
contentWriteFont.setBold(false); //设置字体不加粗
contentWriteCellStyle.setWriteFont(contentWriteFont);
//边框
contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
// 这个策略是 头是头的样式 内容是内容的样式 其他的策略可以自己实现
HorizontalCellStyleStrategy horizontalCellStyleStrategy =
new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
return horizontalCellStyleStrategy;
}
}

View File

@ -31,6 +31,12 @@ public class DirectorsSupervisorsController extends BaseController {
return directorsSupervisorsService.selectDirectorsSupervisorsList(new Page<>(getPageNum(), getPageSize()), directorsSupervisorsDto); return directorsSupervisorsService.selectDirectorsSupervisorsList(new Page<>(getPageNum(), getPageSize()), directorsSupervisorsDto);
} }
@GetMapping("/selectDirectorsSupervisorsFile")
@ApiOperation(value = "董监任免申报附件列表")
public AjaxResult selectDirectorsSupervisorsFile(String id){
return directorsSupervisorsService.selectDirectorsSupervisorsFile(new Page<>(getPageNum(), getPageSize()), id);
}
@GetMapping("/selectDirectorsSupervisorsById") @GetMapping("/selectDirectorsSupervisorsById")
@ApiOperation(value = "董监任免申报详情") @ApiOperation(value = "董监任免申报详情")
@ApiImplicitParam(name = "id", value = "董监任免id", dataType = "String", required = true) @ApiImplicitParam(name = "id", value = "董监任免id", dataType = "String", required = true)

View File

@ -2,12 +2,13 @@ package com.ydool.staff.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
import com.ydool.common.base.BaseController; import com.ydool.common.base.BaseController;
import com.ydool.common.constant.ArgsConst;
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.PartyOrganization; import com.ydool.staff.entity.Organization;
import com.ydool.staff.request.MechanismRequest; import com.ydool.staff.request.OrganizationSearch;
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;
@ -15,75 +16,28 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping(UrlConstant.ORGANIZATION) @RequestMapping(UrlConstant.ORGANIZATION)
@Api(tags = "内设机构登记", value = "内设机构登记") @Api(tags = "人员招聘登记人员指标申报列表", value = "人员招聘登记人员指标申报列表")
public class OrganizationController extends BaseController { public class OrganizationController extends BaseController {
@Autowired
ICompanyNameService companyNameService;
@Autowired @Autowired
IOrganizationService organizationService; IOrganizationService organizationService;
@Autowired
IPartyOrganizationService partyOrganizationService;
@Autowired
IMechanismService mechanismService;
@Autowired
IAttachmentService attachmentService;
/** @GetMapping("/selectOrganizationPersonnelIndicatorsList")
* =======================内设机构登记========================= @ApiOperation(value = "人员招聘登记人员指标申报列表")
* @return @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = Organization.class)}), order = 1)
*/ @ApiImplicitParams({@ApiImplicitParam(name = "type", value = "人员招聘登记organization/人员指标申报personnel_indicators", dataType = "String", required = true), @ApiImplicitParam(name = "current", value = "当前页", dataType = "Integer"), @ApiImplicitParam(name = "size", value = "每页条数", dataType = "Integer"),})
public AjaxResult selectOrganizationList(OrganizationSearch organizationSearch) {
@GetMapping("/selectOrganizationList") return organizationService.selectOrganizationList(new Page<Organization>(getPageNum(), getPageSize()), organizationSearch);
@ApiOperation(value = "内设机构登记列表")
@ApiOperationSupport(order = 1)
@ApiImplicitParams({@ApiImplicitParam(name = "companyName", value = "企业名称"), @ApiImplicitParam(name = "current", value = "当前页", dataType = "Integer"), @ApiImplicitParam(name = "size", value = "每页条数", dataType = "Integer"),})
public AjaxResult selectOrganizationList(String companyName) {
return organizationService.selectOrganizationList(new Page<>(getPageNum(), getPageSize()), companyName);
} }
@GetMapping("/selectOrganizationByMechanism") @PostMapping("/deleteOrganizationAndPersonnelIndicators")
@ApiOperation(value = "内设机构登记详情") @ApiOperation(value = "人员招聘登记人员指标申报删除")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 2)
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "内设机构Id", required = true)})
public AjaxResult selectOrganizationByMechanism(String id) {
return organizationService.selectOrganizationByMechanism(id);
}
@PostMapping("/deleteOrganization")
@ApiOperation(value = "内设机构删除")
@ApiOperationSupport(order = 5)
public AjaxResult deleteOrganization(@RequestBody IdsRequest id) { public AjaxResult deleteOrganization(@RequestBody IdsRequest id) {
return organizationService.deleteOrganization(id); return organizationService.deleteOrganization(id);
} }
/**
* ===========================机构信息============================
* @return
*/
@PostMapping("/saveMechanism")
@ApiOperation(value = "机构信息新增")
@ApiOperationSupport(order = 6)
public AjaxResult saveMechanism(@RequestBody @Validated MechanismRequest mechanismRequest) {
return mechanismService.saveOrganizationMechanism(mechanismRequest);
}
/**
* ==========================党组织信息===========================
* @return
*/
@PostMapping("/savePartyOrganization")
@ApiOperation(value = "党组织信息新增")
@ApiOperationSupport(order = 7)
public AjaxResult savePartyOrganization(@RequestBody @Validated PartyOrganization partyOrganization) {
return partyOrganizationService.savePartyOrganization(partyOrganization);
}
} }

View File

@ -9,7 +9,9 @@ import com.ydool.common.utils.UploadUtils;
import com.ydool.staff.dto.PersonnelDto; import com.ydool.staff.dto.PersonnelDto;
import com.ydool.staff.dto.PersonnelUpdateDto; import com.ydool.staff.dto.PersonnelUpdateDto;
import com.ydool.staff.entity.Attachment; import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.Personnel;
import com.ydool.staff.entity.SelectRequest; import com.ydool.staff.entity.SelectRequest;
import com.ydool.staff.excel.ExcelPersonnel;
import com.ydool.staff.request.ChangeRequest; import com.ydool.staff.request.ChangeRequest;
import com.ydool.staff.request.PersonnelDeleteRequest; import com.ydool.staff.request.PersonnelDeleteRequest;
import com.ydool.staff.request.PersonnelRequest; import com.ydool.staff.request.PersonnelRequest;
@ -24,8 +26,11 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
/** /**
@ -83,7 +88,30 @@ public class PersonnelController extends BaseController {
return personnelService.updateChange(request); return personnelService.updateChange(request);
} }
@GetMapping("getEntityParam")
@ApiOperation(value = "获取实体参数名",response = ExcelPersonnel.class)
public AjaxResult getEntityParam(){
return personnelService.getEntityParam();
}
@PostMapping("export")
@ApiOperation(value = "导出接口")
public void export(@RequestBody PersonnelDeleteRequest personnelParam,HttpServletResponse response){
personnelService.export(personnelParam,response);
}
/**
* 导入员工
*
* @param excl
* @throws Exception
*/
@ApiOperation("导入员工")
@PostMapping(value = "importPersonnel")
public void importEmployees(@RequestParam("file") @NotNull(message = "file is null") MultipartFile excl) throws Exception {
AjaxResult ajaxResult = personnelService.importPersonnel(excl);
renderJson(ajaxResult);
}
} }

View File

@ -0,0 +1,47 @@
package com.ydool.staff.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
import com.ydool.common.base.BaseController;
import com.ydool.common.constant.UrlConstant;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.PersonnelIndicatorsDto;
import com.ydool.staff.request.PersonnelIndicatorsRequest;
import com.ydool.staff.service.IPersonnelIndicatorsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author Zhuyy
* @ClassName PersonnelIndicatorsController
* @Description TODO
* @date 2023/2/10 11:32
* @Version 1.0
*/
@RestController
@RequestMapping(UrlConstant.PERSONNEL_INDICATORS)
@Api(tags = "人员指标申报", value = "人员指标申报")
public class PersonnelIndicatorsController extends BaseController {
@Autowired
IPersonnelIndicatorsService personnelIndicatorsService;
@PostMapping("/savePersonnelIndicators")
@ApiOperation(value = "人员指标申报登记")
@ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = PersonnelIndicatorsRequest.class)}), order = 2)
public AjaxResult savePersonnelIndicators(@RequestBody @Validated PersonnelIndicatorsRequest personnelIndicatorsRequest) {
return personnelIndicatorsService.savePersonnelIndicators(personnelIndicatorsRequest);
}
@GetMapping("/selectPersonnelIndicatorsById")
@ApiOperation(value = "人员指标申报详情")
@ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = PersonnelIndicatorsDto.class)}), order = 3)
public AjaxResult selectPersonnelIndicatorsById(String id) {
return personnelIndicatorsService.selectPersonnelIndicatorsById(id);
}
}

View File

@ -1,10 +1,15 @@
package com.ydool.staff.controller; package com.ydool.staff.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
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.dto.RecruitmentDto;
import com.ydool.staff.request.RecruitmentRequest; import com.ydool.staff.request.RecruitmentRequest;
import com.ydool.staff.service.ICompanyNameService;
import com.ydool.staff.service.IRecruitmentService; import com.ydool.staff.service.IRecruitmentService;
import com.ydool.system.request.IdsRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -14,42 +19,31 @@ import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping(UrlConstant.RECRUITMENT) @RequestMapping(UrlConstant.RECRUITMENT)
@Api(tags = "员工登记", value = "员工登记") @Api(tags = "人员招聘登记", value = "人员招聘登记")
public class RecruitmentController { public class RecruitmentController extends BaseController {
// @Autowired @Autowired
// IRecruitmentService recruitmentService; IRecruitmentService recruitmentService;
// @Autowired
// ICompanyNameService companyNameService;
// @GetMapping("/RecruitmentList") @GetMapping("/selectCompanyNameById")
// @ApiOperation(value = "人员登记列表") @ApiOperation(value = "人员招聘登记详情")
// public AjaxResult recruitmentList() { @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = RecruitmentDto.class)}), order = 2)
// return recruitmentService.recruitmentList(); public AjaxResult selectCompanyNameById(String id) {
// } return recruitmentService.selectRecruitmentById(id);
}
// @PostMapping("/insertRecruitment") @PostMapping("/insertRecruitment")
// @ApiOperation(value = "人员登记") @ApiOperation(value = "人员招聘登记新增")
// public AjaxResult insertRecruitment(@RequestBody @Validated RecruitmentRequest recruitmentRequest) { @ApiOperationSupport(responses = @DynamicResponseParameters(properties = {@DynamicParameter(name = "data", dataTypeClass = RecruitmentRequest.class)}), order = 3)
// return recruitmentService.saveRecruitment(recruitmentRequest); public AjaxResult insertRecruitment(@RequestBody @Validated RecruitmentRequest recruitmentRequest) {
// } return recruitmentService.saveRecruitment(recruitmentRequest);
}
// @DeleteMapping("/deleteRecruitment") @PostMapping("/deleteRecruitment")
// @ApiOperation(value = "人员删除") @ApiOperation(value = "人员招聘登记删除")
// public AjaxResult deleteRecruitment(String id) { @ApiOperationSupport(order = 5)
// return recruitmentService.deleteRecruitment(id); public AjaxResult deleteRecruitment(@RequestBody IdsRequest id) {
// } return recruitmentService.deleteRecruitment(id);
}
// @GetMapping("/selectCompanyNameById")
// @ApiOperation(value = "人员招聘详情")
// public AjaxResult selectCompanyNameById(String id) {
// return companyNameService.selectCompanyNameById(id);
// }
// @PostMapping("/recruitmentSaveBatch")
// @ApiOperation(value = "批量人员登记")
// public AjaxResult recruitmentSaveBatch(@RequestBody @Validated RecruitmentDto recruitmentDto){
// return recruitmentService.recruitmentSaveBatch(recruitmentDto.getRecruitment());
// }
} }

View File

@ -0,0 +1,26 @@
package com.ydool.staff.dto;
import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.PersonnelIndicators;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author Zhuyy
* @ClassName PersonnelIndicatorsDto
* @Description TODO
* @date 2023/2/10 11:43
* @Version 1.0
*/
@Data
public class PersonnelIndicatorsDto implements Serializable {
@ApiModelProperty(value = "企业信息")
private Organization organization;
@ApiModelProperty(value = "人员指标申报")
private List<PersonnelIndicators> personnelIndicators;
}

View File

@ -29,7 +29,7 @@ public class PersonnelUpdateDto {
private String companyName; private String companyName;
@ApiModelProperty(value = "性别") @ApiModelProperty(value = "性别")
private Integer gender; private String gender;
@ApiModelProperty(value = "出生日期") @ApiModelProperty(value = "出生日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ -48,7 +48,7 @@ public class PersonnelUpdateDto {
private String education; private String education;
@ApiModelProperty(value = "是否应届毕业生") @ApiModelProperty(value = "是否应届毕业生")
private Integer freshGraduate; private String freshGraduate;
@ApiModelProperty(value = "毕业院校") @ApiModelProperty(value = "毕业院校")
private String academy; private String academy;

View File

@ -1,17 +1,19 @@
package com.ydool.staff.dto; package com.ydool.staff.dto;
import com.ydool.staff.request.RecruitmentRequest; import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.Recruitment;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
@Data @Data
public class RecruitmentDto implements Serializable { public class RecruitmentDto implements Serializable {
@NotEmpty(message = "不能为空") @ApiModelProperty(value = "企业信息")
@ApiModelProperty(value = "批量人员登记") private Organization organization;
private List<RecruitmentRequest> recruitment;
@ApiModelProperty(value = "人员招聘登记")
private List<Recruitment> recruitments;
} }

View File

@ -36,15 +36,20 @@ public class CompanyName extends BaseEntity {
private String approvalNumber; private String approvalNumber;
@ApiModelProperty(value = "核定指标人数") @ApiModelProperty(value = "核定指标人数")
private Integer checkNumber; private Long checkNumber;
@ApiModelProperty(value = "在职人数") @ApiModelProperty(value = "在职人数")
private Integer activeStaff; private Long activeStaff;
@ApiModelProperty(value = "剩余指标人数") @ApiModelProperty(value = "剩余指标人数")
private Integer residueNumber; private Long residueNumber;
@ApiModelProperty(value = "本次核定总人数")
private Long thisApprovalNumber;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remarks; private String remarks;
@ApiModelProperty(value = "附件")
private String file;
} }

View File

@ -38,6 +38,9 @@ public class DirectorsSupervisors extends BaseEntity {
@NotBlank(message = "企业Id不能为空") @NotBlank(message = "企业Id不能为空")
private String organizationId; private String organizationId;
@ApiModelProperty(value = "信用代码")
private String creditCode;
@ApiModelProperty(value = "姓名") @ApiModelProperty(value = "姓名")
@NotBlank(message = "姓名不能为空") @NotBlank(message = "姓名不能为空")
private String username; private String username;
@ -103,6 +106,12 @@ public class DirectorsSupervisors extends BaseEntity {
@ApiModelProperty(value = "单据状态") @ApiModelProperty(value = "单据状态")
private String documentStatus; private String documentStatus;
@ApiModelProperty(value = "初审意见")
private String firstTrial;
@ApiModelProperty(value = "终审意见")
private String lastInstance;
@ApiModelProperty(value = "附件") @ApiModelProperty(value = "附件")
@TableField(exist = false) @TableField(exist = false)
private List<AttachmentDto> attachmentDtoList; private List<AttachmentDto> attachmentDtoList;

View File

@ -34,19 +34,32 @@ public class Organization extends BaseEntity{
@ApiModelProperty(value = "信用代码") @ApiModelProperty(value = "信用代码")
private String creditCode; private String creditCode;
@ApiModelProperty(value = "审批单号")
private String approvalNumber;
@ApiModelProperty(value = "核定用工人数")
private Long checkNumber;
@ApiModelProperty(value = "剩余指标人数")
private Long residualNumber;
@ApiModelProperty(value = "在职人数")
private Long activeStaff;
@ApiModelProperty(value = "本次核定总人数")
private Long thisApprovalNumber;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "相关附件") @ApiModelProperty(value = "相关附件")
private String attachment; private String attachment;
// @ApiModelProperty(value = "附件列表") @ApiModelProperty(value = "类型")
// @TableField(exist = false) private String type;
// private List<Attachment> attachments;
@ApiModelProperty(value = "企业名称") @ApiModelProperty(value = "单据状态")
@TableField(exist = false) private String documentStatus;
private String companyName;
@ApiModelProperty(value = "修改人") @ApiModelProperty(value = "修改人")
@TableField(exist = false) @TableField(exist = false)

View File

@ -26,9 +26,9 @@ public class PartyOrganization extends BaseEntity{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
// @ApiModelProperty(value = "企业Id") @ApiModelProperty(value = "企业Id")
// @NotBlank(message = "企业Id不能为空") @NotBlank(message = "企业Id不能为空")
// private String organizationId; private String organizationId;
@ApiModelProperty(value = "姓名") @ApiModelProperty(value = "姓名")
@NotBlank(message = "姓名不能为空") @NotBlank(message = "姓名不能为空")

View File

@ -1,12 +1,11 @@
package com.ydool.staff.entity; package com.ydool.staff.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.ydool.common.base.BaseEntity; import com.ydool.common.base.BaseEntity;
import java.util.Date; import java.time.LocalDate;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -42,11 +41,11 @@ public class Personnel extends BaseEntity {
private String companyName; private String companyName;
@ApiModelProperty(value = "性别") @ApiModelProperty(value = "性别")
private Integer gender; private String gender;
@ApiModelProperty(value = "出生日期") @ApiModelProperty(value = "出生日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date birthday; private LocalDate birthday;
@ApiModelProperty(value = "身份证号") @ApiModelProperty(value = "身份证号")
private String numberId; private String numberId;
@ -61,7 +60,7 @@ public class Personnel extends BaseEntity {
private String education; private String education;
@ApiModelProperty(value = "是否应届毕业生") @ApiModelProperty(value = "是否应届毕业生")
private Integer freshGraduate; private String freshGraduate;
@ApiModelProperty(value = "毕业院校") @ApiModelProperty(value = "毕业院校")
private String academy; private String academy;
@ -101,23 +100,23 @@ public class Personnel extends BaseEntity {
@ApiModelProperty(value = "入职时间") @ApiModelProperty(value = "入职时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date hireDate; private LocalDate hireDate;
@ApiModelProperty(value = "退休时间") @ApiModelProperty(value = "退休时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date retirementTime; private LocalDate retirementTime;
@ApiModelProperty(value = "离职时间") @ApiModelProperty(value = "离职时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date resignationTime; private LocalDate resignationTime;
@ApiModelProperty(value = "退休返聘开始时间") @ApiModelProperty(value = "退休返聘开始时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date txfpStartTime; private LocalDate txfpStartTime;
@ApiModelProperty(value = "退休返聘结束时间") @ApiModelProperty(value = "退休返聘结束时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date txfpEndTime; private LocalDate txfpEndTime;
@ApiModelProperty(value = "人员招聘单号") @ApiModelProperty(value = "人员招聘单号")
private String recruitNumber; private String recruitNumber;

View File

@ -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;
/**
* <p>
* 人员指标申报
* </p>
*
* @author ljq
* @since 2023-02-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_lc_personnel_indicators")
@ApiModel(value = "PersonnelIndicators对象", description = "人员指标申报")
public class PersonnelIndicators extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "企业id")
private String organizationId;
@ApiModelProperty(value = "部门")
private String deptId;
@ApiModelProperty(value = "岗位")
private String job;
@ApiModelProperty(value = "指标说明")
private String indexExplain;
@ApiModelProperty(value = "标准指标人数")
private Long standardNumber;
@ApiModelProperty(value = "增加指标人数")
private Long addNumber;
@ApiModelProperty(value = "初审意见")
private String firstTrial;
@ApiModelProperty(value = "国资意见")
private String stateOwned;
@ApiModelProperty(value = "编办意见")
private String arrangeFor;
@ApiModelProperty(value = "单据状态")
private String documentStatus;
}

View File

@ -1,5 +1,6 @@
package com.ydool.staff.entity; package com.ydool.staff.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.common.base.BaseEntity; import com.ydool.common.base.BaseEntity;
@ -28,7 +29,7 @@ public class Recruitment extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "企业名称") @ApiModelProperty(value = "企业id")
private String companyId; private String companyId;
@ApiModelProperty(value = "部门") @ApiModelProperty(value = "部门")
@ -44,6 +45,18 @@ public class Recruitment extends BaseEntity {
private String requirements; private String requirements;
@ApiModelProperty(value = "审批") @ApiModelProperty(value = "审批")
private Integer approval; private Long approval;
@ApiModelProperty(value = "初审意见")
private String firstTrial;
@ApiModelProperty(value = "终审意见")
private String lastInstance;
@ApiModelProperty(value = "单据状态")
private String documentStatus;
@ApiModelProperty(value = "企业名称")
@TableField(exist = false)
private String companyName;
} }

View File

@ -0,0 +1,194 @@
package com.ydool.staff.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.ydool.common.converter.EasyExcelLocalDateConverter;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import java.time.LocalDate;
/**
* @author msh
* @version 1.0
* @date 2023/2/13 17:05
*/
@Data
@HeadRowHeight(20)
@ColumnWidth(20)
@HeadStyle(horizontalAlignment = HorizontalAlignment.CENTER)
@ContentStyle(verticalAlignment = VerticalAlignment.CENTER)
public class ExcelPersonnel {
@ExcelProperty(value = "统一社会信用代码" )
@ApiModelProperty(value = "统一社会信用代码")
private String socialCreditCode;
@ExcelProperty("姓名")
@ApiModelProperty(value = "姓名")
private String userName;
@ExcelProperty("企业名称")
@ApiModelProperty(value = "企业名称")
private String companyName;
@ExcelProperty("性别")
@ApiModelProperty(value = "性别")
private String gender;
@ExcelProperty(value = "出生日期" , converter = EasyExcelLocalDateConverter.class)
@ApiModelProperty(value = "出生日期")
private LocalDate birthday;
@ExcelProperty("身份证号")
@ApiModelProperty(value = "身份证号")
private String numberId;
@ExcelProperty("民族")
@ApiModelProperty(value = "民族")
private String nation;
@ExcelProperty("政治面貌")
@ApiModelProperty(value = "政治面貌")
private String politicsStatus;
@ExcelProperty("学历")
@ApiModelProperty(value = "学历")
private String education;
@ExcelProperty("是否应届毕业生")
@ApiModelProperty(value = "是否应届毕业生")
private String freshGraduate;
@ExcelProperty("毕业院校")
@ApiModelProperty(value = "毕业院校")
private String academy;
@ExcelProperty("专业")
@ApiModelProperty(value = "专业")
private String specialty;
@ExcelProperty("录用方式")
@ApiModelProperty(value = "录用方式")
private String hireType;
@ExcelProperty("执业资格证书")
@ApiModelProperty(value = "执业资格证书")
private String qualification;
@ExcelProperty("专业技术职称")
@ApiModelProperty(value = "专业技术职称")
private String jobTitle;
@ExcelProperty("所在部门")
@ApiModelProperty(value = "所在部门")
private String presentDept;
@ExcelProperty("岗位职务")
@ApiModelProperty(value = "岗位职务")
private String position;
@ExcelProperty("合同形式")
@ApiModelProperty(value = "合同形式")
private String contractModality;
@ExcelProperty("人员类型")
@ApiModelProperty(value = "人员类型")
private String personnelType;
@ExcelProperty("工作状态")
@ApiModelProperty(value = "工作状态")
private String workState;
@ExcelProperty("人员性质")
@ApiModelProperty(value = "人员性质")
private String personnelCharacter;
@ExcelProperty("年薪")
@ApiModelProperty(value = "年薪")
private Integer annualSalary;
@ExcelProperty(value = "入职时间" , converter = EasyExcelLocalDateConverter.class)
@ApiModelProperty(value = "入职时间")
private LocalDate hireDate;
@ExcelProperty(value = "退休时间", converter = EasyExcelLocalDateConverter.class)
@ApiModelProperty(value = "退休时间")
private LocalDate retirementTime;
@ExcelProperty(value ="离职时间",converter = EasyExcelLocalDateConverter.class)
@ApiModelProperty(value = "离职时间")
private LocalDate resignationTime;
@ExcelProperty(value = "退休返聘开始时间",converter = EasyExcelLocalDateConverter.class)
@ApiModelProperty(value = "退休返聘开始时间")
private LocalDate txfpStartTime;
@ExcelProperty(value = "退休返聘结束时间",converter = EasyExcelLocalDateConverter.class)
@ApiModelProperty(value = "退休返聘结束时间")
private LocalDate txfpEndTime;
@ExcelProperty("人员招聘单号")
@ApiModelProperty(value = "人员招聘单号")
private String recruitNumber;
@ExcelProperty("备注")
@ApiModelProperty(value = "备注")
private String remark;
@ExcelProperty("初审意见")
@ApiModelProperty(value = "初审意见")
private String firstTrialRemark;
@ExcelProperty("终审意见")
@ApiModelProperty(value = "终审意见")
private String finalTrialRemark;
@ExcelProperty("变更标志")
@ApiModelProperty(value = "变更标志")
private String alterationSign;
@ExcelProperty("单据状态")
@ApiModelProperty(value = "单据状态")
private String receipts;
}

View File

@ -0,0 +1,150 @@
package com.ydool.staff.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ydool.common.converter.EasyExcelLocalDateConverter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PersonnelExportVO {
@ExcelProperty(value = "统一社会信用代码" )
private String socialCreditCode;
@ExcelProperty("姓名")
private String userName;
@ExcelProperty("企业名称")
private String companyName;
@ExcelProperty("性别")
private String gender;
@ExcelProperty(value = "出生日期" , converter = EasyExcelLocalDateConverter.class)
private LocalDate birthday;
@ExcelProperty("身份证号")
private String numberId;
@ExcelProperty("民族")
private String nation;
@ExcelProperty("政治面貌")
private String politicsStatus;
@ExcelProperty("学历")
private String education;
@ExcelProperty("是否应届毕业生")
private String freshGraduate;
@ExcelProperty("毕业院校")
private String academy;
@ExcelProperty("专业")
private String specialty;
@ExcelProperty("录用方式")
private String hireType;
@ExcelProperty("执业资格证书")
private String qualification;
@ExcelProperty("专业技术职称")
private String jobTitle;
@ExcelProperty("所在部门")
private String presentDept;
@ExcelProperty("岗位职务")
private String position;
@ExcelProperty("合同形式")
private String contractModality;
@ExcelProperty("人员类型")
private String personnelType;
@ExcelProperty("工作状态")
private String workState;
@ExcelProperty("人员性质")
private String personnelCharacter;
@ExcelProperty("年薪")
private Integer annualSalary;
@ExcelProperty(value = "入职时间" , converter = EasyExcelLocalDateConverter.class)
private LocalDate hireDate;
@ExcelProperty(value = "退休时间", converter = EasyExcelLocalDateConverter.class)
private LocalDate retirementTime;
@ExcelProperty(value ="离职时间",converter = EasyExcelLocalDateConverter.class)
private LocalDate resignationTime;
@ExcelProperty(value = "退休返聘开始时间",converter = EasyExcelLocalDateConverter.class)
private LocalDate txfpStartTime;
@ExcelProperty(value = "退休返聘结束时间",converter = EasyExcelLocalDateConverter.class)
private LocalDate txfpEndTime;
@ExcelProperty("人员招聘单号")
private String recruitNumber;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("初审意见")
private String firstTrialRemark;
@ExcelProperty("终审意见")
private String finalTrialRemark;
@ExcelProperty("变更标志")
private String alterationSign;
@ExcelProperty("单据状态")
private String receipts;
}

View File

@ -0,0 +1,154 @@
package com.ydool.staff.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ydool.common.converter.EasyExcelLocalDateConverter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
/**
* @author msh
* @version 1.0
* @date 2023/2/14 11:55
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PersonnelFailMsgVO {
@ExcelProperty("统一社会信用代码")
private String socialCreditCode;
@ExcelProperty("姓名")
private String userName;
@ExcelProperty("企业名称")
private String companyName;
@ExcelProperty("性别")
private String gender;
@ExcelProperty(value = "出生日期" , converter = EasyExcelLocalDateConverter.class)
private LocalDate birthday;
@ExcelProperty("身份证号")
private String numberId;
@ExcelProperty("民族")
private String nation;
@ExcelProperty("政治面貌")
private String politicsStatus;
@ExcelProperty("学历")
private String education;
@ExcelProperty("是否应届毕业生")
private String freshGraduate;
@ExcelProperty("毕业院校")
private String academy;
@ExcelProperty("专业")
private String specialty;
@ExcelProperty("录用方式")
private String hireType;
@ExcelProperty("执业资格证书")
private String qualification;
@ExcelProperty("专业技术职称")
private String jobTitle;
@ExcelProperty("所在部门")
private String presentDept;
@ExcelProperty("岗位职务")
private String position;
@ExcelProperty("合同形式")
private String contractModality;
@ExcelProperty("人员类型")
private String personnelType;
@ExcelProperty("工作状态")
private String workState;
@ExcelProperty("人员性质")
private String personnelCharacter;
@ExcelProperty("年薪")
private Integer annualSalary;
@ExcelProperty(value = "入职时间" , converter = EasyExcelLocalDateConverter.class)
private LocalDate hireDate;
@ExcelProperty(value = "退休时间", converter = EasyExcelLocalDateConverter.class)
private LocalDate retirementTime;
@ExcelProperty(value ="离职时间",converter = EasyExcelLocalDateConverter.class)
private LocalDate resignationTime;
@ExcelProperty(value = "退休返聘开始时间",converter = EasyExcelLocalDateConverter.class)
private LocalDate txfpStartTime;
@ExcelProperty(value = "退休返聘结束时间",converter = EasyExcelLocalDateConverter.class)
private LocalDate txfpEndTime;
@ExcelProperty("人员招聘单号")
private String recruitNumber;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("初审意见")
private String firstTrialRemark;
@ExcelProperty("终审意见")
private String finalTrialRemark;
@ExcelProperty("变更标志")
private String alterationSign;
@ExcelProperty("单据状态")
private String receipts;
@ExcelProperty(value = "结果")
private String failMsg;
}

View File

@ -0,0 +1,18 @@
package com.ydool.staff.mapper;
import com.ydool.staff.entity.PersonnelIndicators;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 人员指标申报 Mapper 接口
* </p>
*
* @author ljq
* @since 2023-02-10
*/
@Mapper
public interface PersonnelIndicatorsMapper extends MPJBaseMapper<PersonnelIndicators> {
}

View File

@ -0,0 +1,26 @@
package com.ydool.staff.request;
import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.entity.PartyOrganization;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author Zhuyy
* @ClassName MechanismPartyOrganization
* @Description TODO
* @date 2023/2/10 15:35
* @Version 1.0
*/
@Data
public class MechanismPartyOrganization implements Serializable {
@ApiModelProperty(value = "内设机构信息")
private List<Mechanism> mechanisms;
@ApiModelProperty(value = "党组织信息")
private List<PartyOrganization> partyOrganizations;
}

View File

@ -1,7 +1,9 @@
package com.ydool.staff.request; package com.ydool.staff.request;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.entity.Attachment; import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.Mechanism; import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.entity.PartyOrganization;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -13,9 +15,9 @@ import java.util.List;
@Data @Data
public class MechanismRequest implements Serializable { public class MechanismRequest implements Serializable {
@ApiModelProperty(value = "企业名称") @ApiModelProperty(value = "企业id")
@NotBlank(message = "企业名称不能为空") @NotBlank(message = "企业id不能为空")
private String companyName; private String companyId;
@ApiModelProperty(value = "信用代码") @ApiModelProperty(value = "信用代码")
private String creditCode; private String creditCode;
@ -24,9 +26,13 @@ public class MechanismRequest implements Serializable {
private String remark; private String remark;
@ApiModelProperty(value = "附件列表") @ApiModelProperty(value = "附件列表")
private List<Attachment> attachments; private List<AttachmentDto> attachmentsDto;
@ApiModelProperty(value = "机构信息") @ApiModelProperty(value = "机构信息")
@NotEmpty(message = "机构信息不能为空") @NotEmpty(message = "机构信息不能为空")
private List<Mechanism> mechments; private List<Mechanism> mechanism;
@ApiModelProperty(value = "党组织信息")
@NotEmpty(message = "党组织信息不能为空")
private List<PartyOrganization> partyOrganizations;
} }

View File

@ -1,40 +1,37 @@
package com.ydool.staff.request; package com.ydool.staff.request;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.Mechanism;
import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.PartyOrganization;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
@Data @Data
public class OrganizationRequest implements Serializable { public class OrganizationRequest implements Serializable {
// @ApiModelProperty(value = "机构")
// private Organization organization;
@ApiModelProperty(value = "企业Id") @ApiModelProperty(value = "企业Id")
private String companyId; private String companyId;
@ApiModelProperty(value = "信用代码") @ApiModelProperty(value = "信用代码")
private String creditCode; private String creditCode;
@ApiModelProperty(value = "审批单号")
private String approvalNumber;
@ApiModelProperty(value = "核定用工人数")
private String checkNumber;
@ApiModelProperty(value = "在职人数")
private String activeStaff;
@ApiModelProperty(value = "本次核定总人数")
private String thisApprovalNumber;
@ApiModelProperty(value = "剩余指标人数")
private String residualNumber;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "附件列表")
private List<AttachmentDto> attachments;
@ApiModelProperty(value = "机构信息")
private List<Mechanism> mechanismList;
@ApiModelProperty(value = "党组织信息")
List<PartyOrganization> partyList;
} }

View File

@ -0,0 +1,28 @@
package com.ydool.staff.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Author Zhuyy
* @ClassName OrganizationSearch
* @Description TODO
* @date 2023/2/13 16:16
* @Version 1.0
*/
@Data
public class OrganizationSearch {
@ApiModelProperty(value = "企业名称")
private String companyName;
@ApiModelProperty(value = "审批单号")
private String approvalNumber;
@ApiModelProperty(value = "类型")
@NotBlank(message = "类型不能为空")
private String type;
}

View File

@ -0,0 +1,25 @@
package com.ydool.staff.request;
import com.ydool.staff.entity.PersonnelIndicators;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author Zhuyy
* @ClassName PersonnelIndicatorsRequest
* @Description TODO
* @date 2023/2/10 11:38
* @Version 1.0
*/
@Data
public class PersonnelIndicatorsRequest implements Serializable {
@ApiModelProperty(value = "人员指标")
private OrganizationRequest organizationRequest;
@ApiModelProperty(value = "人员指标申报")
private List<PersonnelIndicators> personnelIndicators;
}

View File

@ -32,7 +32,7 @@ public class PersonnelRequest {
@ApiModelProperty(value = "性别") @ApiModelProperty(value = "性别")
@NotNull(message = "性别不能为空") @NotNull(message = "性别不能为空")
private Integer gender; private String gender;
@ApiModelProperty(value = "出生日期") @ApiModelProperty(value = "出生日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ -56,7 +56,7 @@ public class PersonnelRequest {
@ApiModelProperty(value = "是否应届毕业生") @ApiModelProperty(value = "是否应届毕业生")
@NotNull(message = "是否应届毕业生不能为空") @NotNull(message = "是否应届毕业生不能为空")
private Boolean freshGraduate; private String freshGraduate;
@ApiModelProperty(value = "毕业院校") @ApiModelProperty(value = "毕业院校")
@NotBlank(message = "毕业院校不能为空") @NotBlank(message = "毕业院校不能为空")

View File

@ -35,7 +35,7 @@ public class PersonnelUpdateRequest {
@ApiModelProperty(value = "是否应届毕业生") @ApiModelProperty(value = "是否应届毕业生")
@NotBlank(message = "是否应届毕业生不能为空") @NotBlank(message = "是否应届毕业生不能为空")
private Integer freshGraduate; private String freshGraduate;
@ApiModelProperty(value = "毕业院校") @ApiModelProperty(value = "毕业院校")
@NotBlank(message = "毕业院校不能为空") @NotBlank(message = "毕业院校不能为空")

View File

@ -1,31 +1,19 @@
package com.ydool.staff.request; package com.ydool.staff.request;
import com.ydool.staff.entity.Recruitment;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
@Data @Data
public class RecruitmentRequest implements Serializable { public class RecruitmentRequest implements Serializable {
@ApiModelProperty(value = "企业名称") @ApiModelProperty(value = "招聘登记")
@NotBlank(message = "企业名称不能为空") private OrganizationRequest organizationRequest;
private String companyId;
@ApiModelProperty(value = "部门") @ApiModelProperty(value = "人员招聘登记")
@NotBlank(message = "部门不能为空") private List<Recruitment> recruitments;
private String deptId;
@ApiModelProperty(value = "岗位职务")
@NotBlank(message = "岗位职务不能为空")
private String position;
@ApiModelProperty(value = "名额")
@NotNull(message = "名额不能为空")
private Integer places;
@ApiModelProperty(value = "条件要求")
private String requirements;
} }

View File

@ -0,0 +1,22 @@
package com.ydool.staff.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author Zhuyy
* @ClassName RecruitmentSearch
* @Description TODO
* @date 2023/2/10 13:11
* @Version 1.0
*/
@Data
public class RecruitmentSearch {
@ApiModelProperty(value = "企业名称")
private String companyName;
@ApiModelProperty(value = "审批单号")
private String approvalNumber;
}

View File

@ -26,6 +26,6 @@ public interface IAttachmentService {
AjaxResult deleteFile(IdsRequest ids); AjaxResult deleteFile(IdsRequest ids);
AjaxResult selectOrganizationFileList(Page page,String id,String type); AjaxResult selectOrganizationFileList(Page<Attachment> page,String id,String type);
} }

View File

@ -3,6 +3,7 @@ package com.ydool.staff.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.DirectorsSupervisorsDto; import com.ydool.staff.dto.DirectorsSupervisorsDto;
import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.DirectorsSupervisors; import com.ydool.staff.entity.DirectorsSupervisors;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
@ -25,5 +26,7 @@ public interface IDirectorsSupervisorsService {
AjaxResult deleteDirectorsSupervisors(IdsRequest ids); AjaxResult deleteDirectorsSupervisors(IdsRequest ids);
AjaxResult selectDirectorsSupervisorsById(String id); AjaxResult selectDirectorsSupervisorsById(String id);
AjaxResult selectDirectorsSupervisorsFile(Page<Attachment> page, String id);
} }

View File

@ -1,5 +1,6 @@
package com.ydool.staff.service; package com.ydool.staff.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.Mechanism;
import com.ydool.staff.request.MechanismRequest; import com.ydool.staff.request.MechanismRequest;
@ -30,6 +31,8 @@ public interface IMechanismService {
*/ */
AjaxResult deleteMechanism(IdsRequest id); AjaxResult deleteMechanism(IdsRequest id);
AjaxResult saveOrganizationMechanism(MechanismRequest mechanismRequest); AjaxResult saveMechanismPartyOrganization(MechanismRequest mechanismRequest);
AjaxResult selectCompanyNameByIdMechanismPartyOrganization(String id);
} }

View File

@ -3,6 +3,7 @@ package com.ydool.staff.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.Organization; import com.ydool.staff.entity.Organization;
import com.ydool.staff.request.OrganizationSearch;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
/** /**
@ -15,14 +16,10 @@ import com.ydool.system.request.IdsRequest;
*/ */
public interface IOrganizationService { public interface IOrganizationService {
AjaxResult selectOrganizationList(Page<Organization> page, String companyName); AjaxResult selectOrganizationList(Page<Organization> page, OrganizationSearch organizationSearch);
AjaxResult selectOrganizationByMechanism(String id);
AjaxResult deleteOrganization(IdsRequest id); AjaxResult deleteOrganization(IdsRequest id);
AjaxResult selectOrganizationByName(String companyName);
AjaxResult selectOrganization();
} }

View File

@ -0,0 +1,21 @@
package com.ydool.staff.service;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.request.PersonnelIndicatorsRequest;
/**
* <p>
* 人员指标申报 服务类
* </p>
*
* @author ljq
* @since 2023-02-10
*/
public interface IPersonnelIndicatorsService {
AjaxResult savePersonnelIndicators(PersonnelIndicatorsRequest personnelIndicatorsRequest);
AjaxResult selectPersonnelIndicatorsById(String id);
}

View File

@ -2,12 +2,15 @@ package com.ydool.staff.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.Personnel;
import com.ydool.staff.entity.SelectRequest; import com.ydool.staff.entity.SelectRequest;
import com.ydool.staff.request.ChangeRequest; import com.ydool.staff.request.ChangeRequest;
import com.ydool.staff.request.PersonnelDeleteRequest; import com.ydool.staff.request.PersonnelDeleteRequest;
import com.ydool.staff.request.PersonnelRequest; import com.ydool.staff.request.PersonnelRequest;
import com.ydool.staff.request.PersonnelUpdateRequest; import com.ydool.staff.request.PersonnelUpdateRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
@ -56,5 +59,11 @@ public interface IPersonnelService {
* @return * @return
*/ */
AjaxResult updateChange(ChangeRequest request); AjaxResult updateChange(ChangeRequest request);
void export(PersonnelDeleteRequest param,HttpServletResponse response);
AjaxResult importPersonnel(MultipartFile excl);
AjaxResult getEntityParam();
} }

View File

@ -1,18 +1,16 @@
package com.ydool.staff.service; package com.ydool.staff.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.entity.Recruitment;
import com.ydool.staff.request.RecruitmentRequest; import com.ydool.staff.request.RecruitmentRequest;
import com.ydool.staff.request.RecruitmentSearch;
import com.ydool.system.request.IdsRequest;
import java.util.List; import java.util.List;
public interface IRecruitmentService { public interface IRecruitmentService {
/**
* 人员列表
* @return
*/
AjaxResult recruitmentList();
/** /**
* 新增人员 * 新增人员
* @param recruitmentRequest * @param recruitmentRequest
@ -25,7 +23,7 @@ public interface IRecruitmentService {
* @param id * @param id
* @return * @return
*/ */
AjaxResult deleteRecruitment(String id); AjaxResult deleteRecruitment(IdsRequest id);
/** /**
* 人员详情 * 人员详情
@ -34,10 +32,4 @@ public interface IRecruitmentService {
*/ */
AjaxResult selectRecruitmentById(String id); AjaxResult selectRecruitmentById(String id);
/**
* 批量新增人员
* @param recruitmentRequest
* @return
*/
AjaxResult recruitmentSaveBatch(List<RecruitmentRequest> recruitmentRequest);
} }

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.IdcardUtil;
import cn.hutool.core.util.ObjectUtil; 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;
@ -11,9 +12,11 @@ import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.AttachmentDto; import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.dto.DirectorsSupervisorsDto; import com.ydool.staff.dto.DirectorsSupervisorsDto;
import com.ydool.staff.entity.Attachment; import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.CompanyName;
import com.ydool.staff.entity.DirectorsSupervisors; import com.ydool.staff.entity.DirectorsSupervisors;
import com.ydool.common.base.BaseService; import com.ydool.common.base.BaseService;
import com.ydool.staff.mapper.AttachmentMapper; import com.ydool.staff.mapper.AttachmentMapper;
import com.ydool.staff.mapper.CompanyNameMapper;
import com.ydool.staff.mapper.DirectorsSupervisorsMapper; import com.ydool.staff.mapper.DirectorsSupervisorsMapper;
import com.ydool.staff.service.IDirectorsSupervisorsService; import com.ydool.staff.service.IDirectorsSupervisorsService;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
@ -42,23 +45,31 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
DirectorsSupervisorsMapper directorsSupervisorsMapper; DirectorsSupervisorsMapper directorsSupervisorsMapper;
@Autowired @Autowired
AttachmentMapper attachmentMapper; AttachmentMapper attachmentMapper;
@Autowired
CompanyNameMapper companyNameMapper;
@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.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.like(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());
directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getPoliticsStatus()), DirectorsSupervisors::getPoliticsStatus, directorsSupervisorsDto.getPoliticsStatus()); directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getPoliticsStatus()), DirectorsSupervisors::getPoliticsStatus, directorsSupervisorsDto.getPoliticsStatus());
directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getPersonnelStatus()), DirectorsSupervisors::getPersonnelStatus, directorsSupervisorsDto.getPersonnelStatus()); directorsSupervisorsLambdaQueryWrapper.eq(StrUtil.isNotBlank(directorsSupervisorsDto.getPersonnelStatus()), DirectorsSupervisors::getPersonnelStatus, directorsSupervisorsDto.getPersonnelStatus());
Page<DirectorsSupervisors> directorsSupervisors = directorsSupervisorsMapper.selectPage(page, directorsSupervisorsLambdaQueryWrapper); Page<DirectorsSupervisors> directorsSupervisors = directorsSupervisorsMapper.selectPage(page, directorsSupervisorsLambdaQueryWrapper);
for (DirectorsSupervisors record : directorsSupervisors.getRecords()) {
record.setOrganizationId(companyNameMapper.selectById(record.getOrganizationId()).getCompanyName());
}
return AjaxResult.ok().data(directorsSupervisors); return AjaxResult.ok().data(directorsSupervisors);
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult saveDirectorsSupervisors(DirectorsSupervisors directorsSupervisors) { public AjaxResult saveDirectorsSupervisors(DirectorsSupervisors directorsSupervisors) {
if (!IdcardUtil.isValidCard(directorsSupervisors.getIdentityCard())) {
return AjaxResult.fail().msg("身份证号格式不正确!");
}
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
List<AttachmentDto> attachmentList = directorsSupervisors.getAttachmentDtoList(); List<AttachmentDto> attachmentList = directorsSupervisors.getAttachmentDtoList();
for (AttachmentDto attachment : attachmentList) { for (AttachmentDto attachment : attachmentList) {
@ -109,5 +120,11 @@ public class DirectorsSupervisorsServiceImpl extends BaseService<DirectorsSuperv
directorsSupervisors.setAttachmentDtoList(attachmentDtos); directorsSupervisors.setAttachmentDtoList(attachmentDtos);
return AjaxResult.ok().data(directorsSupervisors); return AjaxResult.ok().data(directorsSupervisors);
} }
@Override
public AjaxResult selectDirectorsSupervisorsFile(Page<Attachment> page, String id) {
Page<Attachment> attachmentPage = attachmentMapper.selectPage(page, new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, id).eq(Attachment::getTargetType, ArgsConst.DIRECTORS));
return AjaxResult.ok().data(attachmentPage);
}
} }

View File

@ -141,15 +141,29 @@ public class ExchangeServiceImpl extends BaseService<ExchangeMapper, Exchange> i
public AjaxResult selectById(String id) { public AjaxResult selectById(String id) {
Exchange exchange = getById(id); Exchange exchange = getById(id);
Personnel personnel = personnelMapper.selectById(exchange.getPersonnelId()); Personnel personnel = personnelMapper.selectById(exchange.getPersonnelId());
if (ObjectUtil.isEmpty(personnel)){
return AjaxResult.fail().msg("该用户不存在!");
}
CompanyName nowCompany = companyNameMapper.selectById(personnel.getCompanyName()); CompanyName nowCompany = companyNameMapper.selectById(personnel.getCompanyName());
if (ObjectUtil.isEmpty(nowCompany)){
return AjaxResult.fail().msg("该用户不存在!");
}
Dept nowDept = deptMapper.selectById(personnel.getPresentDept()); Dept nowDept = deptMapper.selectById(personnel.getPresentDept());
if (ObjectUtil.isEmpty(nowDept)){
return AjaxResult.fail().msg("该用户不存在!");
}
CompanyName willCompany = companyNameMapper.selectById(exchange.getWillCompanyId()); CompanyName willCompany = companyNameMapper.selectById(exchange.getWillCompanyId());
if (ObjectUtil.isEmpty(willCompany)){
return AjaxResult.fail().msg("该用户不存在!");
}
Dept dept = deptMapper.selectById(exchange.getWillDept()); Dept dept = deptMapper.selectById(exchange.getWillDept());
if (ObjectUtil.isEmpty(dept)){
return AjaxResult.fail().msg("该用户不存在!");
}
List<Attachment> attachments = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, exchange.getId())); List<Attachment> attachments = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, exchange.getId()));
List<AttachmentDto> attachmentDtos = BeanUtil.copyToList(attachments, AttachmentDto.class); List<AttachmentDto> attachmentDtos = BeanUtil.copyToList(attachments, AttachmentDto.class);
System.out.println("byId = " + exchange);
ExchangeOneDto exchangeOneDto = BeanUtil.copyProperties(exchange, ExchangeOneDto.class); ExchangeOneDto exchangeOneDto = BeanUtil.copyProperties(exchange, ExchangeOneDto.class);
exchangeOneDto.setWillCompanyName(willCompany.getCompanyName()); exchangeOneDto.setWillCompanyName(willCompany.getCompanyName());
exchangeOneDto.setWillCOde(willCompany.getCreditCode()); exchangeOneDto.setWillCOde(willCompany.getCreditCode());

View File

@ -3,16 +3,23 @@ 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.ObjectUtil;
import cn.hutool.core.util.StrUtil;
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.constant.ArgsConst;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.entity.Attachment; import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.Mechanism; import com.ydool.staff.entity.Mechanism;
import com.ydool.common.base.BaseService; import com.ydool.common.base.BaseService;
import com.ydool.staff.entity.Organization; import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.PartyOrganization;
import com.ydool.staff.mapper.AttachmentMapper; import com.ydool.staff.mapper.AttachmentMapper;
import com.ydool.staff.mapper.MechanismMapper; import com.ydool.staff.mapper.MechanismMapper;
import com.ydool.staff.mapper.OrganizationMapper; import com.ydool.staff.mapper.OrganizationMapper;
import com.ydool.staff.mapper.PartyOrganizationMapper;
import com.ydool.staff.request.AttachmentRequest; import com.ydool.staff.request.AttachmentRequest;
import com.ydool.staff.request.MechanismPartyOrganization;
import com.ydool.staff.request.MechanismRequest; import com.ydool.staff.request.MechanismRequest;
import com.ydool.staff.request.OrganizationRequest; import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.service.IMechanismService; import com.ydool.staff.service.IMechanismService;
@ -43,6 +50,8 @@ public class MechanismServiceImpl extends BaseService<MechanismMapper, Mechanism
OrganizationMapper organizationMapper; OrganizationMapper organizationMapper;
@Autowired @Autowired
AttachmentMapper attachmentMapper; AttachmentMapper attachmentMapper;
@Autowired
PartyOrganizationMapper partyOrganizationMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -64,35 +73,64 @@ public class MechanismServiceImpl extends BaseService<MechanismMapper, Mechanism
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult saveOrganizationMechanism(MechanismRequest mechanismRequest) { public AjaxResult saveMechanismPartyOrganization(MechanismRequest mechanismRequest) {
Organization organization = new Organization(); Organization organization = new Organization();
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
List<Attachment> attachmentList = mechanismRequest.getAttachments(); List<AttachmentDto> attachmentList = mechanismRequest.getAttachmentsDto();
for (Attachment attachment : attachmentList) { for (AttachmentDto attachment : attachmentList) {
list.add(attachment.getPath()); list.add(attachment.getPath());
} }
organization.setAttachment(StringUtils.join(list,",")); organization.setAttachment(StringUtils.join(list, ","));
organization.setCreditCode(mechanismRequest.getCreditCode()); organization.setCreditCode(mechanismRequest.getCreditCode());
organization.setCompanyId(mechanismRequest.getCompanyName()); organization.setCompanyId(mechanismRequest.getCompanyId());
organization.setRemark(mechanismRequest.getRemark()); organization.setRemark(mechanismRequest.getRemark());
int i = organizationMapper.insert(organization); int i = organizationMapper.insert(organization);
if (i > 0) { if (i > 0) {
List<Attachment> attachments = mechanismRequest.getAttachments(); List<AttachmentDto> attachments = mechanismRequest.getAttachmentsDto();
for (Attachment attachment : attachments) { List<Attachment> copyToList = BeanUtil.copyToList(attachments, Attachment.class);
for (Attachment attachment : copyToList) {
attachment.setTargetId(organization.getId()); attachment.setTargetId(organization.getId());
attachment.setTargetType(ArgsConst.ORGANIZATION); attachment.setTargetType(ArgsConst.ORGANIZATION);
attachment.setSize(attachment.getSize());
attachment.setSuffix(attachment.getSuffix());
attachmentMapper.insert(attachment); attachmentMapper.insert(attachment);
} }
List<Mechanism> mechments = mechanismRequest.getMechments(); // 机构信息
List<Mechanism> mechments = mechanismRequest.getMechanism();
for (Mechanism mechment : mechments) { for (Mechanism mechment : mechments) {
int mechanism = mechanismMapper.selectCount(new LambdaQueryWrapper<Mechanism>().eq(Mechanism::getOrganizationId, organization.getId()).eq(Mechanism::getId, mechment.getId()));
if (mechanism == 0) {
mechment.setOrganizationId(organization.getId()); mechment.setOrganizationId(organization.getId());
mechanismMapper.insert(mechment);
} else {
mechanismMapper.delete(new LambdaQueryWrapper<Mechanism>().eq(Mechanism::getOrganizationId, organization.getId()));
} }
boolean batch = saveBatch(mechments); }
return batch ? AjaxResult.ok().msg("新增成功!") : AjaxResult.fail().msg("新增失败!"); // 党组织信息
List<PartyOrganization> partyOrganizations = mechanismRequest.getPartyOrganizations();
for (PartyOrganization partyOrganization : partyOrganizations) {
int party = partyOrganizationMapper.selectCount(new LambdaQueryWrapper<PartyOrganization>().eq(PartyOrganization::getOrganizationId, organization.getId()).eq(PartyOrganization::getId, partyOrganization.getId()));
if (party == 0) {
partyOrganization.setOrganizationId(organization.getId());
partyOrganizationMapper.insert(partyOrganization);
} else {
partyOrganizationMapper.delete(new LambdaQueryWrapper<PartyOrganization>().eq(PartyOrganization::getOrganizationId, organization.getId()));
}
}
return AjaxResult.ok().msg("新增成功!");
} }
return AjaxResult.fail().msg("新增失败!"); return AjaxResult.fail().msg("新增失败!");
} }
@Override
public AjaxResult selectCompanyNameByIdMechanismPartyOrganization(String id) {
if (StrUtil.isBlank(id)) {
return AjaxResult.fail().msg("企业id不能为空");
}
MechanismPartyOrganization mechanismPartyOrganization = new MechanismPartyOrganization();
List<Mechanism> mechanism = mechanismMapper.selectList(new LambdaQueryWrapper<Mechanism>().eq(Mechanism::getOrganizationId, id));
List<PartyOrganization> partyOrganizations = partyOrganizationMapper.selectList(new LambdaQueryWrapper<PartyOrganization>().eq(PartyOrganization::getOrganizationId, id));
mechanismPartyOrganization.setMechanisms(mechanism);
mechanismPartyOrganization.setPartyOrganizations(partyOrganizations);
return AjaxResult.ok().data(mechanismPartyOrganization);
}
} }

View File

@ -1,28 +1,21 @@
package com.ydool.staff.service.impl; package com.ydool.staff.service.impl;
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;
import com.ydool.common.constant.ArgsConst;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.entity.*; import com.ydool.staff.entity.*;
import com.ydool.common.base.BaseService; import com.ydool.common.base.BaseService;
import com.ydool.staff.mapper.*; import com.ydool.staff.mapper.*;
import com.ydool.staff.request.OrganizationRequest; import com.ydool.staff.request.OrganizationSearch;
import com.ydool.staff.service.IOrganizationService; import com.ydool.staff.service.IOrganizationService;
import com.ydool.system.mapper.UserMapper; import com.ydool.system.mapper.UserMapper;
import com.ydool.system.request.IdsRequest; import com.ydool.system.request.IdsRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.util.StringUtils;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -40,49 +33,24 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
@Autowired @Autowired
OrganizationMapper organizationMapper; OrganizationMapper organizationMapper;
@Autowired @Autowired
PartyOrganizationMapper partyOrganizationMapper;
@Autowired
MechanismMapper mechanismMapper;
@Autowired
CompanyNameMapper companyNameMapper;
@Autowired
UserMapper userMapper; UserMapper userMapper;
@Autowired @Autowired
AttachmentMapper attachmentMapper; CompanyNameMapper companyNameMapper;
@Override @Override
public AjaxResult selectOrganizationList(Page<Organization> page, String companyName) { public AjaxResult selectOrganizationList(Page<Organization> page, OrganizationSearch organizationSearch) {
LambdaQueryWrapper<Organization> organizationLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Organization> organizationLambdaQueryWrapper = new LambdaQueryWrapper<>();
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 + "%'"); organizationLambdaQueryWrapper.exists(StrUtil.isNotBlank(organizationSearch.getCompanyName()), "select t2.id from t_lc_company_name t2 where t_lc_organization.company_id = t2.id and t2.company_name like '%" + organizationSearch.getCompanyName() + "%'");
organizationLambdaQueryWrapper.eq(StrUtil.isNotBlank(organizationSearch.getApprovalNumber()), Organization::getApprovalNumber, organizationSearch.getApprovalNumber());
organizationLambdaQueryWrapper.eq(Organization::getType, organizationSearch.getType());
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());
record.setCompanyName(companyNameMapper.selectById(record.getCompanyId()).getCompanyName()); record.setCompanyId(companyNameMapper.selectById(record.getCompanyId()).getCompanyName());
} }
return AjaxResult.ok().data(selectPage); return AjaxResult.ok().data(selectPage);
} }
@Override
public AjaxResult selectOrganizationByMechanism(String id) {
Organization organization = organizationMapper.selectById(id);
if (ObjectUtil.isNull(organization)) {
return AjaxResult.fail().msg("未找到相关信息!");
} else {
List<Mechanism> mechanismList = mechanismMapper.selectList(new LambdaQueryWrapper<Mechanism>().eq(Mechanism::getOrganizationId, organization.getId()));
List<Attachment> attachmentList = attachmentMapper.selectList(new LambdaQueryWrapper<Attachment>().eq(Attachment::getTargetId, organization.getId()).eq(Attachment::getTargetType, ArgsConst.ORGANIZATION));
List<PartyOrganization> partyOrganizationList = partyOrganizationMapper.selectList(new LambdaQueryWrapper<PartyOrganization>());
List<AttachmentDto> toList = BeanUtil.copyToList(attachmentList, AttachmentDto.class);
OrganizationRequest organizationRequest = new OrganizationRequest();
organizationRequest.setRemark(organization.getRemark());
organizationRequest.setCreditCode(organization.getCreditCode());
organizationRequest.setCompanyId(companyNameMapper.selectById(organization.getCompanyId()).getCompanyName());
organizationRequest.setAttachments(toList);
organizationRequest.setPartyList(partyOrganizationList);
organizationRequest.setMechanismList(mechanismList);
return AjaxResult.ok().data(organizationRequest);
}
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult deleteOrganization(IdsRequest id) { public AjaxResult deleteOrganization(IdsRequest id) {
@ -94,15 +62,5 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!"); return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
} }
} }
@Override
public AjaxResult selectOrganizationByName(String companyName) {
return AjaxResult.ok().data(companyNameMapper.selectOne(new LambdaQueryWrapper<CompanyName>().eq(CompanyName::getId, companyName)));
}
@Override
public AjaxResult selectOrganization() {
return AjaxResult.ok().data(organizationMapper.selectList(null));
}
} }

View File

@ -0,0 +1,67 @@
package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.PersonnelIndicatorsDto;
import com.ydool.staff.entity.*;
import com.ydool.common.base.BaseService;
import com.ydool.staff.entity.PersonnelIndicators;
import com.ydool.staff.mapper.OrganizationMapper;
import com.ydool.staff.mapper.PersonnelIndicatorsMapper;
import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.request.PersonnelIndicatorsRequest;
import com.ydool.staff.service.IPersonnelIndicatorsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 人员指标申报 服务类
* </p>
*
* @author ljq
* @since 2023-02-10
*/
@Service
public class PersonnelIndicatorsServiceImpl extends BaseService<PersonnelIndicatorsMapper, PersonnelIndicators> implements IPersonnelIndicatorsService {
@Autowired
PersonnelIndicatorsMapper personnelIndicatorsMapper;
@Autowired
OrganizationMapper organizationMapper;
@Override
public AjaxResult savePersonnelIndicators(PersonnelIndicatorsRequest personnelIndicatorsRequest) {
OrganizationRequest organizationRequest = personnelIndicatorsRequest.getOrganizationRequest();
Organization organization = BeanUtil.copyProperties(organizationRequest, Organization.class);
organization.setType("personnel_indicators");
int i = organizationMapper.insert(organization);
if (i > 0) {
List<PersonnelIndicators> personnelIndicators = personnelIndicatorsRequest.getPersonnelIndicators();
for (PersonnelIndicators personnelIndicator : personnelIndicators) {
personnelIndicator.setOrganizationId(organization.getId());
}
boolean batch = saveBatch(personnelIndicators);
return batch ? AjaxResult.ok().msg("添加成功!") : AjaxResult.fail().msg("添加失败!");
}
return AjaxResult.fail().msg("添加失败!");
}
@Override
public AjaxResult selectPersonnelIndicatorsById(String id) {
Organization companyName = organizationMapper.selectById(id);
if (ObjectUtil.isNull(companyName)) {
return AjaxResult.fail().msg("未找到相关信息!");
}
List<PersonnelIndicators> personnelIndicators = personnelIndicatorsMapper.selectList(new LambdaQueryWrapper<PersonnelIndicators>().eq(PersonnelIndicators::getOrganizationId, companyName.getId()));
PersonnelIndicatorsDto recruitmentRequest = new PersonnelIndicatorsDto();
recruitmentRequest.setOrganization(companyName);
recruitmentRequest.setPersonnelIndicators(personnelIndicators);
return AjaxResult.ok().data(recruitmentRequest);
}
}

View File

@ -1,10 +1,16 @@
package com.ydool.staff.service.impl; package com.ydool.staff.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollStreamUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -12,6 +18,10 @@ import com.ydool.common.base.BaseService;
import com.ydool.common.constant.ArgsConst; import com.ydool.common.constant.ArgsConst;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.common.utils.ColumnUtil; import com.ydool.common.utils.ColumnUtil;
import com.ydool.common.utils.EasyExcelAlibabaUtil;
import com.ydool.common.utils.ExcelMergeRowByRowUtil;
import com.ydool.common.utils.ExcelUtil;
import com.ydool.common.utils.HttpServletUtil;
import com.ydool.staff.dto.AttachmentDto; import com.ydool.staff.dto.AttachmentDto;
import com.ydool.staff.dto.PersonnelByExchangeDto; import com.ydool.staff.dto.PersonnelByExchangeDto;
import com.ydool.staff.dto.PersonnelDto; import com.ydool.staff.dto.PersonnelDto;
@ -19,12 +29,13 @@ import com.ydool.staff.dto.PersonnelUpdateDto;
import com.ydool.staff.entity.Alteration; import com.ydool.staff.entity.Alteration;
import com.ydool.staff.entity.Attachment; import com.ydool.staff.entity.Attachment;
import com.ydool.staff.entity.CompanyName; import com.ydool.staff.entity.CompanyName;
import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.Personnel; import com.ydool.staff.entity.Personnel;
import com.ydool.staff.entity.SelectRequest; import com.ydool.staff.entity.SelectRequest;
import com.ydool.staff.excel.ExcelPersonnel;
import com.ydool.staff.excel.PersonnelExportVO;
import com.ydool.staff.excel.PersonnelFailMsgVO;
import com.ydool.staff.mapper.AlterationMapper; import com.ydool.staff.mapper.AlterationMapper;
import com.ydool.staff.mapper.CompanyNameMapper; import com.ydool.staff.mapper.CompanyNameMapper;
import com.ydool.staff.mapper.OrganizationMapper;
import com.ydool.staff.mapper.PersonnelMapper; import com.ydool.staff.mapper.PersonnelMapper;
import com.ydool.staff.request.AttachmentRequest; import com.ydool.staff.request.AttachmentRequest;
import com.ydool.staff.request.ChangeRequest; import com.ydool.staff.request.ChangeRequest;
@ -37,15 +48,20 @@ import com.ydool.system.entity.Dept;
import com.ydool.system.mapper.DeptMapper; import com.ydool.system.mapper.DeptMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.thymeleaf.util.StringUtils; import org.thymeleaf.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.constraints.Null; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -84,8 +100,12 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
PersonnelDto dto = BeanUtil.copyProperties(e, PersonnelDto.class); PersonnelDto dto = BeanUtil.copyProperties(e, PersonnelDto.class);
CompanyName companyName = companyNameMapper.selectById(e.getCompanyName()); CompanyName companyName = companyNameMapper.selectById(e.getCompanyName());
Dept dept = deptMapper.selectById(e.getPresentDept()); Dept dept = deptMapper.selectById(e.getPresentDept());
dto.setPresentDept(dept.getName()); if (ObjectUtil.isNotNull(companyName)){
dto.setCompanyName(companyName.getCompanyName()); dto.setCompanyName(companyName.getCompanyName());
}
if (ObjectUtil.isNotNull(dept)) {
dto.setPresentDept(dept.getName());
}
dto.setCreatedAt(e.getCreatedAt()); dto.setCreatedAt(e.getCreatedAt());
return dto; return dto;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
@ -122,6 +142,10 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult savePersonnel(PersonnelRequest personnelRequest) { public AjaxResult savePersonnel(PersonnelRequest personnelRequest) {
if (!IdcardUtil.isValidCard(personnelRequest.getNumberId())){
return AjaxResult.fail().msg("身份证号格式不正确!");
}
Personnel personnel = BeanUtil.copyProperties(personnelRequest, Personnel.class); Personnel personnel = BeanUtil.copyProperties(personnelRequest, Personnel.class);
personnel.setCardFile(StringUtils.join(saveFilePath(personnelRequest.getCardFile(), ArgsConst.CARD_FILE, ArgsConst.SAVE, ""), ',')); personnel.setCardFile(StringUtils.join(saveFilePath(personnelRequest.getCardFile(), ArgsConst.CARD_FILE, ArgsConst.SAVE, ""), ','));
personnel.setEngageFile(StringUtils.join(saveFilePath(personnelRequest.getEngageFile(), ArgsConst.ENGAGE_FILE, ArgsConst.SAVE, ""), ',')); personnel.setEngageFile(StringUtils.join(saveFilePath(personnelRequest.getEngageFile(), ArgsConst.ENGAGE_FILE, ArgsConst.SAVE, ""), ','));
@ -324,7 +348,7 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
.eq(ObjectUtil.isNotNull(request.getHireDate()),Personnel::getHireDate,request.getHireDate()) .eq(ObjectUtil.isNotNull(request.getHireDate()),Personnel::getHireDate,request.getHireDate())
.eq(ObjectUtil.isNotNull(request.getResignationTime()),Personnel::getResignationTime,request.getResignationTime()) .eq(ObjectUtil.isNotNull(request.getResignationTime()),Personnel::getResignationTime,request.getResignationTime())
.eq(StrUtil.isNotBlank(request.getWorkState()),Personnel::getWorkState,request.getWorkState()) .eq(StrUtil.isNotBlank(request.getWorkState()),Personnel::getWorkState,request.getWorkState())
.eq(StrUtil.isNotBlank(request.getReceipts()),Personnel::getRecruitNumber,request.getReceipts()) .eq(StrUtil.isNotBlank(request.getReceipts()),Personnel::getReceipts,request.getReceipts())
.eq(StrUtil.isNotBlank(request.getAlterationSign()),Personnel::getAlterationSign,request.getAlterationSign()); .eq(StrUtil.isNotBlank(request.getAlterationSign()),Personnel::getAlterationSign,request.getAlterationSign());
wrapper.lambda().like(Personnel::getUserName,request.getUserName()) wrapper.lambda().like(Personnel::getUserName,request.getUserName())
.like(Personnel::getNumberId,request.getNumberId()) .like(Personnel::getNumberId,request.getNumberId())
@ -343,5 +367,141 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
} }
return wrapper; return wrapper;
} }
public void export(PersonnelDeleteRequest param ,HttpServletResponse response) {
List<Personnel> list = list();
List<ExcelPersonnel> personnelList = BeanUtil.copyToList(list, ExcelPersonnel.class);
for (ExcelPersonnel excelPersonnel : personnelList) {
CompanyName companyName = companyNameMapper.selectById(excelPersonnel.getCompanyName());
Dept dept = deptMapper.selectById(excelPersonnel.getPresentDept());
if (ObjectUtil.isNotEmpty(companyName)){
excelPersonnel.setCompanyName(companyName.getCompanyName());
}
if (ObjectUtil.isNotEmpty(dept)){
excelPersonnel.setPresentDept(dept.getName());
}
excelPersonnel.setGender("1".equals(excelPersonnel.getGender())?"":"");
excelPersonnel.setFreshGraduate("1".equals(excelPersonnel.getFreshGraduate())?"":"");
}
String fileName = "企业人员申报" + System.currentTimeMillis() + ".xlsx";
Set<String> includeColumnFiledNames = new HashSet<>();
for (String s : param.getIds()) {
includeColumnFiledNames.add(s);
}
//导出
EasyExcelAlibabaUtil.exportDownload(response, ExcelPersonnel.class, personnelList, fileName,includeColumnFiledNames);
}
@Override
public AjaxResult importPersonnel(MultipartFile excl) {
//判断文件类型
String reg = ".+(.xlsx)$";
String suffix = FileUtil.getSuffix(excl.getOriginalFilename());
if (!Pattern.matches(reg, excl.getOriginalFilename()))
return AjaxResult.fail("必须上传后缀为" + suffix + "的文件");
System.out.println("准备导入通讯录" + excl);
if (!"企业人员申报模板.xlsx".equals(excl.getOriginalFilename()))
return AjaxResult.fail("必须上传 企业人员申报模板.xlsx 文件");
//导出数据
List<PersonnelFailMsgVO> failList = new ArrayList<>();
//保存数据
// List<Employees> employeesList = new ArrayList<Employees>();
if (!excl.isEmpty()) {
List<PersonnelExportVO> personnelExportVOS = EasyExcelAlibabaUtil.excelToList(excl,
PersonnelExportVO.class);
JSON json = JSONUtil.parseObj(personnelExportVOS);
System.out.println("导入人员信息:" + json + personnelExportVOS);
System.out.println("导入企业人员申报表:" + personnelExportVOS.size() + "");
if (CollectionUtil.isEmpty(personnelExportVOS)){
return AjaxResult.fail("模板必须要有数据");
}
for (PersonnelExportVO personnelExportVO : personnelExportVOS) {
System.out.println("通讯录信息" + personnelExportVO);
//校验通讯录信息
PersonnelFailMsgVO failMsgVO = checkPersonnelExportVO(personnelExportVO);
//错误数据 不保存
if (StrUtil.isNotBlank(failMsgVO.getFailMsg())) {
failList.add(failMsgVO);
} else {
//转义
Personnel personnel = interpretPersonnelExportVO(personnelExportVO);
//保存
failMsgVO.setFailMsg(failMsgVO.getFailMsg() + (save(personnel) ? "导入成功" : "导入失败"));
failList.add(failMsgVO);
}
}
//保存
// if (CollectionUtil.isNotEmpty(employeesList)) {
// saveBatch(employeesList);
// }
}
// String fileName="通讯录导入结果.xlsx";//文件名称
// String urlPath = System.getProperty("user.dir") + File.separator + "upload"; //文件存放路径
// String FileNamePath = urlPath + File.separator + fileName;
// FileOutputStream fis=new FileOutputStream(FileNamePath);
// OutputStreamWriter out = new OutputStreamWriter(fis,"UTF-8");
//导出导入结果
String download = EasyExcelAlibabaUtil.download(PersonnelFailMsgVO.class, failList, "通讯录导入结果");
return AjaxResult.ok().data(download).msg("导入完成");
}
@Override
public AjaxResult getEntityParam() {
Field[] declaredFields = ExcelPersonnel.class.getDeclaredFields();
List<String> list = new ArrayList<>();
for (Field declaredField : declaredFields) {
list.add(declaredField.getName());
}
return AjaxResult.ok().data(list);
}
public PersonnelFailMsgVO checkPersonnelExportVO(PersonnelExportVO personnelExportVO) {
PersonnelFailMsgVO failMsgVO = BeanUtil.copyProperties(personnelExportVO, PersonnelFailMsgVO.class);
failMsgVO.setFailMsg("");
//联系人姓名不能为空
if (StrUtil.isBlank(personnelExportVO.getUserName())) {
failMsgVO.setFailMsg(failMsgVO.getFailMsg() + " 姓名不能为空 ");
}
//校验性别
if (!"".equals(personnelExportVO.getGender()) && !"".equals(personnelExportVO.getGender())) {
failMsgVO.setFailMsg(failMsgVO.getFailMsg() + " 请输入正确性别,男或女 ");
}
//校验性别
if (!"".equals(personnelExportVO.getFreshGraduate()) && !"".equals(personnelExportVO.getGender())) {
failMsgVO.setFailMsg(failMsgVO.getFailMsg() + " 请输入正确选项,是或否 ");
}
/* //加密
String phone = employeesExportVO.getPhone();*/
/*int count = count(new LambdaQueryWrapper<Personnel>()
.eq(Personnel::getNumberId, personnelExportVO.getNumberId()));
if (count > 0) {
failMsgVO.setFailMsg(failMsgVO.getFailMsg() + " 身份证已存在 ");
}*/
return failMsgVO;
}
public Personnel interpretPersonnelExportVO(PersonnelExportVO personnelExportVO) {
Personnel personnel = BeanUtil.copyProperties(personnelExportVO, Personnel.class);
/*//手机号码加密
employees.setPhone(CodecUtils.encrypt(employees.getPhone()));*/
//组织编码转组织Id
/* GrapeDept dept = deptService.getOne(new LambdaQueryWrapper<GrapeDept>().eq(GrapeDept::getCode,
employeesExportVO.getDeptCode()));*/
//性别转换
//personnel.setGender("".equals(personnelExportVO.getGender()) ? 1 : 0);
personnel.setFreshGraduate("".equals(personnelExportVO.getFreshGraduate()) ? "1" : "0");
return personnel;
}
} }

View File

@ -1,18 +1,26 @@
package com.ydool.staff.service.impl; 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.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ydool.common.data.dto.AjaxResult; import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.dto.RecruitmentDto;
import com.ydool.staff.entity.Organization;
import com.ydool.staff.entity.Recruitment; import com.ydool.staff.entity.Recruitment;
import com.ydool.common.base.BaseService; import com.ydool.common.base.BaseService;
import com.ydool.staff.mapper.CompanyNameMapper; import com.ydool.staff.mapper.CompanyNameMapper;
import com.ydool.staff.mapper.OrganizationMapper;
import com.ydool.staff.mapper.RecruitmentMapper; import com.ydool.staff.mapper.RecruitmentMapper;
import com.ydool.staff.request.OrganizationRequest;
import com.ydool.staff.request.RecruitmentRequest; import com.ydool.staff.request.RecruitmentRequest;
import com.ydool.staff.service.IRecruitmentService; import com.ydool.staff.service.IRecruitmentService;
import com.ydool.system.request.IdsRequest;
import org.springframework.beans.factory.annotation.Autowired; 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 java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@ -30,42 +38,57 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
RecruitmentMapper recruitmentMapper; RecruitmentMapper recruitmentMapper;
@Autowired @Autowired
CompanyNameMapper companyNameMapper; CompanyNameMapper companyNameMapper;
@Autowired
OrganizationMapper organizationMapper;
@Override /**
public AjaxResult recruitmentList() { * 人员招聘登记
return AjaxResult.ok().data(recruitmentMapper.recruitmentList()); * @param recruitmentRequest
} * @return
*/
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult saveRecruitment(RecruitmentRequest recruitmentRequest) { public AjaxResult saveRecruitment(RecruitmentRequest recruitmentRequest) {
Recruitment recruitment = BeanUtil.copyProperties(recruitmentRequest, Recruitment.class); OrganizationRequest organizationRequest = recruitmentRequest.getOrganizationRequest();
int i = recruitmentMapper.insert(recruitment); Organization organization = BeanUtil.copyProperties(organizationRequest, Organization.class);
return i > 0 ? AjaxResult.ok().msg("添加成功!") : AjaxResult.fail().msg("添加失败!"); organization.setType("organization");
int i = organizationMapper.insert(organization);
if (i > 0) {
List<Recruitment> recruitments = recruitmentRequest.getRecruitments();
for (Recruitment recruitment : recruitments) {
recruitment.setCompanyId(organization.getId());
}
boolean batch = saveBatch(recruitments);
return batch ? AjaxResult.ok().msg("添加成功!") : AjaxResult.fail().msg("添加失败!");
} else {
return AjaxResult.fail().msg("添加失败!");
}
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult deleteRecruitment(String id) { public AjaxResult deleteRecruitment(IdsRequest ids) {
Recruitment recruitment = recruitmentMapper.selectById(id); List<String> asList = Arrays.asList(ids.getIds());
if (ObjectUtil.isNull(recruitment)) { if (CollectionUtil.isEmpty(asList)) {
return AjaxResult.fail().msg("未找到相关信息!"); return AjaxResult.fail().msg("Id不能为空");
} else { } else {
int i = recruitmentMapper.deleteById(recruitment.getId()); int i = recruitmentMapper.deleteBatchIds(asList);
return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!"); return i > 0 ? AjaxResult.ok().msg("删除成功!") : AjaxResult.fail().msg("删除失败!");
} }
} }
@Override @Override
public AjaxResult selectRecruitmentById(String id) { public AjaxResult selectRecruitmentById(String id) {
return AjaxResult.ok().data(recruitmentMapper.selectById(id)); Organization recruitment = organizationMapper.selectById(id);
if (ObjectUtil.isNull(recruitment)) {
return AjaxResult.fail().msg("未找到相关信息!");
}
List<Recruitment> recruitments = recruitmentMapper.selectList(new LambdaQueryWrapper<Recruitment>().eq(Recruitment::getCompanyId, recruitment.getId()));
RecruitmentDto recruitmentRequest = new RecruitmentDto();
recruitmentRequest.setOrganization(recruitment);
recruitmentRequest.setRecruitments(recruitments);
return AjaxResult.ok().data(recruitmentRequest);
} }
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult recruitmentSaveBatch(List<RecruitmentRequest> recruitmentRequest) {
List<Recruitment> recruitments = BeanUtil.copyToList(recruitmentRequest, Recruitment.class);
return AjaxResult.ok().data(saveBatch(recruitments));
}
} }