From 2100fd5ff84a43481a1f6026b8cb782ca97448df Mon Sep 17 00:00:00 2001 From: wumu <mayi@mayi.com> Date: 星期五, 01 三月 2024 23:53:47 +0800 Subject: [PATCH] 0301 --- internal_system_v1/converinfo2.cpp | 132 ++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 121 insertions(+), 11 deletions(-) diff --git a/internal_system_v1/converinfo2.cpp b/internal_system_v1/converinfo2.cpp index 6765e19..2725b2e 100644 --- a/internal_system_v1/converinfo2.cpp +++ b/internal_system_v1/converinfo2.cpp @@ -206,9 +206,10 @@ int index = str.indexOf("鍐呭缁�01琛�"); qDebug()<<"index:"<<index; if(index > 0){ - QAxObject excel("Excel.Application"); // windows鍐呮牳 - if(!excel.setControl("Excel.Application")){ - excel.setControl("ket.Application"); // wps鍐呮牳 + QAxObject excel("ket.Application"); + if(!excel.setControl("ket" + ".Application")){ // windows鍐呮牳 + excel.setControl("Excel.Application"); // wps鍐呮牳 } excel.setProperty("Visible",false); excel.setProperty("DisplayAlerts",false); @@ -791,7 +792,17 @@ qDebug()<<"缁熻璐熻矗浜�"<<statisticalConOfficer; // 鏇存柊鍒癿ap涓� + if(m_nameAndComInfos.count(name)==0){ + // 娣诲姞鍒癿ap涓� + m_nameAndComInfos[name]=ComInfo(); + // 娣诲姞鍒板彸杈规爲閮ㄤ欢涓� + QTreeWidgetItem *top1 = new QTreeWidgetItem(ui->treeWidget); + top1->setText(0,name); + } auto &curComInfo = m_nameAndComInfos[name]; + + + strcpy(curComInfo.creditCode,creditCode.toLocal8Bit().data()); strcpy(curComInfo.name,name.toLocal8Bit().data()); strcpy(curComInfo.comType,comType.toLocal8Bit().data()); @@ -801,20 +812,20 @@ strcpy(curComInfo.areaCode,areaCode.toLocal8Bit().data()); strcpy(curComInfo.townCode,townCode.toLocal8Bit().data()); strcpy(curComInfo.scale,scale.toLocal8Bit().data()); - curComInfo.people = people.toInt(); + curComInfo.people = people.toInt(); // index 10 strcpy(curComInfo.representative,representative.toLocal8Bit().data()); strcpy(curComInfo.standardType,standardType.toLocal8Bit().data()); strcpy(curComInfo.trunkCode,trunkCode.toLocal8Bit().data()); strcpy(curComInfo.fixedTel,fixedTel.toLocal8Bit().data()); strcpy(curComInfo.postCode,postCode.toLocal8Bit().data()); strcpy(curComInfo.email,email.toLocal8Bit().data()); - strcpy(curComInfo.webSite,webSite.toLocal8Bit().data()); + strcpy(curComInfo.webSite,webSite.toLocal8Bit().data()); // index 17 // 浜� strcpy(curComInfo.hasUpLegal,hasUpLegal.toLocal8Bit().data()); strcpy(curComInfo.upCreditCode,upCreditCode.toLocal8Bit().data()); strcpy(curComInfo.oldCreditCode,oldCreditCode.toLocal8Bit().data()); - strcpy(curComInfo.upName,upName.toLocal8Bit().data()); + strcpy(curComInfo.upName,upName.toLocal8Bit().data()); // index 21 // 涓� strcpy(curComInfo.hasChiefDesigner,hasChiefDesigner.toLocal8Bit().data()); @@ -824,15 +835,15 @@ strcpy(curComInfo.internalName,internalName.toLocal8Bit().data()); strcpy(curComInfo.leadingOrganization,leadingOrganization.toLocal8Bit().data()); strcpy(curComInfo.hasSetSeparateIA,hasSetSeparateIA.toLocal8Bit().data()); - curComInfo.financeDepartment = financeDepartment; + curComInfo.financeDepartment = financeDepartment; // index 29 curComInfo.legalDepartment = legalDepartment; curComInfo.internalConDepart = internalConDepart; curComInfo.disceplineInDepart = disceplineInDepart; curComInfo.otherDepart = otherDepart; - strcpy(curComInfo.intavalAuditLeval,intavalAuditLeval.toLocal8Bit().data()); + strcpy(curComInfo.intavalAuditLeval,intavalAuditLeval.toLocal8Bit().data()); // index 34 // 鍥� - curComInfo.organazationNum = organazationNum; + curComInfo.organazationNum = organazationNum; // index 35 curComInfo.realNum = realNum; curComInfo.professionalNum = professionalNum; curComInfo.CIANum = CIANum; @@ -853,13 +864,13 @@ curComInfo.managerNum = managerNum; curComInfo.itNum = itNum; curComInfo.engineeringNum = engineeringNum; - curComInfo.otherNum = otherNum; + curComInfo.otherNum = otherNum; // index 56 // 鍚�4涓俊鎭� strcpy(curComInfo.statisticalConOfficer,statisticalConOfficer.toLocal8Bit().data()); strcpy(curComInfo.personFilling,personFilling.toLocal8Bit().data()); strcpy(curComInfo.officerTel,officerTel.toLocal8Bit().data()); - strcpy(curComInfo.fillingDateTime,fillingDateTime.toLocal8Bit().data()); + strcpy(curComInfo.fillingDateTime,fillingDateTime.toLocal8Bit().data()); // index 60 // 鏇存柊鍒版暟鎹簱 @@ -879,8 +890,107 @@ if(rowCnt == 0){ // 涓嶅瓨鍦紝鍒欐彃鍏ヤ竴鏉℃柊鏁版嵁 qDebug()<<"涓嶅瓨鍦�:"<<name; + sql = QString("insert into all_company_info (name,\ +code,\ +鏈烘瀯绫诲瀷,\ +涓昏涓氬姟娲诲姩,\ +琛屼笟浠g爜,\ +鍗曚綅娉ㄥ唽鍦板強鍖哄煙,\ +鍖哄煙浠g爜,\ +鍩庝埂浠g爜,\ +鍗曚綅瑙勬ā,\ +浠庝笟鏈熸湯浜烘暟,\ +娉曞畾浠h〃浜�,\ +鎵ц浼氳鏍囧噯绫诲埆,\ +闀块�斿尯鍙�,\ +鍥哄畾鐢佃瘽,\ +閭斂缂栫爜,\ +鐢靛瓙閭,\ +缃戝潃,\ +鏄惁鏈変笂涓�绾ф硶浜�,\ +涓婁竴绾х粺淇′唬鐮�,\ +鍘熺粍缁囦唬鐮�,\ +涓婄骇鍗曚綅鍚嶇О,\ +鏄惁璁剧疆鎬诲璁″笀,\ +鎬诲璁″笀鑱屼綅灞傜骇,\ +鎬诲浠昏亴鏂瑰紡,\ +鏄惁璁剧疆鍐呭鏈烘瀯,\ +鍐呭鏈烘瀯鍚嶇О,\ +棰嗗鏈烘瀯,\ +鏄惁鐙珛璁剧疆鍐呭鏈烘瀯,\ +璐㈠姟閮ㄩ棬,\ +娉曞姟閮ㄩ棬,\ +鍐呴儴鎺у埗閮ㄩ棬,\ +绾閮ㄩ棬,\ +鍏朵粬閮ㄩ棬,\ +鍐呭灞傜骇,\ +缂栧埗鏁伴噺,\ +瀹炴湁浜烘暟閲�,\ +涓撹亴浜哄憳鏁伴噺,\ +鎷ユ湁CIA浜烘暟,\ +纭曞+瀛﹀巻浠ヤ笂浜烘暟,\ +鏈浜烘暟,\ +涓撶鍙婁互涓嬩汉鏁�,\ +楂樼骇鑱岀О浜烘暟,\ +涓骇鑱岀О浜烘暟,\ +鍒濈骇鑱岀О浜烘暟,\ +鏃犺亴绉颁汉鏁�,\ +浜斿崄宀佷互涓婁汉鏁�,\ +涓夊崄鑷充簲鍗佸瞾宀佷汉鏁�,\ +涓夊崄宀佷互涓嬩汉鏁�,\ +瀹¤鏁伴噺,\ +浼氳鏁伴噺,\ +缁忔祹鏁伴噺,\ +娉曞緥鏁伴噺,\ +绠$悊鏁伴噺,\ +淇℃伅鎶�鏈暟閲�,\ +宸ョ▼鏁伴噺,\ +鍏朵粬鏁伴噺,\ +缁熻璐熻矗浜�,\ +濉〃浜�,\ +鑱旂郴鐢佃瘽,\ +濉姤鏃ユ湡) values ('%1','%2','%3','%4','%5','%6','%7','%8','%9',%10,\ +'%11','%12','%13','%14','%15','%16','%17','%18','%19','%20',\ +'%21','%22','%23','%24','%25','%26','%27','%28',%29,%30,\ +%31,%32,%33,'%34',%35,%36,%37,%38,%39,%40,\ +%41,%42,%43,%44,%45,%46,%47,%48,%49,%50,\ +%51,%52,%53,%54,%55,%56,'%57','%58','%59','%60'\ +)").arg(name).arg(creditCode).arg(comType).arg(business).arg(businessCode).arg(addr).arg(areaCode).arg(townCode).arg(scale).arg(people). + arg(representative).arg(standardType).arg(trunkCode).arg(fixedTel).arg(postCode).arg(email).arg(webSite).arg(hasUpLegal).arg(upCreditCode).arg(oldCreditCode). + arg(upName).arg(hasChiefDesigner).arg(ChiefDesignerLevel).arg(employmentMode).arg(hasSetIntervalAudit).arg(internalName).arg(leadingOrganization).arg(hasSetSeparateIA).arg(financeDepartment).arg(legalDepartment). + arg(internalConDepart).arg(disceplineInDepart).arg(otherDepart).arg(intavalAuditLeval).arg(organazationNum).arg(realNum).arg(professionalNum).arg(CIANum).arg(masterNum).arg(undergraduatesNum). + arg(juniorNum).arg(seniorNum).arg(intermediateNum).arg(primaryNum).arg(noTitleNum).arg(upFiftyOldNum).arg(upThirtyOldNum).arg(downThirtyOldNum).arg(auditNum).arg(accountingNum). + arg(economyNum).arg(lawNum).arg(managerNum).arg(itNum).arg(engineeringNum).arg(otherNum).arg(statisticalConOfficer).arg(personFilling).arg(officerTel).arg(fillingDateTime); + + + qDebug()<<"sql insert:"<<sql; + if(query.exec(sql)){ + qDebug()<<"insert ok"; + }else{ + qDebug()<<"insert fail:"<<query.lastError().text(); + } + }else{ // 鏇存柊 qDebug()<<"瀛樺湪:"<<name; + sql = QString("update all_company_info set name='%1',code='%2',鏈烘瀯绫诲瀷='%3',涓昏涓氬姟娲诲姩='%4',琛屼笟浠g爜='%5',鍗曚綅娉ㄥ唽鍦板強鍖哄煙='%6',鍖哄煙浠g爜='%7',鍩庝埂浠g爜='%8',鍗曚綅瑙勬ā='%9',浠庝笟鏈熸湯浜烘暟=%10\ +,娉曞畾浠h〃浜�='%11',鎵ц浼氳鏍囧噯绫诲埆='%12',闀块�斿尯鍙�='%13',鍥哄畾鐢佃瘽='%14',閭斂缂栫爜='%15',鐢靛瓙閭='%16',缃戝潃='%17',鏄惁鏈変笂涓�绾ф硶浜�='%18',涓婁竴绾х粺淇′唬鐮�='%19',鍘熺粍缁囦唬鐮�='%20'\ +,涓婄骇鍗曚綅鍚嶇О='%21',鏄惁璁剧疆鎬诲璁″笀='%22',鎬诲璁″笀鑱屼綅灞傜骇='%23',鎬诲浠昏亴鏂瑰紡='%24',鏄惁璁剧疆鍐呭鏈烘瀯='%25',鍐呭鏈烘瀯鍚嶇О='%26',棰嗗鏈烘瀯='%27',鏄惁鐙珛璁剧疆鍐呭鏈烘瀯='%28',璐㈠姟閮ㄩ棬=%29,娉曞姟閮ㄩ棬=%30\ +,鍐呴儴鎺у埗閮ㄩ棬=%31,绾閮ㄩ棬=%32,鍏朵粬閮ㄩ棬=%33,鍐呭灞傜骇='%34',缂栧埗鏁伴噺=%35,瀹炴湁浜烘暟閲�=%36,涓撹亴浜哄憳鏁伴噺=%37,鎷ユ湁CIA浜烘暟=%38,纭曞+瀛﹀巻浠ヤ笂浜烘暟=%39,鏈浜烘暟=%40\ +,涓撶鍙婁互涓嬩汉鏁�=%41,楂樼骇鑱岀О浜烘暟=%42,涓骇鑱岀О浜烘暟=%43,鍒濈骇鑱岀О浜烘暟=%44,鏃犺亴绉颁汉鏁�=%45,浜斿崄宀佷互涓婁汉鏁�=%46,涓夊崄鑷充簲鍗佸瞾宀佷汉鏁�=%47,涓夊崄宀佷互涓嬩汉鏁�=%48,瀹¤鏁伴噺=%49,浼氳鏁伴噺=%50\ +,缁忔祹鏁伴噺=%51,娉曞緥鏁伴噺=%52,绠$悊鏁伴噺=%53,淇℃伅鎶�鏈暟閲�=%54,宸ョ▼鏁伴噺=%55,鍏朵粬鏁伴噺=%56,缁熻璐熻矗浜�='%57',濉〃浜�='%58',鑱旂郴鐢佃瘽='%59',濉姤鏃ユ湡='%60'"). + arg(name).arg(creditCode).arg(comType).arg(business).arg(businessCode).arg(addr).arg(areaCode).arg(townCode).arg(scale).arg(people). + arg(representative).arg(standardType).arg(trunkCode).arg(fixedTel).arg(postCode).arg(email).arg(webSite).arg(hasUpLegal).arg(upCreditCode).arg(oldCreditCode). + arg(upName).arg(hasChiefDesigner).arg(ChiefDesignerLevel).arg(employmentMode).arg(hasSetIntervalAudit).arg(internalName).arg(leadingOrganization).arg(hasSetSeparateIA).arg(financeDepartment).arg(legalDepartment). + arg(internalConDepart).arg(disceplineInDepart).arg(otherDepart).arg(intavalAuditLeval).arg(organazationNum).arg(realNum).arg(professionalNum).arg(CIANum).arg(masterNum).arg(undergraduatesNum). + arg(juniorNum).arg(seniorNum).arg(intermediateNum).arg(primaryNum).arg(noTitleNum).arg(upFiftyOldNum).arg(upThirtyOldNum).arg(downThirtyOldNum).arg(auditNum).arg(accountingNum). + arg(economyNum).arg(lawNum).arg(managerNum).arg(itNum).arg(engineeringNum).arg(otherNum).arg(statisticalConOfficer).arg(personFilling).arg(officerTel).arg(fillingDateTime); + + qDebug()<<"update sql:"<<sql; + if(query.exec(sql)){ + qDebug()<<"update ok"; + }else{ + qDebug()<<"update fail:"<<query.lastError().text(); + } } } -- Gitblit v1.8.0