Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
ctltool
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李定达
ctltool
Commits
4728bcd4
Commit
4728bcd4
authored
Oct 30, 2020
by
OFFICE\dingda.li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.mcd国内版本第一次提交为台湾版本
parent
fdc12269
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
32 deletions
+34
-32
main.cpp
+34
-32
No files found.
main.cpp
View file @
4728bcd4
...
...
@@ -287,7 +287,7 @@ void CopyFileToMan(QString day, QString path, QString managerip)
{
QLOG_INFO
()
<<
tmp
.
absoluteFilePath
();
if
(
tmp
.
fileName
().
endsWith
(
".xml"
,
Qt
::
CaseInsensitive
)
/*|| tmp.fileName().endsWith(".DAT", Qt::CaseInsensitive)*/
)
if
(
tmp
.
fileName
().
endsWith
(
".xml"
,
Qt
::
CaseInsensitive
)
||
tmp
.
fileName
().
endsWith
(
".DAT"
,
Qt
::
CaseInsensitive
)
)
{
QFile
file
(
managerpath
+
"
\\
"
+
tmp
.
fileName
());
file
.
remove
();
...
...
@@ -396,18 +396,18 @@ bool havazipFile(QString days, QString storeid, QString dirpath, QString &aons,
dir
.
setSorting
(
QDir
::
DirsFirst
);
QFileInfoList
list
=
dir
.
entryInfoList
();
//
QString zipfilename1 = QString("CUPS_Records_*.DAT");
QString
zipfilename2
=
QString
(
"NPCSWC_XML_
TW
_*.zip"
);
QString
zipfilename1
=
QString
(
"CUPS_Records_*.DAT"
);
QString
zipfilename2
=
QString
(
"NPCSWC_XML_
CN
_*.zip"
);
QString
years
=
days
.
right
(
6
);
QLOG_INFO
()
<<
"#years : "
<<
years
;
//
QString myanosfilename = "AONS" + years + "01MDALLVIP" + storeid;
QString
zipfilename3
=
QString
(
"SOS_XML_
TW
_*.zip"
);
QString
myanosfilename
=
"AONS"
+
years
+
"01MDALLVIP"
+
storeid
;
QString
zipfilename3
=
QString
(
"SOS_XML_
CN
_*.zip"
);
//
QRegExp exp1(zipfilename1);
//
exp1.setPatternSyntax(QRegExp::Wildcard);
QRegExp
exp1
(
zipfilename1
);
exp1
.
setPatternSyntax
(
QRegExp
::
Wildcard
);
QRegExp
exp2
(
zipfilename2
);
exp2
.
setPatternSyntax
(
QRegExp
::
Wildcard
);
QRegExp
exp3
(
zipfilename3
);
...
...
@@ -415,24 +415,24 @@ bool havazipFile(QString days, QString storeid, QString dirpath, QString &aons,
foreach
(
QFileInfo
tmp
,
list
)
{
//
if(exp1.exactMatch(tmp.fileName()) == true)
//
{
//
aons = tmp.absoluteFilePath();
//
aons1 = tmp.fileName();
//
QFile file(aons);
if
(
exp1
.
exactMatch
(
tmp
.
fileName
())
==
true
)
{
aons
=
tmp
.
absoluteFilePath
();
aons1
=
tmp
.
fileName
();
QFile
file
(
aons
);
//
bool rlt = file.copy(aons, dirpath + "/" + myanosfilename);
bool
rlt
=
file
.
copy
(
aons
,
dirpath
+
"/"
+
myanosfilename
);
//
QLOG_WARN() << "find file : " << tmp.absoluteFilePath();
//
QLOG_WARN() << "copy file : " << aons << " to " << dirpath + "/" + myanosfilename << "; result : " << rlt;
QLOG_WARN
()
<<
"find file : "
<<
tmp
.
absoluteFilePath
();
QLOG_WARN
()
<<
"copy file : "
<<
aons
<<
" to "
<<
dirpath
+
"/"
+
myanosfilename
<<
"; result : "
<<
rlt
;
//
aons = dirpath + "/" + myanosfilename;
//
aons1 = myanosfilename;
aons
=
dirpath
+
"/"
+
myanosfilename
;
aons1
=
myanosfilename
;
//
QLOG_WARN() << "aons:" << aons << "aons1:" << aons1;
QLOG_WARN
()
<<
"aons:"
<<
aons
<<
"aons1:"
<<
aons1
;
//
continue;
//
}
continue
;
}
if
(
exp2
.
exactMatch
(
tmp
.
fileName
())
==
true
)
{
...
...
@@ -455,7 +455,9 @@ bool havazipFile(QString days, QString storeid, QString dirpath, QString &aons,
if
(
/*aons.isEmpty() ||*/
sos
.
isEmpty
()
||
npcswc
.
isEmpty
())
{
QLOG_WARN
()
<<
"not found zip file or zip file error, clear dir : "
<<
dirpath
;
ClearDirForPath
(
dirpath
);
QLOG_WARN
()
<<
"sos"
<<
sos
;
QLOG_WARN
()
<<
"npcswc"
<<
npcswc
;
//ClearDirForPath(dirpath);
return
false
;
}
...
...
@@ -1152,13 +1154,13 @@ int main(int argc, char *argv[])
}
//
QLOG_INFO() << "begin upload : " << cvanos << "; file name : " << cvanos1;
QLOG_INFO
()
<<
"begin upload : "
<<
cvanos
<<
"; file name : "
<<
cvanos1
;
//
if(FMNetWork::HttpPut(ftp2ur+cvanos1, ftp2un, ftp2pw, cvanos) == false)
//
{
//
QLOG_ERROR() << "upload failed : " << cvanos;
//
continue;
//
}
if
(
FMNetWork
::
HttpPut
(
ftp2ur
+
cvanos1
,
ftp2un
,
ftp2pw
,
cvanos
)
==
false
)
{
QLOG_ERROR
()
<<
"upload failed : "
<<
cvanos
;
continue
;
}
QLOG_INFO
()
<<
"upload success --------------"
;
...
...
@@ -1191,11 +1193,11 @@ int main(int argc, char *argv[])
QDir
daysdir
;
daysdir
.
mkdir
(
daysstr
);
if
(
GetFile
(
days
,
mystoreid
)
==
false
)
{
QLOG_ERROR
()
<<
"GetFile failed"
;
continue
;
}
//
if(GetFile(days, mystoreid) == false)
//
{
//
QLOG_ERROR() << "GetFile failed";
//
continue;
//
}
CopyXMLToDir
(
QString
(
"C:/np6data/newdata/temp"
),
QString
(
"D:
\\
fm
\\
Gomax
\\
ctllist
\\
"
)
+
days
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment