|
|
@@ -3,6 +3,7 @@ package com.ruoyi.agent.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.json.JSONArray;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
@@ -221,21 +222,21 @@ public class AgentServiceImpl implements IAgentService {
|
|
|
sReq.setSignLevel(1);//签字类型,标准图形章或公章:0标准图形章,1公章或手写,2公章手写或手写,3个人方形标准章(用户类型是个人且姓名2-4个字符生效,其他情况默认使用系统标准图形章)
|
|
|
signatories.add(sReq);
|
|
|
|
|
|
- Map<String, String> templateParams = new HashMap<>();
|
|
|
- templateParams.put("enterpriseFullName", platformInfoVo.getEnterpriseFullName());
|
|
|
- templateParams.put("legalPersonName", platformInfoVo.getLegalPersonName());
|
|
|
- templateParams.put("uscCode", platformInfoVo.getUscCode());
|
|
|
- templateParams.put("contractSigner", platformInfoVo.getContractSigner());
|
|
|
- templateParams.put("signerMobile", platformInfoVo.getSignerMobile());
|
|
|
- templateParams.put("registeredAddress", platformInfoVo.getRegisteredAddress());
|
|
|
+ JSONObject templateParams = new JSONObject();
|
|
|
+ templateParams.set("enterpriseFullName", platformInfoVo.getEnterpriseFullName());
|
|
|
+ templateParams.set("legalPersonName", platformInfoVo.getLegalPersonName());
|
|
|
+ templateParams.set("uscCode", platformInfoVo.getUscCode());
|
|
|
+ templateParams.set("contractSigner", platformInfoVo.getContractSigner());
|
|
|
+ templateParams.set("signerMobile", platformInfoVo.getSignerMobile());
|
|
|
+ templateParams.set("registeredAddress", platformInfoVo.getRegisteredAddress());
|
|
|
if (AgentLevel.COUNTY_AGENT.equals(agent.getAgentLevel())) {
|
|
|
- templateParams.put("regionIdCard", agent.getIdCard());
|
|
|
- templateParams.put("regionRealName", agent.getRealName());
|
|
|
- templateParams.put("regionPhone", agent.getPhone());
|
|
|
+ templateParams.set("regionIdCard", agent.getIdCard());
|
|
|
+ templateParams.set("regionRealName", agent.getRealName());
|
|
|
+ templateParams.set("regionPhone", agent.getPhone());
|
|
|
Agent parentAgent = loadById(agent.getParentAgentId(), true);
|
|
|
- templateParams.put("idCard", parentAgent.getIdCard());
|
|
|
- templateParams.put("realName", parentAgent.getRealName());
|
|
|
- templateParams.put("phone", parentAgent.getPhone());
|
|
|
+ templateParams.set("idCard", parentAgent.getIdCard());
|
|
|
+ templateParams.set("realName", parentAgent.getRealName());
|
|
|
+ templateParams.set("phone", parentAgent.getPhone());
|
|
|
/**
|
|
|
* 签约方1(个人)
|
|
|
*/
|
|
|
@@ -251,26 +252,26 @@ public class AgentServiceImpl implements IAgentService {
|
|
|
spReq.setSignLevel(1);//签字类型,标准图形章或公章:0标准图形章,1公章或手写,2公章手写或手写,3个人方形标准章(用户类型是个人且姓名2-4个字符生效,其他情况默认使用系统标准图形章)
|
|
|
signatories.add(spReq);
|
|
|
} else if (AgentLevel.PROVINCE_AGENT.equals(agent.getAgentLevel())) {
|
|
|
- templateParams.put("idCard", agent.getIdCard());
|
|
|
- templateParams.put("realName", agent.getRealName());
|
|
|
- templateParams.put("phone", agent.getPhone());
|
|
|
+ templateParams.set("idCard", agent.getIdCard());
|
|
|
+ templateParams.set("realName", agent.getRealName());
|
|
|
+ templateParams.set("phone", agent.getPhone());
|
|
|
}
|
|
|
Date date = new Date();
|
|
|
- templateParams.put("signDate", DateUtils.parseDateToStr("yyyy年MM月dd日", date));
|
|
|
- templateParams.put("signExpireDate", DateUtils.parseDateToStr("yyyy年MM月dd日", DateUtils.addYears(date, 1)));
|
|
|
+ templateParams.set("signDate", DateUtils.parseDateToStr("yyyy年MM月dd日", date));
|
|
|
+ templateParams.set("signExpireDate", DateUtils.parseDateToStr("yyyy年MM月dd日", DateUtils.addYears(date, 1)));
|
|
|
//构建请求参数
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("serverCa", 1); //使用云证书
|
|
|
params.put("fileType", 2);
|
|
|
if (AgentLevel.PROVINCE_AGENT.equals(agent.getAgentLevel())) {
|
|
|
- params.put("templateNo", "bgvp9cRmZcc=");
|
|
|
+ params.put("templateNo", "4");
|
|
|
params.put("contractName", "软件代理销售合同"); //合同名称
|
|
|
} else {
|
|
|
- params.put("templateNo", "QVzFDwUCzFg=");
|
|
|
+ params.put("templateNo", "2");
|
|
|
params.put("contractName", "软件代理销售三方协议"); //合同名称
|
|
|
}
|
|
|
params.put("templateParams", templateParams.toString());
|
|
|
- params.put("positionType", 2); //指定签字位置类型(0签字坐标,1表单域,2关键字)
|
|
|
+ params.put("positionType", 0); //指定签字位置类型(0签字坐标,1表单域,2关键字)
|
|
|
params.put("signatories", signatories.toString());
|
|
|
return params;
|
|
|
}
|