车商业绩基本完成。
This commit is contained in:
@@ -9,7 +9,7 @@ public:
|
||||
CarDealerAchievement( const std::wstring & theYear,
|
||||
const std::wstring & theMonth,
|
||||
const std::wstring & carDealerCode,
|
||||
const long double checkedAchievement,
|
||||
const double checkedAchievement,
|
||||
const int policyAmount,
|
||||
const int cpicAmount,
|
||||
const int piccAmount,
|
||||
@@ -27,15 +27,15 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
CarDealerAchievement( const wchar_t * theYear,
|
||||
const wchar_t * theMonth,
|
||||
const wchar_t * carDealerCode,
|
||||
const long double checkedAchievement,
|
||||
const int policyAmount,
|
||||
const int cpicAmount,
|
||||
const int piccAmount,
|
||||
const int pinganAmount,
|
||||
const int othersAmount )
|
||||
CarDealerAchievement( const wchar_t * theYear,
|
||||
const wchar_t * theMonth,
|
||||
const wchar_t * carDealerCode,
|
||||
const double checkedAchievement,
|
||||
const int policyAmount,
|
||||
const int cpicAmount,
|
||||
const int piccAmount,
|
||||
const int pinganAmount,
|
||||
const int othersAmount )
|
||||
: theYear( theYear ),
|
||||
theMonth( theMonth ),
|
||||
carDealerCode( carDealerCode ),
|
||||
@@ -63,9 +63,9 @@ public:
|
||||
}
|
||||
|
||||
CarDealerAchievement( CarDealerAchievement && other )
|
||||
: theYear( std::move(other.theYear) ),
|
||||
theMonth( std::move(other.theMonth) ),
|
||||
carDealerCode( std::move(other.carDealerCode) ),
|
||||
: theYear( std::move( other.theYear ) ),
|
||||
theMonth( std::move( other.theMonth ) ),
|
||||
carDealerCode( std::move( other.carDealerCode ) ),
|
||||
checkedAchievement( other.checkedAchievement ),
|
||||
policyAmount( other.policyAmount ),
|
||||
cpicAmount( other.cpicAmount ),
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
this->carDealerCode = carDealerCode;
|
||||
}
|
||||
|
||||
long double getCheckedAchievement() const
|
||||
double getCheckedAchievement() const
|
||||
{
|
||||
return checkedAchievement;
|
||||
}
|
||||
@@ -221,7 +221,7 @@ private:
|
||||
std::wstring theYear;
|
||||
std::wstring theMonth;
|
||||
std::wstring carDealerCode;
|
||||
long double checkedAchievement;
|
||||
double checkedAchievement;
|
||||
int policyAmount;
|
||||
int cpicAmount;
|
||||
int piccAmount;
|
||||
|
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "../../../data/DataManipulation/oracle/ImportToOracle.h"
|
||||
#include "../../Data/DataManipulation/Excel/LoadFromExcel.h"
|
||||
#include "../../../util/qt/qt_util.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -49,6 +50,8 @@ void QCarDealerAchievementWidget::onImport()
|
||||
try
|
||||
{
|
||||
ImportCarDealerAchievementToOracleCpp( userName, password, tnsName, achievementVector );
|
||||
|
||||
showCarDealerAchievement();
|
||||
}
|
||||
catch ( runtime_error & error )
|
||||
{
|
||||
@@ -58,13 +61,84 @@ void QCarDealerAchievementWidget::onImport()
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void QCarDealerAchievementWidget::onShowCarDealerAchievement()
|
||||
void QCarDealerAchievementWidget::showCarDealerAchievement()
|
||||
{
|
||||
ui.pTableWidgetAchievement->clearContents();
|
||||
|
||||
QTableWidgetItem * pItem = nullptr;
|
||||
int rowIndex = 0;
|
||||
int columnIndex = 0;
|
||||
|
||||
ui.pTableWidgetAchievement->setRowCount(achievementVector.size());
|
||||
|
||||
for ( auto iter = achievementVector.begin();
|
||||
iter != achievementVector.end();
|
||||
++iter, ++rowIndex )
|
||||
{
|
||||
//年度
|
||||
pItem = new QTableWidgetItem(QString::fromStdWString(iter->getTheYear()));
|
||||
pItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
|
||||
ui.pTableWidgetAchievement->setItem(rowIndex, columnIndex++, pItem);
|
||||
|
||||
//月份
|
||||
pItem = new QTableWidgetItem(QString::fromStdWString(iter->getTheMonth()));
|
||||
pItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
|
||||
ui.pTableWidgetAchievement->setItem(rowIndex, columnIndex++, pItem);
|
||||
|
||||
//车商代码
|
||||
pItem = new QTableWidgetItem(QString::fromStdWString(iter->getCarDealerCode()));
|
||||
pItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
|
||||
ui.pTableWidgetAchievement->setItem(rowIndex, columnIndex++, pItem);
|
||||
|
||||
//车商名称
|
||||
pItem = new QTableWidgetItem(QString::fromStdWString(iter->getCarDealerCode()));
|
||||
pItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
|
||||
ui.pTableWidgetAchievement->setItem(rowIndex, columnIndex++, pItem);
|
||||
|
||||
//店内双签产值
|
||||
pItem = new QTableWidgetItem(QString::number(iter->getCheckedAchievement(), 'g', -1));
|
||||
pItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
|
||||
ui.pTableWidgetAchievement->setItem(rowIndex, columnIndex++, pItem);
|
||||
|
||||
//店内新车开票数
|
||||
pItem = new QTableWidgetItem(QString::number(iter->getPolicyAmount(),10));
|
||||
pItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
|
||||
ui.pTableWidgetAchievement->setItem(rowIndex, columnIndex++, pItem);
|
||||
|
||||
//我司新车签单台次
|
||||
pItem = new QTableWidgetItem(QString::number(iter->getCpicAmount()));
|
||||
pItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
|
||||
ui.pTableWidgetAchievement->setItem(rowIndex, columnIndex++, pItem);
|
||||
|
||||
//人保新车签单台次
|
||||
pItem = new QTableWidgetItem(QString::number(iter->getPiccAmount()));
|
||||
pItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
|
||||
ui.pTableWidgetAchievement->setItem(rowIndex, columnIndex++, pItem);
|
||||
|
||||
//平安新车签单台次
|
||||
pItem = new QTableWidgetItem(QString::number(iter->getPinganAmount()));
|
||||
pItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
|
||||
ui.pTableWidgetAchievement->setItem(rowIndex, columnIndex++, pItem);
|
||||
|
||||
//其他保险公司
|
||||
pItem = new QTableWidgetItem(QString::number(iter->getOthersAmount()));
|
||||
pItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
|
||||
ui.pTableWidgetAchievement->setItem(rowIndex, columnIndex++, pItem);
|
||||
}
|
||||
|
||||
resizeTableWidgetTab(ui.pTableWidgetAchievement, 10);
|
||||
}
|
||||
|
||||
void QCarDealerAchievementWidget::init()
|
||||
@@ -82,8 +156,7 @@ void QCarDealerAchievementWidget::initWidgets()
|
||||
{
|
||||
setLayout( ui.pLayoutMain );
|
||||
|
||||
ui.pTableWidgetAchievement->resizeColumnsToContents();
|
||||
|
||||
resizeTableWidgetTab( ui.pTableWidgetAchievement, 10 );
|
||||
}
|
||||
|
||||
void QCarDealerAchievementWidget::initSignal()
|
||||
|
@@ -14,7 +14,7 @@ public:
|
||||
|
||||
protected Q_SLOTS:
|
||||
void onImport();
|
||||
void onShowCarDealerAchievement();
|
||||
void showCarDealerAchievement();
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
@@ -34,19 +34,6 @@
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pButtonImport">
|
||||
<property name="text">
|
||||
@@ -68,6 +55,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
@@ -34,19 +34,6 @@
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pButtonImport">
|
||||
<property name="text">
|
||||
@@ -68,6 +55,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@@ -158,6 +158,8 @@
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../../resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@@ -46,7 +46,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pCarDealerAchievementTab">
|
||||
<attribute name="title">
|
||||
|
@@ -27,6 +27,8 @@ void resizeTableWidgetTab( QTableWidget * pTableWidget, unsigned margin )
|
||||
|
||||
int columnCount = pTableWidget->columnCount();
|
||||
|
||||
pTableWidget->resizeColumnsToContents();
|
||||
|
||||
for ( int columnIndex = 0; columnIndex < columnCount; columnIndex++ )
|
||||
{
|
||||
unsigned int columnWidth = pTableWidget->columnWidth( columnIndex );
|
||||
|
Reference in New Issue
Block a user