Browse Source

查询报表导出修改

callm 6 months ago
parent
commit
e166631149
3 changed files with 43 additions and 9 deletions
  1. 12 9
      UAS-MES/FunctionCode/Query/Query_RadiumSN.cs
  2. 25 0
      UAS-MES/UAS-MES.csproj
  3. 6 0
      UAS-MES/packages.config

+ 12 - 9
UAS-MES/FunctionCode/Query/Query_RadiumSN.cs

@@ -73,15 +73,18 @@ namespace UAS_MES.Query
 
         private void Export_Click_1(object sender, EventArgs e)
         {
-            string sql = "select  mssncode SN,cm_barcode 物料条码,cm_firstsn Firstsn, cmsncode,cm_fsoncode 子件编号,ms_salecode 销售订单 ,to_char(cm_indate,'dd/mm/yyyy')  cmindate 生产日期," +
-                "pr_detail 名称,pr_spec 规格  from CRAFTMATERIAL left join (select ms_sncode mssncode,cm_barcode cmbarcode,cm_sncode cmsncode,pr_detail," +
-                "pr_spec from craftmaterial  left join product on pr_code=cm_fsoncode left join makeserial on ms_code=cm_sncode   where " +
-                "pr_detail='[自制]-液晶屏组件') on cmbarcode=cm_sncode  left join makeserial on ms_code=cm_sncode where mssncode in " +
-                "(select v_barcode from mes_package_view  where v_outboxcode BETWEEN '" + box1.Text + "' and '" + box2.Text + "')  union   " +
-                "select ms_sncode,cm_barcode,cm_firstsn,cm_sncode cmsncode,cm_fsoncode,ms_salecode cmmakecode,to_char(cm_indate,'dd/mm/yyyy')   " +
-                "  cmindate,pr_detail,pr_spec from craftmaterial  left join product on pr_code=cm_fsoncode left join makeserial on " +
-                "ms_code=cm_sncode   where ms_sncode in (select v_barcode from mes_package_view where v_outboxcode " +
-                "BETWEEN '" + box1.Text + "' and '" + box2.Text + "')";
+            string sql = "select mssncode SN,pr_detail 产品名称,pr_spec 产品规格,case when cm_fsoncode like '%072002%' then 'LCD-'||" +
+                "cm_barcode when cm_fsoncode like '%070301%' then 'TP-'||cm_barcode when PR_SPEC like '%MID%' and " +
+                "pr_detail='[半成品]-主板' then 'TM-'||cm_barcode when PR_SPEC like '%TC%'  and pr_detail='[半成品]-主板' then " +
+                "'CM-'||cm_barcode else cm_barcode end  物料条码,cm_indate 生产日期,ms_salecode 销售订单 from ( select  " +
+                "mssncode ,cm_barcode ,cm_firstsn Firstsn, cmsncode,cm_fsoncode ,ms_salecode  ,to_char(cm_indate,'dd/mm/yyyy')  " +
+                "cm_indate,pr_detail ,pr_spec   from CRAFTMATERIAL left join (select ms_sncode mssncode,cm_barcode cmbarcode," +
+                "cm_sncode cmsncode,pr_detail,pr_spec from craftmaterial  left join product on pr_code=cm_fsoncode left join " +
+                "makeserial on ms_code=cm_sncode   where pr_detail='[自制]-液晶屏组件') on cmbarcode=cm_sncode  left join " +
+                "makeserial on ms_code=cm_sncode where cm_status=0 and mssncode in (select v_barcode from mes_package_view  where v_outboxcode " +
+                "BETWEEN '"+box1.Text + "' and '"+box2.Text + "')  union select ms_sncode,cm_barcode,cm_firstsn,cm_sncode cmsncode,cm_fsoncode,ms_salecode cmmakecode,to_char(cm_indate,'dd/mm/yyyy')  " +
+                " cmindate,pr_detail,pr_spec from craftmaterial  left join product on pr_code=cm_fsoncode left join makeserial on ms_code=cm_sncode  " +
+                " where cm_status=0 and ms_sncode in (select v_barcode from mes_package_view where v_outboxcode BETWEEN '"+box1.Text + "' and '"+box2.Text + "'))";
             DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
             ExcelHandler ex = new ExcelHandler();
             ExportFileDialog.ShowDialog();

+ 25 - 0
UAS-MES/UAS-MES.csproj

@@ -142,6 +142,15 @@
       <EmbedInteropTypes>True</EmbedInteropTypes>
       <HintPath>Tool\Microsoft.Office.Interop.Excel.dll</HintPath>
     </Reference>
+    <Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
+    </Reference>
     <Reference Include="NPOI">
       <HintPath>Tool\NPOI.dll</HintPath>
     </Reference>
@@ -154,6 +163,16 @@
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
     <Reference Include="System.Data.OracleClient" />
+    <Reference Include="System.IO, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.IO.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Net" />
+    <Reference Include="System.Runtime, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Runtime.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Threading.Tasks, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Threading.Tasks.dll</HintPath>
+    </Reference>
     <Reference Include="System.Web.Extensions" />
     <Reference Include="System.Windows.Forms.DataVisualization" />
     <Reference Include="System.Xml.Linq" />
@@ -1554,6 +1573,7 @@
       <DependentUpon>SystemSetting_ScaleTest.cs</DependentUpon>
     </EmbeddedResource>
     <None Include="Cert\深圳市优软科技有限公司.pfx" />
+    <None Include="packages.config" />
     <None Include="Properties\app.manifest" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
@@ -2147,6 +2167,11 @@
     <Folder Include="Properties\DataSources\" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
+  <Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
+    <Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
+    <Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
+  </Target>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

+ 6 - 0
UAS-MES/packages.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Microsoft.Bcl" version="1.1.8" targetFramework="net40" />
+  <package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net40" />
+  <package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" />
+</packages>