Commit 904b9763 authored by fangxinjiang's avatar fangxinjiang

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

parents 95fcdb28 a50b64be
......@@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
......@@ -55,25 +56,25 @@ public class FddContractAttachInfo extends BaseEntity {
* 合同试用期开始时间
*/
@Schema(description ="合同试用期开始时间")
private LocalDateTime periodStart;
private LocalDate periodStart;
/**
* 合同试用期结束时间
*/
@Schema(description ="合同试用期结束时间")
private LocalDateTime periodEnd;
private LocalDate periodEnd;
/**
* 合同起始时间
*/
@Schema(description ="合同起始时间")
private LocalDateTime contractStart;
private LocalDate contractStart;
/**
* 合同到期时间
*/
@Schema(description ="合同到期时间")
private LocalDateTime contractEnd;
private LocalDate contractEnd;
/**
* 试用期工资 元/月
......
......@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
......@@ -61,5 +62,10 @@ public class FddTemplateFieldInfo extends BaseEntity {
@Schema(description ="模板ID")
private String templateId;
/**
* 对应法大大模板字段值
*/
@Schema(description ="对应法大大模板字段值")
@TableField(exist = false)
private String fieldValue;
}
......@@ -37,7 +37,7 @@ import java.time.LocalDateTime;
@TableName("t_employee_contract_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "员工合同")
public class TEmployeeContrctInfo extends BaseEntity {
public class TEmployeeContractInfo extends BaseEntity {
/**
* 主键
......
......@@ -67,6 +67,11 @@
<version>1.8.0</version>
<artifactId>fadada-java-sdk-api3</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<version>5.8.0</version>
<artifactId>hutool-all</artifactId>
</dependency>
</dependencies>
<build>
......
......@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddContractInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -111,4 +112,17 @@ public class FddContractInfoController {
return R.ok(fddContractInfoService.removeById(id));
}
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description: 发送法大大电子合同定稿任务
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation(summary = "发送法大大电子合同定稿任务", description = "发送法大大电子合同定稿任务")
@SysLog("发送法大大电子合同定稿任务" )
@PostMapping("/send")
public R<String> send(FddContractInfo fddContractInfo) throws ApiException {
return fddContractInfoService.saveEmpContract(fddContractInfo);
}
}
......@@ -19,8 +19,8 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContrctInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContrctInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
......@@ -43,22 +43,22 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/temployeecontrctinfo")
@Tag(name = "员工合同管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TEmployeeContrctInfoController {
public class TEmployeeContractInfoController {
private final TEmployeeContrctInfoService tEmployeeContrctInfoService;
private final TEmployeeContractInfoService tEmployeeContractInfoService;
/**
* 分页查询
*
* @param page 分页对象
* @param tEmployeeContrctInfo 员工合同
* @param tEmployeeContractInfo 员工合同
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('contract_temployeecontrctinfo_get')")
public R getTEmployeeContrctInfoPage(Page page, TEmployeeContrctInfo tEmployeeContrctInfo) {
return R.ok(tEmployeeContrctInfoService.page(page, Wrappers.query(tEmployeeContrctInfo)));
public R getTEmployeeContrctInfoPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo) {
return new R<>(tEmployeeContractInfoService.getTEmployeeContractInfoPage(page,tEmployeeContractInfo));
}
......@@ -72,35 +72,35 @@ public class TEmployeeContrctInfoController {
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('contract_temployeecontrctinfo_get')")
public R getById(@PathVariable("id") String id) {
return R.ok(tEmployeeContrctInfoService.getById(id));
return R.ok(tEmployeeContractInfoService.getById(id));
}
/**
* 新增员工合同
*
* @param tEmployeeContrctInfo 员工合同
* @param tEmployeeContractInfo 员工合同
* @return R
*/
@Operation(summary = "新增员工合同", description = "新增员工合同:hasPermission('contract_temployeecontrctinfo_add')")
@SysLog("新增员工合同")
@PostMapping
@PreAuthorize("@pms.hasPermission('contract_temployeecontrctinfo_add')")
public R save(@RequestBody TEmployeeContrctInfo tEmployeeContrctInfo) {
return R.ok(tEmployeeContrctInfoService.save(tEmployeeContrctInfo));
public R save(@RequestBody TEmployeeContractInfo tEmployeeContractInfo) {
return R.ok(tEmployeeContractInfoService.save(tEmployeeContractInfo));
}
/**
* 修改员工合同
*
* @param tEmployeeContrctInfo 员工合同
* @param tEmployeeContractInfo 员工合同
* @return R
*/
@Operation(summary = "修改员工合同", description = "修改员工合同:hasPermission('contract_temployeecontrctinfo_edit')")
@SysLog("修改员工合同")
@PutMapping
@PreAuthorize("@pms.hasPermission('contract_temployeecontrctinfo_edit')")
public R updateById(@RequestBody TEmployeeContrctInfo tEmployeeContrctInfo) {
return R.ok(tEmployeeContrctInfoService.updateById(tEmployeeContrctInfo));
public R updateById(@RequestBody TEmployeeContractInfo tEmployeeContractInfo) {
return R.ok(tEmployeeContractInfoService.updateById(tEmployeeContractInfo));
}
/**
......@@ -114,7 +114,7 @@ public class TEmployeeContrctInfoController {
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('contract_temployeecontrctinfo_del')")
public R removeById(@PathVariable String id) {
return R.ok(tEmployeeContrctInfoService.removeById(id));
return R.ok(tEmployeeContractInfoService.removeById(id));
}
}
......@@ -233,9 +233,9 @@ public class TEmployeeInfoController {
* @Date: 2022/6/21 19:42
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "通过ids批量删除人员档案表", description = "通过ids批量删除人员档案表")
@SysLog("通过ids批量删除人员档案表")
@GetMapping("/batchDeleteEmployee")
@Operation(summary = "通过idList批量删除人员档案表", description = "通过ids批量删除人员档案表")
@SysLog("通过idList批量删除人员档案表")
@PostMapping("/batchDeleteEmployee")
@PreAuthorize("@pms.hasPermission('temployeeinfo_batch_del')")
public R<List<ErrorMessageVO>> batchDeleteEmployee(@RequestBody List<String> idList) {
return tEmployeeInfoService.batchDeleteEmployee(idList);
......@@ -248,7 +248,7 @@ public class TEmployeeInfoController {
* @Date: 2022/6/21 19:42
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "通过id减档人员档案表", description = "通过id减档人员档案表")
@Operation(summary = "通过id减档人员档案表temployeeinfo_minus", description = "通过id减档人员档案表")
@SysLog("通过id减档人员档案表")
@GetMapping("/minusEmployee")
@PreAuthorize("@pms.hasPermission('temployeeinfo_minus')")
......@@ -263,9 +263,9 @@ public class TEmployeeInfoController {
* @Date: 2022/6/21 19:42
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "批量减档人员档案表", description = "批量减档人员档案表")
@Operation(summary = "批量减档人员档案表temployeeinfo_batch_minus", description = "批量减档人员档案表")
@SysLog("批量减档人员档案表")
@GetMapping("/batchMinusEmployee")
@PostMapping("/batchMinusEmployee")
@PreAuthorize("@pms.hasPermission('temployeeinfo_batch_minus')")
public R<List<ErrorMessageVO>> batchMinusEmployee(@RequestExcel List<EmployeeLeaveVO> excelList, BindingResult bindingResult) {
return tEmployeeInfoService.batchMinusEmployee(excelList, bindingResult);
......
......@@ -81,7 +81,6 @@ public class TEmployeeProjectController {
return R.ok(tEmployeeProjectService.getTEmployeeProjectInfoPage(page,tEmployeeProject));
}
/**
* 通过id查询项目档案表
* @param id id
......@@ -176,6 +175,21 @@ public class TEmployeeProjectController {
return R.ok(tEmployeeProjectService.deleteEmpPro(tEmployeeProject));
}
/**
* 减项
* @param excelVOList
* @param bindingResult
* @Author huyc
* @Date 2022-06-20
*/
@Operation(summary = "批量减项", description = "批量减项")
@SysLog("批量减项" )
@PostMapping("/batchDeleteEmpPro")
@PreAuthorize("@pms.hasPermission('archives_temployeeproject_batchdelempproinfo')" )
public R<List<ErrorMessage>> batchDeleteEmpPro(@RequestExcel List<EmployeeProjectVO> excelVOList, BindingResult bindingResult) {
return tEmployeeProjectService.batchDeleteEmpPro(excelVOList,bindingResult);
}
/**
* 批量新增项目档案信息
*
......
......@@ -18,8 +18,11 @@
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContrctInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 员工合同
......@@ -28,6 +31,14 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2022-06-29 20:45:22
*/
@Mapper
public interface TEmployeeContrctInfoMapper extends BaseMapper<TEmployeeContrctInfo> {
public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContractInfo> {
/**
* 员工合同信息表简单分页查询
*
* @param tEmployeeContractInfo 员工合同信息表
* @return
*/
IPage<TEmployeeContractInfo> getTEmployeeContractInfoPage(Page<TEmployeeContractInfo> page, @Param("tEmployeeContractInfo") TEmployeeContractInfo tEmployeeContractInfo);
}
......@@ -19,7 +19,9 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/**
* 法大大合同与员工合同信息
......@@ -29,4 +31,5 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
*/
public interface FddContractInfoService extends IService<FddContractInfo> {
R<String> saveEmpContract(FddContractInfo fddContractInfo) throws ApiException;
}
......@@ -21,6 +21,8 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo;
import java.util.List;
/**
* 法大大字段对应信息表
*
......@@ -28,5 +30,6 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo;
* @date 2022-06-28 16:24:12
*/
public interface FddTemplateFieldInfoService extends IService<FddTemplateFieldInfo> {
List<FddTemplateFieldInfo> getFddFields(String templateId, String type);
}
......@@ -17,8 +17,10 @@
package com.yifu.cloud.plus.v1.yifu.archives.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.archives.entity.TEmployeeContrctInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
/**
* 员工合同
......@@ -26,6 +28,14 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContrctInfo;
* @author hgw
* @date 2022-06-29 20:45:22
*/
public interface TEmployeeContrctInfoService extends IService<TEmployeeContrctInfo> {
public interface TEmployeeContractInfoService extends IService<TEmployeeContractInfo> {
/**
* 员工合同信息表简单分页查询
*
* @param tEmployeeContractInfo 员工合同信息表
* @return
*/
IPage<TEmployeeContractInfo> getTEmployeeContractInfoPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo);
}
......@@ -45,8 +45,24 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
R reEmpInfo(JSONObject jsonObject);
/**
* @param tEmployeeProject
* @Description: 减项
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R deleteEmpPro(TEmployeeProject tEmployeeProject);
/**
* @param list
* @Description: 批量减项
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R<List<ErrorMessage>> batchDeleteEmpPro(List<EmployeeProjectVO> list, BindingResult bindingResult);
/**
* @param excelVOList
* @param bindingResult
......@@ -91,7 +107,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
/**
* @param ids
* @Description: 批量删除项目档案
* @Author: hgw
* @Author: huyc
* @Date: 2022/6/22 12:30
* @return: R
**/
......
......@@ -16,6 +16,7 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddTemplateFieldInfoMapper;
......@@ -23,6 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.FddTemplateFieldInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 法大大字段对应信息表
*
......@@ -33,4 +36,17 @@ import org.springframework.stereotype.Service;
@RequiredArgsConstructor
public class FddTemplateFieldInfoServiceImpl extends ServiceImpl<FddTemplateFieldInfoMapper, FddTemplateFieldInfo> implements FddTemplateFieldInfoService {
/**
* @ClassName: com.yifu.cloud.v1.hr.basicArchives.service.impl.FddTemplateFieldInfoServiceImpl.java
* @author huyc
* @date 2022/6/30
* @Description 按模板和角色获取具体字段参数
* @param templateId: 模板ID type:0 个人角色 1 公司角色
*/
@Override
public List<FddTemplateFieldInfo> getFddFields(String templateId, String type) {
return baseMapper.selectList(Wrappers.<FddTemplateFieldInfo>query().lambda()
.eq(FddTemplateFieldInfo::getType,type)
.eq(FddTemplateFieldInfo::getTemplateId,templateId));
}
}
......@@ -16,10 +16,12 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.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.TEmployeeContrctInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContrctInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContrctInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService;
import org.springframework.stereotype.Service;
/**
......@@ -29,6 +31,15 @@ import org.springframework.stereotype.Service;
* @date 2022-06-29 20:45:22
*/
@Service
public class TEmployeeContrctInfoServiceImpl extends ServiceImpl<TEmployeeContrctInfoMapper, TEmployeeContrctInfo> implements TEmployeeContrctInfoService {
public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContractInfoMapper, TEmployeeContractInfo> implements TEmployeeContractInfoService {
/**
* 员工合同信息表简单分页查询
*
* @param tEmployeeContractInfo 员工合同信息表
* @return
*/
@Override
public IPage<TEmployeeContractInfo> getTEmployeeContractInfoPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo) {
return baseMapper.getTEmployeeContractInfoPage(page, tEmployeeContractInfo);
}
}
......@@ -587,23 +587,27 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return null;
}
private R<TEmployeeInfo> checkEmployeeVOR(EmployeeVO employeeInfo) {
private void checkEmployeeVOR(long lineNum, EmployeeVO employeeInfo, Map<Long, ErrorMessage> errorMsgMap, Set<String> errorMsg) {
if (Common.isEmpty(employeeInfo.getEmpIdcard())) {
return R.failed("员工身份证必填!");
errorMsg.add("员工身份证必填!");
errorMsgMap.put(lineNum, new ErrorMessage("员工身份证必填!"));
}
if (Common.isEmpty(employeeInfo.getDeptNo())) {
return R.failed("项目编码必填!");
errorMsg.add("项目编码必填!");
errorMsgMap.put(lineNum, new ErrorMessage("项目编码必填!"));
}
if (Common.isEmpty(employeeInfo.getEmpName())) {
return R.failed("员工姓名必填!");
errorMsg.add("员工姓名必填!");
errorMsgMap.put(lineNum, new ErrorMessage("员工姓名必填!"));
}
if (Common.isEmpty(employeeInfo.getEmpPhone())) {
return R.failed("手机号必填!");
errorMsg.add("手机号必填!");
errorMsgMap.put(lineNum, new ErrorMessage("手机号必填!"));
}
if (Common.isEmpty(employeeInfo.getEmpNatrue())) {
return R.failed("员工类型必填!");
errorMsg.add("员工类型必填!");
errorMsgMap.put(lineNum, new ErrorMessage("员工类型必填!"));
}
return null;
}
@Override
......@@ -629,26 +633,35 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
List<String> phoneList = new ArrayList<>();
Map<String, Integer> idCardMap = new HashMap<>();
String idCard;
ErrorMessage errorMessage;
// 个性化校验逻辑
Set<String> errorMsg;
for (int i = 0; i < excelVOList.size(); i++) {
errorMsg = new HashSet<>();
// 判空
R<TEmployeeInfo> failed = this.checkEmployeeVOR(excelVOList.get(i));
if (failed != null) errorMsgMap.put((i + 2L), new ErrorMessage(failed.getMsg()));
this.checkEmployeeVOR((i+2L), excelVOList.get(i), errorMsgMap, errorMsg);
idCard = excelVOList.get(i).getEmpIdcard();
if (Common.isEmpty(idCard)) {
errorMsg.add("第" + (i + 2) + "行身份证号为空!");
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行身份证号为空!"));
} else {
if (idCardMap.get(idCard) != null) {
errorMsg.add("第" + (i + 2) + "行身份证号与第" + idCardMap.get(idCard) + "行重复!");
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行身份证号与第" + idCardMap.get(idCard) + "行重复!"));
} else {
idCardMap.put(idCard, i + 2);
idCardList.add(idCard);
}
}
if (Common.isEmpty(excelVOList.get(i).getEmpPhone())) {
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行手机号码为空!"));
} else {
if (Common.isNotNull(excelVOList.get(i).getEmpPhone())) {
phoneList.add(excelVOList.get(i).getEmpPhone());
}
// 数据合法情况
if (!CollUtil.isEmpty(errorMsg)) {
// 数据不合法
errorMessageList.add(new ErrorMessage((i + 2L), errorMsg));
}
}
// 查找档案库
Map<String, TEmployeeInfo> existEmpMap = new HashMap<>();
......@@ -666,8 +679,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
}
// 个性化校验逻辑
Set<String> errorMsg;
EmployeeVO excel;
// 已存在的档案信息
TEmployeeInfo existEmp;
......
......@@ -189,7 +189,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeProject::getEmpId,tEmployeeProject.getEmpId())
.eq(TEmployeeProject::getProjectStatus,CommonConstants.dingleDigitIntArray[0]));
if (count.compareTo(CommonConstants.DEPT_TREE_ROOT_ID) >0) {
return R.failed("该人员存在其他进行中的项目,禁止同步减档!");
return R.failed("人员在该项目下存在进行中/未完结的服务");
}
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
......@@ -203,6 +203,60 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return R.failed("传参为空!");
}
@Override
public R<List<ErrorMessage>> batchDeleteEmpPro(List<EmployeeProjectVO> excelVOList, BindingResult bindingResult) {
// 通用校验获取失败的数据
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
Map<Long,ErrorMessage> errorMsgMap = new HashMap<>();
if (Common.isNotNull(errorMessageList)){
errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(),errorMessage));
}
// 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) {
EmployeeProjectVO excel = excelVOList.get(i);
Set<String> errorMsg = new HashSet<>();
// 已有验证报错直接下一个
if (Common.isNotNull(errorMsgMap.get(i + 2))) {
continue;
}
//根据身份证和项目编码获取项目档案
TEmployeeProject tEmployeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard())
.eq(TEmployeeProject::getDeptNo, excel.getDeptNo())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL));
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
TEmployeeProject tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
if (Common.isNotNull(tEmployeeProject)) {
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
if (tEmployeeProject.getIsLeaveEmployee() == CommonConstants.dingleDigitIntArray[1]) {
Long count = this.count(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpId, tEmployeeProject.getEmpId())
.eq(TEmployeeProject::getProjectStatus, CommonConstants.dingleDigitIntArray[0]));
if (count.compareTo(CommonConstants.DEPT_TREE_ROOT_ID) > 0) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_CHANGE_NOT_EXIST));
}
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
}
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]);
this.updateById(tEmployeeProject);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(), "", tEmployeeProjectOld, tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProject.getId(), tEmployeeInfoOld, tEmployeeProject);
}
if (!CollUtil.isEmpty(errorMsg)) {
errorMessageList.add(new ErrorMessage((long) (i + 2), errorMsg));
}
}
if (CollUtil.isNotEmpty(errorMessageList)) {
return R.failed(errorMessageList);
}
return R.ok();
}
/**
* 新增档案操作记录
* @param excelVOList
......@@ -228,6 +282,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 获取身份证、手机号列表,批量查询档案
Map<String, Integer> idCardMap = new HashMap<>();
String idCard;
String deptNo;
// 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) {
......@@ -240,10 +295,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
idCard = excel.getEmpIdcard();
if (idCardMap.get(idCard) != null) {
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行身份证号与第" + idCardMap.get(idCard) + "行重复!"));
deptNo = excel.getDeptNo();
if (idCardMap.get(idCard.concat(deptNo)) != null) {
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行身份证号+项目编码与第" + idCardMap.get(idCard) + "行重复!"));
} else {
idCardMap.put(idCard, i + 2);
idCardMap.put(idCard.concat(deptNo), i + 2);
}
//根据身份证获取人员档案
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="archives.contract.mapper.TEmployeeContrctInfoMapper">
<resultMap id="tEmployeeContrctInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContrctInfo">
<id property="id" column="ID"/>
<result property="empNo" column="EMP_NO"/>
<result property="empId" column="EMP_ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="contractName" column="CONTRACT_NAME"/>
<result property="contractType" column="CONTRACT_TYPE"/>
<result property="contractStart" column="CONTRACT_START"/>
<result property="contractEnd" column="CONTRACT_END"/>
<result property="subjectDepart" column="SUBJECT_DEPART"/>
<result property="subjectUnit" column="SUBJECT_UNIT"/>
<result property="situation" column="SITUATION"/>
<result property="contractTerm" column="CONTRACT_TERM"/>
<result property="contractNo" column="CONTRACT_NO"/>
<result property="remark" column="REMARK"/>
<result property="isObsolete" column="IS_OBSOLETE"/>
<result property="isFile" column="IS_FILE"/>
<result property="oldId" column="OLD_ID"/>
<result property="enjoinDate" column="ENJOIN_DATE"/>
<result property="post" column="POST"/>
<result property="workingHours" column="WORKING_HOURS"/>
<result property="fileCabinetNo" column="FILE_CABINET_NO"/>
<result property="settleDomain" column="SETTLE_DOMAIN"/>
<result property="inUse" column="IN_USE"/>
<result property="obsoleteReason" column="OBSOLETE_REASON"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="fileProvince" column="FILE_PROVINCE"/>
<result property="fileCity" column="FILE_CITY"/>
<result property="fileTown" column="FILE_TOWN"/>
<result property="workingStatusSub" column="WORKING_STATUS_SUB"/>
<result property="workFlag" column="WORK_FLAG"/>
<result property="periodStart" column="PERIOD_START"/>
<result property="periodEnd" column="PERIOD_END"/>
<result property="periodSalaryPerMonth" column="PERIOD_SALARY_PER_MONTH"/>
<result property="salaryType" column="SALARY_TYPE"/>
<result property="salaryStandardPerHour" column="SALARY_STANDARD_PER_HOUR"/>
<result property="salaryStandardPerPiece" column="SALARY_STANDARD_PER_PIECE"/>
<result property="dispatchFlag" column="DISPATCH_FLAG"/>
<result property="warnEmailUserId" column="WARN_EMAIL_USER_ID"/>
<result property="fddFlag" column="FDD_FLAG"/>
<result property="isSign" column="IS_SIGN"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
</mapper>
......@@ -283,4 +283,8 @@ public interface ErrorCodes {
* 对应项目编码无项目档案信息,请核实后导入
*/
String ARCHIVES_PROJECT_EMP_NOT_EXIST = "archives.project.emp.not.exist";
/**
* 人员在该项目下存在进行中/未完结的服务
*/
String ARCHIVES_PROJECT_CHANGE_NOT_EXIST = "archives.project.change.not.exist";
}
......@@ -87,6 +87,7 @@ import.file.type.error=\u5BFC\u5165\u7684\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u7
archives.project.emp.not.exist=\u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u65E0\u9879\u76EE\u6863\u6848\u4FE1\u606F\uFF0C\u8BF7\u6838\u5B9E\u540E\u5BFC\u5165
archives.project.change.not.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0B\u5B58\u5728\u8FDB\u884C\u4E2D/\u672A\u5B8C\u7ED3\u7684\u670D\u52A1
......
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