a
This commit is contained in:
82
Enpower.PRD_MO.Python/Enpower.PRD_MO.Python.py
Normal file
82
Enpower.PRD_MO.Python/Enpower.PRD_MO.Python.py
Normal file
@@ -0,0 +1,82 @@
|
||||
#<23><><EFBFBD><EFBFBD>clr<6C><72><EFBFBD>п<EFBFBD>
|
||||
import clr
|
||||
#<23><><EFBFBD>Ӷ<EFBFBD>cloud<75><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
clr.AddReference('System')
|
||||
clr.AddReference('System.Data')
|
||||
# <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>start
|
||||
clr.AddReference('Kingdee.BOS')
|
||||
clr.AddReference('Kingdee.BOS.App')
|
||||
clr.AddReference('Kingdee.BOS.App.Core')
|
||||
clr.AddReference('Kingdee.BOS.Business.DynamicForm')
|
||||
clr.AddReference('Kingdee.BOS.Contracts')
|
||||
clr.AddReference('Kingdee.BOS.Core')
|
||||
clr.AddReference('Kingdee.BOS.DataEntity')
|
||||
clr.AddReference('Kingdee.BOS.ServiceHelper')
|
||||
# <20><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>end
|
||||
|
||||
#dairycloud<75><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еij<D0B5><C4B3><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A3A8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ䵼<D5BC>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD><EFBFBD>ݹ鵼<DDB9>룩
|
||||
from System import *
|
||||
from System.Data import *
|
||||
from System.Collections.Generic import List
|
||||
from Kingdee.BOS.Core import *
|
||||
from Kingdee.BOS.Util import *
|
||||
from Kingdee.BOS.Core.List import *
|
||||
from Kingdee.BOS.Core.List.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.App.Data import *
|
||||
from Kingdee.BOS.ServiceHelper import *
|
||||
|
||||
# def OnPreparePropertys(e):
|
||||
# e.FieldKeys.Add("FWorkTimeType")
|
||||
|
||||
def AfterDoOperation(e):
|
||||
# <20><><EFBFBD><EFBFBD>8<EFBFBD>ύ9<E1BDBB><39><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>26
|
||||
if e.Operation.Operation == "DoUpdatePPBOMLevel":
|
||||
datas = this.View.SelectedRowsInfo
|
||||
whereSql = ""
|
||||
if datas.Count > 0:
|
||||
whereSql = "AND t0.FID IN({0})".format( ",".join(set(map(lambda x :str(x.PrimaryKeyValue),datas))))
|
||||
|
||||
sql = """/*dialect*/
|
||||
UPDATE t0e SET t0e.FFORECASTGROUP = t1e.FFORECASTGROUP
|
||||
,t0e.FFORECASTGROUPFRIST = CASE
|
||||
WHEN CHARINDEX( '-',REPLACE( t1e.FFORECASTGROUP,'_','-') ,0) = 0
|
||||
THEN t1e.FFORECASTGROUP
|
||||
ELSE SUBSTRING(t1e.FFORECASTGROUP,0, CHARINDEX( '-',REPLACE( t1e.FFORECASTGROUP,'_','-') ,0))
|
||||
END
|
||||
FROM T_PRD_PPBOM t0
|
||||
INNER JOIN T_PRD_PPBOMENTRY t0e on t0.FID = t0e.FID
|
||||
INNER JOIN T_PRD_MOENTRY t1e on t1e.FID = t0.FMOID
|
||||
WHERE 1 = 1 AND t1e.FFORECASTGROUP != ''
|
||||
AND t0e.FFORECASTGROUP = ''
|
||||
AND t0e.FFORECASTGROUPFRIST != t1e.FFORECASTGROUPFRIST
|
||||
{0} """.format(whereSql)
|
||||
# raise Exception(sql)
|
||||
# count = DBUtils.Execute(this.Context, sql)
|
||||
|
||||
# def EndOperationTransaction(e):
|
||||
# if this.FormOperation.Operation == "DoUpdatePPBOMLevel":
|
||||
# datas = e.DataEntitys;
|
||||
# whereSql = ""
|
||||
# if datas.Count > 0:
|
||||
# whereSql = "AND t0.FID IN({0})".format( ",".join(set(map(lambda x :str(x.Id),datas))))
|
||||
|
||||
# sql = """/*dialect*/
|
||||
# UPDATE t0e SET t0e.FFORECASTGROUP = t1e.FFORECASTGROUP
|
||||
# ,t0e.FFORECASTGROUPFRIST = CASE
|
||||
# WHEN CHARINDEX( '-',REPLACE( t1e.FFORECASTGROUP,'_','-') ,0) = 0
|
||||
# THEN t1e.FFORECASTGROUP
|
||||
# ELSE SUBSTRING(t1e.FFORECASTGROUP,0, CHARINDEX( '-',REPLACE( t1e.FFORECASTGROUP,'_','-') ,0))
|
||||
# END
|
||||
# FROM T_PRD_PPBOM t0
|
||||
# INNER JOIN T_PRD_PPBOMENTRY t0e on t0.FID = t0e.FID
|
||||
# INNER JOIN T_PRD_MOENTRY t1e on t1e.FID = t0.FMOID
|
||||
# WHERE 1 = 1 AND t1e.FFORECASTGROUP != ''
|
||||
# AND t0e.FFORECASTGROUP = ''
|
||||
# AND t0e.FFORECASTGROUPFRIST != t1e.FFORECASTGROUPFRIST
|
||||
# {0}
|
||||
# """.format(whereSql)
|
||||
|
||||
# raise Exception(sql)
|
||||
35
Enpower.PRD_MO.Python/Enpower.PRD_MO.Python.pyproj
Normal file
35
Enpower.PRD_MO.Python/Enpower.PRD_MO.Python.pyproj
Normal file
@@ -0,0 +1,35 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>40e7687c-e939-468e-a79a-ef5cbd14dd97</ProjectGuid>
|
||||
<ProjectHome>.</ProjectHome>
|
||||
<StartupFile>Enpower.PRD_MO.Python.py</StartupFile>
|
||||
<SearchPath>
|
||||
</SearchPath>
|
||||
<WorkingDirectory>.</WorkingDirectory>
|
||||
<OutputPath>.</OutputPath>
|
||||
<Name>Enpower.PRD_MO.Python</Name>
|
||||
<RootNamespace>Enpower.PRD_MO.Python</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Enpower.PRD_MO.Python.py" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
|
||||
<!-- Uncomment the CoreCompile target to enable the Build command in
|
||||
Visual Studio and specify your pre- and post-build commands in
|
||||
the BeforeBuild and AfterBuild targets below. -->
|
||||
<!--<Target Name="CoreCompile" />-->
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user