| | |
| | | QVariant name = valRows[9].toList().at(8); |
| | | if(name.isValid()){ |
| | | ui->label_name->setText(name.toString()); |
| | | }else{ |
| | | ui->label_name->setText(""); |
| | | } |
| | | // æºæç±»å |
| | | QVariant comType = valRows[12].toList().at(3); |
| | | if(comType.isValid()){ |
| | | ui->label_comType->setText(comType.toString()); |
| | | }else{ |
| | | ui->label_comType->setText(""); |
| | | } |
| | | // 主è¦ä¸å¡æ´»å¨ |
| | | QString business; |
| | |
| | | } |
| | | if(business.size() > 0){ |
| | | ui->label_business->setText(business); |
| | | }else{ |
| | | ui->label_business->setText(""); |
| | | } |
| | | // ä¸å¡ä»£ç |
| | | QVariant busCode = valRows[19].toList().at(4); |
| | | if(busCode.isValid()){ |
| | | ui->label_businessCode->setText(busCode.toString()); |
| | | }else{ |
| | | ui->label_businessCode->setText(""); |
| | | } |
| | | // 注åå°å |
| | | QString addr=""; |
| | |
| | | if(street.isValid()) addr += street.toString(); |
| | | if(Sub.isValid()) addr += Sub.toString(); |
| | | if(committee.isValid()) addr += committee.toString(); |
| | | if(addr.size()>10)ui->label_addr->setText(addr); |
| | | if(addr.size()>10){ |
| | | ui->label_addr->setText(addr); |
| | | }else{ |
| | | ui->label_addr->setText(""); |
| | | } |
| | | // åºå代ç |
| | | QVariant areaCode = valRows[24].toList().at(2); |
| | | if(areaCode.isValid()) ui->label_areaCode->setText(areaCode.toString()); |
| | | if(areaCode.isValid()){ |
| | | ui->label_areaCode->setText(areaCode.toString()); |
| | | }else{ |
| | | ui->label_areaCode->setText(""); |
| | | } |
| | | // å乡代ç |
| | | QVariant townCode = valRows[24].toList().at(6); |
| | | if(townCode.isValid()) ui->label_townCode->setText(townCode.toString()); |
| | | if(townCode.isValid()) { |
| | | ui->label_townCode->setText(townCode.toString()); |
| | | }else{ |
| | | ui->label_townCode->setText(""); |
| | | } |
| | | |
| | | // åä½è§æ¨¡ |
| | | QVariant scale = valRows[25].toList().at(3); |
| | | if(scale.isValid()) ui->label_scale->setText(scale.toString()); |
| | | if(scale.isValid()){ |
| | | ui->label_scale->setText(scale.toString()); |
| | | }else{ |
| | | ui->label_scale->setText(""); |
| | | } |
| | | // ä»ä¸äººæ° |
| | | QVariant people = valRows[26].toList().at(6); |
| | | if(people.isValid()) ui->label_people->setText(people.toString()); |
| | | if(people.isValid()) { |
| | | ui->label_people->setText(people.toString()); |
| | | }else{ |
| | | ui->label_people->setText(""); |
| | | } |
| | | // æ³äºº |
| | | QVariant representative = valRows[27].toList().at(4); |
| | | if(representative.isValid()) ui->label_representative->setText(representative.toString()); |
| | | if(representative.isValid()) { |
| | | ui->label_representative->setText(representative.toString()); |
| | | }else{ |
| | | ui->label_representative->setText(""); |
| | | } |
| | | // ä¼è®¡æ åç±»å« standardType |
| | | QVariant standardType = valRows[27].toList().at(8); |
| | | if(standardType.isValid()) ui->label_standardType->setText(standardType.toString()); |
| | | if(standardType.isValid()){ |
| | | ui->label_standardType->setText(standardType.toString()); |
| | | }else{ |
| | | ui->label_standardType->setText(""); |
| | | } |
| | | // é¿éåºå· |
| | | QVariant trunkCode = valRows[31].toList().at(2); |
| | | if(trunkCode.isValid()) ui->label_trunkCode->setText(trunkCode.toString()); |
| | | if(trunkCode.isValid()){ |
| | | ui->label_trunkCode->setText(trunkCode.toString()); |
| | | }else{ |
| | | ui->label_trunkCode->setText(""); |
| | | } |
| | | // åºå®çµè¯ |
| | | QVariant fixedTel = valRows[32].toList().at(2); |
| | | if(fixedTel.isValid()) ui->label_fixedTel->setText(fixedTel.toString()); |
| | | if(fixedTel.isValid()) { |
| | | ui->label_fixedTel->setText(fixedTel.toString()); |
| | | }else{ |
| | | ui->label_fixedTel->setText(""); |
| | | } |
| | | // 鮿¿ç¼ç |
| | | QVariant postCode = valRows[33].toList().at(2); |
| | | if(postCode.isValid()) ui->label_postCode->setText(postCode.toString()); |
| | | if(postCode.isValid()){ |
| | | ui->label_postCode->setText(postCode.toString()); |
| | | }else{ |
| | | ui->label_postCode->setText(""); |
| | | } |
| | | // çµåé®ç®± |
| | | QVariant email = valRows[30].toList().at(5); |
| | | if(email.isValid()) ui->label_email->setText(email.toString()); |
| | | if(email.isValid()) { |
| | | ui->label_email->setText(email.toString()); |
| | | }else{ |
| | | ui->label_email->setText(""); |
| | | } |
| | | // ç½å |
| | | QVariant webSite = valRows[32].toList().at(5); |
| | | if(webSite.isValid()) ui->label_webSite->setText(webSite.toString()); |
| | | if(webSite.isValid()) { |
| | | ui->label_webSite->setText(webSite.toString()); |
| | | }else{ |
| | | ui->label_webSite->setText(""); |
| | | } |
| | | } |
| | | wbs->dynamicCall("Close()"); |
| | | excel.dynamicCall("Quit(void)"); |
| | |
| | | QVariant val = usedRange->dynamicCall("Value"); // æ¿å°äºç»´è¡¨æ ¼ |
| | | QVariantList valRows = val.toList(); |
| | | // ç»ä¸ä¿¡ç¨ä»£ç |
| | | // QVariant uniCode = valRows[9].toList().at(3); |
| | | // if(uniCode.isValid()){ |
| | | // ui->label_creditCode->setText(uniCode.toString()); |
| | | // } |
| | | // // åä½åç§° |
| | | // QVariant name = valRows[9].toList().at(8); |
| | | // if(name.isValid()){ |
| | | // ui->label_name->setText(name.toString()); |
| | | // } |
| | | // // æºæç±»å |
| | | // QVariant comType = valRows[12].toList().at(3); |
| | | // if(comType.isValid()){ |
| | | // ui->label_comType->setText(comType.toString()); |
| | | // } |
| | | // // 主è¦ä¸å¡æ´»å¨ |
| | | // QString business; |
| | | // QVariant first = valRows[18].toList().at(2); |
| | | // if(first.isValid()){ |
| | | // business.append(first.toString()); |
| | | // } |
| | | // QVariant sec = valRows[18].toList().at(5); |
| | | // if(sec.isValid()){ |
| | | // business += "ã"; |
| | | // business.append(sec.toString()); |
| | | // } |
| | | // QVariant third = valRows[18].toList().at(8); |
| | | // if(third.isValid()){ |
| | | // business += "ã"; |
| | | // business.append(third.toString()); |
| | | // } |
| | | // if(business.size() > 0){ |
| | | // ui->label_business->setText(business); |
| | | // } |
| | | // // ä¸å¡ä»£ç |
| | | // QVariant busCode = valRows[19].toList().at(4); |
| | | // if(busCode.isValid()){ |
| | | // ui->label_businessCode->setText(busCode.toString()); |
| | | // } |
| | | // // 注åå°å |
| | | // QString addr=""; |
| | | // QVariant province = valRows[21].toList().at(1); // ç份 |
| | | // QVariant city = valRows[21].toList().at(4); // åå¸ |
| | | // QVariant district = valRows[21].toList().at(7); // 管è¾åº |
| | | // QVariant village = valRows[22].toList().at(2); // 乡é |
| | | // QVariant street = valRows[22].toList().at(4); // è¡é |
| | | // QVariant Sub = valRows[23].toList().at(2); // è¡éåäºå¤ |
| | | // QVariant committee = valRows[25].toList().at(3); // å±
å§ä¼ |
| | | // //qDebug()<<province<<city<<district<<village<<street<<Sub<<committee; |
| | | // if(province.isValid()) addr += province.toString(); |
| | | // if(city.isValid()) addr += city.toString(); |
| | | // if(district.isValid()) addr += district.toString(); |
| | | // if(village.isValid()) addr += village.toString(); |
| | | // if(street.isValid()) addr += street.toString(); |
| | | // if(Sub.isValid()) addr += Sub.toString(); |
| | | // if(committee.isValid()) addr += committee.toString(); |
| | | // if(addr.size()>10)ui->label_addr->setText(addr); |
| | | // // åºå代ç |
| | | // QVariant areaCode = valRows[24].toList().at(2); |
| | | // if(areaCode.isValid()) ui->label_areaCode->setText(areaCode.toString()); |
| | | // // å乡代ç |
| | | // QVariant townCode = valRows[24].toList().at(6); |
| | | // if(townCode.isValid()) ui->label_townCode->setText(townCode.toString()); |
| | | // // åä½è§æ¨¡ |
| | | // QVariant scale = valRows[25].toList().at(3); |
| | | // if(scale.isValid()) ui->label_scale->setText(scale.toString()); |
| | | // // ä»ä¸äººæ° |
| | | // QVariant people = valRows[26].toList().at(6); |
| | | // if(people.isValid()) ui->label_people->setText(people.toString()); |
| | | // // æ³äºº |
| | | // QVariant representative = valRows[27].toList().at(4); |
| | | // if(representative.isValid()) ui->label_representative->setText(representative.toString()); |
| | | // // ä¼è®¡æ åç±»å« standardType |
| | | // QVariant standardType = valRows[27].toList().at(8); |
| | | // if(standardType.isValid()) ui->label_standardType->setText(standardType.toString()); |
| | | // // é¿éåºå· |
| | | // QVariant trunkCode = valRows[31].toList().at(2); |
| | | // if(trunkCode.isValid()) ui->label_trunkCode->setText(trunkCode.toString()); |
| | | // // åºå®çµè¯ |
| | | // QVariant fixedTel = valRows[32].toList().at(2); |
| | | // if(fixedTel.isValid()) ui->label_fixedTel->setText(fixedTel.toString()); |
| | | // // 鮿¿ç¼ç |
| | | // QVariant postCode = valRows[33].toList().at(2); |
| | | // if(postCode.isValid()) ui->label_postCode->setText(postCode.toString()); |
| | | // // çµåé®ç®± |
| | | // QVariant email = valRows[30].toList().at(5); |
| | | // if(email.isValid()) ui->label_email->setText(email.toString()); |
| | | // // ç½å |
| | | // QVariant webSite = valRows[32].toList().at(5); |
| | | // if(webSite.isValid()) ui->label_webSite->setText(webSite.toString()); |
| | | |
| | | // ç»ä¸ä¿¡ç¨ä»£ç |
| | | QVariant uniCode = valRows[9].toList().at(3); |
| | | if(uniCode.isValid()){ |
| | | ui->label_creditCode->setText(uniCode.toString()); |
| | |
| | | QVariant name = valRows[9].toList().at(8); |
| | | if(name.isValid()){ |
| | | ui->label_name->setText(name.toString()); |
| | | }else{ |
| | | ui->label_name->setText(""); |
| | | } |
| | | // æºæç±»å |
| | | QVariant comType = valRows[12].toList().at(3); |
| | | if(comType.isValid()){ |
| | | ui->label_comType->setText(comType.toString()); |
| | | }else{ |
| | | ui->label_comType->setText(""); |
| | | } |
| | | // 主è¦ä¸å¡æ´»å¨ |
| | | QString business; |
| | |
| | | } |
| | | if(business.size() > 0){ |
| | | ui->label_business->setText(business); |
| | | }else{ |
| | | ui->label_business->setText(""); |
| | | } |
| | | // ä¸å¡ä»£ç |
| | | QVariant busCode = valRows[19].toList().at(4); |
| | | if(busCode.isValid()){ |
| | | ui->label_businessCode->setText(busCode.toString()); |
| | | }else{ |
| | | ui->label_businessCode->setText(""); |
| | | } |
| | | // 注åå°å |
| | | QString addr=""; |
| | |
| | | if(street.isValid()) addr += street.toString(); |
| | | if(Sub.isValid()) addr += Sub.toString(); |
| | | if(committee.isValid()) addr += committee.toString(); |
| | | if(addr.size()>10)ui->label_addr->setText(addr); |
| | | if(addr.size()>10){ |
| | | ui->label_addr->setText(addr); |
| | | }else{ |
| | | ui->label_addr->setText(""); |
| | | } |
| | | // åºå代ç |
| | | QVariant areaCode = valRows[24].toList().at(2); |
| | | if(areaCode.isValid()) ui->label_areaCode->setText(areaCode.toString()); |
| | | if(areaCode.isValid()){ |
| | | ui->label_areaCode->setText(areaCode.toString()); |
| | | }else{ |
| | | ui->label_areaCode->setText(""); |
| | | } |
| | | // å乡代ç |
| | | QVariant townCode = valRows[24].toList().at(6); |
| | | if(townCode.isValid()) ui->label_townCode->setText(townCode.toString()); |
| | | if(townCode.isValid()) { |
| | | ui->label_townCode->setText(townCode.toString()); |
| | | }else{ |
| | | ui->label_townCode->setText(""); |
| | | } |
| | | |
| | | // åä½è§æ¨¡ |
| | | QVariant scale = valRows[25].toList().at(3); |
| | | if(scale.isValid()) ui->label_scale->setText(scale.toString()); |
| | | if(scale.isValid()){ |
| | | ui->label_scale->setText(scale.toString()); |
| | | }else{ |
| | | ui->label_scale->setText(""); |
| | | } |
| | | // ä»ä¸äººæ° |
| | | QVariant people = valRows[26].toList().at(6); |
| | | if(people.isValid()) ui->label_people->setText(people.toString()); |
| | | if(people.isValid()) { |
| | | ui->label_people->setText(people.toString()); |
| | | }else{ |
| | | ui->label_people->setText(""); |
| | | } |
| | | // æ³äºº |
| | | QVariant representative = valRows[27].toList().at(4); |
| | | if(representative.isValid()) ui->label_representative->setText(representative.toString()); |
| | | if(representative.isValid()) { |
| | | ui->label_representative->setText(representative.toString()); |
| | | }else{ |
| | | ui->label_representative->setText(""); |
| | | } |
| | | // ä¼è®¡æ åç±»å« standardType |
| | | QVariant standardType = valRows[27].toList().at(8); |
| | | if(standardType.isValid()) ui->label_standardType->setText(standardType.toString()); |
| | | if(standardType.isValid()){ |
| | | ui->label_standardType->setText(standardType.toString()); |
| | | }else{ |
| | | ui->label_standardType->setText(""); |
| | | } |
| | | // é¿éåºå· |
| | | QVariant trunkCode = valRows[31].toList().at(2); |
| | | if(trunkCode.isValid()) ui->label_trunkCode->setText(trunkCode.toString()); |
| | | if(trunkCode.isValid()){ |
| | | ui->label_trunkCode->setText(trunkCode.toString()); |
| | | }else{ |
| | | ui->label_trunkCode->setText(""); |
| | | } |
| | | // åºå®çµè¯ |
| | | QVariant fixedTel = valRows[32].toList().at(2); |
| | | if(fixedTel.isValid()) ui->label_fixedTel->setText(fixedTel.toString()); |
| | | if(fixedTel.isValid()) { |
| | | ui->label_fixedTel->setText(fixedTel.toString()); |
| | | }else{ |
| | | ui->label_fixedTel->setText(""); |
| | | } |
| | | // 鮿¿ç¼ç |
| | | QVariant postCode = valRows[33].toList().at(2); |
| | | if(postCode.isValid()) ui->label_postCode->setText(postCode.toString()); |
| | | if(postCode.isValid()){ |
| | | ui->label_postCode->setText(postCode.toString()); |
| | | }else{ |
| | | ui->label_postCode->setText(""); |
| | | } |
| | | // çµåé®ç®± |
| | | QVariant email = valRows[30].toList().at(5); |
| | | if(email.isValid()) ui->label_email->setText(email.toString()); |
| | | if(email.isValid()) { |
| | | ui->label_email->setText(email.toString()); |
| | | }else{ |
| | | ui->label_email->setText(""); |
| | | } |
| | | // ç½å |
| | | QVariant webSite = valRows[32].toList().at(5); |
| | | if(webSite.isValid()) ui->label_webSite->setText(webSite.toString()); |
| | | if(webSite.isValid()) { |
| | | ui->label_webSite->setText(webSite.toString()); |
| | | }else{ |
| | | ui->label_webSite->setText(""); |
| | | } |
| | | |
| | | // 妿å使¯æ°å¢å çï¼å¾åå
¥å°æ°æ®åºä¸ä¿åèµ·æ¥ |
| | | readDataFromSQL(); // 忬¡è°ç¨API ç¡®è®¤æ°æ®è¿å°è¡¨ä¸ |