修改医生基本信息
parent
e234e1a946
commit
1887aee2fb
|
@ -0,0 +1,171 @@
|
||||||
|
|
||||||
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using NPOI.OpenXmlFormats.Wordprocessing;
|
||||||
|
using NPOI.XWPF.UserModel;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Application.Service;
|
||||||
|
|
||||||
|
public static class NpoiWordHelper
|
||||||
|
{
|
||||||
|
public static async Task<IActionResult> TemplateExportWordAsync(string code, object data, IRepository<CommonDocument>? _commonDocumentRepository, IWebHostEnvironment _hostEnvironment)
|
||||||
|
{
|
||||||
|
//var (physicalPath, fileNmae) = await FileStoreHelper.GetCommonDocPhysicalFilePathAsync(_hostEnvironment, _commonDocumentRepository, code);
|
||||||
|
|
||||||
|
var physicalPath = code;
|
||||||
|
|
||||||
|
|
||||||
|
using (FileStream stream = File.OpenRead(physicalPath))
|
||||||
|
{
|
||||||
|
XWPFDocument doc = new XWPFDocument(stream);
|
||||||
|
//遍历段落
|
||||||
|
foreach (var para in doc.Paragraphs)
|
||||||
|
{
|
||||||
|
ReplaceKey(para, data);
|
||||||
|
}
|
||||||
|
//遍历表格
|
||||||
|
var tables = doc.Tables;
|
||||||
|
foreach (var table in tables)
|
||||||
|
{
|
||||||
|
//ReplaceTableKey(table, data, "Data");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var table in tables)
|
||||||
|
{
|
||||||
|
foreach (var row in table.Rows)
|
||||||
|
{
|
||||||
|
foreach (var cell in row.GetTableCells())
|
||||||
|
{
|
||||||
|
foreach (var para in cell.Paragraphs)
|
||||||
|
{
|
||||||
|
ReplaceKey(para, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FileStream out1 = new FileStream("table.docx", FileMode.Create);
|
||||||
|
doc.Write(out1);
|
||||||
|
out1.Close();
|
||||||
|
return new FileStreamResult(stream, "application/msword")
|
||||||
|
{
|
||||||
|
FileDownloadName = $"replaced_{DateTime.Now.ToString("yyyyMMddHHmmss")}.docx"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ReplaceKey(XWPFParagraph para, object model)
|
||||||
|
{
|
||||||
|
string text = para.ParagraphText;
|
||||||
|
|
||||||
|
Type t = model.GetType();
|
||||||
|
PropertyInfo[] pi = t.GetProperties();
|
||||||
|
foreach (PropertyInfo p in pi)
|
||||||
|
{
|
||||||
|
//$$与模板中$$对应,也可以改成其它符号,比如{$name},务必做到唯一
|
||||||
|
if (text.Contains("$" + p.Name + "$"))
|
||||||
|
{
|
||||||
|
text = text.Replace("$" + p.Name + "$", p.GetValue(model)?.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//var runs = para.Runs;
|
||||||
|
//string styleid = para.Style;
|
||||||
|
//for (int i = 0; i < runs.Count; i++)
|
||||||
|
//{
|
||||||
|
// var run = runs[i];
|
||||||
|
// text = run.ToString();
|
||||||
|
// Type t = model.GetType();
|
||||||
|
// PropertyInfo[] pi = t.GetProperties();
|
||||||
|
// foreach (PropertyInfo p in pi)
|
||||||
|
// {
|
||||||
|
// //$$与模板中$$对应,也可以改成其它符号,比如{$name},务必做到唯一
|
||||||
|
// if (text.Contains("$" + p.Name + "$"))
|
||||||
|
// {
|
||||||
|
// text = text.Replace("$" + p.Name + "$", p.GetValue(model)?.ToString());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// runs[i].SetText(text, 0);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 替换表格Key
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="table"></param>
|
||||||
|
/// <param name="list"></param>
|
||||||
|
/// <param name="field"></param>
|
||||||
|
|
||||||
|
private static void ReplaceTableKey(XWPFTable table, IList list, String field)
|
||||||
|
{
|
||||||
|
List<XWPFParagraph> paras = new List<XWPFParagraph>();
|
||||||
|
// 获取最后一行数据,最后一行设置值
|
||||||
|
Int32 iLastRowIndex = 0;
|
||||||
|
for (int iIndex = 0; iIndex < table.Rows.Count; iIndex++)
|
||||||
|
{
|
||||||
|
if (iIndex == table.Rows.Count - 1)
|
||||||
|
{
|
||||||
|
iLastRowIndex = iIndex;
|
||||||
|
foreach (var cell in table.Rows[iIndex].GetTableCells())
|
||||||
|
{
|
||||||
|
foreach (var para in cell.Paragraphs)
|
||||||
|
{
|
||||||
|
paras.Add(para);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 删除最后一行
|
||||||
|
table.RemoveRow(iLastRowIndex);
|
||||||
|
|
||||||
|
for (int iIndex = 0; iIndex < list.Count; iIndex++)
|
||||||
|
{
|
||||||
|
object data = list[iIndex];
|
||||||
|
Type t = data.GetType();
|
||||||
|
PropertyInfo[] pi = t.GetProperties();
|
||||||
|
// 表增加行
|
||||||
|
XWPFTableRow m_row = table.CreateRow();
|
||||||
|
CT_Row m_NewRow = new CT_Row();
|
||||||
|
String text = String.Empty;
|
||||||
|
Int32 jIndex = 0;
|
||||||
|
paras.ForEach(para =>
|
||||||
|
{
|
||||||
|
text = para.ParagraphText;
|
||||||
|
foreach (PropertyInfo p in pi)
|
||||||
|
{
|
||||||
|
if (text.Contains("$" + field + "." + p.Name + "$"))
|
||||||
|
{
|
||||||
|
m_row.GetCell(jIndex).SetText(p.GetValue(data, null).ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jIndex++;
|
||||||
|
});
|
||||||
|
m_row = new XWPFTableRow(m_NewRow, table);
|
||||||
|
table.AddRow(m_row);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -64,7 +64,6 @@
|
||||||
<PackageReference Include="AutoMapper.Collection.EntityFrameworkCore" Version="8.0.0" />
|
<PackageReference Include="AutoMapper.Collection.EntityFrameworkCore" Version="8.0.0" />
|
||||||
<PackageReference Include="BeetleX.BNR" Version="1.0.1" />
|
<PackageReference Include="BeetleX.BNR" Version="1.0.1" />
|
||||||
<PackageReference Include="Castle.Core.AsyncInterceptor" Version="2.1.0" />
|
<PackageReference Include="Castle.Core.AsyncInterceptor" Version="2.1.0" />
|
||||||
<PackageReference Include="DocX.Core" Version="0.4.1" />
|
|
||||||
<PackageReference Include="EasyCaching.Interceptor.AspectCore" Version="1.6.0" />
|
<PackageReference Include="EasyCaching.Interceptor.AspectCore" Version="1.6.0" />
|
||||||
<PackageReference Include="ExcelDataReader" Version="3.6.0" />
|
<PackageReference Include="ExcelDataReader" Version="3.6.0" />
|
||||||
<PackageReference Include="ExcelDataReader.DataSet" Version="3.6.0" />
|
<PackageReference Include="ExcelDataReader.DataSet" Version="3.6.0" />
|
||||||
|
@ -96,6 +95,7 @@
|
||||||
<TreatAsUsed>true</TreatAsUsed>
|
<TreatAsUsed>true</TreatAsUsed>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
|
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
|
||||||
|
<PackageReference Include="NPOI" Version="2.5.6" />
|
||||||
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.0" />
|
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.0" />
|
||||||
<PackageReference Include="Quartz" Version="3.4.0" />
|
<PackageReference Include="Quartz" Version="3.4.0" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
|
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
|
||||||
|
|
|
@ -34,6 +34,14 @@
|
||||||
主要为了 处理项目结束 锁库,不允许操作
|
主要为了 处理项目结束 锁库,不允许操作
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.NpoiWordHelper.ReplaceTableKey(NPOI.XWPF.UserModel.XWPFTable,System.Collections.IList,System.String)">
|
||||||
|
<summary>
|
||||||
|
替换表格Key
|
||||||
|
</summary>
|
||||||
|
<param name="table"></param>
|
||||||
|
<param name="list"></param>
|
||||||
|
<param name="field"></param>
|
||||||
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.Service.TaskAllocationRuleService">
|
<member name="T:IRaCIS.Core.Application.Service.TaskAllocationRuleService">
|
||||||
<summary>
|
<summary>
|
||||||
分配规则
|
分配规则
|
||||||
|
@ -335,6 +343,7 @@
|
||||||
重阅原任务跟踪处理 只会在同意的时候调用这个
|
重阅原任务跟踪处理 只会在同意的时候调用这个
|
||||||
</summary>
|
</summary>
|
||||||
<param name="origenalTask"></param>
|
<param name="origenalTask"></param>
|
||||||
|
<param name="agreeReReadingCommand"></param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.SetReReadingOrBackInfluenceAnalysisAsync(System.Guid)">
|
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.SetReReadingOrBackInfluenceAnalysisAsync(System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
|
@ -348,6 +357,7 @@
|
||||||
确认重阅与否 1同意 2 拒绝
|
确认重阅与否 1同意 2 拒绝
|
||||||
</summary>
|
</summary>
|
||||||
<param name="agreeReReadingCommand"></param>
|
<param name="agreeReReadingCommand"></param>
|
||||||
|
<param name="_visitTaskCommonService"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.PMSetTaskBack(System.Guid,System.Guid)">
|
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.PMSetTaskBack(System.Guid,System.Guid)">
|
||||||
|
|
|
@ -455,6 +455,9 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public Guid? HospitalId { get; set; } = Guid.Empty;
|
public Guid? HospitalId { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
|
public string Physician { get; set; } = string.Empty;
|
||||||
|
public string PhysicianCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -636,6 +639,9 @@ namespace IRaCIS.Application.Contracts
|
||||||
public bool IsVirtual { get; set; }
|
public bool IsVirtual { get; set; }
|
||||||
|
|
||||||
public string BlindName { get; set; } = String.Empty;
|
public string BlindName { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
public string BlindNameCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ResumeConfirmDTO
|
public class ResumeConfirmDTO
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
public Guid? PhaseId { get; set; }
|
public Guid? PhaseId { get; set; }
|
||||||
public string EvaluationContent { get; set; } = String.Empty;
|
public string EvaluationContent { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
public int VisitReadingCount { get; set; }
|
||||||
|
|
||||||
//public string Term { get; set; }
|
//public string Term { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
using BeetleX.BNR;
|
using BeetleX.BNR;
|
||||||
|
using IRaCIS.Core.Application.Service;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Caching.Distributed;
|
using Microsoft.Extensions.Caching.Distributed;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
@ -48,18 +51,57 @@ namespace IRaCIS.Application.Services
|
||||||
//var needAddVisitList = await _repository.Where<VisitTask>(t => t.TrialId == Guid.Empty).DistinctBy(t => t.VisitTaskNum).ToListAsync();
|
//var needAddVisitList = await _repository.Where<VisitTask>(t => t.TrialId == Guid.Empty).DistinctBy(t => t.VisitTaskNum).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
await _repository.BatchUpdateAsync<VisitTask>(t => t.Id==Guid.Empty, u => new VisitTask() {
|
await _repository.BatchUpdateAsync<VisitTask>(t => t.Id == Guid.Empty, u => new VisitTask()
|
||||||
|
{
|
||||||
SuggesteFinishedTime = u.IsUrgent ? DateTime.Now.AddDays(2) : DateTime.Now.AddDays(7),
|
SuggesteFinishedTime = u.IsUrgent ? DateTime.Now.AddDays(2) : DateTime.Now.AddDays(7),
|
||||||
|
|
||||||
Code = u.Code+1
|
Code = u.Code + 1
|
||||||
});
|
});
|
||||||
|
|
||||||
return _userInfo.LocalIp;
|
return _userInfo.LocalIp;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public string Get(TestModel testModel)
|
|
||||||
|
private static Dictionary<string, string> _replacePatterns = new Dictionary<string, string>()
|
||||||
|
{
|
||||||
|
{ "test", "Atlanta Knight" },
|
||||||
|
{ "GAME_TIME", "7:30pm" },
|
||||||
|
{ "GAME_NUMBER", "161" },
|
||||||
|
{ "DATE", "October 18 2018" },
|
||||||
|
};
|
||||||
|
|
||||||
|
private static string ReplaceFunc(string findStr)
|
||||||
{
|
{
|
||||||
|
if (_replacePatterns.ContainsKey(findStr))
|
||||||
|
{
|
||||||
|
return _replacePatterns[findStr];
|
||||||
|
}
|
||||||
|
return findStr;
|
||||||
|
}
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IActionResult> Get(TestModel testModel)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Load a document.
|
||||||
|
//using (var document = DocX.Load(Path.Combine(_hostEnvironment.ContentRootPath, "ReplaceText.docx")))
|
||||||
|
//{
|
||||||
|
// // Check if all the replace patterns are used in the loaded document.
|
||||||
|
// if (document.FindUniqueByPattern(@"<[\w \=]{4,}>", RegexOptions.IgnoreCase).Count > 0)
|
||||||
|
// {
|
||||||
|
// // Do the replacement of all the found tags and with green bold strings.
|
||||||
|
// //for (int i = 0; i < _replacePatterns.Count; ++i)
|
||||||
|
// //{
|
||||||
|
// // document.ReplaceText("<(.*?)>", TestService.ReplaceFunc, false, RegexOptions.IgnoreCase, new Formatting() { Bold = true, FontColor = System.Drawing.Color.Green });
|
||||||
|
// //}
|
||||||
|
// // Save this document to disk.
|
||||||
|
|
||||||
|
// document.ReplaceText("test", "jfdksajfkljflsdjf", false, RegexOptions.IgnoreCase, new Formatting() { Bold = true, FontColor = System.Drawing.Color.Green });
|
||||||
|
// document.SaveAs("ReplacedText.docx");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//}
|
||||||
|
return await NpoiWordHelper.TemplateExportWordAsync(Path.Combine(_hostEnvironment.ContentRootPath, "ReplaceText.docx"), new {test="xiugai",ZZZZ="ModiffyZZZZ"},null,_hostEnvironment);
|
||||||
|
|
||||||
//_cache.SetString("test" , "cacheStr");
|
//_cache.SetString("test" , "cacheStr");
|
||||||
|
|
||||||
|
@ -102,7 +144,7 @@ namespace IRaCIS.Application.Services
|
||||||
//var d = _dicRepository.UpdateFromDTOAsync(new AddOrEditBasicDic() { Id = Guid.Parse("60d86683-c33b-4349-b672-08da1e91b622"), ParentId = null, ChildGroup = null, Code = null }, true, true).Result;
|
//var d = _dicRepository.UpdateFromDTOAsync(new AddOrEditBasicDic() { Id = Guid.Parse("60d86683-c33b-4349-b672-08da1e91b622"), ParentId = null, ChildGroup = null, Code = null }, true, true).Result;
|
||||||
//var a = 123;
|
//var a = 123;
|
||||||
|
|
||||||
var b = _localizer["test{0}", "测试"];
|
//var b = _localizer["test{0}", "测试"];
|
||||||
//return _localizer["test{0}", "测试"];
|
//return _localizer["test{0}", "测试"];
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,8 +153,8 @@ namespace IRaCIS.Application.Services
|
||||||
//var list2 = _repository.Where<VisitTask>(t => t.Id == Guid.NewGuid()).Select(t => t.SourceSubjectVisit).ToList();
|
//var list2 = _repository.Where<VisitTask>(t => t.Id == Guid.NewGuid()).Select(t => t.SourceSubjectVisit).ToList();
|
||||||
|
|
||||||
//var list3 = _repository.Where<VisitTask>(t => t.Id == Guid.NewGuid()).SelectMany(t => t.SourceSubjectVisit.VisitTaskList).ToList();
|
//var list3 = _repository.Where<VisitTask>(t => t.Id == Guid.NewGuid()).SelectMany(t => t.SourceSubjectVisit.VisitTaskList).ToList();
|
||||||
var list2 = _repository.Where<Subject>(t => t.Id == Guid.NewGuid()).SelectMany(t => t.SubjectVisitTaskList).ToList();
|
//var list2 = _repository.Where<Subject>(t => t.Id == Guid.NewGuid()).SelectMany(t => t.SubjectVisitTaskList).ToList();
|
||||||
return _userInfo.LocalIp;
|
//return _userInfo.LocalIp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,8 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public string DepartmentOther { get; set; } = string.Empty;
|
public string DepartmentOther { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
public string Physician { get; set; } = string.Empty;
|
||||||
|
public string PhysicianCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
public Guid? RankId { get; set; } = Guid.Empty;
|
public Guid? RankId { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
|
@ -186,5 +188,10 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public bool IsVirtual { get; set; }
|
public bool IsVirtual { get; set; }
|
||||||
|
|
||||||
public string BlindName { get; set; }
|
public string BlindName { get; set; }
|
||||||
|
|
||||||
|
public string BlindNameCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
public string BlindPublications { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,5 +30,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public DateTime CreateTime { get; set; } = DateTime.Now;
|
public DateTime CreateTime { get; set; } = DateTime.Now;
|
||||||
public Guid UpdateUserId { get; set; }
|
public Guid UpdateUserId { get; set; }
|
||||||
public DateTime UpdateTime { get; set; }
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
|
public int VisitReadingCount { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue