人员导入 __DXZvc8mnEmDqMARhK7a __DXZvc8mnEmDqMARhK7a 16 2048 1536 rollback 1685594697467 人员 0 424 292 142 34 pt_securityman 1685594723946 姓名 0 298 171 142 34 name false //判断表单某字段不能为空 (function(){ var value = getItemValueAsString(@quot;name@quot;); if(!isNotNull(value)) { return @quot;姓名必须填写!@quot;; } })() 1685594723946 1685594697467 false false 424;292;296;176 1685594895275 1685594898860 身份证号 0 622 181 142 34 idcardno false //判断表单某字段不能为空 (function(){ var value = getItemValueAsString(@quot;idcardno@quot;); if(isNotNull(value)) { var doc=getCurrentDocument(); var sql = @quot;select @quot;+ @quot;'@quot;+getDomainid()+@quot;' as DOMAINID,@quot;+ @quot;ITEM_userID,@quot;+ //用户ID @quot;ID as item_ID,@quot;+ @quot;ITEM_COMPANYNAME,@quot;+ @quot;DOMAINID as item_domainid,case item_sex when '0' then '未知' when '1' then '男' when '2' then '女' else '其它' end as item_sex@quot;+ @quot; from vw_employee@quot;+ @quot; where item_documentID='@quot;+value+@quot;' and ITEM_isInMyCompany = '1'@quot;; println(@quot;sql--@gt;@quot;+sql); var datart = findBySQL(sql); if(isNotNull(datart)){ doc.findItem(@quot;tenant_user_id@quot;).setValue(datart.getItemValueAsString(@quot;ID@quot;)); doc.findItem(@quot;employee_id@quot;).setValue(datart.getItemValueAsString(@quot;userID@quot;)); doc.findItem(@quot;organization_name@quot;).setValue(datart.getItemValueAsString(@quot;COMPANYNAME@quot;)); doc.findItem(@quot;organization_id@quot;).setValue(datart.getItemValueAsString(@quot;domainid@quot;)); doc.findItem(@quot;sex@quot;).setValue(datart.getItemValueAsString(@quot;sex@quot;)); println(@quot;sql--@gt;@quot;+datart.getItemValueAsString(@quot;ID@quot;)); }else{ return @quot;@quot;; } var sql2 = @quot;select '@quot;+getDomainid()+@quot;' as DOMAINID,supervise_depart_id as item_superviseid,supervise_depart_name as item_supervisename from obpm2.tenant_organizations where id = '@quot;+getDomainid()+@quot;'@quot;; var datart2 = findBySQL(sql2); if(isNotNull(datart2)){ doc.findItem(@quot;superviseid@quot;).setValue(datart2.getItemValueAsString(@quot;superviseid@quot;)); doc.findItem(@quot;supervisename@quot;).setValue(datart2.getItemValueAsString(@quot;supervisename@quot;)); }else{ return @quot;@quot;; } } })() (function(){ var idcardno = getItemValueAsString(@quot;idcardno@quot;); var name = getItemValueAsString(@quot;name@quot;); if(!isNotNull(idcardno)) { return @quot;身份证号必须填写!@quot;; } var sql = @quot;select a.id from obpm2.tenant_user_credentials a join obpm2.tenant_employees b on a.tenant_user_id = b.tenant_user_id and b.status = '0' join obpm2.tenant_organizations c on c.id = b.organization_id and c.supervise_region_code like '11%' where a.number = '@quot;+idcardno+@quot;' and a.name = '@quot;+name+@quot;'@quot;; println(@quot;sql-----------@quot;+sql) var datas = queryByDSName(@quot;baibaodunFlow@quot;,sql); println(@quot;datas---------@quot;+datas) if(datas==@quot;[]@quot;){ return @quot;系统无此人员信息,请重新输入!@quot; } var sql2 = @quot;select id from tlk_pt_securityman where item_idcardno = '@quot;+idcardno+@quot;' and domainid = '@quot;+getDomainid()+@quot;'@quot;; println(@quot;sql2-----------@quot;+sql2) var datas2 = queryByDSName(@quot;baibaodunFlow@quot;,sql2); println(@quot;datas2---------@quot;+datas2) if(datas2!=@quot;[]@quot;){ return @quot;该人员已存在,请勿重复添加!@quot; } })() 1685594898860 1685594697467 false false 424;292;442;176 1685595016807 false false 1685595830662 ]]> /uploads/exceltemplate/社会力量(保安员)导入模板.xlsx