保密协议集成法大大适配
parent
b9dac47eb9
commit
1d57854bdb
|
@ -31,8 +31,15 @@ public class FaDDContractMapping {
|
||||||
public FaDaDaConfigDTO queryConfig(String workflowId, int type) {
|
public FaDaDaConfigDTO queryConfig(String workflowId, int type) {
|
||||||
String versionStringByWfid = WorkflowVersion.getVersionStringByWfid(workflowId);
|
String versionStringByWfid = WorkflowVersion.getVersionStringByWfid(workflowId);
|
||||||
String query = "select main.id,main.workflow_type,main.api_type, main.params_config," +
|
String query = "select main.id,main.workflow_type,main.api_type, main.params_config," +
|
||||||
|
"main.signed_type,wf2.fieldname field_control1," +
|
||||||
"wf.fieldname field_control, wf1.fieldname contract_doc, " +
|
"wf.fieldname field_control, wf1.fieldname contract_doc, " +
|
||||||
"(select GROUP_CONCAT('',selectvalue,'') selectvalue from workflow_selectitem " +
|
"(select GROUP_CONCAT('',selectvalue,'') selectvalue from workflow_selectitem " +
|
||||||
|
"where FIND_IN_SET(id,main.only_own)) only_own, " +
|
||||||
|
"(select GROUP_CONCAT('',selectvalue,'') selectvalue from workflow_selectitem " +
|
||||||
|
"where FIND_IN_SET(id,main.only_other)) only_other, " +
|
||||||
|
"(select GROUP_CONCAT('',selectvalue,'') selectvalue from workflow_selectitem " +
|
||||||
|
"where FIND_IN_SET(id,main.both_all)) both_all, " +
|
||||||
|
"(select GROUP_CONCAT('',selectvalue,'') selectvalue from workflow_selectitem " +
|
||||||
"where FIND_IN_SET(id,main.check_personal)) check_personal, " +
|
"where FIND_IN_SET(id,main.check_personal)) check_personal, " +
|
||||||
"(select GROUP_CONCAT('',selectvalue,'') selectvalue from workflow_selectitem " +
|
"(select GROUP_CONCAT('',selectvalue,'') selectvalue from workflow_selectitem " +
|
||||||
"where FIND_IN_SET(id,main.check_enterprise)) check_enterprise," +
|
"where FIND_IN_SET(id,main.check_enterprise)) check_enterprise," +
|
||||||
|
@ -40,6 +47,7 @@ public class FaDDContractMapping {
|
||||||
"from uf_contract_config main " +
|
"from uf_contract_config main " +
|
||||||
"left join workflow_field_table_view wf on wf.id = main.field_control " +
|
"left join workflow_field_table_view wf on wf.id = main.field_control " +
|
||||||
"left join workflow_field_table_view wf1 on wf1.id = main.contract_doc " +
|
"left join workflow_field_table_view wf1 on wf1.id = main.contract_doc " +
|
||||||
|
"left join workflow_field_table_view wf2 on wf2.id = main.field_control1 " +
|
||||||
"left join workflow_detail_table_view wdt on wdt.id = main.check_source and " +
|
"left join workflow_detail_table_view wdt on wdt.id = main.check_source and " +
|
||||||
"wdt.workflow_id = main.workflow_type " +
|
"wdt.workflow_id = main.workflow_type " +
|
||||||
"where main.workflow_type in ( " + versionStringByWfid + ") and api_type = ?";
|
"where main.workflow_type in ( " + versionStringByWfid + ") and api_type = ?";
|
||||||
|
@ -68,9 +76,9 @@ public class FaDDContractMapping {
|
||||||
* @param markOnly 获取配置的节点信息
|
* @param markOnly 获取配置的节点信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getNodes(String versionStringByWfid, String markOnly) {
|
public String getNodes(String versionStringByWfid) {
|
||||||
String query = "select workflow_nodes from uf_node_config where workflow_type in (" + versionStringByWfid + ") and mark_only = ?";
|
String query = "select workflow_nodes from uf_node_config where workflow_type in (" + versionStringByWfid + ") and enable_nodes = ?";
|
||||||
rs.executeQuery(query, markOnly);
|
rs.executeQuery(query, 1);
|
||||||
rs.next();
|
rs.next();
|
||||||
return rs.getString(1);
|
return rs.getString(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,12 @@ public class FaDaDaConfigDTO {
|
||||||
private int checkSourceType;
|
private int checkSourceType;
|
||||||
private String checkSource;
|
private String checkSource;
|
||||||
private String contractDoc;
|
private String contractDoc;
|
||||||
|
private int signedType;
|
||||||
|
private String fieldControl1;
|
||||||
|
private int onlyOwn;
|
||||||
|
private int onlyOther;
|
||||||
|
private int bothAll;
|
||||||
|
|
||||||
|
|
||||||
public void setId(int id){
|
public void setId(int id){
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -77,6 +83,46 @@ public class FaDaDaConfigDTO {
|
||||||
this.contractDoc = contractDoc;
|
this.contractDoc = contractDoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getSignedType() {
|
||||||
|
return signedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignedType(int signedType) {
|
||||||
|
this.signedType = signedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFieldControl1() {
|
||||||
|
return fieldControl1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFieldControl1(String fieldControl1) {
|
||||||
|
this.fieldControl1 = fieldControl1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOnlyOwn() {
|
||||||
|
return onlyOwn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnlyOwn(int onlyOwn) {
|
||||||
|
this.onlyOwn = onlyOwn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOnlyOther() {
|
||||||
|
return onlyOther;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnlyOther(int onlyOther) {
|
||||||
|
this.onlyOther = onlyOther;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBothAll() {
|
||||||
|
return bothAll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBothAll(int bothAll) {
|
||||||
|
this.bothAll = bothAll;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "FaDaDaConfigDTO{" +
|
return "FaDaDaConfigDTO{" +
|
||||||
|
@ -88,6 +134,11 @@ public class FaDaDaConfigDTO {
|
||||||
", checkSourceType=" + checkSourceType +
|
", checkSourceType=" + checkSourceType +
|
||||||
", checkSource='" + checkSource + '\'' +
|
", checkSource='" + checkSource + '\'' +
|
||||||
", contractDoc='" + contractDoc + '\'' +
|
", contractDoc='" + contractDoc + '\'' +
|
||||||
|
", signedType=" + signedType +
|
||||||
|
", fieldControl1='" + fieldControl1 + '\'' +
|
||||||
|
", onlyOwn=" + onlyOwn +
|
||||||
|
", onlyOther=" + onlyOther +
|
||||||
|
", bothAll=" + bothAll +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -21,6 +21,7 @@ public class UfContractInfoDTO {
|
||||||
private int singleSignedNum;
|
private int singleSignedNum;
|
||||||
private String workflowRequestId;
|
private String workflowRequestId;
|
||||||
private String workflowDetailTable;
|
private String workflowDetailTable;
|
||||||
|
private String signedType;
|
||||||
private int mainId;
|
private int mainId;
|
||||||
|
|
||||||
public void setId(int id){
|
public void setId(int id){
|
||||||
|
@ -167,27 +168,36 @@ public class UfContractInfoDTO {
|
||||||
return this.mainId;
|
return this.mainId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSignedType() {
|
||||||
|
return signedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignedType(String signedType) {
|
||||||
|
this.signedType = signedType;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "UfContractInfoDTO{" +
|
return "UfContractInfoDTO{" +
|
||||||
"id='" + id + '\'' +
|
"id=" + id +
|
||||||
", requestId='" + requestId + '\'' +
|
", requestId=" + requestId +
|
||||||
", workflowType='" + workflowType + '\'' +
|
", workflowType=" + workflowType +
|
||||||
", contractNo='" + contractNo + '\'' +
|
", contractNo='" + contractNo + '\'' +
|
||||||
", fileNo='" + fileNo + '\'' +
|
", fileNo='" + fileNo + '\'' +
|
||||||
", fileName='" + fileName + '\'' +
|
", fileName='" + fileName + '\'' +
|
||||||
", signedNum='" + signedNum + '\'' +
|
", signedNum=" + signedNum +
|
||||||
", shouldSignedNum='" + shouldSignedNum + '\'' +
|
", shouldSignedNum=" + shouldSignedNum +
|
||||||
", contractStatus='" + contractStatus + '\'' +
|
", contractStatus=" + contractStatus +
|
||||||
", contractViewUrl='" + contractViewUrl + '\'' +
|
", contractViewUrl='" + contractViewUrl + '\'' +
|
||||||
", contractDownUrl='" + contractDownUrl + '\'' +
|
", contractDownUrl='" + contractDownUrl + '\'' +
|
||||||
", workflowMainTable='" + workflowMainTable + '\'' +
|
", workflowMainTable='" + workflowMainTable + '\'' +
|
||||||
", queueSigned='" + queueSigned + '\'' +
|
", queueSigned=" + queueSigned +
|
||||||
", singleContractFileNum='" + singleContractFileNum + '\'' +
|
", singleContractFileNum=" + singleContractFileNum +
|
||||||
", singleSignedNum='" + singleSignedNum + '\'' +
|
", singleSignedNum=" + singleSignedNum +
|
||||||
", workflowRequestId='" + workflowRequestId + '\'' +
|
", workflowRequestId='" + workflowRequestId + '\'' +
|
||||||
", workflowDetailTable='" + workflowDetailTable + '\'' +
|
", workflowDetailTable='" + workflowDetailTable + '\'' +
|
||||||
", mainId='" + mainId + '\'' +
|
", signedType='" + signedType + '\'' +
|
||||||
|
", mainId=" + mainId +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -52,10 +52,9 @@ public class FaDDContractService {
|
||||||
* 获取全版本的流程id,节点id
|
* 获取全版本的流程id,节点id
|
||||||
*
|
*
|
||||||
* @param workflowId
|
* @param workflowId
|
||||||
* @param markOnly
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Map<String, Object> getAllVersion(String workflowId, String markOnly) {
|
public Map<String, Object> getAllVersion(String workflowId) {
|
||||||
String versionStringByWfid = WorkflowVersion.getVersionStringByWfid(workflowId);
|
String versionStringByWfid = WorkflowVersion.getVersionStringByWfid(workflowId);
|
||||||
String newWorkflowId = faDDContractMapping.getAllVersion(versionStringByWfid);
|
String newWorkflowId = faDDContractMapping.getAllVersion(versionStringByWfid);
|
||||||
String allVersion = WorkflowVersion.getVersionStringByWfid(newWorkflowId);
|
String allVersion = WorkflowVersion.getVersionStringByWfid(newWorkflowId);
|
||||||
|
@ -64,7 +63,7 @@ public class FaDDContractService {
|
||||||
}
|
}
|
||||||
String[] split = allVersion.split(",");
|
String[] split = allVersion.split(",");
|
||||||
Map<String, Object> data = new HashMap<>();
|
Map<String, Object> data = new HashMap<>();
|
||||||
String[] nodes = this.getNodes(workflowId, markOnly);
|
String[] nodes = this.getNodes(workflowId);
|
||||||
data.put("workflowIds", split);
|
data.put("workflowIds", split);
|
||||||
data.put("nodeIds", nodes);
|
data.put("nodeIds", nodes);
|
||||||
return data;
|
return data;
|
||||||
|
@ -74,12 +73,11 @@ public class FaDDContractService {
|
||||||
* 获取节点id
|
* 获取节点id
|
||||||
*
|
*
|
||||||
* @param workflowId
|
* @param workflowId
|
||||||
* @param markOnly
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String[] getNodes(String workflowId, String markOnly) {
|
public String[] getNodes(String workflowId) {
|
||||||
String versionStringByWfid = WorkflowVersion.getVersionStringByWfid(workflowId);
|
String versionStringByWfid = WorkflowVersion.getVersionStringByWfid(workflowId);
|
||||||
String nods = faDDContractMapping.getNodes(versionStringByWfid, markOnly);
|
String nods = faDDContractMapping.getNodes(versionStringByWfid);
|
||||||
if (nods == null) {
|
if (nods == null) {
|
||||||
nods = "";
|
nods = "";
|
||||||
}
|
}
|
||||||
|
@ -321,6 +319,10 @@ public class FaDDContractService {
|
||||||
// 如果合同已签数量和应签数量相同,则状态为本方待签
|
// 如果合同已签数量和应签数量相同,则状态为本方待签
|
||||||
if (ufContractInfoDTO.getSignedNum() + 1 == ufContractInfoDTO.getShouldSignedNum()) {
|
if (ufContractInfoDTO.getSignedNum() + 1 == ufContractInfoDTO.getShouldSignedNum()) {
|
||||||
update.put("contract_status", 3);
|
update.put("contract_status", 3);
|
||||||
|
// 判断是否控制签署规则 1-仅本方签署,2-仅对方签署,3-都签署
|
||||||
|
if("1".equals(Util.null2String(ufContractInfoDTO.getSignedType()))){
|
||||||
|
update.put("contract_status", 4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 全部合同一起发送的签署信息
|
// 全部合同一起发送的签署信息
|
||||||
|
@ -329,8 +331,13 @@ public class FaDDContractService {
|
||||||
// 如果已签文件数等于需要签署的合同数乘以合同文件数相等,则代表对方已经签署完毕
|
// 如果已签文件数等于需要签署的合同数乘以合同文件数相等,则代表对方已经签署完毕
|
||||||
if (ufContractInfoDTO.getSignedNum() + 1 == ufContractInfoDTO.getShouldSignedNum() * ufContractInfoDTO.getSingleContractFileNum()) {
|
if (ufContractInfoDTO.getSignedNum() + 1 == ufContractInfoDTO.getShouldSignedNum() * ufContractInfoDTO.getSingleContractFileNum()) {
|
||||||
update.put("contract_status", 3);
|
update.put("contract_status", 3);
|
||||||
|
// 判断是否控制签署规则 1-仅本方签署,2-仅对方签署,3-都签署
|
||||||
|
if("1".equals(Util.null2String(ufContractInfoDTO.getSignedType()))){
|
||||||
|
update.put("contract_status", 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 更新状态
|
// 更新状态
|
||||||
PrepSqlResultImpl sqlResult = Util.createSqlBuilder().updateSql("uf_contract_info", update,
|
PrepSqlResultImpl sqlResult = Util.createSqlBuilder().updateSql("uf_contract_info", update,
|
||||||
Util.createPrepWhereImpl().whereAnd("id").whereEqual(ufContractInfoDTO.getId()));
|
Util.createPrepWhereImpl().whereAnd("id").whereEqual(ufContractInfoDTO.getId()));
|
||||||
|
@ -378,6 +385,14 @@ public class FaDDContractService {
|
||||||
RecordSet rs = new RecordSet();
|
RecordSet rs = new RecordSet();
|
||||||
rs.executeQuery(query, ufContractInfoDTO.getMainId());
|
rs.executeQuery(query, ufContractInfoDTO.getMainId());
|
||||||
List<Map<String, Object>> detailMaps = Util.recordSet2MapList(rs);
|
List<Map<String, Object>> detailMaps = Util.recordSet2MapList(rs);
|
||||||
|
query = "select * from " + ufContractInfoDTO.getWorkflowMainTable() + " where requestid = ?";
|
||||||
|
RecordSet rs1 = new RecordSet();
|
||||||
|
rs1.executeQuery(query,ufContractInfoDTO.getRequestId());
|
||||||
|
Map<String, Object> mainMap = Util.recordSet2Map(rs1);
|
||||||
|
if(mainMap == null){
|
||||||
|
toolUtil.writeErrorLog("mainMap 查询到null -------> " + JSON.toJSONString(ufContractInfoDTO));
|
||||||
|
throw new RuntimeException("mainMap查询到null!");
|
||||||
|
}
|
||||||
// 获取配置表信息
|
// 获取配置表信息
|
||||||
FaDaDaConfigDTO faDaDaConfigDTO = faDDContractMapping.queryConfig(String.valueOf(ufContractInfoDTO.getWorkflowType()), 3);
|
FaDaDaConfigDTO faDaDaConfigDTO = faDDContractMapping.queryConfig(String.valueOf(ufContractInfoDTO.getWorkflowType()), 3);
|
||||||
// 查询接口配置树形结构
|
// 查询接口配置树形结构
|
||||||
|
@ -397,6 +412,15 @@ public class FaDDContractService {
|
||||||
}
|
}
|
||||||
Map<String, Object> updateData = new HashMap<>();
|
Map<String, Object> updateData = new HashMap<>();
|
||||||
Map<String, Object> map = maps.get(0);
|
Map<String, Object> map = maps.get(0);
|
||||||
|
// 如果进行控制签署规则
|
||||||
|
if(faDaDaConfigDTO.getSignedType() == 1){
|
||||||
|
if(Integer.parseInt(Util.null2String(mainMap.get(faDaDaConfigDTO.getFieldControl1()))) == faDaDaConfigDTO.getOnlyOther()){
|
||||||
|
// 仅对方签署
|
||||||
|
if(maps.size() == 1){
|
||||||
|
map.put("signType",2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
signedRequest(map, apiConfigMainDTO);
|
signedRequest(map, apiConfigMainDTO);
|
||||||
// 将合同签署信息更新到合同信息表中
|
// 将合同签署信息更新到合同信息表中
|
||||||
updateData.put("single_signed_num", 0);
|
updateData.put("single_signed_num", 0);
|
||||||
|
|
|
@ -16,9 +16,6 @@ import org.h2.util.StringUtils;
|
||||||
import weaver.aiyh_pcn.fadada.entity.FileInfo;
|
import weaver.aiyh_pcn.fadada.entity.FileInfo;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
@ -55,6 +52,7 @@ public class FaDDRequestUtils {
|
||||||
}
|
}
|
||||||
header.put("apikey", apiKey);
|
header.put("apikey", apiKey);
|
||||||
header.put("Content-Type", HttpArgsType.APPLICATION_JSON);
|
header.put("Content-Type", HttpArgsType.APPLICATION_JSON);
|
||||||
|
TOOL_UTIL.writeErrorLog(JSONObject.toJSONString(header));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询企业认证状态
|
// 查询企业认证状态
|
||||||
|
@ -190,7 +188,7 @@ public class FaDDRequestUtils {
|
||||||
public static String builderBizContent(Map<String, Object> data) {
|
public static String builderBizContent(Map<String, Object> data) {
|
||||||
String jsonString = JSONUtil.toJsonStr(data);
|
String jsonString = JSONUtil.toJsonStr(data);
|
||||||
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码:" + jsonString);
|
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码:" + jsonString);
|
||||||
String encode = null;
|
String encode;
|
||||||
// encode = URLEncoder.encode(jsonString, "UTF-8");
|
// encode = URLEncoder.encode(jsonString, "UTF-8");
|
||||||
encode = URLUtil.encodeAll(jsonString, StandardCharsets.UTF_8);
|
encode = URLUtil.encodeAll(jsonString, StandardCharsets.UTF_8);
|
||||||
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码后URLEncoder编码:" + encode);
|
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码后URLEncoder编码:" + encode);
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class FaDDContractController {
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public String getAllVersion(@PathParam("workflowId") String workflowId, @PathParam("markOnly") String markOnly) {
|
public String getAllVersion(@PathParam("workflowId") String workflowId, @PathParam("markOnly") String markOnly) {
|
||||||
try {
|
try {
|
||||||
Map<String, Object> allVersion = faDDService.getAllVersion(workflowId, markOnly);
|
Map<String, Object> allVersion = faDDService.getAllVersion(workflowId);
|
||||||
return ApiResult.success(allVersion);
|
return ApiResult.success(allVersion);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
toolUtil.writeErrorLog("错误:" + e.toString());
|
toolUtil.writeErrorLog("错误:" + e.toString());
|
||||||
|
|
|
@ -2,6 +2,7 @@ package customization.test;
|
||||||
|
|
||||||
import aiyh.utils.Util;
|
import aiyh.utils.Util;
|
||||||
import aiyh.utils.fileUtil.ProperUtil;
|
import aiyh.utils.fileUtil.ProperUtil;
|
||||||
|
import cn.hutool.core.util.URLUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.api.aiyh_pcn.patentWall.service.PatentWallService;
|
import com.api.aiyh_pcn.patentWall.service.PatentWallService;
|
||||||
import com.api.aiyh_pcn.patentWall.vo.PatentVO;
|
import com.api.aiyh_pcn.patentWall.vo.PatentVO;
|
||||||
|
@ -13,6 +14,8 @@ import weaver.common.util.string.StringUtil;
|
||||||
import weaver.general.GCONST;
|
import weaver.general.GCONST;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -333,4 +336,11 @@ public class NewUtilTest {
|
||||||
System.out.println(matcher.group("field"));
|
System.out.println(matcher.group("field"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test() {
|
||||||
|
String bizContent = "{\"contractExtension\":\".pdf\",\"contractTitle\":\"PCN Template - Non-Disclosure Agreement (Corporate).pdf\",\"uploadType\":1,\"customerNo\":\"ecef845ba95a409393cb66271a41b0a6\"}";
|
||||||
|
System.out.println(cn.hutool.core.util.URLUtil.encodeAll(bizContent, Charset.forName("UTF-8")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class FaDDContractAction extends ToolUtil implements Action {
|
||||||
private String customerNo;
|
private String customerNo;
|
||||||
// 是否是顺序签订
|
// 是否是顺序签订
|
||||||
private String queueSigned;
|
private String queueSigned;
|
||||||
// 签订字段
|
// 签订字段,用于是否电子签
|
||||||
private String signedField;
|
private String signedField;
|
||||||
// 签订值
|
// 签订值
|
||||||
private String signedValue;
|
private String signedValue;
|
||||||
|
@ -69,7 +69,7 @@ public class FaDDContractAction extends ToolUtil implements Action {
|
||||||
FaddContractUtil faddContractUtil = new FaddContractUtil(workflowId, requestId, mainTableName, tableName,
|
FaddContractUtil faddContractUtil = new FaddContractUtil(workflowId, requestId, mainTableName, tableName,
|
||||||
customerNo, customerNoField, contractField, queueSigned, detailMaps, mainMap);
|
customerNo, customerNoField, contractField, queueSigned, detailMaps, mainMap);
|
||||||
try {
|
try {
|
||||||
faddContractUtil.createContract();
|
faddContractUtil.createContract(mainMap);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
toolUtil.writeErrorLog("合同创建失败,失败原因:" + e);
|
toolUtil.writeErrorLog("合同创建失败,失败原因:" + e);
|
||||||
// TODO 更换labelIndex
|
// TODO 更换labelIndex
|
||||||
|
@ -77,6 +77,21 @@ public class FaDDContractAction extends ToolUtil implements Action {
|
||||||
requestInfo.getRequestManager().setMessageid("1");
|
requestInfo.getRequestManager().setMessageid("1");
|
||||||
return Action.FAILURE_AND_CONTINUE;
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
|
if(faDaDaConfigDTO.getSignedType() == 1){
|
||||||
|
// 需要控制签署规则
|
||||||
|
if(Integer.parseInt(Util.null2String(mainMap.get(faDaDaConfigDTO.getFieldControl1()))) == faDaDaConfigDTO.getOnlyOwn()){
|
||||||
|
// 只需要本方签署
|
||||||
|
return Action.SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
if(Integer.parseInt(Util.null2String(mainMap.get(faDaDaConfigDTO.getFieldControl1()))) == faDaDaConfigDTO.getOnlyOther()){
|
||||||
|
// 只需要对方签署
|
||||||
|
}
|
||||||
|
// 双方签署
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
faddContractUtil.signedContract();
|
faddContractUtil.signedContract();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class FaddContractUtil {
|
||||||
/**
|
/**
|
||||||
* 创建合同
|
* 创建合同
|
||||||
*/
|
*/
|
||||||
public void createContract() {
|
public void createContract(Map<String, Object> mainMap) {
|
||||||
// 查询配置参数
|
// 查询配置参数
|
||||||
FaDaDaConfigDTO faDaDaConfigDTO = faDDContractMapping.queryConfig(workflowId, 2);
|
FaDaDaConfigDTO faDaDaConfigDTO = faDDContractMapping.queryConfig(workflowId, 2);
|
||||||
// 查询api配置参数
|
// 查询api配置参数
|
||||||
|
@ -123,11 +123,32 @@ public class FaddContractUtil {
|
||||||
updateMap.put("workflow_detail_table",tableName);
|
updateMap.put("workflow_detail_table",tableName);
|
||||||
// 1表示创建 2表示等待对方签署,3表示等待本方签署,4表示完成
|
// 1表示创建 2表示等待对方签署,3表示等待本方签署,4表示完成
|
||||||
updateMap.put("contract_status",1);
|
updateMap.put("contract_status",1);
|
||||||
|
// 对方应该签署的数量
|
||||||
updateMap.put("should_signed_num",detailMaps.size());
|
updateMap.put("should_signed_num",detailMaps.size());
|
||||||
|
// 现在已经签署的数量
|
||||||
updateMap.put("signed_num",0);
|
updateMap.put("signed_num",0);
|
||||||
|
updateMap.put("signed_type",3);
|
||||||
|
|
||||||
updateMap.put("main_id",String.valueOf(mainMap.get("id")));
|
updateMap.put("main_id",String.valueOf(mainMap.get("id")));
|
||||||
updateMap.put("queue_signed","true".equals(queueSigned) ? 1 : 0);
|
updateMap.put("queue_signed","true".equals(queueSigned) ? 1 : 0);
|
||||||
updateMap.put("single_contract_file_num",contractNoIds.size());
|
updateMap.put("single_contract_file_num",contractNoIds.size());
|
||||||
|
// 如果需要控制签署规则
|
||||||
|
if (faDaDaConfigDTO.getSignedType() == 1) {
|
||||||
|
// 需要控制签署规则
|
||||||
|
if (Integer.parseInt(Util.null2String(mainMap.get(faDaDaConfigDTO.getFieldControl1()))) == faDaDaConfigDTO.getOnlyOwn()) {
|
||||||
|
// 只需要本方签署
|
||||||
|
updateMap.put("contract_status",3);
|
||||||
|
// 对方应该签署的数量
|
||||||
|
updateMap.put("should_signed_num",0);
|
||||||
|
// 现在已经签署的数量
|
||||||
|
updateMap.put("signed_num",0);
|
||||||
|
updateMap.put("queue_signed",0);
|
||||||
|
updateMap.put("signed_type",1);
|
||||||
|
}
|
||||||
|
if (Integer.parseInt(Util.null2String(mainMap.get(faDaDaConfigDTO.getFieldControl1()))) == faDaDaConfigDTO.getOnlyOther()) {
|
||||||
|
updateMap.put("signed_type",2);
|
||||||
|
}
|
||||||
|
}
|
||||||
// 查询合同信息中,是否存在该信息,如果存在着更新,不存在则插入
|
// 查询合同信息中,是否存在该信息,如果存在着更新,不存在则插入
|
||||||
String query = "select * from " + contractInfoTable + " where workflow_request_id = ?";
|
String query = "select * from " + contractInfoTable + " where workflow_request_id = ?";
|
||||||
rs.executeQuery(query,requestId);
|
rs.executeQuery(query,requestId);
|
||||||
|
@ -222,7 +243,7 @@ public class FaddContractUtil {
|
||||||
signedRequest(map,apiConfigMainDTO);
|
signedRequest(map,apiConfigMainDTO);
|
||||||
// 将合同签署信息更新到合同信息表中
|
// 将合同签署信息更新到合同信息表中
|
||||||
update.put("contract_status",2);
|
update.put("contract_status",2);
|
||||||
update.put("single_signed_num",0);
|
// update.put("single_signed_num",0);
|
||||||
PrepSqlResultImpl sqlResult = Util.createSqlBuilder().updateSql(contractInfoTable, update,
|
PrepSqlResultImpl sqlResult = Util.createSqlBuilder().updateSql(contractInfoTable, update,
|
||||||
Util.createPrepWhereImpl().whereAnd("workflow_request_id").whereEqual(requestId));
|
Util.createPrepWhereImpl().whereAnd("workflow_request_id").whereEqual(requestId));
|
||||||
rs.executeUpdate(sqlResult.getSqlStr(),sqlResult.getArgs());
|
rs.executeUpdate(sqlResult.getSqlStr(),sqlResult.getArgs());
|
||||||
|
@ -235,9 +256,9 @@ public class FaddContractUtil {
|
||||||
rs.executeUpdate(sqlResult.getSqlStr(),sqlResult.getArgs());
|
rs.executeUpdate(sqlResult.getSqlStr(),sqlResult.getArgs());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 不是顺序签署
|
||||||
for (Map<String, Object> map : maps) {
|
for (Map<String, Object> map : maps) {
|
||||||
signedRequest(map,apiConfigMainDTO);
|
signedRequest(map,apiConfigMainDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
// 将合同签署信息更新到合同信息表中
|
// 将合同签署信息更新到合同信息表中
|
||||||
update.put("contract_status",2);
|
update.put("contract_status",2);
|
||||||
|
@ -255,7 +276,7 @@ public class FaddContractUtil {
|
||||||
private void signedRequest(Map<String, Object> map, ApiConfigMainDTO apiConfigMainDTO){
|
private void signedRequest(Map<String, Object> map, ApiConfigMainDTO apiConfigMainDTO){
|
||||||
String contractNos = Util.null2String(map.get("contractNo"));
|
String contractNos = Util.null2String(map.get("contractNo"));
|
||||||
String[] split = contractNos.split(",");
|
String[] split = contractNos.split(",");
|
||||||
RecordSet rs = new RecordSet();
|
// RecordSet rs = new RecordSet();
|
||||||
for (String s : split) {
|
for (String s : split) {
|
||||||
map.put("contractNo", s);
|
map.put("contractNo", s);
|
||||||
ResponeVo responeVo = FaDDRequestUtils.signedContract(map, apiConfigMainDTO.getApiUrl());
|
ResponeVo responeVo = FaDDRequestUtils.signedContract(map, apiConfigMainDTO.getApiUrl());
|
||||||
|
|
Loading…
Reference in New Issue