Commit 695b917d authored by hongguangwu's avatar hongguangwu

基数配置提交2

parent 95702c74
...@@ -47,16 +47,16 @@ public class TEmployeeLogServiceImpl extends ServiceImpl<TEmployeeLogMapper, TEm ...@@ -47,16 +47,16 @@ public class TEmployeeLogServiceImpl extends ServiceImpl<TEmployeeLogMapper, TEm
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo); String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异 //如果有差异保存差异
if(!Common.isEmpty(differenceKey)){ if(!Common.isEmpty(differenceKey)){
TEmployeeLog record = new TEmployeeLog(); TEmployeeLog employeeLog = new TEmployeeLog();
record.setProjectId(projectId); employeeLog.setProjectId(projectId);
record.setType(type); employeeLog.setType(type);
record.setEmpId(empId); employeeLog.setEmpId(empId);
record.setCreateTime(LocalDateTime.now()); employeeLog.setCreateTime(LocalDateTime.now());
record.setOldInfo(JSON.toJSONString(oldInfo,features)); employeeLog.setOldInfo(JSON.toJSONString(oldInfo,features));
record.setNewInfo(JSON.toJSONString(newInfo,features)); employeeLog.setNewInfo(JSON.toJSONString(newInfo,features));
record.setDifferenceInfo(differenceKey); employeeLog.setDifferenceInfo(differenceKey);
baseMapper.insert(record); baseMapper.insert(employeeLog);
return record; return employeeLog;
} }
}catch (Exception e){ }catch (Exception e){
log.error(JSON.toJSON(oldInfo)+"插入修改记录报错>>>",e); log.error(JSON.toJSON(oldInfo)+"插入修改记录报错>>>",e);
......
...@@ -20,7 +20,6 @@ package com.yifu.cloud.plus.v1.yifu.social.controller; ...@@ -20,7 +20,6 @@ package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
...@@ -29,10 +28,8 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.SysPayProportion; ...@@ -29,10 +28,8 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.SysPayProportion;
import com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.SysPayProportionService; import com.yifu.cloud.plus.v1.yifu.social.service.SysPayProportionService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -86,9 +83,8 @@ public class SysBaseSetInfoController { ...@@ -86,9 +83,8 @@ public class SysBaseSetInfoController {
* @param id id * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_sysbasesetinfo_get')") @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}") @GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_sysbasesetinfo_get')")
public R<SysBaseSetInfo> getById(@PathVariable("id") String id) { public R<SysBaseSetInfo> getById(@PathVariable("id") String id) {
SysBaseSetInfo baseSetInfo = sysBaseSetInfoService.getById(id); SysBaseSetInfo baseSetInfo = sysBaseSetInfoService.getById(id);
if (null != baseSetInfo && CommonConstants.ONE_STRING.equals(baseSetInfo.getBaseType())){ if (null != baseSetInfo && CommonConstants.ONE_STRING.equals(baseSetInfo.getBaseType())){
......
...@@ -22,14 +22,15 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -22,14 +22,15 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialLog; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialLog;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService; import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
...@@ -63,71 +64,16 @@ public class TSocialLogController { ...@@ -63,71 +64,16 @@ public class TSocialLogController {
} }
/** /**
* 不分页查询 * @Description: 通过EMP_ID查询人员档案变更日志
* * @Author: hgw
* @param tSocialLog 社保变更记录表 * @Date: 2022/6/28 16:45
* @return * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog>>
*/ **/
@Operation(summary = "不分页查询", description = "不分页查询") @Operation(summary = "通过mainId、type查询社保变更日志(type类型:1社保基数配置;2公积金基数配置;后续再追加)", description = "通过mainId查询社保变更日志")
@PostMapping("/noPage") @GetMapping("/getByEmpId")
//@PreAuthorize("@pms.hasPermission('social_tsociallog_get')" ) public R<List<TSocialLog>> getByEmpId(@RequestParam String mainId, @RequestParam Integer type) {
public R<List<TSocialLog>> getTSocialLogNoPage(@RequestBody TSocialLog tSocialLog) { return R.ok(tSocialLogService.list(Wrappers.<TSocialLog>query().eq("MAIN_ID", mainId)
return R.ok(tSocialLogService.list(Wrappers.query(tSocialLog).orderByDesc(CommonConstants.CREATE_TIME))); .eq("TYPE", type).orderByDesc(CommonConstants.CREATE_TIME)));
}
/**
* 通过id查询社保变更记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tsociallog_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tsociallog_get')")
public R<TSocialLog> getById(@PathVariable("id") String id) {
return R.ok(tSocialLogService.getById(id));
}
/**
* 新增社保变更记录表
*
* @param tSocialLog 社保变更记录表
* @return R
*/
@Operation(summary = "新增社保变更记录表", description = "新增社保变更记录表:hasPermission('social_tsociallog_add')")
@SysLog("新增社保变更记录表")
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tsociallog_add')")
public R<Boolean> save(@RequestBody TSocialLog tSocialLog) {
return R.ok(tSocialLogService.save(tSocialLog));
}
/**
* 修改社保变更记录表
*
* @param tSocialLog 社保变更记录表
* @return R
*/
@Operation(summary = "修改社保变更记录表", description = "修改社保变更记录表:hasPermission('social_tsociallog_edit')")
@SysLog("修改社保变更记录表")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tsociallog_edit')")
public R<Boolean> updateById(@RequestBody TSocialLog tSocialLog) {
return R.ok(tSocialLogService.updateById(tSocialLog));
}
/**
* 通过id删除社保变更记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除社保变更记录表", description = "通过id删除社保变更记录表:hasPermission('social_tsociallog_del')")
@SysLog("通过id删除社保变更记录表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tsociallog_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tSocialLogService.removeById(id));
} }
} }
...@@ -67,15 +67,15 @@ public class TSocialLogServiceImpl extends ServiceImpl<TSocialLogMapper, TSocial ...@@ -67,15 +67,15 @@ public class TSocialLogServiceImpl extends ServiceImpl<TSocialLogMapper, TSocial
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo); String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异 //如果有差异保存差异
if (!Common.isEmpty(differenceKey)) { if (!Common.isEmpty(differenceKey)) {
TSocialLog record = new TSocialLog(); TSocialLog socialLog = new TSocialLog();
record.setType(type); socialLog.setType(type);
record.setMainId(mainId); socialLog.setMainId(mainId);
record.setCreateTime(LocalDateTime.now()); socialLog.setCreateTime(LocalDateTime.now());
record.setOldInfo(JSON.toJSONString(oldInfo, features)); socialLog.setOldInfo(JSON.toJSONString(oldInfo, features));
record.setNewInfo(JSON.toJSONString(newInfo, features)); socialLog.setNewInfo(JSON.toJSONString(newInfo, features));
record.setDifferenceInfo(differenceKey); socialLog.setDifferenceInfo(differenceKey);
baseMapper.insert(record); baseMapper.insert(socialLog);
return record; return socialLog;
} }
} catch (Exception e) { } catch (Exception e) {
log.error(JSON.toJSON(oldInfo) + "【新增社保变更记录】报错>>>", e); log.error(JSON.toJSON(oldInfo) + "【新增社保变更记录】报错>>>", e);
......
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