From 38aff235316e8d49bf3558bfaa44f4c6ab2b78a4 Mon Sep 17 00:00:00 2001 From: liaoxujun@qq.com <liaoxujun@qq.com> Date: 星期五, 15 九月 2023 17:26:58 +0800 Subject: [PATCH] 修改权限体系,增加标书信息管理权限分离,分为标书信息管理平台使用,和标书制作管理使用,修改权限表,订单表 --- DocumentFile.Service/Controllers/DocumentController.cs | 76 ++++++++++++++++++++++++++++++++----- 1 files changed, 65 insertions(+), 11 deletions(-) diff --git a/DocumentFile.Service/Controllers/DocumentController.cs b/DocumentFile.Service/Controllers/DocumentController.cs index 1046bff..ad042ab 100644 --- a/DocumentFile.Service/Controllers/DocumentController.cs +++ b/DocumentFile.Service/Controllers/DocumentController.cs @@ -1,6 +1,4 @@ -锘縰sing Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using System.ComponentModel.DataAnnotations; +锘縰sing Microsoft.AspNetCore.Mvc; namespace DocumentFile.Service.Controllers { @@ -19,19 +17,40 @@ _uploadService = uploadService; } + ///// <summary> + ///// 涓婁紶鏂囦欢妯℃澘锛坉oc銆乨ocx锛� + ///// </summary> + ///// <param name="code">绉熸埛鍞竴鏍囪瘑code</param> + ///// <param name="formFile">鏂囦欢</param> + ///// <returns></returns> + //[HttpPost] + //public async Task<IActionResult> UploadDocTemplate([FromForm]string code,IFormFile formFile) + //{ + // ReturnMsg msg = new ReturnMsg(); + // if(formFile.Length>0) + // { + // msg = await this._uploadService.HandleUploadWordFile(formFile,code,""); + // } + // else + // { + // msg.error = "璇蜂笂浼犳枃浠�"; + // } + + // return new JsonResult(msg); + //} + /// <summary> - /// 涓婁紶鏂囦欢妯℃澘锛坉oc銆乨ocx锛� + /// 涓婁紶鏂囦欢锛坉oc銆乨ocx锛� + /// 鏈湴鎸囧畾璺緞 /// </summary> - /// <param name="code">绉熸埛鍞竴鏍囪瘑code</param> - /// <param name="formFile">鏂囦欢</param> /// <returns></returns> [HttpPost] - public async Task<IActionResult> UploadDocTemplate([FromForm]string code,IFormFile formFile) + public async Task<IActionResult> UploadDocWithPath([FromForm]string code, [FromForm] string path, IFormFile formFile) { ReturnMsg msg = new ReturnMsg(); - if(formFile.Length>0) + if (formFile.Length > 0) { - msg = await this._uploadService.HandleUploadWordFile(formFile,code,""); + msg = await this._uploadService.HandleUploadWordFile(formFile,code,path); } else { @@ -46,12 +65,12 @@ /// </summary> /// <returns></returns> [HttpPost] - public async Task<IActionResult> UploadDocInstance([FromForm] string code, [FromForm] string path, IFormFile formFile) + public async Task<IActionResult> UploadDocInstance([FromForm] string code, IFormFile formFile) { ReturnMsg msg = new ReturnMsg(); if (formFile.Length > 0) { - msg = await this._uploadService.HandleUploadWordFile(formFile, code,path); + msg = await this._uploadService.HandleUploadWordFile(formFile, code, ""); } else { @@ -82,6 +101,41 @@ } /// <summary> + /// 鍒犻櫎鏂囦欢 + /// </summary> + /// <param name="delurl"></param> + /// <returns></returns> + [HttpPost] + public IActionResult DeleteFile([FromForm] string[] delurl) + { + ReturnMsg msg = new ReturnMsg(); + try + { + if(delurl!=null && delurl.Length > 0) + { + var dir = AppDomain.CurrentDomain.BaseDirectory; + foreach (var item in delurl) + { + if (!string.IsNullOrEmpty(item)) + { + var path = dir + item; + if (System.IO.File.Exists(path)) + { + System.IO.File.Delete(path); + } + } + } + msg.code = 1; + } + } + catch (Exception ex) + { + NLogProvider.GetInstance().Error(ex); + } + return new JsonResult(msg); + } + + /// <summary> /// 涓嬭浇鏂囦欢 /// </summary> /// <param name="url"></param> -- Gitblit v1.9.1