窗口界面开发完成!

This commit is contained in:
2020-12-08 17:59:27 +08:00
parent 1667755910
commit 50304c0c80
26 changed files with 335 additions and 161 deletions

View File

@@ -1,4 +1,10 @@

#include "AppParameters.h"
UserInfo * pStaffInfo = nullptr;
using namespace std;
UserInfo * pStaffInfo = nullptr;
const string SYSTEM_ADMIN = "999";
const string ADMIN = "000";
const string TEAM_LEADER = "000";

View File

@@ -1,7 +1,11 @@

#pragma once
#include <iostream>
#include "../Datastructure/UserInfo/UserInfo.h"
extern UserInfo * pStaffInfo;
extern const std::string SYSTEM_ADMIN;
extern const std::string ADMIN;
extern const std::string TEAM_LEADER;

View File

@@ -1,4 +1,4 @@
#include <libxl.h>
#include <libxl.h>
#include <stdexcept>
#include "LoadFromExcel.h"
#include "../../excel/excel.h"
@@ -545,6 +545,15 @@ void LoadNewRepairMonitorReportFromXlsx( const std::wstring &
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
if (record._.empty() == true)
{
//空行跳过
rowIndex++;
continue;
}
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );

View File

@@ -1094,13 +1094,12 @@ void ImportNewRepairMonitorToOracle( const std::string &
{
//rollback停止保存
string errorMessage = "报案号";
string notifyNo = QString::fromStdWString( iter->_ ).toLocal8Bit();
errorMessage.append( QString::fromStdWString( iter->_ ).toLocal8Bit() );
errorMessage.append( "保存失败,提示信息:" );
errorMessage.append( error.what() );
errorMessage.append( notifyNo );
errorMessage.append( "\n保存失败,提示信息:" );
errorMessage.append( QString::fromLocal8Bit( error.what()).toStdString() );
OCI_Rollback( pConnection );
OCI_ConnectionFree( pConnection );
OCI_Cleanup();
throw runtime_error( errorMessage );

View File

@@ -1,2 +1,3 @@

#include "UserInfo.h"
#include "UserInfo.h"

View File

@@ -1,4 +1,4 @@
//用户信息相关
//用户信息相关
#pragma once
#include <QString>
@@ -6,12 +6,12 @@ class UserInfo
{
public:
UserInfo( const std::string & staffP13,
const std::string & staffName,
const std::string & staffPost )
: staff_p13( staffP13 ),
staff_name( staffName ),
staff_post( staffPost )
UserInfo( std::string staffP13, std::string staffName, std::string staffPost, std::string staffPostCode )
: staff_p13( std::move(staffP13) ),
staff_name( std::move(staffName) ),
staff_post( std::move(staffPost) ),
staff_post_code( std::move(staffPostCode) )
{
}
@@ -19,14 +19,16 @@ public:
UserInfo( const UserInfo & other )
: staff_p13( other.staff_p13 ),
staff_name( other.staff_name ),
staff_post( other.staff_post )
staff_post( other.staff_post ),
staff_post_code( other.staff_post_code )
{
}
UserInfo( UserInfo && other )
: staff_p13( std::move(other.staff_p13) ),
staff_name( std::move(other.staff_name) ),
staff_post( std::move(other.staff_post) )
staff_post( std::move(other.staff_post) ),
staff_post_code( std::move(other.staff_post_code) )
{
}
@@ -34,9 +36,10 @@ public:
{
if ( this == &other )
return *this;
staff_p13 = other.staff_p13;
staff_name = other.staff_name;
staff_post = other.staff_post;
staff_p13 = other.staff_p13;
staff_name = other.staff_name;
staff_post = other.staff_post;
staff_post_code = other.staff_post_code;
return *this;
}
@@ -44,22 +47,14 @@ public:
{
if ( this == &other )
return *this;
staff_p13 = std::move( other.staff_p13 );
staff_name = std::move( other.staff_name );
staff_post = std::move( other.staff_post );
staff_p13 = std::move( other.staff_p13 );
staff_name = std::move( other.staff_name );
staff_post = std::move( other.staff_post );
staff_post_code = std::move( other.staff_post_code );
return *this;
}
friend void swap( UserInfo & lhs, UserInfo & rhs ) noexcept
{
using std::swap;
swap( lhs.staff_p13, rhs.staff_p13 );
swap( lhs.staff_name, rhs.staff_name );
swap( lhs.staff_post, rhs.staff_post );
}
std::string getStaffP13() const
{
return staff_p13;
@@ -90,8 +85,20 @@ public:
staff_post = staffPost;
}
std::string getStaffPostCode() const
{
return staff_post_code;
}
void setStaffPostCode( const std::string & staffPostCode )
{
staff_post_code = staffPostCode;
}
private:
std::string staff_p13;
std::string staff_name;
std::string staff_post;
std::string staff_post_code;
};

View File

@@ -1,13 +1,15 @@
#include "query_user.h"
#include "query_user.h"
#include <stdexcept>
#include <ocilib.h>
#include "../../db/ocilib/db_oper.h"
#include "../Datastructure/UserInfo/UserInfo.h"
#include <ocilib.hpp>
using namespace std;
string ERROR_MESSAGE_USERERROR = "您的p13账号无权使用该系统\n请联系工作组添加!";
UserInfo queryUserInfo( const string & userName,
const string & password,
const string & tnsName,
@@ -20,7 +22,7 @@ UserInfo queryUserInfo( const string & userName,
string sqlQueryStaff =
"SELECT a.staff_p13, a.staff_name, b.staff_post \n"
"SELECT a.staff_p13, a.staff_name, b.staff_post_code, b.staff_post \n"
"FROM staff_info a, \n"
"staff_post_code b \n"
"WHERE a.staff_post_code = b.staff_post_code \n"
@@ -54,18 +56,18 @@ UserInfo queryUserInfo( const string & userName,
{
pStmt = OCI_StatementCreate( pConn );
OCI_Prepare(pStmt, sqlQueryStaff.c_str());
OCI_Prepare( pStmt, sqlQueryStaff.c_str() );
OCI_AllowRebinding( pStmt, true );
OCI_BindString( pStmt, ":p13", const_cast<otext*>(staffP13.c_str()), staffP13.size() );
OCI_Execute( pStmt );
pResult = OCI_GetResultset( pStmt );
//检查结果集,如果没有返回,则说明没有此用户
if ( OCI_FetchNext( pResult ) == false )
{
throw runtime_error( "用户不存在!" );
throw runtime_error( ERROR_MESSAGE_USERERROR );
}
}
catch ( runtime_error & error )
@@ -78,9 +80,10 @@ UserInfo queryUserInfo( const string & userName,
UserInfo info( OCI_GetString( pResult, 1 ),
OCI_GetString( pResult, 2 ),
OCI_GetString( pResult, 3 ) );
OCI_GetString( pResult, 4 ),
OCI_GetString( pResult, 3 ));
OCI_ConnectionFree(pConn);
OCI_ConnectionFree( pConn );
OCI_Cleanup();
return info;

View File

@@ -1,4 +1,4 @@
//查询用户、权限等相关数据
//查询用户、权限等相关数据
#pragma once
#include <iostream>