Commit 0416aa07 authored by fangxinjiang's avatar fangxinjiang

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

parents 6a1a27be a2773c1e
......@@ -98,6 +98,13 @@ public class TAutoContractScheme extends BaseEntity {
@ExcelProperty("发大大电子签模板")
@Schema(description = "发大大电子签模板")
private String fadadaTemplate;
/**
* 发大大电子签模板ID
*/
@ExcelAttribute(name = "发大大电子签模板ID", maxLength = 50)
@ExcelProperty("发大大电子签模板ID")
@Schema(description = "发大大电子签模板ID")
private String fadadaTemplateId;
/**
* 签订期限 0 固定期限 1 无固定期限 3.以完成一定工作任务为期限
* // 电子签-签订期限(既有字典)
......
......@@ -391,7 +391,7 @@ public class TEmployeeContractInfo extends BaseEntity {
/**
* 审核状态(0:待提交;1:待审核;2审核通过;3审核不通过)
*/
@Schema(description = "审核状态(0:待提交;1:待审核;2审核通过;3审核不通过)")
@Schema(description = "审核状态(0:待提交;1:待审核;2审核通过;3审核不通过;4签署中;5撤销签署;6签署失败)")
private Integer auditStatus;
/**
......@@ -507,7 +507,7 @@ public class TEmployeeContractInfo extends BaseEntity {
* @Date 14:50 2022/11/7
**/
@ExcelAttribute(name = "审核类型",readConverterExp = "0=派增,1=派减")
@Schema(description = "审核类型:0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止")
@Schema(description = "审核类型:0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止、5自动化派单-无需审核")
private String type;
/**
......
......@@ -88,6 +88,9 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "法大大模版名称")
private String fadadaTemplate;
@Schema(description = "电子签转线下签的原因")
private String changeTypeReason;
@Schema(description = "数据来源1客户端 2客服端")
private String dataSource;
......
......@@ -49,7 +49,7 @@ public class EmployeeContractExportAuditVO implements Serializable {
* 3、合同申请处申请类型为:作废——审核类型统一为:派减-作废;终止——审核类型统一为:派减-终止;
* @Date 14:50 2022/11/7
**/
@ExcelAttribute(name = "审核类型",readConverterExp = "0=派增-社保派单,1=派增-无社保新签,2=派增-续签,3=派减-作废,4=派减-终止")
@ExcelAttribute(name = "审核类型",readConverterExp = "0=派增-社保派单,1=派增-无社保新签,2=派增-续签,3=派减-作废,4=派减-终止,5=自动化派单-无需审核")
@Schema(description = "审核类型")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("审核类型")
......
......@@ -46,14 +46,14 @@ public class EmployeeContractExportVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* @Author fxj
* @Description 0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止
* @Description 0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止、5自动化派单-无需审核
* 1、增加“审核类型”,内容为:派增-社保派单、派增-无社保新签、派增-续签、派减-作废、派减-终止
* 2、社保派单过来的合同,审核类型统一为:派增-社保派单;
* 3、合同申请处申请类型为:新签(正常签订)——审核类型为:派增-无社保新签、;续签(合同未到期重新签订、离职再入职、商务合同更改)——审核类型统一为:派增-续签;
* 3、合同申请处申请类型为:作废——审核类型统一为:派减-作废;终止——审核类型统一为:派减-终止;
* @Date 14:50 2022/11/7
**/
@ExcelAttribute(name = "审核类型",readConverterExp = "0=派增-社保派单,1=派增-无社保新签,2=派增-续签,3=派减-作废,4=派减-终止")
@ExcelAttribute(name = "审核类型",readConverterExp = "0=派增-社保派单,1=派增-无社保新签,2=派增-续签,3=派减-作废,4=派减-终止,5=自动化派单-无需审核")
@Schema(description = "审核类型")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("审核类型")
......@@ -187,7 +187,7 @@ public class EmployeeContractExportVO implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("审核状态")
@ExcelAttribute(name = "审核状态", readConverterExp = "0=待提交,1=待审核,2=审核通过,3=审核不通过")
@ExcelAttribute(name = "审核状态", readConverterExp = "0=待提交,1=待审核,2=审核通过,3=审核不通过,4=签署中,5=撤销签署,6=签署失败")
@Schema(description = "审核状态")
private String auditStatus;
......
......@@ -86,6 +86,27 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@Schema(description = "社保缴纳地-县")
@ExcelProperty("社保缴纳地-县")
private String socialTown;
/**
* 社保缴纳地-省
*/
@ExcelAttribute(name = "社保缴纳地-省id")
@ExcelProperty("社保缴纳地-省")
@Schema(description = "社保缴纳地-省")
private String socialProvinceId;
/**
* 社保缴纳地-市
*/
@ExcelAttribute(name = "社保缴纳地-市")
@ExcelProperty("社保缴纳地-市")
@Schema(description = "社保缴纳地-市")
private String socialCityId;
/**
* 社保缴纳地-县
*/
@ExcelAttribute(name = "社保缴纳地-县")
@ExcelProperty("社保缴纳地-县")
@Schema(description = "社保缴纳地-县")
private String socialTownId;
/**
* 公积金缴纳地-省
*/
......
......@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fadada.api.utils.crypt.FddCryptUtil;
import com.fasc.open.api.constants.RequestConstants;
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.FascConfig;
import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
......@@ -14,6 +16,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
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.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -23,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -43,6 +47,12 @@ public class FascController {
@Autowired
private FascConfig fascConfig;
@Autowired
private WxConfig wxConfig;
@Autowired
private UpmsDaprUtils upmsDaprUtils;
private final TFascPushLogService tFascPushLogService;
private final TEmployeeContractPreService tEmployeeContractPreService;
private final TEmployeeContractInfoService tEmployeeContractInfoService;
......@@ -79,6 +89,19 @@ public class FascController {
return fascService.getTemplate(templateName);
}
/**
* @param signTemplateId 签署任务模板ID
* @Description: 获取模板详情预览链接
* @Author: hgw
* @Date: 2025/9/26 16:21
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "获取模板详情预览链接")
@GetMapping("/getTemplateDetailUrl")
public R<String> getTemplateDetailUrl(@RequestParam String signTemplateId) throws ApiException {
return fascService.getTemplateDetailUrl(signTemplateId);
}
/**
* @param id 合同待签订任务记录表TEmployeeContractPre:id
* @Description: 发起电子签署
......@@ -252,6 +275,9 @@ public class FascController {
contractInfo.setInUse(CommonConstants.ONE_STRING);
tEmployeeContractInfoService.updateById(contractInfo);
//签署失败发送企微消息
sendFddFalureInfoToWx(pre);
// 加日志
this.saveAuditLogFail(pre, "签署失败", terminationNote);
pushLog.setReturnData("签署任务参与方签署失败事件:fddEvent:" + fddEvent + FASC_BIZ_CONTENT_STR + fddBizContent);
......@@ -325,4 +351,48 @@ public class FascController {
return true;
}
/**
* 发送法大大失败提醒通知到企微
* @param pre 合同待购买
*/
private void sendFddFalureInfoToWx(TEmployeeContractPre pre) {
//获取前端客服
SysUser user;
if (Common.isEmpty(pre.getCustomerUserLoginname())) {
return;
}
R<SysUser> res = upmsDaprUtils.getSimpleUserByLoginName(pre.getCustomerUserLoginname());
if (Common.isNotNull(res) && Common.isNotNull(res.getData())) {
user = res.getData();
} else {
return;
}
StringBuilder sendUser = null;
if (Common.isNotKong(user.getWxMessage())) {
sendUser = new StringBuilder(user.getWxMessage());
}
if (sendUser != null) {
RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid()
, wxConfig.getDomainName() + "/auth/oauth/wxLogin", "72" + pre.getId());
StringBuilder description = new StringBuilder();
String title = "作业自动化——电子合同签署超期自动撤回提醒";
description.append(pre.getEmployeeName() + "-" + pre.getEmpIdcard()+ "-" + pre.getEmpPhone() +
",电子合同签署失败").append("<br>");
description.append("请及时处理,以免产生用工风险!").append("<br>");
textcard.put("title", title);
textcard.put("url", authUrl);
textcard.put("description", description.toString());
requestMap.put("touser", sendUser);
requestMap.put("agentid", wxConfig.getAgentid());
requestMap.put("msgtype", "textcard");
requestMap.put("textcard", textcard);
// 必须加上header说明
if (!wxConfig.sendTextCard(restTemplate, requestMap)) {
wxConfig.sendTextCard(restTemplate, requestMap);
}
}
}
}
......@@ -33,6 +33,9 @@ public interface FascService extends IService<FddContractInfo> {
// 获取模板
R<String> getTemplate(String templateName) throws ApiException;
// 获取模板详情预览链接
R<String> getTemplateDetailUrl(String signTemplateId) throws ApiException;
// 推送法大大任务
R<String> submitContract(String id) throws ApiException;
......
......@@ -159,6 +159,13 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
return R.ok();
}
// 获取模板详情预览链接
@Override
public R<String> getTemplateDetailUrl(String signTemplateId) throws ApiException {
// templateName 签署任务模板名称
return fascUtil.getTemplateDetailUrl(signTemplateId, tFascPushLogService);
}
/**
* 向list里添加新日志
*/
......@@ -188,6 +195,12 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
if (Common.isEmpty(contract.getContractId())) {
return R.failed("未生成合同,请联系管理员");
}
TEmployeeContractInfo empContract = tEmployeeContractInfoMapper.selectById(contract.getContractId());
if (empContract == null) {
return R.failed(FASC_NO_EMP_CONTRACT);
}
if (Common.isEmpty(contract.getFadadaTemplateId())) {
return R.failed("未找到合同模板ID,请联系管理员");
}
......@@ -206,10 +219,6 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
if (Common.isNotNull(contract.getRequestId())) {
return R.failed("合同已发起,请勿重复发起!");
}
TEmployeeContractInfo empContract = tEmployeeContractInfoMapper.selectById(contract.getContractId());
if (empContract == null) {
return R.failed(FASC_NO_EMP_CONTRACT);
}
TFascTemplate tFascTemplate = tFascTemplateService.getById(contract.getFadadaTemplateId());
if (tFascTemplate == null) {
return R.failed(FASC_NO_TEMPLATE);
......@@ -219,9 +228,9 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
TFascTemplateDetail detail = new TFascTemplateDetail();
detail.setSignTemplateId(contract.getFadadaTemplateId());
List<TFascTemplateDetail> detailList = tFascTemplateDetailService.getTFascTemplateDetailList(detail);
// TODO - 判断是否入职超过1个月
// - 判断是否入职超过1个月——接口入口做了
R<String> requestInfo = fascUtil.submitContract(contract, tFascPushLogService, tEmployeeContractPreMapper);
R<String> requestInfo = fascUtil.submitContract(contract, tFascPushLogService, tEmployeeContractPreMapper, tFascTemplate, detailList);
return requestInfo;
}
......
......@@ -621,6 +621,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
//正常签订
tEmployeeContractInfo.setType(CommonConstants.ONE_STRING);
}
if (Common.isNotNull(tEmployeeContractInfo.getSignType()) && "0".equals(tEmployeeContractInfo.getSignType())) {
tEmployeeContractInfo.setType(CommonConstants.FIVE_STRING);
}
}
/**
......@@ -1436,8 +1439,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} else {
insert.setEmpId(project.getEmpId());
insert.setSettleDomain(project.getDeptId());
//电子签更新为签署中
if (Common.isNotNull(insert.getSignType()) && "0".equals(insert.getSignType())) {
insert.setAuditStatus(CommonConstants.FOUR_INT);
} else {
// 批量直接待审核
insert.setAuditStatus(CommonConstants.ONE_INT);
}
if (Common.isEmpty(insert.getContractTerm())
&& Common.isNotNull(insert.getContractStart())
&& Common.isNotNull(insert.getContractEnd())) {
......
......@@ -388,6 +388,12 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
try {
result = fascService.submitContract(contractPre.getId());
} catch (Exception e) {
// 更新合同:
if (Common.isNotNull(contractPre.getContractId())) {
TEmployeeContractInfo empContract = contractInfoService.getById(contractPre.getContractId());
empContract.setDeleteFlag(CommonConstants.ONE_INT);
contractInfoService.updateById(empContract);
}
log.error("法大大推送执行异常", e);
}
if (result == null || result.getCode() != CommonConstants.SUCCESS) {
......@@ -397,10 +403,16 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
// 更新processStatus为电子签发起失败
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPre::getId, contractPre.getId())
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.SIX_STRING)
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPre::getErrorInfo, errorMsg)
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper);
// 更新合同:
if (Common.isNotNull(contractPre.getContractId())) {
TEmployeeContractInfo empContract = contractInfoService.getById(contractPre.getContractId());
empContract.setDeleteFlag(CommonConstants.ONE_INT);
contractInfoService.updateById(empContract);
}
// 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg);
......@@ -753,7 +765,8 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
updateWrapper.eq(TEmployeeContractPre::getId, contractPre.getId())
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.ONE_STRING) // 待发起
.set(TEmployeeContractPre::getSignType, CommonConstants.ONE_STRING) // 线下签
.set(TEmployeeContractPre::getRevokeReason, "超时未签署自行变更为线下签");
.set(TEmployeeContractPre::getRevokeReason, "超时未签署自行变更为线下签")
.set(TEmployeeContractPre::getChangeTypeReason, "超时未签署自行变更为线下签");
this.update(updateWrapper);
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("撤销签署");
......
......@@ -41,5 +41,9 @@ public interface FascConstants {
// 超时未签署自行变更为线下签
String TIME_OUT_REASON = "超时未签署自行变更为线下签";
// 需要额外转化的字段:
String CONTRACT_DURATION = "contractDurationYear-Month";
String DISPATCH_PERIOD = "dispatchPeriodYear-Month";
//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";
}
......@@ -13,15 +13,13 @@ import com.fasc.open.api.v5_1.client.SignTaskClient;
import com.fasc.open.api.v5_1.client.TemplateClient;
import com.fasc.open.api.v5_1.req.signtask.*;
import com.fasc.open.api.v5_1.req.template.GetSignTemplateListReq;
import com.fasc.open.api.v5_1.req.template.GetTemplatePreviewUrlReq;
import com.fasc.open.api.v5_1.req.template.SignTemplateDetailReq;
import com.fasc.open.api.v5_1.req.template.SignTemplateListFilterInfo;
import com.fasc.open.api.v5_1.res.service.AccessTokenRes;
import com.fasc.open.api.v5_1.res.signtask.CreateSignTaskRes;
import com.fasc.open.api.v5_1.res.signtask.SignTaskGetFileRes;
import com.fasc.open.api.v5_1.res.template.DocumentInfo;
import com.fasc.open.api.v5_1.res.template.SignTemplateDetailRes;
import com.fasc.open.api.v5_1.res.template.SignTemplateListInfo;
import com.fasc.open.api.v5_1.res.template.SignTemplateListRes;
import com.fasc.open.api.v5_1.res.template.*;
import com.yifu.cloud.plus.v1.yifu.archives.config.FascConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
......@@ -31,17 +29,13 @@ 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.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLDecoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
......@@ -317,7 +311,8 @@ public class FascUtil {
}
public R<String> submitContract(TEmployeeContractPre contract, TFascPushLogService tFascPushLogService
, TEmployeeContractPreMapper tEmployeeContractPreMapper) throws ApiException {
, TEmployeeContractPreMapper tEmployeeContractPreMapper
, TFascTemplate tFascTemplate, List<TFascTemplateDetail> detailList) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
String accessToken = this.getFascToken(openApiClient);
OpenId openId = new OpenId();
......@@ -362,7 +357,7 @@ public class FascUtil {
tFascPushLogService.updateById(pushLog);
if (Common.isNotNull(requestId)) {
// 第二步:填写控件
R<String> sendValue = buildDocFieldValue(contract, requestId, openApiClient, accessToken);
R<String> sendValue = buildDocFieldValue(contract, requestId, openApiClient, accessToken, detailList);
if (R.isSuccess(sendValue)) {
// 第三步:提交任务
sendValue = submitTask(requestId, openApiClient, accessToken);
......@@ -400,15 +395,42 @@ public class FascUtil {
tEmployeeContractPreMapper.updateById(contract);
}
// 第二步:填写控件
private R<String> buildDocFieldValue(TEmployeeContractPre contract, String requestId
, OpenApiClient openApiClient, String accessToken) throws ApiException {
, OpenApiClient openApiClient, String accessToken
, List<TFascTemplateDetail> detailList) throws ApiException {
SignTaskClient signTaskClient = new SignTaskClient(openApiClient);
FillFieldValuesReq fillFieldValuesReq = new FillFieldValuesReq();
fillFieldValuesReq.setSignTaskId(requestId);
List<DocFieldValueInfo> docFieldValues = new ArrayList<>();
DocFieldValueInfo dfv = new DocFieldValueInfo();
if (detailList != null && !detailList.isEmpty()) {
DocFieldValueInfo dfv;
String fieldValue;
String fieldName;
for (TFascTemplateDetail detail : detailList) {
if (Common.isNotNull(detail.getHrFieldId()) && Common.isNotNull(detail.getHrField())) {
dfv = new DocFieldValueInfo();
dfv.setDocId(detail.getFascDocId());
dfv.setFieldId(detail.getFascFieldId());
// 转化字段
fieldName = detail.getHrFieldId();
if (FascConstants.CONTRACT_DURATION.equals(fieldName)) {
fieldValue = contract.getContractDurationYear() + CommonConstants.DOWN_LINE_STRING + contract.getContractDurationMonth();
} else if (FascConstants.DISPATCH_PERIOD.equals(fieldName)) {
fieldValue = contract.getDispatchPeriodYear() + CommonConstants.DOWN_LINE_STRING + contract.getDispatchPeriodMonth();
} else {
fieldValue = this.getContractFieldValueByReflection(contract, fieldName);
}
dfv.setFieldValue(fieldValue);
docFieldValues.add(dfv);
}
}
}
/*DocFieldValueInfo dfv = new DocFieldValueInfo();
dfv.setDocId("78112332");
dfv.setFieldId("9738851979");
dfv.setFieldValue(contract.getEmployeeName());
......@@ -417,7 +439,7 @@ public class FascUtil {
dfv.setDocId("78112332");
dfv.setFieldId("2324432163");
dfv.setFieldValue(contract.getEmpIdcard());
docFieldValues.add(dfv);
docFieldValues.add(dfv);*/
fillFieldValuesReq.setDocFieldValues(docFieldValues);
fillFieldValuesReq.setAccessToken(accessToken);
......@@ -431,6 +453,39 @@ public class FascUtil {
return R.failed("res无返回");
}
/**
* 使用反射根据字段名获取合同对象中对应字段的值
* @param contract 合同对象
* @param fieldName 字段名
* @return 字段值
*/
private String getContractFieldValueByReflection(TEmployeeContractPre contract, String fieldName) {
if (contract == null || fieldName == null) {
return null;
}
try {
// 获取对应的getter方法名
String getterMethodName = "get" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
// 获取方法并调用
java.lang.reflect.Method method = contract.getClass().getMethod(getterMethodName);
Object value = method.invoke(contract);
return value != null ? value.toString() : null;
} catch (Exception e) {
// 如果找不到对应的方法,尝试直接匹配字段名
try {
java.lang.reflect.Field field = contract.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
Object value = field.get(contract);
return value != null ? value.toString() : null;
} catch (Exception ex) {
return null;
}
}
}
// 第三步:提交任务
private R<String> submitTask(String requestId, OpenApiClient openApiClient, String accessToken) throws ApiException {
SignTaskClient signTaskClient = new SignTaskClient(openApiClient);
......@@ -610,16 +665,53 @@ public class FascUtil {
return R.failed("res无返回");
}
// 获取模板详情预览链接
public R<String> getTemplateDetailUrl(String signTemplateId, TFascPushLogService tFascPushLogService) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
String accessToken = this.getFascToken(openApiClient);
TemplateClient templateClient = new TemplateClient(openApiClient) ;
GetTemplatePreviewUrlReq getTemplatePreviewUrlReq = new GetTemplatePreviewUrlReq() ;
getTemplatePreviewUrlReq.setOpenCorpId(fascConfig.getOpenId()) ;
getTemplatePreviewUrlReq.setTemplateId(signTemplateId) ;
getTemplatePreviewUrlReq.setAccessToken(accessToken) ;
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(fascConfig.getOpenId());
pushLog.setPushData(JSON.toJSONString(templateClient, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
pushLog.setTypeKey("获取模板详情预览链接,signTemplateId:" + signTemplateId);
pushLog.setTypeName("获取模板详情预览链接");
pushLog.setContractId(signTemplateId);
tFascPushLogService.save(pushLog);
BaseRes<GetTemplatePreviewUrlRes> res = templateClient.getTemplatePreviewUrl(getTemplatePreviewUrlReq) ;
if (res != null) {
pushLog.setReturnData(JSON.toJSONString(res, features));
pushLog.setTaskStatus(res.isSuccess() ? CommonConstants.ONE_STRING : CommonConstants.TWO_STRING);
tFascPushLogService.updateById(pushLog);
if (res.isSuccess() && Common.isNotNull(res.getData())) {
return R.ok(res.getData().getTemplatePreviewUrl());
} else {
return R.failed(res.getMsg());
}
}
return R.failed("res无返回");
}
// 获取附件
public boolean getFileByRequestId(TEmployeeContractPre contract, TFascPushLogService tFascPushLogService
, TAttaInfoMapper tAttaInfoMapper , OSSUtil ossUtil) throws ApiException {
, TAttaInfoMapper tAttaInfoMapper, OSSUtil ossUtil) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
String accessToken = this.getFascToken(openApiClient);
SignTaskClient signTaskClient = new SignTaskClient(openApiClient) ;
SignTaskGetFileReq signTaskGetFileReq = new SignTaskGetFileReq() ;
signTaskGetFileReq.setSignTaskId(contract.getRequestId()) ;
signTaskGetFileReq.setAccessToken(accessToken) ;
SignTaskClient signTaskClient = new SignTaskClient(openApiClient);
SignTaskGetFileReq signTaskGetFileReq = new SignTaskGetFileReq();
signTaskGetFileReq.setSignTaskId(contract.getRequestId());
signTaskGetFileReq.setAccessToken(accessToken);
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
......@@ -632,7 +724,7 @@ public class FascUtil {
pushLog.setContractId(contract.getId());
tFascPushLogService.save(pushLog);
BaseRes<SignTaskGetFileRes> res = signTaskClient.signTaskGetFile(signTaskGetFileReq) ;
BaseRes<SignTaskGetFileRes> res = signTaskClient.signTaskGetFile(signTaskGetFileReq);
if (res != null) {
pushLog.setReturnData(JSON.toJSONString(res, features));
pushLog.setTaskStatus(res.isSuccess() ? CommonConstants.ONE_STRING : CommonConstants.TWO_STRING);
......
......@@ -30,6 +30,7 @@
<result property="contractType" column="CONTRACT_TYPE"/>
<result property="signatory" column="SIGNATORY"/>
<result property="fadadaTemplate" column="FADADA_TEMPLATE"/>
<result property="fadadaTemplateId" column="FADADA_TEMPLATE_ID"/>
<result property="contractTerm" column="CONTRACT_TERM"/>
<result property="contractDurationYear" column="CONTRACT_DURATION_YEAR"/>
<result property="contractDurationMonth" column="CONTRACT_DURATION_MONTH"/>
......@@ -87,6 +88,7 @@
a.CONTRACT_TYPE,
a.SIGNATORY,
a.FADADA_TEMPLATE,
a.FADADA_TEMPLATE_ID,
a.CONTRACT_TERM,
a.CONTRACT_DURATION_YEAR,
a.CONTRACT_DURATION_MONTH,
......@@ -157,6 +159,9 @@
<if test="tAutoContractScheme.fadadaTemplate != null and tAutoContractScheme.fadadaTemplate.trim() != ''">
AND a.FADADA_TEMPLATE = #{tAutoContractScheme.fadadaTemplate}
</if>
<if test="tAutoContractScheme.fadadaTemplateId != null and tAutoContractScheme.fadadaTemplateId.trim() != ''">
AND a.FADADA_TEMPLATE_ID = #{tAutoContractScheme.fadadaTemplateId}
</if>
<if test="tAutoContractScheme.contractTerm != null and tAutoContractScheme.contractTerm.trim() != ''">
AND a.CONTRACT_TERM = #{tAutoContractScheme.contractTerm}
</if>
......
......@@ -498,6 +498,9 @@
WHEN a.AUDIT_STATUS =1 THEN "待审核"
WHEN a.AUDIT_STATUS =2 THEN "审核通过"
WHEN a.AUDIT_STATUS =3 THEN "审核不通过"
WHEN a.AUDIT_STATUS =4 THEN "签署中"
WHEN a.AUDIT_STATUS =5 THEN "撤销签署"
WHEN a.AUDIT_STATUS =6 THEN "签署失败"
ELSE a.AUDIT_STATUS END as "AUDIT_STATUS",
if(a.IN_USE = 0,'可用','不可用') IN_USE,
if(a.IS_FILE = 0,'有附件','无附件') FILES,
......@@ -514,6 +517,7 @@
WHEN a.type =2 THEN "派增-续签"
WHEN a.type =3 THEN "派减-作废"
WHEN a.type =4 THEN "派减-终止"
WHEN a.type =5 THEN "自动化派单-无需审核"
ELSE a.type END as "type",
b.REMARK,
a.REMARK as memo,
......@@ -575,6 +579,9 @@
WHEN a.AUDIT_STATUS =1 THEN "待审核"
WHEN a.AUDIT_STATUS =2 THEN "审核通过"
WHEN a.AUDIT_STATUS =3 THEN "审核不通过"
WHEN a.AUDIT_STATUS =4 THEN "签署中"
WHEN a.AUDIT_STATUS =5 THEN "撤销签署"
WHEN a.AUDIT_STATUS =6 THEN "签署失败"
ELSE a.AUDIT_STATUS END as "AUDIT_STATUS",
if(a.IN_USE = 0,'可用','不可用') IN_USE,
if(a.IS_FILE = 0,'有附件','无附件') FILES,
......@@ -591,6 +598,7 @@
WHEN a.type =2 THEN "派增-续签"
WHEN a.type =3 THEN "派减-作废"
WHEN a.type =4 THEN "派减-终止"
WHEN a.type =5 THEN "自动化派单-无需审核"
ELSE a.type END as "type",
a.CREATE_TIME,
count(1) CREATE_NUM,
......
......@@ -238,6 +238,9 @@
<if test="tEmployeeContractPre.signType != null and tEmployeeContractPre.signType.trim() != ''">
AND a.sign_type = #{tEmployeeContractPre.signType}
</if>
<if test="tEmployeeContractPre.fadadaTemplateId != null and tEmployeeContractPre.fadadaTemplateId.trim() != ''">
AND a.fadada_template_id = #{tEmployeeContractPre.fadadaTemplateId}
</if>
<if test="tEmployeeContractPre.fadadaTemplate != null and tEmployeeContractPre.fadadaTemplate.trim() != ''">
AND a.fadada_template like CONCAT('%',#{tEmployeeContractPre.fadadaTemplate},'%')
</if>
......
......@@ -98,6 +98,27 @@ public class TDispatchInfoPre extends BaseEntity {
@ExcelProperty("社保缴纳地-县")
@Schema(description = "社保缴纳地-县")
private String socialTown;
/**
* 社保缴纳地-省
*/
@ExcelAttribute(name = "社保缴纳地-省id")
@ExcelProperty("社保缴纳地-省")
@Schema(description = "社保缴纳地-省")
private String socialProvinceId;
/**
* 社保缴纳地-市
*/
@ExcelAttribute(name = "社保缴纳地-市")
@ExcelProperty("社保缴纳地-市")
@Schema(description = "社保缴纳地-市")
private String socialCityId;
/**
* 社保缴纳地-县
*/
@ExcelAttribute(name = "社保缴纳地-县")
@ExcelProperty("社保缴纳地-县")
@Schema(description = "社保缴纳地-县")
private String socialTownId;
/**
* 公积金缴纳地-省
*/
......
......@@ -178,4 +178,20 @@ public class TSocialDeadlineInfo extends BaseEntity {
@Schema(description = "医疗减员截止日期")
private Date medicalEndDateReduce;
/**
* 社保预减员起始日期
*/
@ExcelAttribute(name = "社保预减员起始日期", isDate = true)
@ExcelProperty("社保预减员起始日期")
@Schema(description = "社保预减员起始日期")
private Date socialPreReduceStartDate;
/**
* 社保预减员截止日期
*/
@ExcelAttribute(name = "社保预减员截止日期", isDate = true)
@ExcelProperty("社保预减员截止日期")
@Schema(description = "社保预减员截止日期")
private Date socialPreReduceEndDate;
}
......@@ -1137,6 +1137,17 @@ public class TSocialInfo extends BaseEntity {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("减少时留存的增加时的-医生大税友的任务ID" )
private String addYsdRequestId;
/**
* 是否强制停保:1、仅社保网厅
* 2、税友默认为否,我们默认不推送这个值
*/
@Length(max = 1, message = "是否强制停保 不能超过1个字符" )
@ExcelAttribute(name = "是否强制停保", maxLength = 1)
@Schema(description = "是否强制停保" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("是否强制停保" )
private String sfqztb;
// 以上是转为自动化办理查询使用的
// 派单id,社保士兵使用
......
......@@ -197,4 +197,8 @@ public class SociaFriendYgsAddVo implements Serializable {
@ExcelProperty("离职日")
private String leaveDay;
// 仅社保,税友接口目前不支持医保 2025-10-21 11:49:23 已告知产品振华、客服陈红
@ExcelProperty("是否强制停保" )
private String sfqztb;
}
......@@ -572,6 +572,10 @@ public class SocialFriendConfig {
tszdxx.put("ryszswrq", vo.getLeaveDay());
}
} else {
// 是否强制停保:目前仅社保,税友暂不支持医保
if (Common.isNotNull(vo.getSfqztb()) && "是".equals(vo.getSfqztb())) {
tszdxx.put("sfqztb", vo.getSfqztb());
}
if (Common.isNotNull(vo.getAutoLeaveDoc())) {
tszdxx.put("shjycl", vo.getAutoLeaveDoc());
} else {
......
......@@ -291,6 +291,10 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
TDispatchInfoPreVo pre = new TDispatchInfoPreVo();
BeanUtils.copyProperties(preExit, pre);
if (Common.isNotNull(preExit.getExpectedCollectionTime())) {
pre.setExpectedCollectionTime(LocalDateTimeUtils.convertLDTToDate(preExit.getExpectedCollectionTime()));
pre.setExpectedConfirmTime(LocalDateTimeUtils.convertLDTToDate(preExit.getExpectedConfirmTime()));
}
preSocialListVo.setDispatchInfoPreVo(pre);
}
return preSocialListVo;
......
......@@ -324,6 +324,15 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
//处理社保减少截止时间和医保减少截止时间
initMedicalEndDateReduce(holidayMap, save);
}
// 预减员时间
if (Common.isNotNull(save.getSocialPreReduceStartDate())){
save.setSocialPreReduceStartDate(this.getNewDateByOldDate(save.getSocialPreReduceStartDate()));
}
if (Common.isNotNull(save.getSocialPreReduceEndDate())){
save.setSocialPreReduceEndDate(this.getNewDateByOldDate(save.getSocialPreReduceEndDate()));
//处理社保减少截止时间和医保减少截止时间
initPreEndDateReduce(holidayMap, save);
}
initSocialEndDate(holidayMap, save);
initMedicalEndDate(holidayMap, save);
......@@ -498,6 +507,18 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
initMedicalEndDateReduce(holidayMap,save);
}
// 处理预减员日期
private void initPreEndDateReduce(Map<String, String> holidayMap, TSocialDeadlineInfo save) {
// type 0 休假 1 补班
String day= holidayMap.get(DateUtil.getDay(save.getSocialPreReduceEndDate()));
if (Common.isNotNull(day)){
save.setSocialPreReduceEndDate(DateUtil.addDayByDate(save.getSocialPreReduceEndDate(),CommonConstants.ONE_INT_NEGATE));
}else {
return;
}
initPreEndDateReduce(holidayMap,save);
}
/**
* @Description: 获取 当月启用 的配置
* @Author: hgw
......
......@@ -252,9 +252,9 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
continue;
}
}
// 0:未到时间不动; 1:推送; 2:转人工
// 0:未到时间不动; 1:推送; 2:转人工;3预减员
canPushType = this.getCanPushType(socialSetMap, vo);
if (1 == canPushType) {
if (1 == canPushType || 3 == canPushType) {
try {
socialInfo = new TSocialInfo();
......@@ -688,7 +688,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
* @return: int
**/
private int getCanPushType(Map<String, TSocialDeadlineInfo> socialSetMap, SociaFriendYgsAddVo vo) {
// 0:未到时间不动; 1:推送; 2:转人工
// 0:未到时间不动; 1:推送; 2:转人工;3预减员
int canPushType = 0;
if (socialSetMap != null) {
TSocialDeadlineInfo socialSet;
......@@ -720,7 +720,14 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
if (nowTime.before(start)) {
canPushType = 0;
} else if (nowTime.after(end)) {
start = socialSet.getSocialPreReduceStartDate();
end = socialSet.getSocialPreReduceEndDate();
// 预减员
if (start != null && end != null && start.before(nowTime) && nowTime.before(end)) {
canPushType = 3;
} else {
canPushType = 2;
}
} else {
canPushType = 1;
}
......
......@@ -255,6 +255,8 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
updateSocial.setYgsSocialStartDateNext(nextDate);
}
}
} else if ("该人员存在欠缴记录,是否强制减员".equals(failConfig.getReasonKey())){
updateSocial.setSfqztb("是");
}
ygsHandleStatus = CommonConstants.THREE_STRING;
// 新增流程进展明细
......
......@@ -11,8 +11,11 @@
<result property="processStatus" column="PROCESS_STATUS"/>
<result property="deptId" column="DEPT_ID"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialProvinceId" column="SOCIAL_PROVINCE_ID"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialCityId" column="SOCIAL_CITY_ID"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="socialTownId" column="SOCIAL_TOWN_ID"/>
<result property="fundProvince" column="FUND_PROVINCE"/>
<result property="fundCity" column="FUND_CITY"/>
<result property="fundTown" column="FUND_TOWN"/>
......@@ -135,7 +138,8 @@
a.CREATE_NAME,
a.UPDATE_TIME,
a.CREATE_TIME,
a.DELETE_FLAG,error_info,error_time,a.DISPATCHER_ID,a.error_back_info,a.position,SOCIAL_FUND_ID,a.phone
a.DELETE_FLAG,error_info,error_time,a.DISPATCHER_ID,a.error_back_info,a.position,SOCIAL_FUND_ID,a.phone,
a.SOCIAL_PROVINCE_ID,a.SOCIAL_CITY_ID,a.SOCIAL_TOWN_ID
</sql>
<sql id="tDispatchInfoPre_where">
<if test="tDispatchInfoPre != null">
......
......@@ -45,6 +45,8 @@
<result property="medicalStartDateReduce" column="MEDICAL_START_DATE_REDUCE"/>
<result property="socialEndDateReduce" column="SOCIAL_END_DATE_REDUCE"/>
<result property="medicalEndDateReduce" column="MEDICAL_END_DATE_REDUCE"/>
<result property="SOCIAL_PRE_REDUCE_START_DATE" column="SOCIAL_PRE_REDUCE_START_DATE"/>
<result property="SOCIAL_PRE_REDUCE_END_DATE" column="SOCIAL_PRE_REDUCE_END_DATE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -65,7 +67,9 @@
a.SOCIAL_START_DATE_REDUCE,
a.MEDICAL_START_DATE_REDUCE,
a.SOCIAL_END_DATE_REDUCE,
a.MEDICAL_END_DATE_REDUCE
a.MEDICAL_END_DATE_REDUCE,
a.SOCIAL_PRE_REDUCE_START_DATE,
a.SOCIAL_PRE_REDUCE_END_DATE
</sql>
<sql id="tSocialDeadlineInfo_where">
<if test="tSocialDeadlineInfo != null">
......
......@@ -105,6 +105,7 @@
,DATE_FORMAT(a.CREATE_TIME,"%Y%m") yearMonth
,DATE_FORMAT(now(),"%Y年%m月%d日") nowDay
,s.SOCIAL_HOUSEHOLD huId
,s.SFQZTB sfqztb
</sql>
......
......@@ -155,6 +155,7 @@
<result property="ygsRequestId" column="YGS_REQUEST_ID"/>
<result property="ysdRequestId" column="YSD_REQUEST_ID"/>
<result property="ysdSocialStartDateNext" column="YSD_SOCIAL_START_DATE_NEXT"/>
<result property="sfqztb" column="SFQZTB"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -270,7 +271,8 @@
a.YSD_ADD_ID,
a.YGS_REQUEST_ID,
a.YSD_REQUEST_ID,
a.YSD_SOCIAL_START_DATE_NEXT
a.YSD_SOCIAL_START_DATE_NEXT,
a.SFQZTB
</sql>
<sql id="tSocialInfo_where">
......
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