<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Api id="__IG9CoDXCI49J6ZpqDyp">
  <name>生成证书打印记录</name>
  <parentId>__LgZds5MVHW3o08T7UcX</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <status>published</status>
  <apiGroup></apiGroup>
  <encode>UTF-8</encode>
  <requestType>post</requestType>
  <requestUrl>/PrintingRecord</requestUrl>
  <tags></tags>
  <responseType>json</responseType>
  <responseScript><![CDATA[(function(){
  /**
   生成打印记录
   获取证书编号、打印时间、打印人员、打印人员所属监管机构 
  **/
  var printType=""
  var result = new Packages.java.util.HashMap(); //创建指定类对象
  var jsonStr = getParameter("_content");
  if(isNotNull(jsonStr)){
    var json = JSON.parse(jsonStr);
    var certificateNO = json["certificateNO"];//证书编号
    var printDate = json["printDate"];//打印时间
    var printPeople = json["printPeople"];//打印人员
    var printOrganization = json["printOrganization"];//所属监管机构
    //通过证书编号查出这个人的姓名身份证 


    //通过证书编号先进行校验是否存在证书打印记录，无则证书类型为新证，有则为旧证
    if(isNotNull(jsonStr)){
      printType='';
    }else{
      printType='';
    }
    //进行新增操作
    var process = getDocumentProcess();
    var formProcess = getFormProcess();
    var subform = formProcess.doView("	__Jnpcm6W3bkBWHYUncXi");
    var doc = process.doNew(subform, getWebUser(), createParamsTable());
    doc.addStringItem("name", name);
    doc.addStringItem("certificateNO", certificateNO);
    doc.addStringItem("idCardNo", idCardNo);
    doc.addStringItem("printType", printType);
    doc.addStringItem("printDate", AUTHUSERID);
    doc.addStringItem("printPeople", printPeople);
    doc.addStringItem("printOrganization", printOrganization);
    process.doCreate(doc);

    result.put("code","0") 
    result.put("msg","success") 
  }else{//为空信息
    result.put("code","-1") 
    result.put("msg","无数据") 
  }
  return result;
})()]]></responseScript>
</Api>