Commit 9d7238b2 authored by huyuchen's avatar huyuchen

hyc-档案所在地必填调整

parent db06197a
......@@ -151,25 +151,16 @@ public class EmployeeInsertVO extends RowIndex implements Serializable {
@ExcelProperty(value = "户口性质")
private String empRegisType;
/**
* 档案-省
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "档案所在省")
@ExcelAttribute(name = "档案所在省", isArea = true, isNotEmpty = true, errorInfo = "档案所在省不能为空")
@ExcelProperty("档案所在省")
private String fileProvince;
/**
* 档案-市
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "档案所在市")
@ExcelAttribute(name = "档案所在市", isArea = true, parentField = "fileProvince", isNotEmpty = true, errorInfo = "档案所在市不能为空")
@ExcelProperty("档案所在市")
private String fileCity;
/**
* 档案-县
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "档案所在县")
@ExcelAttribute(name = "档案所在县", isArea = true, parentField = "fileCity", isNotEmpty = true, errorInfo = "档案所在县不能为空")
@ExcelProperty("档案所在县")
private String fileTown;
/**
......
......@@ -1263,31 +1263,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp.setIdTown(Integer.parseInt(areaStr));
}
}
// 档案所在地
if (Common.isNotNull(excel.getFileProvince())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileProvince(Integer.parseInt(areaStr));
}
}
if (Common.isNotNull(excel.getFileCity())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileCity().trim() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileCity(Integer.parseInt(areaStr));
}
}
if (Common.isNotNull(excel.getFileTown())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileTown().trim() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileTown(Integer.parseInt(areaStr));
}
}
if (Common.isNotNull(excel.getIsCollege())) {
if (CommonConstants.IS_TRUE.equals(excel.getIsCollege())) {
saveEmp.setIsCollege(CommonConstants.ONE_INT);
......@@ -1780,31 +1755,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp.setIdTown(Integer.parseInt(areaStr));
}
}
// 档案所在地
if (Common.isNotNull(excel.getFileProvince())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileProvince(Integer.parseInt(areaStr));
}
}
if (Common.isNotNull(excel.getFileCity())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileCity().trim() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileCity(Integer.parseInt(areaStr));
}
}
if (Common.isNotNull(excel.getFileTown())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileTown().trim() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileTown(Integer.parseInt(areaStr));
}
}
if (Common.isNotNull(excel.getIsCollege())) {
if (CommonConstants.IS_TRUE.equals(excel.getIsCollege())) {
saveEmp.setIsCollege(CommonConstants.ONE_INT);
......
......@@ -482,7 +482,7 @@ public class ExcelUtil <T> implements Serializable {
private String getAreaValue(String c, String tempStr, ExcelAttribute attr,Integer rowNum, ErrorMessage errorTemp) {
tempStr = String.valueOf(RedisUtil.redis.opsForValue().get(CacheConstants.AREA_VALUE + c));
if (Common.isEmpty(tempStr)){
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, attr.name() + ":" + c.trim() + "校验异常,请联系管理人员"), errorTemp);
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, attr.name() + ":" + c.trim() + "校验异常"), errorTemp);
return CommonConstants.EMPTY_STRING;
}
return tempStr;
......
......@@ -124,7 +124,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 档案-省
*/
@ExcelAttribute(name = "档案-省" ,isArea = true)
@ExcelAttribute(name = "档案-省" ,isArea = true, isNotEmpty = true, errorInfo = "档案-省不能为空")
@Schema(description = "档案-省" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("档案-省" )
......@@ -132,7 +132,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市" ,isArea = true,parentField = "fileProvince")
@ExcelAttribute(name = "档案-市" ,isArea = true,parentField = "fileProvince", isNotEmpty = true, errorInfo = "档案-市不能为空")
@Schema(description = "档案-市" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("档案-市" )
......@@ -140,7 +140,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 档案-县
*/
@ExcelAttribute(name = "档案-县" ,isArea = true,parentField = "fileCity")
@ExcelAttribute(name = "档案-县" ,isArea = true,parentField = "fileCity", isNotEmpty = true, errorInfo = "档案-县不能为空")
@Schema(description = "档案-县" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("档案-县" )
......
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