Commit d9542189 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 9d988c9b be583855
......@@ -1231,9 +1231,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(excel.getIsCollege())) {
if (CommonConstants.IS_TRUE.equals(excel.getIsCollege())) {
saveEmp.setIsCollege(CommonConstants.ONE_INT);
if (Common.isEmpty(excel.getHignEducation())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR, excel.getEmpIdcard()));
}
} else if (CommonConstants.IS_FALSE.equals(excel.getIsCollege())) {
saveEmp.setIsCollege(CommonConstants.ZERO_INT);
} else {
......@@ -1745,9 +1742,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(excel.getIsCollege())) {
if (CommonConstants.IS_TRUE.equals(excel.getIsCollege())) {
saveEmp.setIsCollege(CommonConstants.ONE_INT);
if (Common.isEmpty(excel.getHignEducation())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR, excel.getEmpIdcard()));
}
} else if (CommonConstants.IS_FALSE.equals(excel.getIsCollege())) {
saveEmp.setIsCollege(CommonConstants.ZERO_INT);
} else {
......
......@@ -306,7 +306,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT));
if (Common.isNotNull(tEmployeeInfo)) {
tEmployeeInfoOld = tEmployeeInfoMapper.selectById(empId);
tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
//查询该人员所有的的项目档案
List<TEmployeeProject> list = this.list(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, tEmployeeProject.getEmpIdcard())
......
......@@ -243,7 +243,7 @@
AND a.EMP_CODE = #{tEmployeeProject.empCode}
</if>
<if test="tEmployeeProject.empNatrue != null and tEmployeeProject.empNatrue.trim() != ''">
AND a.EMP_NATRUE = #{tEmployeeProject.empNatrue}
AND a.EMP_NATRUE in (${tEmployeeProject.empNatrue})
</if>
<if test="tEmployeeProject.empName != null and tEmployeeProject.empName.trim() != ''">
AND a.EMP_NAME = #{tEmployeeProject.empName}
......@@ -392,7 +392,7 @@
AND a.EMP_CODE = #{tEmployeeProject.empCode}
</if>
<if test="tEmployeeProject.empNatrue != null and tEmployeeProject.empNatrue.trim() != ''">
AND a.EMP_NATRUE = #{tEmployeeProject.empNatrue}
AND a.EMP_NATRUE in (${tEmployeeProject.empNatrue})
</if>
<if test="tEmployeeProject.empName != null and tEmployeeProject.empName.trim() != ''">
AND a.EMP_NAME = #{tEmployeeProject.empName}
......
......@@ -101,8 +101,8 @@ public class SysBaseSetInfoController {
@SysLog("新增基数设置表")
@PostMapping
@PreAuthorize("@pms.hasPermission('social_sysbasesetinfo_add')")
public R<Boolean> save(@RequestBody SysBaseSetInfo sysBaseSetInfo) {
return R.ok(sysBaseSetInfoService.save(sysBaseSetInfo));
public R<String> save(@RequestBody SysBaseSetInfo sysBaseSetInfo) {
return sysBaseSetInfoService.saveSysBase(sysBaseSetInfo);
}
/**
......@@ -115,8 +115,8 @@ public class SysBaseSetInfoController {
@SysLog("修改基数设置表")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_sysbasesetinfo_edit')")
public R<Boolean> updateById(@RequestBody SysBaseSetInfo sysBaseSetInfo) {
return R.ok(sysBaseSetInfoService.updateById(sysBaseSetInfo));
public R<String> updateById(@RequestBody SysBaseSetInfo sysBaseSetInfo) {
return sysBaseSetInfoService.updateSysBase(sysBaseSetInfo);
}
/**
......
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
/**
......@@ -36,4 +37,23 @@ public interface SysBaseSetInfoService extends IService<SysBaseSetInfo> {
* @return
*/
IPage<SysBaseSetInfo> getSysBaseSetInfoPage(Page<SysBaseSetInfo> page, SysBaseSetInfo sysBaseSetInfo);
/**
* @param sysBaseSetInfo
* @Description: 新增
* @Author: hgw
* @Date: 2022/7/12 10:00
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> saveSysBase(SysBaseSetInfo sysBaseSetInfo);
/**
* @param sysBaseSetInfo
* @Description: 修改
* @Author: hgw
* @Date: 2022/7/12 10:00
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> updateSysBase(SysBaseSetInfo sysBaseSetInfo);
}
......@@ -36,4 +36,18 @@ public interface TSocialLogService extends IService<TSocialLog> {
* @return
*/
IPage<TSocialLog> getTSocialLogPage(Page<TSocialLog> page, TSocialLog tSocialLog);
/**
* 生成修改记录
*
* @param type 类型:1社保基数配置;2公积金基数配置
* @param mainId 关联表id
* @param oldInfo
* @param newInfo
* @return
* @Author pwang
* @Date 2022-06-22 11:32
**/
<T> TSocialLog saveModificationRecord(Integer type, String mainId, T oldInfo, T newInfo);
}
......@@ -19,9 +19,15 @@ package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
/**
......@@ -30,8 +36,11 @@ import org.springframework.stereotype.Service;
* @author hgw
* @date 2022-07-11 18:21:23
*/
@RequiredArgsConstructor
@Service
public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, SysBaseSetInfo> implements SysBaseSetInfoService {
private final TSocialLogService tSocialLogService;
/**
* 基数设置表简单分页查询
*
......@@ -42,4 +51,24 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
public IPage<SysBaseSetInfo> getSysBaseSetInfoPage(Page<SysBaseSetInfo> page, SysBaseSetInfo sysBaseSetInfo) {
return baseMapper.getSysBaseSetInfoPage(page, sysBaseSetInfo);
}
@Override
public R<String> saveSysBase(SysBaseSetInfo sysBaseSetInfo) {
this.save(sysBaseSetInfo);
return R.ok();
}
@Override
public R<String> updateSysBase(SysBaseSetInfo sysBaseSetInfo) {
SysBaseSetInfo old = this.getById(sysBaseSetInfo.getId());
if (old == null || Common.isEmpty(old.getId())) {
return R.failed("根据id未找到基数配置!" + sysBaseSetInfo.getId());
}
this.updateById(sysBaseSetInfo);
// 记录变更日志
tSocialLogService.saveModificationRecord(CommonConstants.ONE_INT, old.getId(), old, sysBaseSetInfo);
return R.ok();
}
}
......@@ -16,14 +16,22 @@
*/
package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialLog;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialLogMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import static com.alibaba.fastjson.serializer.SerializerFeature.*;
/**
* 社保变更记录表
*
......@@ -42,4 +50,42 @@ public class TSocialLogServiceImpl extends ServiceImpl<TSocialLogMapper, TSocial
public IPage<TSocialLog> getTSocialLogPage(Page<TSocialLog> page, TSocialLog tSocialLog) {
return baseMapper.getTSocialLogPage(page, tSocialLog);
}
/**
* @param type 类型:1社保基数配置;2公积金基数配置
* @param mainId
* @Description:
* @Author: hgw
* @Date: 2022/7/12 9:52
* @return: com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog
**/
@Override
public <T> TSocialLog saveModificationRecord(Integer type, String mainId, T oldInfo, T newInfo) {
try {
//比较记录不影响业务逻辑,用try套住
//比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异
if (!Common.isEmpty(differenceKey)) {
TSocialLog record = new TSocialLog();
record.setType(type);
record.setMainId(mainId);
record.setCreateTime(LocalDateTime.now());
record.setOldInfo(JSON.toJSONString(oldInfo, features));
record.setNewInfo(JSON.toJSONString(newInfo, features));
record.setDifferenceInfo(differenceKey);
baseMapper.insert(record);
return record;
}
} catch (Exception e) {
log.error(JSON.toJSON(oldInfo) + "【新增社保变更记录】报错>>>", e);
}
return null;
}
private SerializerFeature[] features = new SerializerFeature[]{
WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty,
WriteNullStringAsEmpty, WriteDateUseDateFormat
};
}
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