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,13 +16,42 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdcardUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
import com.fadada.api.bean.req.account.NoticeReq;
import com.fadada.api.bean.req.revise.CreateReviseTaskReq;
import com.fadada.api.bean.rsp.BaseRsp;
import com.fadada.api.bean.rsp.revise.CreateReviseTaskRsp;
import com.fadada.api.client.ReviseTaskClient;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddContractInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.utils.FddUtil;
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.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
* 法大大合同与员工合同信息
*
......@@ -31,6 +60,359 @@ import org.springframework.stereotype.Service;
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContractInfo> implements FddContractInfoService {
public static final String FILL_FILE_ID_NULL = "定稿任务id为空";
public static final String NOT_FOUND_FDD_USER = "未获取到当前登录用户对应的组织下实名法大大用户";
@Autowired
private FddUtil fddUtil;
@Autowired
private FddReqLogService reqLogService;
@Autowired
private FddContractTemplateService fddContractTemplateService;
@Autowired
private FddPersonAccountService fddPersonAccountService;
@Autowired
private FddContractTemplateFileService fddContractTemplateFileService;
@Autowired
private FddContractInfoService fddContractInfoService;
@Autowired
private FddCompanyInfoService fddCompanyInfoService;
@Autowired
private FddSealPersonAuthService fddSealPersonAuthService;
@Autowired
private FddContractAttachInfoService fddContractAttachInfoService;
// @Autowired
// private TEmployeeContractInfoService employeeContractInfoService;
@Autowired
private TEmployeeInfoService employeeInfoService;
@Autowired
private FddTemplateFieldInfoService fieldInfoService;
// 阿里云文件上传服务
@Autowired
private OSSUtil ossUtil;
// // 附件表
// @Autowired
// private TEmpAttaService empAttaService;
// // 附件-合同,关联表
// @Autowired
// private MEmpContractAttaService mempContractAttaService;
@Autowired
private TSettleDomainService tSettleDomainService;
@Override
public R<String> saveEmpContract(FddContractInfo fddContractInfo) throws ApiException {
FddContractAttachInfo fddContractAttachInfo = fddContractAttachInfoService.getById(fddContractInfo.getId());
YifuUser user = SecurityUtils.getUser();
if (!user.getId().equals(fddContractAttachInfo.getCreateBy())) {
return R.failed("当前用户不是电子合同导入用户,不能操作");
}
//法大大合同模板
TSettleDomain settleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDepartNo, fddContractAttachInfo.getDepartNo()));
if (settleDomain == null) {
return R.failed("未获取到对应的结算主体");
}
List<FddContractTemplate> fddContractTemplateList = fddContractTemplateService.list(Wrappers.<FddContractTemplate>query().lambda()
.eq(FddContractTemplate::getModifyUploadStatus, CommonConstants.dingleDigitStrArray[1])
.eq(FddContractTemplate::getFddTemplateId,fddContractAttachInfo.getFddTemplateId()));
//如果模板存在则生成法大大电子合同数据
if (fddContractTemplateList.size() == CommonConstants.ZERO_INT) {
return R.failed("未获取到有效的合同模板");
}
if (fddContractTemplateList.size() != CommonConstants.ONE_INT) {
return R.failed("法大大合同有效合同模板存在多条");
}
//校验登录用户和法大大实名用户是否名称和手机号一致
FddPersonAccount fddCompanyPersonAccount = fddPersonAccountService.getOne(Wrappers.<FddPersonAccount>query().lambda().eq(FddPersonAccount::getMoblie, user.getPhone())
.eq(FddPersonAccount::getRealStatus, CommonConstants.ONE_STRING).eq(FddPersonAccount::getSystemFlag, CommonConstants.ZERO_STRING).isNotNull(FddPersonAccount::getCompanyInfoId));
if (fddCompanyPersonAccount == null) {
return R.failed(NOT_FOUND_FDD_USER);
}
//获取员工法大大用户id
FddPersonAccount fddEmpAccount = fddPersonAccountService.getOne(Wrappers.<FddPersonAccount>query().lambda().eq(FddPersonAccount::getMoblie, fddContractAttachInfo.getEmpPhone())
.eq(FddPersonAccount::getRealStatus, CommonConstants.ONE_STRING).eq(FddPersonAccount::getSystemFlag, CommonConstants.ONE_STRING));
if (fddEmpAccount == null) {
return R.failed(NOT_FOUND_FDD_USER);
}
if (!StringUtils.equals(CommonConstants.ONE_STRING, fddEmpAccount.getRealStatus())) {
return R.failed("当前用户未实名通过");
}
//获取法大大组织
List<String> companyInfoIdList = Arrays.asList(fddCompanyPersonAccount.getCompanyInfoId().split(","));
List<FddCompanyInfo> fddCompanyInfo = fddCompanyInfoService.list(Wrappers.<FddCompanyInfo>query().lambda().in(FddCompanyInfo::getId, companyInfoIdList));
if (fddCompanyInfo == null) {
return R.failed("未获取到对应法大大组织");
}
FddContractTemplate fddContractTemplate = fddContractTemplateList.get(CommonConstants.ZERO_INT);
//获取法大大模板下附件
FddContractTemplateFile fddContractTemplateFile = fddContractTemplateFileService.getOne(Wrappers.<FddContractTemplateFile>query().lambda().eq(FddContractTemplateFile::getFddTemplateId, fddContractTemplate.getFddTemplateId()));
ReviseTaskClient reviseTaskClient = new ReviseTaskClient(fddUtil.getFadadaApiClient());
CreateReviseTaskReq req = new CreateReviseTaskReq();
req.setTemplateId(fddContractTemplate.getFddTemplateId());
req.setTaskSubject("员工合同");
req.setFinalizeWay(1);
req.setSort(1);
//定义persion角色开始
CreateReviseTaskReq.FillRoleInfo persionFillRoleInfo = new CreateReviseTaskReq.FillRoleInfo();
persionFillRoleInfo.setRoleName(FddUtil.PERSON);
NoticeReq perSionNoticeReq = new NoticeReq();
perSionNoticeReq.setNotifyWay(1);
perSionNoticeReq.setNotifyAddress(fddContractAttachInfo.getEmpPhone());
persionFillRoleInfo.setNotice(perSionNoticeReq);
persionFillRoleInfo.setUnionId(fddEmpAccount.getUnionid());
//文件参数预先填充
List<CreateReviseTaskReq.FillTemplateFileInfo> fileInfoList = new ArrayList<>();
CreateReviseTaskReq.FillTemplateFileInfo fileInfo = new CreateReviseTaskReq.FillTemplateFileInfo();
fileInfo.setFileId(fddContractTemplateFile.getFddFileId());
//员工填充数据
//FddEmployeeContractFillVo fddEmployeeContractFillVo = new FddEmployeeContractFillVo();
//fileInfo.setFormFields(JSON.toJSONString(fddEmployeeContractFillVo));
List<FddTemplateFieldInfo> personFields = fieldInfoService.getFddFields(fddContractTemplate.getFddTemplateId(),CommonConstants.ZERO_STRING);
if (Common.isNotNull(personFields)){
initPersonFields(fddContractAttachInfo,personFields);
fileInfo.setFormFields(JSON.toJSONString(personFields.stream().collect(HashMap::new, (m, v)->m.put(v.getFiledName(), v.getFieldValue()),HashMap::putAll)));
}
fileInfoList.add(fileInfo);
persionFillRoleInfo.setFillTemplateFiles(fileInfoList);
//定义persion角色结束
//定义company角色开始
CreateReviseTaskReq.FillRoleInfo companyFillRoleInfo = new CreateReviseTaskReq.FillRoleInfo();
companyFillRoleInfo.setRoleName(FddUtil.COMPANY);
NoticeReq companyionNoticeReq = new NoticeReq();
companyionNoticeReq.setNotifyWay(1);
companyionNoticeReq.setNotifyAddress(fddCompanyPersonAccount.getMoblie());
companyFillRoleInfo.setNotice(companyionNoticeReq);
companyFillRoleInfo.setUnionId(fddCompanyPersonAccount.getUnionid());
//文件参数预先填充
List<CreateReviseTaskReq.FillTemplateFileInfo> companyFileInfoList = new ArrayList<>();
CreateReviseTaskReq.FillTemplateFileInfo companyFileInfo = new CreateReviseTaskReq.FillTemplateFileInfo();
companyFileInfo.setFileId(fddContractTemplateFile.getFddFileId());
//公司填充数据
List<FddTemplateFieldInfo> compamyFields = fieldInfoService.getFddFields(fddContractTemplate.getFddTemplateId(),CommonConstants.ONE_STRING);
if (Common.isNotNull(compamyFields)){
Map<String,String> companyFieldMap = compamyFields.stream().collect(Collectors.toMap(k->k.getFiledName(), k->k.getFiledName()));
R<String> employeeParamR = generalEmployeeParamNew(fddContractAttachInfo,companyFieldMap);
if (Common.isEmpty(employeeParamR) || employeeParamR.getCode() == CommonConstants.FAIL.intValue()){
return employeeParamR;
}
companyFileInfo.setFormFields(employeeParamR.getData());
}
companyFileInfoList.add(companyFileInfo);
companyFillRoleInfo.setFillTemplateFiles(companyFileInfoList);
//定义company角色结束
//文件id
List<CreateReviseTaskReq.TemplateFileInfo> templateFileInfos = new ArrayList<>();
CreateReviseTaskReq.TemplateFileInfo templateFileInfo = new CreateReviseTaskReq.TemplateFileInfo();
templateFileInfo.setFileId(fddContractTemplateFile.getFddFileId());
templateFileInfo.setFileName("员工合同");
templateFileInfos.add(templateFileInfo);
req.setTemplateFiles(templateFileInfos);
//发送请求
List<CreateReviseTaskReq.FillRoleInfo> fillRoles = new ArrayList<>();
fillRoles.add(persionFillRoleInfo);
fillRoles.add(companyFillRoleInfo);
req.setFillRoles(fillRoles);
//设置token
req.setToken(fddUtil.getToken());
BaseRsp<CreateReviseTaskRsp> rsp = reviseTaskClient.createReviseTask(req);
//保存日志
reqLogService.saveLog(this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName(), req, rsp);
//校验参数
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
CreateReviseTaskRsp rspData = rsp.getData();
//法大大员工合同记录生成
FddContractInfo fddContractInfoNew = new FddContractInfo();
fddContractInfoNew.setContractId(fddContractAttachInfo.getContractId());
fddContractInfoNew.setFddPersonAccountSendId(fddCompanyPersonAccount.getId());
fddContractInfoNew.setFddPersonAccountReceiveId(fddEmpAccount.getId());
fddContractInfoNew.setSendUnionid(fddCompanyPersonAccount.getUnionid());
fddContractInfoNew.setReceiveUnionid(fddEmpAccount.getUnionid());
fddContractInfoNew.setFddTemplateId(fddContractTemplate.getId());
this.save(fddContractInfoNew);
fddContractInfoNew.setTaskId(rspData.getTaskId());
fddContractInfoNew.setFileId(rspData.getTaskFiles().get(CommonConstants.ZERO_INT).getFileId());
this.updateById(fddContractInfoNew);
return new R<>("创建模板定稿任务成功");
} else {
log.error("请求数据:{}",JSON.toJSONString(req));
log.error("返回数据:{}",JSON.toJSONString(rsp));
return R.failed(rsp.getMsg());
}
}
public R<String> generalEmployeeParamNew(FddContractAttachInfo attachInfo,
Map<String, String> companyFieldMap) {
JSONObject paramter = new JSONObject();
if (Common.isNotNull(companyFieldMap)){
R<String> res = getValuesOfKey(paramter,attachInfo,companyFieldMap);
if (Common.isNotNull(res) && res.getCode() == CommonConstants.FAIL.intValue()){
return res;
}
}
return new R<>(paramter.toJSONString());
}
private R<String> getValuesOfKey(JSONObject paramter,
FddContractAttachInfo attachInfo,
Map<String, String> companyFieldMap) {
if (Common.isNotNull(companyFieldMap.get("name"))){
if (StringUtils.isEmpty(attachInfo.getEmpName())) {
return R.failed("姓名为空,请去档案补充对应信息!");
}
paramter.put("name", attachInfo.getEmpName());
}
if (Common.isNotNull(companyFieldMap.get("birth"))){
Date date = IdcardUtil.getBirthDate(attachInfo.getEmpIdcard());
if (LocalDateTimeUtils.convertDateToLDT(date) == null) {
return R.failed("出生年月为空,请去档案补充对应信息!");
}
paramter.put("birth", DateUtil.format(LocalDateTimeUtils.convertDateToLDT(date), DatePattern.NORM_DATE_PATTERN));
}
//暂时档案所在地为空
if (Common.isNotNull(companyFieldMap.get("id_card"))){
if (StringUtils.isEmpty(attachInfo.getEmpIdcard())) {
return R.failed("身份证号为空,请去档案补充对应信息!");
}
paramter.put("id_card", attachInfo.getEmpIdcard());
}
if (Common.isNotNull(companyFieldMap.get("sex"))){
int sex = IdcardUtil.getGenderByIdCard(attachInfo.getEmpIdcard());
if (sex == 0) {
paramter.put("sex", "女");
} else if (sex == 1) {
paramter.put("sex", "男");
}
}
if (Common.isNotNull(companyFieldMap.get("mobile"))){
if (StringUtils.isEmpty(attachInfo.getEmpPhone())) {
return R.failed("手机号为空,请去档案补充对应信息!");
}
paramter.put("mobile", attachInfo.getEmpPhone());
}
if (Common.isNotNull(companyFieldMap.get("contractType"))){
//固定期限
paramter.put("contractType", "一");
paramter.put("fcontractStartY", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "yyyy"));
paramter.put("fcontractStartM", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "MM"));
paramter.put("fcontractStartD", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "dd"));
paramter.put("fcontractEndY", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "yyyy"));
paramter.put("fcontractEndM", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "MM"));
paramter.put("fcontractEndD", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "dd"));
if (Common.isNotNull(companyFieldMap.get("fPeriodStartY"))){
//合同起止时间填充,新签需要判断是否有试用期,试用期工资
if (attachInfo.getPeriodStart() == null) {
return R.failed("新签试用期开始时间为空");
}
paramter.put("fPeriodStartY", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "yyyy"));
paramter.put("fPeriodStartM", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "MM"));
paramter.put("fPeriodStartD", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "dd"));
}
if (Common.isNotNull(companyFieldMap.get("fPeriodEndY"))){
if (attachInfo.getPeriodEnd() == null) {
return R.failed("新签试用期结束时间为空");
}
paramter.put("fPeriodEndY", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "yyyy"));
paramter.put("fPeriodEndM", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "MM"));
paramter.put("fPeriodEndD", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "dd"));
}
if (Common.isNotNull(companyFieldMap.get("periodSalaryPerMonth"))){
if (attachInfo.getPeriodSalaryPerMonth() == null) {
return R.failed("新签试用期工资为空");
}
paramter.put("pSalaryPerMon", attachInfo.getPeriodSalaryPerMonth());
}
}
if (Common.isNotNull(companyFieldMap.get("post"))){
//工作地点和岗位填充
if (StringUtils.isEmpty(attachInfo.getPost())) {
return R.failed("员工岗位为空,请去档案补充对应信息!");
}
paramter.put("post", attachInfo.getPost());
}
if (Common.isNotNull(companyFieldMap.get("workSpace"))){
if (StringUtils.isEmpty(attachInfo.getWorkSpace())) {
return R.failed("员工工作地点为空");
}
paramter.put("workSpace", attachInfo.getWorkSpace());
}
if (Common.isNotNull(companyFieldMap.get("workingHours"))){
paramter.put("workingHours", "");
}
if (Common.isNotNull(companyFieldMap.get("salaryType"))){
//工资标准
if(StringUtils.isEmpty(attachInfo.getSalaryType())){
return R.failed("工资标准类型不能为空");
}
String salaryTypeKey = "salaryType";
if (StringUtils.equals(CommonConstants.ONE_STRING, attachInfo.getSalaryType())) {
paramter.put(salaryTypeKey, CommonConstants.ONE_STRING);
//计时工资
if (attachInfo.getSalaryStandardPerHour()==null) {
return R.failed("计时工资为空");
}
if (Common.isNotNull(companyFieldMap.get("salaryStrandPh"))){
paramter.put("salaryStrandPh", String.valueOf(attachInfo.getSalaryStandardPerHour()));
}
} else if (StringUtils.equals(CommonConstants.TWO_STRING, attachInfo.getSalaryType())) {
paramter.put(salaryTypeKey, CommonConstants.TWO_STRING);
if (attachInfo.getSalaryStandardPerPiece()==null) {
return R.failed("计件工资为空");
}
if (Common.isNotNull(companyFieldMap.get("salaryStrandPp"))){
//计月工资
paramter.put("salaryStrandPp", String.valueOf(attachInfo.getSalaryStandardPerPiece()));
}
} else if (StringUtils.equals(CommonConstants.THREE_STRING, attachInfo.getSalaryType())) {
paramter.put(salaryTypeKey, CommonConstants.THREE_STRING);
} else {
return R.failed("未知的工资标准类型");
}
}
return new R<>(paramter.toJSONString());
}
private void initPersonFields(FddContractAttachInfo fddContractAttachInfo, List<FddTemplateFieldInfo> personFields) {
if (Common.isNotNull(fddContractAttachInfo) && Common.isNotNull(personFields)){
for (FddTemplateFieldInfo field:personFields){
if (field.getFiledName().equals("empNameRecord")){
field.setFieldValue(fddContractAttachInfo.getEmpName());
}
if (field.getFiledName().equals("empSexRecord")){
int sex = IdcardUtil.getGenderByIdCard(fddContractAttachInfo.getEmpIdcard());
if (sex == 0) {
field.setFieldValue("女");
} else if (sex == 1) {
field.setFieldValue("男");
}
}
if (field.getFiledName().equals("empBirthRecord")){
Date date = IdcardUtil.getBirthDate(fddContractAttachInfo.getEmpIdcard());
if (LocalDateTimeUtils.convertDateToLDT(date) != null){
field.setFieldValue(DateUtil.format(LocalDateTimeUtils.convertDateToLDT(date), DatePattern.NORM_DATE_PATTERN));
}
}
if (field.getFiledName().equals("empIdCardRecord")){
field.setFieldValue(fddContractAttachInfo.getEmpIdcard());
}
if (field.getFiledName().equals("empMobileRecord")){
field.setFieldValue(fddContractAttachInfo.getEmpPhone());
}
}
}
}
public static Date localDate2Date(LocalDate localDate) {
if (null == localDate) {
return null;
}
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
return Date.from(zonedDateTime.toInstant());
}
}
......@@ -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="com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper">
<resultMap id="tEmployeeContrctInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo">
<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>
<sql id="Base_Column_List">
a.ID,
a.EMP_NO,
a.EMP_ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.CONTRACT_NAME,
a.CONTRACT_TYPE,
a.CONTRACT_START,
a.CONTRACT_END,
a.SUBJECT_DEPART,
a.SUBJECT_UNIT,
a.SITUATION,
a.CONTRACT_TERM,
a.CONTRACT_NO,
a.REMARK,
a.IS_OBSOLETE,
a.IS_FILE,
a.OLD_ID,
a.ENJOIN_DATE,
a.POST,
a.WORKING_HOURS,
a.FILE_CABINET_NO,
a.SETTLE_DOMAIN,
a.IN_USE,
a.OBSOLETE_REASON,
a.CUSTOMER_ID,
a.FILE_PROVINCE,
a.FILE_CITY,
a.FILE_TOWN,
a.WORKING_STATUS_SUB,
a.WORK_FLAG,
a.PERIOD_START,
a.PERIOD_END,
a.PERIOD_SALARY_PER_MONTH,
a.SALARY_TYPE,
a.SALARY_STANDARD_PER_HOUR,
a.SALARY_STANDARD_PER_PIECE,
a.DISPATCH_FLAG,
a.WARN_EMAIL_USER_ID,
a.FDD_FLAG,
a.IS_SIGN,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="tEmployeeContractInfo_where">
<if test="tEmployeeContractInfo != null">
<if test="tEmployeeContractInfo.id != null and tEmployeeContractInfo.id.trim() != ''">
AND a.ID = #{tEmployeeContractInfo.id}
</if>
<if test="tEmployeeContractInfo.empNo != null and tEmployeeContractInfo.empNo.trim() != ''">
AND a.EMP_NO = #{tEmployeeContractInfo.empNo}
</if>
<if test="tEmployeeContractInfo.empId != null and tEmployeeContractInfo.empId.trim() != ''">
AND a.EMP_ID = #{tEmployeeContractInfo.empId}
</if>
<if test="tEmployeeContractInfo.empName != null and tEmployeeContractInfo.empName.trim() != ''">
AND a.EMP_NAME = #{tEmployeeContractInfo.empName}
</if>
<if test="tEmployeeContractInfo.empIdcard != null and tEmployeeContractInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tEmployeeContractInfo.empIdcard}
</if>
<if test="tEmployeeContractInfo.contractName != null and tEmployeeContractInfo.contractName.trim() != ''">
AND a.CONTRACT_NAME = #{tEmployeeContractInfo.contractName}
</if>
<if test="tEmployeeContractInfo.contractType != null and tEmployeeContractInfo.contractType.trim() != ''">
AND a.CONTRACT_TYPE = #{tEmployeeContractInfo.contractType}
</if>
<if test="tEmployeeContractInfo.contractStart != null">
AND a.CONTRACT_START = #{tEmployeeContractInfo.contractStart}
</if>
<if test="tEmployeeContractInfo.contractEnd != null">
AND a.CONTRACT_END = #{tEmployeeContractInfo.contractEnd}
</if>
<if test="tEmployeeContractInfo.subjectDepart != null and tEmployeeContractInfo.subjectDepart.trim() != ''">
AND a.SUBJECT_DEPART = #{tEmployeeContractInfo.subjectDepart}
</if>
<if test="tEmployeeContractInfo.subjectUnit != null and tEmployeeContractInfo.subjectUnit.trim() != ''">
AND a.SUBJECT_UNIT = #{tEmployeeContractInfo.subjectUnit}
</if>
<if test="tEmployeeContractInfo.situation != null and tEmployeeContractInfo.situation.trim() != ''">
AND a.SITUATION = #{tEmployeeContractInfo.situation}
</if>
<if test="tEmployeeContractInfo.contractTerm != null">
AND a.CONTRACT_TERM = #{tEmployeeContractInfo.contractTerm}
</if>
<if test="tEmployeeContractInfo.contractNo != null and tEmployeeContractInfo.contractNo.trim() != ''">
AND a.CONTRACT_NO = #{tEmployeeContractInfo.contractNo}
</if>
<if test="tEmployeeContractInfo.remark != null and tEmployeeContractInfo.remark.trim() != ''">
AND a.REMARK = #{tEmployeeContractInfo.remark}
</if>
<if test="tEmployeeContractInfo.isObsolete != null and tEmployeeContractInfo.isObsolete.trim() != ''">
AND a.IS_OBSOLETE = #{tEmployeeContractInfo.isObsolete}
</if>
<if test="tEmployeeContractInfo.isFile != null and tEmployeeContractInfo.isFile.trim() != ''">
AND a.IS_FILE = #{tEmployeeContractInfo.isFile}
</if>
<if test="tEmployeeContractInfo.oldId != null">
AND a.OLD_ID = #{tEmployeeContractInfo.oldId}
</if>
<if test="tEmployeeContractInfo.enjoinDate != null">
AND a.ENJOIN_DATE = #{tEmployeeContractInfo.enjoinDate}
</if>
<if test="tEmployeeContractInfo.post != null and tEmployeeContractInfo.post.trim() != ''">
AND a.POST = #{tEmployeeContractInfo.post}
</if>
<if test="tEmployeeContractInfo.workingHours != null and tEmployeeContractInfo.workingHours.trim() != ''">
AND a.WORKING_HOURS = #{tEmployeeContractInfo.workingHours}
</if>
<if test="tEmployeeContractInfo.fileCabinetNo != null and tEmployeeContractInfo.fileCabinetNo.trim() != ''">
AND a.FILE_CABINET_NO = #{tEmployeeContractInfo.fileCabinetNo}
</if>
<if test="tEmployeeContractInfo.settleDomain != null and tEmployeeContractInfo.settleDomain.trim() != ''">
AND a.SETTLE_DOMAIN = #{tEmployeeContractInfo.settleDomain}
</if>
<if test="tEmployeeContractInfo.inUse != null and tEmployeeContractInfo.inUse.trim() != ''">
AND a.IN_USE = #{tEmployeeContractInfo.inUse}
</if>
<if test="tEmployeeContractInfo.obsoleteReason != null and tEmployeeContractInfo.obsoleteReason.trim() != ''">
AND a.OBSOLETE_REASON = #{tEmployeeContractInfo.obsoleteReason}
</if>
<if test="tEmployeeContractInfo.customerId != null and tEmployeeContractInfo.customerId.trim() != ''">
AND a.CUSTOMER_ID = #{tEmployeeContractInfo.customerId}
</if>
<if test="tEmployeeContractInfo.fileProvince != null">
AND a.FILE_PROVINCE = #{tEmployeeContractInfo.fileProvince}
</if>
<if test="tEmployeeContractInfo.fileCity != null">
AND a.FILE_CITY = #{tEmployeeContractInfo.fileCity}
</if>
<if test="tEmployeeContractInfo.fileTown != null">
AND a.FILE_TOWN = #{tEmployeeContractInfo.fileTown}
</if>
<if test="tEmployeeContractInfo.workingStatusSub != null and tEmployeeContractInfo.workingStatusSub.trim() != ''">
AND a.WORKING_STATUS_SUB = #{tEmployeeContractInfo.workingStatusSub}
</if>
<if test="tEmployeeContractInfo.workFlag != null and tEmployeeContractInfo.workFlag.trim() != ''">
AND a.WORK_FLAG = #{tEmployeeContractInfo.workFlag}
</if>
<if test="tEmployeeContractInfo.periodStart != null">
AND a.PERIOD_START = #{tEmployeeContractInfo.periodStart}
</if>
<if test="tEmployeeContractInfo.periodEnd != null">
AND a.PERIOD_END = #{tEmployeeContractInfo.periodEnd}
</if>
<if test="tEmployeeContractInfo.periodSalaryPerMonth != null">
AND a.PERIOD_SALARY_PER_MONTH = #{tEmployeeContractInfo.periodSalaryPerMonth}
</if>
<if test="tEmployeeContractInfo.salaryType != null and tEmployeeContractInfo.salaryType.trim() != ''">
AND a.SALARY_TYPE = #{tEmployeeContractInfo.salaryType}
</if>
<if test="tEmployeeContractInfo.salaryStandardPerHour != null">
AND a.SALARY_STANDARD_PER_HOUR = #{tEmployeeContractInfo.salaryStandardPerHour}
</if>
<if test="tEmployeeContractInfo.salaryStandardPerPiece != null">
AND a.SALARY_STANDARD_PER_PIECE = #{tEmployeeContractInfo.salaryStandardPerPiece}
</if>
<if test="tEmployeeContractInfo.dispatchFlag != null and tEmployeeContractInfo.dispatchFlag.trim() != ''">
AND a.DISPATCH_FLAG = #{tEmployeeContractInfo.dispatchFlag}
</if>
<if test="tEmployeeContractInfo.warnEmailUserId != null and tEmployeeContractInfo.warnEmailUserId.trim() != ''">
AND a.WARN_EMAIL_USER_ID = #{tEmployeeContractInfo.warnEmailUserId}
</if>
<if test="tEmployeeContractInfo.fddFlag != null and tEmployeeContractInfo.fddFlag.trim() != ''">
AND a.FDD_FLAG = #{tEmployeeContractInfo.fddFlag}
</if>
<if test="tEmployeeContractInfo.isSign != null">
AND a.IS_SIGN = #{tEmployeeContractInfo.isSign}
</if>
<if test="tEmployeeContractInfo.createBy != null and tEmployeeContractInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{tEmployeeContractInfo.createBy}
</if>
<if test="tEmployeeContractInfo.createName != null and tEmployeeContractInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tEmployeeContractInfo.createName}
</if>
<if test="tEmployeeContractInfo.createTime != null">
AND a.CREATE_TIME = #{tEmployeeContractInfo.createTime}
</if>
<if test="tEmployeeContractInfo.updateBy != null and tEmployeeContractInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tEmployeeContractInfo.updateBy}
</if>
<if test="tEmployeeContractInfo.updateTime != null">
AND a.UPDATE_TIME = #{tEmployeeContractInfo.updateTime}
</if>
</if>
</sql>
<!--tEmployeeContractInfo简单分页查询-->
<select id="getTEmployeeContractInfoPage" resultMap="tEmployeeContrctInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_contract_info a
<where>
1=1
<include refid="tEmployeeContractInfo_where"/>
</where>
</select>
</mapper>
<?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