a
This commit is contained in:
20
00.未分类/UnitTestProject2/Properties/AssemblyInfo.cs
Normal file
20
00.未分类/UnitTestProject2/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("UnitTestProject2")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("UnitTestProject2")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("3f9daefd-d6af-4fa8-b6b2-485832ab9b26")]
|
||||
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
32
00.未分类/UnitTestProject2/UnitTest1.cs
Normal file
32
00.未分类/UnitTestProject2/UnitTest1.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.Orm.Metadata.DataEntity;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UnitTestProject2
|
||||
{
|
||||
[TestClass]
|
||||
public class UnitTest1
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestMethod1()
|
||||
{
|
||||
|
||||
//var a = new DynamicObject(new DynamicObjectType("COUNT_GAIN"));
|
||||
|
||||
var a = new Dictionary<string, Dictionary<string, string>>();
|
||||
a.Add("a", new Dictionary<string, string>());
|
||||
a.Add("b", new Dictionary<string, string>());
|
||||
|
||||
var keys = new[] { "a", "a", "b" };
|
||||
foreach (var key in keys)
|
||||
{
|
||||
var item = a[key];
|
||||
item.Add("ttt", "1232");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
83
00.未分类/UnitTestProject2/UnitTestProject2.csproj
Normal file
83
00.未分类/UnitTestProject2/UnitTestProject2.csproj
Normal file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\MSTest.TestAdapter.2.2.10\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\..\packages\MSTest.TestAdapter.2.2.10\build\net45\MSTest.TestAdapter.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{3F9DAEFD-D6AF-4FA8-B6B2-485832AB9B26}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>UnitTestProject2</RootNamespace>
|
||||
<AssemblyName>UnitTestProject2</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||
<IsCodedUITest>False</IsCodedUITest>
|
||||
<TestProjectType>UnitTest</TestProjectType>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Kingdee.BOS">
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.App">
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.App.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Core">
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.DataEntity">
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.DataEntity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Model">
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.Model.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="UnitTest1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\MSTest.TestAdapter.2.2.10\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MSTest.TestAdapter.2.2.10\build\net45\MSTest.TestAdapter.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\MSTest.TestAdapter.2.2.10\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MSTest.TestAdapter.2.2.10\build\net45\MSTest.TestAdapter.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\MSTest.TestAdapter.2.2.10\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\..\packages\MSTest.TestAdapter.2.2.10\build\net45\MSTest.TestAdapter.targets')" />
|
||||
</Project>
|
||||
5
00.未分类/UnitTestProject2/packages.config
Normal file
5
00.未分类/UnitTestProject2/packages.config
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MSTest.TestAdapter" version="2.2.10" targetFramework="net45" />
|
||||
<package id="MSTest.TestFramework" version="2.2.10" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -45,5 +45,12 @@
|
||||
<Compile Include="WebHelper.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="sql\发票打印信息清空.sql" />
|
||||
<Content Include="sql\多组织即时库存查询.sql" />
|
||||
<Content Include="sql\拼接表字段为查询语句.sql" />
|
||||
<Content Include="sql\查询字段所在表.sql" />
|
||||
<Content Include="sql\查询表名.sql" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
15
01.扩展/HandleUtils/sql/发票打印信息清空.sql
Normal file
15
01.扩展/HandleUtils/sql/发票打印信息清空.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
T_SAL_outstockfin
|
||||
WHERE
|
||||
FINVOICENUMBER != '';
|
||||
|
||||
UPDATE T_SAL_outstockfin
|
||||
SET FINVOICENUMBER = '',
|
||||
FINVOICEURL = '',
|
||||
FFPQQLSH = '',
|
||||
FFPLXDM = ''
|
||||
WHERE
|
||||
FINVOICENUMBER != ''
|
||||
AND fentryid = 100041
|
||||
28
01.扩展/HandleUtils/sql/多组织即时库存查询.sql
Normal file
28
01.扩展/HandleUtils/sql/多组织即时库存查询.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
SELECT
|
||||
T0.FMASTERID
|
||||
,T0.FMATERIALID
|
||||
,T0.FNUMBER
|
||||
,ISNULL(T1.STOCKQTY,0) AS FSTOCKQTY
|
||||
,T0.FUSEORGID
|
||||
,t2_l.FNAME
|
||||
FROM
|
||||
T_BD_MATERIAL T0
|
||||
LEFT JOIN T_BD_MATERIALPRODUCE T0P ON T0P.FMATERIALID = T0.FMATERIALID
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
T1.FMATERIALID
|
||||
|
||||
,t1.FSTOCKORGID
|
||||
,SUM(T1.FBASEQTY) AS STOCKQTY
|
||||
FROM
|
||||
T_STK_INVENTORY T1
|
||||
GROUP BY
|
||||
T1.FMATERIALID,
|
||||
t1.FSTOCKORGID
|
||||
) T1 ON T0.FMASTERID = T1.FMATERIALID --物料id
|
||||
AND t0.FUSEORGID = t1.FSTOCKORGID --使用组织
|
||||
LEFT JOIN T_ORG_ORGANIZATIONS_L t2_l on t2_l.FORGID = t0.FUSEORGID AND t2_l.FLOCALEID =2052
|
||||
WHERE
|
||||
T0.FDOCUMENTSTATUS = 'C'
|
||||
AND t0.FNUMBER = '1.01.003' --物料编码
|
||||
ORDER BY T0.FMATERIALID
|
||||
9
01.扩展/HandleUtils/sql/拼接表字段为查询语句.sql
Normal file
9
01.扩展/HandleUtils/sql/拼接表字段为查询语句.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
DECLARE @tableName VARCHAR(100),@alias varchar(100),@sql varchar(8000)
|
||||
SET @tableName = 'T_PRD_PMPPBOMENTRY'
|
||||
SET @alias = 't0e'
|
||||
SELECT @sql = CONCAT('SELECT ',
|
||||
STUFF((SELECT ',' + CHAR(10) +@alias+'.' + t0.name FROM SYSCOLUMNS t0
|
||||
WHERE ID = OBJECT_ID(@tableName)
|
||||
ORDER BY t0.colid FOR XML PATH('')),1,1,''),CHAR(10),' FROM ' ,@tableName ,' ', @alias)
|
||||
|
||||
PRINT @sql
|
||||
11
01.扩展/HandleUtils/sql/查询字段所在表.sql
Normal file
11
01.扩展/HandleUtils/sql/查询字段所在表.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
SELECT
|
||||
a.name 表名,
|
||||
b.name 列名
|
||||
FROM
|
||||
sysobjects a,
|
||||
syscolumns b
|
||||
WHERE
|
||||
a.id= b.id
|
||||
AND b.name LIKE '%FSTOCKID'
|
||||
AND a.type= 'U'
|
||||
AND a.name LIKE 'T_PRD_PPBOM%'
|
||||
7
01.扩展/HandleUtils/sql/查询表名.sql
Normal file
7
01.扩展/HandleUtils/sql/查询表名.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sysobjects a
|
||||
WHERE
|
||||
a.name LIKE 'T_AR_RECEIVABLEENTRY%'
|
||||
AND a.type= 'U'
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<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>0bc2f871-b50d-41c3-9267-abde125d9b17</ProjectGuid>
|
||||
<ProjectHome>.</ProjectHome>
|
||||
<StartupFile>HW.PRD_LackAnalyeBill.Python.py</StartupFile>
|
||||
<SearchPath>
|
||||
</SearchPath>
|
||||
<WorkingDirectory>.</WorkingDirectory>
|
||||
<OutputPath>.</OutputPath>
|
||||
<Name>HW.PRD_LackAnalyeBill.Python</Name>
|
||||
<RootNamespace>HW.PRD_LackAnalyeBill.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="HW.PRD_LackAnalyeBill.Python.py" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="sql\" />
|
||||
</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>
|
||||
@@ -0,0 +1,54 @@
|
||||
SELECT
|
||||
t0.FID
|
||||
,t0.FBILLNO
|
||||
,t0e.FMATERIALID
|
||||
,t0e.FMUSTQTY
|
||||
,t0e.FPICKEDQTY
|
||||
,t0e.FINVQTY
|
||||
,t0e.FCANPICKEDQTY
|
||||
,t0e.FLACKQTY
|
||||
,t0e.FBOMID
|
||||
,t0e.FSUMMARYID
|
||||
--,t0e.*
|
||||
FROM T_PRD_LACKANALYSEBILL t0
|
||||
INNER JOIN T_PRD_LACKENTRY t0e on t0e.FID = t0.FID
|
||||
--where t0.FID = 101203
|
||||
SELECT
|
||||
--t0.FID
|
||||
--,t0.FBILLNO
|
||||
--,t0e.FMATERIALID
|
||||
--,t0e.FSELECTED
|
||||
--,t0e.FQTY
|
||||
t0e.*
|
||||
FROM T_PRD_LACKANALYSEBILL t0
|
||||
INNER JOIN T_PRD_LACKMOENTRY t0e on t0.FID = t0e.FID
|
||||
|
||||
SELECT t1.FNUMBER,t0e_a.FSUMMARYID,*
|
||||
FROM T_PRD_PMPPBOMENTRY t0e
|
||||
INNER JOIN T_PRD_PMPPBOMENTRY_A t0e_a on t0e.FENTRYID = t0e_a.FENTRYID
|
||||
INNER JOIN T_BD_MATERIAL t1 on t1.FMATERIALID = t0e.FMATERIALIDSUB
|
||||
where t0e.FID = 101203
|
||||
--AND t1.FNUMBER = 'TSB074H000108O'
|
||||
|
||||
|
||||
--MERGE INTO T_PRD_LACKENTRY U1 USING(
|
||||
--SELECT S.FID,S.FSUMMARYID,S.FENTRYID,S1.FMOBILLNO
|
||||
--FROM (
|
||||
-- SELECT T1.FID,T2.FSUMMARYID,MIN(T1.FENTRYID) AS FENTRYID
|
||||
-- FROM T_PRD_PMPPBOMENTRY T1
|
||||
-- INNER JOIN T_PRD_PMPPBOMENTRY_A T2 ON T1.FENTRYID = T2.FENTRYID --and t1.fid = @lFId
|
||||
-- GROUP BY T1.FID,T2.FSUMMARYID) S
|
||||
-- INNER JOIN T_PRD_PMPPBOMENTRY S1 ON S.FENTRYID = S1.FENTRYID
|
||||
-- INNER JOIN T_PRD_PMPPBOMENTRY_A S2 ON S.FENTRYID = S2.FENTRYID) U2 ON U1.FID = U2.FID AND U1.FSUMMARYID = U2.FSUMMARYID
|
||||
--WHEN MATCHED
|
||||
--THEN UPDATE SET U1.F_ISVCODE_MOBILLNO = U2.FMOBILLNO;
|
||||
|
||||
--SELECT S.FID,S.FSUMMARYID,S.FENTRYID,S1.FMOBILLNO
|
||||
--FROM (
|
||||
-- SELECT T1.FID,T2.FSUMMARYID,MIN(T1.FENTRYID) AS FENTRYID
|
||||
-- FROM T_PRD_PMPPBOMENTRY T1
|
||||
-- INNER JOIN T_PRD_PMPPBOMENTRY_A T2 ON T1.FENTRYID = T2.FENTRYID --and t1.fid = @lFId
|
||||
-- GROUP BY T1.FID,T2.FSUMMARYID) S
|
||||
-- INNER JOIN T_PRD_PMPPBOMENTRY S1 ON S.FENTRYID = S1.FENTRYID
|
||||
-- INNER JOIN T_PRD_PMPPBOMENTRY_A S2 ON S.FENTRYID = S2.FENTRYID
|
||||
|
||||
@@ -3190,7 +3190,7 @@ FROM (
|
||||
ORDER BY FOrderNum,FSEQ1,FSEQ2,FSEQ3,FSEQ4,FSEQ5,FSEQ6
|
||||
|
||||
SELECT
|
||||
t0.FMATERIALID AS 'ProMateralId'
|
||||
t0.FMATERIALID AS 'ProMaterialId'
|
||||
,t1e.FMATERIALID
|
||||
,t1e_c.FSTOCKID
|
||||
--,t1.FBILLNO
|
||||
@@ -3210,12 +3210,13 @@ FROM #TEMPMO t0
|
||||
GROUP BY
|
||||
t0.FMATERIALID,t1e.FMATERIALID,t1e_c.FSTOCKID
|
||||
|
||||
SELECT t0.ProMateralId,t0.MONOS,t0.SALENOS,t0.MOIDS,t0.MOENTRYIDS
|
||||
SELECT t0.ProMaterialId,t0.MONOS,t0.SALENOS,t0.MOIDS,t0.MOENTRYIDS
|
||||
INTO #TEMPMONO2Pro
|
||||
FROM #TEMPMOQTY t0
|
||||
GROUP BY t0.ProMateralId,t0.MONOS,t0.SALENOS,t0.MOIDS,t0.MOENTRYIDS
|
||||
GROUP BY t0.ProMaterialId,t0.MONOS,t0.SALENOS,t0.MOIDS,t0.MOENTRYIDS
|
||||
|
||||
SELECT 序号 AS 'FIDENTITYID'
|
||||
,物料内码
|
||||
,物料代码,物料名称,规格型号,旧编码
|
||||
,上期结存,本期采购入库,本期耗用,期末结存
|
||||
,销售出库数量,仓库拨出数量,仓库拨入数量,申购未转数
|
||||
@@ -3224,13 +3225,15 @@ SELECT 序号 AS 'FIDENTITYID'
|
||||
,t1.FBASENEEDQTY
|
||||
,t1.FBASENOPICKEDQTY
|
||||
,t1.FBASEPICKEDQTY
|
||||
,CASE CHARINDEX(',',t2.MONOS) WHEN 0 THEN t2.MONOS ELSE '' END AS 'MONO'
|
||||
,CASE CHARINDEX(',',t2.SALENOS) WHEN 0 THEN t2.SALENOS ELSE '' END AS 'SALENO'
|
||||
,t2.SALENOS,t2.MOENTRYIDS,t2.MOIDS,t0.FProMaterialId
|
||||
--,CASE CHARINDEX(',',t2.MONOS) WHEN 0 THEN t2.MONOS ELSE '' END AS 'MONO'
|
||||
--,CASE CHARINDEX(',',t2.SALENOS) WHEN 0 THEN t2.SALENOS ELSE '' END AS 'SALENO'
|
||||
,t2.SALENOS AS SALENO
|
||||
,t2.MONOS AS MONO
|
||||
,t2.SALENOS,t2.MOENTRYIDS,t2.MOIDS,t2.ProMaterialId
|
||||
INTO {0}
|
||||
FROM #Stock_Bom t0
|
||||
LEFT JOIN #TEMPMONO2Pro t2 on t2.ProMateralId = t0.FProMaterialId
|
||||
LEFT JOIN #TEMPMOQTY t1 ON t0.物料内码 = t1.FMATERIALID AND t0.仓库内码 = t1.FSTOCKID AND t0.FProMaterialId = t1.ProMateralId
|
||||
LEFT JOIN #TEMPMONO2Pro t2 on t2.ProMaterialId = t0.FProMaterialId
|
||||
LEFT JOIN #TEMPMOQTY t1 ON t0.物料内码 = t1.FMATERIALID AND t0.仓库内码 = t1.FSTOCKID AND t0.FProMaterialId = t1.ProMaterialId
|
||||
|
||||
DROP TABLE #TEMPMO
|
||||
DROP TABLE #TEMPMOQTY
|
||||
|
||||
@@ -27,12 +27,37 @@ def CellDbClick(e):
|
||||
e.Cancel = True
|
||||
fldKey = e.Header.FieldName;
|
||||
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>嵥
|
||||
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
# if fldKey == "FBASENEEDQTY":
|
||||
# reportModel = this.Model
|
||||
# tab = reportModel.DataSource
|
||||
# row = e.CellRowIndex - 1
|
||||
# data = tab.Rows[row]
|
||||
# moIds = "0";
|
||||
# if data["MOIDS"] !=None and data["MOIDS"] != "":
|
||||
# moIds = data["MOIDS"];
|
||||
# filterStr = "FID IN ({0}) AND FMATERIALID = {1} ".format(moIds,data["ProMaterialId"])
|
||||
# ShowListForm("PRD_MO", filterStr)
|
||||
if fldKey == "FBASENEEDQTY":
|
||||
reportModel = this.Model
|
||||
tab = reportModel.DataSource
|
||||
row = e.CellRowIndex - 1
|
||||
data = tab.Rows[row]
|
||||
filterStr = "FID IN ({0}) AND FMATERIALID = {1} ".format(data["MOIDS"],data["FProMaterialId"])
|
||||
moIds = "0";
|
||||
if data["MOIDS"] !=None and data["MOIDS"] != "":
|
||||
moIds = data["MOIDS"];
|
||||
filterStr = "t1.FMOID IN ({0}) AND t1.FMATERIALID = {1} ".format(moIds,data["<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"])
|
||||
ShowListForm("PRD_PPBOM", filterStr)
|
||||
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if fldKey == "FBASEPICKEDQTY":
|
||||
reportModel = this.Model
|
||||
tab = reportModel.DataSource
|
||||
row = e.CellRowIndex - 1
|
||||
data = tab.Rows[row]
|
||||
moIds = "0";
|
||||
if data["MOIDS"] !=None and data["MOIDS"] != "":
|
||||
moIds = data["MOIDS"];
|
||||
filterStr = "FID IN ({0}) AND FMATERIALID = {1} ".format(moIds,data["ProMaterialId"])
|
||||
ShowListForm("PRD_MO", filterStr)
|
||||
|
||||
def ShowListForm(_fromId, _filter, _operationStatus = OperationStatus.VIEW ,_openStyleShowType = ShowType.Floating):
|
||||
|
||||
@@ -32,7 +32,7 @@ def OnPreparePropertys(e):
|
||||
e.FieldKeys.Add("FHRWORKTIME")
|
||||
|
||||
def EndOperationTransaction(e):
|
||||
# <20><><EFBFBD><EFBFBD>8<EFBFBD>ύ9<E1BDBB><39><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>26
|
||||
# <20><><EFBFBD><EFBFBD>8<EFBFBD>ύ9<E1BDBB><39><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>26ɾ<EFBFBD><EFBFBD>3
|
||||
if this.FormOperation.OperationId == 1:
|
||||
# sqlList = """"""
|
||||
sqlLList=List[str]();
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="SQLServer\实际工时归集关联查询.sql" />
|
||||
<Content Include="SQLServer\长园客户与开票单位数据置换.sql" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
|
||||
<!-- Uncomment the CoreCompile target to enable the Build command in
|
||||
|
||||
@@ -63,7 +63,8 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="实际工时归集关联查询.sql" />
|
||||
<Content Include="sql\SQLQuery1.sql" />
|
||||
<Content Include="sql\实际工时归集关联查询.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\01.扩展\Extensions\ExtensionMethods.csproj">
|
||||
|
||||
28
05.长园/CY.PRD_MORPT/sql/SQLQuery1.sql
Normal file
28
05.长园/CY.PRD_MORPT/sql/SQLQuery1.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
/***********<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<EFBFBD><EFBFBD>start*********************/
|
||||
----UPDATE tt.F_CYG_TEXT1 =
|
||||
--SELECT
|
||||
-- tt.FENTRYID, --<2D><><EFBFBD><EFBFBD>֪ͨ<CDA8><D6AA>
|
||||
-- STUFF((SELECT ','+ CONVERT(VARCHAR(100),t0e.FENTRYID/*t0e.F_CYG_TEXT4*/) --CONVERT ֵ<><D6B5><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;Ͳ<CDBE><CDB2><EFBFBD>Ҫ FENTRYID <20><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ҫ
|
||||
-- FROM T_SAL_ORDERENTRY t0e --<2D><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>
|
||||
-- INNER JOIN T_SAL_DELIVERYNOTICEENTRY_LK t1e_lk --<2D><><EFBFBD><EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>
|
||||
-- ON t0e.FID = t1e_lk.FSBILLID AND t0e.FENTRYID = t1e_lk.FSID
|
||||
-- WHERE t1e_lk.FENTRYID = tt.FENTRYID --ƴ<>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD>ֶ<EFBFBD>
|
||||
-- AND t1e_lk.FSTABLENAME = 'T_SAL_ORDERENTRY'
|
||||
-- FOR XML PATH('')
|
||||
-- ),1,1,'') --stuff <20><>ת<EFBFBD>к<EFBFBD>ƴ<EFBFBD><C6B4>
|
||||
--FROM T_SAL_DELIVERYNOTICEENTRY tt --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<EFBFBD><EFBFBD>
|
||||
/***********<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<EFBFBD><EFBFBD>end*********************/
|
||||
|
||||
/***********Ӧ<EFBFBD>յ<EFBFBD>start*********************/
|
||||
SELECT
|
||||
tt.FENTRYID, --Ӧ<EFBFBD>յ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ISNULL(STUFF((SELECT ','+ CONVERT(VARCHAR(100),t0e.FENTRYID/*t0e.F_CYG_TEXT4*/) --CONVERT ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;Ͳ<EFBFBD><EFBFBD><EFBFBD>Ҫ FENTRYID <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD>Ҫ
|
||||
FROM T_SAL_ORDERENTRY t0e --<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD>
|
||||
INNER JOIN T_AR_RECEIVABLEENTRY_LK t1e_lk --Ӧ<EFBFBD>յ<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD>
|
||||
ON t0e.FID = t1e_lk.FSBILLID AND t0e.FENTRYID = t1e_lk.FSID
|
||||
WHERE t1e_lk.FENTRYID = tt.FENTRYID --ƴ<EFBFBD>ӹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
|
||||
AND t1e_lk.FSTABLENAME = 'T_SAL_ORDERENTRY'
|
||||
FOR XML PATH('')
|
||||
),1,1,''),'') AS '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ'--stuff <EFBFBD><EFBFBD>ת<EFBFBD>к<EFBFBD>ƴ<EFBFBD><EFBFBD>
|
||||
FROM T_AR_RECEIVABLEENTRY tt --Ӧ<EFBFBD>յ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/***********Ӧ<EFBFBD>յ<EFBFBD>end*********************/
|
||||
@@ -71,6 +71,7 @@
|
||||
<Compile Include="TestAutoPushPlugIn.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="SQLServer\SQLQuery4.sql" />
|
||||
<Content Include="SQLServer\无关联应收单.sql" />
|
||||
<Content Include="SQLServer\无关联应收单2-未关联应收数量.sql" />
|
||||
</ItemGroup>
|
||||
|
||||
223
07.珠海英搏尔/Enpower.PRD_MO/SQLserver/P_UpdatePlan2.sql
Normal file
223
07.珠海英搏尔/Enpower.PRD_MO/SQLserver/P_UpdatePlan2.sql
Normal file
@@ -0,0 +1,223 @@
|
||||
USE [AIS20220929093310]
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[P_UpdatePlan2] Script Date: 2024-03-12 11:36:05 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
-- =============================================
|
||||
-- Author: <20><><EFBFBD><EFBFBD><Author,,Name>
|
||||
-- Create date: 2023-05-23<Create Date,,>
|
||||
-- Description: <20><><EFBFBD>¼ƻ<C2BC><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<Description,,>
|
||||
-- =============================================
|
||||
ALTER PROCEDURE [dbo].[P_UpdatePlan2]
|
||||
(
|
||||
@FBILLNO NVARCHAR(1000)
|
||||
)
|
||||
|
||||
AS
|
||||
BEGIN
|
||||
EXEC PROC_UPDATE_PLAN_20240120
|
||||
-- SET NOCOUNT ON added to prevent extra result sets from
|
||||
-- interfering with SELECT statements.
|
||||
-- SET NOCOUNT ON;
|
||||
-- -- EXEC P_UpdatePlan
|
||||
|
||||
|
||||
-- select fname into #temp2 from dbo.fn_hr_StrSplit(@FBILLNO,',')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--select a.FBILLNO AS '<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',A.FSALENOROW,A.F_SOURCE_ORDER_LINE_NUMBER as '<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>',A.F_Source_order_number as '<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
--, A.F_FORECASTNUMBER as '<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', A.F_Linenumber as '<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD>ⵥ<EFBFBD>к<EFBFBD>',
|
||||
--E.FBILLNO AS 'Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',D.FSEQ,D.F_Source_order_number as 'Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',D.F_SOURCE_ORDER_LINE_NUMBER as 'Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>'
|
||||
--INTO #TEMP1
|
||||
--from T_PLN_PLANORDER A
|
||||
--INNER JOIN T_PLN_RESERVELINKENTRY B ON B.FSUPPLYBILLNO = A.FBILLNO
|
||||
--INNER JOIN T_PLN_RESERVELINK C ON C.FID=B.FID
|
||||
--INNER JOIN T_PLN_FORECASTENTRY D ON D.FENTRYID=C.FSRCENTRYID
|
||||
--INNER JOIN T_PLN_FORECAST e on e .fid=d.FID
|
||||
--inner join #temp2 f on f.fname = a.FBILLNO
|
||||
----WHERE A.F_FORECASTNUMBER=''
|
||||
----AND A.FBILLNO = @FBILLNO
|
||||
----where A.FBILLNO = 'MRP00260726'
|
||||
----WHERE A.F_SOURCE_ORDER_LINE_NUMBER = ''
|
||||
|
||||
-- --select * from #TEMP1
|
||||
----
|
||||
|
||||
|
||||
-- SELECT
|
||||
--<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||
--'Ԥ<EFBFBD>ⵥ<EFBFBD>к<EFBFBD>'=ISNULL( stuff((select ','+CONVERT(nvarchar(100), FSEQ) from #TEMP1 where <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=t.<2E>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> =t.Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> for xml path('')),1,1,''),''),
|
||||
--'<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'=ISNULL( stuff((select distinct ','+CONVERT(nvarchar(100), Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) from #TEMP1 where Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD>۶<EFBFBD><DBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>'' and <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=t.<2E>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> =t.Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> for xml path('')),1,1,''),''),
|
||||
--'<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>'=ISNULL( stuff((select distinct ','+CONVERT(nvarchar(100), Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>) from #TEMP1 where Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD>۶<EFBFBD><DBB6><EFBFBD><EFBFBD>к<EFBFBD><>'' and <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=t.<2E>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> =t.Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> for xml path('')),1,1,''),'')
|
||||
--into #temp3
|
||||
-- FROM #TEMP1 t
|
||||
-- GROUP BY <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
-- UPDATE T_PLN_PLANORDER SET F_FORECASTNUMBER=B.Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD>, F_Linenumber=B.Ԥ<>ⵥ<EFBFBD>к<EFBFBD>, F_SOURCE_ORDER_LINE_NUMBER=b.<2E><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD><EFBFBD>к<EFBFBD>, F_SOURCE_ORDER_NUMBER=b.<2E><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
--FROM T_PLN_PLANORDER A
|
||||
--inner join #temp3 B
|
||||
--ON A.FBILLNO=B.<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
--inner join #temp2 f on f.fname = a.FBILLNO
|
||||
|
||||
|
||||
|
||||
--DROP TABLE #TEMP1
|
||||
--DROP TABLE #temp3
|
||||
|
||||
|
||||
--UPDATE A SET A.F_CUSTOMERNAME=D.FCUSTID,A.F_MATERIALCODE=D.FMATERIALID
|
||||
--from T_PLN_PLANORDER A
|
||||
--INNER JOIN T_PLN_RESERVELINKENTRY B ON B.FSUPPLYBILLNO = A.FBILLNO
|
||||
--INNER JOIN T_PLN_RESERVELINK C ON C.FID=B.FID
|
||||
--INNER JOIN T_PLN_FORECASTENTRY D ON D.FENTRYID=C.FSRCENTRYID
|
||||
--INNER JOIN T_PLN_FORECAST e on e .fid=d.FID
|
||||
--inner join #temp2 f on f.fname = a.FBILLNO
|
||||
----where (a.F_CUSTOMERNAME=0 or a.F_MATERIALCODE=0 )
|
||||
----AND A.FBILLNO = @FBILLNO
|
||||
|
||||
--update a set F_CUSTOMERNAME=d.FCUSTID,F_MATERIALCODE=d.FMATERIALID,F_FORECASTNUMBER=c.FBILLNO,F_Linenumber=d.FSEQ,F_SOURCE_ORDER_LINE_NUMBER=d.F_SOURCE_ORDER_LINE_NUMBER,F_Source_order_number=d.F_Source_order_number
|
||||
--FROM T_PLN_PLANORDER A
|
||||
--INNER JOIN T_PLN_PLANORDER_B B ON A.FID=B.FID
|
||||
--INNER JOIN T_PLN_FORECAST C ON C .FBILLNO = B.FSALEORDERNO
|
||||
--INNER JOIN T_PLN_FORECASTENTRY D ON D .FID= C.FID AND D.FSEQ=B.FSALEORDERENTRYSEQ
|
||||
--INNER JOIN #temp2 e ON A.FBILLNO = e.Fname
|
||||
----WHERE A.FBILLNO = 'MRP00640407'
|
||||
|
||||
|
||||
|
||||
----UPDATE A SET A.F_Remark=ISNULL( dbo.GetForecast(A.F_FORECASTNUMBER ,A.F_LINENUMBER),'')
|
||||
----from T_PLN_PLANORDER A
|
||||
----INNER JOIN T_PLN_FORECAST B ON B.FBILLNO=A.F_FORECASTNUMBER
|
||||
----INNER JOIN T_PLN_FORECAST_L C ON C.FID=B.FID
|
||||
----INNER JOIN T_PLN_FORECASTENTRY D on D.FID=B.FID AND D.FSEQ=A.F_Linenumber
|
||||
----where ( a.F_Remark='' )
|
||||
|
||||
|
||||
--UPDATE E SET F_DESCRIPTION=ISNULL(C.FDESCRIPTION ,'' )
|
||||
--from T_PLN_PLANORDER A
|
||||
--INNER JOIN T_PLN_PLANORDER_L E ON E.FID=A.FID
|
||||
--INNER JOIN T_PLN_FORECAST B ON B.FBILLNO=A.F_FORECASTNUMBER
|
||||
--INNER JOIN T_PLN_FORECAST_L C ON C.FID=B.FID
|
||||
--inner join #temp2 f on f.fname = a.FBILLNO
|
||||
----where ( e.F_DESCRIPTION='' )
|
||||
----AND A.FBILLNO = @FBILLNO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--UPDATE T_PLN_PLANORDER SET F_Remark=
|
||||
-- ISNULL( dbo.GetForecast(A.F_FORECASTNUMBER ,A.F_LINENUMBER),'')
|
||||
--from T_PLN_PLANORDER A
|
||||
--inner join #temp2 f on f.fname = a.FBILLNO
|
||||
--where
|
||||
--1=1
|
||||
----and ( a.F_Remark='' )
|
||||
--AND CONVERT(nvarchar(100), a.FCREATEDATE,23) = CONVERT(nvarchar(100), GETDATE(),23)
|
||||
----AND A.FBILLNO = @FBILLNO
|
||||
|
||||
|
||||
--UPDATE T_PLN_PLANORDER SET F_WAUG_LAYER =
|
||||
--CASE WHEN B.<EFBFBD><EFBFBD><EFBFBD><EFBFBD> IS NULL THEN <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ELSE CONCAT(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'-',<EFBFBD><EFBFBD><EFBFBD><EFBFBD>) END
|
||||
-- from T_PLN_PLANORDER A
|
||||
-- inner join
|
||||
--(
|
||||
--select A.FID, dbo.GetBomSeq( B .FBOMID,a.FMATERIALID) as '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', A.FMATERIALID,B.FBOMID,A.f_WAUG_LAYER,A.F_FORECASTNUMBER,A.F_LINENUMBER,
|
||||
--A.F_MATERIALCODE,a.FBILLNO as '1',b.FBILLNO as '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' from T_PLN_PLANORDER A
|
||||
--INNER JOIN T_PLN_PLANORDER B ON A.F_FORECASTNUMBER=B.F_FORECASTNUMBER AND A.F_LINENUMBER=B.F_LINENUMBER AND A.F_MATERIALCODE =B.FMATERIALID
|
||||
--INNER JOIN #temp2 C ON C.Fname=A.FBILLNO
|
||||
----WHERE a.F_WAUG_LAYER = ''
|
||||
|
||||
--) B ON A.FID = B.FID
|
||||
|
||||
--DROP TABLE #temp2
|
||||
|
||||
|
||||
|
||||
|
||||
------select a.FBILLNO AS '<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',A.FSALENOROW,A.F_SOURCE_ORDER_LINE_NUMBER as '<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>',A.F_Source_order_number as '<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
------, A.F_FORECASTNUMBER as '<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>', A.F_Linenumber as '<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD>ⵥ<EFBFBD>к<EFBFBD>',
|
||||
------E.FBILLNO AS 'Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',D.FSEQ,D.F_Source_order_number as 'Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',D.F_SOURCE_ORDER_LINE_NUMBER as 'Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>'
|
||||
------INTO #TEMP1
|
||||
------from T_PLN_PLANORDER A
|
||||
------INNER JOIN T_PLN_RESERVELINKENTRY B ON B.FSUPPLYBILLNO = A.FBILLNO
|
||||
------INNER JOIN T_PLN_RESERVELINK C ON C.FID=B.FID
|
||||
------INNER JOIN T_PLN_FORECASTENTRY D ON D.FENTRYID=C.FSRCENTRYID
|
||||
------INNER JOIN T_PLN_FORECAST e on e .fid=d.FID
|
||||
------WHERE A.F_FORECASTNUMBER=''
|
||||
------AND A.FBILLNO = @FBILLNO
|
||||
--------where A.FBILLNO = 'MRP00260726'
|
||||
--------WHERE A.F_SOURCE_ORDER_LINE_NUMBER = ''
|
||||
|
||||
------ --select * from #TEMP1
|
||||
--------
|
||||
------UPDATE A SET A.F_FORECASTNUMBER=B.Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD>,A.F_Linenumber=B.Ԥ<>ⵥ<EFBFBD>к<EFBFBD>,a.F_SOURCE_ORDER_LINE_NUMBER=b.<2E><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD><EFBFBD>к<EFBFBD>,a.F_SOURCE_ORDER_NUMBER=b.<2E><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
------FROM T_PLN_PLANORDER A
|
||||
------inner join
|
||||
------(
|
||||
------SELECT
|
||||
------<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||
------'Ԥ<EFBFBD>ⵥ<EFBFBD>к<EFBFBD>'=ISNULL( stuff((select ','+CONVERT(nvarchar(100), FSEQ) from #TEMP1 where <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=t.<2E>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> =t.Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> for xml path('')),1,1,''),''),
|
||||
------'<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'=ISNULL( stuff((select distinct ','+CONVERT(nvarchar(100), Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) from #TEMP1 where Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD>۶<EFBFBD><DBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>'' and <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=t.<2E>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> =t.Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> for xml path('')),1,1,''),''),
|
||||
------'<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>'=ISNULL( stuff((select distinct ','+CONVERT(nvarchar(100), Ԥ<EFBFBD>ⵥ<EFBFBD><EFBFBD><EFBFBD>۶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>) from #TEMP1 where Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD>۶<EFBFBD><DBB6><EFBFBD><EFBFBD>к<EFBFBD><>'' and <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=t.<2E>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> =t.Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD> for xml path('')),1,1,''),'')
|
||||
------ FROM #TEMP1 t
|
||||
------ GROUP BY <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,Ԥ<>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD>
|
||||
------) B
|
||||
------ON A.FBILLNO=B.<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
------WHERE A.F_FORECASTNUMBER=''
|
||||
------AND A.FBILLNO = @FBILLNO
|
||||
|
||||
|
||||
|
||||
------DROP TABLE #TEMP1
|
||||
|
||||
|
||||
----UPDATE A SET A.F_CUSTOMERNAME=D.FCUSTID,A.F_MATERIALCODE=D.FMATERIALID
|
||||
----from T_PLN_PLANORDER A
|
||||
----INNER JOIN T_PLN_RESERVELINKENTRY B ON B.FSUPPLYBILLNO = A.FBILLNO
|
||||
----INNER JOIN T_PLN_RESERVELINK C ON C.FID=B.FID
|
||||
----INNER JOIN T_PLN_FORECASTENTRY D ON D.FENTRYID=C.FSRCENTRYID
|
||||
----INNER JOIN T_PLN_FORECAST e on e .fid=d.FID
|
||||
----where (a.F_CUSTOMERNAME=0 or a.F_MATERIALCODE=0 )
|
||||
----AND A.FBILLNO = @FBILLNO
|
||||
|
||||
|
||||
------UPDATE A SET A.F_Remark=ISNULL( dbo.GetForecast(A.F_FORECASTNUMBER ,A.F_LINENUMBER),'')
|
||||
------from T_PLN_PLANORDER A
|
||||
------INNER JOIN T_PLN_FORECAST B ON B.FBILLNO=A.F_FORECASTNUMBER
|
||||
------INNER JOIN T_PLN_FORECAST_L C ON C.FID=B.FID
|
||||
------INNER JOIN T_PLN_FORECASTENTRY D on D.FID=B.FID AND D.FSEQ=A.F_Linenumber
|
||||
------where ( a.F_Remark='' )
|
||||
|
||||
|
||||
----UPDATE E SET F_DESCRIPTION=ISNULL(C.FDESCRIPTION ,'' )
|
||||
----from T_PLN_PLANORDER A
|
||||
----INNER JOIN T_PLN_PLANORDER_L E ON E.FID=A.FID
|
||||
----INNER JOIN T_PLN_FORECAST B ON B.FBILLNO=A.F_FORECASTNUMBER
|
||||
----INNER JOIN T_PLN_FORECAST_L C ON C.FID=B.FID
|
||||
----where ( e.F_DESCRIPTION='' )
|
||||
----AND A.FBILLNO = @FBILLNO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
----UPDATE T_PLN_PLANORDER SET F_Remark=
|
||||
---- ISNULL( dbo.GetForecast(A.F_FORECASTNUMBER ,A.F_LINENUMBER),'')
|
||||
----from T_PLN_PLANORDER A
|
||||
----where
|
||||
----1=1
|
||||
----and ( a.F_Remark='' )
|
||||
----AND CONVERT(nvarchar(100), a.FCREATEDATE,23) = CONVERT(nvarchar(100), GETDATE(),23)
|
||||
----AND A.FBILLNO = @FBILLNO
|
||||
|
||||
|
||||
|
||||
END
|
||||
@@ -21,6 +21,6 @@ def BarItemClick(e):
|
||||
fidList = List[str](set(map(lambda x:x.PrimaryKeyValue ,sellist)))
|
||||
service = STKInventoryService(this.Context)
|
||||
# raise Exception(str(type(fidList)))
|
||||
service.HandleSyncData(fidList, opResult)
|
||||
service.HandleSyncData(fidList, opResult,"")
|
||||
if opResult.OperateResult.Count > 0:
|
||||
this.View.ShowOperateResult(opResult.OperateResult)
|
||||
@@ -22,6 +22,22 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="EastChanger.Python.py" />
|
||||
<Compile Include="STK_Inventory\ListEventPlugInEx.py" />
|
||||
<Compile Include="STK_Miscellaneous\ListEventPlugInEx.py" />
|
||||
<Compile Include="STK_Miscellaneous\OperationEventPlugInEx.py" />
|
||||
<Compile Include="STK_MisDelivery\ListEventPlugInEx.py" />
|
||||
<Compile Include="STK_MisDelivery\OperationEventPlugInEx.py" />
|
||||
<Compile Include="STK_StockCountGain\ListEventPlugInEx.py" />
|
||||
<Compile Include="STK_StockCountGain\OperationEventPlugInEx.py" />
|
||||
<Compile Include="STK_StockCountLoss\ListEventPlugInEx.py" />
|
||||
<Compile Include="STK_StockCountLoss\OperationEventPlugInEx.py" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="STK_StockCountLoss\" />
|
||||
<Folder Include="STK_StockCountGain\" />
|
||||
<Folder Include="STK_MisDelivery\" />
|
||||
<Folder Include="STK_Miscellaneous\" />
|
||||
<Folder Include="STK_Inventory\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
|
||||
<!-- Uncomment the CoreCompile target to enable the Build command in
|
||||
|
||||
30
08.昶东/EastChanger.Python/STK_Inventory/ListEventPlugInEx.py
Normal file
30
08.昶东/EastChanger.Python/STK_Inventory/ListEventPlugInEx.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import clr
|
||||
clr.AddReference("System")
|
||||
clr.AddReference("Kingdee.BOS")
|
||||
clr.AddReference("Kingdee.BOS.Core")
|
||||
clr.AddReference("EastChanger")
|
||||
|
||||
from System import *
|
||||
from System.Collections.Generic import List
|
||||
from System.ComponentModel import *
|
||||
from Kingdee.BOS import*
|
||||
from Kingdee.BOS.Util import*
|
||||
from Kingdee.BOS.Core.DynamicForm import*
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import*
|
||||
from Kingdee.BOS.Core.List.PlugIn import*
|
||||
from EastChanger.STK_Inventory import*
|
||||
|
||||
def BarItemClick(e):
|
||||
if e.BarItemKey.Equals("ImmediateInventory"):
|
||||
opResult = OperationResult()
|
||||
sellist = this.ListView.SelectedRowsInfo
|
||||
if sellist !=None and sellist.Count > 0:
|
||||
this.View.ShowErrMessage("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫͬ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>");
|
||||
return
|
||||
fidList = List[str](set(map(lambda x:x.PrimaryKeyValue ,sellist)))
|
||||
|
||||
service = STKInventoryService(this.Context)
|
||||
# raise Exception(str(type(fidList)))
|
||||
service.HandleSyncData(fidList, opResult,0)
|
||||
if opResult.OperateResult.Count > 0:
|
||||
this.View.ShowOperateResult(opResult.OperateResult)
|
||||
@@ -0,0 +1,6 @@
|
||||
class my_class(object):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class my_class(object):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class my_class(object):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import clr
|
||||
clr.AddReference("System")
|
||||
clr.AddReference("System.Core")
|
||||
clr.AddReference("Kingdee.BOS")
|
||||
clr.AddReference("Kingdee.BOS.Core")
|
||||
clr.AddReference("EastChanger")
|
||||
|
||||
from System import *
|
||||
from System.Linq import *
|
||||
from System.Collections.Generic import List
|
||||
from System.ComponentModel import *
|
||||
from Kingdee.BOS import*
|
||||
from Kingdee.BOS.Util import*
|
||||
from Kingdee.BOS.Core.DynamicForm import*
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import*
|
||||
from Kingdee.BOS.Core.List.PlugIn import*
|
||||
from EastChanger.STK_StockCountLoss import*
|
||||
|
||||
def BarItemClick(e):
|
||||
if e.BarItemKey.Equals("InventoryProfit"):
|
||||
sellist = this.ListView.SelectedRowsInfo
|
||||
if sellist != None and sellist.Any():
|
||||
this.View.ShowErrMessage("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫͬ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>");
|
||||
return
|
||||
opResult = OperationResult()
|
||||
|
||||
fidList = List[str](set(map(lambda x:x.PrimaryKeyValue ,sellist)))
|
||||
|
||||
service = STKStockCountLossService(this.Context)
|
||||
# raise Exception(str(type(fidList)))
|
||||
# service.HandleSyncData(fidList, opResult, 0)
|
||||
# if opResult.OperateResult.Count > 0:
|
||||
# this.View.ShowOperateResult(opResult.OperateResult)
|
||||
@@ -0,0 +1,29 @@
|
||||
import clr
|
||||
clr.AddReference("System")
|
||||
clr.AddReference("System.Core")
|
||||
clr.AddReference("Kingdee.BOS")
|
||||
clr.AddReference("Kingdee.BOS.Core")
|
||||
clr.AddReference("EastChanger")
|
||||
|
||||
from System import *
|
||||
from System.Linq import *
|
||||
from System.Collections.Generic import List
|
||||
from System.ComponentModel import *
|
||||
from Kingdee.BOS import*
|
||||
from Kingdee.BOS.Core.DynamicForm import*
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import*
|
||||
from EastChanger.STK_StockCountLoss import*
|
||||
|
||||
def OnPreparePropertys(e):
|
||||
e.FieldKeys.Add("FSTATUS")
|
||||
|
||||
def OnAddValidators(e):
|
||||
if this.FormOperation.OperationId == 3:
|
||||
base.OnAddValidators(e);
|
||||
validator = CustomsSyncVaildators(5);
|
||||
# <20>Ƿ<EFBFBD><C7B7><EFBFBD>ҪУ<D2AA>飬true<75><65><EFBFBD><EFBFBD>Ҫ
|
||||
validator.AlwaysValidate = true;
|
||||
# У<>鵥<EFBFBD><E9B5A5>ͷ
|
||||
validator.EntityKey = "FBillHead";
|
||||
# <20><><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD>
|
||||
e.Validators.Add(validator);
|
||||
@@ -23,20 +23,22 @@ namespace EastChanger
|
||||
protected readonly string _appKey;
|
||||
protected readonly string _appKeySecret;
|
||||
protected readonly string _moduleCnName;
|
||||
protected readonly string _moduleName;
|
||||
|
||||
public BaseService(Context context, string apiName, string moduleCnName = "海关信息同步")
|
||||
public BaseService(Context context, int apiNoId)
|
||||
{
|
||||
_context = context;
|
||||
var sql = "SELECT * FROM V_CUSTOMS_API_REQUEST_PARAMETE ";
|
||||
var sql = $"SELECT * FROM V_CUSTOMS_API_REQUEST_PARAMETE WHERE Id = {apiNoId}";
|
||||
var data = DBUtils.ExecuteDynamicObject(context, $"/*dialect*/{sql}");
|
||||
var info = data[0];
|
||||
|
||||
_moduleCnName = info["ModuleCnName"].ToString();
|
||||
_moduleName = info["ModuleName"].ToString();
|
||||
_apiVersion = info["apiVersion"].ToString();
|
||||
_apiName = info["apiName"].ToString();
|
||||
_apiUrl = info["appUrl"].ToString();
|
||||
_appKey = info["appKey"].ToString();
|
||||
_appKeySecret = info["appKeySecret"].ToString();
|
||||
_apiName = apiName;
|
||||
_apiVersion = "";
|
||||
_moduleCnName = moduleCnName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -70,7 +72,7 @@ namespace EastChanger
|
||||
/// 根据账册分类后设置申报信息表头
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected Dictionary<string, Dictionary<string, object>> GetDeclInfos()
|
||||
protected virtual Dictionary<string, Dictionary<string, object>> GetDeclInfos()
|
||||
{
|
||||
var newDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@@ -111,7 +113,7 @@ namespace EastChanger
|
||||
{
|
||||
opResult.OperateResult.Add(new OperateResult
|
||||
{
|
||||
Name = "同步编号:" + itemNo,
|
||||
Name = itemNo,
|
||||
Message = msg,
|
||||
SuccessStatus = IsSuccessStatus
|
||||
});
|
||||
|
||||
91
08.昶东/EastChanger/CustomsSyncVaildators.cs
Normal file
91
08.昶东/EastChanger/CustomsSyncVaildators.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using Kingdee.BOS.Core.Validation;
|
||||
using Kingdee.BOS.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Kingdee.BOS;
|
||||
using ExtensionMethods;
|
||||
using EastChanger.STK_Inventory;
|
||||
using EastChanger.STK_StockCountGain;
|
||||
using EastChanger.STK_StockCountLoss;
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
using Kingdee.BOS.Util;
|
||||
|
||||
namespace EastChanger
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义校验器
|
||||
/// </summary>
|
||||
public class CustomsSyncVaildators : AbstractValidator
|
||||
{
|
||||
private readonly int _syncModuleId;
|
||||
private readonly int _action;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="syncModuleId">1.即时库存明细 2.物料入库单 3.成品出库单 4.盘盈单 5.盘亏单</param>
|
||||
/// <param name="action">1.删除</param>
|
||||
public CustomsSyncVaildators(int syncModuleId, int action = 1)
|
||||
{
|
||||
_syncModuleId = syncModuleId;
|
||||
_action = action;
|
||||
}
|
||||
|
||||
public override void Validate(ExtendedDataEntity[] dataEntities, ValidateContext validateContext, Context ctx)
|
||||
{
|
||||
ISynchonService service = null;
|
||||
|
||||
switch (_syncModuleId)
|
||||
{
|
||||
case 1://即时库存明细
|
||||
break;
|
||||
case 2://其他入库单
|
||||
break;
|
||||
case 3://其他出库单
|
||||
break;
|
||||
case 4://盘盈单
|
||||
service = new STKStockCountGainService(ctx);
|
||||
break;
|
||||
case 5://盘亏单
|
||||
service = new STKStockCountLossService(ctx);
|
||||
break;
|
||||
}
|
||||
|
||||
if (service != null)
|
||||
{
|
||||
IOperationResult opResult = new OperationResult();
|
||||
var ids = dataEntities.Select(x => x.DataEntity["Id"].ToString()).ToList();
|
||||
service.HandleSyncData(ids, opResult, this._action);
|
||||
if (opResult.OperateResult.Any())
|
||||
{
|
||||
foreach (var data in dataEntities)
|
||||
{
|
||||
var id = data.DataEntity["Id"].ToString();
|
||||
var syncStatus = data.DataEntity["FSTATUS"].Long2Int();
|
||||
if (syncStatus == 1 || syncStatus == -2)
|
||||
{
|
||||
var res = opResult.OperateResult.FirstOrDefault(x => x.Name.Equals(id) && x.SuccessStatus == false);
|
||||
if (res != null)
|
||||
{
|
||||
validateContext.AddError(
|
||||
data.DataEntity
|
||||
, new ValidationErrorInfo(
|
||||
""
|
||||
, id
|
||||
, data.DataEntityIndex
|
||||
, data.RowIndex
|
||||
, "001"
|
||||
, $"{res.Name} ,{res.Message}"
|
||||
, "同步海关信息" + data.BillNo
|
||||
, ErrorLevel.Error));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -63,6 +63,8 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BaseService.cs" />
|
||||
<Compile Include="CustomsSyncVaildators.cs" />
|
||||
<Compile Include="Entites\BaseRequest.cs" />
|
||||
<Compile Include="ISynchonService.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="sfj4Class.cs" />
|
||||
@@ -70,7 +72,11 @@
|
||||
<Compile Include="STK_Inventory\ListEventPlugInEx.cs" />
|
||||
<Compile Include="STK_Inventory\STKInventoryService.cs" />
|
||||
<Compile Include="STK_Miscellaneous\STKMiscellaneousService.cs" />
|
||||
<Compile Include="STK_StockCountGain\CountGainRequest.cs" />
|
||||
<Compile Include="STK_StockCountGain\OperationEventPlugInEx.cs" />
|
||||
<Compile Include="STK_StockCountGain\STKStockCountGainService.cs" />
|
||||
<Compile Include="STK_StockCountLoss\ListEventPlugInEx.cs" />
|
||||
<Compile Include="STK_StockCountLoss\OperationEventPlugInEx.cs" />
|
||||
<Compile Include="STK_StockCountLoss\STKStockCountLossService.cs" />
|
||||
<Compile Include="Synchron2Customs.cs" />
|
||||
</ItemGroup>
|
||||
@@ -79,6 +85,10 @@
|
||||
<Content Include="SQLServer\1.账册信息视图.sql" />
|
||||
<Content Include="SQLServer\2.1.库存明细同步接口回填.sql" />
|
||||
<Content Include="SQLServer\2.明细信息关联视图.sql" />
|
||||
<Content Include="SQLServer\5.盘盈单_表体.sql" />
|
||||
<Content Include="SQLServer\5.盘盈单_表头.sql" />
|
||||
<Content Include="SQLServer\6.盘亏单_表体.sql" />
|
||||
<Content Include="SQLServer\6.盘亏单_表头.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="STK_MisDelivery\" />
|
||||
|
||||
86
08.昶东/EastChanger/Entites/BaseRequest.cs
Normal file
86
08.昶东/EastChanger/Entites/BaseRequest.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EastChanger.Entites
|
||||
{
|
||||
public class BaseRequest<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 编号
|
||||
/// </summary>
|
||||
public string declaCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经营单位编码
|
||||
/// </summary>
|
||||
public string entCusCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经营单位社会信用代码
|
||||
/// </summary>
|
||||
public string entCreditCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经营单位名称
|
||||
/// </summary>
|
||||
public string entName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申报单位编码
|
||||
/// </summary>
|
||||
public string declaEntCusCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申报单位社会
|
||||
/// </summary>
|
||||
public string declaEntCreditCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申报单位名称
|
||||
/// </summary>
|
||||
public string declaEntName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主管海关
|
||||
/// </summary>
|
||||
public string customsCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账册编号
|
||||
/// </summary>
|
||||
public string bookNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作员
|
||||
/// </summary>
|
||||
public string inputMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申报类型 00:备案/01:变更/99:注销
|
||||
/// </summary>
|
||||
public string declaType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务类型 01-加工类,02-展示门店类,03-物流类,04-保税维修类
|
||||
/// </summary>
|
||||
public string busiType { get; set; } = "03";
|
||||
|
||||
/// <summary>
|
||||
/// 录入时间
|
||||
/// </summary>
|
||||
public string inputDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申报时间
|
||||
/// </summary>
|
||||
public string declaDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表体
|
||||
/// </summary>
|
||||
public T itemList { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,12 @@ namespace EastChanger
|
||||
{
|
||||
string ModuleCnName { get; }
|
||||
|
||||
void HandleSyncData(List<string> idList, IOperationResult opResult);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="idList"></param>
|
||||
/// <param name="opResult"></param>
|
||||
/// <param name="action">1.删除</param>
|
||||
void HandleSyncData(List<string> idList, IOperationResult opResult, int action);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,11 @@ IF EXISTS(SELECT * FROM sysobjects WHERE name = 'V_CUSTOMS_API_REQUEST_PARAMETE'
|
||||
GO
|
||||
CREATE VIEW V_CUSTOMS_API_REQUEST_PARAMETE AS
|
||||
SELECT
|
||||
1 AS 'NO'
|
||||
1 AS 'Id'
|
||||
,'STK_Inventory' AS 'ModuleName'
|
||||
,'<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ' AS 'ModuleCnName'
|
||||
,'supvWarehouse.save' AS 'apiName'
|
||||
,'' AS 'apiVersion'
|
||||
,'http://tsjgqy.zheport.com/api/' AS 'appUrl' --<EFBFBD><EFBFBD>ʽ
|
||||
,'4257290a253c480e8425efabecefc39d' AS 'appKey' --<EFBFBD><EFBFBD>ʽ
|
||||
,'E3002B57-66DE-4D81-A3BE-F088CBF79485' AS 'appKeySecret' --<EFBFBD><EFBFBD>ʽ
|
||||
@@ -13,8 +16,11 @@ SELECT
|
||||
--,'72CD0295-2312-4B08-9A4C-2A338A0EE9BF' AS 'appKeySecret'
|
||||
UNION
|
||||
SELECT
|
||||
2 AS 'NO'
|
||||
2 AS 'Id'
|
||||
,'STK_MISCELLANEOUS' AS 'ModuleName'
|
||||
,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⵥ' AS 'ModuleCnName'
|
||||
,'supvMaterialStorage.save' AS 'apiName'
|
||||
,'' AS 'apiVersion'
|
||||
--,'http://tsjgqy.zheport.com/api/' AS 'appUrl' --<EFBFBD><EFBFBD>ʽ
|
||||
--,'4257290a253c480e8425efabecefc39d' AS 'appKey' --<EFBFBD><EFBFBD>ʽ
|
||||
--,'E3002B57-66DE-4D81-A3BE-F088CBF79485' AS 'appKeySecret' --<EFBFBD><EFBFBD>ʽ
|
||||
@@ -23,8 +29,11 @@ SELECT
|
||||
,'72CD0295-2312-4B08-9A4C-2A338A0EE9BF' AS 'appKeySecret'
|
||||
UNION
|
||||
SELECT
|
||||
3 AS 'NO'
|
||||
3 AS 'Id'
|
||||
,'STK_MisDelivery' AS 'ModuleName'
|
||||
,'<EFBFBD><EFBFBD>Ʒ<EFBFBD><EFBFBD><EFBFBD>ⵥ' AS 'ModuleCnName'
|
||||
,'supvProductDelivery.save' AS 'apiName'
|
||||
,'' AS 'apiVersion'
|
||||
--,'http://tsjgqy.zheport.com/api/' AS 'appUrl' --<EFBFBD><EFBFBD>ʽ
|
||||
--,'4257290a253c480e8425efabecefc39d' AS 'appKey' --<EFBFBD><EFBFBD>ʽ
|
||||
--,'E3002B57-66DE-4D81-A3BE-F088CBF79485' AS 'appKeySecret' --<EFBFBD><EFBFBD>ʽ
|
||||
@@ -33,8 +42,11 @@ SELECT
|
||||
,'72CD0295-2312-4B08-9A4C-2A338A0EE9BF' AS 'appKeySecret'
|
||||
UNION
|
||||
SELECT
|
||||
4 AS 'NO'
|
||||
4 AS 'Id'
|
||||
,'STK_StockCountGain' AS 'ModuleName'
|
||||
,'<EFBFBD><EFBFBD>ӯ<EFBFBD><EFBFBD>' AS 'ModuleCnName'
|
||||
,'supvInventoryProfitLoss.save' AS 'apiName'
|
||||
,'' AS 'apiVersion'
|
||||
--,'http://tsjgqy.zheport.com/api/' AS 'appUrl' --<EFBFBD><EFBFBD>ʽ
|
||||
--,'4257290a253c480e8425efabecefc39d' AS 'appKey' --<EFBFBD><EFBFBD>ʽ
|
||||
--,'E3002B57-66DE-4D81-A3BE-F088CBF79485' AS 'appKeySecret' --<EFBFBD><EFBFBD>ʽ
|
||||
@@ -43,8 +55,11 @@ SELECT
|
||||
,'72CD0295-2312-4B08-9A4C-2A338A0EE9BF' AS 'appKeySecret'
|
||||
UNION
|
||||
SELECT
|
||||
5 AS 'NO'
|
||||
5 AS 'Id'
|
||||
,'STK_StockCountLoss' AS 'ModuleName'
|
||||
,'<EFBFBD>̿<EFBFBD><EFBFBD><EFBFBD>' AS 'ModuleCnName'
|
||||
,'supvInventoryProfitLoss.save' AS 'apiName'
|
||||
,'' AS 'apiVersion'
|
||||
--,'http://tsjgqy.zheport.com/api/' AS 'appUrl' --<EFBFBD><EFBFBD>ʽ
|
||||
--,'4257290a253c480e8425efabecefc39d' AS 'appKey' --<EFBFBD><EFBFBD>ʽ
|
||||
--,'E3002B57-66DE-4D81-A3BE-F088CBF79485' AS 'appKeySecret' --<EFBFBD><EFBFBD>ʽ
|
||||
|
||||
@@ -33,5 +33,6 @@ FROM
|
||||
LEFT JOIN T_BD_STOCK t4 on t4.FSTOCKID = t0.FSTOCKID
|
||||
LEFT JOIN T_BAS_FLEXVALUESDETAIL t6 on t6.FID = t0.FSTOCKLOCID
|
||||
LEFT JOIN T_BAS_FLEXVALUESENTRY t5 ON t5.FENTRYID = t6.FF100001 OR t5.FENTRYID = t6.FF100002
|
||||
WHERE t0.FBASEQTY != 0
|
||||
WHERE 1 = 1
|
||||
AND t0.FBASEQTY != 0
|
||||
--AND t0.FSTATUS != 1
|
||||
43
08.昶东/EastChanger/SQLServer/5.盘盈单_表体.sql
Normal file
43
08.昶东/EastChanger/SQLServer/5.盘盈单_表体.sql
Normal file
@@ -0,0 +1,43 @@
|
||||
IF EXISTS(SELECT * FROM sysobjects WHERE name = 'V_SYNC_STKCOUNTGAINENTRY')--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
DROP VIEW V_SYNC_STKCOUNTGAINENTRY--<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
GO
|
||||
CREATE VIEW V_SYNC_STKCOUNTGAINENTRY AS
|
||||
SELECT
|
||||
t0.FID AS ID
|
||||
,t0.FDOCUMENTSTATUS
|
||||
,t0.FSTATUS AS SyncStatus
|
||||
,t0.FDATE AS inventoryDt
|
||||
,t0e.FSEQ AS itemNo
|
||||
,t1e.FID AS LEDGERID
|
||||
,t1e.FENTRYID AS BookNumId
|
||||
,t1e.FBOOKNUM
|
||||
,t1e.FCUSTOMSCODE
|
||||
,t1es.FLEDGERSTOCKID
|
||||
,t2.FNUMBER AS materialCd
|
||||
,t2_l.FNAME AS materialDesc
|
||||
,'' AS materialType
|
||||
,t2_l.FSPECIFICATION AS specificationsModels
|
||||
,'' AS adjmtrMarkcd
|
||||
,t3.FNUMBER AS calcUnit
|
||||
,'' AS cunit
|
||||
,t0e.FBASECOUNTQTY AS materialWarehouse
|
||||
,t0e.FBASEACCTQTY AS erpWarehouse
|
||||
,t0e.FBASEGAINQTY AS warehouseNumberDifference
|
||||
,'' AS materialWarehouseValue
|
||||
,'' AS erpWarehouseValue
|
||||
,'' AS warehouseValuDifference
|
||||
,'' AS currency
|
||||
,t4.FNUMBER AS warehouseCd
|
||||
,t5.FNUMBER AS warehousePosiCd
|
||||
FROM
|
||||
T_STK_STKCOUNTGAIN t0
|
||||
INNER JOIN T_STK_STKCOUNTGAINENTRY t0e on t0.FID = t0e.FID
|
||||
INNER JOIN T_BD_LEDGERSTOCK t1es on t1es.FLEDGERSTOCKID = t0e.FSTOCKID
|
||||
INNER JOIN T_BD_LEDGERENTRY t1e on t1e.FENTRYID = t1es.FENTRYID
|
||||
LEFT JOIN T_BD_MATERIAL t2 on t2.FMATERIALID = t0e.FMATERIALID
|
||||
LEFT JOIN T_BD_MATERIAL_L t2_l on t2_l.FMATERIALID = t0e.FMATERIALID AND t2_l.FLOCALEID = 2052
|
||||
LEFT JOIN T_BD_UNIT t3 on t3.FUNITID = t0e.FBASEUNITID
|
||||
LEFT JOIN T_BD_STOCK t4 on t4.FSTOCKID = t0e.FSTOCKID
|
||||
LEFT JOIN T_BAS_FLEXVALUESDETAIL t6 on t6.FID = t0e.FSTOCKLOCID
|
||||
LEFT JOIN T_BAS_FLEXVALUESENTRY t5 ON t5.FENTRYID = t6.FF100001 OR t5.FENTRYID = t6.FF100002
|
||||
WHERE 1 = 1
|
||||
25
08.昶东/EastChanger/SQLServer/5.盘盈单_表头.sql
Normal file
25
08.昶东/EastChanger/SQLServer/5.盘盈单_表头.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
IF EXISTS(SELECT * FROM sysobjects WHERE name = 'V_SYNC_STKCOUNTGAIN')--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
DROP VIEW V_SYNC_STKCOUNTGAIN--<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
GO
|
||||
CREATE VIEW V_SYNC_STKCOUNTGAIN AS
|
||||
SELECT
|
||||
DISTINCT
|
||||
t0.FID AS ID
|
||||
,t0.FBILLNO
|
||||
,t0.FDOCUMENTSTATUS
|
||||
,t0.FSTATUS AS SyncStatus
|
||||
,t0.FDATE AS inventoryDt
|
||||
,t0.FCREATEDATE AS inputDate
|
||||
,t1e.FID AS LEDGERID
|
||||
,t1e.FENTRYID AS BookNumId
|
||||
,t1e.FBOOKNUM
|
||||
,t1e.FCUSTOMSCODE
|
||||
,t1es.FLEDGERSTOCKID
|
||||
,t7.FNAME AS 'inputMan'
|
||||
FROM
|
||||
T_STK_STKCOUNTGAIN t0
|
||||
INNER JOIN T_STK_STKCOUNTGAINENTRY t0e on t0.FID = t0e.FID
|
||||
INNER JOIN T_BD_LEDGERSTOCK t1es on t1es.FLEDGERSTOCKID = t0e.FSTOCKID
|
||||
INNER JOIN T_BD_LEDGERENTRY t1e on t1e.FENTRYID = t1es.FENTRYID
|
||||
LEFT JOIN T_SEC_USER t7 on t7.FUSERID = t0.FCREATORID
|
||||
WHERE 1 = 1
|
||||
43
08.昶东/EastChanger/SQLServer/6.盘亏单_表体.sql
Normal file
43
08.昶东/EastChanger/SQLServer/6.盘亏单_表体.sql
Normal file
@@ -0,0 +1,43 @@
|
||||
IF EXISTS(SELECT * FROM sysobjects WHERE name = 'V_SYNC_STKCOUNTLOSSENTRY')--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
DROP VIEW V_SYNC_STKCOUNTLOSSENTRY--<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
GO
|
||||
CREATE VIEW V_SYNC_STKCOUNTLOSSENTRY AS
|
||||
SELECT
|
||||
t0.FID AS ID
|
||||
,t0.FDOCUMENTSTATUS
|
||||
,t0.FSTATUS AS SyncStatus
|
||||
,t0.FDATE AS inventoryDt
|
||||
,t0e.FSEQ AS itemNo
|
||||
,t1e.FID AS LEDGERID
|
||||
,t1e.FENTRYID AS BookNumId
|
||||
,t1e.FBOOKNUM
|
||||
,t1e.FCUSTOMSCODE
|
||||
,t1es.FLEDGERSTOCKID
|
||||
,t2.FNUMBER AS materialCd
|
||||
,t2_l.FNAME AS materialDesc
|
||||
,'' AS materialType
|
||||
,t2_l.FSPECIFICATION AS specificationsModels
|
||||
,'' AS adjmtrMarkcd
|
||||
,t3.FNUMBER AS calcUnit
|
||||
,'' AS cunit
|
||||
,t0e.FBASECOUNTQTY AS materialWarehouse
|
||||
,t0e.FBASEACCTQTY AS erpWarehouse
|
||||
,t0e.FBASELOSSQTY AS warehouseNumberDifference
|
||||
,'' AS materialWarehouseValue
|
||||
,'' AS erpWarehouseValue
|
||||
,'' AS warehouseValuDifference
|
||||
,'' AS currency
|
||||
,t4.FNUMBER AS warehouseCd
|
||||
,t5.FNUMBER AS warehousePosiCd
|
||||
FROM
|
||||
T_STK_STKCOUNTLOSS t0
|
||||
INNER JOIN T_STK_STKCOUNTLOSSENTRY t0e on t0.FID = t0e.FID
|
||||
INNER JOIN T_BD_LEDGERSTOCK t1es on t1es.FLEDGERSTOCKID = t0e.FSTOCKID
|
||||
INNER JOIN T_BD_LEDGERENTRY t1e on t1e.FENTRYID = t1es.FENTRYID
|
||||
LEFT JOIN T_BD_MATERIAL t2 on t2.FMATERIALID = t0e.FMATERIALID
|
||||
LEFT JOIN T_BD_MATERIAL_L t2_l on t2_l.FMATERIALID = t0e.FMATERIALID AND t2_l.FLOCALEID = 2052
|
||||
LEFT JOIN T_BD_UNIT t3 on t3.FUNITID = t0e.FBASEUNITID
|
||||
LEFT JOIN T_BD_STOCK t4 on t4.FSTOCKID = t0e.FSTOCKID
|
||||
LEFT JOIN T_BAS_FLEXVALUESDETAIL t6 on t6.FID = t0e.FSTOCKLOCID
|
||||
LEFT JOIN T_BAS_FLEXVALUESENTRY t5 ON t5.FENTRYID = t6.FF100001 OR t5.FENTRYID = t6.FF100002
|
||||
WHERE 1 = 1
|
||||
25
08.昶东/EastChanger/SQLServer/6.盘亏单_表头.sql
Normal file
25
08.昶东/EastChanger/SQLServer/6.盘亏单_表头.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
IF EXISTS(SELECT * FROM sysobjects WHERE name = 'V_SYNC_STKCOUNTLOSS')--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
DROP VIEW V_SYNC_STKCOUNTLOSS--<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
GO
|
||||
CREATE VIEW V_SYNC_STKCOUNTLOSS AS
|
||||
SELECT
|
||||
DISTINCT
|
||||
t0.FID AS ID
|
||||
,t0.FBILLNO
|
||||
,t0.FDOCUMENTSTATUS
|
||||
,t0.FSTATUS AS SyncStatus
|
||||
,t0.FDATE AS inventoryDt
|
||||
,t0.FCREATEDATE AS inputDate
|
||||
,t1e.FID AS LEDGERID
|
||||
,t1e.FENTRYID AS BookNumId
|
||||
,t1e.FBOOKNUM
|
||||
,t1e.FCUSTOMSCODE
|
||||
,t1es.FLEDGERSTOCKID
|
||||
,t7.FNAME AS 'inputMan'
|
||||
FROM
|
||||
T_STK_STKCOUNTLOSS t0
|
||||
INNER JOIN T_STK_STKCOUNTLOSSENTRY t0e on t0.FID = t0e.FID
|
||||
INNER JOIN T_BD_LEDGERSTOCK t1es on t1es.FLEDGERSTOCKID = t0e.FSTOCKID
|
||||
INNER JOIN T_BD_LEDGERENTRY t1e on t1e.FENTRYID = t1es.FENTRYID
|
||||
LEFT JOIN T_SEC_USER t7 on t7.FUSERID = t0.FCREATORID
|
||||
WHERE 1 = 1
|
||||
@@ -30,8 +30,8 @@ namespace EastChanger.STK_Inventory
|
||||
|
||||
opResult = new OperationResult();
|
||||
var fidList = list.Select(x => x.PrimaryKeyValue).Distinct().ToList();
|
||||
STKInventoryService service = new STKInventoryService(this.Context);
|
||||
service.HandleSyncData(fidList, opResult);
|
||||
ISynchonService service = new STKInventoryService(this.Context);
|
||||
service.HandleSyncData(fidList, opResult, 0);
|
||||
|
||||
if (opResult.OperateResult.Any())
|
||||
this.View.ShowOperateResult(opResult.OperateResult);
|
||||
|
||||
@@ -18,9 +18,8 @@ namespace EastChanger.STK_Inventory
|
||||
/// </summary>
|
||||
public class STKInventoryService : BaseService, ISynchonService
|
||||
{
|
||||
public STKInventoryService(Context context) : base(context, "supvWarehouse.save", "即时库存明细")
|
||||
public STKInventoryService(Context context) : base(context, 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string ModuleCnName => _moduleCnName;
|
||||
@@ -30,7 +29,8 @@ namespace EastChanger.STK_Inventory
|
||||
/// </summary>
|
||||
/// <param name="idList"></param>
|
||||
/// <param name="opResult"></param>
|
||||
public void HandleSyncData(List<string> idList, IOperationResult opResult)
|
||||
/// <param name="action"></param>
|
||||
public void HandleSyncData(List<string> idList, IOperationResult opResult, int action)
|
||||
{
|
||||
var declInfos = GetDeclInfos();
|
||||
var headSql = @"
|
||||
|
||||
@@ -12,13 +12,13 @@ namespace EastChanger.STK_Miscellaneous
|
||||
/// </summary>
|
||||
public class STKMiscellaneousService : BaseService, ISynchonService
|
||||
{
|
||||
public STKMiscellaneousService(Context context) : base(context, "supvMaterialStorage.save", "其他入库单")
|
||||
public STKMiscellaneousService(Context context) : base(context, 2)
|
||||
{
|
||||
}
|
||||
|
||||
public string ModuleCnName => _moduleCnName;
|
||||
|
||||
public void HandleSyncData(List<string> idList, IOperationResult opResult)
|
||||
public void HandleSyncData(List<string> idList, IOperationResult opResult, int action)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
19
08.昶东/EastChanger/STK_StockCountGain/CountGainRequest.cs
Normal file
19
08.昶东/EastChanger/STK_StockCountGain/CountGainRequest.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using EastChanger.Entites;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EastChanger.STK_StockCountGain
|
||||
{
|
||||
public class CountGainRequest : BaseRequest<List<Dictionary<string, object>>>
|
||||
{
|
||||
/// <summary>
|
||||
/// 盘点日期
|
||||
/// </summary>
|
||||
public string inventoryDt { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using ExtensionMethods;
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Core;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.Validation;
|
||||
using Kingdee.BOS.TCP;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EastChanger.STK_StockCountGain
|
||||
{
|
||||
public class OperationEventPlugInEx : AbstractOperationServicePlugIn
|
||||
{
|
||||
public override void OnPreparePropertys(PreparePropertysEventArgs e)
|
||||
{
|
||||
base.OnPreparePropertys(e);
|
||||
e.FieldKeys.Add("FSTATUS");
|
||||
}
|
||||
|
||||
public override void OnAddValidators(AddValidatorsEventArgs e)
|
||||
{
|
||||
base.OnAddValidators(e);
|
||||
if (this.FormOperation.OperationId == 3)
|
||||
{
|
||||
var validator = new CustomsSyncVaildators(4);
|
||||
//是否需要校验,true是需要
|
||||
validator.AlwaysValidate = true;
|
||||
//校验单据头
|
||||
validator.EntityKey = "FBillHead";
|
||||
//加载校验器
|
||||
e.Validators.Add(validator);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,9 @@
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.App.Data;
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
using Kingdee.BOS.Orm;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.Orm.Metadata.DataEntity;
|
||||
using Kingdee.BOS.Util;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
@@ -16,93 +19,110 @@ namespace EastChanger.STK_StockCountGain
|
||||
/// </summary>
|
||||
public class STKStockCountGainService : BaseService, ISynchonService
|
||||
{
|
||||
public STKStockCountGainService(Context context, string apiName = "supvInventoryProfitLoss.save", string moduleCnName = "盘盈单") : base(context, apiName, moduleCnName)
|
||||
/// <summary>
|
||||
/// 同步类型 0.手动同步 1.自动同步
|
||||
/// </summary>
|
||||
private readonly int _syncType;
|
||||
|
||||
public STKStockCountGainService(Context context, int syncType = 0) : base(context, 4)
|
||||
{
|
||||
_syncType = syncType;
|
||||
}
|
||||
|
||||
public string ModuleCnName => this._moduleCnName;
|
||||
|
||||
public void HandleSyncData(List<string> idList, IOperationResult opResult)
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="idList"></param>
|
||||
/// <param name="opResult"></param>
|
||||
/// <param name="action">1.删除</param>
|
||||
public void HandleSyncData(List<string> idList, IOperationResult opResult, int action)
|
||||
{
|
||||
var declInfos = GetDeclInfos();
|
||||
|
||||
var headSql = @"
|
||||
SELECT
|
||||
t0.ID
|
||||
,t0.declaCode
|
||||
,t0.status
|
||||
,t0.materialWarehouse
|
||||
,t0.LEDGERID
|
||||
,t0.FENTRYID
|
||||
,t0.FBOOKNUM
|
||||
,t0.FCUSTOMSCODE
|
||||
,t0.FLEDGERSTOCKID
|
||||
,t0.code
|
||||
,t0.name
|
||||
,t0.specificationsModels
|
||||
,t0.calcUnit
|
||||
,t0.cunit
|
||||
,t0.warehouseCd
|
||||
,t0.warehousePosiCd
|
||||
,t0.itemNo
|
||||
,t0.reduceable
|
||||
,t0.inputMan
|
||||
,t0.declaType
|
||||
FROM
|
||||
V_IMMEDIATE_INVENTORY t0
|
||||
var whereSql = " AND FDOCUMENTSTATUS = 'C' ";
|
||||
if (action == 1)
|
||||
whereSql = " AND (SyncStatus = '1' OR SyncStatus = '-2') ";
|
||||
else
|
||||
whereSql += " AND SyncStatus != '1' ";
|
||||
|
||||
if (idList != null && idList.Any())
|
||||
whereSql += $" AND ID IN ({string.Join(",", idList)}) ";
|
||||
|
||||
var headSql = $@"
|
||||
SELECT * FROM V_SYNC_STKCOUNTGAIN
|
||||
WHERE 1 = 1
|
||||
{0}
|
||||
{whereSql}
|
||||
";
|
||||
var entrySql = $@"
|
||||
SELECT * FROM V_SYNC_STKCOUNTGAINENTRY
|
||||
WHERE 1 = 1
|
||||
{whereSql}
|
||||
";
|
||||
|
||||
var whereSql = "";
|
||||
if (idList != null && idList.Any())
|
||||
whereSql = string.Format(" AND t0.ID IN ({0}) ", string.Join("','", idList));
|
||||
var toSql = string.Format(headSql, whereSql);
|
||||
var headList = DBUtils.ExecuteDynamicObject(_context, $"/*dialect*/{headSql}");
|
||||
var entryList = DBUtils.ExecuteDynamicObject(_context, $"/*dialect*/{entrySql}");
|
||||
|
||||
List<Dictionary<string, object>> itemList = new List<Dictionary<string, object>>();
|
||||
var dbList = DBUtils.ExecuteDynamicObject(_context, $"/*dialect*/{toSql}");
|
||||
if (headList != null && headList.Any())
|
||||
{
|
||||
var groupList = entryList.GroupBy(x => x["ID"].ToString());
|
||||
|
||||
if (dbList != null && dbList.Any())
|
||||
foreach (var head in headList)
|
||||
{
|
||||
var groupList = dbList.GroupBy(x => x["FBOOKNUM"].ToString());
|
||||
int no = 0;
|
||||
foreach (var bookEntity in groupList)
|
||||
{
|
||||
no++;
|
||||
var bookNum = bookEntity.Key;
|
||||
foreach (var entity in bookEntity)
|
||||
var itemList = new List<Dictionary<string, object>>();
|
||||
var id = head["ID"].ToSafeTurnString();
|
||||
var bookNum = head["FBOOKNUM"].ToSafeTurnString();
|
||||
var syncStatus = head["SyncStatus"].Long2Int();
|
||||
|
||||
//申报类型
|
||||
var declaType = "";
|
||||
if (syncStatus == 1 || syncStatus == -2)
|
||||
declaType = "01";
|
||||
else
|
||||
declaType = "00";
|
||||
|
||||
//申报通用表头信息
|
||||
#region 表头信息
|
||||
var main = new Dictionary<string, object>(declInfos[bookNum]);
|
||||
main.Add("declaCode", id);
|
||||
main.Add("inventoryDt", head["inventoryDt"].ToSafeTurnString());
|
||||
main.Add("inputMan", head["inputMan"].ToSafeTurnString());
|
||||
main.Add("declaType", declaType);
|
||||
main.Add("busiType", "03");
|
||||
main.Add("inputDate", head["inputDate"].ToSafeTurnString());
|
||||
main.Add("declaDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
main.Add("itemList", itemList);
|
||||
#endregion
|
||||
|
||||
#region 表体信息
|
||||
var list = groupList.FirstOrDefault(w => w.Key == id);
|
||||
foreach (var entity in list.ToList())
|
||||
{
|
||||
var item = new Dictionary<string, object>();
|
||||
itemList.Add(item);
|
||||
item.Add("itemNo", entity["itemNo"].ToSafeTurnString());
|
||||
item.Add("code", entity["code"].ToSafeTurnString());
|
||||
item.Add("name", entity["name"].ToSafeTurnString());
|
||||
item.Add("materialCd", entity["materialCd"].ToSafeTurnString());
|
||||
item.Add("materialDesc", entity["materialDesc"].ToSafeTurnString());
|
||||
item.Add("materialType", entity["materialType"].ToSafeTurnString());
|
||||
item.Add("specificationsModels", entity["specificationsModels"].ToSafeTurnString());
|
||||
item.Add("adjmtrMarkcd", entity["adjmtrMarkcd"].ToSafeTurnString());
|
||||
item.Add("calcUnit", entity["calcUnit"].ToSafeTurnString());
|
||||
item.Add("cunit", entity["cunit"].ToSafeTurnString());
|
||||
item.Add("reduceable", entity["reduceable"].ToSafeTurnString());
|
||||
item.Add("materialWarehouse", entity["materialWarehouse"].ToSafeTurnString());
|
||||
item.Add("erpWarehouse", entity["erpWarehouse"].ToSafeTurnString());
|
||||
item.Add("warehouseNumberDifference", entity["warehouseNumberDifference"].ToSafeTurnString());
|
||||
item.Add("erpWarehouseValue", entity["erpWarehouseValue"].ToSafeTurnString());
|
||||
item.Add("warehouseValuDifference", entity["warehouseValuDifference"].ToSafeTurnString());
|
||||
item.Add("currency", entity["currency"].ToSafeTurnString());
|
||||
item.Add("warehouseCd", entity["warehouseCd"].ToSafeTurnString());
|
||||
item.Add("warehousePosiCd", entity["warehousePosiCd"].ToSafeTurnString());
|
||||
itemList.Add(item);
|
||||
}
|
||||
var oIdList = bookEntity.ToDictionary(k => k["ID"].ToString(), v => v["itemNo"].Long2Int());
|
||||
|
||||
var main = declInfos[bookNum];
|
||||
|
||||
var newDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
//no 补位序号,防止一秒内多次执行,生成相同的itemNo
|
||||
string itemNo = $"CD{DateTime.Now:yyMMddHHmmss}{no:D2}";
|
||||
main.Add("compileDate", newDate);
|
||||
main.Add("inputMan", _context.UserName);
|
||||
main.Add("declaType", "00");
|
||||
main.Add("busiType", "03");
|
||||
main.Add("inputDate", newDate);
|
||||
main.Add("declaDate", newDate);
|
||||
main.Add("declaCode", itemNo);
|
||||
main.Add("itemList", itemList);
|
||||
#endregion
|
||||
|
||||
var dataJson = JsonUtil.Serialize(main);
|
||||
var result = this.DoSubmit(dataJson);
|
||||
|
||||
if (!result.IsNullOrEmpty())
|
||||
{
|
||||
JToken resData = JsonUtil.DeserializeObject<JToken>(result);
|
||||
@@ -112,36 +132,29 @@ WHERE 1 = 1
|
||||
var data = resData["data"];
|
||||
var rtnFlag = data["rtnFlag"].Long2Int() == 0;
|
||||
var rtnMessage = data["rtnMessage"].ToString();
|
||||
|
||||
JArray rtnItemList = null;
|
||||
if (rtnFlag)
|
||||
rtnItemList = data["rtnObj"]["entity"]["itemList"] as JArray;
|
||||
|
||||
foreach (var kv in oIdList)
|
||||
{
|
||||
var id = kv.Key;
|
||||
var msg = $"明细ID:{id},{rtnMessage}。";
|
||||
if (rtnFlag)
|
||||
{
|
||||
var index = kv.Value - 1;
|
||||
var rtnItem = rtnItemList[index];
|
||||
var rItemNo = rtnItem["itemNo"].ToString();
|
||||
var declaId = rtnItemList["declaId"].ToString();
|
||||
var syncId = rtnItemList["id"].ToString();
|
||||
//UpdateStkInventoryInfo(id, 1, itemNo, declaId, syncId);
|
||||
//InserSyncRecord(id, 1, itemNo, declaId, syncId);
|
||||
}
|
||||
ExecuteOperateResult(opResult, itemNo, msg, rtnFlag);
|
||||
}
|
||||
UpdateStatus(this._context, id, (rtnFlag ? "1" : "-1"));
|
||||
ExecuteOperateResult(opResult, id, rtnMessage, rtnFlag);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExecuteOperateResult(opResult, itemNo, resData["msg"].ToString(), false);
|
||||
UpdateStatus(this._context, id, "-1");
|
||||
ExecuteOperateResult(opResult, id, resData["msg"].ToString(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 同步完成后更新单据同步状态
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="status"></param>
|
||||
public void UpdateStatus(Context context, string id, string status)
|
||||
{
|
||||
var headSql = $@"UPDATE T_STK_STKCOUNTGAIN set FSTATUS='{status}' where FID = " + id;
|
||||
DBUtils.ExecuteDynamicObject(context, $"/*dialect*/{headSql}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
41
08.昶东/EastChanger/STK_StockCountLoss/ListEventPlugInEx.cs
Normal file
41
08.昶东/EastChanger/STK_StockCountLoss/ListEventPlugInEx.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.List.PlugIn;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EastChanger.STK_StockCountLoss
|
||||
{
|
||||
[Description("【列表插件】【1.海关同步】"), HotUpdate]
|
||||
public class ListEventPlugInEx : AbstractListPlugIn
|
||||
{
|
||||
private IOperationResult opResult;
|
||||
|
||||
public override void BarItemClick(BarItemClickEventArgs e)
|
||||
{
|
||||
base.BarItemClick(e);
|
||||
//同步海关信息
|
||||
if (e.BarItemKey.Equals("InventoryProfit"))
|
||||
{
|
||||
var list = this.ListView.SelectedRowsInfo;
|
||||
if (!list.Any())
|
||||
{
|
||||
this.View.ShowErrMessage("请选择需要同步的单据");
|
||||
return;
|
||||
}
|
||||
|
||||
opResult = new OperationResult();
|
||||
var fidList = list.Select(x => x.PrimaryKeyValue).Distinct().ToList();
|
||||
ISynchonService service = new STKStockCountLossService(this.Context);
|
||||
service.HandleSyncData(fidList, opResult, 0);
|
||||
|
||||
if (opResult.OperateResult.Any())
|
||||
this.View.ShowOperateResult(opResult.OperateResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using ExtensionMethods;
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Core;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.Validation;
|
||||
using Kingdee.BOS.TCP;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EastChanger.STK_StockCountLoss
|
||||
{
|
||||
public class OperationEventPlugInEx : AbstractOperationServicePlugIn
|
||||
{
|
||||
public override void OnPreparePropertys(PreparePropertysEventArgs e)
|
||||
{
|
||||
base.OnPreparePropertys(e);
|
||||
e.FieldKeys.Add("FSTATUS");
|
||||
}
|
||||
/// <summary>
|
||||
/// 单据校验
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
public override void OnAddValidators(AddValidatorsEventArgs e)
|
||||
{
|
||||
if (this.FormOperation.OperationId == 3)
|
||||
{
|
||||
base.OnAddValidators(e);
|
||||
var validator = new CustomsSyncVaildators(5);
|
||||
//是否需要校验,true是需要
|
||||
validator.AlwaysValidate = true;
|
||||
//校验单据头
|
||||
validator.EntityKey = "FBillHead";
|
||||
//加载校验器
|
||||
e.Validators.Add(validator);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
using Kingdee.BOS;
|
||||
using ExtensionMethods;
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.App.Data;
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
using Kingdee.BOS.Util;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
@@ -12,15 +17,130 @@ namespace EastChanger.STK_StockCountLoss
|
||||
/// </summary>
|
||||
public class STKStockCountLossService : BaseService, ISynchonService
|
||||
{
|
||||
public STKStockCountLossService(Context context) : base(context, "", "海关信息同步")
|
||||
public STKStockCountLossService(Context context) : base(context, 5)
|
||||
{
|
||||
}
|
||||
|
||||
public string ModuleCnName => throw new NotImplementedException();
|
||||
|
||||
public void HandleSyncData(List<string> idList, IOperationResult opResult)
|
||||
public void HandleSyncData(List<string> idList, IOperationResult opResult, int action)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var declInfos = GetDeclInfos();
|
||||
|
||||
var whereSql = " AND FDOCUMENTSTATUS = 'C' ";
|
||||
if (action == 1)
|
||||
whereSql = " AND (SyncStatus = '1' OR SyncStatus = '-2') ";
|
||||
else
|
||||
whereSql += " AND SyncStatus != '1' ";
|
||||
|
||||
if (idList != null && idList.Any())
|
||||
whereSql += $" AND ID IN ({string.Join(",", idList)}) ";
|
||||
|
||||
var headSql = $@"
|
||||
SELECT * FROM V_SYNC_STKCOUNTLOSS
|
||||
WHERE 1 = 1
|
||||
{whereSql}
|
||||
";
|
||||
var entrySql = $@"
|
||||
SELECT * FROM V_SYNC_STKCOUNTLOSSENTRY
|
||||
WHERE 1 = 1
|
||||
{whereSql}
|
||||
";
|
||||
|
||||
var headList = DBUtils.ExecuteDynamicObject(_context, $"/*dialect*/{headSql}");
|
||||
var entryList = DBUtils.ExecuteDynamicObject(_context, $"/*dialect*/{entrySql}");
|
||||
|
||||
if (headList != null && headList.Any())
|
||||
{
|
||||
var groupList = entryList.GroupBy(x => x["ID"].ToString());
|
||||
|
||||
foreach (var head in headList)
|
||||
{
|
||||
var itemList = new List<Dictionary<string, object>>();
|
||||
var id = head["ID"].ToSafeTurnString();
|
||||
var bookNum = head["FBOOKNUM"].ToSafeTurnString();
|
||||
var syncStatus = head["SyncStatus"].Long2Int();
|
||||
|
||||
//申报类型
|
||||
var declaType = "";
|
||||
if (syncStatus == 1 || syncStatus == -2)
|
||||
declaType = "01";
|
||||
else
|
||||
declaType = "00";
|
||||
|
||||
//申报通用表头信息
|
||||
#region 表头信息
|
||||
var main = new Dictionary<string, object>(declInfos[bookNum]);
|
||||
main.Add("declaCode", id);
|
||||
main.Add("inventoryDt", head["inventoryDt"].ToSafeTurnString());
|
||||
main.Add("inputMan", head["inputMan"].ToSafeTurnString());
|
||||
main.Add("declaType", declaType);
|
||||
main.Add("busiType", "03");
|
||||
main.Add("inputDate", head["inputDate"].ToSafeTurnString());
|
||||
main.Add("declaDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
main.Add("itemList", itemList);
|
||||
#endregion
|
||||
|
||||
#region 表体信息
|
||||
var list = groupList.FirstOrDefault(w => w.Key == id);
|
||||
foreach (var entity in list.ToList())
|
||||
{
|
||||
var item = new Dictionary<string, object>();
|
||||
itemList.Add(item);
|
||||
item.Add("itemNo", entity["itemNo"].ToSafeTurnString());
|
||||
item.Add("materialCd", entity["materialCd"].ToSafeTurnString());
|
||||
item.Add("materialDesc", entity["materialDesc"].ToSafeTurnString());
|
||||
item.Add("materialType", entity["materialType"].ToSafeTurnString());
|
||||
item.Add("specificationsModels", entity["specificationsModels"].ToSafeTurnString());
|
||||
item.Add("adjmtrMarkcd", entity["adjmtrMarkcd"].ToSafeTurnString());
|
||||
item.Add("calcUnit", entity["calcUnit"].ToSafeTurnString());
|
||||
item.Add("cunit", entity["cunit"].ToSafeTurnString());
|
||||
item.Add("materialWarehouse", entity["materialWarehouse"].ToSafeTurnString());
|
||||
item.Add("erpWarehouse", entity["erpWarehouse"].ToSafeTurnString());
|
||||
item.Add("warehouseNumberDifference", entity["warehouseNumberDifference"].ToSafeTurnString());
|
||||
item.Add("erpWarehouseValue", entity["erpWarehouseValue"].ToSafeTurnString());
|
||||
item.Add("warehouseValuDifference", entity["warehouseValuDifference"].ToSafeTurnString());
|
||||
item.Add("currency", entity["currency"].ToSafeTurnString());
|
||||
item.Add("warehouseCd", entity["warehouseCd"].ToSafeTurnString());
|
||||
item.Add("warehousePosiCd", entity["warehousePosiCd"].ToSafeTurnString());
|
||||
}
|
||||
#endregion
|
||||
|
||||
var dataJson = JsonUtil.Serialize(main);
|
||||
var result = this.DoSubmit(dataJson);
|
||||
|
||||
if (!result.IsNullOrEmpty())
|
||||
{
|
||||
JToken resData = JsonUtil.DeserializeObject<JToken>(result);
|
||||
var code = resData["code"].Long2Int();
|
||||
if (code == 0)
|
||||
{
|
||||
var data = resData["data"];
|
||||
var rtnFlag = data["rtnFlag"].Long2Int() == 0;
|
||||
var rtnMessage = data["rtnMessage"].ToString();
|
||||
UpdateStatus(this._context, id, (rtnFlag ? "1" : "-1"));
|
||||
ExecuteOperateResult(opResult, id, rtnMessage, rtnFlag);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateStatus(this._context, id, "-1");
|
||||
ExecuteOperateResult(opResult, id, resData["msg"].ToString(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 同步完成后更新单据同步状态
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="status"></param>
|
||||
public void UpdateStatus(Context context, string id, string status)
|
||||
{
|
||||
var headSql = $@"UPDATE T_STK_STKCOUNTGAIN set FSTATUS='{status}' where FID = " + id;
|
||||
DBUtils.ExecuteDynamicObject(context, $"/*dialect*/{headSql}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using EastChanger.STK_Inventory;
|
||||
using EastChanger.STK_StockCountGain;
|
||||
using EastChanger.STK_StockCountLoss;
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Contracts;
|
||||
using Kingdee.BOS.Core;
|
||||
@@ -33,9 +35,14 @@ namespace EastChanger
|
||||
service = new STKInventoryService(ctx);
|
||||
break;
|
||||
case "STK_MISCELLANEOUS"://其他入库单
|
||||
break;
|
||||
case "STK_MisDelivery"://其他出库单
|
||||
break;
|
||||
case "STK_StockCountGain"://盘盈单
|
||||
service = new STKStockCountGainService(ctx);
|
||||
break;
|
||||
case "STK_StockCountLoss"://盘亏单
|
||||
service = new STKStockCountLossService(ctx);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -43,7 +50,7 @@ namespace EastChanger
|
||||
continue;
|
||||
|
||||
Logger.Info(schedule.Name, $"{service.ModuleCnName}数据同步start...");
|
||||
service.HandleSyncData(null, null);
|
||||
service.HandleSyncData(null, null, 0);
|
||||
Logger.Info(schedule.Name, $"{service.ModuleCnName}数据同步end...");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HW.App.Sal.Report.PlugInEx"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HW.ProductionMaterialsReport", "03.珠海市汇威精密制造有限公司\ProductionMaterialsReport\HW.ProductionMaterialsReport.csproj", "{17EF8474-392A-4595-A4D4-D224F16AF8C4}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestProject2", "00.未分类\UnitTestProject2\UnitTestProject2.csproj", "{3F9DAEFD-D6AF-4FA8-B6B2-485832AB9B26}"
|
||||
EndProject
|
||||
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "HW.PRD_LackAnalyeBill.Python", "03.珠海市汇威精密制造有限公司\HW.PRD_LackAnalyeBill.Python\HW.PRD_LackAnalyeBill.Python.pyproj", "{0BC2F871-B50D-41C3-9267-ABDE125D9B17}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -186,6 +190,12 @@ Global
|
||||
{17EF8474-392A-4595-A4D4-D224F16AF8C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{17EF8474-392A-4595-A4D4-D224F16AF8C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{17EF8474-392A-4595-A4D4-D224F16AF8C4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3F9DAEFD-D6AF-4FA8-B6B2-485832AB9B26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3F9DAEFD-D6AF-4FA8-B6B2-485832AB9B26}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3F9DAEFD-D6AF-4FA8-B6B2-485832AB9B26}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3F9DAEFD-D6AF-4FA8-B6B2-485832AB9B26}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0BC2F871-B50D-41C3-9267-ABDE125D9B17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0BC2F871-B50D-41C3-9267-ABDE125D9B17}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -220,6 +230,8 @@ Global
|
||||
{615361A4-2F0E-4521-A8C5-46BDB8AA6F28} = {42311C80-7B4C-4353-BCA9-4ABD024290C8}
|
||||
{6AA65F8D-BA02-4CA7-85FB-551A1D7C1143} = {42311C80-7B4C-4353-BCA9-4ABD024290C8}
|
||||
{17EF8474-392A-4595-A4D4-D224F16AF8C4} = {42311C80-7B4C-4353-BCA9-4ABD024290C8}
|
||||
{3F9DAEFD-D6AF-4FA8-B6B2-485832AB9B26} = {2217EA0E-E53F-4ECC-A49D-F38BC743F47A}
|
||||
{0BC2F871-B50D-41C3-9267-ABDE125D9B17} = {42311C80-7B4C-4353-BCA9-4ABD024290C8}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {16F7DBDD-F487-41D6-A856-9E9B7B3F61C5}
|
||||
|
||||
Reference in New Issue
Block a user