1
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
#引入clr运行库
|
||||
import clr
|
||||
#添加对cloud插件开发的常用组件引用
|
||||
clr.AddReference('System')
|
||||
clr.AddReference('System.Data')
|
||||
clr.AddReference('Kingdee.BOS')
|
||||
clr.AddReference('Kingdee.BOS.Core')
|
||||
clr.AddReference('Kingdee.BOS.App')
|
||||
clr.AddReference('Kingdee.BOS.Contracts')
|
||||
clr.AddReference('Kingdee.BOS.DataEntity')
|
||||
clr.AddReference('Kingdee.BOS.ServiceHelper')
|
||||
clr.AddReference('E_ZKEccSDK')
|
||||
|
||||
#dairycloud基础库中的常用实体对象(分命名空间导入,不会递归导入)
|
||||
from Kingdee.BOS.Core import *
|
||||
from Kingdee.BOS.Util import *
|
||||
from Kingdee.BOS.Core.Bill import *
|
||||
from Kingdee.BOS.Core.Bill.PlugIn import *
|
||||
from Kingdee.BOS.Orm.DataEntity import *
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
|
||||
from System import *
|
||||
from System.Data import *
|
||||
from System.Collections.Generic import *
|
||||
from Kingdee.BOS.App.Data import *
|
||||
from Kingdee.BOS.ServiceHelper import *
|
||||
|
||||
|
||||
def EndOperationTransaction(e):
|
||||
# 保存8提交9审核1反审核26删除3
|
||||
if this.FormOperation.OperationId == 1:
|
||||
Audit2DoUpdAttendanceData(e)
|
||||
|
||||
# 审核后更新考勤信息
|
||||
def Audit2DoUpdAttendanceData(e):
|
||||
ACCESS_KEY = "3391hexqe5h0wv4z4veju_dvn7gntnr5oiv_dxjabqtt"
|
||||
# 人员对接 employee
|
||||
更新人员 = "http://127.0.0.1:8088/api/v2/employee/update/?key=" + ACCESS_KEY
|
||||
获取人员信息 = "http://127.0.0.1:8088/api/v2/employee/get/?key=" + ACCESS_KEY
|
||||
人员离职 = "http://127.0.0.1:81/api/v2/employee/leave/?key=" + ACCESS_KEY
|
||||
离职恢复 = "http://127.0.0.1:81/api/v2/employee/restore/?key=" + ACCESS_KEY
|
||||
# http://14.21.32.187:8088/api/v2/transaction/get/?key=3391hexqe5h0wv4z4veju_dvn7gntnr5oiv_dxjabqtt
|
||||
|
||||
# 外部接口 http://14.21.32.187:8088/accounts/login/?next=/iclock/imanager
|
||||
url = "http://127.0.0.1:8088/api/v2"
|
||||
return
|
||||
|
||||
def GetE_ZKEccSDKAPIInfo():
|
||||
vSql = "/*dialect*/ SELECT * FROM V_E_ZKEccSDK_API_INFO "
|
||||
dataTable = DBUtils.ExecuteDynamicObject(this.Context, vSql)
|
||||
dataRow = dataTable[0]
|
||||
apiInfo = ApiInfoDomian()
|
||||
|
||||
apiInfo.appKey = dataRow["appKey"]
|
||||
apiInfo.apiVersion = dataRow["apiVersion"]
|
||||
apiInfo.serverUrl = dataRow["serverUrl"]
|
||||
|
||||
return apiInfo
|
||||
@@ -22,10 +22,10 @@
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="DB_StaffData\" />
|
||||
<Folder Include="GAT_StaffData\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DB_StaffData\OperationEventPlugInEx.py" />
|
||||
<Compile Include="GAT_StaffData\OperationEventPlugInEx.py" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
|
||||
<!-- Uncomment the CoreCompile target to enable the Build command in
|
||||
|
||||
96
13.得米新材/Demi.Python/GAT_StaffData/OperationEventPlugInEx.py
Normal file
96
13.得米新材/Demi.Python/GAT_StaffData/OperationEventPlugInEx.py
Normal file
@@ -0,0 +1,96 @@
|
||||
#引入clr运行库
|
||||
import clr
|
||||
#添加对cloud插件开发的常用组件引用
|
||||
clr.AddReference('System')
|
||||
clr.AddReference('System.Data')
|
||||
clr.AddReference('Kingdee.BOS')
|
||||
clr.AddReference('Kingdee.BOS.Core')
|
||||
clr.AddReference('Kingdee.BOS.App')
|
||||
clr.AddReference('Kingdee.BOS.Contracts')
|
||||
clr.AddReference('Kingdee.BOS.DataEntity')
|
||||
clr.AddReference('Kingdee.BOS.ServiceHelper')
|
||||
clr.AddReference('E_ZKEccSDK')
|
||||
|
||||
#dairycloud基础库中的常用实体对象(分命名空间导入,不会递归导入)
|
||||
from Kingdee.BOS.Core import *
|
||||
from Kingdee.BOS.Util import *
|
||||
from Kingdee.BOS.Core.Bill import *
|
||||
from Kingdee.BOS.Core.Bill.PlugIn import *
|
||||
from Kingdee.BOS.Orm.DataEntity import *
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
|
||||
from System import *
|
||||
from System.Data import *
|
||||
from System.Collections.Generic import *
|
||||
from Kingdee.BOS.App.Data import *
|
||||
from Kingdee.BOS.ServiceHelper import *
|
||||
from E_ZKEcc.Domian import *
|
||||
from E_ZKEcc.Service import *
|
||||
from E_ZKEcc.Request import *
|
||||
|
||||
# 操作后事务前
|
||||
def EndOperationTransaction(e):
|
||||
# 保存8提交9审核1反审核26删除3
|
||||
if this.FormOperation.OperationId == 1 and e.DataEntitys.Count > 0:
|
||||
# raise Exception(JsonUtil.Serialize(e.DataEntitys))
|
||||
DoUpdateEmployeeFunc(e.DataEntitys)
|
||||
|
||||
# 审核后更新考勤信息
|
||||
def DoUpdateEmployeeFunc(dataEntitys):
|
||||
apiInfo = GetE_ZKEccSDKAPIInfo()
|
||||
service = EmployeeService(apiInfo)
|
||||
datas = List[EmployeeUpdateRequest]()
|
||||
|
||||
idList = set(map(lambda x:x["Id"] , dataEntitys))
|
||||
dataList = GetDataList(idList)
|
||||
|
||||
if dataList != None and dataList.Count > 0:
|
||||
for entity in dataList:
|
||||
domain = EmployeeUpdateRequest()
|
||||
# 员工编号
|
||||
domain.pin = entity["FNUMBER"]
|
||||
# domain.pin = "99999"
|
||||
domain.name = entity["FNAME"]
|
||||
domain.deptnumber = "999"
|
||||
# 身份证
|
||||
domain.identitycard = entity["FIDTYPENUMBER"]
|
||||
|
||||
# 头像
|
||||
imageFilePath = entity["FLOCATIONPATH"]
|
||||
if imageFilePath != None:
|
||||
enrollpic = "" if imageFilePath == "" else ImageUtil.ImageFileToBase64(imageFilePath)
|
||||
domain.enrollpic = enrollpic;
|
||||
|
||||
datas.Add(domain)
|
||||
# raise Exception(JsonUtil.Serialize(datas))
|
||||
result = service.UpdateEmployee(datas)
|
||||
|
||||
if result.ret != 0:
|
||||
# raise Exception("错误信息:{0} ;请求数据:{1}".format(result.msg, JsonUtil.Serialize(datas)))
|
||||
raise Exception(result.msg)
|
||||
|
||||
# 获取数据
|
||||
def GetDataList(idList):
|
||||
sql ="""/*dialect*/
|
||||
SELECT t0.FID,t0.FNUMBER,t0_l.FNAME,t0.FIDTYPENUMBER,ISNULL(t1.FLOCATIONPATH,'') AS 'FLOCATIONPATH'
|
||||
FROM T_BD_StaffData t0
|
||||
INNER JOIN T_BD_StaffData_l t0_l on t0.FID = t0_l.FID AND t0_l.FLOCALEID = 2052
|
||||
LEFT JOIN T_BAS_FileServerFileInfo t1 on t0.FIMAGE = t1.FFILEID
|
||||
WHERE 1 = 1
|
||||
AND t0.FID IN ({0})
|
||||
""".format(",".join(map(str,idList)))
|
||||
return DBUtils.ExecuteDynamicObject(this.Context, sql)
|
||||
|
||||
# 获取api信息
|
||||
def GetE_ZKEccSDKAPIInfo():
|
||||
vSql = "/*dialect*/ SELECT * FROM V_E_ZKEccSDK_API_INFO "
|
||||
dataTable = DBUtils.ExecuteDynamicObject(this.Context, vSql)
|
||||
dataRow = dataTable[0]
|
||||
|
||||
apiInfo = ApiInfoDomian()
|
||||
apiInfo.appKey = dataRow["appKey"]
|
||||
apiInfo.apiVersion = dataRow["apiVersion"]
|
||||
apiInfo.serverUrl = dataRow["serverUrl"]
|
||||
|
||||
return apiInfo
|
||||
Reference in New Issue
Block a user