Commit 99e81fdf authored by fangxinjiang's avatar fangxinjiang

派单同步更新档案档案地 和 新增合同档案地

parent eb21df7e
......@@ -33,4 +33,12 @@ public class UpProjectSocialFundVo implements Serializable {
String departNo;
// 身份证
String empIdCard;
// 档案地-省
String fileProvince;
// 档案地-市
String fileCity;
// 档案地-县
String fileTown;
// 档案地-手机号码
String mobile;
}
......@@ -85,4 +85,6 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
List<EmployeeLeaveExportVO> noPageLeaveDiy(@Param("tEmployeeInfo")EmployeeInfoSearchVo searchV);
int noPageCountLeaveDiy(@Param("tEmployeeInfo")EmployeeInfoSearchVo searchV);
int updateSocialInfoById(@Param("tEmployeeInfo")TEmployeeInfo employee);
}
......@@ -171,32 +171,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeInfo::getEmpIdcard, tEmployeeProject.getEmpIdcard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT));
if (Common.isNotNull(tEmployeeInfo)) {
if (Common.isNotNull(tEmployeeProject.getBankNo())) {
TCheckBankNo check = new TCheckBankNo();
check.setBankNo(tEmployeeProject.getBankNo());
check.setIdNum(tEmployeeProject.getEmpIdcard());
check.setName(tEmployeeProject.getEmpName());
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(),
daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, CheckBankNoVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
CheckBankNoVo vo = checkListR.getData();
check = (null == vo.getRes()) ? null : vo.getRes().getData();
if (Common.isEmpty(vo)) {
return R.failed(EmployeeConstants.CHECK_NO_RESPONSE);
} else if (!CommonConstants.SUCCESS.equals(vo.getRes().getCode())) {
return R.failed(vo.getRes().getMsg());
} else if (null != check && !check.getResult().equals(CommonConstants.ZERO_ONE)) {
return R.failed(check.getRemark());
}
} else {
return R.failed(EmployeeConstants.CHECK_NO_RESPONSE);
}
}
TEmployeeInfo tEmployeeInfoCompare = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
//获取项目和单位信息
......@@ -236,27 +212,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override
public R updateProject(TEmployeeProject tEmployeeProject) {
if (Common.isNotNull(tEmployeeProject.getBankNo())) {
TCheckBankNo check = new TCheckBankNo();
check.setBankNo(tEmployeeProject.getBankNo());
check.setIdNum(tEmployeeProject.getEmpIdcard());
check.setName(tEmployeeProject.getEmpName());
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, CheckBankNoVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
CheckBankNoVo vo = checkListR.getData();
check = (null == vo.getRes()) ? null : vo.getRes().getData();
if (Common.isEmpty(vo)) {
return R.failed(EmployeeConstants.CHECK_NO_RESPONSE);
} else if (!CommonConstants.SUCCESS.equals(vo.getRes().getCode())) {
return R.failed(vo.getRes().getMsg());
} else if (null != check && !check.getResult().equals(CommonConstants.ZERO_ONE)) {
return R.failed(check.getRemark());
}
} else {
return R.failed(EmployeeConstants.CHECK_NO_RESPONSE);
}
}
TEmployeeProject compareProject = this.getById(tEmployeeProject.getId());
boolean flag = this.updateById(tEmployeeProject);
TEmployeeProject newProject = this.getById(tEmployeeProject.getId());
......@@ -1444,7 +1399,21 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (Common.isNotNull(vo.getFundStatus())){
employee.setFundStatus(Integer.parseInt(vo.getFundStatus()));
}
tEmployeeInfoMapper.updateById(employee);
if (Common.isNotNull(vo.getFileProvince())){
employee.setFileProvince(Integer.parseInt(vo.getFileProvince()));
}
if (Common.isNotNull(vo.getFileCity())){
employee.setFileCity(Integer.parseInt(vo.getFileCity()));
if (Common.isNotNull(vo.getFileTown())){
employee.setFileTown(Integer.parseInt(vo.getFileTown()));
}else {
employee.setFileTown(null);
}
}
if (Common.isNotNull(vo.getMobile())){
employee.setEmpPhone(vo.getMobile());
}
tEmployeeInfoMapper.updateSocialInfoById(employee);
}
TEmployeeProject project = baseMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeptNo,vo.getDepartNo())
......
......@@ -1082,4 +1082,22 @@
order by a.CREATE_TIME desc
</select>
<update id="updateSocialInfoById" >
update t_employee_info a
<trim prefix="set" suffixOverrides=",">
<if test="tEmployeeInfo.id != null">a.id=a.id,</if>
<if test="tEmployeeInfo.socialStatus != null">SOCIAL_STATUS=#{tEmployeeInfo.socialStatus},</if>
<if test="tEmployeeInfo.fundStatus != null">FUND_STATUS=#{tEmployeeInfo.fundStatus},</if>
<if test="tEmployeeInfo.fileProvince != null">a.FILE_PROVINCE=#{tEmployeeInfo.fileProvince},</if>
<if test="tEmployeeInfo.fileCity != null">a.FILE_CITY=#{tEmployeeInfo.fileCity},</if>
<if test="tEmployeeInfo.fileCity != null">
<if test="tEmployeeInfo.fileTown != null">a.FILE_TOWN=#{tEmployeeInfo.fileTown},</if>
<if test="tEmployeeInfo.fileTown == null">a.FILE_TOWN=null,</if>
</if>
<if test="tEmployeeInfo.empPhone != null and tEmployeeInfo.empPhone != ''">a.EMP_PHONE=#{tEmployeeInfo.empPhone},</if>
</trim>
WHERE a.id=#{tEmployeeInfo.id}
</update>
</mapper>
......@@ -100,7 +100,7 @@ public class ChecksUtil {
}
} else {
// 记录错误日志,正式项目中请换成log打印
return R.failed("银行卡号校验失败,code:" + code + ChecksConstants.MESSAGE_INFO + jsonObject.get(ChecksConstants.MESSAGE).getAsString());
return R.failed("银行卡号校验失败:"+jsonObject.get(ChecksConstants.MESSAGE).getAsString());
}
} else {
return R.failed(ChecksConstants.NO_DATA_RESULT);
......@@ -146,7 +146,7 @@ public class ChecksUtil {
}
} else {
// 记录错误日志,正式项目中请换成log打印
return R.failed("手机号校验失败,code:" + code + ChecksConstants.MESSAGE_INFO + jsonObject.get(ChecksConstants.MESSAGE).getAsString());
return R.failed("手机号校验失败:" + jsonObject.get(ChecksConstants.MESSAGE).getAsString());
}
} else {
return R.failed(ChecksConstants.NO_DATA_RESULT);
......@@ -173,12 +173,12 @@ public class ChecksUtil {
} else {
checkIdCard.setIsTrue(CommonConstants.ZERO_INT);
String remark = getJsonElementValue(resultJson.get(ChecksConstants.REMARK));
checkIdCard.setReason("调用身份信息校验失败,resultStr:" + resultStr + ChecksConstants.MESSAGE_INFO + remark);
checkIdCard.setReason("调用身份信息校验失败:" + remark);
}
} else {
// 记录错误日志,正式项目中请换成log打印
checkIdCard.setIsTrue(CommonConstants.ZERO_INT);
checkIdCard.setReason("调用身份信息校验失败,code:" + code + ChecksConstants.MESSAGE_INFO + jsonObject.get(ChecksConstants.MESSAGE).getAsString());
checkIdCard.setReason("调用身份信息校验失败:" + jsonObject.get(ChecksConstants.MESSAGE).getAsString());
}
} else {
checkIdCard.setIsTrue(CommonConstants.ZERO_INT);
......
......@@ -682,7 +682,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
forecastLibraryService.updateForecastLibaryByDispatch(socialFund);
}
// 同步更新人员档案和项目档案的社保公积金状态
updateDocSocialFund(social, fund, socialFund);
updateDocSocialFund(social, fund, socialFund,excel);
}catch (Exception e){
log.error("派单新增异常:", e);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "派单新增异常:"+e.getMessage()));
......@@ -709,7 +709,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
auditInfoMapper.insert(auditInfo);
}
private void updateDocSocialFund(TSocialInfo social, TProvidentFund fund, TSocialFundInfo socialFund) {
private void updateDocSocialFund(TSocialInfo social, TProvidentFund fund, TSocialFundInfo socialFund, TDispatchImportVo excel) {
UpProjectSocialFundVo vo = new UpProjectSocialFundVo();
if (Common.isNotNull(social)){
vo.setSocialStatus(CommonConstants.ONE_STRING);
......@@ -741,7 +741,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(socialFund) && flagTemp){
vo.setSocialStatus(CommonConstants.TWO_STRING);
}
vo.setFileProvince(excel.getFileProvince());
vo.setFileCity(excel.getFileCity());
vo.setFileTown(excel.getFileTown());
vo.setMobile(excel.getEmpMobile());
vo.setEmpIdCard(socialFund.getEmpIdcard());
R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo);
if (Common.isEmpty(resUp) || !(CommonConstants.SUCCESS.intValue() == resUp.getCode()) || !resUp.getData().booleanValue()){
......@@ -1886,9 +1889,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVo.getEmpNatrue())){
contract.setEmpNatrue(empVo.getEmpNatrue());
}
contract.setFileProvince(empVo.getFileProvince());
contract.setFileCity(empVo.getFileCity());
contract.setFileTown(empVo.getFileTown());
if (Common.isNotNull(excel.getFileProvince())){
contract.setFileProvince(Integer.parseInt(excel.getFileProvince()));
contract.setFileCity(null == excel.getFileCity()?null:Integer.parseInt(excel.getFileCity()));
contract.setFileTown(null == excel.getFileTown()?null:Integer.parseInt(excel.getFileTown()));
}
}
if (Common.isEmpty(contract.getContractTerm()) && Common.isNotNull(contract.getContractStart()) && Common.isNotNull(contract.getContractEnd())){
contract.setContractTerm(Integer.toString(Common.getYearOfTime(contract.getContractStart(), contract.getContractEnd())));
......@@ -2146,12 +2151,21 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVo.getEmpNatrue())){
excel.setEmpType(empVo.getEmpNatrue());
}
if (Common.isNotNull(empVo.getEmpPhone())){
if (Common.isNotNull(empVo.getEmpPhone()) && Common.isEmpty(excel.getEmpMobile())){
excel.setEmpMobile(empVo.getEmpPhone());
}
excel.setFileProvince(Common.isNotNullToStr(empVo.getFileProvince()));
excel.setFileCity(Common.isNotNullToStr(empVo.getFileCity()));
excel.setFileTown(Common.isNotNullToStr(empVo.getFileTown()));
// 如果存在档案但是手机号码不为空校验号码
if (Common.isNotNull(excel.getEmpMobile())
&& !excel.getEmpMobile().equals(empVo.getEmpPhone())
&& checkMobileAndIdcard(errorMessageList, excel)){
return true;
}
// 档案地 手机号码, 派单有数据 更新档案,派单没有 有档案取值档案数据
if (Common.isEmpty(excel.getFileProvince())){
excel.setFileProvince(Common.isNotNullToStr(empVo.getFileProvince()));
excel.setFileCity(Common.isNotNullToStr(empVo.getFileCity()));
excel.setFileTown(Common.isNotNullToStr(empVo.getFileTown()));
}
excel.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince()));
excel.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity()));
excel.setIdCardTown(Common.isNotNullToStr(empVo.getIdCity()));
......@@ -2301,6 +2315,28 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
return false;
}
private boolean checkMobileAndIdcard(List<ErrorMessage> errorMessageList, TDispatchImportVo excel) {
// 如果没有人员档案和项目档案的时候校验身份证和手机号码
R<Boolean> checkRes = checkDaprUtil.checkIdCardAndMobile(null,null, excel.getEmpMobile());
if (Common.isEmpty(checkRes) || checkRes.getCode() != CommonConstants.SUCCESS){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), checkRes.getMsg()));
return true;
}
// 校验手机号码重复
checkRes = archivesDaprUtil.checkMobile(excel.getEmpMobile());
if (Common.isEmpty(checkRes) || checkRes.getCode() != CommonConstants.SUCCESS){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), checkRes.getMsg()));
return true;
}
if (Common.isNotNull(checkRes.getData()) && checkRes.getData().booleanValue())
{
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "手机号码已被其他身份证使用!"));
return true;
}
return false;
}
private boolean validContractInfo(List<ErrorMessage> errorMessageList, TDispatchImportVo excel){
// 合同起缴时间、合同类型、签订期限必填
if ((Common.isEmpty(excel.getContractStart())
......
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