Commit 5ceb9714 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent aa8dfd6a
...@@ -37,12 +37,12 @@ import lombok.EqualsAndHashCode; ...@@ -37,12 +37,12 @@ import lombok.EqualsAndHashCode;
@Schema(description = "档案划转日志表") @Schema(description = "档案划转日志表")
public class TEmpChangeInfo extends BaseEntity { public class TEmpChangeInfo extends BaseEntity {
/** /**
* id * 主键
*/ */
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@Schema(description ="id") @Schema(description ="主键")
private Long id; private String id;
/** /**
* 员工姓名 * 员工姓名
...@@ -75,10 +75,10 @@ public class TEmpChangeInfo extends BaseEntity { ...@@ -75,10 +75,10 @@ public class TEmpChangeInfo extends BaseEntity {
private String newSettle; private String newSettle;
/** /**
* 员工id * 项目档案id
*/ */
@Schema(description ="员工id") @Schema(description ="项目档案id")
private Long empId; private Long proId;
/** /**
* 未结算费用 0:划转 1:不划转 * 未结算费用 0:划转 1:不划转
...@@ -112,4 +112,31 @@ public class TEmpChangeInfo extends BaseEntity { ...@@ -112,4 +112,31 @@ public class TEmpChangeInfo extends BaseEntity {
@Schema(description ="身份证号码") @Schema(description ="身份证号码")
private String empIdcard; private String empIdcard;
/**
* 客户id
*/
@Schema(description ="客户id")
@TableField(exist = false)
private String unitId;
/**
* 客户编码
*/
@Schema(description ="客户编码")
@TableField(exist = false)
private String unitNo;
/**
* 项目id
*/
@Schema(description ="项目id")
@TableField(exist = false)
private String deptId;
/**
* 项目编码
*/
@Schema(description ="项目编码")
@TableField(exist = false)
private String deptNo;
} }
...@@ -28,6 +28,7 @@ import lombok.EqualsAndHashCode; ...@@ -28,6 +28,7 @@ import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
/** /**
* 项目档案表 * 项目档案表
...@@ -222,7 +223,7 @@ public class TEmployeeProject extends BaseEntity { ...@@ -222,7 +223,7 @@ public class TEmployeeProject extends BaseEntity {
* 入职日期 * 入职日期
*/ */
@Schema(description ="入职日期") @Schema(description ="入职日期")
private LocalDateTime enjoinDate; private Date enjoinDate;
/** /**
* 试用期(单位月) * 试用期(单位月)
......
...@@ -29,6 +29,8 @@ import lombok.RequiredArgsConstructor; ...@@ -29,6 +29,8 @@ import lombok.RequiredArgsConstructor;
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.*;
import javax.validation.Valid;
/** /**
* 电子档案信息表 * 电子档案信息表
...@@ -79,7 +81,7 @@ public class TElecEmployeeInfoController { ...@@ -79,7 +81,7 @@ public class TElecEmployeeInfoController {
@SysLog("新增电子档案信息表" ) @SysLog("新增电子档案信息表" )
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('archives_telecemployeeinfo_add')" ) @PreAuthorize("@pms.hasPermission('archives_telecemployeeinfo_add')" )
public R save(@RequestBody TElecEmployeeInfo tElecEmployeeInfo) { public R save(@Valid @RequestBody TElecEmployeeInfo tElecEmployeeInfo) {
return R.ok(tElecEmployeeInfoService.save(tElecEmployeeInfo)); return R.ok(tElecEmployeeInfoService.save(tElecEmployeeInfo));
} }
......
...@@ -55,10 +55,6 @@ public class TEmpChangeInfoController { ...@@ -55,10 +55,6 @@ public class TEmpChangeInfoController {
private final TEmpChangeInfoService tEmpChangeInfoService; private final TEmpChangeInfoService tEmpChangeInfoService;
private final TCustomerInfoService tCustomerInfoService;
private final TSettleDomainService tSettleDomainService;
/** /**
* 分页查询 * 分页查询
* @param page 分页对象 * @param page 分页对象
...@@ -134,8 +130,7 @@ public class TEmpChangeInfoController { ...@@ -134,8 +130,7 @@ public class TEmpChangeInfoController {
@SysLog("获取所有项目名称" ) @SysLog("获取所有项目名称" )
@GetMapping("/getAllDept" ) @GetMapping("/getAllDept" )
public R<List<TSettleDomain>> getAllDept() { public R<List<TSettleDomain>> getAllDept() {
List<TSettleDomain> list = tSettleDomainService.list(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDeleteFlag, CommonConstants.STATUS_NORMAL)); return tEmpChangeInfoService.getAllDept();
return R.ok(list);
} }
...@@ -149,8 +144,7 @@ public class TEmpChangeInfoController { ...@@ -149,8 +144,7 @@ public class TEmpChangeInfoController {
@SysLog("获取所有单位名称" ) @SysLog("获取所有单位名称" )
@GetMapping("/getAllUint" ) @GetMapping("/getAllUint" )
public R<List<TCustomerInfo>> getAllUint() { public R<List<TCustomerInfo>> getAllUint() {
List<TCustomerInfo> list = tCustomerInfoService.list(Wrappers.<TCustomerInfo>query().lambda().eq(TCustomerInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL)); return tEmpChangeInfoService.getAllUint();
return R.ok(list);
} }
/** /**
......
...@@ -19,7 +19,9 @@ package com.yifu.cloud.plus.v1.yifu.archives.service; ...@@ -19,7 +19,9 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpChangeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpChangeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpChangeInfoVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpChangeInfoVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
...@@ -48,4 +50,20 @@ public interface TEmpChangeInfoService extends IService<TEmpChangeInfo> { ...@@ -48,4 +50,20 @@ public interface TEmpChangeInfoService extends IService<TEmpChangeInfo> {
**/ **/
R<List<ErrorMessage>> batchChangeArc(List<TEmpChangeInfoVO> excelVOList, BindingResult bindingResult); R<List<ErrorMessage>> batchChangeArc(List<TEmpChangeInfoVO> excelVOList, BindingResult bindingResult);
/**
* 获取所有项目名称
* @return R
* @Author huyc
* @Date 2022-06-22
*/
R<List<TSettleDomain>> getAllDept();
/**
* 获取所有单位名称
* @return R
* @Author huyc
* @Date 2022-06-22
*/
R<List<TCustomerInfo>> getAllUint();
} }
...@@ -20,17 +20,22 @@ import cn.hutool.core.collection.CollUtil; ...@@ -20,17 +20,22 @@ import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpChangeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpChangeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpChangeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpChangeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TCustomerInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpChangeInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpChangeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpChangeInfoVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpChangeInfoVO;
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.exception.ErrorCodes; import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
...@@ -43,9 +48,14 @@ import java.util.*; ...@@ -43,9 +48,14 @@ import java.util.*;
* @date 2022-06-18 09:39:46 * @date 2022-06-18 09:39:46
*/ */
@Service @Service
@RequiredArgsConstructor
public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, TEmpChangeInfo> implements TEmpChangeInfoService { public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, TEmpChangeInfo> implements TEmpChangeInfoService {
private TEmployeeProjectService tEmployeeProjectService; private final TEmployeeProjectService tEmployeeProjectService;
private final TCustomerInfoService tCustomerInfoService;
private final TSettleDomainService tSettleDomainService;
/** /**
* @Author huyc * @Author huyc
...@@ -67,6 +77,17 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -67,6 +77,17 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
//社保公积金派单处需要直接修改为最新的项目 //社保公积金派单处需要直接修改为最新的项目
//社保预估库、缴费库、对比库、代理差额库,需要同步修改未结算(并且满足这个条件:数据 生成月≥此处划转起始月)的数据,已结算数据不变更; //社保预估库、缴费库、对比库、代理差额库,需要同步修改未结算(并且满足这个条件:数据 生成月≥此处划转起始月)的数据,已结算数据不变更;
//划转,更新项目信息
TEmployeeProject updateTEmployeeProject = tEmployeeProjectService.getById(tEmpChangeInfo.getProId());
if (Common.isNotNull(updateTEmployeeProject)) {
updateTEmployeeProject.setDeptNo(tEmpChangeInfo.getDeptNo());
updateTEmployeeProject.setDeptId(tEmpChangeInfo.getDeptId());
updateTEmployeeProject.setDeptName(tEmpChangeInfo.getNewDept());
updateTEmployeeProject.setUnitId(tEmpChangeInfo.getUnitId());
updateTEmployeeProject.setUnitNo(tEmpChangeInfo.getUnitNo());
updateTEmployeeProject.setUnitName(tEmpChangeInfo.getNewDept());
tEmployeeProjectService.updateById(updateTEmployeeProject);
}
//保存档案划转记录 //保存档案划转记录
this.save(tEmpChangeInfo); this.save(tEmpChangeInfo);
return R.ok(); return R.ok();
...@@ -89,7 +110,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -89,7 +110,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
continue; continue;
} }
errorMsg = new HashSet<>(); errorMsg = new HashSet<>();
TEmpChangeInfoVO excel = excelVOList.get(i); TEmpChangeInfoVO excel = excelVOList.get(i);
//待划转员工已在目标结算主体下不可划转 //待划转员工已在目标结算主体下不可划转
TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda() TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
...@@ -100,7 +121,26 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -100,7 +121,26 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
} }
// 数据合法情况 // 数据合法情况
if (CollUtil.isEmpty(errorMsg)) { if (CollUtil.isEmpty(errorMsg)) {
//划转,更新项目信息
TEmployeeProject updateTEmployeePro = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,excel.getOldSettleCode())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(updateTEmployeePro)) {
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo,updateTEmployeePro.getDeptNo()).eq(TSettleDomain::getDeleteFlag,CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(tSettleDomain)) {
updateTEmployeePro.setDeptNo(tSettleDomain.getDepartNo());
updateTEmployeePro.setDeptId(tSettleDomain.getId());
updateTEmployeePro.setDeptName(tSettleDomain.getDepartName());
TCustomerInfo tCustomerInfo = tCustomerInfoService.getById(tSettleDomain.getCustomerId());
if(Common.isNotNull(tCustomerInfo)) {;
updateTEmployeePro.setUnitId(tCustomerInfo.getId());
updateTEmployeePro.setUnitNo(tCustomerInfo.getCustomerCode());
updateTEmployeePro.setUnitName(tCustomerInfo.getCustomerName());
}
tEmployeeProjectService.updateById(updateTEmployeePro);
}
}
} else { } else {
// 数据不合法 // 数据不合法
errorMessageList.add(new ErrorMessage((long) (i + 2), errorMsg)); errorMessageList.add(new ErrorMessage((long) (i + 2), errorMsg));
...@@ -111,4 +151,28 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -111,4 +151,28 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
} }
return R.ok(); return R.ok();
} }
/**
* 获取所有项目名称
* @return R
* @Author huyc
* @Date 2022-06-22
*/
@Override
public R<List<TSettleDomain>> getAllDept() {
List<TSettleDomain> list = tSettleDomainService.list(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDeleteFlag, CommonConstants.STATUS_NORMAL));
return R.ok(list);
}
/**
* 获取所有单位名称
* @return R
* @Author huyc
* @Date 2022-06-22
*/
@Override
public R<List<TCustomerInfo>> getAllUint() {
List<TCustomerInfo> list = tCustomerInfoService.list(Wrappers.<TCustomerInfo>query().lambda().eq(TCustomerInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
return R.ok(list);
}
} }
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<result property="newDept" column="NEW_DEPT"/> <result property="newDept" column="NEW_DEPT"/>
<result property="oldSettle" column="OLD_SETTLE"/> <result property="oldSettle" column="OLD_SETTLE"/>
<result property="newSettle" column="NEW_SETTLE"/> <result property="newSettle" column="NEW_SETTLE"/>
<result property="empId" column="EMP_ID"/> <result property="proId" column="PRO_ID"/>
<result property="unsettleDeal" column="UNSETTLE_DEAL"/> <result property="unsettleDeal" column="UNSETTLE_DEAL"/>
<result property="changeStartMonth" column="CHANGE_START_MONTH"/> <result property="changeStartMonth" column="CHANGE_START_MONTH"/>
<result property="createBy" column="CREATE_BY"/> <result property="createBy" column="CREATE_BY"/>
......
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