Exemplo n.º 1
0
        public void generateExcelToCheck(List <MBBgaMaterialStruct> StockCheckList, List <bgaReport> bgas, string startTime, string endTime)
        {
            List <allContent> allcontentList = new List <allContent>();

            allContent firstsheet = new allContent();

            firstsheet.sheetName   = "MBBga材料一览表";
            firstsheet.titleList   = new List <string>();
            firstsheet.contentList = new List <object>();

            firstsheet.titleList.Add("厂商");
            firstsheet.titleList.Add("客户别");
            firstsheet.titleList.Add("MB简称");
            firstsheet.titleList.Add("MPN");
            firstsheet.titleList.Add("MB描述");;
            firstsheet.titleList.Add("厂商PCH_MPN");
            firstsheet.titleList.Add("PCH简述");
            firstsheet.titleList.Add("PCH描述");
            firstsheet.titleList.Add("厂商VGA_MPN");
            firstsheet.titleList.Add("VGA简述");
            firstsheet.titleList.Add("VGA描述");
            firstsheet.titleList.Add("厂商CPU_MPN");
            firstsheet.titleList.Add("CPU简述");
            firstsheet.titleList.Add("CPU描述");
            firstsheet.titleList.Add("DPK类型");
            firstsheet.titleList.Add("保修期");
            firstsheet.titleList.Add("客户机型");

            firstsheet.titleList.Add("整机出货量");
            firstsheet.titleList.Add("客户退修量");

            firstsheet.titleList.Add("MB购买数量");
            firstsheet.titleList.Add("MB报废数量");
            firstsheet.titleList.Add("MB报废率");

            firstsheet.titleList.Add("材料类别");

            foreach (MBBgaMaterialStruct stockcheck in StockCheckList)
            {
                ExportExcelContent ctest1 = new ExportExcelContent();
                List <string>      ct1    = new List <string>();
                ct1.Add(stockcheck.vendor);
                ct1.Add(stockcheck.product);

                ct1.Add(stockcheck.mb_brief);
                ct1.Add(stockcheck.mpn);
                ct1.Add(stockcheck.mb_descripe);
                ct1.Add(stockcheck.vendor_pch_mpn);
                ct1.Add(stockcheck.pcb_brief_describe);
                ct1.Add(stockcheck.pcb_describe);
                ct1.Add(stockcheck.vendor_vga_mpn);
                ct1.Add(stockcheck.vga_brief_describe);
                ct1.Add(stockcheck.vga_describe);
                ct1.Add(stockcheck.vendor_cpu_mpn);
                ct1.Add(stockcheck.cpu_brief);
                ct1.Add(stockcheck.cpu_describe);
                ct1.Add(stockcheck.dpk_type);
                ct1.Add(stockcheck.warranty_period);
                ct1.Add(stockcheck.custom_machine_type);
                ct1.Add(stockcheck.whole_out_num);
                ct1.Add(stockcheck.repaire_num);

                ct1.Add(stockcheck.mb_buy_in_num);
                ct1.Add(stockcheck.mb_fault_num);
                ct1.Add(stockcheck.mb_fault_rate);

                ct1.Add(stockcheck.eol);

                ctest1.contentArray = ct1;
                firstsheet.contentList.Add(ctest1);
            }
            allcontentList.Add(firstsheet);

            allContent secondsheet = new allContent();

            secondsheet.sheetName   = "BGAMB一览表";
            secondsheet.titleList   = new List <string>();
            secondsheet.contentList = new List <object>();

            secondsheet.titleList.Add("BGA_厂商MPN");
            secondsheet.titleList.Add("BGA简述");
            secondsheet.titleList.Add("BGA描述");
            secondsheet.titleList.Add("BGA类别");

            secondsheet.titleList.Add("厂商");
            secondsheet.titleList.Add("客户别");
            secondsheet.titleList.Add("MB简称");
            secondsheet.titleList.Add("mpn");
            secondsheet.titleList.Add("对应整机出货量");
            secondsheet.titleList.Add("客户退修量");
            secondsheet.titleList.Add("近1个月MB退修量");
            secondsheet.titleList.Add("近2个月MB退修量");
            secondsheet.titleList.Add("BGA更换数量");
            secondsheet.titleList.Add("BGA不良率");
            secondsheet.titleList.Add("材料类别");


            foreach (bgaReport stockcheck in bgas)
            {
                ExportExcelContent ctest1 = new ExportExcelContent();
                List <string>      ct1    = new List <string>();
                ct1.Add(stockcheck.bgapn);
                ct1.Add(stockcheck.bga_brief);
                ct1.Add(stockcheck.bga_desc);
                ct1.Add(stockcheck.bga_type);
                ct1.Add(stockcheck.vendor);
                ct1.Add(stockcheck.product);
                ct1.Add(stockcheck.mb_brief);
                ct1.Add(stockcheck.mpn);
                ct1.Add(stockcheck.whole_out_num);
                ct1.Add(stockcheck.repaire_num);
                ct1.Add(stockcheck.repair_num_1_month);
                ct1.Add(stockcheck.repair_num_2_month);
                ct1.Add(stockcheck.bga_change_number);
                ct1.Add(stockcheck.bga_rate);
                ct1.Add(stockcheck.material_type);

                ctest1.contentArray = ct1;
                secondsheet.contentList.Add(ctest1);
            }

            allcontentList.Add(secondsheet);

            Utils.createMulitSheetsUsingNPOI("MBBga材料一览表" + startTime.Replace('/', '-') + "-" + endTime.Replace('/', '-') + ".xls", allcontentList);
        }
Exemplo n.º 2
0
        public void generateExcelToCheck(
            debitnotsSheet3 debitnots,
            List <allSumStruct> allSumStructListAIO,
            List <allSumStruct> allSumStructListNB,
            List <fruListSheet4> fruList,
            List <nb_aio_mblistSheet5_6> repairRecordListAIO,
            List <nb_aio_mblistSheet5_6> repairRecordListNB,
            string startTime, string endTime)
        {
            List <allContent> allcontentList = new List <allContent>();

            //汇总AIO
            allContent sumContentAio = new allContent();

            sumContentAio.sheetName   = startTime + "到" + endTime + "汇总AIO";
            sumContentAio.titleList   = new List <string>();
            sumContentAio.contentList = new List <object>();
            sumContentAio.titleList.Add("Model");
            sumContentAio.titleList.Add("数量");
            if (allSumStructListAIO.Count == 0)
            {
                ExportExcelContent ctest1 = new ExportExcelContent();
                List <string>      ct1    = new List <string>();
                ctest1.contentArray = ct1;
                ct1.Add("");
                ct1.Add("");
                sumContentAio.contentList.Add(ctest1);
            }
            else
            {
                foreach (allSumStruct temp in allSumStructListAIO)
                {
                    ExportExcelContent ctest1 = new ExportExcelContent();
                    List <string>      ct1    = new List <string>();
                    ctest1.contentArray = ct1;
                    ct1.Add(temp.mb_brief);
                    ct1.Add(temp.returnNum + "");
                    sumContentAio.contentList.Add(ctest1);
                }
            }

            allcontentList.Add(sumContentAio);

            //汇总NB
            allContent sumContentNB = new allContent();

            sumContentNB.sheetName   = startTime + "到" + endTime + "汇总NB";
            sumContentNB.titleList   = new List <string>();
            sumContentNB.contentList = new List <object>();
            sumContentNB.titleList.Add("Model");
            sumContentNB.titleList.Add("数量");
            if (allSumStructListNB.Count == 0)
            {
                ExportExcelContent ctest1 = new ExportExcelContent();
                List <string>      ct1    = new List <string>();
                ctest1.contentArray = ct1;
                ct1.Add("");
                ct1.Add("");
                sumContentNB.contentList.Add(ctest1);
            }
            else
            {
                foreach (allSumStruct temp in allSumStructListNB)
                {
                    ExportExcelContent ctest1 = new ExportExcelContent();
                    List <string>      ct1    = new List <string>();
                    ctest1.contentArray = ct1;
                    ct1.Add(temp.mb_brief);
                    ct1.Add(temp.returnNum + "");
                    sumContentNB.contentList.Add(ctest1);
                }
            }

            allcontentList.Add(sumContentNB);

            //FRU记录
            allContent fruContent = new allContent();

            fruContent.sheetName   = startTime + "到" + endTime + "FRU记录";
            fruContent.titleList   = new List <string>();
            fruContent.contentList = new List <object>();
            fruContent.titleList.Add("收料日期");
            fruContent.titleList.Add("rma号码");
            fruContent.titleList.Add("联想料号");
            fruContent.titleList.Add("机型");
            fruContent.titleList.Add("名称");
            fruContent.titleList.Add("配件序号");
            fruContent.titleList.Add("周期");
            fruContent.titleList.Add("保内外");
            fruContent.titleList.Add("料号71");
            fruContent.titleList.Add("原材料号");
            fruContent.titleList.Add("客户故障");
            // fruContent.titleList.Add("是否收费");
            fruContent.titleList.Add("charge ");
            if (fruList.Count == 0)
            {
                ExportExcelContent ctest1 = new ExportExcelContent();
                List <string>      ct1    = new List <string>();
                ctest1.contentArray = ct1;
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                //ct1.Add("");
                ct1.Add("");
                fruContent.contentList.Add(ctest1);
            }
            else
            {
                foreach (fruListSheet4 temp in fruList)
                {
                    ExportExcelContent ctest1 = new ExportExcelContent();
                    List <string>      ct1    = new List <string>();
                    ctest1.contentArray = ct1;

                    ct1.Add(Utils.modifyDataFormat(temp.receive_date));
                    ct1.Add(temp.orderno);

                    ct1.Add(temp.customermaterialno);
                    ct1.Add(temp.machine_type);
                    ct1.Add(temp.name);
                    ct1.Add(temp.peijian_no);
                    ct1.Add(Utils.modifyDataFormat(temp.make_date));
                    ct1.Add(temp.gurantee);
                    ct1.Add(temp.vendor_material_no);
                    ct1.Add(temp.mpn1);
                    ct1.Add(temp.custom_fault);
                    //ct1.Add(temp.eol);
                    ct1.Add(temp.charge);

                    fruContent.contentList.Add(ctest1);
                }
            }

            allcontentList.Add(fruContent);

            //维修记录AIO
            allContent repairRecordContentAIO = new allContent();

            repairRecordContentAIO.sheetName   = startTime + "到" + endTime + "维修记录AIO";
            repairRecordContentAIO.titleList   = new List <string>();
            repairRecordContentAIO.contentList = new List <object>();

            repairRecordContentAIO.titleList.Add("订单编号");
            repairRecordContentAIO.titleList.Add("来源");
            repairRecordContentAIO.titleList.Add("跟踪条码");
            repairRecordContentAIO.titleList.Add("收货日期");
            repairRecordContentAIO.titleList.Add("MB简称");
            repairRecordContentAIO.titleList.Add("MB描述");
            repairRecordContentAIO.titleList.Add("MPN");
            repairRecordContentAIO.titleList.Add("厂商序号");
            repairRecordContentAIO.titleList.Add("MB生产日期");
            repairRecordContentAIO.titleList.Add("客户故障");
            for (int i = 1; i <= 3; i++)
            {
                repairRecordContentAIO.titleList.Add("现象" + i);
            }
            for (int i = 1; i <= 1; i++)
            {
                repairRecordContentAIO.titleList.Add("mbfa" + i);
            }
            repairRecordContentAIO.titleList.Add("短路电压");
            repairRecordContentAIO.titleList.Add("北桥");
            repairRecordContentAIO.titleList.Add("南北桥料号");
            repairRecordContentAIO.titleList.Add("南桥");
            repairRecordContentAIO.titleList.Add("vga芯片料号");
            repairRecordContentAIO.titleList.Add("显存");
            repairRecordContentAIO.titleList.Add("CPU料号");
            repairRecordContentAIO.titleList.Add("CPU底座");

            for (int i = 1; i <= 3; i++)
            {
                repairRecordContentAIO.titleList.Add("其他" + i + "位置");
                //repairRecordContentAIO.titleList.Add("其他" + i + "位置料号");
            }

            repairRecordContentAIO.titleList.Add("断线氧化内短位置");

            repairRecordContentAIO.titleList.Add("维修人");
            repairRecordContentAIO.titleList.Add("测试人");
            repairRecordContentAIO.titleList.Add("修复日期 ");
            repairRecordContentAIO.titleList.Add("工程变更 ");
            repairRecordContentAIO.titleList.Add("charge");

            if (repairRecordListAIO.Count == 0)
            {
                ExportExcelContent ctest1 = new ExportExcelContent();
                List <string>      ct1    = new List <string>();

                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");

                for (int i = 0; i < 3; i++)
                {
                    ct1.Add("");
                }

                for (int i = 0; i < 1; i++)
                {
                    ct1.Add("");
                }
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");

                for (int i = 0; i < 3; i++)
                {
                    ct1.Add("");
                }

                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");

                ctest1.contentArray = ct1;
                repairRecordContentAIO.contentList.Add(ctest1);
            }
            else
            {
                foreach (nb_aio_mblistSheet5_6 repaircheck in repairRecordListAIO)
                {
                    ExportExcelContent ctest1 = new ExportExcelContent();
                    List <string>      ct1    = new List <string>();
                    ct1.Add(repaircheck.order_no);
                    ct1.Add(repaircheck.source);
                    ct1.Add(repaircheck.track_serial_no);
                    ct1.Add(Utils.modifyDataFormat(repaircheck.receivedate));
                    ct1.Add(repaircheck.mb_brief);

                    ct1.Add(repaircheck.mb_describe);
                    ct1.Add(repaircheck.mpn);
                    ct1.Add(repaircheck.vendor_serail_no);
                    ct1.Add(Utils.modifyDataFormat(repaircheck.mb_make_date));
                    ct1.Add(repaircheck.custom_fault);

                    for (int i = 0; i < 3; i++)
                    {
                        if (i < repaircheck.fault_describeList.Count)
                        {
                            ct1.Add(repaircheck.fault_describeList[i]);
                        }
                        else
                        {
                            ct1.Add("");
                        }
                    }
                    for (int i = 0; i < 1; i++)
                    {
                        if (i < repaircheck.mbfaList.Count)
                        {
                            ct1.Add(repaircheck.mbfaList[i]);
                        }
                        else
                        {
                            ct1.Add("");
                        }
                    }
                    ct1.Add(repaircheck.shortcut);
                    ct1.Add("");
                    ct1.Add(repaircheck.pch);
                    ct1.Add("");
                    ct1.Add(repaircheck.vga);
                    ct1.Add("");
                    ct1.Add(repaircheck.cpu);
                    ct1.Add("");
                    for (int i = 0; i < 3; i++)
                    {
                        if (i < repaircheck.smtRecords.Count)
                        {
                            ct1.Add(repaircheck.smtRecords[i].smtplace);
                            // ct1.Add(repaircheck.smtRecords[i].smtMpn);
                        }
                        else
                        {
                            ct1.Add("");
                            // ct1.Add("");
                        }
                    }
                    ct1.Add("");

                    ct1.Add(repaircheck.repairer);
                    ct1.Add(repaircheck.tester);
                    ct1.Add(Utils.modifyDataFormat(repaircheck.repair_date));
                    ct1.Add("");
                    ct1.Add(repaircheck.charge);

                    ctest1.contentArray = ct1;
                    repairRecordContentAIO.contentList.Add(ctest1);
                }
            }

            allcontentList.Add(repairRecordContentAIO);

            //维修记录NB
            allContent repairRecordContentNB = new allContent();

            repairRecordContentNB.sheetName   = startTime + "到" + endTime + "维修记录NB";
            repairRecordContentNB.titleList   = new List <string>();
            repairRecordContentNB.contentList = new List <object>();

            repairRecordContentNB.titleList.Add("订单编号");
            repairRecordContentNB.titleList.Add("来源");
            repairRecordContentNB.titleList.Add("跟踪条码");
            repairRecordContentNB.titleList.Add("收货日期");
            repairRecordContentNB.titleList.Add("MB简称");
            repairRecordContentNB.titleList.Add("MB描述");
            repairRecordContentNB.titleList.Add("MPN");
            repairRecordContentNB.titleList.Add("厂商序号");
            repairRecordContentNB.titleList.Add("MB生产日期");
            repairRecordContentNB.titleList.Add("客户故障");
            for (int i = 1; i <= 3; i++)
            {
                repairRecordContentNB.titleList.Add("现象" + i);
            }
            for (int i = 1; i <= 1; i++)
            {
                repairRecordContentNB.titleList.Add("mbfa" + i);
            }
            repairRecordContentNB.titleList.Add("短路电压");
            repairRecordContentNB.titleList.Add("北桥");
            repairRecordContentNB.titleList.Add("南北桥料号");
            repairRecordContentNB.titleList.Add("南桥");
            repairRecordContentNB.titleList.Add("vga芯片料号");
            repairRecordContentNB.titleList.Add("显存");
            repairRecordContentNB.titleList.Add("CPU料号");
            repairRecordContentNB.titleList.Add("CPU底座");

            for (int i = 1; i <= 3; i++)
            {
                repairRecordContentNB.titleList.Add("其他" + i + "位置");
                //repairRecordContentNB.titleList.Add("其他" + i + "位置料号");
            }

            repairRecordContentNB.titleList.Add("断线氧化内短位置");

            repairRecordContentNB.titleList.Add("维修人");
            repairRecordContentNB.titleList.Add("测试人");
            repairRecordContentNB.titleList.Add("修复日期 ");
            repairRecordContentNB.titleList.Add("工程变更 ");
            repairRecordContentNB.titleList.Add("charge");

            if (repairRecordListNB.Count == 0)
            {
                ExportExcelContent ctest1 = new ExportExcelContent();
                List <string>      ct1    = new List <string>();

                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");

                for (int i = 0; i < 3; i++)
                {
                    ct1.Add("");
                }

                for (int i = 0; i < 1; i++)
                {
                    ct1.Add("");
                }

                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");

                for (int i = 0; i < 3; i++)
                {
                    ct1.Add("");
                }

                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");
                ct1.Add("");

                ctest1.contentArray = ct1;
                repairRecordContentNB.contentList.Add(ctest1);
            }
            else
            {
                foreach (nb_aio_mblistSheet5_6 repaircheck in repairRecordListNB)
                {
                    ExportExcelContent ctest1 = new ExportExcelContent();
                    List <string>      ct1    = new List <string>();

                    ct1.Add(repaircheck.order_no);
                    ct1.Add(repaircheck.source);
                    ct1.Add(repaircheck.track_serial_no);
                    ct1.Add(Utils.modifyDataFormat(repaircheck.receivedate));
                    ct1.Add(repaircheck.mb_brief);

                    ct1.Add(repaircheck.mb_describe);
                    ct1.Add(repaircheck.mpn);
                    ct1.Add(repaircheck.vendor_serail_no);
                    ct1.Add(Utils.modifyDataFormat(repaircheck.mb_make_date));
                    ct1.Add(repaircheck.custom_fault);

                    for (int i = 0; i < 3; i++)
                    {
                        if (i < repaircheck.fault_describeList.Count)
                        {
                            ct1.Add(repaircheck.fault_describeList[i]);
                        }
                        else
                        {
                            ct1.Add("");
                        }
                    }
                    for (int i = 0; i < 1; i++)
                    {
                        if (i < repaircheck.mbfaList.Count)
                        {
                            ct1.Add(repaircheck.mbfaList[i]);
                        }
                        else
                        {
                            ct1.Add("");
                        }
                    }
                    ct1.Add(repaircheck.shortcut);
                    ct1.Add("");
                    ct1.Add(repaircheck.pch);
                    ct1.Add("");
                    ct1.Add(repaircheck.vga);
                    ct1.Add("");
                    ct1.Add(repaircheck.cpu);
                    ct1.Add("");
                    for (int i = 0; i < 3; i++)
                    {
                        if (i < repaircheck.smtRecords.Count)
                        {
                            ct1.Add(repaircheck.smtRecords[i].smtplace);
                            // ct1.Add(repaircheck.smtRecords[i].smtMpn);
                        }
                        else
                        {
                            ct1.Add("");
                            // ct1.Add("");
                        }
                    }
                    ct1.Add("");

                    ct1.Add(repaircheck.repairer);
                    ct1.Add(repaircheck.tester);
                    ct1.Add(Utils.modifyDataFormat(repaircheck.repair_date));
                    ct1.Add("");
                    ct1.Add(repaircheck.charge);


                    ctest1.contentArray = ct1;
                    repairRecordContentNB.contentList.Add(ctest1);
                }
            }

            allcontentList.Add(repairRecordContentNB);

            exportxmlbutton.Enabled = true;
            Utils.createExcelListUsingNPOI("D:\\" + startTime.Replace('/', '-') + "-" + endTime.Replace('/', '-') + "新维修数据.xls", debitnots, allcontentList);
        }
Exemplo n.º 3
0
        public void generateExcelToCheck(List <BgaUsedStruct> StockCheckList, string startTime, string endTime, List <bagUsedSumStruct> bagWaitSumList)
        {
            List <allContent> allcontentList = new List <allContent>();

            allContent firstsheet = new allContent();

            firstsheet.sheetName   = "BGA待料信息" + startTime.Replace('/', '-') + "-" + endTime.Replace('/', '-');
            firstsheet.titleList   = new List <string>();
            firstsheet.contentList = new List <object>();

            firstsheet.titleList.Add("跟踪条码");
            firstsheet.titleList.Add("客户料号");
            firstsheet.titleList.Add("厂商");
            firstsheet.titleList.Add("客户别");
            firstsheet.titleList.Add("来源");
            firstsheet.titleList.Add("订单编号");
            firstsheet.titleList.Add("收货日期");
            firstsheet.titleList.Add("MB描述");
            firstsheet.titleList.Add("MB简称");
            firstsheet.titleList.Add("客户序号");
            firstsheet.titleList.Add("厂商序号");
            firstsheet.titleList.Add("MPN");
            firstsheet.titleList.Add("MB生产日期");
            firstsheet.titleList.Add("客户故障");
            firstsheet.titleList.Add("ECO");
            firstsheet.titleList.Add("bga类型");
            firstsheet.titleList.Add("BGAPN");
            firstsheet.titleList.Add("BGA描述");
            firstsheet.titleList.Add("BGA简述");
            firstsheet.titleList.Add("老sn");
            firstsheet.titleList.Add("新sn");

            firstsheet.titleList.Add("更换原因");
            firstsheet.titleList.Add("短路电压");
            firstsheet.titleList.Add("维修人");
            firstsheet.titleList.Add("更换人");
            firstsheet.titleList.Add("更换日期");
            firstsheet.titleList.Add("CPU采购类别");
            firstsheet.titleList.Add("CPU是否更换");

            foreach (BgaUsedStruct stockcheck in StockCheckList)
            {
                ExportExcelContent ctest1 = new ExportExcelContent();
                List <string>      ct1    = new List <string>();
                ct1.Add(stockcheck.track_serial_no);
                ct1.Add(stockcheck.customMaterialNo);
                ct1.Add(stockcheck.vendor);
                ct1.Add(stockcheck.product);
                ct1.Add(stockcheck.source);
                ct1.Add(stockcheck.orderno);
                ct1.Add(Utils.modifyDataFormat(stockcheck.receivedate));
                ct1.Add(stockcheck.mb_describe);
                ct1.Add(stockcheck.mb_brief);
                ct1.Add(stockcheck.custom_serial_no);
                ct1.Add(stockcheck.vendor_serail_no);
                ct1.Add(stockcheck.mpn);
                ct1.Add(Utils.modifyDataFormat(stockcheck.mb_make_date));
                ct1.Add(stockcheck.customFault);
                ct1.Add(stockcheck.ECO);
                ct1.Add(stockcheck.bgatype);
                ct1.Add(stockcheck.BGAPN);
                ct1.Add(stockcheck.BGA_describe);

                ct1.Add(stockcheck.bga_brief);
                ct1.Add(stockcheck.oldSn);
                ct1.Add(stockcheck.newSn);

                ct1.Add(stockcheck.change_reason);
                ct1.Add(stockcheck.shortcut);
                ct1.Add(stockcheck.repairer);
                ct1.Add(stockcheck.bga_repairer);
                ct1.Add(Utils.modifyDataFormat(stockcheck.change_date));
                ct1.Add(stockcheck.cpu_buy_type);
                ct1.Add(stockcheck.cpu_change);

                ctest1.contentArray = ct1;
                firstsheet.contentList.Add(ctest1);
            }

            allcontentList.Add(firstsheet);

            allContent secondsheet = new allContent();

            secondsheet.sheetName   = "统计信息" + startTime.Replace('/', '-') + "-" + endTime.Replace('/', '-');
            secondsheet.titleList   = new List <string>();
            secondsheet.contentList = new List <object>();

            secondsheet.titleList.Add("ECO");
            secondsheet.titleList.Add("BGA类型");
            secondsheet.titleList.Add("BGA简述");
            secondsheet.titleList.Add("待货数量");

            foreach (bagUsedSumStruct stockcheck in bagWaitSumList)
            {
                ExportExcelContent ctest1 = new ExportExcelContent();
                List <string>      ct1    = new List <string>();
                ct1.Add(stockcheck.eco);
                ct1.Add(stockcheck.bga_type);
                ct1.Add(stockcheck.bga_brief);
                ct1.Add(stockcheck.returnNum + "");

                ctest1.contentArray = ct1;
                secondsheet.contentList.Add(ctest1);
            }

            allcontentList.Add(secondsheet);

            Utils.createMulitSheetsUsingNPOI("BGA维修信息" + bgaRepair_resultcomboBox.Text.Trim() + "-" + startTime.Replace('/', '-') + "-" + endTime.Replace('/', '-') + ".xls", allcontentList);
        }
Exemplo n.º 4
0
        public void generateExcelToCheck(List <StoreHouseStatisticsStruct> StockCheckList, Dictionary <string, bgaTypeStatistics> bgabriefdict,
                                         string startTime, string endTime)
        {
            List <allContent> allcontentList = new List <allContent>();

            allContent firstsheet = new allContent();

            firstsheet.sheetName   = this.houseComboBox.Text + "平衡表信息导出" + startTime.Replace('/', '-') + "-" + endTime.Replace('/', '-');
            firstsheet.titleList   = new List <string>();
            firstsheet.contentList = new List <object>();

            firstsheet.titleList.Add("ID");
            firstsheet.titleList.Add("库房");
            firstsheet.titleList.Add("储位");
            firstsheet.titleList.Add("存储料号");
            firstsheet.titleList.Add("类型");
            firstsheet.titleList.Add("厂商");
            firstsheet.titleList.Add("剩余数量");
            firstsheet.titleList.Add("购买数量");
            firstsheet.titleList.Add("出库数量");
            firstsheet.titleList.Add("报废转卖");
            firstsheet.titleList.Add("描述");
            firstsheet.titleList.Add("BGA简称");

            foreach (StoreHouseStatisticsStruct stockcheck in StockCheckList)
            {
                if (stockcheck.type != null && !stockcheck.type.Contains("SMT"))
                {
                    ExportExcelContent ctest1 = new ExportExcelContent();
                    List <string>      ct1    = new List <string>();
                    ct1.Add(stockcheck.Id);
                    ct1.Add(stockcheck.house);
                    ct1.Add(stockcheck.place);
                    ct1.Add(stockcheck.mpn);
                    ct1.Add(stockcheck.type);
                    ct1.Add(stockcheck.vendor);
                    ct1.Add(stockcheck.leftnumber);
                    ct1.Add(stockcheck.buynumber);
                    ct1.Add(stockcheck.outnumber);
                    ct1.Add(stockcheck.othernumber);
                    ct1.Add(stockcheck.describe);
                    ct1.Add(stockcheck.bga_brief);

                    ctest1.contentArray = ct1;
                    firstsheet.contentList.Add(ctest1);
                }
            }
            allcontentList.Add(firstsheet);

            allContent secondsheet = new allContent();

            secondsheet.sheetName   = "BGA简称" + startTime.Replace('/', '-') + "-" + endTime.Replace('/', '-');
            secondsheet.titleList   = new List <string>();
            secondsheet.contentList = new List <object>();

            secondsheet.titleList.Add("BGA类型");
            secondsheet.titleList.Add("剩余数量");
            secondsheet.titleList.Add("购买数量");
            secondsheet.titleList.Add("出货数量");
            secondsheet.titleList.Add("报废转卖");
            secondsheet.titleList.Add("描述");
            secondsheet.titleList.Add("相关mpn");

            foreach (string key in bgabriefdict.Keys)
            {
                ExportExcelContent ctest1 = new ExportExcelContent();

                List <string>     ct1        = new List <string>();
                bgaTypeStatistics stockcheck = bgabriefdict[key];
                ct1.Add(stockcheck.bga_brief);
                ct1.Add(stockcheck.leftnumber);
                ct1.Add(stockcheck.buynumber);
                ct1.Add(stockcheck.outnumber);
                ct1.Add(stockcheck.othernumber);
                ct1.Add(stockcheck.describe);
                ct1.Add(stockcheck.releatedMpn);

                ctest1.contentArray = ct1;
                secondsheet.contentList.Add(ctest1);
            }
            allcontentList.Add(secondsheet);

            Utils.createMulitSheetsUsingNPOI(string.Format("{0}平衡表信息导出{1}-{2}", this.houseComboBox.Text, startTime.Replace('/', '-'), endTime.Replace('/', '-')) + ".xls", allcontentList);
        }