<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<impMappingConfigVO id="__RHrPEJFlMxA61kcuNza">
  <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>notRollback</needRollback>
<cn.myapps.runtime.dynaform.dts.excelimport.MasterSheet>
<id>1618538131343</id>
<name>批量修改成绩</name>
<scale>0</scale>
<x>415</x>
<y>84</y>
<width>142</width>
<height>34</height>
<formName>impScore</formName>
</cn.myapps.runtime.dynaform.dts.excelimport.MasterSheet>
<cn.myapps.runtime.dynaform.dts.excelimport.Column>
<id>1618538208276</id>
<name>准考证</name>
<scale>0</scale>
<x>266</x>
<y>239</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;);         
       var writtenScore=getItemValueAsInt(@quot;writtenScore@quot;);                 
       var operateScore=getItemValueAsInt(@quot;operateScore@quot;);   
       var testState=@quot;@quot;   
       var examId = new Packages.cn.myapps.common.util.cache.MemoryCacheUtil.getFromPrivateSpace(@quot;examId@quot;, getWebUser());//读缓存   
       println(@quot;examId----@gt;@quot;+examId)    
       var sumScore=getItemValueAsDouble(@quot;sumScore@quot;);   
       //根据数据id去获取对应的值   
       var examInfoDoc = findDocument(examId);   
       var isComputerExam = examInfoDoc.findItem(@quot;isComputerExam@quot;).getValue();    
       var isStamina = examInfoDoc.findItem(@quot;isStamina@quot;).getValue();    
       var examRules = examInfoDoc.findItem(@quot;examRules@quot;).getValue();    
       var writtenRatio = examInfoDoc.findItem(@quot;writtenRatio@quot;).getValue();   
       var operateRatio= examInfoDoc.findItem(@quot;operateRatio@quot;).getValue();   
       var examStandard= examInfoDoc.findItem(@quot;examStandard@quot;).getValue();   
       var writtenPassScore = examInfoDoc.findItem(@quot;writtenPassScore@quot;).getValue();   
       var operatePassScore= examInfoDoc.findItem(@quot;operatePassScore@quot;).getValue();   
       if(@quot;1@quot;.equals(isComputerExam) @amp;@amp; @quot;0@quot;.equals(isStamina) ){//只有理论   
           if(sumScore@gt;=examStandard){   
             testState=1   
           }else{   
             testState=0   
           }   
       }else if(@quot;0@quot;.equals(isComputerExam) @amp;@amp; @quot;1@quot;.equals(isStamina) ){//只有实操   
           if(sumScore@gt;=examStandard){   
             testState=1   
           }else{   
              testState=0   
           }   
       } else if(@quot;1@quot;.equals(isComputerExam) @amp;@amp; @quot;1@quot;.equals(isStamina) ){//都有，按照百分比计算   
         if(@quot;0@quot;.equals(examRules)){   
           if(sumScore@gt;=examStandard){   
             testState=1   
           }else{   
             testState=0   
           }   
      
         }else{   
           if(sumScore@gt;=examStandard){//都有，按照总分计算   
            testState=1   
           }else{   
            testState=0   
           }   
         }   
       }   
      println(@quot;testState----@gt;@quot;+testState)    
      
       
   //var signIn = getItemValue(@quot;signIn@quot;); //是否签到 到时候可以在导入模板中设置一个这个字段进行控制     
   var sql = @quot;select '@quot;+getDomainid()+@quot;' as domainid,@quot;+            
       @quot;a.ITEM_SECURITYID,@quot; + //保安员id            
       @quot;a.ITEM_IDCARDNO,@quot; + //身份证            
       @quot;a.ITEM_NAME,@quot; + //姓名            
       @quot;a.ITEM_COMPANY,@quot; + //所属公司            
       @quot;a.ITEM_MOBILE,@quot; + //手机号            
       @quot;a.ITEM_WRITTENSCORE,@quot; + //笔试成绩            
       @quot;a.ITEM_OPERATESCORE,@quot; + //实操成绩            
       @quot;a.ITEM_SUMSCORE,@quot; + //总成绩            
       @quot;a.ITEM_TESTSTATE,@quot; + //考试成绩状态            
       @quot;a.ITEM_NOTICESTATE,@quot; + //考试通知状态            
       //@quot;a.ITEM_SCOREMSGSTATE,@quot; + //成绩通知状态 scoreState           
       @quot;a.ITEM_scoreState,@quot; + //成绩确认状态 scoreState           
       @quot;a.ITEM_CARDSTATE,@quot; + //制证状态            
       @quot;a.ITEM_APPLYID,@quot; + //报名id            
       @quot;a.ITEM_WRITTENSTATE,@quot; + //笔试状态            
       @quot;a.ITEM_WRITTENRECORD,@quot; + //笔试做题记录            
       @quot;a.ITEM_ISMAKEUP,@quot; + //是否补考            
       @quot;a.ITEM_SIGNIN,@quot; + //是否签到            
       @quot;a.ITEM_CONFIRMDATE,@quot; + //确认成绩的时间            
       @quot;a.ITEM_EXAMID,@quot; + //考试id            
       @quot;a.ID,@quot;+            
       @quot;a.ID as ITEM_ID@quot;+            
       @quot; from tlk_system_exam_person a where ITEM_IDCARDNO = '@quot;+idCardNo+@quot;' @quot;+            
       @quot; and CREATED = (select MAX(CREATED) from tlk_system_exam_person where ITEM_IDCARDNO = a.ITEM_IDCARDNO) @quot;;            
   println(@quot;导入成绩查询sql打印====@quot;+sql);            
   var datas=findBySQL(sql);            
   if(isNotNull(datas)){            
     var SCOREMSGSTATE=datas.getItemValueAsString(@quot;scoreState@quot;);            
     if(@quot;1@quot;.equals(SCOREMSGSTATE)){            
       return idCardNo + @quot; 已确认成绩,无法修改成绩！@quot;;            
     }else{         
       var updatesql=@quot;update tlk_system_exam_person set item_writtenScore='@quot;+writtenScore+@quot;',item_testState='@quot;+testState+@quot;',ITEM_OPERATESCORE = '@quot;+operateScore+@quot;',ITEM_SUMSCORE = '@quot;+sumScore+@quot;' where ITEM_IDCARDNO = '@quot;+idCardNo+@quot;'@quot;;         
       updateByDSName(@quot;tms@quot;,updatesql);         
     }       
   }            
   })()</validateRule>
</cn.myapps.runtime.dynaform.dts.excelimport.Column>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1618538131343</startnodeid>
<endnodeid>1618538131343</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>520;150;520;150</pointstack>
<id>1618538241753</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1618538131343</startnodeid>
<endnodeid>1618538131343</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>518;99;518;99</pointstack>
<id>1618538254002</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1618538208276</startnodeid>
<endnodeid>1618538208276</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>398;239;398;239</pointstack>
<id>1618538272556</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1618538131343</startnodeid>
<endnodeid>1618538131343</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>547;77;547;77</pointstack>
<id>1618538290704</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1618538131343</startnodeid>
<endnodeid>1618538131343</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>581;136;581;136</pointstack>
<id>1618538320011</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1618538208276</startnodeid>
<endnodeid>1618538208276</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>398;239;398;239</pointstack>
<id>1618538323900</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1618538131343</startnodeid>
<endnodeid>1618538131343</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>572;83;572;83</pointstack>
<id>1618538328330</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1618538131343</startnodeid>
<endnodeid>1618538208276</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>398;239;572;83</pointstack>
<id>1618538375791</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Column>
<id>1618538384559</id>
<name>理论成绩</name>
<scale>0</scale>
<x>391</x>
<y>250</y>
<width>142</width>
<height>34</height>
<formName></formName>
<fieldName>writtenScore</fieldName>
<primaryKey>false</primaryKey>
<valueScript></valueScript>
<validateRule></validateRule>
</cn.myapps.runtime.dynaform.dts.excelimport.Column>
<cn.myapps.runtime.dynaform.dts.excelimport.Column>
<id>1618538413494</id>
<name>体能成绩</name>
<scale>0</scale>
<x>500</x>
<y>248</y>
<width>142</width>
<height>34</height>
<formName></formName>
<fieldName>operateScore</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>1618538131343</startnodeid>
<endnodeid>1618538384559</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>447;250;415;84</pointstack>
<id>1618538434312</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1618538131343</startnodeid>
<endnodeid>1618538413494</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>622;229;415;84</pointstack>
<id>1618538438890</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<cn.myapps.runtime.dynaform.dts.excelimport.Column>
<id>1618538470454</id>
<name>总成绩</name>
<scale>0</scale>
<x>648</x>
<y>243</y>
<width>142</width>
<height>34</height>
<formName></formName>
<fieldName>sumScore</fieldName>
<primaryKey>false</primaryKey>
<valueScript>/*(function(){            
             println(@quot;总成绩值脚本打印===@quot;);            
                  
         var examId = new Packages.cn.myapps.common.util.cache.MemoryCacheUtil.getFromPrivateSpace(@quot;examId@quot;, getWebUser());//读缓存新的读写缓存函数地址         
           println(@quot;examId打印===@quot;+examId);          
            var writtenScore=getItemValueAsInt(@quot;writtenScore@quot;);            
            var operateScore=getItemValueAsInt(@quot;operateScore@quot;);            
            println(@quot;理论成绩===@quot;+writtenScore);        
        	println(@quot;体能成绩===@quot;+operateScore);        
            var examInfoDoc = findDocument(examId);           
            var isComputerExam = examInfoDoc.findItem(@quot;isComputerExam@quot;).getValue();             
            var isStamina = examInfoDoc.findItem(@quot;isStamina@quot;).getValue();             
            var examRules = examInfoDoc.findItem(@quot;examRules@quot;).getValue();             
            var writtenRatio = examInfoDoc.findItem(@quot;writtenRatio@quot;).getValue();            
            var operateRatio= examInfoDoc.findItem(@quot;operateRatio@quot;).getValue();            
            var examStandard= examInfoDoc.findItem(@quot;examStandard@quot;).getValue();            
            var writtenPassScore = examInfoDoc.findItem(@quot;writtenPassScore@quot;).getValue();            
            var operatePassScore= examInfoDoc.findItem(@quot;operatePassScore@quot;).getValue();            
          
            if(@quot;1@quot;.equals(isComputerExam) @amp;@amp; @quot;0@quot;.equals(isStamina) ){         
              return writtenScore;       
            }else if(@quot;0@quot;.equals(isComputerExam) @amp;@amp; @quot;1@quot;.equals(isStamina) ){       
              return operateScore;            
            } else if(@quot;1@quot;.equals(isComputerExam) @amp;@amp; @quot;1@quot;.equals(isStamina) ){          
              if(@quot;0@quot;.equals(examRules)){            
                writtenScore = writtenScore * (writtenRatio / 100);            
                operateScore = operateScore * (operateRatio / 100);            
                return writtenScore + operateScore;            
              }else{            
                return writtenScore + operateScore;           
              }            
            }            
            })()    
    */   
  (function(){            
     var idcardno = getItemValueAsString(@quot;idCardNo@quot;)  
 println(@quot;idcardno------------@quot;+idcardno) 
     var sql=@quot;update tlk_system_exam_person set item_apptype = '1' where item_idcardno = '@quot;+idcardno+@quot;'@quot;; 
 println(@quot;sql------------@quot;+sql) 
     updateByDSName(@quot;tms@quot;,sql)  
   })()</valueScript>
<validateRule></validateRule>
</cn.myapps.runtime.dynaform.dts.excelimport.Column>
<cn.myapps.runtime.dynaform.dts.excelimport.Relation>
<state></state>
<startnodeid>1618538131343</startnodeid>
<endnodeid>1618538470454</endnodeid>
<ispassed>false</ispassed>
<isreturn>false</isreturn>
<condition></condition>
<pointstack>648;245;415;84</pointstack>
<id>1618538798827</id>
<name></name>
</cn.myapps.runtime.dynaform.dts.excelimport.Relation>
</cn.myapps.runtime.dynaform.dts.excelimport.ExcelMappingDiagram>
]]></xml>
  <templatePath>/uploads/exceltemplate/批量修改成绩.xlsx</templatePath>
</impMappingConfigVO>