diff --git a/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.cpp b/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.cpp index d827de8..c4ab82f 100644 --- a/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.cpp +++ b/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.cpp @@ -426,69 +426,69 @@ void LoadRepairOrderFromXls( const std::wstring & filePath, { int colunmIndex = pSheet->firstCol(); - const wstring && branchName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && orderNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && orderType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && notifyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && damageArea = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && damageDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && generatingDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && policyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && policyNoJQX = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && plateNumber = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && brandName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && isInsuranceObject = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && isSuccess = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && recommandDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && recommandDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && recommandDealerCodeInNotify = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && recommandDealerNameInNotify = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && recommandDealerNameInSurvey = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && agentName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && surveyor = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && checkDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && repairingStartDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && repairingFinishDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && status = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && lostItemID = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - const wstring && surveyorRecommandStatus = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); - - //空行跳过 - if ( orderNo.empty() == true ) - { - rowIndex++; - - continue; - } - - RepairOrder order( branchName, - orderNo, - orderType, - notifyNo, - damageArea, - damageDate, - generatingDate, - policyNo, - policyNoJQX, - plateNumber, - brandName, - isInsuranceObject, - isSuccess, - recommandDealerCode, - recommandDealerName, - recommandDealerCodeInNotify, - recommandDealerNameInNotify, - recommandDealerNameInSurvey, - agentName, - surveyor, - checkDate, - repairingStartDate, - repairingFinishDate, - status, - lostItemID, - surveyorRecommandStatus ); - - orderVector.push_back( order ); + // const wstring && branchName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && orderNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && orderType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && notifyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && damageArea = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && damageDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && generatingDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && policyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && policyNoJQX = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && plateNumber = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && brandName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && isInsuranceObject = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && isSuccess = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && recommandDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && recommandDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && recommandDealerCodeInNotify = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && recommandDealerNameInNotify = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && recommandDealerNameInSurvey = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && agentName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && surveyor = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && checkDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && repairingStartDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && repairingFinishDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && status = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && lostItemID = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // const wstring && surveyorRecommandStatus = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + // + // //空行跳过 + // if ( orderNo.empty() == true ) + // { + // rowIndex++; + // + // continue; + // } + // + // RepairOrder order( branchName, + // orderNo, + // orderType, + // notifyNo, + // damageArea, + // damageDate, + // generatingDate, + // policyNo, + // policyNoJQX, + // plateNumber, + // brandName, + // isInsuranceObject, + // isSuccess, + // recommandDealerCode, + // recommandDealerName, + // recommandDealerCodeInNotify, + // recommandDealerNameInNotify, + // recommandDealerNameInSurvey, + // agentName, + // surveyor, + // checkDate, + // repairingStartDate, + // repairingFinishDate, + // status, + // lostItemID, + // surveyorRecommandStatus ); + // + // orderVector.push_back( order ); rowIndex++; } diff --git a/代码/cpp/car_dealer_util/source/data/excel/excel.cpp b/代码/cpp/car_dealer_util/source/data/excel/excel.cpp index f95cc93..7f5ff3c 100644 --- a/代码/cpp/car_dealer_util/source/data/excel/excel.cpp +++ b/代码/cpp/car_dealer_util/source/data/excel/excel.cpp @@ -15,6 +15,14 @@ void setKey( libxl::Book * pBook ) } } +void setKey( libxl::IBookT * pBook ) +{ + if (pBook != nullptr) + { + pBook->setKey("cpic", "windows-202d21040bc4e70060bc6264a6ucu7i1"); + } +} + std::wstring ReadCellStringFromXlsx( libxl::IBookT * pBook, unsigned int sheetIndex, unsigned int rowIndex, diff --git a/代码/cpp/car_dealer_util/source/data/excel/excel.h b/代码/cpp/car_dealer_util/source/data/excel/excel.h index cd3d4bb..971dd72 100644 --- a/代码/cpp/car_dealer_util/source/data/excel/excel.h +++ b/代码/cpp/car_dealer_util/source/data/excel/excel.h @@ -9,6 +9,7 @@ * \param pBook ************************************************/ void setKey( libxl::Book * pBook ); +void setKey( libxl::IBookT * pBook ); /************************************************ * \brief 从xlsx文件单元格中读取数据,以字符串为返回值。 diff --git a/代码/cpp/car_dealer_util/source/test/test.cpp b/代码/cpp/car_dealer_util/source/test/test.cpp index 0e325a7..3e6251e 100644 --- a/代码/cpp/car_dealer_util/source/test/test.cpp +++ b/代码/cpp/car_dealer_util/source/test/test.cpp @@ -23,6 +23,8 @@ void excelTest() wstring filePath = L"D:/develop/projects_win/2019/car_dealer_util/数据/345517_1.xls"; + string xlsFilePath = "D:/develop/projects_win/2019/car_dealer_util/数据/345517_1.xls"; + //LoadCarDealerSchemeFromXlsx(filePath, 0, 1, schemeVector); //LoadCarDealerAchievementFromXlsx( filePath, 0, 1, achievementsVector ); LoadRepairOrderFromXls(filePath, 0, 1, repairOrderVector); diff --git a/数据/送返修工单/343404_1 - 副本.xls b/数据/送返修工单/343404_1 - 副本.xls deleted file mode 100644 index 63f46e4..0000000 Binary files a/数据/送返修工单/343404_1 - 副本.xls and /dev/null differ diff --git a/数据/送返修工单/343404_1.xls b/数据/送返修工单/343404_1.xls deleted file mode 100644 index 63f46e4..0000000 Binary files a/数据/送返修工单/343404_1.xls and /dev/null differ diff --git a/数据/送返修工单/345517_1.xls b/数据/送返修工单/345517_1.xls deleted file mode 100644 index 63f46e4..0000000 Binary files a/数据/送返修工单/345517_1.xls and /dev/null differ diff --git a/数据/送返修工单/345540_1.xls b/数据/送返修工单/345540_1.xls new file mode 100644 index 0000000..3b82d41 Binary files /dev/null and b/数据/送返修工单/345540_1.xls differ