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 { ...@@ -58,8 +58,8 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "合同类型,标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同") @Schema(description = "合同类型,标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同")
private String contractType; private String contractType;
@ExcelAttribute(name = "签署方式", isDataId = true, readConverterExp = "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撤销签署") @Schema(description = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9已完结10撤销签署-客服撤销 11 撤销签署-系统自动撤销")
private String processStatus; private String processStatus;
@Schema(description = "签署甲方") @Schema(description = "签署甲方")
......
...@@ -68,5 +68,21 @@ public class TFascHrField { ...@@ -68,5 +68,21 @@ public class TFascHrField {
@ExcelProperty("合同类型") @ExcelProperty("合同类型")
@Schema(description = "合同类型") @Schema(description = "合同类型")
private String contractType; 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 { ...@@ -141,4 +141,17 @@ public class TFascTemplateDetail extends BaseEntity {
@Schema(description = "合同类型是否配置") @Schema(description = "合同类型是否配置")
private String haveContractType; 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 { ...@@ -86,6 +86,59 @@ public class IdCardUtil {
} }
return date; 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 * @Author fxj
......
...@@ -204,7 +204,7 @@ public class FascController { ...@@ -204,7 +204,7 @@ public class FascController {
TEmployeeContractPre pre = tEmployeeContractPreService.getOne(Wrappers.<TEmployeeContractPre>query().lambda() TEmployeeContractPre pre = tEmployeeContractPreService.getOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRequestId, signTaskId).last(CommonConstants.LAST_ONE_SQL)); .eq(TEmployeeContractPre::getRequestId, signTaskId).last(CommonConstants.LAST_ONE_SQL));
YifuUser user = getNewYifuUser(); YifuUser user = getNewYifuUser();
if (pre != null) { if (pre != null && Common.isNotNull(pre.getProcessStatus()) && !pre.getProcessStatus().equals(CommonConstants.dingleDigitStrArray[9])) {
TEmployeeContractInfo contractInfo = null; TEmployeeContractInfo contractInfo = null;
if (Common.isNotNull(pre.getContractId())) { if (Common.isNotNull(pre.getContractId())) {
//如果存在合同申请审核数据,将状态更新成待提交 //如果存在合同申请审核数据,将状态更新成待提交
......
...@@ -43,6 +43,8 @@ public interface TFascTemplateDetailMapper extends BaseMapper<TFascTemplateDetai ...@@ -43,6 +43,8 @@ public interface TFascTemplateDetailMapper extends BaseMapper<TFascTemplateDetai
*/ */
IPage<TFascTemplateDetail> getTFascTemplateDetailPage(Page<TFascTemplateDetail> page, @Param("tFascTemplateDetail") TFascTemplateDetail tFascTemplateDetail); 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<TFascTemplateDetail> getTFascTemplateDetailList(@Param("tFascTemplateDetail") TFascTemplateDetail tFascTemplateDetail);
List<TFascTemplateDetailExportVo> getTFascTemplateDetailExport(@Param("tFascTemplateDetail") TFascTemplateDetailSearchVo tFascTemplateDetail, @Param("idList") List<String> idList); List<TFascTemplateDetailExportVo> getTFascTemplateDetailExport(@Param("tFascTemplateDetail") TFascTemplateDetailSearchVo tFascTemplateDetail, @Param("idList") List<String> idList);
......
...@@ -43,6 +43,8 @@ public interface TFascTemplateDetailService extends IService<TFascTemplateDetail ...@@ -43,6 +43,8 @@ public interface TFascTemplateDetailService extends IService<TFascTemplateDetail
IPage<TFascTemplateDetail> getTFascTemplateDetailPage(Page<TFascTemplateDetail> page, TFascTemplateDetailSearchVo tFascTemplateDetail); IPage<TFascTemplateDetail> getTFascTemplateDetailPage(Page<TFascTemplateDetail> page, TFascTemplateDetailSearchVo tFascTemplateDetail);
// 获取列表 // 获取列表
List<TFascTemplateDetail> getTDetailListByFieldType(String fadadaTemplateId);
List<TFascTemplateDetail> getTFascTemplateDetailList(TFascTemplateDetail tFascTemplateDetail); List<TFascTemplateDetail> getTFascTemplateDetailList(TFascTemplateDetail tFascTemplateDetail);
R<List<ErrorMessage>> batchUpdateFascDetail(InputStream inputStream); R<List<ErrorMessage>> batchUpdateFascDetail(InputStream inputStream);
......
...@@ -1558,9 +1558,18 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1558,9 +1558,18 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
.eq(TEmployeeContractPre::getRegisterId, id) .eq(TEmployeeContractPre::getRegisterId, id)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contract)) { if (Common.isNotNull(contract)) {
//特殊状态处理
if (Common.isNotNull(contract.getChangeTypeReason())) {
contract.setSignType(CommonConstants.ZERO_STRING);
}
//附件赋值 //附件赋值
List<TAttaInfo> attaContractInfo = attaInfoService.list(Wrappers.<TAttaInfo>query().lambda() List<TAttaInfo> attaContractInfo = attaInfoService.list(Wrappers.<TAttaInfo>query().lambda()
.eq(TAttaInfo::getDomainId, contract.getId())); .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,并将其添加到员工注册信息中 // 如果附件信息非空,则为每个附件生成可访问的URL,并将其添加到员工注册信息中
if (attaContractInfo != null && !attaContractInfo.isEmpty()) { if (attaContractInfo != null && !attaContractInfo.isEmpty()) {
URL url; URL url;
......
...@@ -244,9 +244,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -244,9 +244,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
} else if (!"valid".equals(tFascTemplate.getSignTemplateStatus())) { } else if (!"valid".equals(tFascTemplate.getSignTemplateStatus())) {
return R.failed("法大大模版状态不是“启用”,不可发起电子签署"); return R.failed("法大大模版状态不是“启用”,不可发起电子签署");
} }
TFascTemplateDetail detail = new TFascTemplateDetail(); List<TFascTemplateDetail> detailList = tFascTemplateDetailService.getTDetailListByFieldType(contract.getFadadaTemplateId());
detail.setSignTemplateId(contract.getFadadaTemplateId());
List<TFascTemplateDetail> detailList = tFascTemplateDetailService.getTFascTemplateDetailList(detail);
// - 判断是否入职超过1个月——接口入口做了 // - 判断是否入职超过1个月——接口入口做了
TFascCompany company = tFascCompanyService.getById(tFascTemplate.getCompanyId()); TFascCompany company = tFascCompanyService.getById(tFascTemplate.getCompanyId());
......
...@@ -542,7 +542,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -542,7 +542,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(tEmployeeContractInfo.getPreId())) { if (Common.isNotNull(tEmployeeContractInfo.getPreId())) {
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda() TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getId, tEmployeeContractInfo.getPreId()) .eq(TEmployeeContractPre::getId, tEmployeeContractInfo.getPreId())
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus) .in(TEmployeeContractPre::getProcessStatus, CommonConstants.contractDIsStatus)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) { if (Common.isNotNull(contractPre)) {
//合同状态初始为签署中 //合同状态初始为签署中
......
...@@ -172,66 +172,65 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -172,66 +172,65 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
private static final List<String> PRE_IGNORE_FIELD = new ArrayList<>(); private static final List<String> PRE_IGNORE_FIELD = new ArrayList<>();
static { static {
IGNORE_FIELD.add("createTime"); PRE_IGNORE_FIELD.add("createTime");
IGNORE_FIELD.add("deptId"); PRE_IGNORE_FIELD.add("deptId");
IGNORE_FIELD.add("dataSource"); PRE_IGNORE_FIELD.add("dataSource");
IGNORE_FIELD.add("createBy"); PRE_IGNORE_FIELD.add("createBy");
IGNORE_FIELD.add("createName"); PRE_IGNORE_FIELD.add("createName");
IGNORE_FIELD.add("updateBy"); PRE_IGNORE_FIELD.add("updateBy");
} }
private static final List<String> CONTRACT_IGNORE_FIELD = new ArrayList<>(); private static final List<String> CONTRACT_IGNORE_FIELD = new ArrayList<>();
static { static {
IGNORE_FIELD.add("joinLeaveDate"); CONTRACT_IGNORE_FIELD.add("joinLeaveDate");
IGNORE_FIELD.add("createTime"); CONTRACT_IGNORE_FIELD.add("createTime");
IGNORE_FIELD.add("empPhone"); CONTRACT_IGNORE_FIELD.add("empPhone");
IGNORE_FIELD.add("employeeName"); CONTRACT_IGNORE_FIELD.add("employeeName");
IGNORE_FIELD.add("empIdcard"); CONTRACT_IGNORE_FIELD.add("empIdcard");
IGNORE_FIELD.add("deptNo"); CONTRACT_IGNORE_FIELD.add("deptNo");
IGNORE_FIELD.add("deptName"); CONTRACT_IGNORE_FIELD.add("deptName");
IGNORE_FIELD.add("deptId"); CONTRACT_IGNORE_FIELD.add("deptId");
IGNORE_FIELD.add("customerUsername"); CONTRACT_IGNORE_FIELD.add("changeTypeReason");
IGNORE_FIELD.add("customerUserLoginname"); CONTRACT_IGNORE_FIELD.add("changeTypeUser");
IGNORE_FIELD.add("dataSource"); CONTRACT_IGNORE_FIELD.add("changeTypeTime");
IGNORE_FIELD.add("position"); CONTRACT_IGNORE_FIELD.add("dataSource");
IGNORE_FIELD.add("contractId"); CONTRACT_IGNORE_FIELD.add("contractId");
IGNORE_FIELD.add("registerId"); CONTRACT_IGNORE_FIELD.add("registerId");
IGNORE_FIELD.add("createBy"); CONTRACT_IGNORE_FIELD.add("createBy");
IGNORE_FIELD.add("createName"); CONTRACT_IGNORE_FIELD.add("createName");
IGNORE_FIELD.add("updateBy"); CONTRACT_IGNORE_FIELD.add("updateBy");
IGNORE_FIELD.add("isAddress"); CONTRACT_IGNORE_FIELD.add("id");
IGNORE_FIELD.add("internshipPeriodNum"); CONTRACT_IGNORE_FIELD.add("timeoutElecSign");
IGNORE_FIELD.add("tryPeriodNum");
IGNORE_FIELD.add("id");
} }
private static final List<String> SOCIAL_IGNORE_FIELD = new ArrayList<>(); private static final List<String> SOCIAL_IGNORE_FIELD = new ArrayList<>();
static { static {
IGNORE_FIELD.add("joinLeaveDate"); SOCIAL_IGNORE_FIELD.add("joinLeaveDate");
IGNORE_FIELD.add("createTime"); SOCIAL_IGNORE_FIELD.add("createTime");
IGNORE_FIELD.add("empName"); SOCIAL_IGNORE_FIELD.add("empName");
IGNORE_FIELD.add("phone"); SOCIAL_IGNORE_FIELD.add("phone");
IGNORE_FIELD.add("employeeName"); SOCIAL_IGNORE_FIELD.add("employeeName");
IGNORE_FIELD.add("empIdcard"); SOCIAL_IGNORE_FIELD.add("empIdcard");
IGNORE_FIELD.add("deptNo"); SOCIAL_IGNORE_FIELD.add("deptNo");
IGNORE_FIELD.add("deptName"); SOCIAL_IGNORE_FIELD.add("deptName");
IGNORE_FIELD.add("deptId"); SOCIAL_IGNORE_FIELD.add("deptId");
IGNORE_FIELD.add("customerUsername"); SOCIAL_IGNORE_FIELD.add("customerUsername");
IGNORE_FIELD.add("customerUserLoginname"); SOCIAL_IGNORE_FIELD.add("customerUserLoginname");
IGNORE_FIELD.add("position"); SOCIAL_IGNORE_FIELD.add("position");
IGNORE_FIELD.add("contractId"); SOCIAL_IGNORE_FIELD.add("contractId");
IGNORE_FIELD.add("errorBackInfo"); SOCIAL_IGNORE_FIELD.add("errorBackInfo");
IGNORE_FIELD.add("errorInfo"); SOCIAL_IGNORE_FIELD.add("errorInfo");
IGNORE_FIELD.add("errorTime"); SOCIAL_IGNORE_FIELD.add("errorTime");
IGNORE_FIELD.add("socialFundId"); SOCIAL_IGNORE_FIELD.add("socialFundId");
IGNORE_FIELD.add("dispatcherId"); SOCIAL_IGNORE_FIELD.add("dispatcherId");
IGNORE_FIELD.add("contractStatus"); SOCIAL_IGNORE_FIELD.add("contractStatus");
IGNORE_FIELD.add("typeSub"); SOCIAL_IGNORE_FIELD.add("typeSub");
IGNORE_FIELD.add("registerId"); SOCIAL_IGNORE_FIELD.add("registerId");
IGNORE_FIELD.add("createBy"); SOCIAL_IGNORE_FIELD.add("createBy");
IGNORE_FIELD.add("createName"); SOCIAL_IGNORE_FIELD.add("createName");
IGNORE_FIELD.add("updateBy"); SOCIAL_IGNORE_FIELD.add("updateBy");
IGNORE_FIELD.add("id"); SOCIAL_IGNORE_FIELD.add("id");
SOCIAL_IGNORE_FIELD.add("expectedCollectionType");
} }
@Override @Override
......
...@@ -85,6 +85,16 @@ public class TFascTemplateDetailServiceImpl extends ServiceImpl<TFascTemplateDet ...@@ -85,6 +85,16 @@ public class TFascTemplateDetailServiceImpl extends ServiceImpl<TFascTemplateDet
return baseMapper.getTFascTemplateDetailPage(page, tFascTemplateDetail); 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 { ...@@ -44,6 +44,8 @@ public interface FascConstants {
// 需要额外转化的字段: // 需要额外转化的字段:
String CONTRACT_DURATION = "contractDurationYear-Month"; String CONTRACT_DURATION = "contractDurationYear-Month";
String DISPATCH_PERIOD = "dispatchPeriodYear-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"; //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.*; ...@@ -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.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper; 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.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.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
...@@ -36,10 +37,10 @@ import org.springframework.stereotype.Component; ...@@ -36,10 +37,10 @@ import org.springframework.stereotype.Component;
import java.io.InputStream; import java.io.InputStream;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static com.alibaba.fastjson.serializer.SerializerFeature.*; import static com.alibaba.fastjson.serializer.SerializerFeature.*;
...@@ -57,6 +58,9 @@ public class FascUtil { ...@@ -57,6 +58,9 @@ public class FascUtil {
@Autowired @Autowired
//private FascConfig fascConfig; //private FascConfig fascConfig;
private static final String DATA_COVER = "dataCover";
private static final String DATE_FORMAT = "dateFormat";
private static final SerializerFeature[] features = new SerializerFeature[]{ private static final SerializerFeature[] features = new SerializerFeature[]{
WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty, WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty,
WriteNullStringAsEmpty, WriteDateUseDateFormat WriteNullStringAsEmpty, WriteDateUseDateFormat
...@@ -424,6 +428,7 @@ public class FascUtil { ...@@ -424,6 +428,7 @@ public class FascUtil {
tEmployeeContractPreMapper.updateById(contract); tEmployeeContractPreMapper.updateById(contract);
} }
public static final String YEAR_MONTH_DATE_FORMAT = "yyyy年MM月";
// 第二步:填写控件 // 第二步:填写控件
private R<String> buildDocFieldValue(TEmployeeContractPre contract, String requestId private R<String> buildDocFieldValue(TEmployeeContractPre contract, String requestId
...@@ -450,8 +455,24 @@ public class FascUtil { ...@@ -450,8 +455,24 @@ public class FascUtil {
fieldValue = contract.getContractDurationYear() + CommonConstants.CENTER_SPLIT_LINE_STRING + contract.getContractDurationMonth(); fieldValue = contract.getContractDurationYear() + CommonConstants.CENTER_SPLIT_LINE_STRING + contract.getContractDurationMonth();
} else if (FascConstants.DISPATCH_PERIOD.equals(fieldName)) { } else if (FascConstants.DISPATCH_PERIOD.equals(fieldName)) {
fieldValue = contract.getDispatchPeriodYear() + CommonConstants.CENTER_SPLIT_LINE_STRING + contract.getDispatchPeriodMonth(); 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 { } else {
fieldValue = this.getContractFieldValueByReflection(contract, fieldName); fieldValue = this.getContractFieldValueByReflection(contract, fieldName, detail.getFieldType(), detail.getFieldValue());
} }
dfv.setFieldValue(fieldValue); dfv.setFieldValue(fieldValue);
...@@ -479,7 +500,7 @@ public class FascUtil { ...@@ -479,7 +500,7 @@ public class FascUtil {
* @param fieldName 字段名 * @param fieldName 字段名
* @return 字段值 * @return 字段值
*/ */
private String getContractFieldValueByReflection(TEmployeeContractPre contract, String fieldName) { private String getContractFieldValueByReflection(TEmployeeContractPre contract, String fieldName, String fieldType, String fieldValue) {
if (contract == null || fieldName == null) { if (contract == null || fieldName == null) {
return null; return null;
} }
...@@ -492,7 +513,7 @@ public class FascUtil { ...@@ -492,7 +513,7 @@ public class FascUtil {
java.lang.reflect.Method method = contract.getClass().getMethod(getterMethodName); java.lang.reflect.Method method = contract.getClass().getMethod(getterMethodName);
Object value = method.invoke(contract); Object value = method.invoke(contract);
String valueStr = String.valueOf(value); String valueStr = String.valueOf(value);
valueStr = this.getCoverValue(contract, fieldName, valueStr); valueStr = this.getCoverValue(valueStr, fieldType, fieldValue);
return valueStr; return valueStr;
} catch (Exception e) { } catch (Exception e) {
// 如果找不到对应的方法,尝试直接匹配字段名 // 如果找不到对应的方法,尝试直接匹配字段名
...@@ -508,27 +529,82 @@ public class FascUtil { ...@@ -508,27 +529,82 @@ public class FascUtil {
} }
// 翻译字典 // 翻译字典
private String getCoverValue(TEmployeeContractPre contract, String fieldName, String valueStr) throws NoSuchFieldException { private String getCoverValue(String valueStr, String fieldType, String fieldValue) {
if (Common.isNotNull(valueStr) && isInteger(valueStr)) { if (Common.isNotNull(valueStr) && (Common.isNotNull(fieldType))) {
java.lang.reflect.Field field = contract.getClass().getDeclaredField(fieldName); if (DATA_COVER.equals(fieldType)) {
field.setAccessible(true); valueStr = convertByExp(fieldValue, valueStr);
// 检查ExcelAttribute注解 } else if (DATE_FORMAT.equals(fieldType)) {
ExcelAttribute excelAnnotation = field.getAnnotation(ExcelAttribute.class); valueStr = formatStringDate(fieldValue, valueStr);
if (excelAnnotation != null && excelAnnotation.isDataId()) {
String converterExp = excelAnnotation.readConverterExp();
if (converterExp != null && !converterExp.isEmpty()) {
valueStr = convertByExp(converterExp, valueStr);
}
} }
} }
return 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) { private static String convertByExp(String converterExp, String value) {
if (converterExp == null || value == null) { if (Common.isEmpty(converterExp) || Common.isEmpty(value)) {
return value; return value;
} }
String[] items = converterExp.split(","); String[] items = converterExp.split(",");
...@@ -542,11 +618,6 @@ public class FascUtil { ...@@ -542,11 +618,6 @@ public class FascUtil {
return value; // 如果没有找到匹配的,返回原值 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 { private R<String> submitTask(String requestId, OpenApiClient openApiClient, String accessToken) throws ApiException {
SignTaskClient signTaskClient = new SignTaskClient(openApiClient); SignTaskClient signTaskClient = new SignTaskClient(openApiClient);
...@@ -795,6 +866,7 @@ public class FascUtil { ...@@ -795,6 +866,7 @@ public class FascUtil {
pushLog.setTypeKey("获取附件,身份证:" + empIdCard); pushLog.setTypeKey("获取附件,身份证:" + empIdCard);
pushLog.setTypeName("获取附件"); pushLog.setTypeName("获取附件");
pushLog.setContractId(contract.getId()); pushLog.setContractId(contract.getId());
pushLog.setSignTaskId(contract.getRequestId());
tFascPushLogService.save(pushLog); tFascPushLogService.save(pushLog);
BaseRes<SignTaskGetFileRes> res = signTaskClient.signTaskGetFile(signTaskGetFileReq); BaseRes<SignTaskGetFileRes> res = signTaskClient.signTaskGetFile(signTaskGetFileReq);
......
...@@ -337,6 +337,7 @@ ...@@ -337,6 +337,7 @@
WHEN a.process_status =6 THEN "签署中" WHEN a.process_status =6 THEN "签署中"
WHEN a.process_status =7 THEN "签署失败" WHEN a.process_status =7 THEN "签署失败"
WHEN a.process_status =8 THEN "电子待归档" WHEN a.process_status =8 THEN "电子待归档"
WHEN a.process_status =11 THEN "撤销签署-系统自动撤销"
ELSE a.process_status END as process_status, ELSE a.process_status END as process_status,
if(b.id is null,'否','是') archives_is_create if(b.id is null,'否','是') archives_is_create
FROM t_employee_contract_pre a FROM t_employee_contract_pre a
......
...@@ -28,12 +28,16 @@ ...@@ -28,12 +28,16 @@
<result property="hrField" column="hr_field"/> <result property="hrField" column="hr_field"/>
<result property="hrFieldId" column="hr_field_id"/> <result property="hrFieldId" column="hr_field_id"/>
<result property="contractType" column="contract_type"/> <result property="contractType" column="contract_type"/>
<result property="fieldType" column="field_type"/>
<result property="fieldValue" column="field_value"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.id, a.id,
a.hr_field, a.hr_field,
a.hr_field_id, a.hr_field_id,
a.contract_type a.contract_type,
a.field_type,
a.field_value
</sql> </sql>
<sql id="tFascHrField_where"> <sql id="tFascHrField_where">
<if test="tFascHrField != null"> <if test="tFascHrField != null">
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
<result property="signTemplateStatus" column="sign_template_status"/> <result property="signTemplateStatus" column="sign_template_status"/>
<result property="contractType" column="contract_type"/> <result property="contractType" column="contract_type"/>
<result property="fascDocId" column="fasc_doc_id"/> <result property="fascDocId" column="fasc_doc_id"/>
<result property="fieldType" column="field_type"/>
<result property="fieldValue" column="field_value"/>
</resultMap> </resultMap>
<resultMap id="tFascTemplateDetailExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TFascTemplateDetailExportVo"> <resultMap id="tFascTemplateDetailExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TFascTemplateDetailExportVo">
...@@ -151,11 +153,31 @@ ...@@ -151,11 +153,31 @@
FROM t_fasc_template_detail a 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_template b on a.sign_template_id = b.sign_template_id
<where> <where>
1=1 b.delete_Flag = '0'
<include refid="tFascTemplateDetail_where"/> <include refid="tFascTemplateDetail_where"/>
</where> </where>
ORDER BY a.CREATE_TIME ASC ORDER BY a.CREATE_TIME ASC
</select> </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简单分页查询--> <!--tFascTemplateDetail简单分页查询-->
<select id="getTFascTemplateDetailList" resultMap="tFascTemplateDetailMap"> <select id="getTFascTemplateDetailList" resultMap="tFascTemplateDetailMap">
SELECT SELECT
...@@ -186,8 +208,8 @@ ...@@ -186,8 +208,8 @@
FROM t_fasc_template_detail a 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_template b on a.sign_template_id = b.sign_template_id
<where> <where>
1=1 b.delete_Flag = '0'
<include refid="tFascTemplateDetail_where"/> <include refid="tFascTemplateDetail_where"/>
<if test="idList != null and idList.size>0"> <if test="idList != null and idList.size>0">
AND a.id in AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")"> <foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
...@@ -209,8 +231,8 @@ ...@@ -209,8 +231,8 @@
FROM t_fasc_template_detail a 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_template b on a.sign_template_id = b.sign_template_id
<where> <where>
1=1 b.delete_Flag = '0'
<include refid="tFascTemplateDetail_where"/> <include refid="tFascTemplateDetail_where"/>
<if test="idList != null and idList.size>0"> <if test="idList != null and idList.size>0">
AND a.id in AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")"> <foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
......
...@@ -648,6 +648,8 @@ public interface CommonConstants { ...@@ -648,6 +648,8 @@ public interface CommonConstants {
List<String> socialInfoStatus = Stream.of("1","3","5","7").collect(Collectors.toList()); 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> processInsurancesStatus = Stream.of("1","2","5").collect(Collectors.toList());
List<String> processListPreArchivesStatus = Stream.of("0","1","2","3","4","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 ...@@ -208,13 +208,17 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
BeanUtils.copyProperties(preVo, pre); BeanUtils.copyProperties(preVo, pre);
//时间格式转化 //时间格式转化
if (Common.isNotNull(preVo.getExpectedCollectionTime())) { 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())); pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
} }
if (Common.isNotNull(preVo.getExpectedConfirmTime())) { 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())); pre.setExpectedConfirmTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedConfirmTime()));
} }
if (Common.isEmpty(pre.getDispatchItem())) { if (Common.isEmpty(pre.getDispatchItem())) {
preVo.setDispatchItem("养老、医疗、生育、失业、工伤、大病"); pre.setDispatchItem("养老、医疗、生育、失业、工伤、大病");
} }
//如果自动触发派增为是,计算派单发起时间和派单确认时间 //如果自动触发派增为是,计算派单发起时间和派单确认时间
if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis()) if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis())
...@@ -240,6 +244,8 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -240,6 +244,8 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 15:20", DateUtil.DATETIME_PATTERN_MINUTE)); preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 15:20", DateUtil.DATETIME_PATTERN_MINUTE));
preVo.setExpectedConfirmTime(DateUtil.parseDate(DateUtil.dateToString( preVo.setExpectedConfirmTime(DateUtil.parseDate(DateUtil.dateToString(
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 09:00", DateUtil.DATETIME_PATTERN_MINUTE)); 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)) { if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId()); pre.setId(preExit.getId());
......
...@@ -315,7 +315,7 @@ ...@@ -315,7 +315,7 @@
<select id="getTDispatchInfoPrePage" resultMap="tDispatchInfoPreMap"> <select id="getTDispatchInfoPrePage" resultMap="tDispatchInfoPreMap">
SELECT SELECT
<include refid="Base_Column_List"/> <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 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 left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where> <where>
...@@ -365,6 +365,7 @@ ...@@ -365,6 +365,7 @@
a.DELETE_FLAG = '0' a.DELETE_FLAG = '0'
<include refid="tDispatchInfoPre_where"/> <include refid="tDispatchInfoPre_where"/>
</where> </where>
group by a.id
order by a.create_time desc order by a.create_time desc
<if test="tDispatchInfoPre.limitStart != null"> <if test="tDispatchInfoPre.limitStart != null">
limit #{tDispatchInfoPre.limitStart},#{tDispatchInfoPre.limitEnd} 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