| | |
| | | auto resList = m_curItem->takeChildren(); |
| | | |
| | | qDebug()<<"删除数量:"<<resList.size(); |
| | | |
| | | // 删除数据库表里面对应的公司信息,并且再次刷新下拉框和树状图 |
| | | |
| | | // 数据库表有:封面信息表 all_company_info 综合信息表 comprehensive_entry_info 三合一的表 standing_book_info |
| | | QString name = m_curItem->text(0); |
| | | QStringList sp = name.split("(本级)"); |
| | | QStringList sp2 = name.split("下级数"); |
| | | qDebug()<<"拆开:"<<sp<<"汇总:"<<sp2; |
| | | if(sp.size() == 2){ |
| | | name = sp.at(0); |
| | | } |
| | | if(sp2.size() == 2){ // 得递归删除底下的所有单位 |
| | | name = sp2.at(0); |
| | | } |
| | | // 删除所有表中这个名字 |
| | | deleteAllByName(name); |
| | | |
| | | // 删除完了,还得去刷新下拉框 |
| | | |
| | | // 去刷新树形图 |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | void ConverInfo2::saveInfo() |
| | |
| | | qDebug()<<"rowCnt:"<<rowCnt; |
| | | } |
| | | } |
| | | |
| | | void ConverInfo2::deleteAllByName(QString name) |
| | | { |
| | | // 数据库表有:封面信息表 all_company_info |
| | | // 综合信息表 comprehensive_entry_info |
| | | // 三合一的表 standing_book_info |
| | | |
| | | QString first_sql = QString("delete from all_company_info where name='%1'").arg(name); |
| | | qDebug()<<"first_sql:"<<first_sql; |
| | | |
| | | QString second_sql = QString("delete from comprehensive_entry_info where name='%1'").arg(name); |
| | | qDebug()<<"second_sql:"<<second_sql; |
| | | |
| | | QString three_sql = QString("delete from standing_book_info where 责任主体名称='%1'").arg(name); |
| | | qDebug()<<"three_sql:"<<three_sql; |
| | | |
| | | |
| | | QSqlQuery query; |
| | | if(query.exec(first_sql)) |
| | | { |
| | | qDebug()<<"first_sql run ok"; |
| | | } |
| | | if(query.exec(second_sql)) |
| | | { |
| | | qDebug()<<"second_sql run ok"; |
| | | } |
| | | if(query.exec(three_sql)) |
| | | { |
| | | qDebug()<<"three_sql run ok"; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | void ConverInfo2::addTreeWidgetNode(QVariant upName,QVariant name){ |
| | | // 添加左边树形图相关 |
| | | // 菜单相关 当上级公司为空上级时,自己当自己的上级,并且罗列进去当 本级 |