<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<impMappingConfigVO id="__F0UarooeiCS61gI2DEI">
  <name>结业成绩录入</name>
  <parentId>__LgZds5MVHW3o08T7UcX</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <xml><![CDATA[<cn.myapps.runtime.dynaform.dts.excelimport.ExcelMappingDiagram>
<flowstatus>16</flowstatus>
<flowpath></flowpath>
<deleteMSG></deleteMSG>
<width>2048</width>
<height>1536</height>
<needRollback>rollback</needRollback>
<cn.myapps.runtime.dynaform.dts.excelimport.MasterSheet>
<id>1620630779257</id>
<name>结业成绩表</name>
<scale>0</scale>
<x>560</x>
<y>107</y>
<width>142</width>
<height>34</height>
<formName>impGrade</formName>
</cn.myapps.runtime.dynaform.dts.excelimport.MasterSheet>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1620630779257</startnodeid>
<endnodeid>1620630779257</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>560;107;560;107</pointstack>
<id>1620631044408</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Column>
<id>1620631052992</id>
<name>身份证</name>
<scale>0</scale>
<x>504</x>
<y>234</y>
<width>142</width>
<height>34</height>
<formName></formName>
<fieldName>idCardNo</fieldName>
<primaryKey>true</primaryKey>
<valueScript></valueScript>
<validateRule>(function(){                         
                         var idCardNo = getItemValueAsString(@quot;idCardNo@quot;);                         
                         println(@quot;身份证号：@quot;+idCardNo);                         
                         var sclassid = @quot;@quot;; //定义数据库查询到的班级id                         
                         var sidCardNo = @quot;@quot;; //定义数据库查询到的学员的身份证号       
                         var hclassid = new Packages.cn.myapps.common.util.cache.MemoryCacheUtil.getFromPrivateSpace(@quot;classId@quot;, getWebUser());       
                        /**获取导入的总成绩以及其他成绩  **/                  
                         var writtenScore1=getItemValueAsInt(@quot;graduationTheoryScore@quot;);   //数字类型                                  
                         var writtenScore2=getItemValueAsInt(@quot;graduationOperationScore@quot;);//数字类型                      
                         var sumScore=writtenScore1+writtenScore2                 
                          println(@quot;sumScore----@gt;@quot;+sumScore)                  
                         var testState=@quot;@quot;                                 
                         println(@quot;hclassid----@gt;@quot;+hclassid)                         
                           var examInfoDoc = findDocument(hclassid); //班级id                         
                           var qualifiedGTheoryResult = examInfoDoc.findItem(@quot;qualifiedGTheoryResult@quot;).getValue(); //合格结业理论考试成绩                      
                           var qualifiedGOperationResult= examInfoDoc.findItem(@quot;qualifiedGOperationResult@quot;).getValue();//合格结业实操考试成绩                       
                           var sumScorequal=parseDouble(qualifiedGTheoryResult)+parseDouble(qualifiedGOperationResult)                    
                               if(sumScore@gt;=sumScorequal){//都有，按照总分计算                       
                                testState=1   //及格                    
                               }else if(0@lt;sumScore@amp;@amp;sumScore@lt;sumScorequal){                    
                                testState=2  //不及格                    
                               }else{                       
                                testState=0  //未考试                     
                               }                       
                          println(@quot;sumScorequal----@gt;@quot;+sumScorequal)                   
                          println(@quot;testState----@gt;@quot;+testState)                      
                                            
                         var sql = @quot;SELECT ITEM_CLASSID,ID,ITEM_IDCARDNO from tlk_level_class_student where ITEM_IDCARDNO = '@quot;+idCardNo+@quot;'@quot;;                         
                         var datas = queryByDSName(@quot;tms@quot;,sql);                         
                         if(datas!=null){                         
                            for(var iterator = datas.iterator();iterator.hasNext();){                         
                                var map1 = iterator.next();//取值                         
                                sclassid = map1.get(@quot;ITEM_CLASSID@quot;);                         
                                sidCardNo = map1.get(@quot;ITEM_IDCARDNO@quot;);           
                                ID=map1.get(@quot;ID@quot;);           
                              println(@quot;学生ID@quot;+ID)           
                              println(@quot;数据库班级id：@quot;+sclassid);                         
                              println(@quot;数据库身份证号：@quot;+sidCardNo);                         
                             }                         
                         }                         
                         if (!sclassid.equals(hclassid)){                         
                             return @quot;身份证号为：@quot;+sidCardNo+@quot;的学员非本班级学员！@quot;;                 
                         }else{     
                          println(@quot;开始更新@quot;)            
                               //使用doupdate            
                              /* var process = getDocumentProcess();            
                               var examInfoDoc=findDocument(ID);             
                               examInfoDoc.findItem(@quot;graduationTestResults@quot;).setValue(testState);            
                               examInfoDoc.findItem(@quot;sumScore@quot;).setValue(sumScore);            
                               println(@quot;examInfoDoc@quot;+examInfoDoc)          
                               process.doUpdate(examInfoDoc);           
                                */   
                             var updatesql=@quot;update tlk_level_class_student set item_graduationTheoryScore='@quot;+writtenScore1+@quot;',item_graduationOperationScore='@quot;+writtenScore2+@quot;', item_graduationTestResults='@quot;+testState+@quot;',ITEM_SUMSCORE = '@quot;+sumScore+@quot;' where ITEM_IDCARDNO = '@quot;+idCardNo+@quot;'@quot;;           
                             updateByDSName(@quot;tms@quot;,updatesql);      
                            println(@quot;更新结束@quot;)   
                         }                   
                                                  
                         })</validateRule>
</cn.myapps.runtime.dynaform.dts.excelimport.Column>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1620630779257</startnodeid>
<endnodeid>1620631052992</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>579;196;560;107</pointstack>
<id>1620631088824</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Column>
<id>1620631098416</id>
<name>结业理论成绩</name>
<scale>0</scale>
<x>613</x>
<y>232</y>
<width>142</width>
<height>34</height>
<formName></formName>
<fieldName>graduationTheoryScore</fieldName>
<primaryKey>false</primaryKey>
<valueScript></valueScript>
<validateRule></validateRule>
</cn.myapps.runtime.dynaform.dts.excelimport.Column>
<cn.myapps.runtime.dynaform.dts.excelimport.Column>
<id>1620631137088</id>
<name>结业实操成绩</name>
<scale>0</scale>
<x>744</x>
<y>229</y>
<width>142</width>
<height>34</height>
<formName></formName>
<fieldName>graduationOperationScore</fieldName>
<primaryKey>false</primaryKey>
<valueScript></valueScript>
<validateRule></validateRule>
</cn.myapps.runtime.dynaform.dts.excelimport.Column>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1620630779257</startnodeid>
<endnodeid>1620631098416</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>737;209;560;107</pointstack>
<id>1620631168000</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1620630779257</startnodeid>
<endnodeid>1620631137088</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>943;175;560;107</pointstack>
<id>1620631170192</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
</cn.myapps.runtime.dynaform.dts.excelimport.ExcelMappingDiagram>
]]></xml>
  <templatePath>/uploads/exceltemplate/结业成绩录入.xlsx</templatePath>
</impMappingConfigVO>