Commit 6e3ba2a0 authored by hongguangwu's avatar hongguangwu

合同优化-待提交

parent 522f6ff2
......@@ -90,7 +90,7 @@ public class TEmployeeContractInfo extends BaseEntity {
*/
@NotBlank(message = "合同类型不能为空")
@Length(max = 32, message = "合同类型不能超过32个字符")
@ExcelAttribute(name = "合同类型", isNotEmpty = true, errorInfo = "合同类型不能为空", maxLength = 32, needExport = true)
@ExcelAttribute(name = "合同类型", maxLength = 32, needExport = true)
@Schema(description = "合同类型", name = "contractName")
private String contractName;
/**
......@@ -101,14 +101,14 @@ public class TEmployeeContractInfo extends BaseEntity {
*/
@NotBlank(message = "签订期限不能为空")
@Length(max = 32, message = "签订期限不能超过32个字符")
@ExcelAttribute(name = "签订期限", isNotEmpty = true, errorInfo = "签订期限不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE, needExport = true)
@ExcelAttribute(name = "签订期限", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE, needExport = true)
@Schema(description = "签订期限", name = "contractType")
private String contractType;
/**
* 合同起始时间
*/
@NotBlank(message = "合同起始时间不能为空")
@ExcelAttribute(name = "合同起始时间", isNotEmpty = true, errorInfo = "合同起始时间不能为空")
@ExcelAttribute(name = "合同起始时间", needExport = true)
@Schema(description = "合同起始时间", name = "contractStart")
private Date contractStart;
/**
......@@ -210,14 +210,14 @@ public class TEmployeeContractInfo extends BaseEntity {
* 合同岗位
*/
@Length(max = 32, message = "合同岗位不能超过32个字符")
@ExcelAttribute(name = "合同岗位", isNotEmpty = true, errorInfo = "合同岗位不能为空", maxLength = 32, needExport = true)
@ExcelAttribute(name = "合同岗位", maxLength = 32, needExport = true)
@Schema(description = "合同岗位", name = "post")
private String post;
/**
* 工时制(数据字典) 1标准工时 2 综合工时 3不定时工时制
*/
@Length(max = 32, message = "工时制不能超过32个字符")
@ExcelAttribute(name = "工时制", isNotEmpty = true, errorInfo = "工时制不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.WORKING_HOURS)
@ExcelAttribute(name = "工时制", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.WORKING_HOURS)
@Schema(description = "工时制(数据字典) 1标准工时 2 综合工时 3不定时工时制", name = "workingHours")
private String workingHours;
/**
......@@ -413,7 +413,7 @@ public class TEmployeeContractInfo extends BaseEntity {
*/
@NotBlank(message = "合同甲方不能为空")
@Length(max = 50, message = "合同甲方不能超过50个字符")
@ExcelAttribute(name = "合同甲方", isNotEmpty = true, errorInfo = "合同甲方不能为空", maxLength = 50, needExport = true)
@ExcelAttribute(name = "合同甲方", maxLength = 50, needExport = true)
@Schema(description = "合同甲方")
@Size(max = 50, message = "合同甲方不可超过50位")
private String contractParty;
......
......@@ -76,7 +76,7 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
*/
@NotBlank(message = "合同类型不能为空")
@Length(max = 32, message = "合同类型不能超过32个字符")
@ExcelAttribute(name = "合同类型", isNotEmpty = true, errorInfo = "合同类型不能为空", maxLength = 32, needExport = true)
@ExcelAttribute(name = "合同类型", maxLength = 32, needExport = true)
@Schema(description = "合同类型", name = "contractName")
private String contractName;
......@@ -101,7 +101,7 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
* 合同甲方
*/
@Length(max = 50, message = "原因说明不能超过200个字符")
@ExcelAttribute(name = "合同甲方", isNotEmpty = true, errorInfo = "合同甲方不能为空", maxLength = 50, needExport = true)
@ExcelAttribute(name = "合同甲方", maxLength = 50, needExport = true)
@Schema(description = "合同甲方")
@Size(max = 50, message = "合同甲方不可超过50位")
private String contractParty;
......@@ -114,7 +114,7 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
*/
@NotBlank(message = "签订期限不能为空")
@Length(max = 32, message = "签订期限不能超过32个字符")
@ExcelAttribute(name = "签订期限", isNotEmpty = true, errorInfo = "签订期限不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE, needExport = true)
@ExcelAttribute(name = "签订期限", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE, needExport = true)
@Schema(description = "签订期限", name = "contractType")
private String contractType;
......@@ -123,7 +123,7 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
*/
@NotBlank(message = "起始日期不能为空")
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "起始日期", isNotEmpty = true, errorInfo = "起始日期不能为空", isDate = true)
@ExcelAttribute(name = "起始日期", isDate = true)
@Schema(description = "起始日期", name = "contractStart")
private Date contractStart;
/**
......@@ -138,7 +138,7 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
* 合同岗位
*/
@Length(max = 32, message = "合同岗位不能超过32个字符")
@ExcelAttribute(name = "合同岗位", isNotEmpty = true, errorInfo = "合同岗位不能为空", maxLength = 32, needExport = true)
@ExcelAttribute(name = "合同岗位", maxLength = 32, needExport = true)
@Schema(description = "合同岗位", name = "post")
private String post;
......@@ -146,7 +146,7 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
* 工时制(数据字典) 1标准工时 2 综合工时 3不定时工时制
*/
@Length(max = 32, message = "工时制不能超过32个字符")
@ExcelAttribute(name = "工时制", isNotEmpty = true, errorInfo = "工时制不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.WORKING_HOURS)
@ExcelAttribute(name = "工时制", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.WORKING_HOURS)
@Schema(description = "工时制(数据字典) 1标准工时 2 综合工时 3不定时工时制", name = "workingHours")
private String workingHours;
......
......@@ -41,6 +41,13 @@ public class EmployeeConstants {
public static final String CONTRACT_TYPE_TWO = "2";
public static final String CONTRACT_NO_IN_USE = "暂无可操作的合同";
public static final String CONTRACT_NAME_EMPTY = "合同类型不能为空";
public static final String CONTRACT_PARTY_EMPTY = "合同甲方不能为空";
public static final String CONTRACT_TYPE_EMPTY = "签订期限不能为空";
public static final String CONTRACT_START_EMPTY = "起始日期不能为空";
public static final String POST_EMPTY = "合同岗位不能为空";
public static final String WORKING_HOURS_EMPTY = "工时制不能为空";
/**
* 无数据可更新
**/
......
......@@ -709,15 +709,43 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
if (Common.isEmpty(insert.getEmpIdcard()) || Common.isEmpty(insert.getDeptNo())) {
errorInfo.append(EmployeeConstants.EMPID_NOT_EMPTY);
} else if (EmployeeConstants.SITUATION_SIX.equals(insert.getSituation())
|| EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation())) {
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
.eq(TEmployeeContractInfo::getDeptNo, insert.getDeptNo())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL));
if (contractInfo == null) {
errorInfo.append(EmployeeConstants.CONTRACT_NO_IN_USE);
} else {
if (EmployeeConstants.SITUATION_SIX.equals(insert.getSituation())
|| EmployeeConstants.SITUATION_SEVEN.equals(insert.getSituation())) {
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, insert.getEmpIdcard())
.eq(TEmployeeContractInfo::getDeptNo, insert.getDeptNo())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL));
if (contractInfo == null) {
errorInfo.append(EmployeeConstants.CONTRACT_NO_IN_USE);
} else {
insert.setContractName(contractInfo.getContractName());
insert.setSubjectUnit(contractInfo.getSubjectUnit());
insert.setContractParty(contractInfo.getContractParty());
insert.setContractType(contractInfo.getContractType());
insert.setContractStart(contractInfo.getContractStart());
insert.setContractEnd(contractInfo.getContractEnd());
}
} else {
if (Common.isEmpty(insert.getContractName())) {
errorInfo.append(EmployeeConstants.CONTRACT_NAME_EMPTY);
}
if (Common.isEmpty(insert.getContractParty())) {
errorInfo.append(EmployeeConstants.CONTRACT_PARTY_EMPTY);
}
if (Common.isEmpty(insert.getContractType())) {
errorInfo.append(EmployeeConstants.CONTRACT_TYPE_EMPTY);
}
if (Common.isEmpty(insert.getContractStart())) {
errorInfo.append(EmployeeConstants.CONTRACT_START_EMPTY);
}
if (Common.isEmpty(insert.getPost())) {
errorInfo.append(EmployeeConstants.POST_EMPTY);
}
if (Common.isEmpty(insert.getWorkingHours())) {
errorInfo.append(EmployeeConstants.WORKING_HOURS_EMPTY);
}
}
}
if (Common.isEmpty(errorInfo.toString())) {
......
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