Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
b06ef206
Commit
b06ef206
authored
Jan 05, 2023
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
e8c7b1ee
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
12 deletions
+36
-12
WordTemplateHelper.cs
Edu.Common/Plugin/WordTemplateHelper.cs
+5
-10
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+29
-0
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+1
-1
appsettings.json
Edu.WebApi/appsettings.json
+1
-1
No files found.
Edu.Common/Plugin/WordTemplateHelper.cs
View file @
b06ef206
...
@@ -17,9 +17,8 @@ namespace Edu.Common.Plugin
...
@@ -17,9 +17,8 @@ namespace Edu.Common.Plugin
/// <param name="templatePath">模板文件</param>
/// <param name="templatePath">模板文件</param>
/// <param name="newFilePath">新文件保存路径</param>
/// <param name="newFilePath">新文件保存路径</param>
/// <returns></returns>
/// <returns></returns>
public
static
b
ool
UrlToWord
(
string
url
,
string
templatePath
,
string
newFil
ePath
)
public
static
b
yte
[]
UrlToWord
(
string
url
,
string
templat
ePath
)
{
{
FileStream
pFileStream
=
null
;
try
try
{
{
WebRequest
req
=
WebRequest
.
Create
(
url
);
WebRequest
req
=
WebRequest
.
Create
(
url
);
...
@@ -38,24 +37,20 @@ namespace Edu.Common.Plugin
...
@@ -38,24 +37,20 @@ namespace Edu.Common.Plugin
NodeCollection
allTables
=
doc
.
GetChildNodes
(
NodeType
.
Table
,
true
);
NodeCollection
allTables
=
doc
.
GetChildNodes
(
NodeType
.
Table
,
true
);
MemoryStream
firstStream
=
new
MemoryStream
();
MemoryStream
firstStream
=
new
MemoryStream
();
doc
.
Save
(
firstStream
,
SaveFormat
.
Doc
);
doc
.
Save
(
firstStream
,
SaveFormat
.
Doc
);
var
pReadByte
=
firstStream
.
GetBuffer
();
return
firstStream
.
GetBuffer
();
pFileStream
=
new
FileStream
(
newFilePath
,
FileMode
.
OpenOrCreate
);
pFileStream
.
Write
(
pReadByte
,
0
,
pReadByte
.
Length
);
}
}
catch
catch
{
{
return
false
;
}
}
finally
finally
{
{
if
(
pFileStream
!=
null
)
pFileStream
.
Close
();
}
}
return
true
;
return
null
;
}
}
/// <summary>
#
endregion
#
endregion
}
}
...
...
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
b06ef206
...
@@ -1320,5 +1320,34 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -1320,5 +1320,34 @@ namespace Edu.WebApi.Controllers.Course
}
}
#
endregion
#
endregion
/// <summary>
/// 下载学员跟进信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Obsolete
]
public
FileContentResult
DownLoadBank
()
{
List
<
ExcelDataSource
>
slist
=
new
List
<
ExcelDataSource
>();
string
BankIds
=
base
.
ParmJObj
.
GetStringValue
(
"BankId"
);
string
fileName
=
DateTime
.
Now
.
Ticks
+
".doc"
;
try
{
string
url
=
Common
.
Config
.
UploadSiteUrl
+
"/Home/JieHeQuestion?showType=1&BankIds="
+
BankIds
;
string
basepath
=
AppContext
.
BaseDirectory
;
string
tempPath
=
basepath
+
"\\upfile\\Template\\"
;
string
path_server
=
tempPath
+
"template.doc"
;
var
byteData
=
Common
.
Plugin
.
WordTemplateHelper
.
UrlToWord
(
url
,
path_server
);
return
File
(
byteData
,
"application/octet-stream"
,
fileName
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"DownLoadBank"
);
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
fileName
);
}
}
}
}
}
}
\ No newline at end of file
Edu.WebApi/Controllers/User/LoginController.cs
View file @
b06ef206
...
@@ -63,7 +63,7 @@ namespace Edu.WebApi.Controllers.User
...
@@ -63,7 +63,7 @@ namespace Edu.WebApi.Controllers.User
[
AllowAnonymous
]
[
AllowAnonymous
]
public
ApiResult
Test
()
public
ApiResult
Test
()
{
{
TestMethod
(
);
new
OrderModule
().
GetClassNameList
(
"1337"
);
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
...
...
Edu.WebApi/appsettings.json
View file @
b06ef206
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
"IsSendMsg"
:
2
,
"IsSendMsg"
:
2
,
"AllowedHosts"
:
"*"
,
"AllowedHosts"
:
"*"
,
"OpenValidation"
:
"False"
,
"OpenValidation"
:
"False"
,
"UploadSiteUrl"
:
"http://192.168.10.
46
:8120"
,
"UploadSiteUrl"
:
"http://192.168.10.
128
:8120"
,
"ViewFileSiteUrl"
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com"
,
"ViewFileSiteUrl"
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com"
,
"ErpViewFileSiteUrl"
:
"http://imgfile.oytour.com"
,
"ErpViewFileSiteUrl"
:
"http://imgfile.oytour.com"
,
"ErpUrl"
:
"http://localhost:8181/#"
,
"ErpUrl"
:
"http://localhost:8181/#"
,
...
...
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