Commit 1d20db5e authored by hongguangwu's avatar hongguangwu

优化人员档案

parent 7955b944
......@@ -30,6 +30,8 @@ public class EmployeeConstants {
public static final String FILE_CITY_MUST = "更新档案县,档案市必填";
public static final String DEPT_NO_ERROR = "项目编码错误";
public static final String DEPT_NO_EXIST = "根据项目编码未找到项目";
public static final String CHECK_ERROR = "校验服务错误,请联系管理员!";
public static final String CHECK_NO_RESPONSE = "校验服务器未返回,请联系管理员!";
/**
* 无数据可更新
......
......@@ -19,13 +19,10 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.plugin.excel.annotation.RequestExcel;
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeLeaveVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorMessageVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
......@@ -46,13 +43,11 @@ import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.InputStream;
import java.util.List;
......
......@@ -122,12 +122,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (checkListR != null && checkListR.getData() != null) {
TCheckIdCard check = checkListR.getData();
if (check == null || Common.isEmpty(check.getIsTrue())) {
return R.failed("校验服务器未返回,请联系管理员!!");
return R.failed(EmployeeConstants.CHECK_NO_RESPONSE);
} else if (check.getIsTrue() == CommonConstants.ZERO_INT) {
return R.failed(check.getReason());
}
} else {
return R.failed("校验服务器未返回,请联系管理员!");
return R.failed(EmployeeConstants.CHECK_NO_RESPONSE);
}
return R.ok();
}
......@@ -1598,8 +1598,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMsg.add(checkMobile.getMessage());
}
} else {
errorMsg.add("校验服务错误,请联系管理员!");
errorMsg.add(EmployeeConstants.CHECK_ERROR);
}
} else {
errorMsg.add(EmployeeConstants.CHECK_ERROR);
}
}
}
......
......@@ -38,7 +38,7 @@ public class ChecksUtil {
// 1.调用身份信息校验api
checkIdCardMethod(checkIdCard);
} else {
checkIdCard.setIsTrue(0);
checkIdCard.setIsTrue(CommonConstants.ZERO_INT);
checkIdCard.setReason(ChecksConstants.NACOS_CHECK_CONFIG_ERROR);
}
}
......@@ -173,20 +173,20 @@ public class ChecksUtil {
JsonObject resultJson = jsonObject.get(ChecksConstants.DATA).getAsJsonObject();
String resultStr = getJsonElementValue(resultJson.getAsJsonObject().get(ChecksConstants.RESULT));
if ("01".equals(resultStr)) {
checkIdCard.setIsTrue(1);
checkIdCard.setIsTrue(CommonConstants.ONE_INT);
checkIdCard.setReason("正确");
} else {
checkIdCard.setIsTrue(0);
checkIdCard.setIsTrue(CommonConstants.ZERO_INT);
String remark = getJsonElementValue(resultJson.get(ChecksConstants.REMARK));
checkIdCard.setReason("调用身份信息校验失败,resultStr:" + resultStr + ",msg:" + remark);
}
} else {
// 记录错误日志,正式项目中请换成log打印
checkIdCard.setIsTrue(0);
checkIdCard.setIsTrue(CommonConstants.ZERO_INT);
checkIdCard.setReason("调用身份信息校验失败,code:" + code + ",msg:" + jsonObject.get(ChecksConstants.MESSAGE).getAsString());
}
} else {
checkIdCard.setIsTrue(0);
checkIdCard.setIsTrue(CommonConstants.ZERO_INT);
checkIdCard.setReason(ChecksConstants.NO_DATA_RESULT);
}
}
......
......@@ -233,25 +233,22 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
if (Common.isEmpty(idCard) || Common.isEmpty(name)){
tCheckIdCard.setIsTrue(CommonConstants.ZERO_INT);
tCheckIdCard.setReason(CommonConstants.PARAM_IS_NOT_EMPTY);
tCheckIdCard.setIsTrue(CommonConstants.ONE_INT);
return tCheckIdCard;
}
// 校验姓名身份证规则
if (!regIdCard(idCard)) {
tCheckIdCard.setIsTrue(0);
tCheckIdCard.setIsTrue(CommonConstants.ZERO_INT);
tCheckIdCard.setReason("身份证格式有误");
tCheckIdCard.setIsTrue(CommonConstants.ONE_INT);
return tCheckIdCard;
} else if (regEmpName(name)) {
tCheckIdCard.setIsTrue(0);
tCheckIdCard.setIsTrue(CommonConstants.ZERO_INT);
tCheckIdCard.setReason("姓名含数字或空格,无法校验");
tCheckIdCard.setIsTrue(CommonConstants.ONE_INT);
return tCheckIdCard;
}
synchronized (this){
TCheckIdCard checkIdCard = baseMapper.selectOne(Wrappers.<TCheckIdCard>query().lambda()
.eq(TCheckIdCard::getIdCard,idCard)
.eq(TCheckIdCard::getIsTrue,CommonConstants.ONE_STRING)
.eq(TCheckIdCard::getIsTrue,CommonConstants.ONE_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(checkIdCard)){
if (name.equals(checkIdCard.getName())) {
......@@ -268,7 +265,7 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
if (checkList != null && !checkList.isEmpty()) {
for (TCheckIdCard c : checkList) {
if (idCard.equals(c.getIdCard()) && name.equals(c.getName())) {
tCheckIdCard.setIsTrue(0);
tCheckIdCard.setIsTrue(CommonConstants.ZERO_INT);
tCheckIdCard.setReason(c.getReason());
return tCheckIdCard;
}
......
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