Commit 4ffc5926 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.7.16' into MVP1.7.16

parents 43adeaa1 3deae139
......@@ -58,8 +58,8 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "合同类型,标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同")
private String contractType;
@ExcelAttribute(name = "签署方式", isDataId = true, readConverterExp = "0=待确认,1=待发起,2=线下签待审核,3=线下签审核不通过4=线下签待归档5=发起失败6=签署中7=签署失败8=电子待归档9=已完结10=撤销签署")
@Schema(description = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9已完结10撤销签署")
@ExcelAttribute(name = "签署方式", isDataId = true, readConverterExp = "0=待确认,1=待发起,2=线下签待审核,3=线下签审核不通过,4=线下签待归档,5=发起失败,6=签署中,7=签署失败,8=电子待归档,9=已完结,10=撤销签署-客服撤销,11=撤销签署-系统自动撤销")
@Schema(description = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9已完结10撤销签署-客服撤销 11 撤销签署-系统自动撤销")
private String processStatus;
@Schema(description = "签署甲方")
......
......@@ -68,5 +68,21 @@ public class TFascHrField {
@ExcelProperty("合同类型")
@Schema(description = "合同类型")
private String contractType;
/**
* 字段类型
*/
@ExcelAttribute(name = "字段类型", maxLength = 10)
@Length(max = 10, message = "字段类型不能超过10个字符")
@ExcelProperty("字段类型")
@Schema(description = "字段类型")
private String fieldType;
/**
* 字段格式化或键值对
*/
@ExcelAttribute(name = "字段格式化或键值对", maxLength = 30)
@Length(max = 30, message = "字段格式化或键值对不能超过30个字符")
@ExcelProperty("字段格式化或键值对")
@Schema(description = "字段格式化或键值对")
private String fieldValue;
}
......@@ -141,4 +141,17 @@ public class TFascTemplateDetail extends BaseEntity {
@Schema(description = "合同类型是否配置")
private String haveContractType;
/**
* 字段类型
*/
@TableField(exist = false)
@Schema(description = "字段类型")
private String fieldType;
/**
* 字段格式化或键值对
*/
@TableField(exist = false)
@Schema(description = "字段格式化或键值对")
private String fieldValue;
}
......@@ -86,6 +86,59 @@ public class IdCardUtil {
}
return date;
}
/**
* 提取身份证中的出生日期,身份证非法则返回空
* @param idNum
* @return
*/
public static String getBirthdateByPatten(String idNum, String patten){
Pattern idNumPattern = null;
Matcher idNumMatcher = null;
String returnDateStr = null;
//定义判别用户身份证号的正则表达式(要么是15位,要么是18位,最后一位可以为字母)
idNumPattern = compile("(\\d{14}[0-9a-zA-Z])|(\\d{17}[0-9a-zA-Z])");
//通过Pattern获得Matcher
idNumMatcher = idNumPattern.matcher(idNum);
//判断用户输入是否为身份证号
if(idNumMatcher.matches()){
Pattern birthDatePattern =null;
Matcher birthDateMather = null;
String year = null;
if(idNum.length()==18){
//如果是,定义正则表达式提取出身份证中的出生日期
birthDatePattern= compile("\\d{6}(\\d{4})(\\d{2})(\\d{2}).*");//身份证上的前6位以及出生年月日
//通过Pattern获得Matcher
birthDateMather= birthDatePattern.matcher(idNum);
}else if(idNum.length()==15){
//如果是,定义正则表达式提取出身份证中的出生日期
birthDatePattern= compile("\\d{6}(\\d{2})(\\d{2})(\\d{2}).*");//身份证上的前6位以及出生年月日
//通过Pattern获得Matcher
birthDateMather= birthDatePattern.matcher(idNum);
}
//通过Matcher获得用户的出生年月日
if(null != birthDateMather && birthDateMather.find()){
if(idNum.length()==18){
year = birthDateMather.group(1);
}else if(idNum.length()==15){
year = "19"+birthDateMather.group(1);
}
String month = birthDateMather.group(2);
String datetemp = birthDateMather.group(3);
String dateStr =year+"-"+month+"-"+datetemp;
SimpleDateFormat sdfInput = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdfOut = new SimpleDateFormat( patten );
try {
Date shijian =sdfInput.parse(dateStr);
returnDateStr = sdfOut.format(shijian);
} catch (ParseException e) {
//数据有误
}
}
}
return returnDateStr;
}
/**
* 获取身份证的性别
* @Author fxj
......
......@@ -204,7 +204,7 @@ public class FascController {
TEmployeeContractPre pre = tEmployeeContractPreService.getOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRequestId, signTaskId).last(CommonConstants.LAST_ONE_SQL));
YifuUser user = getNewYifuUser();
if (pre != null) {
if (pre != null && Common.isNotNull(pre.getProcessStatus()) && !pre.getProcessStatus().equals(CommonConstants.dingleDigitStrArray[9])) {
TEmployeeContractInfo contractInfo = null;
if (Common.isNotNull(pre.getContractId())) {
//如果存在合同申请审核数据,将状态更新成待提交
......
......@@ -43,6 +43,8 @@ public interface TFascTemplateDetailMapper extends BaseMapper<TFascTemplateDetai
*/
IPage<TFascTemplateDetail> getTFascTemplateDetailPage(Page<TFascTemplateDetail> page, @Param("tFascTemplateDetail") TFascTemplateDetail tFascTemplateDetail);
List<TFascTemplateDetail> getTDetailListByFieldType(@Param("fadadaTemplateId") String fadadaTemplateId);
List<TFascTemplateDetail> getTFascTemplateDetailList(@Param("tFascTemplateDetail") TFascTemplateDetail tFascTemplateDetail);
List<TFascTemplateDetailExportVo> getTFascTemplateDetailExport(@Param("tFascTemplateDetail") TFascTemplateDetailSearchVo tFascTemplateDetail, @Param("idList") List<String> idList);
......
......@@ -43,6 +43,8 @@ public interface TFascTemplateDetailService extends IService<TFascTemplateDetail
IPage<TFascTemplateDetail> getTFascTemplateDetailPage(Page<TFascTemplateDetail> page, TFascTemplateDetailSearchVo tFascTemplateDetail);
// 获取列表
List<TFascTemplateDetail> getTDetailListByFieldType(String fadadaTemplateId);
List<TFascTemplateDetail> getTFascTemplateDetailList(TFascTemplateDetail tFascTemplateDetail);
R<List<ErrorMessage>> batchUpdateFascDetail(InputStream inputStream);
......
......@@ -1558,9 +1558,18 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
.eq(TEmployeeContractPre::getRegisterId, id)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contract)) {
//特殊状态处理
if (Common.isNotNull(contract.getChangeTypeReason())) {
contract.setSignType(CommonConstants.ZERO_STRING);
}
//附件赋值
List<TAttaInfo> attaContractInfo = attaInfoService.list(Wrappers.<TAttaInfo>query().lambda()
.eq(TAttaInfo::getDomainId, contract.getId()));
if (Common.isNotNull(contract.getSignType()) && CommonConstants.ZERO_STRING.equals(contract.getSignType())
&& Common.isNotNull(contract.getContractId())) {
attaContractInfo = attaInfoService.list(Wrappers.<TAttaInfo>query().lambda()
.eq(TAttaInfo::getDomainId, contract.getContractId()));
}
// 如果附件信息非空,则为每个附件生成可访问的URL,并将其添加到员工注册信息中
if (attaContractInfo != null && !attaContractInfo.isEmpty()) {
URL url;
......
......@@ -244,9 +244,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
} else if (!"valid".equals(tFascTemplate.getSignTemplateStatus())) {
return R.failed("法大大模版状态不是“启用”,不可发起电子签署");
}
TFascTemplateDetail detail = new TFascTemplateDetail();
detail.setSignTemplateId(contract.getFadadaTemplateId());
List<TFascTemplateDetail> detailList = tFascTemplateDetailService.getTFascTemplateDetailList(detail);
List<TFascTemplateDetail> detailList = tFascTemplateDetailService.getTDetailListByFieldType(contract.getFadadaTemplateId());
// - 判断是否入职超过1个月——接口入口做了
TFascCompany company = tFascCompanyService.getById(tFascTemplate.getCompanyId());
......
......@@ -542,7 +542,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(tEmployeeContractInfo.getPreId())) {
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getId, tEmployeeContractInfo.getPreId())
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus)
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.contractDIsStatus)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
//合同状态初始为签署中
......
......@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasc.open.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
......@@ -83,7 +84,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
//权限赋值
initSearchVo(tEmployeeContractPre);
if (Common.isEmpty(tEmployeeContractPre.getProcessStatus()) && Common.isEmpty(tEmployeeContractPre.getStatusList())) {
tEmployeeContractPre.setStatusList(Stream.of("0","1","2","3","4","5","6","7","8").collect(Collectors.toList()));
tEmployeeContractPre.setStatusList(Stream.of("0","1","2","3","4","5","6","7","8","11").collect(Collectors.toList()));
}
return baseMapper.getTEmployeeContractPrePage(page,tEmployeeContractPre);
}
......@@ -117,7 +118,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
}
initSearchVo(tEmployeeContractPre);
if (Common.isEmpty(tEmployeeContractPre.getProcessStatus())&& Common.isEmpty(tEmployeeContractPre.getStatusList())) {
tEmployeeContractPre.setStatusList(Stream.of("0","1","2","3","4","5","6","7","8").collect(Collectors.toList()));
tEmployeeContractPre.setStatusList(Stream.of("0","1","2","3","4","5","6","7","8","11").collect(Collectors.toList()));
}
return baseMapper.getTEmployeeContractPreExportCount(tEmployeeContractPre);
}
......@@ -135,7 +136,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
//权限赋值
initSearchVo(searchVo);
if (Common.isEmpty(searchVo.getProcessStatus())&& Common.isEmpty(searchVo.getStatusList())) {
searchVo.setStatusList(Stream.of("0","1","2","3","4","5","6","7","8").collect(Collectors.toList()));
searchVo.setStatusList(Stream.of("0","1","2","3","4","5","6","7","8","11").collect(Collectors.toList()));
}
long count = baseMapper.getTEmployeeContractPreExportCount(searchVo);
try(ServletOutputStream out = response.getOutputStream();) {
......@@ -275,15 +276,15 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
}
@Override
public R dispatcherContract(List<String> idList,String type) {
public R dispatcherContract(List<String> idList, String type) {
List<TEmployeeContractPre> contractPreList = baseMapper.selectList(Wrappers.<TEmployeeContractPre>query()
.lambda().in(TEmployeeContractPre::getId, idList)
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus));
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.contractDIsStatus));
// 如果没有找到任何未处理的合同待派单数据,返回失败消息
if (Common.isEmpty(contractPreList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
// 创建一个Map映射preId到TEmployeeContractPre对象
Map<String, TEmployeeContractPre> preContractMap = contractPreList.stream()
.collect(Collectors.toMap(TEmployeeContractPre::getId, pre -> pre));
......@@ -292,7 +293,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
//发起派单
List<ErrorMessage> errorMessageListAll = new ArrayList<>();
List<EmployeeContractVO> excelVOList = baseMapper.getDisPatcherContractList(idList,CommonConstants.socialInfoStatus,type);
// 拆分电子签和线下签
List<EmployeeContractVO> electronicSignList = new ArrayList<>();
List<EmployeeContractVO> offlineSignList = new ArrayList<>();
......@@ -411,12 +412,13 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
} else {
// 合同创建成功,继续调用FascService的submitContract方法
R<String> result = null;
TEmployeeContractPre contract = baseMapper.selectById(contractPre.getId());
try {
result = fascService.submitContract(contractPre.getId());
} catch (Exception e) {
// 更新合同:
if (Common.isNotNull(contractPre.getContractId())) {
TEmployeeContractInfo empContract = contractInfoService.getById(contractPre.getContractId());
if (Common.isNotNull(contract.getContractId())) {
TEmployeeContractInfo empContract = contractInfoService.getById(contract.getContractId());
empContract.setDeleteFlag(CommonConstants.ONE_INT);
contractInfoService.updateById(empContract);
}
......@@ -434,8 +436,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper);
// 更新合同:
if (Common.isNotNull(contractPre.getContractId())) {
TEmployeeContractInfo empContract = contractInfoService.getById(contractPre.getContractId());
if (Common.isNotNull(contract.getContractId())) {
TEmployeeContractInfo empContract = contractInfoService.getById(contract.getContractId());
empContract.setDeleteFlag(CommonConstants.ONE_INT);
contractInfoService.updateById(empContract);
}
......@@ -455,10 +457,10 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
errorMessage.setData(contractVO);
errorMessageListAll.add(errorMessage);
} else {
if (Common.isNotNull(contractPre.getContractId())) {
if (Common.isNotNull(contract.getContractId())) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("签署中");
audit.setLinkId(contractPre.getContractId());
audit.setLinkId(contract.getContractId());
audit.setLinkType(CommonConstants.ONE_INT);
audit.setCreateName("法大大电子签");
audit.setCreateBy("1");
......@@ -541,7 +543,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TEmployeeContractPre::getId, contractVO.getPreId())
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus)
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.contractDIsStatus)
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPre::getSignType, CommonConstants.ONE_STRING)
.set(TEmployeeContractPre::getErrorInfo, errorMessage.getMessage())
......@@ -592,37 +594,51 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
}
TEmployeeContractPre pre;
TEmployeeContractInfo contractInfo;
R<String> result;
for (TEmployeeAutoRegistRevokeVo registRevokeVo : registRevokeVoList) {
pre = baseMapper.selectById(registRevokeVo.getId());
//电子待归档、线下签待归档、已完结的不能撤销签署
if (Common.isNotNull(pre) && !CommonConstants.NINE_STRING.equals(pre.getProcessStatus()) &&
!CommonConstants.FOUR_STRING.equals(pre.getProcessStatus()) &&
!CommonConstants.EIGHT_STRING.equals(pre.getProcessStatus())) {
//如果不是待确认和待发起,需要记录操作记录
if (!CommonConstants.ZERO_STRING.equals(pre.getProcessStatus()) &&
!CommonConstants.ONE_STRING.equals(pre.getProcessStatus()) &&
Common.isNotNull(pre.getContractId())) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("撤销签署");
audit.setLinkId(pre.getContractId());
audit.setLinkType(CommonConstants.ONE_INT);
tEmployeeContractAuditService.save(audit);
if (pre != null) {
if (Common.isNotNull(pre.getSignType()) && CommonConstants.ZERO_STRING.equals(pre.getSignType())
&& Common.isNotNull(pre.getRequestId())) {
try {
result = fascService.cancelTask(pre.getRequestId());
if (!R.isSuccess(result)) {
// 产品暂未设计失败了怎么做
}
} catch (ApiException e) {
// 产品暂未设计失败了怎么做
}
}
pre.setProcessStatus(CommonConstants.TEN_STRING);
pre.setSignFlag(CommonConstants.ZERO_STRING);
pre.setRevokeReason(registRevokeVo.getReason());
baseMapper.updateById(pre);
}
if (Common.isNotNull(pre.getContractId())) {
//如果存在合同申请审核数据,将状态更新成待提交
contractInfo = contractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getId, pre.getContractId())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractInfo)) {
contractInfo.setAuditStatus(CommonConstants.ZERO_INT);
contractInfo.setInUse(CommonConstants.ONE_STRING);
contractInfoService.updateById(contractInfo);
//电子待归档、线下签待归档、已完结的不能撤销签署
if (Common.isNotNull(pre) && !CommonConstants.NINE_STRING.equals(pre.getProcessStatus()) &&
!CommonConstants.FOUR_STRING.equals(pre.getProcessStatus()) &&
!CommonConstants.EIGHT_STRING.equals(pre.getProcessStatus())) {
//如果不是待确认和待发起,需要记录操作记录
if (!CommonConstants.ZERO_STRING.equals(pre.getProcessStatus()) &&
!CommonConstants.ONE_STRING.equals(pre.getProcessStatus()) &&
Common.isNotNull(pre.getContractId())) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("撤销签署");
audit.setLinkId(pre.getContractId());
audit.setLinkType(CommonConstants.ONE_INT);
tEmployeeContractAuditService.save(audit);
}
pre.setProcessStatus(CommonConstants.TEN_STRING);
pre.setSignFlag(CommonConstants.ZERO_STRING);
pre.setRevokeReason(registRevokeVo.getReason());
baseMapper.updateById(pre);
}
if (Common.isNotNull(pre.getContractId())) {
//如果存在合同申请审核数据,将状态更新成待提交
contractInfo = contractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getId, pre.getContractId())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractInfo)) {
contractInfo.setAuditStatus(CommonConstants.ZERO_INT);
contractInfo.setInUse(CommonConstants.ONE_STRING);
contractInfoService.updateById(contractInfo);
}
}
}
}
......@@ -826,7 +842,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
// 撤销成功:状态更新为"待发起"(1) 且 签署方式变更为"线下签"(1)
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPre::getId, contractPre.getId())
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.ONE_STRING) // 待发起
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.ELEVEN_STRING) // 11 撤销签署-系统自动撤销
.set(TEmployeeContractPre::getSignType, CommonConstants.ONE_STRING) // 线下签
.set(TEmployeeContractPre::getRevokeReason, "超时未签署自行变更为线下签")
.set(TEmployeeContractPre::getChangeTypeReason, "超时未签署自行变更为线下签")
......@@ -840,7 +856,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
audit.setLinkType(CommonConstants.ONE_INT);
audit.setRemark("电子合同签署超过1个月未完成签署系统,自动撤销");
tEmployeeContractAuditService.save(audit);
} else if ("已完成签署".equals(revokeResult.getMsg())) {
// 撤销失败原因为已完成签署:更新为签署完成的"待归档"状态(8)
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
......
......@@ -172,66 +172,65 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
private static final List<String> PRE_IGNORE_FIELD = new ArrayList<>();
static {
IGNORE_FIELD.add("createTime");
IGNORE_FIELD.add("deptId");
IGNORE_FIELD.add("dataSource");
IGNORE_FIELD.add("createBy");
IGNORE_FIELD.add("createName");
IGNORE_FIELD.add("updateBy");
PRE_IGNORE_FIELD.add("createTime");
PRE_IGNORE_FIELD.add("deptId");
PRE_IGNORE_FIELD.add("dataSource");
PRE_IGNORE_FIELD.add("createBy");
PRE_IGNORE_FIELD.add("createName");
PRE_IGNORE_FIELD.add("updateBy");
}
private static final List<String> CONTRACT_IGNORE_FIELD = new ArrayList<>();
static {
IGNORE_FIELD.add("joinLeaveDate");
IGNORE_FIELD.add("createTime");
IGNORE_FIELD.add("empPhone");
IGNORE_FIELD.add("employeeName");
IGNORE_FIELD.add("empIdcard");
IGNORE_FIELD.add("deptNo");
IGNORE_FIELD.add("deptName");
IGNORE_FIELD.add("deptId");
IGNORE_FIELD.add("customerUsername");
IGNORE_FIELD.add("customerUserLoginname");
IGNORE_FIELD.add("dataSource");
IGNORE_FIELD.add("position");
IGNORE_FIELD.add("contractId");
IGNORE_FIELD.add("registerId");
IGNORE_FIELD.add("createBy");
IGNORE_FIELD.add("createName");
IGNORE_FIELD.add("updateBy");
IGNORE_FIELD.add("isAddress");
IGNORE_FIELD.add("internshipPeriodNum");
IGNORE_FIELD.add("tryPeriodNum");
IGNORE_FIELD.add("id");
CONTRACT_IGNORE_FIELD.add("joinLeaveDate");
CONTRACT_IGNORE_FIELD.add("createTime");
CONTRACT_IGNORE_FIELD.add("empPhone");
CONTRACT_IGNORE_FIELD.add("employeeName");
CONTRACT_IGNORE_FIELD.add("empIdcard");
CONTRACT_IGNORE_FIELD.add("deptNo");
CONTRACT_IGNORE_FIELD.add("deptName");
CONTRACT_IGNORE_FIELD.add("deptId");
CONTRACT_IGNORE_FIELD.add("changeTypeReason");
CONTRACT_IGNORE_FIELD.add("changeTypeUser");
CONTRACT_IGNORE_FIELD.add("changeTypeTime");
CONTRACT_IGNORE_FIELD.add("dataSource");
CONTRACT_IGNORE_FIELD.add("contractId");
CONTRACT_IGNORE_FIELD.add("registerId");
CONTRACT_IGNORE_FIELD.add("createBy");
CONTRACT_IGNORE_FIELD.add("createName");
CONTRACT_IGNORE_FIELD.add("updateBy");
CONTRACT_IGNORE_FIELD.add("id");
CONTRACT_IGNORE_FIELD.add("timeoutElecSign");
}
private static final List<String> SOCIAL_IGNORE_FIELD = new ArrayList<>();
static {
IGNORE_FIELD.add("joinLeaveDate");
IGNORE_FIELD.add("createTime");
IGNORE_FIELD.add("empName");
IGNORE_FIELD.add("phone");
IGNORE_FIELD.add("employeeName");
IGNORE_FIELD.add("empIdcard");
IGNORE_FIELD.add("deptNo");
IGNORE_FIELD.add("deptName");
IGNORE_FIELD.add("deptId");
IGNORE_FIELD.add("customerUsername");
IGNORE_FIELD.add("customerUserLoginname");
IGNORE_FIELD.add("position");
IGNORE_FIELD.add("contractId");
IGNORE_FIELD.add("errorBackInfo");
IGNORE_FIELD.add("errorInfo");
IGNORE_FIELD.add("errorTime");
IGNORE_FIELD.add("socialFundId");
IGNORE_FIELD.add("dispatcherId");
IGNORE_FIELD.add("contractStatus");
IGNORE_FIELD.add("typeSub");
IGNORE_FIELD.add("registerId");
IGNORE_FIELD.add("createBy");
IGNORE_FIELD.add("createName");
IGNORE_FIELD.add("updateBy");
IGNORE_FIELD.add("id");
SOCIAL_IGNORE_FIELD.add("joinLeaveDate");
SOCIAL_IGNORE_FIELD.add("createTime");
SOCIAL_IGNORE_FIELD.add("empName");
SOCIAL_IGNORE_FIELD.add("phone");
SOCIAL_IGNORE_FIELD.add("employeeName");
SOCIAL_IGNORE_FIELD.add("empIdcard");
SOCIAL_IGNORE_FIELD.add("deptNo");
SOCIAL_IGNORE_FIELD.add("deptName");
SOCIAL_IGNORE_FIELD.add("deptId");
SOCIAL_IGNORE_FIELD.add("customerUsername");
SOCIAL_IGNORE_FIELD.add("customerUserLoginname");
SOCIAL_IGNORE_FIELD.add("position");
SOCIAL_IGNORE_FIELD.add("contractId");
SOCIAL_IGNORE_FIELD.add("errorBackInfo");
SOCIAL_IGNORE_FIELD.add("errorInfo");
SOCIAL_IGNORE_FIELD.add("errorTime");
SOCIAL_IGNORE_FIELD.add("socialFundId");
SOCIAL_IGNORE_FIELD.add("dispatcherId");
SOCIAL_IGNORE_FIELD.add("contractStatus");
SOCIAL_IGNORE_FIELD.add("typeSub");
SOCIAL_IGNORE_FIELD.add("registerId");
SOCIAL_IGNORE_FIELD.add("createBy");
SOCIAL_IGNORE_FIELD.add("createName");
SOCIAL_IGNORE_FIELD.add("updateBy");
SOCIAL_IGNORE_FIELD.add("id");
SOCIAL_IGNORE_FIELD.add("expectedCollectionType");
}
@Override
......
......@@ -85,6 +85,16 @@ public class TFascTemplateDetailServiceImpl extends ServiceImpl<TFascTemplateDet
return baseMapper.getTFascTemplateDetailPage(page, tFascTemplateDetail);
}
/**
* 法大大专业版模板映射表_发起专用,含格式化映射字段
*
* @param fadadaTemplateId 法大大专业版模板映射表
* @return
*/
@Override
public List<TFascTemplateDetail> getTDetailListByFieldType(String fadadaTemplateId) {
return baseMapper.getTDetailListByFieldType(fadadaTemplateId);
}
/**
* 法大大专业版模板映射表简单分页查询
*
......
......@@ -44,6 +44,8 @@ public interface FascConstants {
// 需要额外转化的字段:
String CONTRACT_DURATION = "contractDurationYear-Month";
String DISPATCH_PERIOD = "dispatchPeriodYear-Month";
String EMP_SEX = "empSex";
String EMP_BIRTHDAY_MONTH = "empBirthdayMonth";
//String FIELD_TYPE = "text_single_line,text_multi_line,number,id_card,fill_date,multi_radio,multi_checkbox,picture,select_box,table,verification_code,business_code";
}
......@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TFascPushLogService;
import com.yifu.cloud.plus.v1.yifu.archives.util.IdCardUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
......@@ -36,10 +37,10 @@ import org.springframework.stereotype.Component;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.*;
import java.util.concurrent.TimeUnit;
import static com.alibaba.fastjson.serializer.SerializerFeature.*;
......@@ -57,6 +58,9 @@ public class FascUtil {
@Autowired
//private FascConfig fascConfig;
private static final String DATA_COVER = "dataCover";
private static final String DATE_FORMAT = "dateFormat";
private static final SerializerFeature[] features = new SerializerFeature[]{
WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty,
WriteNullStringAsEmpty, WriteDateUseDateFormat
......@@ -424,6 +428,7 @@ public class FascUtil {
tEmployeeContractPreMapper.updateById(contract);
}
public static final String YEAR_MONTH_DATE_FORMAT = "yyyy年MM月";
// 第二步:填写控件
private R<String> buildDocFieldValue(TEmployeeContractPre contract, String requestId
......@@ -450,8 +455,24 @@ public class FascUtil {
fieldValue = contract.getContractDurationYear() + CommonConstants.CENTER_SPLIT_LINE_STRING + contract.getContractDurationMonth();
} else if (FascConstants.DISPATCH_PERIOD.equals(fieldName)) {
fieldValue = contract.getDispatchPeriodYear() + CommonConstants.CENTER_SPLIT_LINE_STRING + contract.getDispatchPeriodMonth();
} else if (FascConstants.EMP_SEX.equals(fieldName)) {
fieldValue = "";
if(Common.isNotNull(contract.getEmpIdcard()) && contract.getEmpIdcard().length() > 14){
String idCard = contract.getEmpIdcard();
fieldValue = IdCardUtil.getSexName(idCard);
}
} else if (FascConstants.EMP_BIRTHDAY_MONTH.equals(fieldName)) {
fieldValue = contract.getEmpIdcard();
if(Common.isNotNull(contract.getEmpIdcard()) && contract.getEmpIdcard().length() > 14){
String idCard = contract.getEmpIdcard();
if (Common.isNotNull(detail.getFieldValue())) {
fieldValue = IdCardUtil.getBirthdateByPatten(idCard, detail.getFieldValue());
} else {
fieldValue = IdCardUtil.getBirthdateByPatten(idCard, YEAR_MONTH_DATE_FORMAT);
}
}
} else {
fieldValue = this.getContractFieldValueByReflection(contract, fieldName);
fieldValue = this.getContractFieldValueByReflection(contract, fieldName, detail.getFieldType(), detail.getFieldValue());
}
dfv.setFieldValue(fieldValue);
......@@ -479,7 +500,7 @@ public class FascUtil {
* @param fieldName 字段名
* @return 字段值
*/
private String getContractFieldValueByReflection(TEmployeeContractPre contract, String fieldName) {
private String getContractFieldValueByReflection(TEmployeeContractPre contract, String fieldName, String fieldType, String fieldValue) {
if (contract == null || fieldName == null) {
return null;
}
......@@ -492,7 +513,7 @@ public class FascUtil {
java.lang.reflect.Method method = contract.getClass().getMethod(getterMethodName);
Object value = method.invoke(contract);
String valueStr = String.valueOf(value);
valueStr = this.getCoverValue(contract, fieldName, valueStr);
valueStr = this.getCoverValue(valueStr, fieldType, fieldValue);
return valueStr;
} catch (Exception e) {
// 如果找不到对应的方法,尝试直接匹配字段名
......@@ -508,27 +529,82 @@ public class FascUtil {
}
// 翻译字典
private String getCoverValue(TEmployeeContractPre contract, String fieldName, String valueStr) throws NoSuchFieldException {
if (Common.isNotNull(valueStr) && isInteger(valueStr)) {
java.lang.reflect.Field field = contract.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
// 检查ExcelAttribute注解
ExcelAttribute excelAnnotation = field.getAnnotation(ExcelAttribute.class);
if (excelAnnotation != null && excelAnnotation.isDataId()) {
String converterExp = excelAnnotation.readConverterExp();
if (converterExp != null && !converterExp.isEmpty()) {
valueStr = convertByExp(converterExp, valueStr);
}
private String getCoverValue(String valueStr, String fieldType, String fieldValue) {
if (Common.isNotNull(valueStr) && (Common.isNotNull(fieldType))) {
if (DATA_COVER.equals(fieldType)) {
valueStr = convertByExp(fieldValue, valueStr);
} else if (DATE_FORMAT.equals(fieldType)) {
valueStr = formatStringDate(fieldValue, valueStr);
}
}
return valueStr;
}
public static String formatStringDate(String pattern, String dateValue) {
if (dateValue == null || dateValue.trim().isEmpty() || pattern == null) {
return dateValue;
}
SimpleDateFormat sdfInput = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH);
SimpleDateFormat sdfOutput = new SimpleDateFormat(pattern);
try {
Date date = sdfInput.parse(dateValue);
String result = sdfOutput.format(date);
if (Common.isNotNull(result)) {
return result;
} else {
String trimmedValue = dateValue.trim();
try {
// 尝试解析为java.util.Date
date = parseDate(trimmedValue);
if (date != null) {
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(pattern);
return sdf.format(date);
}
} catch (Exception e) {
// 解析失败,返回原字符串
}
}
} catch (ParseException e) {
}
return dateValue;
}
/**
* 解析字符串为java.util.Date
*/
private static java.util.Date parseDate(String dateStr) {
// 常见日期格式模式
String[] patterns = {
"EEE MMM dd HH:mm:ss z yyyy",
"yyyy-MM-dd",
"yyyy/MM/dd",
"yyyy年MM月dd日",
"yyyy-MM-dd HH:mm:ss",
"yyyy/MM/dd HH:mm:ss",
"yyyy-MM-dd HH:mm",
"yyyy/MM/dd HH:mm"
};
for (String pattern : patterns) {
try {
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(pattern);
sdf.setLenient(false); // 严格模式
return sdf.parse(dateStr);
} catch (Exception e) {
// 继续尝试下一种格式
}
}
return null;
}
/**
* 根据转换表达式翻译值
*/
private static String convertByExp(String converterExp, String value) {
if (converterExp == null || value == null) {
if (Common.isEmpty(converterExp) || Common.isEmpty(value)) {
return value;
}
String[] items = converterExp.split(",");
......@@ -542,11 +618,6 @@ public class FascUtil {
return value; // 如果没有找到匹配的,返回原值
}
private boolean isInteger(String value) {
// 允许正负整数,不允许前导0(除了0本身)
return value != null && value.matches("^(-?[1-9]\\d*|0)$");
}
// 第三步:提交任务
private R<String> submitTask(String requestId, OpenApiClient openApiClient, String accessToken) throws ApiException {
SignTaskClient signTaskClient = new SignTaskClient(openApiClient);
......@@ -795,6 +866,7 @@ public class FascUtil {
pushLog.setTypeKey("获取附件,身份证:" + empIdCard);
pushLog.setTypeName("获取附件");
pushLog.setContractId(contract.getId());
pushLog.setSignTaskId(contract.getRequestId());
tFascPushLogService.save(pushLog);
BaseRes<SignTaskGetFileRes> res = signTaskClient.signTaskGetFile(signTaskGetFileReq);
......
......@@ -337,6 +337,7 @@
WHEN a.process_status =6 THEN "签署中"
WHEN a.process_status =7 THEN "签署失败"
WHEN a.process_status =8 THEN "电子待归档"
WHEN a.process_status =11 THEN "撤销签署-系统自动撤销"
ELSE a.process_status END as process_status,
if(b.id is null,'否','是') archives_is_create
FROM t_employee_contract_pre a
......
......@@ -28,12 +28,16 @@
<result property="hrField" column="hr_field"/>
<result property="hrFieldId" column="hr_field_id"/>
<result property="contractType" column="contract_type"/>
<result property="fieldType" column="field_type"/>
<result property="fieldValue" column="field_value"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.hr_field,
a.hr_field_id,
a.contract_type
a.contract_type,
a.field_type,
a.field_value
</sql>
<sql id="tFascHrField_where">
<if test="tFascHrField != null">
......
......@@ -42,6 +42,8 @@
<result property="signTemplateStatus" column="sign_template_status"/>
<result property="contractType" column="contract_type"/>
<result property="fascDocId" column="fasc_doc_id"/>
<result property="fieldType" column="field_type"/>
<result property="fieldValue" column="field_value"/>
</resultMap>
<resultMap id="tFascTemplateDetailExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TFascTemplateDetailExportVo">
......@@ -151,11 +153,31 @@
FROM t_fasc_template_detail a
left join t_fasc_template b on a.sign_template_id = b.sign_template_id
<where>
1=1
b.delete_Flag = '0'
<include refid="tFascTemplateDetail_where"/>
</where>
ORDER BY a.CREATE_TIME ASC
</select>
<!--推送时专用查询,含字段对应格式化-->
<select id="getTDetailListByFieldType" resultMap="tFascTemplateDetailMap">
SELECT
a.id,
a.sign_template_id,
a.fasc_doc_id,
a.fasc_field,
a.fasc_field_id,
a.is_must,
a.delete_flag,
a.hr_field,
a.hr_field_id,
a.is_edit,
h.field_type,h.field_value
FROM t_fasc_template_detail a
left join t_fasc_template b on a.sign_template_id = b.sign_template_id
left join t_fasc_hr_field h on h.hr_field_id = a.hr_field_id and h.hr_field = a.hr_field
where b.delete_Flag = '0' and a.hr_field_id is not null and a.sign_template_id = #{fadadaTemplateId}
</select>
<!--tFascTemplateDetail简单分页查询-->
<select id="getTFascTemplateDetailList" resultMap="tFascTemplateDetailMap">
SELECT
......@@ -186,8 +208,8 @@
FROM t_fasc_template_detail a
left join t_fasc_template b on a.sign_template_id = b.sign_template_id
<where>
1=1
<include refid="tFascTemplateDetail_where"/>
b.delete_Flag = '0'
<include refid="tFascTemplateDetail_where"/>
<if test="idList != null and idList.size>0">
AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
......@@ -209,8 +231,8 @@
FROM t_fasc_template_detail a
left join t_fasc_template b on a.sign_template_id = b.sign_template_id
<where>
1=1
<include refid="tFascTemplateDetail_where"/>
b.delete_Flag = '0'
<include refid="tFascTemplateDetail_where"/>
<if test="idList != null and idList.size>0">
AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
......
......@@ -648,6 +648,8 @@ public interface CommonConstants {
List<String> socialInfoStatus = Stream.of("1","3","5","7").collect(Collectors.toList());
List<String> contractDIsStatus = Stream.of("1","3","5","7","11").collect(Collectors.toList());
List<String> processInsurancesStatus = Stream.of("1","2","5").collect(Collectors.toList());
List<String> processListPreArchivesStatus = Stream.of("0","1","2","3","4","5").collect(Collectors.toList());
......
......@@ -208,13 +208,17 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
BeanUtils.copyProperties(preVo, pre);
//时间格式转化
if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 15:20", DateUtil.DATETIME_PATTERN_MINUTE));
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
}
if (Common.isNotNull(preVo.getExpectedConfirmTime())) {
preVo.setExpectedConfirmTime(DateUtil.parseDate(DateUtil.dateToString(
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 09:00", DateUtil.DATETIME_PATTERN_MINUTE));
pre.setExpectedConfirmTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedConfirmTime()));
}
if (Common.isEmpty(pre.getDispatchItem())) {
preVo.setDispatchItem("养老、医疗、生育、失业、工伤、大病");
pre.setDispatchItem("养老、医疗、生育、失业、工伤、大病");
}
//如果自动触发派增为是,计算派单发起时间和派单确认时间
if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis())
......@@ -240,6 +244,8 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 15:20", DateUtil.DATETIME_PATTERN_MINUTE));
preVo.setExpectedConfirmTime(DateUtil.parseDate(DateUtil.dateToString(
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 09:00", DateUtil.DATETIME_PATTERN_MINUTE));
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
pre.setExpectedConfirmTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedConfirmTime()));
}
if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId());
......
......@@ -315,7 +315,7 @@
<select id="getTDispatchInfoPrePage" resultMap="tDispatchInfoPreMap">
SELECT
<include refid="Base_Column_List"/>
if(b.id is not null,'0','1') as CONTRACT_STATUS
,if(b.id is not null,'0','1') as CONTRACT_STATUS
FROM t_dispatch_info_pre a
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where>
......@@ -365,6 +365,7 @@
a.DELETE_FLAG = '0'
<include refid="tDispatchInfoPre_where"/>
</where>
group by a.id
order by a.create_time desc
<if test="tDispatchInfoPre.limitStart != null">
limit #{tDispatchInfoPre.limitStart},#{tDispatchInfoPre.limitEnd}
......
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