Commit bff0f3f1 authored by tangwei's avatar tangwei

增加日志

parent 17e8f5ec
......@@ -202,10 +202,7 @@ public class HouseholdContractController extends BaseController {
@PostMapping (value = "/reissue")
@ApiOperation(httpMethod = "post", value = "重新发起", notes = "重新发起")
public ResponseModel<HouseholdContract> reissue(@RequestBody HouseholdContract model ) {
HouseholdContract householdContract= householdContractServiceImpl.reissueinitiateHouseholdContract(model);
return ResponseHelper.buildResponse(householdContract);
}
......
......@@ -195,11 +195,9 @@ public class HouseholdContractServiceImpl extends BaseService<HouseholdContractD
public HouseholdContract reissueinitiateHouseholdContract(HouseholdContract model){
HouseholdContract peasantHousehold= this.getById(model.getSequenceNbr());
//生成合同
HouseholdContract householdContract=new HouseholdContract();
householdContract.setPartyA(model.getPartyA());
householdContract.setPartyB(model.getPartyB());
householdContract.setContractTemplateId(model.getContractTemplateId());
......@@ -235,7 +233,6 @@ public class HouseholdContractServiceImpl extends BaseService<HouseholdContractD
ContractDataDto contractDataDto =new ContractDataDto();
contractDataDto.setUsername(householdContract.getPartyA());
contractDataDto.setContact(householdContract.getPeasantHouseholdPhone());
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.qiyuesuo.sdk.v2.SdkClient;
import com.qiyuesuo.sdk.v2.bean.*;
import com.qiyuesuo.sdk.v2.bean.vo.DocumentUrlVO;
......@@ -11,6 +12,7 @@ import com.qiyuesuo.sdk.v2.response.*;
import com.yeejoin.amos.boot.module.common.api.dto.ContractDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.ContractDataDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TemplateParamDto;
import jdk.internal.org.objectweb.asm.tree.TryCatchBlockNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
......@@ -89,6 +91,10 @@ public class QiyuesuoServiceImpl {
public Long addContract(ContractDataDto contractDataDto , List<TemplateParamDto> templateParam ){
SdkResponse<Contract> responseObj=null;
// 返回结果
Contract result=new Contract();
String username=contractDataDto.getUsername();
String contact=contractDataDto.getContact();
String IDCard=contractDataDto.getIDCard();
......@@ -109,6 +115,7 @@ public class QiyuesuoServiceImpl {
Double personalOffsetX= contractDataDto.getPersonalOffsetX();
Double personalOffsetY= contractDataDto.getPersonalOffsetY();
List<Long> corpSealIds=contractDataDto.getSealId();
try {
SdkClient sdkClient = new SdkClient(serverUrl, accessKey, accessSecret);
// 合同基本参数
//进行日期格式化
......@@ -142,10 +149,13 @@ public class QiyuesuoServiceImpl {
ContractDraftRequest request = new ContractDraftRequest(contract);
logger.info("创建草稿合同调用前"+JSON.toJSONString(request));
String response = sdkClient.service(request);
SdkResponse<Contract> responseObj = JSONUtils.toQysResponse(response, Contract.class);
// 返回结果
Contract result=new Contract();
responseObj = JSONUtils.toQysResponse(response, Contract.class);
logger.info("创建草稿合同调用后"+JSON.toJSONString(responseObj));
}catch (Exception e){
e.printStackTrace();
throw new RuntimeException("创建草稿合同失败");
}
if(responseObj.getCode() == 0) {
result = responseObj.getResult();
logger.info(JSON.toJSONString(responseObj));
......@@ -189,6 +199,9 @@ public class QiyuesuoServiceImpl {
public DocumentAddResult getDocumentAddResult(Long contractId, String subject, List<TemplateParamDto> templateParam , Long emplateId ) {
DocumentAddResult result=null;
SdkResponse<DocumentAddResult> responseObj=null;
try {
SdkClient sdkClient = new SdkClient(serverUrl, accessKey, accessSecret);
// 添加合同文档
List<TemplateParam> params = new ArrayList<>();
......@@ -197,38 +210,49 @@ public class QiyuesuoServiceImpl {
params.add(new TemplateParam(templateParamDto.getKey(), templateParamDto.getValue()));
}
}
logger.info("合同参数"+JSON.toJSONString(params));
logger.info("添加合同文档参数"+JSON.toJSONString(params));
DocumentAddByTemplateRequest request = new DocumentAddByTemplateRequest(contractId,
emplateId , params, subject);
logger.info("添加合同文档前", JSON.toJSONString(request));
String response = sdkClient.service(request);
SdkResponse<DocumentAddResult> responseObj = JSONUtils.toQysResponse(response, DocumentAddResult.class);
responseObj = JSONUtils.toQysResponse(response, DocumentAddResult.class);
logger.info("添加合同文档后", JSON.toJSONString(responseObj));
DocumentAddResult result=null;
if (responseObj.getCode() == 0) {
}catch (Exception e){
e.printStackTrace();
throw new RuntimeException("添加合同文档失败");
}
if (responseObj!=null&&responseObj.getCode() == 0) {
result = responseObj.getResult();
logger.info("添加合同文档成功,文档ID:{}", JSON.toJSONString(result));
} else {
throw new RuntimeException("请求失败");
throw new RuntimeException("添加合同文档"+responseObj.getMessage());
}
return result;
}
public SdkResponse<Object> getSdkResponse(Long contractId,List<Stamper> stampers ){
SdkClient sdkClient = new SdkClient(serverUrl, accessKey, accessSecret);
// 发起合同
SdkResponse<Object> responseObj =null;
try {
SdkClient sdkClient = new SdkClient(serverUrl, accessKey, accessSecret);
ContractSendRequest request = new ContractSendRequest(contractId, stampers);
logger.info("发起合同前", JSON.toJSONString(request));
logger.info("请求契约锁发起合同前", JSON.toJSONString(request));
String response = sdkClient.service(request);
responseObj = JSONUtils.toQysResponse(response);
logger.info("发起合同后", JSON.toJSONString(responseObj));
if(responseObj.getCode() == 0) {
logger.info("合同发起成功");
}catch (Exception e){
e.printStackTrace();
throw new RuntimeException("请求契约锁发起合同接口失败");
}
logger.info("请求契约锁发起合同后", JSON.toJSONString(responseObj));
if(responseObj!=null&&responseObj.getCode() == 0) {
logger.info("请求契约锁发起合同成功");
} else {
throw new RuntimeException("请求失败"+responseObj.getMessage());
throw new RuntimeException("请求契约锁发起合同失败"+responseObj.getMessage());
}
return responseObj;
}
......
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