Commit 77dd2305 authored by hongguangwu's avatar hongguangwu

MVP1.7.16-法大大

parent d73818dd
......@@ -88,6 +88,7 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "法大大模版名称")
private String fadadaTemplate;
@Schema(description = "数据来源1客户端 2客服端")
private String dataSource;
......@@ -288,4 +289,15 @@ public class TEmployeeContractPre extends BaseEntity {
@TableField(exist = false)
private List<TAttaInfo> attaList;
@Schema(description = "法大大模版ID")
private String fadadaTemplateId;
// 1待发起、5发起失败、7签署失败,可以发起电子签 2025-10-14 18:25:16倩倩
// processStatus = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9已完结10撤销签署")
@Schema(description = "任务ID")
private String requestId;
@Schema(description = "任务信息")
private String requestMsg;
}
......@@ -56,6 +56,14 @@ public class TFascTemplateDetail extends BaseEntity {
@ExcelProperty("模板ID")
@Schema(description = "模板ID")
private String signTemplateId;
/**
* 法大大文档ID
*/
@ExcelAttribute(name = "法大大文档ID", maxLength = 100)
@Length(max = 100, message = "法大大文档ID不能超过100个字符")
@ExcelProperty("法大大文档ID")
@Schema(description = "法大大文档ID")
private String fascDocId;
/**
* 法大大字段
*/
......
......@@ -565,4 +565,13 @@ public class TEmployeeContractPreVo extends RowIndex implements Serializable {
private String revokeReason;
/**
* 法大大模版ID
*/
@Length(max = 50, message = "法大大模版ID 不能超过50 个字符")
@ExcelAttribute(name = "法大大模版ID", maxLength = 50)
@Schema(description = "法大大模版ID")
@ExcelProperty("法大大模版ID")
private String fadadaTemplateId;
}
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.alibaba.fastjson.JSON;
import com.fasc.open.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddReqLog;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.archives.service.FascService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @auther huyc
* @date 2022/6/29
*/
@EnableConfigurationProperties({DaprUpmsProperties.class})
@RestController
@RequiredArgsConstructor
@RequestMapping("/fasc")
......@@ -30,18 +24,6 @@ public class FascController {
@Autowired
private FascService fascService;
@Autowired
private FddReqLogService reqLogService;
@Autowired
private FddPersonAccountService fddPersonAccountService;
@Autowired
private FddContractInfoService fddContractInfoService;
@Autowired
private FddCompanyInfoService fddCompanyInfoService;
@Autowired
private FddContractAttachInfoService fddContractAttachInfoService;
@Autowired
private TEmployeeContractInfoService employeeContractInfoService;
/**
* @param templateName 签署任务模板名称,如果传了该参数,会根据名称模糊匹配查询,长度最大100个字符。
......@@ -51,50 +33,48 @@ public class FascController {
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "获取模板")
@GetMapping("/getTemplate" )
@GetMapping("/getTemplate")
public R<String> getTemplate(@RequestParam(required = false) String templateName) throws ApiException {
return fascService.getTemplate(templateName);
}
/**
* 保存请求参数日志
*
* @param request
*/
private void saveReqLog(HttpServletRequest request) {
Map<String, String[]> parameterMap = request.getParameterMap();
FddReqLog fddReqLog = new FddReqLog();
fddReqLog.setResData(JSON.toJSONString(parameterMap));
fddReqLog.setMethodName(Thread.currentThread().getStackTrace()[1].getMethodName());
fddReqLog.setClassName(Thread.currentThread().getStackTrace()[1].getClassName());
reqLogService.save(fddReqLog);
* @param id 合同待签订任务记录表TEmployeeContractPre:id
* @Description: 发起电子签署
* @Author: hgw
* @Date: 2025/10/13 17:24
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "发起电子签署")
@GetMapping("/submitContract")
public R<String> submitContract(@RequestParam String id) throws ApiException {
return fascService.submitContract(id);
}
//验证签名
public void checkSign(HttpServletRequest request) throws Exception {
/* Map<String, String> paraMap = new HashMap<>(8);
paraMap.put(GlobalConstants.FDD_APPID, request.getHeader(GlobalConstants.FDD_APPID));
paraMap.put(GlobalConstants.FDD_SIGN_TYPE, request.getHeader(GlobalConstants.FDD_SIGN_TYPE));
paraMap.put(GlobalConstants.FDD_TIMESTAMP, request.getHeader(GlobalConstants.FDD_TIMESTAMP));
paraMap.put(GlobalConstants.FDD_NONCE, request.getHeader(GlobalConstants.FDD_NONCE));
paraMap.put(FDD_EVENT, request.getHeader(FDD_EVENT));
String fddBizContent = request.getParameter(FDD_BIZ_CONTENT);
paraMap.put(FDD_BIZ_CONTENT, fddBizContent);
//得到排序后的字符串,FddCryptUtil为法大大提供得签名工具类
String sortParam = FddCryptUtil.sortParameters(paraMap);
//计算之后得到签名 该签名需要放到请求头
String signature = FddCryptUtil.sign(sortParam, request.getHeader(GlobalConstants.FDD_TIMESTAMP), fddConfigProperties.getAppKey());
if (StringUtils.equals(signature, request.getHeader(GlobalConstants.FDD_API_SIGN))) {
FddReqLog fddReqLog = new FddReqLog();
paraMap.put(GlobalConstants.FDD_TIMESTAMP, request.getHeader(GlobalConstants.FDD_TIMESTAMP));
fddReqLog.setReqData(signature);
fddReqLog.setResData(JSON.toJSONString(paraMap));
fddReqLog.setMethodName(Thread.currentThread().getStackTrace()[1].getMethodName());
fddReqLog.setClassName(Thread.currentThread().getStackTrace()[1].getClassName());
reqLogService.save(fddReqLog);
return;
}*/
throw new CheckedException("签名异常");
/**
* @param id 合同待签订任务记录表TEmployeeContractPre:id
* @Description: 撤销签署
* @Author: hgw
* @Date: 2025/10/13 17:24
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "撤销签署")
@GetMapping("/cancelTask")
public R<String> cancelTask(@RequestParam String id) throws ApiException {
return fascService.cancelTask(id);
}
/**
* @param id 合同待签订任务记录表TEmployeeContractPre:id
* @Description: 催办
* @Author: hgw
* @Date: 2025/10/13 17:24
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "催办")
@GetMapping("/urgeTask")
public R<String> urgeTask(@RequestParam String id) throws ApiException {
return fascService.urgeTask(id);
}
}
......@@ -32,4 +32,14 @@ public interface FascService extends IService<FddContractInfo> {
// 获取模板
R<String> getTemplate(String templateName) throws ApiException;
// 推送法大大任务
R<String> submitContract(String id) throws ApiException;
// 撤销签署任务
R<String> cancelTask(String id) throws ApiException;
// 催办签署任务
R<String> urgeTask(String id) throws ApiException;
}
......@@ -19,23 +19,18 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasc.open.api.exception.ApiException;
import com.fasc.open.api.v5_1.res.template.SignTemplateListInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascEditLog;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascTemplate;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascTemplateDetail;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.utils.FascUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 法大大专业版
......@@ -54,6 +49,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
private final TFascPushLogService tFascPushLogService;
private final TFascTemplateService tFascTemplateService;
private final TFascTemplateDetailService tFascTemplateDetailService;
private final TEmployeeContractPreService tEmployeeContractPreService;
@Override
public R<String> getTemplate(String templateName) throws ApiException {
......@@ -95,10 +91,14 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
}
// 主表:
TFascTemplate oldMain;
String logId;
for (TFascTemplate t : tList) {
oldMain = oldMainMap.get(t.getSignTemplateId());
if (oldMain != null) {
t.setId(oldMain.getId());
} else {
logId = String.valueOf(UUID.randomUUID()).replaceAll("-", "");
t.setId(logId);
}
this.addFascLogToList(t.getId(), CommonConstants.ONE_STRING, editContent1, logList);
updateMain.add(t);
......@@ -115,6 +115,9 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
oldDetail = oldDetailMap.get(t.getSignTemplateId() + CommonConstants.DOWN_LINE_STRING + t.getFascFieldId());
if (oldDetail != null) {
t.setId(oldDetail.getId());
} else {
logId = String.valueOf(UUID.randomUUID()).replaceAll("-", "");
t.setId(logId);
}
this.addFascLogToList(t.getId(), CommonConstants.TWO_STRING, editContent1, logList);
updateDetail.add(t);
......@@ -157,4 +160,90 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
}
/**
* @param id TEmployeeContractPre主键
* @Description: 推送法大大任务
* @Author: hgw
* @Date: 2025/10/15 16:40
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> submitContract(String id) throws ApiException {
// templateName 签署任务模板名称
TEmployeeContractPre contract = tEmployeeContractPreService.getById(id);
if (contract == null) {
return R.failed("未找到合同");
}
if (Common.isEmpty(contract.getFadadaTemplateId())) {
return R.failed("未找到合同模板ID,请联系管理员");
}
if (Common.isEmpty(contract.getSignType())) {
return R.failed("签署方式为空,请联系管理员");
} else if (!CommonConstants.ONE_STRING.equals(contract.getSignType())) {
return R.failed("签署方式不是电子签,不可发起电子签署");
}
if (Common.isEmpty(contract.getProcessStatus())) {
return R.failed("合同无状态,请联系管理员");
} else if (!CommonConstants.dingleDigitStrArray[1].equals(contract.getProcessStatus())
&& !CommonConstants.dingleDigitStrArray[5].equals(contract.getProcessStatus())
&& !CommonConstants.dingleDigitStrArray[7].equals(contract.getProcessStatus())) {
return R.failed("合同状态不是待发起、发起失败、签署失败,不可发起电子签署!");
}
if (Common.isNotNull(contract.getRequestId())) {
return R.failed("合同已发起,请勿重复发起!");
}
// TODO - 判断是否入职超过1个月
R<String> requestInfo = fascUtil.submitContract(contract, tFascPushLogService, tEmployeeContractPreService);
return requestInfo;
}
/**
* @param id TEmployeeContractPre主键
* @Description: 撤销签署任务
* @Author: hgw
* @Date: 2025/10/15 16:40
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> cancelTask(String id) throws ApiException {
// templateName 签署任务模板名称
TEmployeeContractPre contract = tEmployeeContractPreService.getById(id);
if (contract == null) {
return R.failed("未找到合同");
}
if (Common.isEmpty(contract.getRequestId())) {
return R.failed("无requestId,请检查数据");
}
// TODO - 判断什么状态撤销等,需要产品定
return fascUtil.cancelTask(contract, tFascPushLogService, tEmployeeContractPreService);
}
/**
* @param id TEmployeeContractPre主键
* @Description: 催办签署任务
* @Author: hgw
* @Date: 2025/10/15 17:56
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> urgeTask(String id) throws ApiException {
// templateName 签署任务模板名称
TEmployeeContractPre contract = tEmployeeContractPreService.getById(id);
if (contract == null) {
return R.failed("未找到合同");
}
if (Common.isEmpty(contract.getRequestId())) {
return R.failed("无requestId,请检查数据");
}
// TODO - 判断什么状态催办等,需要产品定
return fascUtil.urgeTask(contract, tFascPushLogService, tEmployeeContractPreService);
}
}
......@@ -36,5 +36,10 @@ public interface FascConstants {
// 控件类型是印章
String FIELD_ZHANG_TYPE = "corp_seal,corp_seal_cross_page";
// 撤销签署失败原因为 已完成签署(处理的同时员工完成签署公司免验证签完成),则更新为签署完成的“待归档”状态。
String FIELD_REASON = "已完成签署";
// 超时未签署自行变更为线下签
String TIME_OUT_REASON = "超时未签署自行变更为线下签";
//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";
}
......@@ -8,6 +8,7 @@ spring:
redis:
host: 127.0.0.1
port: 6379
password: '@yf_2017'
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
......
......@@ -24,6 +24,7 @@
<result property="errorInfo" column="error_info"/>
<result property="errorTime" column="error_time"/>
<result property="fadadaTemplate" column="fadada_template"/>
<result property="fadadaTemplateId" column="fadada_template_id"/>
<result property="dataSource" column="data_source"/>
<result property="expectedCollectionTime" column="expected_collection_time"/>
<result property="contractStart" column="contract_start"/>
......@@ -84,7 +85,9 @@
<result property="createName" column="create_name"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="contractSubName" column="CONTRACT_SUB_NAME,"/>
<result property="contractSubName" column="CONTRACT_SUB_NAME"/>
<result property="requestId" column="request_id"/>
<result property="requestMsg" column="request_msg"/>
</resultMap>
<sql id="Base_Column_List">
id
......@@ -103,6 +106,7 @@
,customer_user_loginname
,sign_type
,fadada_template
,fadada_template_id
,data_source
,expected_confirm_time
,expected_collection_time
......@@ -165,6 +169,8 @@
,TASK
,TASK_TYPE
,TASK_END_STANDARD,contract_flag,a.CONTRACT_SUB_NAME
,a.request_id
,a.request_msg
</sql>
<sql id="tEmployeeContractPre_where">
<if test="tEmployeeContractPre != null">
......
......@@ -41,6 +41,7 @@
<result property="signTemplateName" column="sign_template_name"/>
<result property="signTemplateStatus" column="sign_template_status"/>
<result property="contractType" column="contract_type"/>
<result property="fascDocId" column="fasc_doc_id"/>
</resultMap>
<resultMap id="tFascTemplateDetailExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TFascTemplateDetailExportVo">
......@@ -59,6 +60,7 @@
<sql id="Base_Column_List">
a.id,
a.sign_template_id,
a.fasc_doc_id,
a.fasc_field,
a.fasc_field_id,
a.is_must,
......
......@@ -202,6 +202,7 @@ public interface CacheConstants {
String FASC_ACCOSS_TOKEN = "FASC_ACCOSS_TOKEN";
// 如果idType为corp:代表应用系统上的企业用户,主体方是openCorpId所指定的企业
String FASC_ID_TYPE = "corp";
String FASC_ID_TYPE_PERSON = "person";
/**
* 登录用户最近一次选择的收入证明单位名称
......
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