Commit 0b9efb53 authored by fangxinjiang's avatar fangxinjiang

代码优化

parent 419e8dc5
...@@ -81,7 +81,7 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable { ...@@ -81,7 +81,7 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable {
/** /**
* 是否最高资格0是/1否 * 是否最高资格0是/1否
*/ */
@ExcelAttribute(name = "是否最高资格",errorInfo = "是否最高资格不可为空",readConverterExp = "0:是,1:否") @ExcelAttribute(name = "是否最高资格",errorInfo = "是否最高资格不可为空",readConverterExp = "0=是,1=否")
@NotNull(message = "是否最高资格不可为空") @NotNull(message = "是否最高资格不可为空")
@ExcelProperty(value ="是否最高资格") @ExcelProperty(value ="是否最高资格")
private String heightIdentification; private String heightIdentification;
......
...@@ -25,7 +25,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -25,7 +25,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/** /**
* 员工姓名 * 员工姓名
*/ */
@ExcelAttribute(name = "员工姓名",errorInfo = "员工姓名不可为空",maxLength = 20) @ExcelAttribute(name = "员工姓名",isNotEmpty = true, errorInfo = "员工姓名不可为空",maxLength = 20)
@NotNull(message = "员工姓名不可为空") @NotNull(message = "员工姓名不可为空")
@ExcelProperty(value ="员工姓名") @ExcelProperty(value ="员工姓名")
private String empName; private String empName;
...@@ -33,7 +33,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -33,7 +33,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/** /**
* 身份证号 * 身份证号
*/ */
@ExcelAttribute(name = "身份证号",errorInfo = "员工身份证不可为空", maxLength = 20) @ExcelAttribute(name = "身份证号",isNotEmpty = true, errorInfo = "员工身份证不可为空", maxLength = 20)
@NotNull(message = "员工身份证不可为空") @NotNull(message = "员工身份证不可为空")
@ExcelProperty(value ="身份证号") @ExcelProperty(value ="身份证号")
private String empIdcard; private String empIdcard;
...@@ -41,7 +41,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -41,7 +41,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/** /**
* 学校名称 * 学校名称
*/ */
@ExcelAttribute(name = "学校",errorInfo = "学校不可为空",maxLength = 50) @ExcelAttribute(name = "学校",isNotEmpty = true, errorInfo = "学校不可为空",maxLength = 50)
@NotNull(message = "学校不可为空") @NotNull(message = "学校不可为空")
@ExcelProperty(value ="学校") @ExcelProperty(value ="学校")
private String school; private String school;
...@@ -56,7 +56,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -56,7 +56,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/** /**
* 专业 * 专业
*/ */
@ExcelAttribute(name = "专业",errorInfo = "专业不可为空",maxLength = 50) @ExcelAttribute(name = "专业",isNotEmpty = true, errorInfo = "专业不可为空",maxLength = 50)
@NotNull(message = "专业不可为空") @NotNull(message = "专业不可为空")
@ExcelProperty(value ="专业") @ExcelProperty(value ="专业")
private String major; private String major;
...@@ -64,7 +64,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -64,7 +64,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/** /**
* 学历名称 * 学历名称
*/ */
@ExcelAttribute(name = "学历",errorInfo = "学历不可为空",isDataId = true,dataType = "education") @ExcelAttribute(name = "学历",isNotEmpty = true, errorInfo = "学历不可为空",isDataId = true,dataType = "education")
@NotNull(message = "学历不可为空") @NotNull(message = "学历不可为空")
@ExcelProperty(value ="学历") @ExcelProperty(value ="学历")
private String educationName; private String educationName;
...@@ -79,7 +79,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -79,7 +79,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/** /**
* 最高学历标识0是/1否 * 最高学历标识0是/1否
*/ */
@ExcelAttribute(name = "最高学历",errorInfo = "最高学历不可为空",readConverterExp = "0=是,1=否") @ExcelAttribute(name = "最高学历",isNotEmpty = true, errorInfo = "最高学历不可为空",readConverterExp = "0=是,1=否")
@NotNull(message = "最高学历标识不可为空") @NotNull(message = "最高学历标识不可为空")
@ExcelProperty(value ="最高学历") @ExcelProperty(value ="最高学历")
private String highIdentification; private String highIdentification;
...@@ -94,7 +94,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -94,7 +94,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/** /**
* 入学时间 * 入学时间
*/ */
@ExcelAttribute(name = "入学时间",errorInfo = "入学时间不可为空",isDate = true) @ExcelAttribute(name = "入学时间",isNotEmpty = true, errorInfo = "入学时间不可为空",isDate = true)
@NotNull(message = "入学时间不可为空") @NotNull(message = "入学时间不可为空")
@DateTimeFormat("yyyy-MM-dd") @DateTimeFormat("yyyy-MM-dd")
@ExcelProperty(value ="入学时间") @ExcelProperty(value ="入学时间")
...@@ -103,7 +103,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -103,7 +103,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/** /**
* 结业日期 * 结业日期
*/ */
@ExcelAttribute(name = "毕业时间",errorInfo = "毕业时间不可为空",isDate = true) @ExcelAttribute(name = "毕业时间",isNotEmpty = true, errorInfo = "毕业时间不可为空",isDate = true)
@NotNull(message = "毕业时间不可为空") @NotNull(message = "毕业时间不可为空")
@DateTimeFormat("yyyy-MM-dd") @DateTimeFormat("yyyy-MM-dd")
@ExcelProperty(value ="毕业时间") @ExcelProperty(value ="毕业时间")
......
...@@ -110,7 +110,7 @@ public class TEmpProfessionalQualificationController { ...@@ -110,7 +110,7 @@ public class TEmpProfessionalQualificationController {
@PutMapping @PutMapping
@PreAuthorize("@pms.hasPermission('archives_tempprofessionalqualification_edit')" ) @PreAuthorize("@pms.hasPermission('archives_tempprofessionalqualification_edit')" )
public R updateById(@RequestBody TEmpProfessionalQualification tEmpProfessionalQualification) { public R updateById(@RequestBody TEmpProfessionalQualification tEmpProfessionalQualification) {
return R.ok(qualificationService.updateById(tEmpProfessionalQualification)); return R.ok(qualificationService.updateByIdDiy(tEmpProfessionalQualification));
} }
/** /**
......
...@@ -46,4 +46,6 @@ public interface TEmpProfessionalQualificationService extends IService<TEmpProfe ...@@ -46,4 +46,6 @@ public interface TEmpProfessionalQualificationService extends IService<TEmpProfe
IPage<TEmpProfessionalQualification> pageDiy(Page page, CertifySearchVo searchVo); IPage<TEmpProfessionalQualification> pageDiy(Page page, CertifySearchVo searchVo);
R<List<ErrorMessage>> importEmpCertificateDiy(InputStream inputStream); R<List<ErrorMessage>> importEmpCertificateDiy(InputStream inputStream);
R<Boolean> updateByIdDiy(TEmpProfessionalQualification tEmpProfessionalQualification);
} }
...@@ -108,8 +108,8 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert ...@@ -108,8 +108,8 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
private LambdaQueryWrapper buildQueryWrapper(CertRecordSearchVo entity){ private LambdaQueryWrapper buildQueryWrapper(CertRecordSearchVo entity){
LambdaQueryWrapper<TCertRecord> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<TCertRecord> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) { if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TCertRecord::getCreateTime, entity.getCreateTimes()[0]) wrapper.ge(TCertRecord::getOpenTime, entity.getCreateTimes()[0])
.le(TCertRecord::getCreateTime, .le(TCertRecord::getOpenTime,
entity.getCreateTimes()[1]); entity.getCreateTimes()[1]);
} }
if (Common.isNotNull(entity.getEmpName())){ if (Common.isNotNull(entity.getEmpName())){
......
...@@ -92,6 +92,7 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T ...@@ -92,6 +92,7 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T
errorMessageList.add(errorMsg); errorMessageList.add(errorMsg);
continue; continue;
} }
excel.setEmpName(emp.getEmpName());
exist = baseMapper.selectOne(Wrappers.<TEmpEducation>query().lambda() exist = baseMapper.selectOne(Wrappers.<TEmpEducation>query().lambda()
.eq(TEmpEducation::getEmpIdcard,excel.getEmpIdcard()) .eq(TEmpEducation::getEmpIdcard,excel.getEmpIdcard())
.eq(TEmpEducation::getEducationName,excel.getEducationName()) .eq(TEmpEducation::getEducationName,excel.getEducationName())
......
...@@ -65,6 +65,17 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr ...@@ -65,6 +65,17 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
@Override @Override
public R<Boolean> saveDiy(TEmpProfessionalQualification qualification) { public R<Boolean> saveDiy(TEmpProfessionalQualification qualification) {
TEmpProfessionalQualification exist = baseMapper.selectOne(Wrappers.<TEmpProfessionalQualification>query().lambda()
.eq(TEmpProfessionalQualification::getEmpIdcard,qualification.getEmpIdcard())
.eq(TEmpProfessionalQualification::getQualificationLevel,qualification.getQualificationLevel())
.eq(TEmpProfessionalQualification::getQualificationType,qualification.getQualificationType())
.eq(TEmpProfessionalQualification::getDeleteFlag,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exist)){
return R.failed(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_CERTIFICATE_NAME_EXISTING));
}
qualification.setDeleteFlag(CommonConstants.ZERO_STRING); qualification.setDeleteFlag(CommonConstants.ZERO_STRING);
int res = baseMapper.insert(qualification); int res = baseMapper.insert(qualification);
if (res <= CommonConstants.ZERO_INT){ if (res <= CommonConstants.ZERO_INT){
...@@ -99,6 +110,7 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr ...@@ -99,6 +110,7 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
continue; continue;
} }
exist = baseMapper.selectOne(Wrappers.<TEmpProfessionalQualification>query().lambda() exist = baseMapper.selectOne(Wrappers.<TEmpProfessionalQualification>query().lambda()
.eq(TEmpProfessionalQualification::getEmpIdcard,excel.getEmpIdcard())
.eq(TEmpProfessionalQualification::getQualificationLevel,excel.getQualificationLevel()) .eq(TEmpProfessionalQualification::getQualificationLevel,excel.getQualificationLevel())
.eq(TEmpProfessionalQualification::getQualificationType,excel.getQualificationType()) .eq(TEmpProfessionalQualification::getQualificationType,excel.getQualificationType())
.eq(TEmpProfessionalQualification::getDeleteFlag,CommonConstants.ZERO_STRING) .eq(TEmpProfessionalQualification::getDeleteFlag,CommonConstants.ZERO_STRING)
...@@ -215,6 +227,25 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr ...@@ -215,6 +227,25 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
return R.ok(errorMessageList); return R.ok(errorMessageList);
} }
@Override
public R<Boolean> updateByIdDiy(TEmpProfessionalQualification qualification) {
TEmpProfessionalQualification exist = baseMapper.selectOne(Wrappers.<TEmpProfessionalQualification>query().lambda()
.ne(TEmpProfessionalQualification::getId,qualification.getId())
.eq(TEmpProfessionalQualification::getEmpIdcard,qualification.getEmpIdcard())
.eq(TEmpProfessionalQualification::getQualificationLevel,qualification.getQualificationLevel())
.eq(TEmpProfessionalQualification::getQualificationType,qualification.getQualificationType())
.eq(TEmpProfessionalQualification::getDeleteFlag,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exist)){
return R.failed(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_CERTIFICATE_NAME_EXISTING));
}
int res = baseMapper.updateById(qualification);
if (res < 0){
return R.failed();
}
return R.ok();
}
private LambdaQueryWrapper buildQueryWrapper(CertifySearchVo entity){ private LambdaQueryWrapper buildQueryWrapper(CertifySearchVo entity){
LambdaQueryWrapper<TEmpProfessionalQualification> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<TEmpProfessionalQualification> wrapper = Wrappers.lambdaQuery();
wrapper.eq(TEmpProfessionalQualification::getDeleteFlag,CommonConstants.ZERO_STRING); wrapper.eq(TEmpProfessionalQualification::getDeleteFlag,CommonConstants.ZERO_STRING);
......
...@@ -26,6 +26,7 @@ mybatis-plus: ...@@ -26,6 +26,7 @@ mybatis-plus:
logic-not-delete-value: 0 logic-not-delete-value: 0
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# spring security 配置 # spring security 配置
security: security:
......
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