Merge branch 'master' of http://47.108.235.38:8080/r/DocumentService
# Conflicts:
# DocumentServiceAPI.Application/DocumentServiceAPI.Application.xml
# DocumentServiceAPI.Web.Entry/appsettings.json
21个文件已修改
1个文件已删除
16个文件已添加
| | |
| | | /DocumentFile.Service/obj |
| | | /DocumentServiceAPI.Services/bin |
| | | /DocumentServiceAPI.Services/obj |
| | | ZcPayCore/obj/ |
| | | DocumentServiceApi.InitQMessage/obj/ |
| | | DocumentServiceAPI.Application/DocumentServiceAPI.Application.xml |
| | |
| | | PageModel pg = new PageModel(); |
| | | pg.PageSize = page.PageSize; |
| | | pg.PageIndex = page.PageIndex; |
| | | |
| | | |
| | | PageResult<Doc_Classification> result = new PageResult<Doc_Classification>(); |
| | | if (page.Status.HasValue) |
| | | { |
| | | result.Items = await _classificationService.GetPageListAsync(c => c.status ==page.Status && c.parent_code == page.Code, pg); |
| | | result.Items = await _classificationService.GetPageListAsync(c => c.status ==page.Status && c.parent_code == page.Code,pg,c=>c.sort_id,OrderByType.Asc); |
| | | } |
| | | else |
| | | { |
| | | result.Items = await _classificationService.GetPageListAsync(c => c.parent_code == page.Code, pg); |
| | | result.Items = await _classificationService.GetPageListAsync(c => c.parent_code == page.Code, pg, c => c.sort_id, OrderByType.Asc); |
| | | } |
| | | result.TotalCount = pg.TotalCount; |
| | | result.PageIndex = pg.PageIndex; |
| | |
| | | public async Task<IActionResult> PostItemList(DocClassificationSearch page) |
| | | { |
| | | var data = await _classificationService.GetListAsync(c => c.status == 1 && c.parent_code == page.Code); |
| | | return new JsonResult(data); |
| | | return new JsonResult(data.OrderBy(c=>c.sort_id).ToList()); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | doc.doc_classification_code = ""; |
| | | doc.is_system = false; |
| | | doc.parent_code = info.code; |
| | | doc.sort_id = 99; |
| | | doc.sort_id = info.sort; |
| | | doc.status = info.status; |
| | | doc.tenant_code = info.tenant_id; |
| | | |
| | |
| | | model.add_time = DateTime.Now; |
| | | model.doc_classification = info.name; |
| | | model.status = info.status; |
| | | model.sort_id = info.sort; |
| | | |
| | | msg = await _classificationService.UpdateAsync(model); |
| | | } |
| | |
| | | using DocumentServiceAPI.Application.DocManage.Dtos; |
| | | using DocumentServiceAPI.Application.DocManage.Services; |
| | | using DocumentServiceAPI.Application.ProjectInfo.Services; |
| | | using DocumentServiceAPI.Application.System.Services; |
| | | using DocumentServiceAPI.Model.cyDocumentModel; |
| | | using DocumentServiceAPI.Services.IService; |
| | | using DocumentServiceAPI.Utility; |
| | | using Microsoft.AspNetCore.Mvc.RazorPages; |
| | | using Microsoft.Extensions.Caching.Memory; |
| | | using System.Linq.Expressions; |
| | | |
| | | namespace DocumentServiceAPI.Application.DocManage |
| | |
| | | private readonly DocumentManageService _docManageService; |
| | | private readonly OrganizationService _organizationService; |
| | | private readonly FileManageService _fileManageService; |
| | | private readonly ProjectManageService _projectService; |
| | | private readonly DocAchievementService _achievementService; |
| | | private readonly IRedisCacheService _redisCache; |
| | | |
| | | |
| | | |
| | | public DocumentManageAppService(DocClassificationService classService, DocumentManageService docService, OrganizationService orgService,FileManageService fileManageService) |
| | | public DocumentManageAppService(DocClassificationService classService, DocumentManageService docService, OrganizationService orgService, |
| | | FileManageService fileManageService, ProjectManageService projectService, DocAchievementService achievementService, IRedisCacheService redisCase) |
| | | { |
| | | _classificationService = classService; |
| | | _docManageService = docService; |
| | | _organizationService = orgService; |
| | | _fileManageService = fileManageService; |
| | | _projectService = projectService; |
| | | _achievementService = achievementService; |
| | | |
| | | _redisCache = redisCase; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç¼è¾ææ¡£æ¶è®¾ç½®ææ¡£éå®ç¶æ |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns> |
| | | /// true:设置é宿å |
| | | /// false:éå®å¤±è´¥ï¼ææ¡£å·²è¢«éå® |
| | | /// </returns> |
| | | public bool SetDocLockStatus(DocLock_Submit_Dto model) |
| | | { |
| | | bool msg = true; |
| | | string key = model.tenant_id.ToString().PadLeft(4,'0') + "_" + model.id.ToString().PadLeft(8,'0'); |
| | | if (_redisCache.Get<Document_Lock_Dto>(key) != null) |
| | | { |
| | | msg = false; |
| | | } |
| | | else |
| | | { |
| | | Document_Lock_Dto lk = new Document_Lock_Dto(); |
| | | lk.doc_id = model.id; |
| | | lk.lock_time = DateTime.Now; |
| | | lk.lock_user = model.username; |
| | | lk.lock_user_id = model.userid; |
| | | lk.status = 0; |
| | | lk.tenant_id = model.tenant_id; |
| | | |
| | | var db= _redisCache.Add<Document_Lock_Dto>(key,lk ,-1); |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢é¡¹ç®ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="search"></param> |
| | | /// <returns></returns> |
| | | public async Task<IActionResult> PostProjectItemList(ProjectItemSearch search) |
| | | { |
| | | var data = await _projectService.GetListAsync();//.GetListAsync(c => c.TenantID == search.tenant_id); |
| | | if (data != null) |
| | | { |
| | | var list = data.Select(c => new ProjectItem_List_Dto() |
| | | { |
| | | pro_id=c.ProjectId, |
| | | pro_name=c.ProjectName |
| | | }).OrderBy(c => c.pro_name).ToList(); |
| | | return new JsonResult(list); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ææ¡£ç±»åæ¥è¯¢ææ¡£å表 |
| | | /// </summary> |
| | | /// <param name="search"></param> |
| | | /// <returns></returns> |
| | | public async Task<IActionResult> PostDocumentItemList(DocumentSearch search) |
| | | { |
| | | var data = await _docManageService.GetListAsync(c => c.is_del == false && c.doc_code == search.Code && c.tenant_code == search.TenantID); |
| | | if (search.class_id > 0) |
| | | { |
| | | data = data.Where(c => c.classification_id == search.class_id).ToList(); |
| | | } |
| | | |
| | | return new JsonResult(data.Select(c => new { name= c.doc_name, c.id }).ToList()); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public async Task<bool> CheckNameDuplicate(Document_Submit_Dto model) |
| | | { |
| | | var msg = false; |
| | | var ck =await _docManageService.GetFirstAsync(c=>c.doc_name==model.name && c.doc_code==model.code && c.classification_id==model.class_id && c.id!=model.id); |
| | | Expression<Func<Doc_Info, bool>> expression = t => true; |
| | | expression = expression.And(c => c.tenant_code == model.tenant_id && c.doc_name == model.name && c.doc_code == model.code ); |
| | | if (model.class_id.HasValue && model.class_id!=0) |
| | | { |
| | | expression = expression.And(t => t.classification_id == model.class_id); |
| | | } |
| | | if (model.project_id.HasValue && model.project_id != 0) |
| | | { |
| | | expression = expression.And(t => t.project_id == model.project_id); |
| | | } |
| | | |
| | | if (model.id > 0) |
| | | { |
| | | expression = expression.And(t => t.id != model.id); |
| | | } |
| | | var ck =await _docManageService.GetFirstAsync(expression); |
| | | if (ck != null) |
| | | { |
| | | msg = true; |
| | |
| | | { |
| | | Expression<Func<Doc_Info, bool>> expression = t => true; |
| | | |
| | | expression = expression.And(t => t.doc_code == page.Code && t.is_del==false); |
| | | expression = expression.And(t =>t.tenant_code==page.TenantID && t.doc_code == page.Code && t.is_del==false); |
| | | if (page.ClassCode.HasValue) |
| | | { |
| | | expression = expression.And(t => t.classification_id == page.ClassCode); |
| | |
| | | var data = await _docManageService.Context.Queryable<Doc_Info>() |
| | | .Includes(c => c.DocClassification) |
| | | .Includes(c=>c.DocOrganization) |
| | | .Includes(c=>c.DocProject) |
| | | .Where(expression) |
| | | .OrderByDescending(c=>c.id) |
| | | .ToPageListAsync(page.PageIndex, page.PageSize, total); |
| | | |
| | | if (data != null && total > 0) |
| | |
| | | doc_name = c.doc_name, |
| | | id = c.id, |
| | | org_id = c.org_id, |
| | | org_name = c.DocOrganization.UnitName, |
| | | org_name = c.DocOrganization?.UnitName, |
| | | project_id = c.project_id, |
| | | project_name = "", |
| | | project_name = c.DocProject?.ProjectName, |
| | | status = c.status |
| | | }).ToList(); |
| | | |
| | |
| | | } |
| | | |
| | | return new JsonResult(result); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ææ¡£å·æ¥è¯¢ |
| | | /// </summary> |
| | | /// <param name="search"></param> |
| | | /// <returns></returns> |
| | | public async Task<IActionResult> PostDocumentInfo(DocumentSearch search) |
| | | { |
| | | var data = await _docManageService.GetFirstAsync(c => c.is_del == false && c.id == search.ID && c.tenant_code==search.TenantID); |
| | | if (data != null) |
| | | { |
| | | var list = await _fileManageService.GetListAsync(c =>c.status==1 && c.doc_id == search.ID); |
| | | Document_Info_Dto info = new Document_Info_Dto(data, list.Select(c => new FileInfo_List_Dto(c)).OrderBy(c => c.sort).ToList()); |
| | | return new JsonResult(info); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var id =await _docManageService.InsertReturnIdentityAsync(doc); |
| | | if (id > 0) |
| | | { |
| | | if(info.files!=null&& info.files.Count > 0) |
| | | if(info.newfiles!=null&& info.newfiles.Count > 0) |
| | | { |
| | | foreach (var item in info.files) |
| | | foreach (var item in info.newfiles) |
| | | { |
| | | File_Info file = new File_Info(); |
| | | file.doc_id = id; |
| | |
| | | file.uptime = DateTime.Now; |
| | | file.up_userid = item.up_userid; |
| | | file.up_username = item.up_username; |
| | | file.sort = item.sort; |
| | | await _fileManageService.InsertAsync(file); |
| | | } |
| | | } |
| | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ç±»åæ¥è¯¢æ°æ® |
| | | /// </summary> |
| | | /// <param name="page"></param> |
| | | /// <returns></returns> |
| | | public async Task<IActionResult> PostItemList(DocClassificationSearch page) |
| | | { |
| | | var data = await _classificationService.GetListAsync(c => c.status == 1 && c.parent_code == page.Code); |
| | | return new JsonResult(data); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹æ°æ® |
| | | /// </summary> |
| | | /// <param name="info"></param> |
| | | /// <returns></returns> |
| | | public async Task<IActionResult> PostEdtInfo(Classification_Submit_Dto info) |
| | | public async Task<bool> PostEdtDocumentInfo(Document_Submit_Dto info) |
| | | { |
| | | var msg = false; |
| | | var model = await _classificationService.GetByIdAsync(info.id); |
| | | if (model != null) |
| | | { |
| | | model.add_time = DateTime.Now; |
| | | model.doc_classification = info.name; |
| | | model.status = info.status; |
| | | bool msg = false; |
| | | |
| | | msg = await _classificationService.UpdateAsync(model); |
| | | var doc= _docManageService.GetById(info.id); |
| | | if (info.tenant_id == doc.tenant_code && doc.is_del==false) |
| | | { |
| | | doc.add_time = DateTime.Now; |
| | | doc.classification_id = info.class_id; |
| | | doc.doc_name = info.name; |
| | | doc.org_id = info.org_id; |
| | | doc.status = info.status; |
| | | |
| | | if (await _docManageService.UpdateAsync(doc)) |
| | | { |
| | | //æ°æäº¤çæä»¶ |
| | | if (info.newfiles != null && info.newfiles.Count > 0) |
| | | { |
| | | foreach (var item in info.newfiles) |
| | | { |
| | | File_Info file = new File_Info(); |
| | | file.doc_id = doc.id; |
| | | file.filenewname = item.filenewname.Length > 40 ? item.filenewname.Substring(item.filenewname.Length - 40) : item.filenewname; |
| | | file.fileoldname = item.fileoldname.Length > 40 ? item.fileoldname.Substring(item.fileoldname.Length - 40) : item.fileoldname; |
| | | file.filepath = item.filepath; |
| | | file.fileservername = item.fileservername; |
| | | file.filesize = item.filesize; |
| | | file.filetype = item.filetype; |
| | | file.status = 1; |
| | | file.suffix = item.suffix; |
| | | file.uptime = DateTime.Now; |
| | | file.up_userid = item.up_userid; |
| | | file.up_username = item.up_username; |
| | | file.sort = item.sort; |
| | | await _fileManageService.InsertAsync(file); |
| | | } |
| | | } |
| | | |
| | | //ä¿®æ¹èµæºåç§°çæä»¶ |
| | | if (info.editfiles != null && info.editfiles.Count > 0) |
| | | { |
| | | foreach (var item in info.editfiles) |
| | | { |
| | | var file= _fileManageService.GetById(item.id); |
| | | if (file != null && file.doc_id==doc.id) |
| | | { |
| | | file.fileoldname = file.filenewname; |
| | | file.filenewname = item.filenewname.Length > 40 ? item.filenewname.Substring(item.filenewname.Length - 40) : item.filenewname; |
| | | file.uptime = DateTime.Now; |
| | | file.sort = item.sort; |
| | | await _fileManageService.UpdateAsync(file); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //å é¤èµæº |
| | | if (info.delfiles != null && info.delfiles.Count > 0) |
| | | { |
| | | foreach (var item in info.delfiles) |
| | | { |
| | | var file = _fileManageService.GetById(item); |
| | | if (file != null && file.doc_id == doc.id) |
| | | { |
| | | file.status = 0; |
| | | file.uptime = DateTime.Now; |
| | | await _fileManageService.UpdateAsync(file); |
| | | } |
| | | } |
| | | } |
| | | |
| | | msg = true; |
| | | } |
| | | } |
| | | |
| | | return new JsonResult(msg); |
| | | return msg; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å 餿°æ® |
| | | /// å é¤ææ¡£æ°æ® |
| | | /// </summary> |
| | | /// <param name="doc"></param> |
| | | /// <returns></returns> |
| | |
| | | return new JsonResult(msg); |
| | | } |
| | | |
| | | #region ææ¡£çæä»¶ |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ææ¡£å·æ¥è¯¢æä»¶æ°æ® |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public async Task<IActionResult> GetDocumentFilesList(int id) |
| | | { |
| | | var data = await _fileManageService.GetListAsync(c => c.status == 1 && c.doc_id == id); |
| | | var list = data.Select(c => new FileInfo_List_Dto(c)).OrderBy(c => c.sort).ToList(); |
| | | |
| | | return new JsonResult(list); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ä¸ç»©ç®¡ç |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®å页æ¡ä»¶æ¥è¯¢åé¡µæ°æ® |
| | | /// </summary> |
| | | /// <param name="page"></param> |
| | | /// <returns></returns> |
| | | public async Task<IActionResult> PostAchievementListPage(DocumentPageSearch page) |
| | | { |
| | | PageResult<Achievement_List_Dto> result = new PageResult<Achievement_List_Dto>(); |
| | | |
| | | try |
| | | { |
| | | Expression<Func<Doc_Achievement, bool>> expression = t => true; |
| | | |
| | | expression = expression.And(t => t.tenant_code == page.TenantID && t.status == 1); |
| | | if (page.ClassCode.HasValue) |
| | | { |
| | | expression = expression.And(t => t.classification_id == page.ClassCode); |
| | | } |
| | | if (!string.IsNullOrEmpty(page.Name)) |
| | | { |
| | | expression = expression.And(t => t.achievement_name.Contains(page.Name)); |
| | | } |
| | | |
| | | RefAsync<int> total = 0; |
| | | var data = await _achievementService.Context.Queryable<Doc_Achievement>() |
| | | .Includes(c => c.DocClassification) |
| | | .Includes(c => c.DocProject) |
| | | .Where(expression) |
| | | .OrderByDescending(c => c.id) |
| | | .ToPageListAsync(page.PageIndex, page.PageSize, total); |
| | | |
| | | if (data != null && total > 0) |
| | | { |
| | | result.Items = data.Select(c => new Achievement_List_Dto() |
| | | { |
| | | add_time = c.add_time, |
| | | class_id=c.classification_id, |
| | | class_name = c.DocClassification?.doc_classification, |
| | | id = c.id, |
| | | project_id = c.project_id, |
| | | project_name = c.DocProject?.ProjectName, |
| | | fkpz=c.fkpz_url, |
| | | hjzs=c.hjzs_url, |
| | | ht=c.ht_url, |
| | | yhpj=c.yhpj_url, |
| | | ysbg=c.ysbg_url, |
| | | zbtzs=c.zbtzs_url, |
| | | status = c.status |
| | | }).ToList(); |
| | | |
| | | } |
| | | result.PageIndex = page.PageIndex; |
| | | result.PageSize = page.PageSize; |
| | | result.TotalCount = total; |
| | | } |
| | | catch (Exception er) |
| | | { |
| | | Log.Error(er.Message, er); |
| | | } |
| | | |
| | | return new JsonResult(result); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ£æ¥éå¤ |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public async Task<bool> CheckDocAchievementDuplicate(Document_Submit_Dto model) |
| | | { |
| | | var msg = false; |
| | | var ck = await _achievementService.GetFirstAsync(c=>c.status==1 && c.tenant_code==model.tenant_id |
| | | && c.project_id==model.project_id && c.classification_id==c.classification_id); |
| | | if (ck != null) |
| | | { |
| | | msg = true; |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å æ°æ® |
| | | /// </summary> |
| | | /// <param name="info"></param> |
| | | /// <returns></returns> |
| | | public async Task<IActionResult> PostAddFilesInfo(Classification_Submit_Dto info) |
| | | public async Task<bool> PostAddDocAchievement(Achievement_Submit_Dto info) |
| | | { |
| | | Doc_Classification doc = new Doc_Classification(); |
| | | Doc_Achievement doc = new Doc_Achievement(); |
| | | doc.add_time = DateTime.Now; |
| | | doc.doc_classification = info.name; |
| | | doc.doc_classification_code = ""; |
| | | doc.is_system = false; |
| | | doc.parent_code = info.code; |
| | | doc.sort_id = 99; |
| | | doc.status = info.status; |
| | | doc.classification_id = info.class_id; |
| | | doc.project_id = info.project_id; |
| | | doc.achievement_name = info.name; |
| | | |
| | | doc.fkpz_url = info.fkpz; |
| | | doc.hjzs_url = info.hjzs; |
| | | doc.ht_url = info.ht; |
| | | doc.yhpj_url = info.yhpj; |
| | | doc.ysbg_url = info.ysbg; |
| | | doc.zbtzs_url = info.zbtzs; |
| | | |
| | | doc.status = 1; |
| | | doc.tenant_code = info.tenant_id; |
| | | |
| | | var msg = await _classificationService.InsertAsync(doc); |
| | | return new JsonResult(msg); |
| | | return await _achievementService.InsertAsync(doc); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹æ°æ® |
| | | /// </summary> |
| | | /// <param name="info"></param> |
| | | /// <returns></returns> |
| | | public async Task<IActionResult> PostEdtFileInfo(Classification_Submit_Dto info) |
| | | { |
| | | var msg = false; |
| | | var model = await _classificationService.GetByIdAsync(info.id); |
| | | if (model != null) |
| | | { |
| | | model.add_time = DateTime.Now; |
| | | model.doc_classification = info.name; |
| | | model.status = info.status; |
| | | |
| | | msg = await _classificationService.UpdateAsync(model); |
| | | } |
| | | |
| | | return new JsonResult(msg); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å 餿°æ® |
| | | /// </summary> |
| | | /// <param name="doc"></param> |
| | | /// <returns></returns> |
| | | public async Task<IActionResult> PostDelFileInfo(Document_Submit_Dto doc) |
| | | { |
| | | bool msg = false; |
| | | //åå é¤ |
| | | var model = await _docManageService.GetByIdAsync(doc.id); |
| | | if (model != null) |
| | | { |
| | | if (model.tenant_code == doc.tenant_id && !model.is_del) |
| | | { |
| | | model.is_del = true; |
| | | msg = await _docManageService.UpdateAsync(model); |
| | | } |
| | | } |
| | | return new JsonResult(msg); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | namespace DocumentServiceAPI.Application.DocManage.Dtos |
| | | { |
| | | /// <summary> |
| | | /// ä¸ç»©èµææäº¤ |
| | | /// </summary> |
| | | public class Achievement_Submit_Dto |
| | | { |
| | | public int id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç±»id |
| | | /// </summary> |
| | | public int class_id { get; set; } |
| | | public string name { get; set; } |
| | | |
| | | public int tenant_id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 项ç®åç§° |
| | | /// </summary> |
| | | public int project_id { get; set; } |
| | | |
| | | public string zbtzs { get; set; } |
| | | |
| | | public string ht { get; set; } |
| | | |
| | | public string ysbg { get; set; } |
| | | |
| | | public string fkpz { get; set; } |
| | | |
| | | public string yhpj { get; set; } |
| | | |
| | | public string hjzs { get; set; } |
| | | } |
| | | |
| | | public class Achievement_List_Dto |
| | | { |
| | | /// <summary> |
| | | /// æ·»å /æ´æ°æ¶é´ |
| | | /// </summary> |
| | | public DateTime add_time { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ |
| | | /// </summary> |
| | | public int status { get; set; } |
| | | |
| | | public int id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å½å±åç±»ï¼åç±»åï¼ |
| | | /// </summary> |
| | | public int? class_id { get; set; } |
| | | |
| | | public string class_name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public string doc_name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 项ç®id |
| | | /// </summary> |
| | | public int? project_id { get; set; } |
| | | |
| | | public string project_name { get; set; } |
| | | |
| | | public string zbtzs { get; set; } |
| | | |
| | | public string ht { get; set; } |
| | | |
| | | public string ysbg { get; set; } |
| | | |
| | | public string fkpz { get; set; } |
| | | |
| | | public string yhpj { get; set; } |
| | | |
| | | public string hjzs { get; set; } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public string code { get; set; } |
| | | |
| | | public int sort { get; set; } |
| | | public int status { get; set; } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// åç±»id |
| | | /// </summary> |
| | | public int class_id { get; set; } |
| | | public int? class_id { get; set; } |
| | | public string name { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// ææ åä½ |
| | | /// </summary> |
| | | public int? org_id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 项ç®åç§° |
| | | /// </summary> |
| | | public int? project_id { get; set; } |
| | | |
| | | public int status { get; set; } |
| | | |
| | | public List<DocumentFile_Submit_Dto> newfiles { get; set; } |
| | | |
| | | public List<DocumentFile_Submit_Dto> editfiles { get; set; } |
| | | |
| | | public List<int> delfiles { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢ææ¡£ä¿¡æ¯ |
| | | /// </summary> |
| | | public class Document_Info_Dto |
| | | { |
| | | public Document_Info_Dto() { } |
| | | |
| | | public Document_Info_Dto(Doc_Info doc,List<FileInfo_List_Dto> filelist) |
| | | { |
| | | this.id = doc.id; |
| | | if (doc.classification_id.HasValue) |
| | | { |
| | | this.class_id = doc.classification_id.Value; |
| | | } |
| | | this.name = doc.doc_name; |
| | | if (doc.org_id.HasValue) |
| | | { |
| | | this.org_id = doc.org_id.Value; |
| | | } |
| | | this.status = doc.status; |
| | | this.files = filelist; |
| | | } |
| | | |
| | | public int id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç±»id |
| | | /// </summary> |
| | | public int class_id { get; set; } |
| | | public string name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ææ åä½ |
| | | /// </summary> |
| | | public int org_id { get; set; } |
| | | |
| | | public int status { get; set; } |
| | | |
| | | public List<DocumentFile_Submit_Dto> files { get; set; } |
| | | public List<FileInfo_List_Dto> files { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public class DocumentFile_Submit_Dto |
| | | { |
| | | public int id { get; set; } |
| | | /// <summary> |
| | | /// åæä»¶åç§° |
| | | /// </summary> |
| | |
| | | |
| | | public string filepath { get; set; } |
| | | |
| | | public int sort { get; set; } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace DocumentServiceAPI.Application.DocManage.Dtos |
| | | { |
| | | public class Document_Lock_Dto |
| | | { |
| | | /// <summary> |
| | | /// ææ¡£id |
| | | /// </summary> |
| | | public int doc_id { get; set; } |
| | | |
| | | public int lock_user_id { get; set; } |
| | | |
| | | public string lock_user { get; set; } |
| | | |
| | | public DateTime lock_time { get; set; } |
| | | |
| | | public DateTime? release_time { get; set; } |
| | | public int tenant_id { get; set; } |
| | | |
| | | public int status { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æäº¤ä¿¡æ¯ |
| | | /// </summary> |
| | | public class DocLock_Submit_Dto |
| | | { |
| | | public int id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 人å |
| | | /// </summary> |
| | | public int userid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 人å |
| | | /// </summary> |
| | | public string username { get; set; } |
| | | |
| | | public int tenant_id { get; set; } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using DocumentServiceAPI.Model.cyDocumentModel; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace DocumentServiceAPI.Application.DocManage.Dtos |
| | | { |
| | | public class FileInfo_List_Dto |
| | | { |
| | | public FileInfo_List_Dto() |
| | | { |
| | | } |
| | | |
| | | public FileInfo_List_Dto(File_Info file) |
| | | { |
| | | this.id = file.id; |
| | | this.fileOldName = file.fileoldname; |
| | | this.fileNewName = file.filenewname; |
| | | this.filePath = file.filepath; |
| | | this.isChange = false; |
| | | this.filesize = file.filesize; |
| | | this.sort = file.sort; |
| | | this.suffix = file.suffix; |
| | | } |
| | | |
| | | public int id { get; set; } |
| | | public string fileOldName { get; set; } |
| | | public string fileNewName { get; set; } |
| | | public string filePath { get; set; } |
| | | public bool isChange { get; set; } |
| | | |
| | | public long filesize { get; set; } |
| | | public int sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ©å±å |
| | | /// </summary> |
| | | public string suffix { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | namespace DocumentServiceAPI.Application.DocManage.Dtos |
| | | { |
| | | /// <summary> |
| | | /// 项ç®åè¡¨ä¿¡æ¯ |
| | | /// </summary> |
| | | public class ProjectItem_List_Dto |
| | | { |
| | | /// <summary> |
| | | /// 项ç®id |
| | | /// </summary> |
| | | public int pro_id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 项ç®åç§° |
| | | /// </summary> |
| | | public string pro_name { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// é¡¹ç®æ¥è¯¢æ¡ä»¶ |
| | | /// </summary> |
| | | public class ProjectItemSearch |
| | | { |
| | | /// <summary> |
| | | /// ç§æ· |
| | | /// </summary> |
| | | public int tenant_id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | public int org_id { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | using DocumentServiceAPI.Core; |
| | | using DocumentServiceAPI.Model.cyDocumentModel; |
| | | |
| | | namespace DocumentServiceAPI.Application.DocManage.Services |
| | | { |
| | | public class DocAchievementService : BaseRepository<Doc_Achievement>, ITransient |
| | | { |
| | | } |
| | | } |
| | |
| | | |
| | | public class DocumentSearch : BaseSearch |
| | | { |
| | | |
| | | /// <summary> |
| | | /// å类代ç |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// äºçº§åç±» |
| | | /// </summary> |
| | | public int class_id { get; set; } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
New file |
| | |
| | | using DocumentServiceAPI.Core; |
| | | using DocumentServiceAPI.Model.cyDocumentModel; |
| | | |
| | | namespace DocumentServiceAPI.Application.DocManage.Services |
| | | { |
| | | /// <summary> |
| | | /// é¡¹ç®æ¥è¯¢ç±» |
| | | /// </summary> |
| | | public class ProjectManageService : BaseRepository<Document_ProjectInfo>, ITransient |
| | | { |
| | | } |
| | | } |
| | |
| | | using DocumentServiceAPI.Application.UserAndLogin.Services; |
| | | using DocumentServiceAPI.Application.UserAndLogin.ViewMode; |
| | | using DocumentServiceAPI.Model.cyDocumentModel; |
| | | using DocumentServiceAPI.Model.UserInfoModel; |
| | | using DocumentServiceAPI.Utility; |
| | | using Furion.DynamicApiController; |
| | | using Furion.JsonSerialization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using NetTaste; |
| | | using Newtonsoft.Json.Linq; |
| | | using Swashbuckle.AspNetCore.Annotations; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.IdentityModel.Tokens.Jwt; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | } |
| | | /// <summary> |
| | | /// ç»å½ 1 è¾å
¥åå·¥è´¦æ·æè
ç§æ·è´¦æ·ï¼2 éæ©ç§æ·è´¦æ·ï¼3 éæ©å
¬å¸ |
| | | /// å½å¯ç 为空æ¶ï¼å¸¦å
¥ç¨æ·ä¸å¿tokenå³å¯å®ç°ç»å½ |
| | | /// </summary> |
| | | /// <returns>ç»å½ä¿¡æ¯</returns> |
| | | [HttpPost("LogoIn")] |
| | | public async Task<RetLoginVM> LogoIn (LoginPsWordIN Parma) |
| | | public async Task<RetLoginVM> LogoIn ( LoginPsWordIN Parma) |
| | | { |
| | | bool needtoken=false; |
| | | if (Parma.TenantId==null) |
| | | //zctokæ ¡éªæåæ¯å¦æ å¿ |
| | | bool IsTokenPass=false; |
| | | |
| | | if(string.IsNullOrEmpty(Parma.PassWord)) |
| | | { |
| | | //å¦æè¿æ²¡ç¡®å®ç§æ·ID éè¦å
ç¡®å®ç§æ·ID |
| | | List<TenderVM>Tender = await _userService.GetUserTenderList(Parma.ITCode); |
| | | |
| | | switch (Tender.Count) |
| | | |
| | | var Request = App.HttpContext.Request; |
| | | string stoken = Request.Headers["Authorization"]; |
| | | if (stoken == null) |
| | | throw Oops.Oh("没æè¾å
¥å¯ç "); |
| | | stoken = stoken.Replace("Bearer ", ""); |
| | | |
| | | var isvale = _tokenService.CheckJwt(stoken, out SecurityToken securityToken); |
| | | JwtSecurityToken jwtToken = securityToken as JwtSecurityToken; |
| | | string itcode = jwtToken.Claims.FirstOrDefault(claim => claim.Type == "sub")?.Value; |
| | | if (isvale == false) |
| | | throw Oops.Oh("ç»å½ä¿¡æ¯åºé"); |
| | | if(Parma.ITCode!= itcode) |
| | | throw Oops.Oh("ç¨æ·åé误"); |
| | | IsTokenPass=true; |
| | | |
| | | } |
| | | |
| | | bool needtoken = false; |
| | | |
| | | if (Parma.TenantId == null) |
| | | { |
| | | case 0: |
| | | throw Oops.Oh($"è´¦æ·æè
å¯ç é误"); |
| | | case 1: |
| | | needtoken = await _userService.CheckPsw(Tender[0].TenderId, Tender[0].EmployeeID,Parma.PassWord); |
| | | |
| | | if(!needtoken) |
| | | //å¦æè¿æ²¡ç¡®å®ç§æ·ID éè¦å
ç¡®å®ç§æ·ID |
| | | List<TenderVM> Tender = await _userService.GetUserTenderList(Parma.ITCode); |
| | | |
| | | switch (Tender.Count) |
| | | { |
| | | case 0: |
| | | throw Oops.Oh($"è´¦æ·æè
å¯ç é误"); |
| | | |
| | | Parma.TenantId = Tender[0].TenderId; |
| | | Parma.employeeID = Tender[0].EmployeeID; |
| | | if (Parma.UnitID == null) |
| | | case 1: |
| | | if (!IsTokenPass) |
| | | { |
| | | |
| | | List<UnitVM> Units = await _userService.GetUserUnitList(Parma.TenantId ?? 0); |
| | | if (Units.Count == 0) |
| | | { |
| | | //没æå
¬å¸ |
| | | needtoken = true; |
| | | } |
| | | else if (Units.Count == 1) |
| | | { |
| | | Parma.UnitID = Units[0].UnitID; |
| | | needtoken = true; |
| | | } |
| | | else |
| | | { |
| | | //å
¶ä»éè¦ç¨æ·éæ©ç§æ· |
| | | return new RetLoginVM |
| | | { |
| | | NeedNext = true, |
| | | Units = Units, |
| | | needtoken = await _userService.CheckPsw(Tender[0].TenderId, Tender[0].EmployeeID, Parma.PassWord); |
| | | |
| | | }; |
| | | } |
| | | if (!needtoken) |
| | | throw Oops.Oh($"è´¦æ·æè
å¯ç é误"); |
| | | } |
| | | |
| | | break; |
| | | |
| | | default: |
| | | |
| | | |
| | | Parma.TenantId = Tender[0].TenderId; |
| | | Parma.employeeID = Tender[0].EmployeeID; |
| | | if (Parma.UnitID == null) |
| | | { |
| | | |
| | | List<UnitVM> Units = await _userService.GetUserUnitList(Parma.TenantId ?? 0); |
| | | if (Units.Count == 0) |
| | | { |
| | | //没æå
¬å¸ |
| | | needtoken = true; |
| | | } |
| | | else if (Units.Count == 1) |
| | | { |
| | | Parma.UnitID = Units[0].UnitID; |
| | | needtoken = true; |
| | | } |
| | | else |
| | | { |
| | | //å
¶ä»éè¦ç¨æ·éæ©ç§æ· |
| | | return new RetLoginVM |
| | | { |
| | | NeedNext = true, |
| | | Units = Units, |
| | | |
| | | }; |
| | | } |
| | | } |
| | | |
| | | break; |
| | | |
| | | default: |
| | | //å
¶ä»éè¦ç¨æ·éæ©ç§æ· |
| | | return new RetLoginVM |
| | | { |
| | | NeedNext = true, |
| | | Tenants = Tender, |
| | | |
| | | }; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | else if (Parma.UnitID == null) |
| | | { |
| | | |
| | | var Units = await _userService.GetUserUnitList(Parma.TenantId ?? 0); |
| | | if (Units.Count == 0) |
| | | { |
| | | //没æå
¬å¸ |
| | | needtoken = true; |
| | | } |
| | | else if (Units.Count == 1) { |
| | | Parma.UnitID = Units[0].UnitID; |
| | | needtoken = true; |
| | | } |
| | | else |
| | | { |
| | | //å
¶ä»éè¦ç¨æ·éæ©ç§æ· |
| | | return new RetLoginVM |
| | | { |
| | | NeedNext = true, |
| | | Tenants = Tender, |
| | | Units = Units, |
| | | |
| | | }; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | else if(Parma.UnitID==null) |
| | | { |
| | | |
| | | var Units = await _userService.GetUserUnitList(Parma.TenantId??0); |
| | | if(Units.Count==0) |
| | | if (needtoken || Parma.UnitID != null) |
| | | { |
| | | //没æå
¬å¸ |
| | | needtoken = true; |
| | | } |
| | | else if (Units.Count==1) { |
| | | Parma.UnitID= Units[0].UnitID; |
| | | needtoken = true; |
| | | } |
| | | else |
| | | |
| | | TenderVM Tender = (await _userService.GetUserTenderList(Parma.ITCode)).Where(x => x.TenderId == Parma.TenantId && x.EmployeeID == Parma.employeeID).SingleOrDefault(); |
| | | if (Tender == null) |
| | | { |
| | | throw Oops.Oh($"è´¦æ·å¯ç æè
ç§æ·éæ©é误"); |
| | | } |
| | | if (!IsTokenPass) |
| | | { |
| | | //å
¶ä»éè¦ç¨æ·éæ©ç§æ· |
| | | needtoken = await _userService.CheckPsw(Tender.TenderId, Tender.EmployeeID, Parma.PassWord); |
| | | |
| | | if (!needtoken) |
| | | throw Oops.Oh($"è´¦æ·æè
å¯ç é误"); |
| | | } |
| | | var token = _tokenService.CreateToken(new Model.JwtInfo |
| | | { |
| | | EID = Tender.EmployeeID, |
| | | LogInSource = Parma.Form, |
| | | TEID = Tender.TenderId, |
| | | UID = Parma.UnitID, |
| | | }); |
| | | return new RetLoginVM |
| | | { |
| | | NeedNext = true, |
| | | Units = Units, |
| | | NeedNext = false, |
| | | Token = token, |
| | | |
| | | }; |
| | | } |
| | | throw Oops.Oh($"åæ°é误"); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | if(needtoken|| Parma.UnitID!=null) |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æ¯ç¨æ·ç§æ·ï¼æè
æ¯åå·¥ |
| | | /// </summary> |
| | | /// <param name="ITCode">è´¦å·</param> |
| | | /// <returns> è¿åtrue 代表æ¯ï¼ falseä»£è¡¨ä¸æ¯</returns> |
| | | [HttpGet("IDIsEmployee")] |
| | | public async Task<bool> IDIsEmployee(string ITCode, [FromServices] ISqlSugarClient db) |
| | | { |
| | | var ad= ITCode.TryValidate(ValidationTypes.PhoneNumber); |
| | | if(!ad.IsValid) |
| | | { |
| | | |
| | | TenderVM Tender = (await _userService.GetUserTenderList(Parma.ITCode)).Where(x=>x.TenderId==Parma.TenantId&&x.EmployeeID==Parma.employeeID).SingleOrDefault(); |
| | | if(Tender==null) |
| | | { |
| | | throw Oops.Oh($"è´¦æ·å¯ç æè
ç§æ·éæ©é误"); |
| | | } |
| | | needtoken = await _userService.CheckPsw(Tender. TenderId, Tender.EmployeeID, Parma.PassWord); |
| | | |
| | | if (!needtoken) |
| | | throw Oops.Oh($"è´¦æ·æè
å¯ç é误"); |
| | | var token= _tokenService.CreateToken(new Model.JwtInfo |
| | | { |
| | | EID = Tender.EmployeeID, |
| | | LogInSource = Parma.Form, |
| | | TEID = Tender.TenderId, |
| | | UID = Parma.UnitID, |
| | | }); |
| | | return new RetLoginVM |
| | | { |
| | | NeedNext = false, |
| | | Token = token, |
| | | |
| | | }; |
| | | throw Oops.Oh("请è¾å
¥æ£ç¡®çè´¦å·"); |
| | | } |
| | | throw Oops.Oh($"åæ°é误"); |
| | | |
| | | |
| | | var count= await db.Queryable<TenantInfo>().Where(x=>x.ItCode==ITCode&&x.IsEn==true&&x.IsDel==false).WithCache(600).CountAsync(); |
| | | if (count > 0) |
| | | return true; |
| | | count=await db.Queryable<Document_EmployeeInfo>().Where(x=>x.UserName==ITCode).WithCache(600).CountAsync(); |
| | | if (count > 0) |
| | | return true; |
| | | return false; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// è·åå
¬å¸å表 |
| | | /// </summary> |
| | | /// <returns>ç»å½ä¿¡æ¯</returns> |
| | | public bool GetUnitList() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | /// <summary> |
| | | /// è·åå
¬å¸å表 |
| | | /// </summary> |
| | | /// <returns>ç»å½ä¿¡æ¯</returns> |
| | | public bool GetTenantInfoList() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | public string Get() |
| | | { |
| | | return $"Hello {nameof(Furion)}"; |
| | | } |
| | | } |
| | | } |
| | |
| | | using Furion.Authorization; |
| | | using Furion.DistributedIDGenerator; |
| | | using Furion.JsonSerialization; |
| | | using Furion.Logging.Extensions; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using NetTaste; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.IdentityModel.Tokens.Jwt; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Security.Claims; |
| | |
| | | /// <summary> |
| | | /// tokenæå¡ç±» |
| | | /// </summary> |
| | | public class TokenService: IScoped |
| | | public class TokenService : IScoped |
| | | { |
| | | /// <summary> |
| | | /// Tokenæ¯å¥ |
| | |
| | | private ISqlSugarClient _db; |
| | | private UserService _UserService; |
| | | private IRedisCacheService _RedisCase; |
| | | public TokenService(ISqlSugarClient db, UserService UserInfoService, IRedisCacheService RedisCase ) { |
| | | public TokenService(ISqlSugarClient db, UserService UserInfoService, IRedisCacheService RedisCase) { |
| | | _db = db; |
| | | _UserService = UserInfoService; |
| | | _RedisCase = RedisCase; |
| | |
| | | /// æ°å»ºä¸ä¸ªTOken |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string CreateToken(JwtInfo jwt) |
| | | public string CreateToken(JwtInfo jwt) |
| | | { |
| | | string TokenKey=TokenKeys+ getTokenKey(jwt); |
| | | string TokenKey = TokenKeys + getTokenKey(jwt); |
| | | IDictionary<string, object> propertyDictionary = new Dictionary<string, object>(); |
| | | |
| | | PropertyInfo[] properties = jwt.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance); |
| | |
| | | propertyDictionary.Add(propertyName.ToLower(), propertyValue); |
| | | } |
| | | var ID = IDGen.NextID(); |
| | | jwt.JID = ID; |
| | | var token= JWTEncryption.Encrypt(propertyDictionary, App.GetConfig<JWTSettingsOptions>("JWTSettings").ExpiredTime ?? 3600); |
| | | if(jwt.LogInSource==LogInFrom.PC) |
| | | _RedisCase.Add<string>(TokenKey, ID.ToString(), expireSeconds: (int )(App.GetConfig<JWTSettingsOptions>("JWTSettings").ExpiredTime??3600)); |
| | | jwt.JID = ID; |
| | | var token = JWTEncryption.Encrypt(propertyDictionary, App.GetConfig<JWTSettingsOptions>("JWTSettings").ExpiredTime ?? 3600); |
| | | if (jwt.LogInSource == LogInFrom.PC) |
| | | _RedisCase.Add<string>(TokenKey, ID.ToString(), expireSeconds: (int)(App.GetConfig<JWTSettingsOptions>("JWTSettings").ExpiredTime ?? 3600)); |
| | | return token; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¡éªtoken çæææ§ |
| | | /// </summary> |
| | | /// <param name="Token"> Tokenæ ¡éª</param> |
| | | /// <param name="validationParameters"></param> |
| | | /// <param name="securityToken"></param> |
| | | /// <returns></returns> |
| | | public bool CheckJwt(string Token, out SecurityToken? securityToken) |
| | | { |
| | | var configuration = App.Configuration; |
| | | // var value = configuration["xxx:xxx"]; |
| | | |
| | | string secretKey = configuration["ZCUserInfoJwtOP:SecurityKey"]; |
| | | if (secretKey == null) |
| | | { |
| | | "没æé
ç½®ç¨æ·ä¸å¿çå®å
¨ç§é¥ ZCUserInfoJwtOP:SecurityKey æ¾ä¸å°".LogInformation<TokenService>(); |
| | | throw Oops.Oh("é
ç½®é误ï¼è系管çå"); |
| | | } |
| | | |
| | | JwtSecurityTokenHandler tokenHandler = new JwtSecurityTokenHandler(); |
| | | //JwtSecurityToken jwt = tokenHandler.ReadJwtToken(Token); |
| | | |
| | | // éªè¯ JWT ç¾åå¹¶æ£æ¥æææ |
| | | TokenValidationParameters validationParameters = new TokenValidationParameters |
| | | { |
| | | ValidateIssuerSigningKey = true, |
| | | IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secretKey)), |
| | | ValidateIssuer = false, |
| | | ValidateAudience = false, |
| | | ClockSkew = TimeSpan.Zero // ç¦ç¨æ¶é´åç§»é |
| | | }; |
| | | try |
| | | { |
| | | ClaimsPrincipal claimsPrincipal = tokenHandler.ValidateToken(Token, validationParameters, out SecurityToken validatedToken); |
| | | |
| | | securityToken = validatedToken; |
| | | return true; |
| | | } |
| | | catch (SecurityTokenException) |
| | | { |
| | | securityToken=null; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | string TokenKey = TokenKeys + jwt.EID?.ToString() + jwt.UID?.ToString() + jwt.TEID?.ToString(); |
| | | return TokenKey; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | /// </summary> |
| | | public string LastUpdateName { get; set; } |
| | | /// <summary> |
| | | /// ç¨æ·å |
| | | /// </summary> |
| | | /// ç¨æ·å ææºå·éªè¯ å¿
å¡« |
| | | /// </summary> |
| | | [Required] |
| | | [RegularExpression("/^(?:(?:\\+|00)86)?1\\d{10}$/")] |
| | | public string UserName { get; set; } |
| | | /// <summary> |
| | | /// ç¨æ·å¯ç |
| | |
| | | "KeepVerb": true,//ä¿æçæ¬å·ä¸è´ |
| | | "LowercaseRoute": false |
| | | }, |
| | | |
| | | |
| | | "CorsAccessorSettings": { |
| | | "WithExposedHeaders": [ |
| | | "access-token", |
| | | "x-access-token", |
| | | "environment" |
| | | ] |
| | | }, |
| | | "ZCUserInfoJwtOP": { //zcç¨æ·ä¸å¿jwté
ç½® ç¨äºè§£æzcçtoken |
| | | |
| | | "Issuer": "http://localhost", |
| | | "Audience": "http://localhost", |
| | | "Expires": 10800, |
| | | "weixinExpires": 1296000, |
| | | "SecurityKey": "superSecretKey@345", |
| | | "RefreshTokenExpires": 86400, |
| | | "LoginPath": "/_Framework/Redirect401" |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | using DocumentServiceAPI.Enum; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | /// </summary> |
| | | public class Oder:BaseModel |
| | | { |
| | | /// <summary> |
| | | /// OderID |
| | | /// </summary> |
| | | [SugarColumn( IsPrimaryKey =true,IsIdentity =true)] |
| | | public int Id { get; set; } |
| | | /// <summary> |
| | | /// æä»½ |
| | | /// </summary> |
| | | [Display(Name = "æä»½")] |
| | | public int? MonthCount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ä¸ªæ° |
| | | /// </summary> |
| | | [Display(Name = "åä½ä¸ªæ°")] |
| | | public int? UnitCount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå·¥ |
| | | /// </summary> |
| | | [Display(Name = "å工个æ°")] |
| | | public int? EmployeeCount { get; set; } |
| | | /// <summary> |
| | | /// åä»· |
| | | /// </summary> |
| | | [Display(Name = "éé¢")] |
| | | public decimal Amount { get; set; } |
| | | /// <summary> |
| | | /// æ¯ä»æ¹å¼ |
| | | /// </summary> |
| | | public string? PayType { get; set; } |
| | | /// <summary> |
| | | /// æ¯ä»æ¶é´ |
| | | /// </summary> |
| | | public DateTime? PayTime { get; set; } |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | public string? Description { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ææºå·ç |
| | | /// </summary> |
| | | public string ITCode { get; set; } |
| | | /// <summary> |
| | | /// æ¿éç¨æ·ä¸å¿ID |
| | | /// </summary> |
| | | public Guid? ZcUserID { get; set; } |
| | | |
| | | |
| | | } |
| | |
| | | using DocumentServiceAPI.Enum; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | /// <summary> |
| | | /// ç§æ·æé |
| | | /// </summary> |
| | | public class TenantPermissions |
| | | public class TenantPermissions: BaseModel |
| | | { |
| | | /// <summary> |
| | | /// id |
| | | /// </summary> |
| | | [Display(Name = "id ")] |
| | | [SugarColumn(ColumnDescription = "id " ,IsPrimaryKey =true,IsIdentity =true)] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç§æ·ID |
| | | /// </summary> |
| | | [Display(Name = "ç§æ·ID ")] |
| | | [SugarColumn(ColumnDescription = "ç§æ·ID ")] |
| | | public int TenantId { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æå¤§ä¼ä¸ä¸ªæ° |
| | | /// </summary> |
| | | [Display(Name = "æå¤§ä¼ä¸ä¸ªæ° ")] |
| | | [SugarColumn(ColumnDescription = "æå¤§ä¼ä¸ä¸ªæ° ")] |
| | | public int UnitMaxCount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå¤§åå·¥æ°é |
| | | /// </summary> |
| | | [Display(Name = "æå¤§åå·¥æ°é ")] |
| | | [SugarColumn(ColumnDescription = "æå¤§åå·¥æ°é ")] |
| | | public int EmployeeMaxCount { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å°ææ¶é´ |
| | | /// </summary> |
| | | [Display(Name = "å°ææ¶é´ ")] |
| | | [SugarColumn(ColumnDescription = "å°ææ¶é´ ")] |
| | | public DateTime OverTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | [Display(Name = "æè¿° ")] |
| | | [SugarColumn(ColumnDescription = "æè¿° ")] |
| | | public string? Description { get; set; } |
| | | } |
| | | } |
| | |
| | | /// å¯ç |
| | | /// </summary> |
| | | [SugarColumn(Length =30)] |
| | | public string? PsW { get; set; } |
| | | public string? PsW { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¿éç¨æ·ä¸å¿ID |
| | | /// </summary> |
| | | public Guid? ZcUserID { get; set; } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace DocumentServiceAPI.Model.cyDocumentModel |
| | | { |
| | | ///<summary> |
| | | ///ä¸ç»©ç®¡ç |
| | | ///</summary> |
| | | [SugarTable("t_doc_achievement")] |
| | | public class Doc_Achievement : Doc_Base |
| | | { |
| | | public Doc_Achievement() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// id |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] |
| | | public int id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å½å±åç±»ï¼åç±»åï¼ |
| | | /// </summary> |
| | | public int? classification_id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 项ç®id |
| | | /// </summary> |
| | | public int? project_id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public string achievement_name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 䏿 éç¥ä¹¦ |
| | | /// </summary> |
| | | public string zbtzs_url { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå |
| | | /// </summary> |
| | | public string ht_url { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éªæ¶æ¥å |
| | | /// </summary> |
| | | public string ysbg_url { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 仿¬¾åè¯ |
| | | /// </summary> |
| | | public string fkpz_url { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨æ·è¯ä»· |
| | | /// </summary> |
| | | public string yhpj_url { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·å¥è¯ä¹¦ |
| | | /// </summary> |
| | | public string hjzs_url { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³èåç±» |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | [Navigate(NavigateType.OneToOne, nameof(classification_id))] |
| | | public Doc_Classification? DocClassification { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³èé¡¹ç® |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | [Navigate(NavigateType.OneToOne, nameof(project_id))] |
| | | public Document_ProjectInfo? DocProject { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Security.Principal; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace DocumentServiceAPI.Model.cyDocumentModel |
| | | { |
| | | ///<summary> |
| | | ///æä»¶ä¿¡æ¯ç±» |
| | | ///</summary> |
| | | [SugarTable("t_doc_file")] |
| | | public class File_Info |
| | | { |
| | | /// <summary> |
| | | /// id |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] |
| | | public int id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæä»¶åç§° |
| | | /// </summary> |
| | | public string fileoldname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°åç§° |
| | | /// </summary> |
| | | public string filenewname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¿åæä»¶åç§° |
| | | /// </summary> |
| | | public string fileservername { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä»¶å¤§å°ï¼åèï¼ |
| | | /// </summary> |
| | | public int filesize { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç¼å |
| | | /// </summary> |
| | | public string suffix { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°æ¶é´ |
| | | /// </summary> |
| | | public DateTime uptime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ææ¡£ID |
| | | /// </summary> |
| | | public int doc_id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ |
| | | /// </summary> |
| | | public int status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä»¶ç±»å |
| | | /// 001-èµè´¨ææ¡£ |
| | | /// 002-ä¸ç»©ææ¡£ |
| | | /// 003-æ¹æ¡ææ¡£ |
| | | /// 004-è´¢å¡ææ¡£ |
| | | /// 005-ææ¯ææ¡£ |
| | | /// 006-è®¾å¤ææ¡£ |
| | | /// 007-è´¨æ£ææ¡£ |
| | | /// 008-å¶åº¦æµç¨ææ¡£ |
| | | /// </summary> |
| | | public string filetype { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¼ 人å |
| | | /// </summary> |
| | | public int up_userid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¼ 人å |
| | | /// </summary> |
| | | public string up_username { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·¯å¾ |
| | | /// </summary> |
| | | public string filepath { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int sort { get; set; } |
| | | } |
| | | |
| | | } |
| | |
| | | [SugarColumn(IsIgnore = true)] |
| | | [Navigate(NavigateType.OneToOne, nameof(org_id))] |
| | | public Document_TenderUnit? DocOrganization { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³èé¡¹ç® |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | [Navigate(NavigateType.OneToOne, nameof(project_id))] |
| | | public Document_ProjectInfo? DocProject { get; set; } |
| | | } |
| | | |
| | | |
| | | ///<summary> |
| | | ///æä»¶ä¿¡æ¯ç±» |
| | | ///</summary> |
| | | [SugarTable("t_doc_file")] |
| | | public class File_Info |
| | | { |
| | | /// <summary> |
| | | /// id |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] |
| | | public int id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæä»¶åç§° |
| | | /// </summary> |
| | | public string fileoldname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°åç§° |
| | | /// </summary> |
| | | public string filenewname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¿åæä»¶åç§° |
| | | /// </summary> |
| | | public string fileservername { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä»¶å¤§å°ï¼åèï¼ |
| | | /// </summary> |
| | | public int filesize { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç¼å |
| | | /// </summary> |
| | | public string suffix { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°æ¶é´ |
| | | /// </summary> |
| | | public DateTime uptime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ææ¡£ID |
| | | /// </summary> |
| | | public int doc_id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ |
| | | /// </summary> |
| | | public int status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä»¶ç±»å |
| | | /// 001-èµè´¨ææ¡£ |
| | | /// 002-ä¸ç»©ææ¡£ |
| | | /// 003-æ¹æ¡ææ¡£ |
| | | /// 004-è´¢å¡ææ¡£ |
| | | /// 005-ææ¯ææ¡£ |
| | | /// 006-è®¾å¤ææ¡£ |
| | | /// 007-è´¨æ£ææ¡£ |
| | | /// 008-å¶åº¦æµç¨ææ¡£ |
| | | /// </summary> |
| | | public string filetype { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¼ 人å |
| | | /// </summary> |
| | | public int up_userid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¼ 人å |
| | | /// </summary> |
| | | public string up_username { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è·¯å¾ |
| | | /// </summary> |
| | | public string filepath { get; set; } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | public abstract class BaseSearch |
| | | { |
| | | public int ID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¬å¸ID |
| | | /// </summary> |
| | | public string CompanyID { get; set; } |
| | | public int CompanyID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç§æ·ID |
| | | /// </summary> |
| | | public string TenantID { get; set; } |
| | | public int TenantID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨æ·ID |
| | | /// </summary> |
| | | public string UserID { get; set; } |
| | | public int UserID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å§æ¥æ |
| | |
| | | using Furion.Authorization; |
| | | using Furion.DataEncryption; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | |
| | | namespace DocumentServiceAPI.Web.Entry |
| | |
| | | /// </summary> |
| | | public class AuthorizeHandler:AppAuthorizeHandler |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 请æ±ç®¡é |
| | | /// </summary> |
| | |
| | | public override Task<bool> PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext) |
| | | { |
| | | // æ¤å¤å·²ç»èªå¨éªè¯ Jwt tokençæææ§äºï¼æ éæå¨éªè¯ |
| | | |
| | | |
| | | // æ£æ¥æéï¼å¦ææ¹æ³æ¯å¼æ¥çå°±ä¸ç¨ Task.FromResult å
裹ï¼ç´æ¥ä½¿ç¨ async/await å³å¯ |
| | | return Task.FromResult(CheckAuthorzie(httpContext)); |
| | | } |
| | |
| | | <DebuggerFlavor>ProjectDebugger</DebuggerFlavor> |
| | | </PropertyGroup> |
| | | <PropertyGroup> |
| | | <ActiveDebugProfile>DocumentServiceAPI.Web.Entry</ActiveDebugProfile> |
| | | <ActiveDebugProfile>IIS Express</ActiveDebugProfile> |
| | | <NameOfLastUsedPublishProfile>E:\workdir\æ 书软件\ApiService\DocumentServiceAPI\DocumentServiceAPI.Web.Entry\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | </PropertyGroup> |
| | | </Project> |
| | |
| | | <Project> |
| | | <PropertyGroup> |
| | | <_PublishTargetUrl>D:\DocServiceAPI</_PublishTargetUrl> |
| | | <History>True|2023-08-03T03:23:49.7155745Z;True|2023-08-03T10:57:12.3860490+08:00;True|2023-08-02T17:29:04.8984231+08:00;True|2023-08-02T14:24:54.6607875+08:00;True|2023-08-02T13:12:00.3228236+08:00;</History> |
| | | <History>True|2023-08-25T08:28:37.8668025Z;True|2023-08-25T15:17:17.9212851+08:00;True|2023-08-25T11:21:18.2228201+08:00;True|2023-08-03T11:23:49.7155745+08:00;True|2023-08-03T10:57:12.3860490+08:00;True|2023-08-02T17:29:04.8984231+08:00;True|2023-08-02T14:24:54.6607875+08:00;True|2023-08-02T13:12:00.3228236+08:00;</History> |
| | | <LastFailureDetails /> |
| | | </PropertyGroup> |
| | | </Project> |
| | |
| | | "windowsAuthentication": false, |
| | | "anonymousAuthentication": true, |
| | | "iisExpress": { |
| | | "applicationUrl": "http://localhost:53785", |
| | | "sslPort": 44342 |
| | | "applicationUrl": "http://localhost:5001" |
| | | |
| | | } |
| | | }, |
| | | "profiles": { |
| | |
| | | |
| | | }, |
| | | |
| | | //æ¶æ¯éåé
ç½® 为äºç¬ç«é¨ç½²ï¼è¿éåç¬é
ç½® |
| | | "InitQRedisConfig": { |
| | | // 妿éç¨å®¹å¨åé¨ç½²Service è¦åæredisçæå¡åï¼å¦ååå°å |
| | | "ConnectionString": "127.0.0.1:6379,password=,connectTimeout=30000,responseTimeout=30000,abortConnect=false,connectRetry=1,syncTimeout=10000,DefaultDatabase=7" //redisæ°æ®åºè¿æ¥å符串 |
| | | |
| | | }, |
| | | |
| | | |
| | | "JWTSettings": { |
| | |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentServiceAPI.Services", "DocumentServiceAPI.Services\DocumentServiceAPI.Services.csproj", "{3369F102-ABB2-42A4-B216-58D530AEE8BE}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZcPayCore", "ZcPayCore\ZcPayCore.csproj", "{76BFAB65-B7AC-4534-A595-363551111129}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocumentServiceApi.InitQMessage", "DocumentServiceApi.InitQMessage\DocumentServiceApi.InitQMessage.csproj", "{0A75ECEE-91C9-4A87-8573-4298DF0B6CDE}" |
| | | EndProject |
| | | Global |
| | | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| | | Debug|Any CPU = Debug|Any CPU |
| | |
| | | {3369F102-ABB2-42A4-B216-58D530AEE8BE}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {3369F102-ABB2-42A4-B216-58D530AEE8BE}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {3369F102-ABB2-42A4-B216-58D530AEE8BE}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {76BFAB65-B7AC-4534-A595-363551111129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {76BFAB65-B7AC-4534-A595-363551111129}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {76BFAB65-B7AC-4534-A595-363551111129}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {76BFAB65-B7AC-4534-A595-363551111129}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {0A75ECEE-91C9-4A87-8573-4298DF0B6CDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {0A75ECEE-91C9-4A87-8573-4298DF0B6CDE}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {0A75ECEE-91C9-4A87-8573-4298DF0B6CDE}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {0A75ECEE-91C9-4A87-8573-4298DF0B6CDE}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | EndGlobalSection |
| | | GlobalSection(SolutionProperties) = preSolution |
| | | HideSolutionNode = FALSE |
New file |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <ImplicitUsings>enable</ImplicitUsings> |
| | | <Nullable>enable</Nullable> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="InitQ" Version="1.0.0.15" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\DocumentServiceAPI.Core\DocumentServiceAPI.Core.csproj" /> |
| | | <ProjectReference Include="..\DocumentServiceAPI.Model\DocumentServiceAPI.Model.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace DocumentServiceApi.InitQMessage |
| | | { |
| | | /// <summary> |
| | | /// æ¶æ¯ç»æå®ä¹ |
| | | /// </summary> |
| | | public static class INITQMessageDefine |
| | | { |
| | | /// <summary> |
| | | /// è´å
¥Oderæ¶æ¯ |
| | | /// </summary> |
| | | public const string InitTenantOder = "DocumentServiceAPI_OderINIT"; |
| | | |
| | | /// <summary> |
| | | /// æ¤å |
| | | /// </summary> |
| | | public const string DecTenantOder = "DocumentServiceAPI_DecOderINIT"; |
| | | } |
| | | } |
New file |
| | |
| | | using CSRedis; |
| | | using Furion; |
| | | using InitQ; |
| | | using Mapster; |
| | | using Microsoft.AspNetCore.Builder; |
| | | using Microsoft.AspNetCore.Hosting; |
| | | using Microsoft.Extensions.Configuration; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace DocumentServiceApi.InitQMessage |
| | | { |
| | | /// <summary> |
| | | /// 注å INITQ |
| | | /// </summary> |
| | | public class DocServiceApiStartup : AppStartup |
| | | { |
| | | public void ConfigureServices(IServiceCollection services) { |
| | | |
| | | |
| | | var readisconnectionstring = App.Configuration["InitQRedisConfig:ConnectionString"]; |
| | | if (readisconnectionstring != null) |
| | | //åå§åredié
ç½® |
| | | { |
| | | services.AddInitQ((op) => |
| | | { |
| | | op.SuspendTime = 500; |
| | | op.IntervalTime = 500; |
| | | op.ConnectionString = readisconnectionstring; |
| | | op.ListSubscribe = new List<Type>() { typeof(MessageReceive) }; |
| | | op.ShowLog = false; |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
| | | { |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using DocumentServiceAPI.Model.Oder; |
| | | using DocumentServiceAPI.Model.Permissions; |
| | | using DocumentServiceAPI.Model.UserInfoModel; |
| | | using Furion; |
| | | using Furion.JsonSerialization; |
| | | using Furion.Logging.Extensions; |
| | | using InitQ.Abstractions; |
| | | using InitQ.Attributes; |
| | | using Microsoft.Extensions.Options; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace DocumentServiceApi.InitQMessage |
| | | { |
| | | /// <summary> |
| | | /// æ¶æ¯æ¥æ¶å¤ç彿° |
| | | /// </summary> |
| | | public class MessageReceive: IRedisSubscribe |
| | | { |
| | | |
| | | |
| | | /// <summary> |
| | | /// åå§å订åå¤ç |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | | [Subscribe(INITQMessageDefine.InitTenantOder)] |
| | | private async Task InitTenantOder(string msg) |
| | | { |
| | | TenantOderInfo? obj = JSON.Deserialize<TenantOderInfo>(msg); |
| | | if(obj==null) |
| | | { |
| | | $"InitTenantOder åå§å msg 对象é误 ,msg为{msg}".LogInformation<MessageReceive>(); |
| | | return; |
| | | } |
| | | var _db= App.GetService<ISqlSugarClient>(); |
| | | |
| | | |
| | | Oder oder = new Oder() |
| | | { |
| | | Amount = obj.Amount, |
| | | CreatBy = "æ¶æ¯éå InitTenantOder", |
| | | CreatTime = DateTime.Now, |
| | | Description = obj.Description, |
| | | EmployeeCount = obj.EmployeeCount, |
| | | MonthCount = obj.MonthCount, |
| | | UnitCount = obj.UnitCount, |
| | | PayType = obj.PayType, |
| | | PayTime = obj.PayTime, |
| | | ZcUserID = obj.ZcUserID, |
| | | ITCode = obj.ITCode, |
| | | }; |
| | | TenantInfo? Tinfo = await _db.Queryable<TenantInfo>().Where(x=>x.ZcUserID==obj.ZcUserID).SingleAsync(); |
| | | if(Tinfo==null) |
| | | { |
| | | Tinfo = new TenantInfo |
| | | { |
| | | ZcUserID = obj.ZcUserID, |
| | | ItCode = obj.ITCode, |
| | | CreatBy = "æ¶æ¯éå InitTenantOder", |
| | | CreatTime = DateTime.Now, |
| | | Description = obj.Description, |
| | | Name = obj.ITCode, |
| | | PsW = obj.ITCode.Substring(obj.ITCode.Length - 4), |
| | | |
| | | |
| | | }; |
| | | TenantPermissions permissions = new TenantPermissions() |
| | | { |
| | | CreatBy = "æ¶æ¯éå InitTenantOder", |
| | | CreatTime = DateTime.Now, |
| | | Description = obj.Description, |
| | | EmployeeMaxCount = obj.EmployeeCount ?? 0, |
| | | UnitMaxCount = obj.UnitCount ?? 0, |
| | | OverTime = DateTime.Now.AddMonths(obj.MonthCount ?? 0), |
| | | |
| | | |
| | | |
| | | }; |
| | | try |
| | | { |
| | | await _db.AsTenant().BeginTranAsync(); |
| | | |
| | | var id= await _db.Insertable(Tinfo).ExecuteReturnIdentityAsync(); |
| | | permissions.TenantId = id; |
| | | await _db.Insertable(permissions).ExecuteCommandAsync (); |
| | | await _db.Insertable(oder).ExecuteCommandAsync(); |
| | | await _db.AsTenant().CommitTranAsync(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | await _db.AsTenant().RollbackTranAsync(); |
| | | $"æ°å»ºç§æ·å¤ç失败 msg:{msg},e:{e.ToString()} BYï¼æ¶æ¯éå InitTenantOder".LogInformation<MessageReceive>(); |
| | | return; |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | Tinfo.ItCode = obj.ITCode; |
| | | Tinfo.UpdataBy = "æ¶æ¯éå InitTenantOder"; |
| | | Tinfo.UpdataTime = DateTime.Now; |
| | | Tinfo.IsDel = false; |
| | | Tinfo.IsEn = true; |
| | | var tp= await _db.Queryable<TenantPermissions>().Where(x=>x.TenantId==Tinfo.Id).FirstAsync(); |
| | | |
| | | try |
| | | { |
| | | await _db.AsTenant().BeginTranAsync(); |
| | | if (Tinfo.ItCode != obj.ITCode) |
| | | { |
| | | |
| | | await _db.Updateable(Tinfo).ExecuteCommandAsync(); |
| | | }; |
| | | if (tp == null) |
| | | { |
| | | tp = new TenantPermissions() |
| | | { |
| | | CreatBy = "æ¶æ¯éå InitTenantOder", |
| | | CreatTime = DateTime.Now, |
| | | IsDel = false, |
| | | IsEn = true, |
| | | EmployeeMaxCount=obj.EmployeeCount??0, |
| | | UnitMaxCount=obj.UnitCount??0, |
| | | OverTime=DateTime.Now.AddMinutes(obj.MonthCount??0), |
| | | TenantId= Tinfo.Id, |
| | | |
| | | }; |
| | | await _db.Insertable(tp).ExecuteCommandAsync(); |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | tp.IsDel = false; |
| | | tp.IsEn = true; |
| | | tp.UnitMaxCount = obj.UnitCount ?? tp.UnitMaxCount; |
| | | tp.EmployeeMaxCount = obj.EmployeeCount ?? tp.EmployeeMaxCount; |
| | | tp.OverTime = tp.OverTime.AddMonths(obj.MonthCount??0); |
| | | tp.UpdataBy = "æ¶æ¯éå InitTenantOder"; |
| | | tp.UpdataTime = DateTime.Now; |
| | | |
| | | await _db.Updateable(tp).ExecuteCommandAsync(); |
| | | |
| | | } |
| | | await _db.Insertable(oder).ExecuteCommandAsync(); |
| | | await _db.AsTenant().CommitTranAsync(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | |
| | | await _db.AsTenant().RollbackTranAsync(); |
| | | $"ä¿®æ¹ç§æ·æé失败 msg:{msg},e:{e.ToString()} Byï¼æ¶æ¯éå InitTenantOder".LogInformation<MessageReceive>(); |
| | | return; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace DocumentServiceApi.InitQMessage |
| | | { |
| | | /// <summary> |
| | | /// è®¢åæ¶æ¯æ¨¡å详æ
|
| | | /// </summary> |
| | | internal class TenantOderInfo |
| | | { |
| | | /// <summary> |
| | | /// ææºå·ç |
| | | /// </summary> |
| | | public string ITCode { get; set; } |
| | | /// <summary> |
| | | /// æ¿éç¨æ·ä¸å¿ID |
| | | /// </summary> |
| | | public Guid? ZcUserID { get; set; } |
| | | /// <summary> |
| | | /// æä»½ |
| | | /// </summary> |
| | | [Display(Name = "æä»½")] |
| | | public int? MonthCount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ä¸ªæ° |
| | | /// </summary> |
| | | [Display(Name = "åä½ä¸ªæ°")] |
| | | public int? UnitCount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå·¥ |
| | | /// </summary> |
| | | [Display(Name = "å工个æ°")] |
| | | public int? EmployeeCount { get; set; } |
| | | /// <summary> |
| | | /// åä»· |
| | | /// </summary> |
| | | [Display(Name = "éé¢")] |
| | | public decimal Amount { get; set; } |
| | | /// <summary> |
| | | /// æ¯ä»æ¹å¼ |
| | | /// </summary> |
| | | public string? PayType { get; set; } |
| | | /// <summary> |
| | | /// æ¯ä»æ¶é´ |
| | | /// </summary> |
| | | public DateTime? PayTime { get; set; } |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | public string? Description { get; set; } |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using DocumentServiceAPI.Enum; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace ZcPayCore.Model |
| | | { |
| | | /// <summary> |
| | | /// éç¨è®¢åç±» |
| | | /// </summary> |
| | | [Display(Name = "éç¨è®¢åç±» ")] |
| | | [SugarTable(TableName = "Oder", TableDescription = "éç¨è®¢åç±»")] |
| | | public class Oder : BaseModel |
| | | { |
| | | /// <summary> |
| | | /// Id |
| | | /// </summary> |
| | | [Display(Name = "Id ")] |
| | | [SugarColumn(ColumnDescription = "Id ",IsIdentity =true,IsPrimaryKey =true)] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨æ·ID ä¹å¯è½æ¯ç§æ·ID |
| | | /// </summary> |
| | | [Display(Name = "ç¨æ·ID ä¹å¯è½æ¯ç§æ·ID ")] |
| | | [SugarColumn(ColumnDescription = "ç¨æ·ID ä¹å¯è½æ¯ç§æ·ID ")] |
| | | public int UserID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 订å详æ
æè¿° |
| | | /// </summary> |
| | | [Display(Name = "订å详æ
æè¿° ")] |
| | | [SugarColumn(ColumnDescription = "订å详æ
æè¿° ")] |
| | | public string? Description { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¶ä»åæ° |
| | | /// </summary> |
| | | [Display(Name = "å
¶ä»åæ° ")] |
| | | [SugarColumn(ColumnDescription = "å
¶ä»åæ° ")] |
| | | public string? Param { get; set; } |
| | | |
| | | /// <summary> |
| | | /// PropertyDecName |
| | | /// </summary> |
| | | [Display(Name = "PropertyDecName ")] |
| | | [SugarColumn(ColumnDescription = "PropertyDecName ")] |
| | | public int Property { get; set; } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <ImplicitUsings>enable</ImplicitUsings> |
| | | <Nullable>enable</Nullable> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Essensoft.Paylink.Alipay" Version="4.1.2" /> |
| | | <PackageReference Include="Essensoft.Paylink.Security" Version="4.1.2" /> |
| | | <PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.1.2" /> |
| | | <PackageReference Include="SqlSugarCore" Version="5.1.4.99" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\DocumentServiceAPI.Enum\DocumentServiceAPI.Enum.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
New file |
| | |
| | | |
| | | /****** Object: Table [dbo].[t_doc_classification] Script Date: 2023-08-08 11:35:47 ******/ |
| | | SET ANSI_NULLS ON |
| | | GO |
| | | |
| | | SET QUOTED_IDENTIFIER ON |
| | | GO |
| | | |
| | | CREATE TABLE [dbo].[t_doc_classification]( |
| | | [id] [int] IDENTITY(1,1) NOT NULL, |
| | | [doc_classification_code] [nvarchar](10) NULL, |
| | | [doc_classification] [nvarchar](30) NULL, |
| | | [parent_code] [nvarchar](10) NULL, |
| | | [is_system] [bit] NULL, |
| | | [tenant_code] [int] NULL, |
| | | [status] [int] NULL, |
| | | [sort_id] [int] NULL, |
| | | [add_time] [datetime] NULL, |
| | | CONSTRAINT [PK_t_doc_classification] PRIMARY KEY CLUSTERED |
| | | ( |
| | | [id] ASC |
| | | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] |
| | | ) ON [PRIMARY] |
| | | GO |
| | | SET IDENTITY_INSERT [dbo].[t_doc_classification] ON |
| | | GO |
| | | INSERT [dbo].[t_doc_classification] ([id], [doc_classification_code], [doc_classification], [parent_code], [is_system], [tenant_code], [status], [sort_id], [add_time]) VALUES (1, N'001', N'èµè´¨ç±»å«', N'00', 1, NULL, 1, 1, CAST(N'2023-08-01T16:21:39.003' AS DateTime)) |
| | | INSERT [dbo].[t_doc_classification] ([id], [doc_classification_code], [doc_classification], [parent_code], [is_system], [tenant_code], [status], [sort_id], [add_time]) VALUES (2, N'002', N'ä¸ç»©ç±»å«', N'00', 1, NULL, 1, 2, CAST(N'2023-08-02T16:22:39.003' AS DateTime)) |
| | | INSERT [dbo].[t_doc_classification] ([id], [doc_classification_code], [doc_classification], [parent_code], [is_system], [tenant_code], [status], [sort_id], [add_time]) VALUES (3, N'003', N'æ¹æ¡ç±»å«', N'00', 1, NULL, 1, 3, CAST(N'2023-08-03T16:23:39.003' AS DateTime)) |
| | | INSERT [dbo].[t_doc_classification] ([id], [doc_classification_code], [doc_classification], [parent_code], [is_system], [tenant_code], [status], [sort_id], [add_time]) VALUES (4, N'004', N'è´¢å¡ç±»å«', N'00', 1, NULL, 1, 4, CAST(N'2023-08-04T16:24:39.003' AS DateTime)) |
| | | INSERT [dbo].[t_doc_classification] ([id], [doc_classification_code], [doc_classification], [parent_code], [is_system], [tenant_code], [status], [sort_id], [add_time]) VALUES (5, N'005', N'ææ¯ç±»å«', N'00', 1, NULL, 1, 5, CAST(N'2023-08-05T16:25:39.003' AS DateTime)) |
| | | INSERT [dbo].[t_doc_classification] ([id], [doc_classification_code], [doc_classification], [parent_code], [is_system], [tenant_code], [status], [sort_id], [add_time]) VALUES (6, N'006', N'设å¤èµæ', N'00', 1, NULL, 1, 6, CAST(N'2023-08-06T16:25:39.003' AS DateTime)) |
| | | INSERT [dbo].[t_doc_classification] ([id], [doc_classification_code], [doc_classification], [parent_code], [is_system], [tenant_code], [status], [sort_id], [add_time]) VALUES (7, N'007', N'è´¨æ£æ¥å', N'00', 1, NULL, 1, 7, CAST(N'2023-08-07T16:25:39.003' AS DateTime)) |
| | | INSERT [dbo].[t_doc_classification] ([id], [doc_classification_code], [doc_classification], [parent_code], [is_system], [tenant_code], [status], [sort_id], [add_time]) VALUES (8, N'008', N'å¶åº¦æµç¨', N'00', 1, NULL, 1, 8, CAST(N'2023-08-08T16:25:39.003' AS DateTime)) |
| | | SET IDENTITY_INSERT [dbo].[t_doc_classification] OFF |
| | | GO |
| | | |
| | | |
| | | /****** Object: Table [dbo].[t_project_file] Script Date: 2023-08-09 14:21:20 ******/ |
| | | CREATE TABLE [dbo].[t_document]( |
| | | [id] [int] IDENTITY(1,1) NOT NULL, |
| | | [doc_code] [nvarchar](10) NOT NULL, |
| | | [classification_id] [int] NULL, |
| | | [doc_name] [nvarchar](50) NOT NULL, |
| | | [org_id] [int] NULL, |
| | | [project_id] [int] NULL, |
| | | [status] [int] NOT NULL, |
| | | [add_time] [datetime] NOT NULL, |
| | | [tenant_code] [int] NULL, |
| | | [is_del] [bit] NULL, |
| | | CONSTRAINT [PK_t_doc_credential] PRIMARY KEY CLUSTERED |
| | | ( |
| | | [id] ASC |
| | | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] |
| | | ) ON [PRIMARY] |
| | | GO |
| | | |
| | | |
| | | CREATE TABLE [dbo].[t_doc_file]( |
| | | [id] [int] IDENTITY(1,1) NOT NULL, |
| | | [fileoldname] [nvarchar](50) NULL, |
| | | [filenewname] [nvarchar](50) NULL, |
| | | [fileservername] [nvarchar](50) NULL, |
| | | [filesize] [int] NULL, |
| | | [suffix] [nvarchar](10) NULL, |
| | | [uptime] [datetime] NULL, |
| | | [doc_id] [int] NULL, |
| | | [status] [int] NULL, |
| | | [filetype] [nvarchar](10) NULL, |
| | | [up_userid] [int] NULL, |
| | | [up_username] [nvarchar](40) NULL, |
| | | [filepath] [nvarchar](150) NULL, |
| | | [sort] [int] NULL, |
| | | CONSTRAINT [PK_t_project_file] PRIMARY KEY CLUSTERED |
| | | ( |
| | | [id] ASC |
| | | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] |
| | | ) ON [PRIMARY] |
| | | GO |
| | | |
| | | |
| | | /****** Object: Table [dbo].[t_doc_achievement] Script Date: 2023-08-25 16:10:21 ******/ |
| | | SET ANSI_NULLS ON |
| | | GO |
| | | |
| | | SET QUOTED_IDENTIFIER ON |
| | | GO |
| | | |
| | | CREATE TABLE [dbo].[t_doc_achievement]( |
| | | [id] [int] IDENTITY(1,1) NOT NULL, |
| | | [classification_id] [int] NULL, |
| | | [project_id] [int] NULL, |
| | | [achievement_name] [nvarchar](50) NULL, |
| | | [zbtzs_url] [nvarchar](100) NULL, |
| | | [ht_url] [nvarchar](100) NULL, |
| | | [ysbg_url] [nvarchar](100) NULL, |
| | | [fkpz_url] [nvarchar](100) NULL, |
| | | [yhpj_url] [nvarchar](100) NULL, |
| | | [hjzs_url] [nvarchar](100) NULL, |
| | | [tenant_code] [int] NULL, |
| | | [add_time] [datetime] NULL, |
| | | [status] [int] NULL, |
| | | CONSTRAINT [PK_t_doc_achievement] PRIMARY KEY CLUSTERED |
| | | ( |
| | | [id] ASC |
| | | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] |
| | | ) ON [PRIMARY] |
| | | GO |