此文章所写的接口中出现的例子
//我们根据前端所传的ID为条件,执行SQL 查找数据,写入Word中
public ReturnResponse WordFile(string UserInfoID)
{
ReturnResponse _R = new ReturnResponse();
Base_LogEntity _L = new Base_LogEntity();
#endregion
var wordPath = @"\Word\模板.docx";
//var wordPath = Config.GetValue("WaterReportWord");
string newTempletePath = FileDownHelper.MapPathFile(wordPath);
FileStream fileStream = new FileStream(newTempletePath, FileMode.Open, FileAccess.Read);
//此处需要引入NPOI
XWPFDocument myDoc = new XWPFDocument(fileStream);
try
{
// 获取用户信息
var jsonData = "{ 'UserInfoID':'" + UserInfoID + "'}";
//根据ID查找用户的信息
UserInfoEntity userEntity = userInfoIBLL.GetEntity(UserInfoID);
// 获取结果信息
DetectOddEntity deteEntity = detectOddIBLL.GetAllEntity(jsonData).ToList().FirstOrDefault();
#region 写入数据
string temptext = string.Empty, itemTxt = string.Empty;
//条码号