Commit 1dc387ec authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent 50792c69
......@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
......@@ -26,6 +27,7 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;
/**
* 项目档案表excel对应的实体
......@@ -43,7 +45,7 @@ public class EmployeeProjectVO extends RowIndex implements Serializable {
* 员工类型(字典值,0外包1派遣2代理)
*/
@NotNull(message = "员工类型不能为空")
@ExcelAttribute(name = "员工类型",isNotEmpty = true, errorInfo = "员工类型不能为空",maxLength = 1,isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE)
@ExcelAttribute(name = "员工类型",isNotEmpty = true, errorInfo = "员工类型不能为空",maxLength = 2,isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE)
@ExcelProperty(value ="员工类型")
private String empNatrue;
......@@ -94,7 +96,7 @@ public class EmployeeProjectVO extends RowIndex implements Serializable {
*/
@NotNull(message = "合同类型不能为空")
@ExcelProperty(value ="合同类型")
@ExcelAttribute(name = "合同类型",isNotEmpty = true, errorInfo = "合同类型不能为空",maxLength = 2,isDataId = true,dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE)
@ExcelAttribute(name = "合同类型",isNotEmpty = true, errorInfo = "合同类型不能为空",maxLength = 10,isDataId = true,dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE)
private String contractType;
/**
......@@ -102,7 +104,7 @@ public class EmployeeProjectVO extends RowIndex implements Serializable {
*/
@NotNull(message = "工时制不能为空")
@ExcelProperty(value ="工时制")
@ExcelAttribute(name = "工时制",isNotEmpty = true, errorInfo = "工时制不能为空",maxLength = 1,isDataId = true,dataType = ExcelAttributeConstants.WORKING_HOURS)
@ExcelAttribute(name = "工时制",isNotEmpty = true, errorInfo = "工时制不能为空",maxLength = 10,isDataId = true,dataType = ExcelAttributeConstants.WORKING_HOURS)
private String workingHours;
/**
......@@ -119,14 +121,15 @@ public class EmployeeProjectVO extends RowIndex implements Serializable {
@ExcelProperty(value ="入职日期")
@NotNull(message = "入职日期不能为空")
@Past
private LocalDate enjoinDate;
@DateTimeFormat("yyyy-MM-dd")
private Date enjoinDate;
/**
* 试用期(单位月)
*/
@ExcelProperty(value ="试用期")
@NotNull(message = "试用期不能为空")
@ExcelAttribute(name = "试用期",isNotEmpty = true, errorInfo = "试用期不能为空",maxLength = 2)
@ExcelAttribute(name = "试用期",isNotEmpty = true, errorInfo = "试用期不能为空",maxLength = 4)
private String tryPeriod;
}
......@@ -54,7 +54,6 @@ public class TElecEmployeeInfoController {
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
@PreAuthorize("@pms.hasPermission('archives_telecemployeeinfo_get')" )
public R getTElecEmployeeInfoPage(Page page, TElecEmployeeInfo tElecEmployeeInfo) {
return R.ok(tElecEmployeeInfoService.getTElecEmployeeInfoPage(page,tElecEmployeeInfo));
}
......@@ -67,7 +66,6 @@ public class TElecEmployeeInfoController {
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_telecemployeeinfo_get')" )
public R getById(@PathVariable("id" ) Long id) {
return R.ok(tElecEmployeeInfoService.getById(id));
}
......
......@@ -206,7 +206,7 @@ public class TEmployeeProjectController {
@SysLog("批量新增项目档案信息")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('wxhr:employeeProjectinfo_importListAdd')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file, @RequestParam("idAdd") String idAdd) throws IOException {
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file, @RequestParam("idAdd") String idAdd){
return tEmployeeProjectService.importListAdd(file.getInputStream(), idAdd);
}
......
......@@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.Constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
......@@ -345,10 +346,22 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) {
EmployeeProjectVO excel = excelVOList.get(i);
Set<String> errorMsg = new HashSet<>();
idCard = excel.getEmpIdcard();
deptNo = excel.getDeptNo();
if (excel.getEmpNatrue().equals(CommonConstants.ZERO_STRING) || excel.getEmpNatrue().equals(CommonConstants.ONE_STRING)) {
if (excel.getContractType().equals(CommonConstants.ONE_STRING)) {
if (Common.isEmpty(excel.getWorkingHours())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "第" + (excel.getRowIndex()) + "工时制不能为空!"));
}
}
if (Common.isEmpty(excel.getEnjoinDate())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "第" + (excel.getRowIndex()) + "入职日期不能为空!"));
}
if (Common.isEmpty(excel.getTryPeriod())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "第" + (excel.getRowIndex()) + "试用期不能为空!"));
}
}
if (idCardMap.get(idCard.concat(deptNo)) != null) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),"第" + (excel.getRowIndex()) + "行身份证号+项目编码与第" + idCardMap.get(idCard) + "行重复!"));
} else {
......@@ -383,7 +396,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
//存在复档或复项的情况,允许复档复项
if (CommonConstants.ZERO_STRING.equals(idAdd)) {
if (CommonConstants.ONE_STRING.equals(idAdd)) {
//档案有(离职库),项目(已减档)
if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
......
......@@ -33,9 +33,9 @@ public class ExcelAttributeConstants {
//员工合同类型
public static final String EMPLOYEE_CONTRACT_TYPE = "employee_contract_type" ;
public static final String EMPLOYEE_CONTRACT_TYPE = "contract_type" ;
//员工合同工时制 1标准工时 2 综合工时 3不定时工时制
public static final String WORKING_HOURS = "working_hours";
public static final String WORKING_HOURS = "contract_working_hours";
//员工合同续签情况
public static final String EMPLOYEE_SITUATION_TYPE = "situation_type" ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment