<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__M75CjMau95RmQTcSBct">
  <name>确认成绩</name>
  <parentId>__LbjIRMmhU8mHEwz3CA3</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <type>13</type>
  <onActionFlow></onActionFlow>
  <onActionPrint></onActionPrint>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[#include "sysfunction";
#include "uuidUtil";
(function(){
  var examPersonName = getItemValueAsString("examPersonName"); 
  if("".equals(examPersonName)) {
    return "请选择人员！";
  }
  var examPersonId = getItemValueAsString("examPersonId"); 
  var formservice = getFormProcess();
  var arrto = splitText(examPersonId,";"); 
  var process = getDocumentProcess();  
  var examPassPerson="('";//考试通过人员的id
  var examNoPassPerson="('";//考试不通过人员的id
  var examPassPersonApplyId="('";//考试通过人员的报名id
  var examAllPersonApplyId="('";//所有考试人员的报名id
  var examNoPassPersonApplyId="('";//考试不通过人员的报名id
  var examPersonOrderId="('";//考试人员的订单id
  for(var i = 0;i < arrto.length;i++){
    var examPersonInfoDoc = findDocument(arrto[i]);
    var applyId = examPersonInfoDoc.findItem("applyId").getValue(); 
    var applyInfoDoc = findDocument(applyId);
    examAllPersonApplyId+=applyId+"','"
    var orderId = applyInfoDoc.findItem("orderId").getValue(); 
    examPersonOrderId+=orderId+"','"
    var orderInfoDoc = findDocument(orderId);
    var price = orderInfoDoc.findItem("price").getValue();
    var testState = examPersonInfoDoc.findItem("testState").getValue();
    if("0".equals(testState)){
      examNoPassPerson+=arrto[i]+"','"
      examNoPassPersonApplyId+=applyId+"','"
    }else if("1".equals(testState)){
      examPassPerson+=arrto[i]+"','"
      examPassPersonApplyId+=applyId+"','"
    }
  }
  examPersonOrderId+="1')"
  examNoPassPerson+="1')"
  examNoPassPersonApplyId+="1')"
  examPassPerson+="1')"
  examPassPersonApplyId+="1')"
  examAllPersonApplyId+="1')"
  //更新考试人员的确认状态，制证状态
  var updateExamNoPassPersonSql="update tlk_system_exam_person set item_scoreState = '1',item_confirmDate = now(),item_confirmoperator = '" + getWebUser().getName() + "',LASTMODIFIED = now() where id in " + examNoPassPerson 
  updateByDSName("tms",updateExamNoPassPersonSql);
  var updateExamPassPersonSql="update tlk_system_exam_person set item_scoreState = '1',item_confirmDate = now(),item_cardState = '2',item_confirmoperator = '" + getWebUser().getName() + "',LASTMODIFIED = now() where id in " + examPassPerson
  updateByDSName("tms",updateExamPassPersonSql);
  //更新课程授权
  var updateLessonSql = "update tlk_lesson_auth_base_info set item_isdelete='1',item_isProgress='0' where item_authRecordId in " + examAllPersonApplyId
  updateByDSName("tms",updateLessonSql);
  //更新报名信息
  var updateApplyIdNoPassSql = "update tlk_qualify_person_apply set ITEM_APPLYSTATUS = '2',LASTMODIFIED = now() where id in " + examNoPassPersonApplyId ;
  updateByDSName("tms",updateApplyIdNoPassSql);
  var updateApplyIdPassSql = "update tlk_qualify_person_apply set ITEM_APPLYSTATUS = '1',LASTMODIFIED = now() where id in " + examPassPersonApplyId;
  updateByDSName("tms",updateApplyIdPassSql);
  //更新订单
  var orderUpdateStr = "update tlk_learn_order_person SET item_confirmdate =  now()  WHERE ID IN " + examPersonOrderId 
  updateByDSName("tms",orderUpdateStr);
})()
]]></beforeActionScript>
  <afterActionScript><![CDATA[]]></afterActionScript>
  <retractBeforeActionScript><![CDATA[]]></retractBeforeActionScript>
  <retractAfterActionScript><![CDATA[]]></retractAfterActionScript>
  <hiddenScript><![CDATA[]]></hiddenScript>
  <readonlyScript><![CDATA[]]></readonlyScript>
  <startFlowScript><![CDATA[]]></startFlowScript>
  <editMode>0</editMode>
  <fileNameScript><![CDATA[]]></fileNameScript>
  <iconurl></iconurl>
  <orderno>0</orderno>
  <stateToShow></stateToShow>
  <parentForm>__LbjIRMmhU8mHEwz3CA3</parentForm>
  <jumpType>0</jumpType>
  <expSub>false</expSub>
  <icon></icon>
  <disableFlowNode>false</disableFlowNode>
  <changeFlowOperator>false</changeFlowOperator>
  <changeFlowCc>false</changeFlowCc>
  <multiLanguageLabel></multiLanguageLabel>
  <dispatcherMode>0</dispatcherMode>
  <dispatcherUrl><![CDATA[]]></dispatcherUrl>
  <dispatcherParams><![CDATA[[{"paramKey":"","paramValue":""}]]]></dispatcherParams>
  <jumpMode>0</jumpMode>
  <jumpActOpenType>0</jumpActOpenType>
  <withOld>false</withOld>
  <actionType>2</actionType>
  <actionDispatcherUrlScript><![CDATA[]]></actionDispatcherUrlScript>
  <actionSelection>0</actionSelection>
  <relatedFormId></relatedFormId>
  <actionScript><![CDATA[]]></actionScript>
  <workFlowType>0</workFlowType>
  <contextMenu>false</contextMenu>
  <showInToolbar>true</showInToolbar>
  <transpond></transpond>
  <targetList>|</targetList>
  <label><![CDATA[]]></label>
</activity>