diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemController.cs index d188756af..c7496d2a1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemController.cs @@ -3,6 +3,11 @@ using System.Data; using Learun.Application.TwoDevelopment.AssetManagementSystem; using System.Web.Mvc; using System.Collections.Generic; +using ZipOneCode.ZipProvider; +using System.Linq; +using System.Drawing; +using System.IO; +using System; namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers { @@ -64,8 +69,31 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers return View(); } [HttpGet] - public ActionResult QRPrint() + public ActionResult QRPrint(string keyValue) { + var lists = new List(); + if (!string.IsNullOrEmpty(keyValue)) + { + foreach (var item in keyValue.Split(',')) + { + var entity = ass_AssetsInfoItemIBLL.GetAss_AssetsInfoItemEntity(item); + if (entity != null) + { + lists.Add(entity); + //读图片 + var d = QRCodeHelper.ProcessRequest(entity.AIId, @"~\Content\images\img1.png", "在册登记明细", entity.AIASSName + entity.AICode); + FileStream fs = new FileStream(d.resultImgPath, FileMode.Open, FileAccess.Read); + int length = (int)fs.Length; + byte[] image = new byte[length]; + fs.Read(image, 0, length); + var src = "data:image/jepg;base64," + Convert.ToBase64String(image); + entity.ImgBase64String = src; + fs.Close(); + } + } + } + ViewBag.Lists = lists; + return View(); } #endregion @@ -225,6 +253,88 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers ass_AssetsInfoItemIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + /// + /// 批量生成二维码 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult GetQRCode(string keyValue,Pagination pagination) + { + //TODO:文件夹压缩成zip + //var a = @"D:\Job\test\zip"; + //var aa = string.Format(@"{0}.zip", a); + //ZipHelper.CreateZip(a, aa); + + //TODO:生成带logo二维码 + //var resultImgPath = QRCodeHelper.ProcessRequest("demo", @"~\Content\images\img1.png"); + + //TODO:生成二维码,并打包 + //var dArr = new List(); + //for (int i = 0; i < 5; i++) + //{ + // var d = QRCodeHelper.ProcessRequest("demo" + i, @"~\Content\images\img1.png", "demo" + i); + // if (dArr.IndexOf(d) == -1) + // { + // dArr.Add(d); + // } + //} + //foreach (var item in dArr) + //{ + // ZipHelper.CreateZip(item, item + ".zip"); + //} + + //图片保存文件夹地址 + var dArr = new List(); + //明细数据 + var lists = new List(); + if (!string.IsNullOrEmpty(keyValue)) + { + foreach (var item in keyValue.Split(',')) + { + var entity = ass_AssetsInfoItemIBLL.GetAss_AssetsInfoItemEntity(item); + if (entity != null) + { + lists.Add(entity); + } + } + } + else + { + var data = ass_AssetsInfoItemIBLL.GetPageList(pagination, "{}"); + lists = data.ToList(); + } + + foreach (var item in lists) + { + var d = QRCodeHelper.ProcessRequest(item.AIId, @"~\Content\images\img1.png", "在册登记明细", item.AIASSName + item.AICode); + if (dArr.IndexOf(d.resultImgDirectoryPath) == -1) + { + dArr.Add(d.resultImgDirectoryPath); + } + } + foreach (var item in dArr) + { + ZipHelper.CreateZip(item, item + ".zip"); + } + + return Success("操作成功!二维码图片地址为:" + string.Join(",", dArr),dArr); + + } + /// + /// 批量生成二维码下载 + /// + /// + [HttpPost] + public void DownFile(string path) + { + path = string.Format(@"{0}{1}", path, ".zip"); + if (FileDownHelper.FileExists(path)) + { + FileDownHelper.DownLoadold(path, path.Substring(path.LastIndexOf(@"\") + 1)); + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.cshtml index 5012c51c7..8fbd51da3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.cshtml @@ -80,6 +80,9 @@  查看出入记录  查看使用人员记录 +
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.js index e7d36d6f0..f43014606 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/Index.js @@ -34,7 +34,7 @@ var bootstrap = function ($, learun) { nodeClick: function (item) { page.search({ AIASSClass: item.value }); } - }); + }); $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 400, 400); @@ -65,7 +65,8 @@ var bootstrap = function ($, learun) { height: 80 }); $("#lr_printBar").on('click', function () { - var keyValue = $('#gridtable').jfGridValue('AICode'); + //var keyValue = $('#gridtable').jfGridValue('AICode'); + var keyValue = $('#gridtable').jfGridValue('AIId'); var AName = $('#gridtable').jfGridValue('AIASSName'); if (learun.checkrow(keyValue)) { //todo 打印标签 @@ -86,7 +87,7 @@ var bootstrap = function ($, learun) { learun.layerForm({ id: 'formcardprint', title: '打印二维码', - url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/QRPrint?keyValue=' + keyValue+'&aName='+escape(AName), + url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/QRPrint?keyValue=' + keyValue + '&aName=' + escape(AName), width: 700, height: 300, btn: null, @@ -184,6 +185,39 @@ var bootstrap = function ($, learun) { } }); + //生成二维码 + $('#lr_getqrcode').on('click', function () { + //console.log($('#gridtable')[0].dfop.running); + var keyValue = $('#gridtable').jfGridValue('AIId'); + //js方法: + //if (keyValue != null && keyValue != "" && keyValue != undefined) { + // //console.log("有选中"); + //} else { + // //console.log("无选中"); + // if ($('#gridtable')[0].dfop.running.rowdata.length > 100) { + // learun.alert.warning("最多可以选择100条数据!"); + // return false; + // } + // var bb = new Array(); + // for (var i = 0; i < $('#gridtable')[0].dfop.running.rowdata.length; i++) { + // bb.push($('#gridtable')[0].dfop.running.rowdata[i]["jfgridRowData"]["AIId"]); + // } + // keyValue = bb.toString(); + //} + + learun.postForm(top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/GetQRCode', { keyValue: keyValue, pagination: $('#gridtable')[0].dfop.running.pageparam }, function (res) { + //console.log(res); + if (res && res.code == "200") { + //top.layer.alert("二维码图片地址为:" + res.data, { icon: 7, title: "提示", yes: function (index) { layer.close(index) } }); + + //下载文件 + for (var i = 0; i < res.data.length; i++) { + learun.download({ url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/DownFile', param: { path: res.data[i], __RequestVerificationToken: $.lrToken }, method: 'POST' }); + } + } + }); + }); + }, // 初始化列表 initGird: function () { @@ -377,7 +411,7 @@ var bootstrap = function ($, learun) { mainId: 'AIId', isMultiselect: true, isPage: true, - sidx: 'AICodeNum' + sidx: 'AICodeNum', }); page.search(); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/QRPrint.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/QRPrint.cshtml index 5a39f0077..65e547cb4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/QRPrint.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/QRPrint.cshtml @@ -1,4 +1,5 @@ - +@using Learun.Application.TwoDevelopment.AssetManagementSystem + @@ -23,38 +24,47 @@ -
-
-
-
+
+ @*
+
+
+
*@ + + @foreach (Ass_AssetsInfoItemEntity item in ViewBag.Lists) + { +
+ +
@item.AIASSName@item.AICode
+
+ } +
-
-
打印
- + function AddPrintContent3() { + $('#btnprint').css('display', 'none') + window.print(); + $('#btnprint').css('display', 'block') + } + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/img1.png b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/img1.png new file mode 100644 index 000000000..7db98a9ea Binary files /dev/null and b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/img1.png differ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj index 0725c9ac3..3aa9c4d4c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj @@ -192,6 +192,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AssetManagementSystem/Ass_AssetsInfoItemApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AssetManagementSystem/Ass_AssetsInfoItemApi.cs new file mode 100644 index 000000000..f15953ab3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AssetManagementSystem/Ass_AssetsInfoItemApi.cs @@ -0,0 +1,47 @@ +using Learun.Application.Base.SystemModule; +using Learun.Application.TwoDevelopment.AssetManagementSystem; +using Learun.Util; +using Nancy; +using System; +using System.Collections.Generic; +using System.IO; + +namespace Learun.Application.WebApi.Modules +{ + public class Ass_AssetsInfoItemApi : BaseApi + { + public Ass_AssetsInfoItemApi() + : base("/learun/adms/AssetManagementSystem/Ass_AssetsInfoItem") + { + Get["/getEntity"] = GetEntity; + } + private Ass_AssetsInfoItemIBLL ass_AssetsInfoItemIBLL = new Ass_AssetsInfoItemBLL(); + private Ass_AssetsInfoIBLL ass_AssetsInfoIBLL = new Ass_AssetsInfoBLL(); + + /// + /// 获取资产信息 + /// + /// + /// + public Response GetEntity(dynamic _) + { + var keyValue = this.GetReqData(); + var entity = ass_AssetsInfoItemIBLL.GetAss_AssetsInfoItemEntity(keyValue); + if (entity != null) + { + entity.ACode = ass_AssetsInfoIBLL.GetAss_AssetsInfoEntity(entity.AId)?.ACode; + } + else + { + entity = new Ass_AssetsInfoItemEntity(); + } + var result = new + { + Ass_AssetsInfoItemEntity = entity + }; + + return Success(result); + } + + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Website/Web.config b/Learun.Framework.Ultimate V7/Learun.Application.Website/Web.config index 65a84299c..77bf6316c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Website/Web.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Website/Web.config @@ -69,6 +69,18 @@ + + + + + + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Language/app.config b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Language/app.config index 739e9c9c8..899e22885 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Language/app.config +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Language/app.config @@ -6,6 +6,18 @@ + + + + + + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/app.config b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/app.config index 739e9c9c8..899e22885 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/app.config +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/app.config @@ -6,6 +6,18 @@ + + + + + + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemEntity.cs index 815eafba5..422d732af 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemEntity.cs @@ -389,6 +389,24 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem ///
[NotMapped] public string AIPhoto { get; set; } + + /// + /// 资产名称 + /// + [NotMapped] + public string AName { get; set; } + /// + /// 资产编号 + /// + [NotMapped] + public string ACode { get; set; } + + /// + /// 批量生成二维码base64字符串 + /// + [NotMapped] + public string ImgBase64String { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs index 71697fc80..5b7878189 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs @@ -274,7 +274,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem t.AContent "); strSql.Append(" FROM Ass_AssetsInfoItem a LEFT JOIN dbo.Ass_AssetsInfo t ON a.AId=t.AId "); - strSql.Append(" WHERE a.AIASSState<>2 "); + strSql.Append(" WHERE (a.AIASSState <> 2 or a.AIASSState is null) "); var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); @@ -313,24 +313,24 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem try { var result = this.BaseRepository().FindEntity(keyValue); - - var assInfo = this.BaseRepository().FindEntity(a => a.AName == result.AIASSName); - if (assInfo != null) + if (result != null) { - - if (assInfo.APhoto != null) + var assInfo = this.BaseRepository().FindEntity(a => a.AName == result.AIASSName); + if (assInfo != null) { - string photoPath = this.BaseRepository() - .FindEntity(a => a.F_FolderId == assInfo.APhoto)?.F_FilePath; - if (!string.IsNullOrEmpty(photoPath)) + if (assInfo.APhoto != null) { - photoPath = "/" + photoPath.Substring(photoPath.IndexOf("Resource")); - result.AIPhoto = photoPath; + string photoPath = this.BaseRepository() + .FindEntity(a => a.F_FolderId == assInfo.APhoto)?.F_FilePath; + if (!string.IsNullOrEmpty(photoPath)) + { + photoPath = "/" + photoPath.Substring(photoPath.IndexOf("Resource")); + result.AIPhoto = photoPath; + } } } } - return result; } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj index 6153a1661..dbaff6549 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj @@ -81,6 +81,9 @@ + + ..\..\..\packages\ThoughtWorks.QRCode.1.1.0\lib\ThoughtWorks.QRCode.dll + ..\..\..\packages\YUICompressor.NET.2.7.0.0\lib\NET20\Yahoo.Yui.Compressor.dll @@ -128,8 +131,10 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Web/QRCodeHelper.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Web/QRCodeHelper.cs new file mode 100644 index 000000000..fe0e3d00e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Web/QRCodeHelper.cs @@ -0,0 +1,133 @@ +using System; +using System.Web; +using ThoughtWorks.QRCode.Codec; +using ThoughtWorks.QRCode.Codec.Data; +using ThoughtWorks.QRCode.Codec.Util; +using System.IO; +using System.Text; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Collections.Generic; + +namespace Learun.Util +{ + public class QRCodeHelper + { + /// + /// 生成带图片的二维码 + /// + /// 二维码内容 + /// 二维码上logo图片地址 + /// + /// 二维码图片名称 + public static Result ProcessRequest(string qrcodeText,string imagePath,string savePath,string imageName) + { + //最终图片保存路径 + var resultImgPath = string.Empty; + //最终图片文件夹保存路径 + var resultImgDirectoryPath = string.Empty; + + if (!string.IsNullOrEmpty(qrcodeText)) + { + QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); + qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE;//设置编码模式(注意:BYTE能支持中文,ALPHA_NUMERIC扫描出来的都是数字) + qrCodeEncoder.QRCodeScale = 4;//设置编码测量度(值越⼤⽣成的⼆维码图⽚像素越⾼) + qrCodeEncoder.QRCodeVersion = 0;//设置编码版本(注意:设置为0主要是防止编码的字符串太长时发生错误) + qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.H;//设置编码错误纠正(有4个等级:H-L-M-Q) + System.Drawing.Image image = qrCodeEncoder.Encode(qrcodeText); + System.IO.MemoryStream MStream = new System.IO.MemoryStream(); + image.Save(MStream, System.Drawing.Imaging.ImageFormat.Png); + System.IO.MemoryStream MStream1 = new System.IO.MemoryStream(); + CombinImage(image, HttpContext.Current.Server.MapPath(imagePath)).Save(MStream1, System.Drawing.Imaging.ImageFormat.Png); + //保存图片到本地文件夹 + System.Drawing.Image img = System.Drawing.Image.FromStream(MStream1); + //string imgDirectoryPath = System.IO.Path.Combine(Config.GetValue("AnnexesFile"), "带logo图片二维码", DateTime.Now.ToString("yyyyMMddHHmm")); + string imgDirectoryPath = System.IO.Path.Combine(Config.GetValue("AnnexesFile"), "带logo图片二维码", savePath); + if (!System.IO.Directory.Exists(imgDirectoryPath)) + { + System.IO.Directory.CreateDirectory(imgDirectoryPath); + } + string imgPath = System.IO.Path.Combine(imgDirectoryPath, imageName + ".png"); + img.Save(imgPath, System.Drawing.Imaging.ImageFormat.Png); + resultImgDirectoryPath = imgDirectoryPath; + resultImgPath = imgPath; + + //HttpContext.Current.Response.ClearContent(); + //HttpContext.Current.Response.ContentType = "image/png"; + //HttpContext.Current.Response.BinaryWrite(MStream1.ToArray()); + //image.Dispose(); + MStream.Dispose(); + MStream1.Dispose(); + + } + //HttpContext.Current.Response.Flush(); + //HttpContext.Current.Response.End(); + + var result = new Result() + { + resultImgPath = resultImgPath, + resultImgDirectoryPath = resultImgDirectoryPath + }; + + return result; + } + /// + /// 调用此函数后使此两种图片合并,类似相册,有个 + /// 背景图,中间贴自己的目标图片 + /// + /// 粘贴的源图片 + /// 粘贴的目标图片 + public static Image CombinImage(Image imgBack, string destImg) + { + Image img = Image.FromFile(destImg); //照片图片 + if (img.Height != 30 || img.Width != 30) + { + img = KiResizeImage(img, 30, 30, 0); + } + Graphics g = Graphics.FromImage(imgBack); + g.DrawImage(imgBack, 0, 0, imgBack.Width, imgBack.Height); + //g.DrawImage(imgBack, 0, 0, 相框宽, 相框高); + //g.FillRectangle(System.Drawing.Brushes.White, imgBack.Width / 2 - img.Width / 2 - 1, imgBack.Width / 2 - img.Width / 2 - 1,1,1);//相片四周刷一层黑色边框 + //g.DrawImage(img, 照片与相框的左边距, 照片与相框的上边距, 照片宽, 照片高); + g.DrawImage(img, imgBack.Width / 2 - img.Width / 2, imgBack.Width / 2 - img.Width / 2, img.Width, img.Height); + GC.Collect(); + return imgBack; + } + /// + /// Resize图片 + /// + /// 原始Bitmap + /// 新的宽度 + /// 新的高度 + /// 保留着,暂时未用 + /// 处理以后的图片 + public static Image KiResizeImage(Image bmp, int newW, int newH, int Mode) + { + try + { + Image b = new Bitmap(newW, newH); + Graphics g = Graphics.FromImage(b); + // 插值算法的质量 + g.InterpolationMode = InterpolationMode.HighQualityBicubic; + g.DrawImage(bmp, new Rectangle(0, 0, newW, newH), new Rectangle(0, 0, bmp.Width, bmp.Height), GraphicsUnit.Pixel); + g.Dispose(); + return b; + } + catch + { + return null; + } + } + public bool IsReusable + { + get + { + return false; + } + } + public class Result { + public string resultImgPath { get; set; } + public string resultImgDirectoryPath { get; set; } + } + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Web/ZipHelper.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Web/ZipHelper.cs new file mode 100644 index 000000000..e7f8be7b2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Web/ZipHelper.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using System.Diagnostics; +using ICSharpCode.SharpZipLib; +using ICSharpCode.SharpZipLib.Zip; +using ICSharpCode.SharpZipLib.Checksums; +using ICSharpCode.SharpZipLib.Core; + +namespace ZipOneCode.ZipProvider +{ + public class ZipHelper + { + /// + /// 压缩文件 + /// + /// + /// + public static void CreateZip(string sourceFilePath, string destinationZipFilePath) + { + if (sourceFilePath[sourceFilePath.Length - 1] != System.IO.Path.DirectorySeparatorChar) + sourceFilePath += System.IO.Path.DirectorySeparatorChar; + + ZipOutputStream zipStream = new ZipOutputStream(File.Create(destinationZipFilePath)); + zipStream.SetLevel(6); // 压缩级别 0-9 + CreateZipFiles(sourceFilePath, zipStream, sourceFilePath); + + zipStream.Finish(); + zipStream.Close(); + } + + /// + /// 递归压缩文件 + /// + /// 待压缩的文件或文件夹路径 + /// 打包结果的zip文件路径(类似 D:\WorkSpace\a.zip),全路径包括文件名和.zip扩展名 + /// + private static void CreateZipFiles(string sourceFilePath, ZipOutputStream zipStream, string staticFile) + { + Crc32 crc = new Crc32(); + string[] filesArray = Directory.GetFileSystemEntries(sourceFilePath); + foreach (string file in filesArray) + { + if (Directory.Exists(file)) //如果当前是文件夹,递归 + { + CreateZipFiles(file, zipStream, staticFile); + } + + else //如果是文件,开始压缩 + { + FileStream fileStream = File.OpenRead(file); + + byte[] buffer = new byte[fileStream.Length]; + fileStream.Read(buffer, 0, buffer.Length); + string tempFile = file.Substring(staticFile.LastIndexOf("\\") + 1); + ZipEntry entry = new ZipEntry(tempFile); + + entry.DateTime = DateTime.Now; + entry.Size = fileStream.Length; + fileStream.Close(); + crc.Reset(); + crc.Update(buffer); + entry.Crc = crc.Value; + zipStream.PutNextEntry(entry); + + zipStream.Write(buffer, 0, buffer.Length); + } + } + } + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/packages.config b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/packages.config index 30bb78e68..e4fa9f5c3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/packages.config +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/packages.config @@ -7,5 +7,6 @@ + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/.hbuilderx/launch.json b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/.hbuilderx/launch.json index c9abd4b1d..582561b0c 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/.hbuilderx/launch.json +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/.hbuilderx/launch.json @@ -2,10 +2,15 @@ // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 "version": "0.0", "configurations": [{ - "type": "uniCloud", - "default": { - "launchtype": "local" - } - } + "app-plus" : + { + "launchtype" : "local" + }, + "default" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } ] } diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js index f44498f0f..4f26dbe40 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js @@ -16,11 +16,11 @@ export default { // "http://localhost:8088/" // ], "apiHost": [ - "http://localhost:8088/" + "http://192.168.10.45:8088/" ], // 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 "devAccount": [ - { username: "system", password: "123456" } + { username: "system", password: "www.qj.com" } ], //是否分布式部署 指WebApi与Web不在一台服务器 "isDistributed":true, diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json index 7d4284706..ca770f873 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json @@ -1074,6 +1074,19 @@ "style": { "navigationBarTitleText": "详情" } + }, + //扫描资产二维码 + { + "path": "pages/AssetManagementSystem/ScanAssetQRCode/list", + "style": { + "navigationBarTitleText": "扫描资产二维码" + } + }, + { + "path": "pages/AssetManagementSystem/ScanAssetQRCode/from", + "style": { + "navigationBarTitleText": "资产详情" + } } diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AssetManagementSystem/ScanAssetQRCode/from.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AssetManagementSystem/ScanAssetQRCode/from.vue new file mode 100644 index 000000000..6012d11be --- /dev/null +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AssetManagementSystem/ScanAssetQRCode/from.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AssetManagementSystem/ScanAssetQRCode/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AssetManagementSystem/ScanAssetQRCode/list.vue new file mode 100644 index 000000000..ad9ee3b79 --- /dev/null +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AssetManagementSystem/ScanAssetQRCode/list.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/Learun.Framework.Ultimate V7/Quanjiang.DigitalSchool.Aspose/Quanjiang.DigitalSchool.Aspose.csproj b/Learun.Framework.Ultimate V7/Quanjiang.DigitalSchool.Aspose/Quanjiang.DigitalSchool.Aspose.csproj new file mode 100644 index 000000000..2053b563a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Quanjiang.DigitalSchool.Aspose/Quanjiang.DigitalSchool.Aspose.csproj @@ -0,0 +1,68 @@ + + + + + Debug + AnyCPU + {767D20C4-B983-4940-BF97-74D5479CA558} + Library + Properties + Quanjiang.DigitalSchool.AsposeHelper + Quanjiang.DigitalSchool.AsposeHelper + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Aspose.Cells.20.10.0\lib\net40\Aspose.Cells.dll + + + ..\packages\Aspose.Words.20.10.0\lib\net461\Aspose.Words.dll + + + ..\packages\Aspose.Words.20.10.0\lib\net461\Aspose.Words.Pdf2Word.dll + + + + + + + + + + + + + + + + + + + + + + {CF8AE293-88AB-436C-9720-A8386BA5D7B7} + Learun.Util + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Quanjiang.DigitalSchool.Aspose/app.config b/Learun.Framework.Ultimate V7/Quanjiang.DigitalSchool.Aspose/app.config new file mode 100644 index 000000000..e936cc132 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Quanjiang.DigitalSchool.Aspose/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/packages/ThoughtWorks.QRCode.1.1.0/.signature.p7s b/Learun.Framework.Ultimate V7/packages/ThoughtWorks.QRCode.1.1.0/.signature.p7s new file mode 100644 index 000000000..5920afe5e Binary files /dev/null and b/Learun.Framework.Ultimate V7/packages/ThoughtWorks.QRCode.1.1.0/.signature.p7s differ diff --git a/Learun.Framework.Ultimate V7/packages/ThoughtWorks.QRCode.1.1.0/ThoughtWorks.QRCode.1.1.0.nupkg b/Learun.Framework.Ultimate V7/packages/ThoughtWorks.QRCode.1.1.0/ThoughtWorks.QRCode.1.1.0.nupkg new file mode 100644 index 000000000..c7891604b Binary files /dev/null and b/Learun.Framework.Ultimate V7/packages/ThoughtWorks.QRCode.1.1.0/ThoughtWorks.QRCode.1.1.0.nupkg differ diff --git a/Learun.Framework.Ultimate V7/packages/ThoughtWorks.QRCode.1.1.0/lib/ThoughtWorks.QRCode.dll b/Learun.Framework.Ultimate V7/packages/ThoughtWorks.QRCode.1.1.0/lib/ThoughtWorks.QRCode.dll new file mode 100644 index 000000000..45b1b5267 Binary files /dev/null and b/Learun.Framework.Ultimate V7/packages/ThoughtWorks.QRCode.1.1.0/lib/ThoughtWorks.QRCode.dll differ