<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Api id="__xv1zb1Uy58pRt0Trce5">
  <name>等级证修改考生考试信息</name>
  <parentId>__LgZds5MVHW3o08T7UcX</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <status>published</status>
  <apiGroup></apiGroup>
  <encode>UTF-8</encode>
  <requestType>put</requestType>
  <requestUrl>/exam/updateClassPersonInfo/{id}</requestUrl>
  <tags></tags>
  <responseType>json</responseType>
  <responseScript><![CDATA[(function () {
  var id = getParameter("id");
  var sql = "select item_classid from tlk_level_class_student where id = '"+id+"'";
  var datas = queryByDSName("tms",sql);
  var classid = ''
  var qualifiedGTheoryResult = '';
  var qualifiedGOperationResult = '';
  if(datas!=null){
    for(var iterator = datas.iterator();iterator.hasNext();){
      var map1 = iterator.next();//取值
      classid = map1.get("item_classid");
    }
  }
  if(isNotNull(classid)){
    var sql2 = "select item_qualifiedGTheoryResult,item_qualifiedGOperationResult from tlk_grade_card_class where id = '"+classid+"'";
    var datas2 = queryByDSName("tms",sql);
    if(datas2!=null){
      for(var iterator = datas2.iterator();iterator.hasNext();){
        var map1 = iterator.next();//取值
        qualifiedGTheoryResult = map1.get("item_qualifiedGTheoryResult");
        qualifiedGOperationResult = map1.get("item_qualifiedGOperationResult");
      }
    }
    var result = new Packages.java.util.HashMap(); //创建指定类对象
    var jsonStr = getParameter("_content");
    if(isNotNull(jsonStr)){
      var json = JSON.parse(jsonStr);
      println("ss"+json)
      var process = getDocumentProcess();
      var Info = findDocument(id);
      Info.findItem("apptype").setValue(0);
      for (var key in json) {
        var value = json[key];
        println("sss"+value)
        Info.findItem(key).setValue(value);
      }
      /*if(parseFloat(json.graduationTheoryScore)>=parseFloat(qualifiedGTheoryResult) && parseFloat(json.graduationOperationScore)>=parseFloat(qualifiedGOperationResult)){
        Info.findItem("graduationTestResults").setValue(1);
      }else{
        Info.findItem("graduationTestResults").setValue(2);
      }*/
      Info.findItem("graduationTestResults").setValue(0);
      Info.findItem("apptype").setValue(0);
      process.doUpdate(Info);
      result.put("msg", "success");
      result.put("code", "0");
      result.put("type", "update");
    }else{
      result.put("msg", "参数不能为空");
      result.put("code", "-1");
      result.put("type", "update");
    }
    return result;
  }
  })()]]></responseScript>
</Api>