|
@@ -38,9 +38,9 @@ namespace wispro.sp.winClient
|
|
{
|
|
{
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
- private CaseInfo getCaseInfo_files(string caseNo,out string draftFile,out string returnFile,out string finalFile)
|
|
|
|
|
|
+
|
|
|
|
+ private CaseInfo getCaseInfo_files(string caseNo, out string draftFile, out string returnFile, out string finalFile)
|
|
{
|
|
{
|
|
draftFile = null;
|
|
draftFile = null;
|
|
returnFile = null;
|
|
returnFile = null;
|
|
@@ -115,7 +115,7 @@ namespace wispro.sp.winClient
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -133,22 +133,22 @@ namespace wispro.sp.winClient
|
|
}
|
|
}
|
|
|
|
|
|
string draftFile = string.Empty;
|
|
string draftFile = string.Empty;
|
|
- string returnFile =string.Empty;
|
|
|
|
- string finalFile =string.Empty;
|
|
|
|
|
|
+ string returnFile = string.Empty;
|
|
|
|
+ string finalFile = string.Empty;
|
|
|
|
|
|
string CaseNo = row["我方文号"].ToString();
|
|
string CaseNo = row["我方文号"].ToString();
|
|
|
|
|
|
- var isExistResp = new APIService().CaseExist(CaseNo);
|
|
|
|
|
|
+ var isExistResp = await new APIService().CaseExist(CaseNo);
|
|
|
|
|
|
- isExistResp.Wait();
|
|
|
|
|
|
+ //isExistResp.Wait();
|
|
|
|
|
|
- if (isExistResp.Result)
|
|
|
|
|
|
+ if (isExistResp)
|
|
{
|
|
{
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
- CaseInfo caseInfo = getCaseInfo_files(CaseNo, out draftFile,out returnFile, out finalFile);
|
|
|
|
-
|
|
|
|
|
|
+ CaseInfo caseInfo = getCaseInfo_files(CaseNo, out draftFile, out returnFile, out finalFile);
|
|
|
|
+
|
|
|
|
|
|
int i = (string.IsNullOrEmpty(draftFile) ? 0 : 1) +
|
|
int i = (string.IsNullOrEmpty(draftFile) ? 0 : 1) +
|
|
(string.IsNullOrEmpty(returnFile) ? 0 : 1) +
|
|
(string.IsNullOrEmpty(returnFile) ? 0 : 1) +
|
|
@@ -167,10 +167,10 @@ namespace wispro.sp.winClient
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void CompareFiles(string draftFile, string returnFile, string finalFile, CaseInfo caseInfo)
|
|
|
|
|
|
+ private void CompareFiles(string draftFile, string returnFile, string finalFile, CaseInfo caseInfo)
|
|
{
|
|
{
|
|
string strExtractPath = @"c:\temp";
|
|
string strExtractPath = @"c:\temp";
|
|
- string tmpdraftFile = ExtractFile(draftFile,0,strExtractPath);
|
|
|
|
|
|
+ string tmpdraftFile = ExtractFile(draftFile, 0, strExtractPath);
|
|
string tmpreturnFile = ExtractFile(returnFile, 1, strExtractPath);
|
|
string tmpreturnFile = ExtractFile(returnFile, 1, strExtractPath);
|
|
string tmpfinalFile = ExtractFile(finalFile, 2, strExtractPath);
|
|
string tmpfinalFile = ExtractFile(finalFile, 2, strExtractPath);
|
|
|
|
|
|
@@ -178,7 +178,7 @@ namespace wispro.sp.winClient
|
|
{
|
|
{
|
|
CompareDocx docx = new CompareDocx();
|
|
CompareDocx docx = new CompareDocx();
|
|
docx.Compare(tmpdraftFile, tmpreturnFile);
|
|
docx.Compare(tmpdraftFile, tmpreturnFile);
|
|
- if(docx.FulltextResult.oldWordCount > 0)
|
|
|
|
|
|
+ if (docx.FulltextResult.oldWordCount > 0)
|
|
{
|
|
{
|
|
caseInfo.DRRFulltext = docx.FulltextResult;
|
|
caseInfo.DRRFulltext = docx.FulltextResult;
|
|
}
|
|
}
|
|
@@ -241,24 +241,24 @@ namespace wispro.sp.winClient
|
|
System.IO.File.Delete(finalFile);
|
|
System.IO.File.Delete(finalFile);
|
|
}
|
|
}
|
|
|
|
|
|
- if (System.IO.Directory.Exists(Path.Combine(strExtractPath,returnFile.Substring(0,returnFile.Length -4))))
|
|
|
|
|
|
+ if (System.IO.Directory.Exists(Path.Combine(strExtractPath, returnFile.Substring(0, returnFile.Length - 4))))
|
|
{
|
|
{
|
|
System.IO.Directory.Delete(Path.Combine(strExtractPath, returnFile.Substring(0, returnFile.Length - 4)), true);
|
|
System.IO.Directory.Delete(Path.Combine(strExtractPath, returnFile.Substring(0, returnFile.Length - 4)), true);
|
|
}
|
|
}
|
|
|
|
|
|
if (System.IO.Directory.Exists(Path.Combine(strExtractPath, draftFile.Substring(0, draftFile.Length - 4))))
|
|
if (System.IO.Directory.Exists(Path.Combine(strExtractPath, draftFile.Substring(0, draftFile.Length - 4))))
|
|
{
|
|
{
|
|
- System.IO.Directory.Delete(Path.Combine(strExtractPath, draftFile.Substring(0, draftFile.Length - 4)),true);
|
|
|
|
|
|
+ System.IO.Directory.Delete(Path.Combine(strExtractPath, draftFile.Substring(0, draftFile.Length - 4)), true);
|
|
}
|
|
}
|
|
if (System.IO.Directory.Exists(Path.Combine(strExtractPath, finalFile.Substring(0, finalFile.Length - 4))))
|
|
if (System.IO.Directory.Exists(Path.Combine(strExtractPath, finalFile.Substring(0, finalFile.Length - 4))))
|
|
{
|
|
{
|
|
- System.IO.Directory.Delete(Path.Combine(strExtractPath, finalFile.Substring(0, finalFile.Length - 4)),true);
|
|
|
|
|
|
+ System.IO.Directory.Delete(Path.Combine(strExtractPath, finalFile.Substring(0, finalFile.Length - 4)), true);
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
CaseInfo caseInfo;
|
|
CaseInfo caseInfo;
|
|
private void button1_Click(object sender, EventArgs e)
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
@@ -291,12 +291,7 @@ namespace wispro.sp.winClient
|
|
if (i > 1)
|
|
if (i > 1)
|
|
{
|
|
{
|
|
CompareFiles(draftFile, returnFile, finalFile, caseInfo);
|
|
CompareFiles(draftFile, returnFile, finalFile, caseInfo);
|
|
-
|
|
|
|
- for (int k = 0; k < 1; k++)
|
|
|
|
- {
|
|
|
|
- new APIService().SaveCompareResult(caseInfo);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ new APIService().SaveCompareResult(caseInfo);
|
|
}
|
|
}
|
|
|
|
|
|
comboBox1.SelectedIndex = 0;
|
|
comboBox1.SelectedIndex = 0;
|
|
@@ -356,7 +351,7 @@ namespace wispro.sp.winClient
|
|
|
|
|
|
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
|
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
{
|
|
- if (caseInfo != null )
|
|
|
|
|
|
+ if (caseInfo != null)
|
|
{
|
|
{
|
|
richTextBox1.Clear();
|
|
richTextBox1.Clear();
|
|
|
|
|
|
@@ -366,12 +361,12 @@ namespace wispro.sp.winClient
|
|
case 0:
|
|
case 0:
|
|
if (caseInfo.DRRAll != null)
|
|
if (caseInfo.DRRAll != null)
|
|
{
|
|
{
|
|
- strHtml = $"<b>所有文字比较:</b><br/><p>初稿与第一次返稿比较结果:</p><p>初稿文件字数:{caseInfo.DRRAll.oldWordCount}</p><p>删除文字数量:{caseInfo.DRRAll.DeleteCount}</p><p>插入文字数量:{caseInfo.DRRAll.InsertCount}</p><p>修改比率:{(caseInfo.DRRAll.diffRate * 100).ToString("0.0000")}%</p><p>文档语义相似度:{(caseInfo.DRRAll.TextSimilarity*100).ToString("0.0000")}%</p>";
|
|
|
|
|
|
+ strHtml = $"<b>所有文字比较:</b><br/><p>初稿与第一次返稿比较结果:</p><p>初稿文件字数:{caseInfo.DRRAll.oldWordCount}</p><p>删除文字数量:{caseInfo.DRRAll.DeleteCount}</p><p>插入文字数量:{caseInfo.DRRAll.InsertCount}</p><p>修改比率:{(caseInfo.DRRAll.diffRate * 100).ToString("0.0000")}%</p><p>文档语义相似度:{(caseInfo.DRRAll.TextSimilarity * 100).ToString("0.0000")}%</p>";
|
|
}
|
|
}
|
|
|
|
|
|
if (caseInfo.RFRAll != null)
|
|
if (caseInfo.RFRAll != null)
|
|
{
|
|
{
|
|
- strHtml = strHtml + $"<p></p><p>第一次返稿与定稿比较结果:</p><p>第一次返稿文件字数:{ caseInfo.RFRAll.oldWordCount}</p><p>删除文字数量:{caseInfo.RFRAll.DeleteCount}</p><p>插入文字数量:{caseInfo.RFRAll.InsertCount}</p><p>修改比率:{(caseInfo.RFRAll.diffRate * 100).ToString("0.0000")}%</p><p>文档语义相似度:{(caseInfo.RFRAll.TextSimilarity * 100).ToString("0.0000")}%</p>";
|
|
|
|
|
|
+ strHtml = strHtml + $"<p></p><p>第一次返稿与定稿比较结果:</p><p>第一次返稿文件字数:{caseInfo.RFRAll.oldWordCount}</p><p>删除文字数量:{caseInfo.RFRAll.DeleteCount}</p><p>插入文字数量:{caseInfo.RFRAll.InsertCount}</p><p>修改比率:{(caseInfo.RFRAll.diffRate * 100).ToString("0.0000")}%</p><p>文档语义相似度:{(caseInfo.RFRAll.TextSimilarity * 100).ToString("0.0000")}%</p>";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -483,7 +478,7 @@ namespace wispro.sp.winClient
|
|
private void button2_Click(object sender, EventArgs e)
|
|
private void button2_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
new Form1().ShowDialog();
|
|
new Form1().ShowDialog();
|
|
-
|
|
|
|
|
|
+
|
|
#region 选择文档比较
|
|
#region 选择文档比较
|
|
//OpenFileDialog openFileDialog = new OpenFileDialog();
|
|
//OpenFileDialog openFileDialog = new OpenFileDialog();
|
|
|
|
|
|
@@ -519,7 +514,7 @@ namespace wispro.sp.winClient
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- private void SaveResult(string strPath,CompareDocx draft_fristReturn)
|
|
|
|
|
|
+ private void SaveResult(string strPath, CompareDocx draft_fristReturn)
|
|
{
|
|
{
|
|
string strHtml = @"<!DOCTYPE html>
|
|
string strHtml = @"<!DOCTYPE html>
|
|
<html lang=""en"">
|
|
<html lang=""en"">
|
|
@@ -716,5 +711,10 @@ namespace wispro.sp.winClient
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void button3_Click(object sender, EventArgs e)
|
|
|
|
+ {
|
|
|
|
+ emlFileReader reader = new emlFileReader(@"D:\Users\luowen\Downloads\2f7e92c1-e009-4b19-ba8d-332e8f6f2ffc.eml");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|